summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2002-09-24 20:37:56 +0000
committerKeith Seitz <keiths@redhat.com>2002-09-24 20:37:56 +0000
commitc709ff98b014a66934671dcece6d2b26d5101b1a (patch)
tree2cae57d3bed8d1c06b191a3d847ed0bfd0f48676
parent07296cfdb73a6d68eb6b921fd25c7c9dacdf1eec (diff)
downloadgdb-c709ff98b014a66934671dcece6d2b26d5101b1a.tar.gz
import tk 8.4.0TK_8_4_0
-rw-r--r--tk/ChangeLog6149
-rw-r--r--tk/README26
-rw-r--r--tk/changes386
-rw-r--r--tk/compat/limits.h1
-rw-r--r--tk/compat/stdlib.h1
-rw-r--r--tk/compat/unistd.h1
-rw-r--r--tk/doc/3DBorder.33
-rw-r--r--tk/doc/AddOption.34
-rw-r--r--tk/doc/BindTable.35
-rw-r--r--tk/doc/CanvPsY.311
-rw-r--r--tk/doc/CanvTkwin.33
-rw-r--r--tk/doc/CanvTxtInfo.31
-rw-r--r--tk/doc/Clipboard.31
-rw-r--r--tk/doc/ClrSelect.31
-rw-r--r--tk/doc/ConfigWidg.316
-rw-r--r--tk/doc/ConfigWind.31
-rw-r--r--tk/doc/CoordToWin.31
-rw-r--r--tk/doc/CrtCmHdlr.369
-rw-r--r--tk/doc/CrtErrHdlr.31
-rw-r--r--tk/doc/CrtGenHdlr.31
-rw-r--r--tk/doc/CrtImgType.37
-rw-r--r--tk/doc/CrtItemType.34
-rw-r--r--tk/doc/CrtPhImgFmt.32
-rw-r--r--tk/doc/CrtSelHdlr.31
-rw-r--r--tk/doc/CrtWindow.320
-rw-r--r--tk/doc/DeleteImg.33
-rw-r--r--tk/doc/DrawFocHlt.32
-rw-r--r--tk/doc/EventHndlr.31
-rw-r--r--tk/doc/FindPhoto.339
-rw-r--r--tk/doc/FontId.35
-rw-r--r--tk/doc/FreeXId.31
-rw-r--r--tk/doc/GeomReq.339
-rw-r--r--tk/doc/GetAnchor.35
-rw-r--r--tk/doc/GetBitmap.37
-rw-r--r--tk/doc/GetCapStyl.35
-rw-r--r--tk/doc/GetClrmap.33
-rw-r--r--tk/doc/GetColor.33
-rw-r--r--tk/doc/GetCursor.37
-rw-r--r--tk/doc/GetDash.31
-rw-r--r--tk/doc/GetFont.38
-rw-r--r--tk/doc/GetGC.31
-rw-r--r--tk/doc/GetHWND.32
-rw-r--r--tk/doc/GetImage.33
-rw-r--r--tk/doc/GetJoinStl.35
-rw-r--r--tk/doc/GetJustify.35
-rw-r--r--tk/doc/GetOption.35
-rw-r--r--tk/doc/GetPixels.33
-rw-r--r--tk/doc/GetPixmap.31
-rw-r--r--tk/doc/GetRelief.35
-rw-r--r--tk/doc/GetRootCrd.31
-rw-r--r--tk/doc/GetScroll.34
-rw-r--r--tk/doc/GetSelect.31
-rw-r--r--tk/doc/GetUid.31
-rw-r--r--tk/doc/GetVRoot.31
-rw-r--r--tk/doc/GetVisual.33
-rw-r--r--tk/doc/HWNDToWindow.32
-rw-r--r--tk/doc/HandleEvent.31
-rw-r--r--tk/doc/IdToWindow.31
-rw-r--r--tk/doc/ImgChanged.31
-rw-r--r--tk/doc/InternAtom.35
-rw-r--r--tk/doc/MainLoop.31
-rw-r--r--tk/doc/MainWin.32
-rw-r--r--tk/doc/MaintGeom.34
-rw-r--r--tk/doc/ManageGeom.31
-rw-r--r--tk/doc/MapWindow.31
-rw-r--r--tk/doc/MeasureChar.31
-rw-r--r--tk/doc/MoveToplev.31
-rw-r--r--tk/doc/Name.33
-rw-r--r--tk/doc/NameOfImg.33
-rw-r--r--tk/doc/OwnSelect.31
-rw-r--r--tk/doc/ParseArgv.33
-rw-r--r--tk/doc/QWinEvent.326
-rw-r--r--tk/doc/Restack.31
-rw-r--r--tk/doc/RestrictEv.31
-rw-r--r--tk/doc/SetAppName.35
-rw-r--r--tk/doc/SetCaret.340
-rw-r--r--tk/doc/SetClass.31
-rw-r--r--tk/doc/SetClassProcs.391
-rw-r--r--tk/doc/SetGrid.31
-rw-r--r--tk/doc/SetOptions.3166
-rw-r--r--tk/doc/SetVisual.31
-rw-r--r--tk/doc/StrictMotif.31
-rw-r--r--tk/doc/TextLayout.31
-rw-r--r--tk/doc/TkInitStubs.310
-rw-r--r--tk/doc/Tk_Init.350
-rw-r--r--tk/doc/Tk_Main.31
-rw-r--r--tk/doc/WindowId.338
-rw-r--r--tk/doc/bell.n12
-rw-r--r--tk/doc/bind.n69
-rw-r--r--tk/doc/bindtags.n1
-rw-r--r--tk/doc/bitmap.n1
-rw-r--r--tk/doc/button.n35
-rw-r--r--tk/doc/canvas.n85
-rw-r--r--tk/doc/checkbutton.n35
-rw-r--r--tk/doc/chooseColor.n1
-rw-r--r--tk/doc/chooseDirectory.n1
-rw-r--r--tk/doc/clipboard.n18
-rw-r--r--tk/doc/colors.n24
-rw-r--r--tk/doc/console.n142
-rw-r--r--tk/doc/destroy.n1
-rw-r--r--tk/doc/dialog.n1
-rw-r--r--tk/doc/entry.n53
-rw-r--r--tk/doc/event.n6
-rw-r--r--tk/doc/focus.n1
-rw-r--r--tk/doc/focusNext.n1
-rw-r--r--tk/doc/font.n3
-rw-r--r--tk/doc/frame.n13
-rw-r--r--tk/doc/getOpenFile.n14
-rw-r--r--tk/doc/grab.n1
-rw-r--r--tk/doc/grid.n71
-rw-r--r--tk/doc/image.n9
-rw-r--r--tk/doc/label.n18
-rw-r--r--tk/doc/labelframe.n147
-rw-r--r--tk/doc/listbox.n51
-rw-r--r--tk/doc/loadTk.n7
-rw-r--r--tk/doc/lower.n1
-rw-r--r--tk/doc/man.macros2
-rw-r--r--tk/doc/menu.n31
-rw-r--r--tk/doc/menubar.n1
-rw-r--r--tk/doc/menubutton.n23
-rw-r--r--tk/doc/message.n11
-rw-r--r--tk/doc/messageBox.n6
-rw-r--r--tk/doc/option.n1
-rw-r--r--tk/doc/optionMenu.n1
-rw-r--r--tk/doc/options.n5
-rw-r--r--tk/doc/pack-old.n1
-rw-r--r--tk/doc/pack.n7
-rw-r--r--tk/doc/palette.n1
-rw-r--r--tk/doc/panedwindow.n246
-rw-r--r--tk/doc/photo.n58
-rw-r--r--tk/doc/place.n208
-rw-r--r--tk/doc/popup.n1
-rw-r--r--tk/doc/radiobutton.n36
-rw-r--r--tk/doc/raise.n1
-rw-r--r--tk/doc/scale.n10
-rw-r--r--tk/doc/scrollbar.n10
-rw-r--r--tk/doc/selection.n7
-rw-r--r--tk/doc/send.n1
-rw-r--r--tk/doc/spinbox.n582
-rw-r--r--tk/doc/text.n192
-rw-r--r--tk/doc/tk.n27
-rw-r--r--tk/doc/tkerror.n1
-rw-r--r--tk/doc/tkvars.n15
-rw-r--r--tk/doc/tkwait.n1
-rw-r--r--tk/doc/toplevel.n17
-rw-r--r--tk/doc/winfo.n9
-rw-r--r--tk/doc/wish.11
-rw-r--r--tk/doc/wm.n63
-rw-r--r--tk/generic/default.h5
-rw-r--r--tk/generic/ks_names.h2
-rw-r--r--tk/generic/prolog.ps1
-rw-r--r--tk/generic/tk.decls587
-rw-r--r--tk/generic/tk.h352
-rw-r--r--tk/generic/tk3d.c25
-rw-r--r--tk/generic/tk3d.h1
-rw-r--r--tk/generic/tkArgv.c18
-rw-r--r--tk/generic/tkAtom.c7
-rw-r--r--tk/generic/tkBind.c236
-rw-r--r--tk/generic/tkBitmap.c34
-rw-r--r--tk/generic/tkButton.c126
-rw-r--r--tk/generic/tkButton.h39
-rw-r--r--tk/generic/tkCanvArc.c79
-rw-r--r--tk/generic/tkCanvBmap.c66
-rw-r--r--tk/generic/tkCanvImg.c5
-rw-r--r--tk/generic/tkCanvLine.c106
-rw-r--r--tk/generic/tkCanvPoly.c112
-rw-r--r--tk/generic/tkCanvPs.c346
-rw-r--r--tk/generic/tkCanvText.c83
-rw-r--r--tk/generic/tkCanvUtil.c18
-rw-r--r--tk/generic/tkCanvWind.c80
-rw-r--r--tk/generic/tkCanvas.c168
-rw-r--r--tk/generic/tkCanvas.h3
-rw-r--r--tk/generic/tkClipboard.c336
-rw-r--r--tk/generic/tkCmds.c516
-rw-r--r--tk/generic/tkColor.c15
-rw-r--r--tk/generic/tkColor.h24
-rw-r--r--tk/generic/tkConfig.c271
-rw-r--r--tk/generic/tkConsole.c52
-rw-r--r--tk/generic/tkCursor.c30
-rw-r--r--tk/generic/tkDecls.h457
-rw-r--r--tk/generic/tkEntry.c2179
-rw-r--r--tk/generic/tkError.c1
-rw-r--r--tk/generic/tkEvent.c428
-rw-r--r--tk/generic/tkFileFilter.c25
-rw-r--r--tk/generic/tkFileFilter.h1
-rw-r--r--tk/generic/tkFocus.c52
-rw-r--r--tk/generic/tkFont.c199
-rw-r--r--tk/generic/tkFont.h6
-rw-r--r--tk/generic/tkFrame.c1310
-rw-r--r--tk/generic/tkGC.c58
-rw-r--r--tk/generic/tkGeometry.c143
-rw-r--r--tk/generic/tkGet.c59
-rw-r--r--tk/generic/tkGrab.c274
-rw-r--r--tk/generic/tkGrid.c1786
-rw-r--r--tk/generic/tkImage.c105
-rw-r--r--tk/generic/tkImgBmap.c193
-rw-r--r--tk/generic/tkImgGIF.c1280
-rw-r--r--tk/generic/tkImgPPM.c8
-rw-r--r--tk/generic/tkImgPhoto.c1285
-rw-r--r--tk/generic/tkImgUtil.c1
-rw-r--r--tk/generic/tkInitScript.h11
-rw-r--r--tk/generic/tkInt.decls780
-rw-r--r--tk/generic/tkInt.h246
-rw-r--r--tk/generic/tkIntDecls.h492
-rw-r--r--tk/generic/tkIntPlatDecls.h783
-rw-r--r--tk/generic/tkIntXlibDecls.h744
-rw-r--r--tk/generic/tkListbox.c726
-rw-r--r--tk/generic/tkMacWinMenu.c1
-rw-r--r--tk/generic/tkMain.c37
-rw-r--r--tk/generic/tkMenu.c122
-rw-r--r--tk/generic/tkMenu.h13
-rw-r--r--tk/generic/tkMenuDraw.c28
-rw-r--r--tk/generic/tkMenubutton.c75
-rw-r--r--tk/generic/tkMenubutton.h11
-rw-r--r--tk/generic/tkMessage.c376
-rw-r--r--tk/generic/tkObj.c314
-rw-r--r--tk/generic/tkOldConfig.c43
-rw-r--r--tk/generic/tkOption.c260
-rw-r--r--tk/generic/tkPack.c626
-rw-r--r--tk/generic/tkPanedWindow.c2752
-rw-r--r--tk/generic/tkPlace.c749
-rw-r--r--tk/generic/tkPlatDecls.h94
-rw-r--r--tk/generic/tkPointer.c11
-rw-r--r--tk/generic/tkPort.h3
-rw-r--r--tk/generic/tkRectOval.c79
-rw-r--r--tk/generic/tkScale.c47
-rw-r--r--tk/generic/tkScale.h2
-rw-r--r--tk/generic/tkScrollbar.c13
-rw-r--r--tk/generic/tkScrollbar.h3
-rw-r--r--tk/generic/tkSelect.c674
-rw-r--r--tk/generic/tkSelect.h1
-rw-r--r--tk/generic/tkSquare.c79
-rw-r--r--tk/generic/tkStubImg.c3
-rw-r--r--tk/generic/tkStubInit.c386
-rw-r--r--tk/generic/tkStubLib.c15
-rw-r--r--tk/generic/tkStyle.c1664
-rw-r--r--tk/generic/tkTest.c252
-rw-r--r--tk/generic/tkText.c940
-rw-r--r--tk/generic/tkText.h92
-rw-r--r--tk/generic/tkTextBTree.c5
-rw-r--r--tk/generic/tkTextDisp.c63
-rw-r--r--tk/generic/tkTextImage.c15
-rw-r--r--tk/generic/tkTextIndex.c77
-rw-r--r--tk/generic/tkTextMark.c29
-rw-r--r--tk/generic/tkTextTag.c58
-rw-r--r--tk/generic/tkTextWind.c23
-rw-r--r--tk/generic/tkTrig.c1
-rw-r--r--tk/generic/tkUndo.c400
-rw-r--r--tk/generic/tkUndo.h90
-rw-r--r--tk/generic/tkUtil.c18
-rw-r--r--tk/generic/tkVisual.c7
-rw-r--r--tk/generic/tkWindow.c613
-rw-r--r--tk/library/bgerror.tcl332
-rw-r--r--tk/library/button.tcl515
-rw-r--r--tk/library/choosedir.tcl49
-rw-r--r--tk/library/clrpick.tcl326
-rw-r--r--tk/library/comdlg.tcl110
-rw-r--r--tk/library/console.tcl841
-rw-r--r--tk/library/demos/README1
-rw-r--r--tk/library/demos/arrow.tcl88
-rw-r--r--tk/library/demos/bind.tcl1
-rw-r--r--tk/library/demos/bitmap.tcl1
-rwxr-xr-xtk/library/demos/browse33
-rw-r--r--tk/library/demos/button.tcl1
-rw-r--r--tk/library/demos/check.tcl1
-rw-r--r--tk/library/demos/clrpick.tcl3
-rw-r--r--tk/library/demos/colors.tcl1
-rw-r--r--tk/library/demos/cscroll.tcl15
-rw-r--r--tk/library/demos/ctext.tcl38
-rw-r--r--tk/library/demos/dialog1.tcl1
-rw-r--r--tk/library/demos/dialog2.tcl3
-rw-r--r--tk/library/demos/entry1.tcl1
-rw-r--r--tk/library/demos/entry2.tcl1
-rw-r--r--tk/library/demos/entry3.tcl187
-rw-r--r--tk/library/demos/filebox.tcl5
-rw-r--r--tk/library/demos/floor.tcl3
-rw-r--r--tk/library/demos/form.tcl1
-rwxr-xr-xtk/library/demos/hello3
-rw-r--r--tk/library/demos/hscale.tcl3
-rw-r--r--tk/library/demos/icon.tcl1
-rw-r--r--tk/library/demos/image1.tcl1
-rw-r--r--tk/library/demos/image2.tcl47
-rw-r--r--tk/library/demos/items.tcl3
-rwxr-xr-xtk/library/demos/ixset134
-rw-r--r--tk/library/demos/label.tcl1
-rw-r--r--tk/library/demos/labelframe.tcl80
-rw-r--r--tk/library/demos/menu.tcl13
-rw-r--r--tk/library/demos/menubu.tcl4
-rw-r--r--tk/library/demos/msgbox.tcl1
-rw-r--r--tk/library/demos/paned1.tcl34
-rw-r--r--tk/library/demos/paned2.tcl76
-rw-r--r--tk/library/demos/plot.tcl16
-rw-r--r--tk/library/demos/puzzle.tcl22
-rw-r--r--tk/library/demos/radio.tcl40
-rwxr-xr-xtk/library/demos/rmt32
-rwxr-xr-xtk/library/demos/rolodex77
-rw-r--r--tk/library/demos/ruler.tcl17
-rw-r--r--tk/library/demos/sayings.tcl1
-rw-r--r--tk/library/demos/search.tcl1
-rw-r--r--tk/library/demos/spin.tcl55
-rwxr-xr-xtk/library/demos/square1
-rw-r--r--tk/library/demos/states.tcl1
-rw-r--r--tk/library/demos/style.tcl1
-rwxr-xr-xtk/library/demos/tcolor277
-rw-r--r--tk/library/demos/text.tcl17
-rwxr-xr-xtk/library/demos/timer32
-rw-r--r--tk/library/demos/twind.tcl20
-rw-r--r--tk/library/demos/vscale.tcl3
-rwxr-xr-xtk/library/demos/widget233
-rw-r--r--tk/library/dialog.tcl45
-rw-r--r--tk/library/entry.tcl289
-rw-r--r--tk/library/focus.tcl24
-rw-r--r--tk/library/images/README1
-rw-r--r--tk/library/listbox.tcl158
-rw-r--r--tk/library/menu.tcl563
-rw-r--r--tk/library/mkpsenc.tcl1367
-rw-r--r--tk/library/msgbox.tcl159
-rw-r--r--tk/library/msgs/cs.msg70
-rw-r--r--tk/library/msgs/de.msg70
-rw-r--r--tk/library/msgs/el.msg86
-rw-r--r--tk/library/msgs/en.msg70
-rw-r--r--tk/library/msgs/en_gb.msg3
-rw-r--r--tk/library/msgs/es.msg70
-rw-r--r--tk/library/msgs/fr.msg70
-rw-r--r--tk/library/msgs/it.msg70
-rw-r--r--tk/library/msgs/nl.msg106
-rw-r--r--tk/library/msgs/ru.msg73
-rw-r--r--tk/library/obsolete.tcl1
-rw-r--r--tk/library/optMenu.tcl5
-rw-r--r--tk/library/palette.tcl63
-rw-r--r--tk/library/panedwindow.tcl181
-rw-r--r--tk/library/safetk.tcl4
-rw-r--r--tk/library/scale.tcl130
-rw-r--r--tk/library/scrlbar.tcl206
-rw-r--r--tk/library/spinbox.tcl568
-rw-r--r--tk/library/tclIndex448
-rw-r--r--tk/library/tearoff.tcl13
-rw-r--r--tk/library/text.tcl461
-rw-r--r--tk/library/tk.tcl363
-rw-r--r--tk/library/tkfbox.tcl998
-rw-r--r--tk/library/unsupported.tcl297
-rw-r--r--tk/library/xmfbox.tcl486
-rw-r--r--tk/mac/MW_TkBuildLibHeader.h7
-rw-r--r--tk/mac/MW_TkBuildLibHeader.pch36
-rw-r--r--tk/mac/MW_TkHeader.h50
-rw-r--r--tk/mac/MW_TkHeader.pch28
-rw-r--r--tk/mac/MW_TkHeaderCommon.h40
-rw-r--r--tk/mac/MW_TkOldImgHeader.h2
-rw-r--r--tk/mac/MW_TkOldImgStaticHeader.h3
-rw-r--r--tk/mac/MW_TkStaticHeader.h7
-rw-r--r--tk/mac/MW_TkStaticHeader.pch36
-rw-r--r--tk/mac/MW_TkTestHeader.pch34
-rw-r--r--tk/mac/README16
-rw-r--r--tk/mac/tclets.r262
-rw-r--r--tk/mac/tclets.tcl89
-rw-r--r--tk/mac/tkMac.h29
-rw-r--r--tk/mac/tkMacAppInit.c57
-rw-r--r--tk/mac/tkMacAppearanceStubs.c2
-rw-r--r--tk/mac/tkMacApplication.r50
-rw-r--r--tk/mac/tkMacBitmap.c3
-rw-r--r--tk/mac/tkMacButton.c322
-rw-r--r--tk/mac/tkMacClipboard.c1
-rw-r--r--tk/mac/tkMacColor.c1
-rw-r--r--tk/mac/tkMacConfig.c5
-rw-r--r--tk/mac/tkMacCursor.c11
-rw-r--r--tk/mac/tkMacCursors.r1
-rw-r--r--tk/mac/tkMacDefault.h68
-rw-r--r--tk/mac/tkMacDialog.c35
-rw-r--r--tk/mac/tkMacDraw.c4
-rw-r--r--tk/mac/tkMacEmbed.c5
-rw-r--r--tk/mac/tkMacFont.c9
-rw-r--r--tk/mac/tkMacHLEvents.c5
-rw-r--r--tk/mac/tkMacInit.c117
-rw-r--r--tk/mac/tkMacInt.h27
-rw-r--r--tk/mac/tkMacKeyboard.c2
-rw-r--r--tk/mac/tkMacLibrary.r448
-rw-r--r--tk/mac/tkMacMDEF.c1
-rw-r--r--tk/mac/tkMacMDEF.r31
-rw-r--r--tk/mac/tkMacMenu.c199
-rw-r--r--tk/mac/tkMacMenu.r1
-rw-r--r--tk/mac/tkMacMenubutton.c169
-rw-r--r--tk/mac/tkMacMenus.c12
-rw-r--r--tk/mac/tkMacPort.h20
-rw-r--r--tk/mac/tkMacProjects.sea.hqx6419
-rw-r--r--tk/mac/tkMacRegion.c29
-rw-r--r--tk/mac/tkMacResource.r78
-rw-r--r--tk/mac/tkMacScale.c2
-rw-r--r--tk/mac/tkMacScrlbr.c38
-rw-r--r--tk/mac/tkMacSend.c7
-rw-r--r--tk/mac/tkMacSubwindows.c11
-rw-r--r--tk/mac/tkMacTclCode.r71
-rw-r--r--tk/mac/tkMacTest.c1
-rw-r--r--tk/mac/tkMacWindowMgr.c18
-rw-r--r--tk/mac/tkMacWm.c3395
-rw-r--r--tk/mac/tkMacXCursors.r1
-rw-r--r--tk/mac/tkMacXStubs.c30
-rw-r--r--tk/mac/widget.r18
-rw-r--r--tk/macosx/Makefile86
-rw-r--r--tk/macosx/Wish.icnsbin0 -> 35960 bytes
-rw-r--r--tk/macosx/Wish.pbproj/jingham.pbxuser1502
-rw-r--r--tk/macosx/Wish.pbproj/project.pbxproj3619
-rw-r--r--tk/macosx/tclets.r172
-rw-r--r--tk/macosx/tkAboutDlg.r393
-rw-r--r--tk/macosx/tkMacOSX.h34
-rw-r--r--tk/macosx/tkMacOSXAppInit.c241
-rw-r--r--tk/macosx/tkMacOSXApplication.r276
-rw-r--r--tk/macosx/tkMacOSXBitmap.c283
-rw-r--r--tk/macosx/tkMacOSXButton.c1580
-rw-r--r--tk/macosx/tkMacOSXClipboard.c321
-rw-r--r--tk/macosx/tkMacOSXColor.c448
-rw-r--r--tk/macosx/tkMacOSXConfig.c46
-rw-r--r--tk/macosx/tkMacOSXCursor.c406
-rw-r--r--tk/macosx/tkMacOSXCursors.r130
-rw-r--r--tk/macosx/tkMacOSXDebug.c439
-rw-r--r--tk/macosx/tkMacOSXDebug.h69
-rw-r--r--tk/macosx/tkMacOSXDefault.h531
-rw-r--r--tk/macosx/tkMacOSXDialog.c1229
-rw-r--r--tk/macosx/tkMacOSXDraw.c1714
-rw-r--r--tk/macosx/tkMacOSXEmbed.c1193
-rw-r--r--tk/macosx/tkMacOSXEvent.c276
-rw-r--r--tk/macosx/tkMacOSXEvent.h86
-rw-r--r--tk/macosx/tkMacOSXFont.c2191
-rw-r--r--tk/macosx/tkMacOSXHLEvents.c447
-rw-r--r--tk/macosx/tkMacOSXInit.c221
-rw-r--r--tk/macosx/tkMacOSXInt.h155
-rw-r--r--tk/macosx/tkMacOSXKeyEvent.c501
-rw-r--r--tk/macosx/tkMacOSXKeyboard.c682
-rw-r--r--tk/macosx/tkMacOSXLibrary.r510
-rw-r--r--tk/macosx/tkMacOSXMenu.c4691
-rw-r--r--tk/macosx/tkMacOSXMenu.r47
-rw-r--r--tk/macosx/tkMacOSXMenubutton.c861
-rw-r--r--tk/macosx/tkMacOSXMenus.c325
-rw-r--r--tk/macosx/tkMacOSXMouseEvent.c740
-rw-r--r--tk/macosx/tkMacOSXNotify.c1162
-rw-r--r--tk/macosx/tkMacOSXPort.h154
-rw-r--r--tk/macosx/tkMacOSXRegion.c252
-rw-r--r--tk/macosx/tkMacOSXResource.r502
-rw-r--r--tk/macosx/tkMacOSXScale.c431
-rw-r--r--tk/macosx/tkMacOSXScrlbr.c1076
-rw-r--r--tk/macosx/tkMacOSXSend.c552
-rw-r--r--tk/macosx/tkMacOSXSubwindows.c1304
-rw-r--r--tk/macosx/tkMacOSXTest.c82
-rw-r--r--tk/macosx/tkMacOSXUtil.c330
-rw-r--r--tk/macosx/tkMacOSXUtil.h65
-rw-r--r--tk/macosx/tkMacOSXWindowEvent.c693
-rw-r--r--tk/macosx/tkMacOSXWm.c5512
-rw-r--r--tk/macosx/tkMacOSXWm.h302
-rw-r--r--tk/macosx/tkMacOSXXCursors.r961
-rw-r--r--tk/macosx/tkMacOSXXStubs.c862
-rw-r--r--tk/tests/README1
-rw-r--r--tk/tests/all.tcl77
-rw-r--r--tk/tests/bell.test31
-rw-r--r--tk/tests/bgerror.test9
-rw-r--r--tk/tests/bind.test87
-rw-r--r--tk/tests/bitmap.test29
-rw-r--r--tk/tests/border.test58
-rw-r--r--tk/tests/button.test123
-rw-r--r--tk/tests/canvImg.test151
-rw-r--r--tk/tests/canvPs.test20
-rw-r--r--tk/tests/canvPsImg.tcl3
-rw-r--r--tk/tests/canvRect.test15
-rw-r--r--tk/tests/canvText.test21
-rw-r--r--tk/tests/canvWind.test15
-rw-r--r--tk/tests/canvas.test112
-rw-r--r--tk/tests/choosedir.test12
-rw-r--r--tk/tests/clipboard.test80
-rw-r--r--tk/tests/clrpick.test28
-rw-r--r--tk/tests/cmds.test11
-rw-r--r--tk/tests/color.test97
-rw-r--r--tk/tests/config.test499
-rw-r--r--tk/tests/constraints.tcl181
-rw-r--r--tk/tests/cursor.test107
-rw-r--r--tk/tests/dialog.test64
-rw-r--r--tk/tests/embed.test51
-rw-r--r--tk/tests/entry.test147
-rw-r--r--tk/tests/event.test617
-rw-r--r--tk/tests/filebox.test430
-rw-r--r--tk/tests/focus.test40
-rw-r--r--tk/tests/focusTcl.test49
-rw-r--r--tk/tests/font.test94
-rw-r--r--tk/tests/frame.test326
-rw-r--r--tk/tests/geometry.test12
-rw-r--r--tk/tests/get.test13
-rw-r--r--tk/tests/grab.test185
-rw-r--r--tk/tests/grid.test336
-rw-r--r--tk/tests/id.test26
-rw-r--r--tk/tests/image.test133
-rw-r--r--tk/tests/imgBmap.test16
-rw-r--r--tk/tests/imgPPM.test18
-rw-r--r--tk/tests/imgPhoto.test335
-rw-r--r--tk/tests/listbox.test120
-rw-r--r--tk/tests/macEmbed.test113
-rw-r--r--tk/tests/macFont.test150
-rw-r--r--tk/tests/macMenu.test569
-rw-r--r--tk/tests/macWinMenu.test32
-rw-r--r--tk/tests/macscrollbar.test53
-rw-r--r--tk/tests/main.test29
-rw-r--r--tk/tests/menu.test135
-rw-r--r--tk/tests/menuDraw.test97
-rw-r--r--tk/tests/menubut.test55
-rw-r--r--tk/tests/message.test125
-rw-r--r--tk/tests/msgbox.test17
-rw-r--r--tk/tests/obj.test17
-rw-r--r--tk/tests/oldpack.test11
-rw-r--r--tk/tests/option.test20
-rw-r--r--tk/tests/pack.test156
-rw-r--r--tk/tests/panedwindow.test2392
-rw-r--r--tk/tests/place.test184
-rw-r--r--tk/tests/raise.test44
-rw-r--r--tk/tests/safe.test74
-rw-r--r--tk/tests/scale.test22
-rw-r--r--tk/tests/scrollbar.test54
-rw-r--r--tk/tests/select.test342
-rw-r--r--tk/tests/send.test889
-rw-r--r--tk/tests/spinbox.test1589
-rw-r--r--tk/tests/text.test262
-rw-r--r--tk/tests/textBTree.test9
-rw-r--r--tk/tests/textDisp.test44
-rw-r--r--tk/tests/textImage.test24
-rw-r--r--tk/tests/textIndex.test13
-rw-r--r--tk/tests/textMark.test94
-rw-r--r--tk/tests/textTag.test257
-rw-r--r--tk/tests/textWind.test14
-rw-r--r--tk/tests/tk.test35
-rw-r--r--tk/tests/unixButton.test76
-rw-r--r--tk/tests/unixEmbed.test209
-rw-r--r--tk/tests/unixFont.test131
-rw-r--r--tk/tests/unixMenu.test371
-rw-r--r--tk/tests/unixSelect.test17
-rw-r--r--tk/tests/unixWm.test404
-rw-r--r--tk/tests/util.test15
-rw-r--r--tk/tests/visual.test26
-rw-r--r--tk/tests/visual_bb.test36
-rw-r--r--tk/tests/winButton.test76
-rw-r--r--tk/tests/winClipboard.test67
-rw-r--r--tk/tests/winDialog.test92
-rw-r--r--tk/tests/winFont.test21
-rw-r--r--tk/tests/winMenu.test133
-rw-r--r--tk/tests/winSend.test172
-rw-r--r--tk/tests/winWm.test64
-rw-r--r--tk/tests/window.test19
-rw-r--r--tk/tests/winfo.test62
-rw-r--r--tk/tests/wm.test2134
-rw-r--r--tk/tests/xmfbox.test60
-rw-r--r--tk/unix/Makefile.in353
-rw-r--r--tk/unix/README54
-rw-r--r--tk/unix/aclocal.m41
-rwxr-xr-xtk/unix/configure2414
-rwxr-xr-xtk/unix/configure.in301
-rwxr-xr-xtk/unix/install-sh20
-rwxr-xr-xtk/unix/mkLinks1490
-rw-r--r--tk/unix/tcl.m41280
-rw-r--r--tk/unix/tk.spec52
-rw-r--r--tk/unix/tkAppInit.c15
-rw-r--r--tk/unix/tkConfig.sh.in14
-rw-r--r--tk/unix/tkUnix.c5
-rw-r--r--tk/unix/tkUnix3d.c13
-rw-r--r--tk/unix/tkUnixButton.c360
-rw-r--r--tk/unix/tkUnixColor.c1
-rw-r--r--tk/unix/tkUnixConfig.c5
-rw-r--r--tk/unix/tkUnixCursor.c7
-rw-r--r--tk/unix/tkUnixDefault.h69
-rw-r--r--tk/unix/tkUnixDialog.c13
-rw-r--r--tk/unix/tkUnixDraw.c7
-rw-r--r--tk/unix/tkUnixEmbed.c17
-rw-r--r--tk/unix/tkUnixEvent.c128
-rw-r--r--tk/unix/tkUnixFocus.c1
-rw-r--r--tk/unix/tkUnixFont.c352
-rw-r--r--tk/unix/tkUnixInit.c7
-rw-r--r--tk/unix/tkUnixInt.h1
-rw-r--r--tk/unix/tkUnixKey.c68
-rw-r--r--tk/unix/tkUnixMenu.c168
-rw-r--r--tk/unix/tkUnixMenubu.c267
-rw-r--r--tk/unix/tkUnixPort.h21
-rw-r--r--tk/unix/tkUnixScale.c6
-rw-r--r--tk/unix/tkUnixScrlbr.c11
-rw-r--r--tk/unix/tkUnixSelect.c46
-rw-r--r--tk/unix/tkUnixSend.c73
-rw-r--r--tk/unix/tkUnixWm.c3856
-rw-r--r--tk/unix/tkUnixXId.c88
-rw-r--r--tk/win/Makefile.in196
-rw-r--r--tk/win/README8
-rw-r--r--tk/win/aclocal.m41
-rw-r--r--tk/win/buildall.vc.bat37
-rwxr-xr-xtk/win/configure1258
-rwxr-xr-xtk/win/configure.in142
-rw-r--r--tk/win/lamp.bmpbin0 -> 2102 bytes
-rw-r--r--tk/win/makefile.bc875
-rw-r--r--tk/win/makefile.vc1347
-rw-r--r--tk/win/mkd.bat36
-rw-r--r--tk/win/nmakehlp.c297
-rw-r--r--tk/win/rc/tk.rc115
-rw-r--r--tk/win/rc/tk_base.rc261
-rw-r--r--tk/win/rc/wish.exe.manifest23
-rw-r--r--tk/win/rc/wish.rc136
-rw-r--r--tk/win/rmd.bat48
-rw-r--r--tk/win/rules.vc263
-rw-r--r--tk/win/stubs.c4
-rw-r--r--tk/win/tcl.m4378
-rw-r--r--tk/win/tkConfig.sh.in5
-rw-r--r--tk/win/tkWin.h1
-rw-r--r--tk/win/tkWin32Dll.c15
-rw-r--r--tk/win/tkWinButton.c672
-rw-r--r--tk/win/tkWinClipboard.c2
-rw-r--r--tk/win/tkWinColor.c2
-rw-r--r--tk/win/tkWinConfig.c5
-rw-r--r--tk/win/tkWinCursor.c76
-rw-r--r--tk/win/tkWinDefault.h84
-rw-r--r--tk/win/tkWinDialog.c1049
-rw-r--r--tk/win/tkWinDraw.c20
-rw-r--r--tk/win/tkWinEmbed.c19
-rw-r--r--tk/win/tkWinFont.c49
-rw-r--r--tk/win/tkWinImage.c3
-rw-r--r--tk/win/tkWinInit.c40
-rw-r--r--tk/win/tkWinInt.h35
-rw-r--r--tk/win/tkWinKey.c37
-rw-r--r--tk/win/tkWinMenu.c214
-rw-r--r--tk/win/tkWinPixmap.c1
-rw-r--r--tk/win/tkWinPort.h19
-rw-r--r--tk/win/tkWinRegion.c24
-rw-r--r--tk/win/tkWinScrlbr.c22
-rw-r--r--tk/win/tkWinSend.c4
-rw-r--r--tk/win/tkWinTest.c120
-rw-r--r--tk/win/tkWinWindow.c51
-rw-r--r--tk/win/tkWinWm.c4743
-rw-r--r--tk/win/tkWinX.c513
-rw-r--r--tk/win/winMain.c26
-rw-r--r--tk/xlib/X11/X.h8
-rw-r--r--tk/xlib/X11/Xlib.h13
-rw-r--r--tk/xlib/X11/Xutil.h4
-rw-r--r--tk/xlib/xbytes.h1
-rw-r--r--tk/xlib/xcolors.c1510
-rw-r--r--tk/xlib/xdraw.c1
-rw-r--r--tk/xlib/xgc.c12
-rw-r--r--tk/xlib/ximage.c3
-rw-r--r--tk/xlib/xutil.c1
636 files changed, 115237 insertions, 30720 deletions
diff --git a/tk/ChangeLog b/tk/ChangeLog
index 25d85457335..0ff16040b3b 100644
--- a/tk/ChangeLog
+++ b/tk/ChangeLog
@@ -1,152 +1,3456 @@
-2001-08-08 Mo DeJong <mdejong@redhat.com>
+2002-09-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/Makefile.in: added DYLIB_INSTALL_DIR variable for Darwin
+ and set it to default value ${LIB_RUNTIME_DIR}
+ * unix/tcl.m4 (Darwin): use DYLIB_INSTALL_DIR instead of
+ LIB_RUNTIME_DIR in the -install_name argument to ld.
+ * unix/configure: regen.
+
+ * macosx/Wish.pbproj/project.pbxproj:
+ * macosx/Makefile: added support for building Tcl as an embedded
+ framework, i.e. using an dyld install_name containing
+ @executable_path/../Frameworks via the new DYLIB_INSTALL_DIR
+ unix/Makefile variable.
+
+2002-09-10 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4.0 TAGGED FOR RELEASE ***
+
+2002-09-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * macosx/tkMacOSXNotify.c (Tk_MacOSXSetupTkNotifier): corrected
+ Mac Jaguar event loop issue.
+
+ * library/tk.tcl: use command instead of control on Aqua bindings.
+ Force dialogs to appear below fixed native Mac menubar.
+ * macosx/tkMacOSXKeyEvent.c:
+ * macosx/tkMacOSXKeyboard.c: Keypress/release events for pure
+ modifier keys were not being passed to Tk.
+ Deadkey presses were inserting null characters into text windows.
+ Now they do nothing. (Still not ideal, but better than before!)
+ * macosx/tkMacOSXMenu.c: Allow more than 200 menus to exist -
+ increased to 2000.
+ * macosx/tkMacOSXMouseEvent.c: Bad interactions between floating
+ windows and ordinary ones. Ensure that local<->global coordinate
+ transformations are wrt to the correct window.
+ * macosx/tkMacOSXWm.c: Better error msg for 'wm attributes'.
+ Remove crash in 'wm transient'.
+ Add 'noActivates' and 'noUpdates' flags to unsupported command.
+ [Patch #606658] (darley)
+
+ * library/xmfbox.tcl (::tk::MotifFDialog_ActivateSEnt): corrected
+ msgcat code with XPG specifier. [Patch #606719] (miller)
+
+2002-09-06 Don Porter <dgp@users.sf.net>
+
+ * tests/unixWm.test (unixWm-50.3): Constrained test that hangs
+ on Windows.
+
+2002-09-05 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: added overlooked missing
+ TK_PATCH_LEVEL version bump to 8.4.0.
+
+2002-09-04 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * win/Makefile.in (install-libraries): Added code section to
+ install the message catalogs. Copied same section from
+ unix/Makefile.in and adapted it to the slightly different
+ environment.
+
+2002-09-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/button.tcl: further restrict buttons to not resetting
+ the "original" relief if it has changed in the interim. This
+ prevents code that simulated overrelief buttons from not working
+ in 8.4. [Bug #604270]
+
+2002-09-03 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/Wish.pbproj/project.pbxproj: Bumped version number to
+ 8.4.0 and updated copyright info.
+
+2002-09-03 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * macosx/tkMacOSXWm.c: fix to 'wm attributes' error-handling bug.
+
+2002-09-03 Don Porter <dgp@users.sf.net>
+
+ * changes: Updated for 8.4.0 release
+
+2002-09-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/cursor.test: reverted 2002-08-31 change for OS X to use
+ 'heart' cursor because 'arrow' on windows has a pre-skewed use
+ count. [Bug #602667]
+
+ * tests/button.test: added button-14.1
+ * win/tkWinButton.c (TkpComputeButtonGeometry): correct Win button
+ sizing to be equal for one-line buttons with -height of 0 or 1, as
+ well as -height 0 buttons with empty text and no image, which
+ should be the same as single-line text buttons. [Bug #565485]
+
+ * library/button.tcl (::tk::ButtonLeave): correctly restore state
+ of button to normal for unix bindings. [Bug #597920]
+
+ * doc/tk.n: added tk windowingsystem docs.
+
+ * tests/wm.test:
+ * unix/tkUnixWm.c: remove possible 2-second delay in 'raise'.
+ [Patch #601518] (english) TIP #107
+
+ * unix/tcl.m4: add support for 64-bit builds on HP-11 with gcc.
+ * unix/configure.in: make sure to substitute LD_LIBRARY_PATH_VAR.
+ * unix/configure: regend
+
+ * README: Bumped version number to 8.4.0
+ * generic/tk.h:
+ * unix/configure:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure:
+ * win/configure.in:
+
+ * generic/tkCmds.c:
+ * generic/tkWindow.c: made 'tk' available in safe interpreters,
+ but only the caret and windowingsystem subcommands may be called.
+ * tests/safe.test (safe-1.2): noted that tk is now available in
+ safe interps, but not the appname/scaling subcommands.
+
+ * tests/tk.test (tk-1.2): noted new tk windowingsystem subcommand
+
+2002-08-31 Daniel Steffen <das@users.sourceforge.net>
+
+ * unix/tcl.m4: update from Tcl
+
+ * unix/Makefile.in: import of TK_SHLIB_LD_EXTRAS for Tk library
+ specific linker settings. Added use of new LD_LIBRARY_PATH_VAR.
+
+ * unix/configure: regen
+
+2002-08-31 Daniel Steffen <das@users.sourceforge.net>
+
+ *** macosx-8-4-branch merged into the mainline [tcl patch #602770] ***
+
+ * generic/tk.decls:
+ * generic/tkInt.decls: added new "aqua" specific entries to the
+ stubs tables. Changed all "unix" entries to "x11" to allow us to
+ distinguish and build both "aqua" on MacOSX and "x11" on MacOSX.
+
+ * generic/tk.h: added a #ifnded RESOURCE_INCLUDED so that tk.h can
+ be passed to the resource compiler.
+
+ * generic/tkCmds.c (Tk_TkObjCmd): added [tk windowingsystem]
+ subcommand: returns "x11" when running on X11, "win32" on Windows,
+ "classic" on MacOS9 and "aqua" on MacOSX Aqua (i.e. Carbon)
+
+ * generic/tkFont.c (TkFontGetFirstTextLayout): new private function
+ returning the first chunk of a Tk_TextLayout, i.e. until the first
+ font change on the first line (or the whole first line if there is
+ no such font change).
+
+ * generic/tkMain.c: made Tcl_ThreadDataKey static
+
+ * library/demos/puzzle.tcl: fixed button metrics for aqua
+
+ * tests/cursor.test: check for presence of arrow cursor instead of
+ heart cursor
+
+ * xlib/xcolors.c: changed xColors static initialization to more
+ standard C
+
+ * macosx/Wish.pbproj/jingham.pbxuser (new):
+ * macosx/Wish.pbproj/project.pbxproj (new): project for Apple's
+ ProjectBuilder IDE.
+
+ * macosx/Makefile (new): simple makefile for building the project
+ from the command line via the ProjectBuilder tool 'pbxbuild'.
+
+ * macosx/tkMacOSXAppInit.c (new): macosx specific AppInit looking
+ for a AppMain.tcl file in its bundled Resources/Scripts folder. If
+ present, argv[1] is set to that file and the Scripts folder is
+ added to the auto_path. This allows tk apps to embed scripts within
+ their bundle directory structure.
+
+ * macosx/tkMacOSXInit.c (new): macosx adapted version of
+ tkUnixInit.c: we initialize & cache the Carbon native encoding
+ (e.g. 'macRoman') and try to find the tk script library files
+ inside Tk packaged as a framework.
+
+ * macosx/tkMacOSXNotify.c (new): new macosx specific merged
+ Carbon/select-based notifier.
+
+ * macosx/tkMacOSXEvent.c (new):
+ * macosx/tkMacOSXEvent.h (new):
+ * macosx/tkMacOSXKeyEvent.c (new):
+ * macosx/tkMacOSXMouseEvent.c (new):
+ * macosx/tkMacOSXWindowEvent.c (new): new macosx specific event
+ handling functionality.
+
+ * macosx/tkMacOSX.h (new):
+ * macosx/tkMacOSXBitmap.c (new):
+ * macosx/tkMacOSXButton.c (new):
+ * macosx/tkMacOSXClipboard.c (new):
+ * macosx/tkMacOSXColor.c (new):
+ * macosx/tkMacOSXConfig.c (new):
+ * macosx/tkMacOSXCursor.c (new):
+ * macosx/tkMacOSXDefault.h (new):
+ * macosx/tkMacOSXDialog.c (new):
+ * macosx/tkMacOSXDraw.c (new):
+ * macosx/tkMacOSXEmbed.c (new):
+ * macosx/tkMacOSXFont.c (new):
+ * macosx/tkMacOSXHLEvents.c (new):
+ * macosx/tkMacOSXInt.h (new):
+ * macosx/tkMacOSXKeyboard.c (new):
+ * macosx/tkMacOSXMenu.c (new):
+ * macosx/tkMacOSXMenubutton.c (new):
+ * macosx/tkMacOSXMenus.c (new):
+ * macosx/tkMacOSXPort.h (new):
+ * macosx/tkMacOSXRegion.c (new):
+ * macosx/tkMacOSXScale.c (new):
+ * macosx/tkMacOSXScrlbr.c (new):
+ * macosx/tkMacOSXSubwindows.c (new):
+ * macosx/tkMacOSXTest.c (new):
+ * macosx/tkMacOSXUtil.c (new):
+ * macosx/tkMacOSXUtil.h (new):
+ * macosx/tkMacOSXWm.c (new):
+ * macosx/tkMacOSXWm.h (new):
+ * macosx/tkMacOSXXStubs.c (new): macosx ports of classic mac Tk
+ implementation in tk/mac.
+
+ * macosx/tkMacOSXSend.c (new): only send to local interp
+ implemented currently.
+
+ * macosx/tkMacOSXDebug.h (new):
+ * macosx/tkMacOSXDebug.c (new): new macosx specific functions for
+ debugging MacOS events, regions, etc.
+
+ * macosx/tkAboutDlg.r (new):
+ * macosx/tkMacOSXApplication.r (new):
+ * macosx/tkMacOSXCursors.r (new):
+ * macosx/tkMacOSXLibrary.r (new):
+ * macosx/tkMacOSXMenu.r (new):
+ * macosx/tkMacOSXResource.r (new):
+ * macosx/tkMacOSXXCursors.r (new):
+ * macosx/tclets.r (new): sources for Rez resource compiler.
+
+ * macosx/Wish.icns (new): Wish application icon.
+
+ * generic/tk.h:
+ * generic/default.h:
+ * generic/tkBind.c:
+ * generic/tkCmds.c:
+ * generic/tkGrab.c:
+ * generic/tkPointer.c:
+ * generic/tkPort.h:
+ * generic/tkSelect.c:
+ * generic/tkStubLib.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+ * generic/tkWindow.c:
+ * unix/tkUnix3d.c:
+ * xlib/xgc.c:
+ * xlib/X11/X.h:
+ * xlib/X11/Xlib.h:
+ * xlib/X11/Xutil.h: added #includes and #ifdefs for macosx
+
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/scrlbar.tcl:
+ * library/spinbox.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/demos/menu.tcl:
+ * library/demos/menubu.tcl:
+ * library/demos/widget: check [tk windowingsystem] instead of
+ and/or in addition to $tcl_platform(platform).
+
+ * generic/tkInt.h:
+ * mac/tkMacBitmap.c:
+ * mac/tkMacWm.c: added missing CONSTification
+
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntXlibDecls.h:
+ * generic/tkPlatDecls.h:
+ * generic/tkStubInit.c: regen
+
+2002-08-27 D. Richard Hipp <drh@hwaci.com>
+
+ * doc/checkbutton.n: [Bug 582457] Fix the -offrelief option so
+ * doc/radiobutton.n: that when -offrelief is flat and -relief is
+ * mac/tkMacButton.c: sunken and -overrelief is raised, buttons
+ * unix/tkUnixButton.c: work look toolbar buttons under Windows.
+ * win/tkWinButton.c: See also: TIP #82.
+
+2002-08-26 Don Porter <dgp@users.sf.net>
+
+ * win/Makefile.in: Removed dependence on the (parts of) the
+ * win/winMain.c: tcltest executable on Windows. It was not
+ used, and the dependency complicated the Makefile. [Bug 592638].
+
+2002-08-20 Don Porter <dgp@users.sf.net>
+
+ * README: Bumped version number to 8.4b3 to distinguish
+ * generic/tk.h: HEAD from the 8.4b2 release.
+ * unix/configure.in:
+ * win/configure.in:
+ * unix/tk.spec:
+
+ * unix/configure: autoconf
+ * win/configure:
+
+ * generic/tk.h: Added compile-time check that the tcl.h header file
+ #included by Tk 8.4 is one from Tcl 8.4. This is needed to be sure
+ that new #defines like CONST84 are available. [Bug 597432].
+
+2002-08-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (install-binaries): simplified pkgIndex.tcl
+ file created on installation.
+ * win/Makefile.in (install-binaries): corrected and simplified
+ creation of pkgIndex.tcl file on installation.
+
+2002-08-14 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinDialog.c:
+ * win/makefile.vc: broken compilation and link from changes
+ Hobbs-08-07 fixed.
+ * win/tkWinTest.c: CONST problem resolved.
+
+2002-08-13 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/button.tcl: change the bindings to use Priv($w,relief)
+ instead of just Priv(relief). This ensures that neighboring
+ buttons don't confuse (over)relief settings.
+
+2002-08-13 Reinhard Max <max@suse.de>
+
+ * unix/tkUnixSend.c (Tk_SetAppName): Fixed a compiler warning.
+
+2002-08-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/image2.tcl: Tweaked the behaviour of the directory
+ box on resize, as resizing of the overall window tends to be
+ common given the sample images.
+
+2002-08-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/tkUnixWm.c (WmTransientCmd): Apply fix for
+ wm transient assertion error that was applied
+ to tkWinWm.c for Tk Bug #592201.
+
+2002-08-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Add deleteWindows at start of
+ new transient tests so they do not fail if the
+ toplevels already exist.
+ * unix/tkUnixWm.c: Revert patch for Tk Bug #592201
+ which incorrectly removed numTransients member.
+
+2002-08-08 Joe English <jenglish@users.sourceforge.net>
+
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c:
+ * tests/wm.test: Fix for Tk Bug #592201 "wm transient fails with two
+ masters"; fixes panic after a transient window is reassigned to
+ new master and either master is subsequently destroyed.
+
+2002-08-08 Don Porter <dgp@users.sf.net>
+
+ * tests/unixWm.test: Corrected packaging of unixWm-50.3 so that
+ [setupbg] and [cleanupbg] always balance, no matter what tests
+ are skipped.
+
+2002-08-08 Reinhard Max <max@suse.de>
+
+ * unix/Makefile.in: Fixed typos in DISTNAME, and ZIPNAME.
+
+2002-08-08 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4b2 TAGGED FOR RELEASE ***
+
+ * generic/tkButton.c (TkButtonWorldChanged): added GCFont handling
+ to the disabledGc of buttons when compound != none. The drawing
+ appears to be incorrect across platforms still. [Bug #477740]
+
+ * generic/tkImgGIF.c (FileReadGIF): fixed -from handling for gifs
+ [Bug #467524] (obermeier)
+
+2002-08-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCanvUtil.c (TkSmoothParseProc): recognize the built-in
+ bezier method by name. [Bug #578654]
+ * doc/canvas.n: update to note that -smooth really doesn't take
+ or return just booleans.
+
+ * win/tkWinMenu.c (TkpSetWindowMenuBar): fixed logic bug in when
+ to idle call ReconfigureWindowsMenu.
+
+ * doc/GetBitmap.3: removed doc refs to deprecated
+ Tk_GetBitmapFromData. [Bug #590379]
+
+ * generic/tkPanedWindow.c (Tk_PanedWindowObjCmd):
+ * library/panedwindow.tcl: changed class from PanedWindow to
+ Panedwindow to not conflict with existing bwidgets, but also to be
+ more regular with other names used in the core.
+
+ * tests/panedwindow.test: added -text foobar to some test buttons
+ to enable correct testing of panedwindow across platforms.
+ [Bug #582370]
+
+ * win/tkWinDialog.c: enabled use of the updated native Windows
+ directory browser (tk_chooseDirectory). This does require
+ shell32.dll v4.71 or greater. [Patch #468139]
+
+ * win/configure:
+ * win/tcl.m4: added shell32 to libs for updated native Windows
+ tk_chooseDirectory dialog.
+
+2002-08-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (RESIZE_PENDING): Separated out flag for
+ indicating that a resize needs to be issued.
+ (PanedWindowReqProc): Do the old behaviour when the panedwindow is
+ not mapped; easiest way of making the test suite pass while still
+ preserving improved behaviour in the face of children whose size
+ is not known immediately.
+
+2002-08-06 Don Porter <dgp@users.sf.net>
+
+ * tests/defs.tcl: removed file. No longer needed now that Tk is
+ using the tcltest package to do its testing.
+
+2002-08-05 Don Porter <dgp@users.sf.net>
+
+ * win/tkWinFont.c: Additional changes to fix CONST warnings on
+ * win/tkWinWM.c: Windows due to latest patch. Tks Vince Darley.
+
+ * doc/3DBorder.3: Applied companion patch for Tcl Patch 585105,
+ * doc/BindTable.3: updating Tk to use Tcl 8.4's fully CONST-ified
+ * doc/ConfigWidg.3: interface, and fully CONSTifying Tk at the
+ * doc/CrtImgType.3: same time.
+ * doc/CrtWindow.3:
+ * doc/DeleteImg.3: This patch includes purging Tk of its last
+ * doc/FindPhoto.3: direct access to interp->result. [Bug 589853]
+ * doc/GetAnchor.3:
+ * doc/GetBitmap.3: The substantial changes include copying
+ * doc/GetCapStyl.3: event sequence strings into Tcl_DStrings
+ * doc/GetClrmap.3: in tkBind.c, and copying [text] indices into
+ * doc/GetColor.3: Tcl_DStrings because parsing them involved
+ * doc/GetCursor.3: overwriting them. If this causes performance
+ * doc/GetFont.3: trouble, that can be resolved by further
+ * doc/GetImage.3: converting them to Tcl_Obj's.
+ * doc/GetJoinStl.3:
+ * doc/GetJustify.3: The #defines USE_NON_CONST and USE_COMPAT_CONST
+ * doc/GetOption.3: have the same effect for Tk as they do for Tcl.
+ * doc/GetRelief.3: (They actually change tcl.h)
+ * doc/GetScroll.3:
+ * doc/GetVisual.3:
+ * doc/InternAtom.3:
+ * doc/NameOfImg.3:
+ * doc/SetAppName.3:
+ * doc/WindowId.3:
+ * generic/tk.decls:
+ * generic/tk.h:
+ * generic/tk3d.c:
+ * generic/tkAtom.c:
+ * generic/tkBind.c:
+ * generic/tkBitmap.c:
+ * generic/tkButton.c:
+ * generic/tkCanvArc.c:
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvImg.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvPs.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvUtil.c:
+ * generic/tkCanvWind.c:
+ * generic/tkCanvas.c:
+ * generic/tkCanvas.h:
+ * generic/tkClipboard.c:
+ * generic/tkCmds.c:
+ * generic/tkColor.c:
+ * generic/tkConfig.c:
+ * generic/tkConsole.c:
+ * generic/tkCursor.c:
+ * generic/tkDecls.h:
+ * generic/tkEntry.c:
+ * generic/tkFont.c:
+ * generic/tkFrame.c:
+ * generic/tkGet.c:
+ * generic/tkGrid.c:
+ * generic/tkImage.c:
+ * generic/tkImgBmap.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkInt.decls:
+ * generic/tkInt.h:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkListbox.c:
+ * generic/tkMenu.c:
+ * generic/tkMenubutton.c:
+ * generic/tkMessage.c:
+ * generic/tkOldConfig.c:
+ * generic/tkOption.c:
+ * generic/tkRectOval.c:
+ * generic/tkScale.c:
+ * generic/tkScrollbar.c:
+ * generic/tkSelect.c:
+ * generic/tkStyle.c:
+ * generic/tkTest.c:
+ * generic/tkText.c:
+ * generic/tkText.h:
+ * generic/tkTextBTree.c:
+ * generic/tkTextDisp.c:
+ * generic/tkTextImage.c:
+ * generic/tkTextIndex.c:
+ * generic/tkTextMark.c:
+ * generic/tkTextTag.c:
+ * generic/tkTextWind.c:
+ * generic/tkUtil.c:
+ * generic/tkVisual.c:
+ * generic/tkWindow.c:
+ * mac/tkMacConfig.c:
+ * mac/tkMacCursor.c:
+ * mac/tkMacEmbed.c:
+ * mac/tkMacSend.c:
+ * unix/tkUnixConfig.c:
+ * unix/tkUnixCursor.c:
+ * unix/tkUnixEmbed.c:
+ * unix/tkUnixFont.c:
+ * unix/tkUnixSelect.c:
+ * unix/tkUnixSend.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinConfig.c:
+ * win/tkWinCursor.c:
+ * win/tkWinEmbed.c:
+ * win/tkWinMenu.c:
+ * win/tkWinSend.c:
+
+2002-08-02 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (DestroyPanedWindow): Idle calls need to
+ be deleted on destruction of the window, or things can *really* go
+ pear-shaped.
+
+2002-07-31 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkPanedWindow.c (PanedWindowReqProc): Postpone pane
+ arrangement until idle, as is done in other window managers, to
+ fix problems with size calculations when the children don't
+ already know their sizes anyway.
- * cygtcl.m4: Update from Tcl.
* unix/configure: Regen.
- * win/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
-2001-08-06 Mo DeJong <mdejong@redhat.com>
+2002-07-29 Mo DeJong <mdejong@users.sourceforge.net>
- * cygtcl.m4: Update from Tcl.
* unix/configure: Regen.
- * win/configure: Regen.
+ * unix/configure.in: Remove code that was setting
+ CC_SEARCH_FLAGS and LD_SEARCH_FLAGS to try to
+ account for cc vs ld linking. Tcl now handles this.
+ * unix/tcl.m4: Update from Tcl.
-2001-08-06 Mo DeJong <mdejong@redhat.com>
+2002-07-27 Mo DeJong <mdejong@users.sourceforge.net>
- * unix/Makefile.in: Remove TCL_LIB_FLAG, replace TCL_LIB_SPEC
- with TCL_BUILD_LIB_SPEC.
+ * unix/Makefile.in: Add MAJOR_VERSION, MINOR_VERSION,
+ PATCH_LEVEL, INSTALL_LIBRARY, STUB_LIB_FILE, and LIB_FILE
+ to support changes in tcl.m4 related to library builds.
+ Use MAKE_LIB macro to avoid dealing with RANLIB issues.
+ Rename TK_CC_SEARCH_FLAGS to CC_SEARCH_FLAGS and
+ rename TK_LD_SEARCH_FLAGS to LD_SEARCH_FLAGS.
+ Use new INSTALL_LIB and INSTALL_STUB_LIB substs to
+ deal with ranlib issues when install libraries.
* unix/configure: Regen.
- * unix/configure.in: Avoid resetting TCL_LIB_SPEC and
- TCL_STUB_LIB_SPEC since they are already set in tclConfig.sh. Subst
- TCL_BUILD_STUB_LIB_SPEC and TCL_BUILD_LIB_SPEC into the Makefile.
- * win/Makefile.in: Use TCL_LIB_SPEC and TCL_STUB_LIB_SPEC from
- tclConfig.sh instead of creating them via a cygpath call. Use
- TCL_STUB_LIB_SPEC in place of TCL_STUB_LIB_FILE.
- * win/configure: Regen.
- * win/configure.in: Fixup TK_STUB_LIB_SPEC, TK_BUILD_STUB_LIB_PATH,
- TK_STUB_LIB_PATH, TK_LIB_FLAG, TK_BUILD_LIB_SPEC, TK_LIB_SPEC
- and TK_LIB_FULL_PATH variables so they work like the unix version.
+ * unix/configure.in: Remove AC_PROG_RANLIB since
+ this is done by tcl.m4 now. Define CC_SEARCH_FLAGS
+ instead of TK_CC_SEARCH_FLAGS and so on.
+ Use MAKE_LIB and MAKE_STUB_LIB from tcl.m4.
+ Remove AC_SUBST calls that are no done in tcl.m4.
+ * unix/tcl.m4: Update from Tcl.
+ * unix/tkConfig.sh.in: Subst CC_SEARCH_FLAGS and
+ LD_SEARCH_FLAGS.
+
+2002-07-25 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * mac/tkMacWm.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c:
+ * tests/wm.test:
+ * tests/winWm.test:
+ * tests/unixWm.test: Objectifed wm. [Patch #564521]
+ Note: At this point the Mac file is completely untested
+ and may not even compile.
+
+2002-07-25 Jeff Hobbs <jeffh@ActiveState.com>
-2001-08-01 Mo DeJong <mdejong@redhat.com>
+ * tests/spinbox.test: added spinbox-22.[1-3]
+ * generic/tkEntry.c (ConfigureEntry): made the textvariable value
+ take precedence over changed -from/-to values, unless it must be
+ constrained. [Bug #559078]
+
+ * library/spinbox.tcl (MouseSelect): when not in the entry, just
+ return instead of invoking - ButtonUp handles invoking already.
+ [Bug #499168]
+
+ * library/tk.tcl (RestoreFocusGrab): handle the case where the
+ FocusGrab info is not set. [Bug #553283]
+
+2002-07-24 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/canvas.test: added canvas-14.[1-6]
+ * generic/tkCanvas.c (CanvasWidgetCmd): corrected handling of
+ 'scan' subcommand args. Also removed early return cases to goto
+ done instead where the canvasPtr would be Tcl_Release'd. This may
+ solve other problems with unreleased canvasPtr's. [Bug #581560]
+
+ * win/tkWinButton.c (TkpDisplayButton): corrected display of focus
+ ring around the actual text when the button is a compound button.
+ [Bug #583691]
+
+ * unix/README: Corrected notes about running user interactive Tk
+ tests. [Bug #462320]
+
+ * generic/tkText.c (TextEditUndo): set isDirtyIncrement to -1 when
+ reverting to note proper "dirtiness". [Bug #580362] (callewaert)
+
+ * generic/tkEntry.c (DisplayEntry): correct cursor position before
+ calling Tk_SetCaretPos. (yamamoto)
+
+2002-07-23 Mo DeJong <mdejong@users.sourceforge.net>
- * cygtcl.m4: Update from Tcl.
* unix/configure: Regen.
- * unix/configure.in: Use TCL_TOOL_SHARED_LIB_LONGNAME
- and TCL_TOOL_STATIC_LIB_LONGNAME to generate lib names.
- * win/configure: Regen.
- * win/configure.in: Use TCL_TOOL_SHARED_LIB_LONGNAME
- and TCL_TOOL_STATIC_LIB_LONGNAME to generate lib names.
+ * unix/tcl.m4: Update from Tcl.
-2001-07-24 Mo DeJong <mdejong@redhat.com>
+2002-07-22 Mo DeJong <mdejong@users.sourceforge.net>
- * generic/default.h: Include tkWinDefault.h
- when built with Cygwin or Mingw.
+ * library/choosedir.tcl (tk::dialog::file::chooseDir):
+ * library/clrpick.tcl (tk::dialog::file::chooseDir):
+ * library/msgbox.tcl (tk::MessageBox):
+ * library/tkfbox.tcl (tk::dialog::file):
+ * library/xmfbox.tcl (tk::MotifFDialog):
+ Revert [Tk patch 568278]. The transient window workaround
+ is no longer needed since the fix for [Tk bug 570764]
+ solved the problem for withdrawn transients.
-2001-07-24 Mo DeJong <mdejong@redhat.com>
+2002-07-19 Mo DeJong <mdejong@users.sourceforge.net>
+ * unix/configure:
+ * unix/configure.in:
* win/configure:
- * win/tcl.m4: Update from Tcl.
+ * win/configure.in: Add AC_PREREQ(2.13) in an attempt
+ to make it more clear that the configure scripts
+ must be generated with autoconf version 2.13.
+ [Tcl Bug 583573]
+
+2002-07-19 D. Richard Hipp <drh@hwaci.com>
+
+ * library/mkpsec.tcl: Fix a bug that was causing postscript generation
+ to fail under Win2K.
+
+2002-07-18 Reinhard Max <max@suse.de>
+
+ * unix/tkUnixSend.c: Using Tcl_GetTime instead of TclpGetTime.
+
+2002-07-17 Reinhard Max <max@suse.de>
+
+ * library/unsupported.tcl: Extended ExposePrivateVariable, and
+ ExposePrivateCommand to accept patterns as well.
+
+2002-07-17 Don Porter <dgp@users.sf.net>
+
+ * generic/tkFont.c: Corrected reversed logic in assert -> panic
+ conversion. [Bug 582799]
+
+2002-07-16 Mo DeJong <mdejong@users.sourceforge.net>
-2001-07-12 Mo DeJong <mdejong@redhat.com>
+ * generic/tkFont.c (TkFontPkgFree): Call panic instead
+ of assert since assert is not used in the rest of Tk.
+ [Tk bug 579651]
+2002-07-16 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Add a more descriptive warning
+ in the event `make genstubs` needs to be rerun.
+
+2002-07-16 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * win/tkWinWm.c:
+ * doc/wm.n: fix for part of [Bug 581627], and made iconbitmap
+ code on Windows more flexible about reading in icons [Bug
+ 220800].
+
+2002-07-15 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.bc (new): re-add of the borland makefile. Submitted
+ by Helmut Giese <hgiese@ratiosoft.com>. This needs testing, still.
+
+2002-07-15 Don Porter <dgp@users.sf.net>
+
+ * Fixes for [Bug 581627, 581795].
+ * generic/tkTest.c: Test commands not supported on non-Unix
+ platforms should not be defined there in the first place.
+ * tests/constraints.tcl: Fixed "secureserver" constraint.
+ * tests/unixWm.test: Some tests needed "unix" constraint.
+ * win/tkWinWm.c: Typo in error message.
+
+2002-07-14 Don Porter <dgp@users.sf.net>
+
+ * tests/event.test: Fixes to enable testing of only userInteraction
+ * tests/visual_bb.test: tests.
+
+ * README: Bumped HEAD to version 8.4b2 in order to
+ * generic/tk.h: distinguish it from the 8.4b1 release.
+ * unix/configure*: Also extended LOCALES to cover all message
+ * unix/tk.spec: catalogs.
+ * win/configure*:
+
+ * tests/focustTcl.test: Conversion bug: Corrected backwards logic.
+ * tests/imgPhoto.test: Conversion bug: overwrote unix/README.
+
+ * tests/all.tcl: Completed conversion of Tk test suite
+ * tests/constraints.tcl: to use tcltest.
+ * tests/[b-v]*.test:
* unix/Makefile.in:
+
+2002-07-12 Don Porter <dgp@users.sf.net>
+
+ * tests/constraints.tcl: Converted more files to tcltest and
+ * tests/[g-x]*.test: factored out common code.
+
+2002-07-11 Don Porter <dgp@users.sf.net>
+
+ * tests/canvPsImg.tcl: Converted several files in the
+ * tests/constraints.tcl (new file): Tk test suite for testing by
+ * tests/[r-x]*.test: tcltest 2.1.
+ * unix/Makefile.in:
+
+2002-07-11 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd): initialize
+ utfTitle to NULL, add a few more notes about limitations of
+ possible new Tk_ChooseDirectoryObjCmd function.
+
+2002-07-11 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/imgPhoto.test (imgPhoto-15.1): Added test of mem-alloc
+ failure, but this is non-portable.
+ * generic/tkImgPhoto.c (ImgPhotoSetSize): Allowed this function to
+ fail when it can't allocate enough memory. Note that not all the
+ places that call it can fail nicely without API changes; some
+ still panic but at least some of the potential failures are now
+ handled gracefully.
+
+ * tests/visual_bb.test (lpr): Stopped this from relying on
+ external files; direct piping is much more flexible for this
+ application.
+
+2002-07-09 Don Porter <dgp@users.sf.net>
+
+ * generic/tkTest.c: Removed unused dependence on TclThread_Init()
+ * tests/defs.tcl: and [testthread]. [Bug 578165, Tcl Bug 531413]
+
+2002-07-08 David Gravereaux <davygrvy@pobox.com>
+
+ * unix/Makefile.in: Added missing win/lamp.bmp to the dist
+ target.
+
+2002-07-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4b1 TAGGED FOR RELEASE ***
+
+2002-07-04 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/bgerror.tcl (bgerror): Stopped the bgerror dialog from
+ getting wider than the screen; in theory really long messages
+ could make it become taller than the screen now, but that's much
+ less likely to happen. Also trimmed a little bit of internal
+ space so that the icon-message gap is the same as the icon-frame
+ and message-frame gaps.
+
+2002-07-01 Don Porter <dgp@users.sf.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Updated to latest tcl.m4 from Tcl.
+
+2002-06-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/msgbox.tcl (MessageBox): Force all non-button widgets to
+ have the same background as the containing toplevel. [Bug #552515]
+
+2002-06-27 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * win/Makefile.in (install-binaries): Fix of troubled Makefile
+ quoting introduced by [Patch 521356] causing the installed to
+ fail.
+
+2002-06-25 Don Porter <dgp@users.sf.net>
+
+ * unix/tkUnixFont.c: (Tk_DrawChars) silence compiler warning.
+
+2002-06-26 David Gravereaux <davygrvy@pobox.com>
+
+ * generic/tkStyle.c: <eol> of the committing cvs client didn't
+ match the <eol> of the file itself. Windows users where getting
+ \r\r\n. Problem fixed.
+
+2002-06-26 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * generic/tkFont.c (TkTextLayoutToPostscript): fixed potential
+ buffer overflow which could be intentionally triggered from
+ within safe interpreter -- malicious applet could modify
+ tk::psglyphs array.
+
+2002-06-26 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * tests/font.test (font-32.1): updated this test
+ to expect the new behavior of canvas postscript.
+
+2002-06-25 Don Porter <dgp@users.sf.net>
+
+ * unix/Makefile.in: Expanded install-binaries target to create
+ * win/Makefile.in: and install a pkgIndex.tcl file to enable
+ Tk as a loadable package [Patch 521356]
+
+2002-06-25 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * library/mkpsenc.tcl: (added) utilities to generate
+ Postscript prolog for current system encoding.
+ * generic/tkCanvPs.c (TkCanvPostscriptCmd): now
+ uses mkpsenc.tcl to generate Postscript prolog.
+ * generic/tkFont.c (TkTextLayoutToPostscript): modified
+ according to patch #546910. Now outputs system-encoded
+ characters (for unibyte) or Adobe glyph names (for
+ multibyte or outside-locale).
+ * tests/canvText.test (canvText-17.1): updated this test
+ to expect the new behavior of canvas postscript.
+
+2002-06-25 Reinhard Max <max@suse.de>
+
+ * unix/tcl.m4: New macro SC_CONFIG_MANPAGES.
+ * unix/configure.in: Added support for symlinks and compression
+ * unix/Makefile.in: when installing the manpages. [Patch 518052]
+ Default is still hardlinks and no compression.
+
+ * unix/mkLinks: generated
+ * unix/configure:
+
+ * unix/README: Added documentation for the new features.
+
+ * unix/configure: Replaced ${exec_prefix}/lib
+ * unix/tcl.m4 (SC_PATH_TCLCONFIG): by ${libdir}.
+
+2002-06-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/winWm.test: Verify that both an unmapped
+ and already mapped toplevel are raised and receive
+ the focus when deiconified.
+ * tests/wm.test: Add wm deiconify tests. Check that
+ a toplevel that has never been mapped is not mapped
+ by the deiconify command since it should be done
+ at idle by MapFrame.
+ * win/tkWinWm.c (Tk_WmCmd): Check the WM_NEVER_MAPPED
+ flag while processing the wm deiconify command.
+ The WM_UPDATE_PENDING flag should never be set when
+ WM_NEVER_MAPPED is set, but double check so that
+ the implementation is more explicit and matches
+ the comment just above.
+ Return without invoking TkWmRestackToplevel or
+ TkSetFocusWin on a toplevel that has never been
+ mapped. This fixes a bug where a toplevel is mapped
+ with the wrong size and is then resized by the
+ idle call to MapFrame. [Tk bug 233150]
+
+2002-06-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWm.c (UpdateGeometryInfo): remove the check for a null
+ wrapper introduced in r1.41 on 2002-06-15 because it prevented
+ geometry setting from taking effect if the window was not on the
+ screen. Another check may go in it's place as IsIconic and
+ IsZoomed should not be passed NULL.
+
+2002-06-22 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Remove invalid minsize test. Add update
+ calls to wm transient tests so that idle handlers get
+ run. This is needed to get the tests to pass under Win32.
+ * unix/tkUnixWm.c (WmWaitMapProc): Move the special
+ transient withdrawn check into the if body to
+ make it easier to set a breakpoint on this test
+ inside a debugger. No functional changes.
+ * win/tkWinWm.c (WmWaitVisibilityOrMapProc): Ditto.
+
+2002-06-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/wm.n: TIP #95 Windows implementation and
+ * mac/tkMacWm.c (Tk_WmCmd): docs with mac and unix stubs.
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinWm.c (Tk_WmCmd):
+ * tests/unixWm.test:
+ * tests/winWm.test: more wm attr tests will be needed.
+
+ * generic/tkGrid.c (GridReqProc): check that gridPtr is not NULL
+ (may be when embedded). [Bug #548791] (halliday)
+
+ * generic/tkFont.c (TkFontPkgFree): changed panic on freeing fonts
+ to an assert, and wrapped panic in #ifdef PURIFY. [Bug #568701]
+
+ * library/menu.tcl: corrected menus from being posted offscreen
+ on Windows. [Bug #464451] (darley)
+
+ * library/console.tcl: corrected the defaultPrompt substitution
+ [Bug #553207] and made Tab a default expansion key (like Escape).
+
+ * win/tkWinEmbed.c (EmbedWindowDeleted): added a check for a null
+ containerPtr. The core of this bug is likely elsewhere. [Bug #476176]
+
+ * doc/text.n: TIP #93 implementation that
+ * generic/tkText.c (TextWidgetCmd): enhances the text get and
+ * generic/tkTextIndex.c (TkTextGetIndex): delete methods to accept
+ * tests/text.test: multiple range pairs.
+ This handles the delete case in an atomic, fixed-index fashion.
+
+2002-06-21 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Add tests to make sure a withdrawn
+ transient does not get remapped by state changes
+ in the master.
+ * unix/tkUnixWm.c (Tk_WmCmd, WmWaitMapProc):
+ * win/tkWinWm.c (Tk_WmCmd, WmWaitVisibilityOrMapProc):
+ Add a WM_TRANSIENT_WITHDRAWN flag that gets set by the
+ withdraw, deiconify, or state wm subcommands. Check
+ this flag before mapping a transient when processing
+ a MapNotify event. [Tk bug 570764]
+
+2002-06-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * unix/tk.spec (version), README, win/configure.in, unix/configure.in:
+ * generic/tk.h (TK_RELEASE_*, TK_PATCH_LEVEL): Bumped to beta1.
+
+2002-06-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/text.n: TIP #104 implementation which generalizes the
+ * generic/tkText.c: undo/redo stack to not be tied solely to the
+ * generic/tkText.h: text widget. The APIs are still private.
+ * generic/tkUndo.c: This also adds a stack limiting ability and
+ * generic/tkUndo.h: a -maxundo option to the text widget (in
+ * library/text.tcl: addition to the options from TIP #26) should
+ * mac/tkMacDefault.h: users want to limit the undo/redo stack
+ * tests/text.test: (should not be necessary in most cases).
+ * unix/Makefile.in: [Patch #554763] (callewart)
+ * unix/tkUnixDefault.h:
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/tkWinDefault.h:
+
+2002-06-21 Don Porter <dgp@users.sf.net>
+
+ * unix/Makefile.in: Removed unnecessary dependence of tktest
+ * unix/tkAppInit.c: executable on the tcltest executable on
+ Unix. If there are similar dependencies on other platforms, they
+ can probably be removed as well. [Bug 572134].
+
+2002-06-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/listbox.n:
+ * generic/tkListbox.c (DisplayListbox):
+ * mac/tkMacDefault.h: TIP #94 implementation adding -activestyle
+ * tests/listbox.test: option to the listbox. This adds the ability
+ * unix/tkUnixDefault.h: to have listboxes look native on Windows, and
+ * win/tkWinDefault.h: "nicer" elsewhere using the 'dotbox' style.
+
+2002-06-20 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkGrid.c: Corrected the test for grid propagate change.
+ [Bug #571433]
+
+2002-06-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/panedwindow.test:
+ * generic/tkPanedWindow.c: ensure that sash index is lower bounds
+ checked. [Bug #548727]
+
+2002-06-19 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkClipboard.c (TkClipCleanup): Add code
+ to set dispPtr->clipWindow to NULL, this was
+ accidently removed by last commit. Fixes
+ a crash while running the tests under win32.
+
+2002-06-19 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkBind.c (TkBindDeadWindow):
+ Handle case where Tk_DestroyWindow is invoked
+ on clipboard and send windows.
+ * generic/tkClipboard.c (TkClipCleanup):
+ Invoke Tk_DestroyWindow to cleanup the
+ dispPtr->clipWindow. Call Tcl_Preserve
+ and Tcl_Release on the window to avoid an
+ invalid memory ref on shutdown.
+ * generic/tkEvent.c (Tk_HandleEvent):
+ Panic if XCreateIC is invoked twice for
+ the same window. This should never happen,
+ the check were just added to make sure it
+ does not since this could lead to crashes
+ in XCloseIM.
+ * generic/tkFocus.c (TkFocusDeadWindow):
+ Handle case where Tk_DestroyWindow is invoked
+ on clipboard and send windows.
+ * generic/tkOption.c (TkOptionDeadWindow): Ditto.
+ * generic/tkWindow.c (TkCloseDisplay): Move
+ deletion of dispPtr->winTable after TkpCloseDisplay
+ call since Tk_DestroyWindow uses it and could
+ be called by TkpCloseDisplay for clipboard/send windows.
+ Also invoke ckfree for the dispPtr instead of
+ doing it in TkpCloseDisplay.
+ (Tk_DestroyWindow): Check for a null winPtr->mainPtr
+ before doing certain cleanup tasks so the we can
+ invoke Tk_DestroyWindow on clipboard and send windows.
+ We need to do this so that XDestroyIC will get invoked
+ for the input contexts of each window.
+ * mac/tkMacXStubs.c (TkpCloseDisplay): Don't free
+ the displayPtr since this is now done in TkCloseDisplay.
+ * unix/tkUnixEvent.c (TkpCloseDisplay, OpenIM): Remove
+ conditional compilation around calls to XCloseIM
+ since I am confident that the crashes related to
+ input contexts has been fixed. Don't free
+ the displayPtr since this is now done in TkCloseDisplay.
+ * unix/tkUnixSend.c (TkSendCleanup): Invoke the
+ Tk_DestroyWindow method to cleanup the special
+ send window. This will call XDestroyIC and thereby
+ avoid a crash in XCloseIM. The send window needs
+ to be Tcl_Preserve and Tcl_Release to avoid an
+ invalid memory ref on shutdown.
+ * win/tkWinX.c (TkpCloseDisplay): Don't free
+ the displayPtr since this is now done in TkCloseDisplay.
+ [Tk patch 570902]
+
+2002-06-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkStyle.c: TIP#48 style engine.
+ See http://purl.org/tcl/tip/48.html for details.
+
+ * generic/tkConfig.c (GetOptionFromObj): Split to allow for access
+ to option tables via name as well as via object.
+ (TkGetOptionSpec): Semi-public interface to GetOption functionality.
+ (DoObjConfig, Tk_RestoreSavedOptions, FreeResources)
+ (GetObjectForOption): Basic style support for configure.
+
+ * generic/tkWindow.c (TkCreateMainWindow, Tk_DestroyWindow): Added
+ calls to set up and tear down the style subsystem.
+
+ * generic/tk.decls, generic/tk.h: Many declarations forming TIP#48
+ public interface.
+
+ * generic/tkInt.decls (TkStylePkgInit,TkStylePkgFree):
+ * generic/tkInt.h (TkGetOptionSpec): Supporting declarations.
+
+ * unix/Makefile.in, win/Makefile.in, win/makefile.vc: Added
+ tkStyle.c to list of generic source files.
+
+2002-06-18 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/defs.tcl (makeFile): Defined the return value of this
+ procedure to be the filename of the created file, as in the real
+ tcltest package...
+
+2002-06-17 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkImage.c (Tk_ImageObjCmd, DeleteImage): Call
+ Tcl_Preserve and Tcl_Release for the masterPtr->winPtr
+ window to avoid accessing memory that had already
+ been deallocated in DeleteImage.
+
+2002-06-17 David Gravereaux <davygrvy@pobox.com>
+
+ Trims to support the removal of RESOURCE_INCLUDED from rc
+ scripts from Tcl's accepted FR #565088.
+
+ * generic/tk.h: Changed RESOURCE_INCLUDED to be RC_INVOKED
+ as the RC tool defines this already by default.
+
+ * win/rc/tk.rc:
+ * win/rc/wish.rc: removed the #define RESOURCE_INCLUDED lines.
+
+2002-06-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (dist): correct installation of
+ wish.exe.manifest to DISTDIR target directory.
+
+ * generic/tkCmds.c (Tk_TkObjCmd):
+ * generic/tkInt.h (struct TkCaret):
+ * mac/tkMacXStubs.c (Tk_SetCaretPos):
+ * unix/tkUnixKey.c (TkpGetString, Tk_SetCaretPos):
+ * win/tkWinX.c (Tk_SetCaretPos):
+ * tests/tk.test: Added 'tk caret' implementation of TIP#96
+ * doc/SetCaret.3 (new): which adds a TkCaret structure element to
+ * doc/tk.n: TkDisplay for maintaining state.
+
+ * unix/tkUnixSend.c (TkSendCleanup): special cleanup of
+ inputContext to avoid bug in XCloseIM. (dejong)
+
+2002-06-17 Don Porter <dgp@users.sf.net>
+
+ * library/msgs/en_gb.msg: Added catalog for UK English.
+ Currently includes only Color -> Colour translation.
+
+2002-06-17 D. Richard Hipp <drh@hwaci.com>
+
+ * doc/checkbutton.n:
+ * doc/radiobutton.n:
+ * generic/tkButton.c:
+ * generic/tkButton.h:
+ * mac/tkMacButton.c:
+ * tests/button.test:
+ * unix/tkUnixButton.c:
+ * win/tkWinButton.c: Implementation of TIP#82 - Added the
+ -offrelief option to checkbutton and radiobutton.
+
+2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkWindow.c (Tk_DestroyWindow): Set the pathName
+ component of a window to NULL after its memory has been
+ deallocated to avoid a possible illegal memory access
+ as a result of a call to Tk_PathName() on a Tk_Window
+ structure of a window that has already been destroyed.
+ [Tk bug 521946]
+
+2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkOption.c (Tk_GetOption): Allocate
+ memory with ckalloc not malloc. This keeps
+ Tk from erroring out when built with
+ TCL_MEM_DEBUG.
+
+2002-06-14 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkBind.c (HandleEventGenerate):
+ * generic/tkInt.h: changed warpInProgress boolean from int to a
+ bit in the flags variable (TK_DISPLAY_IN_WARP)
+
+ * generic/tkCmds.c (Tk_TkObjCmd):
+ * unix/tkUnixKey.c (TkpGetString):
+ * generic/tkEvent.c (Tk_HandleEvent):
+ * generic/tkInt.h: changed useInputMethods boolean from int to a
+ bit in the flags variable (TK_DISPLAY_USE_IM)
+
+ * generic/tkInt.h:
+ * generic/tkCmds.c (Tk_WmObjCmd):
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinWm.c (Tk_WmCmd): changed wmTracing from being an int to
+ just a bit in the flags variable (TK_DISPLAY_WM_TRACING)
+
+ * generic/tkEvent.c (Tk_HandleEvent):
+ * unix/tkUnixEvent.c (OpenIM):
+ * unix/tkUnixKey.c (TkpGetString):
+ * generic/tkInt.h: added TK_DISPLAY_XIM_SPOT flag bit for TkDisplay
+ and used this to allow a runtime check to see if over-the-spot XIM
+ is possible. If not it will try and fallback to the old-style
+ input context, which handles things like dead keys input.
+
+ * generic/tk.decls: added TIP #84 implementation that adds a
+ * generic/tkDecls.h: Tk_CollapseMotionEvents API which controls
+ * generic/tkEvent.c: Tk's collapsing of incoming motion events
+ * generic/tkInt.h: on its windows. The default remains to do
+ * generic/tkStubInit.c: collapsing. Added a flags parameter to the
+ * generic/tkWindow.c: internal display structure to support this
+ * doc/QWinEvent.3: and be used in the future for other bits.
+ [Tk patch 564642]
+
+ * unix/mkLinks: updated from current docs
+
+2002-06-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkEvent.c (TkXErrorHandler): Declare static
+ function to avoid compiler error with VC++.
+ * generic/tkBind.c (ExpandPercents): Cast argument to
+ Tk_GetAtomName in order to avoid compiler warning.
+
+2002-06-14 Joe English <jenglish@users.sf.net>
+
+ * doc/bind.n:
+ * generic/tk.h:
+ * generic/tkBind.c:
+ * generic/tkCanvWind.c:
+ * generic/tkCmds.c:
+ * generic/tkEvent.c:
+ * generic/tkFocus.c:
+ * generic/tkGrab.c:
+ * generic/tkGrid.c:
+ * generic/tkImage.c:
+ * generic/tkPack.c:
+ * generic/tkPlace.c:
+ * generic/tkPointer.c:
+ * generic/tkTextWind.c:
+ * generic/tkWindow.c:
+ * mac/tkMacSubwindows.c:
+ * mac/tkMacWindowMgr.c
+ * mac/tkMacWm.c:
+ * unix/Makefile.in:
+ * unix/tkUnixEmbed.c:
+ * unix/tkUnixWm.c:
+ * win/tkWinScrlbr.c:
+ * win/tkWinWindow.c:
+ * win/tkWinWm.c: Implementation of TIP #47 by Neil McKay
+ "Modifying Tk to Allow Writing X Window managers".
+ Add CirculateRequest, Create, MapRequest, ResizeRequest,
+ and ConfigureRequest event types;
+ Split TK_TOPLEVEL flag into TK_TOPLEVEL, TK_HAS_WRAPPER,
+ TK_WIN_MANAGED, and TK_TOP_HIERARCHY. [Tk patch 572978]
+
+2002-06-14 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * unix/tkAppInit.c: Removed now unneeded and erroneous reference
+ to 'matherr'. See Tcl ChangeLog entry 2002-05-31 Don Porter.
+
+2002-06-14 David Gravereaux <davygrvy@pobox.com>
+
+ * win/rules.vc: The test for compiler optimizations was in error.
+ Thanks goes to Roy Terry <royterry@earthlink.net> for his
+ assistance with this.
+
+2002-06-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ Implement TIP 98 [Tk patch 566765]
+
+ * doc/FindPhoto.3, generic/tk.h, generic/tk.decls:
+ * generic/tkImgPhoto.c: Changed *_Old to *_NoComposite and
+ USE_OLD_PHOTO_PUT_BLOCK to USE_COMPOSITELESS_PHOTO_PUT_BLOCK
+ following a suggestion from Don Porter.
+
+ * tests/imgPhoto.test: Added tests of -compositingrule
+
+ * doc/photo.n: Added documentation for "-compositingrule".
+ * generic/tkImgPhoto.c (ImgPhotoCmd, ParseSubcommandOptions): New
+ "-compositingrule" option for [$photo copy] subcommand, using
+ OPT_COMPOSITE flag and compositingRule field in SubcommandOptions
+ structure.
+
+ * doc/FindPhoto.3: Documented the extra argument for the
+ compositing rule and the action to take if anyone wants to
+ maintain total backward-compatability.
+
+ * generic/tk.h (TK_PHOTO_COMPOSITE_*): Defined values for use as
+ compositing rules.
+ (USE_OLD_PHOTO_PUT_BLOCK): Added a way for users to select the old
+ interface to Tk_PhotoPutBlock to provide an easier upgrade path.
+
+ * generic/tk.decls: Alter Tk_PhotoPut*Block to Tk_PhotoPut*Block_Old
+ and introduce new slots for the old name of function with an extra
+ argument at the end for the compositing rule.
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Updated "transparency set"
+ subcommand to use TkSubtractRegion().
+
+ * win/tkWinRegion.c (TkSubtractRegion):
+ * mac/tkMacRegion.c (TkSubtractRegion):
+ * generic/tkInt.decls (TkSubtractRegion):
+ * unix/tkUnixPort.h (TkSubtractRegion): Added function to perform
+ the set-difference operation on regions; it seems all platforms
+ can support it, and it makes removing rectangular bits from
+ regions much easier.
+
+ * generic/tkImgPPM.c (FileReadPPM): Reading a PPM/PGM always uses
+ the SET compositing rule because it is faster and the format does
+ not have any transparency information.
+
+ * generic/tkImgGIF.c (FileReadGIF): Reading a GIF always uses the
+ SET compositing rule because GIF files model transparency as a
+ single special colour.
+
+ * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock):
+ Added a compositing rule to allow better control over what happens
+ to transparent pixels when inserting data into a photo image.
+
+2002-06-13 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/winfo.test: Add basic tests for winfo ismapped.
+
+2002-06-13 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/unixWm.test:
+ * tests/wm.test: Move wm minsize and wm maxsize
+ usage tests into the cross platform wm tests.
+
+2002-06-13 Don Porter <dgp@users.sf.net>
+
+ * tests/cursor.test: corrected error after cursor-2.2.
+ * tests/defs.tcl: Added enhancements to Tk's fake version of
+ tcltest required by recent cursor.test changes.
+
+2002-06-13 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/cursor.test (cursor-2.[34]): Tests added to ensure that
+ cursor specs really are well-behaved lists. Also some general
+ clean-up...
+ * win/tkWinCursor.c (TkGetCursorByName): Undone Jeff's back-off
+ and fixed things so that they should work now. Cursor specs are
+ lists first and foremost.
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * changes: Clearly label wm transient changes as
+ a POTENTIAL INCOMPATIBILITY.
+ * doc/wm.n: Remove "some window managers will" text
+ and explicitly state what behavior a transient
+ window will display. Also mention that it is an
+ error to make a window a transient of itself.
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/choosedir.tcl (tk::dialog::file::chooseDir):
+ * library/clrpick.tcl (tk::dialog::file::chooseDir):
+ * library/msgbox.tcl (tk::MessageBox):
+ * library/tkfbox.tcl (tk::dialog::file):
+ * library/xmfbox.tcl (tk::MotifFDialog): Remove the
+ transient property on dialogs after they have been
+ dismissed to insulate them from further state changes
+ in the master. This keeps a withdrawn dialog from
+ being mapped when the master is deiconified. [Tk patch 568278]
+
+2002-06-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinCursor.c (TkGetCursorByName): reverted fix from
+ 2002-06-06 because it broke the ability to use built-in cursors
+ like left_ptr.
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/choosedir.tcl (tk::dialog::file::chooseDir):
+ * library/clrpick.tcl (tk::dialog::color):
+ * library/dialog.tcl (tk_dialog):
+ * library/msgbox.tcl (tk::MessageBox):
+ * library/tkfbox.tcl (tk::dialog::file):
+ * library/xmfbox.tcl (tk::MotifFDialog_Create):
+ Only make the dialog window a transient if
+ the master is visible. This check already
+ appeared in some of the dialogs. This patch
+ just copies the check into those that were
+ lacking. [Tk patch 568253]
+
+2002-06-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * changes: Add note about new transient behavior.
+ * tests/unixWm.test: Check that the WM_TRANSIENT_FOR
+ property for a transient window is being cleared
+ when the master is destroyed.
+ * tests/wm.test: Source defs.tcl instead of using
+ tcltest to match the rest of Tk's test files.
+ Add new tests that ensure that a transient's state
+ mirrors the state of the master.
+ * unix/tkUnixWm.c (WmInfo, TkWmNewWindow, TkWmMapWindow,
+ TkWmDeadWindow, Tk_WmCmd, WmWaitMapProc): Add numTransients
+ member to WmInfo structure. Keep state of master and
+ transient in sync using a callback that tracks MapNotify
+ and UnmapNotify events. When the master is mapped, map
+ the transient. When the master is unmapped or iconified,
+ withdraw the transient.
+ * win/tkWinWm.c (TkWmMapWindow, TkpWmSetState,
+ TkWmDeadWindow, Tk_WmCmd, WmWaitVisibilityOrMapProc):
+ Keep state of master and transient in sync using a
+ callback that tracks MapNotify and UnmapNotify events.
+ Move masterPtr check from TkpWmSetState into TkWmMapWindow
+ to deal with WM_NEVER_MAPPED transients. Cleanup
+ numTransients and the callback in TkWmDeadWindow.
+ Cleanup numTransients and the callback only after
+ deleting a master in wm transient command to avoid
+ deleting the callback when an error is raised.
+ Add support for MapNotify and UnmapNotify events
+ to the master callback. [Tk patch 561708]
+
+2002-06-11 Joe English <jenglish@users.sf.net>
+
+ * library/menu.tcl: fix for bug report #530212 "Bad Window Path
+ Name in tkMenuFind"
+
+2002-06-10 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Fixed a win98 issue where the /exclude option
+ for xcopy is unsupported.
+ Reported by Roy Terry <royterry@earthlink.net>.
+
+2002-06-10 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * library/tk.tcl: added utility functions to get "-underline" and
+ "-text" for labels and buttons from translatable string containing
+ "magic ampersand" [patch #566605]
+ * library/clrpick.tcl:
+ * library/msgbox.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl: some places where msgcat is used to get
+ translated label are modified to handle labels with magic ampersand.
+ * library/msgs/ru.msg: russian translations added
+ * library/msgs/cs.msg:
+ * library/msgs/de.msg:
+ * library/msgs/el.msg:
+ * library/msgs/es.msg:
+ * library/msgs/fr.msg:
+ * library/msgs/it.msg:
+ * library/msgs/nl.msg: all translation files now have labels with
+ 'magic ampersand' where appropriate. In el.msg some ampersands are
+ missing, as I don't know which underline positions seems natural
+ to "el" users.
+
+2002-06-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/bgerror.tcl (tk::dialog::error::bgerror):
+ Don't set the bgerror dialog as a transient of
+ itself since this operation is ill defined.
+
+2002-06-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * win/tkWinCursor.c (TkGetCursorByName): Fixed so that the reading
+ of cursors from a file with a cursor spec was built using [list]
+ works when the file has a space in instead of requiring fiddling
+ with backslashes.
+
+2002-06-06 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * library/msgbox.tcl (MessageBox): Add -default normal
+ when creating non-default buttons for message box.
+ They already get -default normal when they're
+ unfocused, and dialog window size used to change suddenly
+ in such cases.
+
+2002-06-05 Anton Kovalenko <a_kovalenko@users.sourceforge.net>
+
+ * unix/tkUnixFont.c (Tk_DrawChars): Don't assume that
+ one char is always one byte, and that required
+ subfont for the last character in any string is
+ the same as for the previous character
+ [Bug #559435] [Patch #559437]
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * changes: Document [wm transient .t .t] error.
+ * tests/wm.test: Check that setting a window
+ as a transient of itself raises an error. Check
+ that passing a non-toplevel window to the wm
+ transient command uses the enclosing toplevel.
+ * unix/tkUnixWm.c (Tk_WmCmd): Raise an error
+ if the user tries to make a toplevel a
+ transient of itself.
+ * win/tkWinWm.c (Tk_WmCmd): Raise an error
+ if the user tries to make a toplevel a
+ transient of itself. Test for other error
+ before checking for the transient self error.
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/tkUnixWm.c (WmInfo, TkWmCleanup, TkWmNewWindow,
+ TkWmMapWindow, TkWmDeadWindow, Tk_WmCmd): Replace
+ WmInfo's master and masterWindowName members with
+ a masterPtr member. This implementation is much
+ simpler and mirrors the Win32 implementation. This
+ change makes it easy to check the flags of the
+ master window. No user visible changes.
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * generic/tkInt.decls: Add unix decl for TkpWmSetState.
+ * generic/tkIntPlatDecls.h: Regen.
+ * generic/tkStubInit.c: Regen.
+ * tests/wm.test: Test state changes between iconic,
+ normal, and withdrawn both before and after initial
+ mapping.
+ * unix/tkUnixWm.c (Tk_WmCmd, TkpWmSetState): Move
+ state change code into TkpWmSetState to more closely
+ match the Win32 implementation. No user visible changes.
+
+2002-05-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/embed.test: Added cross platform embed tests.
+ Check that window passed to -use has the -container
+ option set.
+ * tests/wm.test: Remove useless catch call. Deiconify
+ . just in case, stackorder tests will not pass unless
+ it is in the normal state. Add -container flag to
+ embedded stackorder test.
+ * unix/tkUnixEmbed.c (TkpUseWindow):
+ * win/tkWinEmbed.c (TkpUseWindow): Lookup Tk window
+ based on the id passed in as the value for -use.
+ Generate an error if the Tk window did not have
+ the -container option set.
+
+2002-05-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkButton.c (ConfigureButton): When creating
+ a radiobutton with -value "" it was not drawn properly
+ if the -variable was created by the radiobutton.
+ [Bug #548765]
+
+2002-05-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkCanvText.c (ComputeTextBbox): Negative
+ coordinates were rounded badly causing a 1 pixel
+ displacement. [Bug #556526]
+
+2002-05-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * mac/tkMacWm.c (Tk_WmCmd):
+ * tests/unixWm.test: Move wm transient checks over
+ to wm.test so they will be run on all systems.
+ * tests/wm.test: Add tests to check for error when
+ an iconwindow is passed to the wm transient command.
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinWm.c (Tk_WmCmd): Raise an error if one
+ of the windows passed to the wm transient command
+ is an iconwindow for another toplevel.
+
+2002-05-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * mac/tkMacWm.c (TkWmStackorderToplevelWrapperMap):
+ * tests/wm.test: Add embedded Window test case for
+ the stackorder command.
+ * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap):
+ * win/tkWinWm.c (TkWmStackorderToplevelWrapperMap):
+ Ignore embedded windows during wm stackorder command.
+
+2002-05-21 Mo DeJong <mdejong@users.sourceforge.net>
+
* unix/configure: Regen.
- * unix/configure.in:
- * unix/tcl.m4:
+ * unix/configure.in: Invoke SC_ENABLE_SHARED before
+ calling SC_CONFIG_CFLAGS so that the SHARED_BUILD
+ variable can be checked inside SC_CONFIG_CFLAGS.
+ * unix/tcl.m4: Update from Tcl.
+
+2002-05-20 Don Porter <dgp@users.sourceforge.net>
+
+ * library/tk.tcl: A little namespace cleanup on Daniel Steffen's
+ latest revisions to avoid defining new global commands.
+
+2002-05-20 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacInit.c:
+ * mac/tkMacTclCode.r: include msgcat package in resources
+ as bgerror depends on it. Restores ability of mac static
+ build to run standalone (except for encoding file issues).
+
+ * mac/tkMacInit.c:
+ * library/console.tcl:
+ * library/tk.tcl: fix tk.tcl not sourcing library files
+ that define bindings at startup on mac. (independent of
+ tk library files being in resources or on auto_path)
+
+2002-05-08 Don Porter <dgp@users.sourceforge.net>
+
+ * library/bgerror.tcl:
+ * library/tclIndex: Cleaned up namespace usage of the bgerror
+ dialog. Completes soft dependence on msgcat. [FR 539309]
+
+2002-05-07 David Gravereaux <davygrvy@pobox.com>
+ * win/makefile.vc: Problem with TCLDIR macro not accepting
+ forward slash path seperators resolved. Added the same logic
+ to INSTALLDIR, too. [Bug #553208]
+
+2002-04-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/tcl.m4: change HP-11 SHLIB_LD_LIBS from "" to ${LIBS} so
+ that the .sl knows its dependent libs.
+
+2002-04-24 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacTclCode.r:
+ * mac/tkMacResource.r: added check of
+ TCLTK_NO_LIBRARY_TEXT_RESOURCES #define to allow disabling the
+ inclusion of the tk library code in the resource fork of Tk
+ executables and shared libraries.
+ Moved tk library code inclusion to separate file like in tcl.
+ Added 'panedwindow' resource.
+
+2002-04-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/button.tcl (ButtonLeave): corrected the 3
+ implementations of ButtonLeave to check for Priv(relief) existing
+ before trying to use it. [Patch #541849]
+
+ * generic/tkTextDisp.c (DisplayLineBackground):
+ * unix/tkUnix3d.c (Tk_3DHorizontalBevel):
+ * unix/tkUnixFont.c (Tk_DrawChars): applied fixes to not overrun
+ the X window 16-bit size limit. [Patch #541999] (bonfield)
+
+2002-04-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkTextDisp.c (GetXView, GetYView): Comparison with
+ previous values of scrollbar range are now done in a way that is
+ sensitive to the bizarreness of floating-point on architectures
+ where IEEE-FP is not used on the processor. Also increased the
+ size of the temporary buffer to take account of the fact that
+ TCL_DOUBLE_SPACE is meant to only imply enough space to take a
+ printed double and trailing '\0', and no more. [Bug #223739]
+ (FP_EQUAL_SCALE): New macro to help compare floating-point numbers
+ for equality in a sane way, used in GetXView and GetYView.
+
+2002-04-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkWindow.c (TkCloseDisplay): Added to centralize where a
+ display was closed. This handles freeing memory associated with a
+ display and closing it.
+ (DeleteWindowsExitProc): actually close displays. This would also
+ ideally be done in Tk_DestroyWindow when the last window on the
+ display has been closed, but that still has unresolved order of
+ cleanup problems.
+ (Tk_DestroyWindow): added TkFocusFree call.
+
+ * generic/tkStubInit.c:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkIntDecls.h:
+ * generic/tkInt.decls: added TkFocusFree, TkClipCleanup and
+ TkGCCleanup generic private procs, and TkWmCleanup, TkSendCleanup
+ and TkFreeXId unix private procs.
+
+ * generic/tkInt.h:
+ * unix/tkUnixXId.c (TkFreeXId): frees XID resources.
+ Made idCleanupScheduled a Tcl_TimerToken (was int) in TkDisplay
+ structure to allow us to delete the timer scheduled for it.
+
+ * unix/tkUnixWm.c (TkWmStackorderToplevel): ensure children
+ structure is freed.
+ (ConfigureEvent, ComputeReparentGeometry): Add extra wm tracing info
+ (TkWmRestackToplevel): initialize changes to 0 to prevent UMR.
+ Use WaitForConfigureNotify on all windows. This part still
+ requires fixing as it is the root of the 2 second raise delay on
+ some window managers (those that use extra wrapper windows of
+ their own).
+
+ * unix/tkUnixSend.c (TkSendCleanup): free send-related resources
+
+ * unix/tkUnixEvent.c (TkpCloseDisplay): call TkSendCleanup and
+ TkWmCleanup.
+
+ * unix/tkUnixSelect.c (SelRcvIncrProc): added missing Tcl_Release
+ of interp
+
+ * generic/tkGet.c (FreeUidThreadExitProc): free thread-specific
+ resources on thread exit
+
+ * generic/tkFocus.c (TkFocusFree): frees TkMainInfo data
+ * generic/tkClipboard.c (TkClipCleanup): frees TkDisplay data
+ * generic/tkGC.c (TkGCCleanup): frees TkDisplay data
+
+ * unix/tkUnixFont.c (FontPkgCleanup): cleanup thread specific font
+ resources on thread exit.
+
+ * mac/tkMacXStubs.c (TkpOpenDisplay): memset the initial display
+ structures to 0.
+
+ * generic/tkOption.c (OptionThreadExitProc): freed tsd option
+ stacks on thread exit.
+ (Tk_GetOption): free mem used to get Tk_Uid
+
+ * generic/tkMenu.c (ConfigureMenu): freed saved options in all
+ error cases.
+
+ * win/tkWinInt.h: declaration for TkWinGetUnicodeEncoding
+ * win/tkWinDialog.c (GetFileNameW): use TkWinGetUnicodeEncoding
+ * win/tkWinInit.c (TkpDisplayWarning): use TkWinGetUnicodeEncoding
+ * win/tkWinFont.c: use TkWinGetUnicodeEncoding instead of static
+ unicodeEncoding.
+
+ * win/tkWinX.c (Tk_SetCaretPos): remove WM_IME_STARTCOMPOSITION
+ and place the IME position within Tk_SetCaretPos. Cache results in
+ Tk_SetCaretPos to reduce unnecessary repositioning. Also call
+ DestroyCaret if we receive WM_KILLFOCUS.
+ (TkpOpenDisplay): ZeroMemory the initial display structures.
+ (TkWinGetUnicodeEncoding): Added so that Windows only needs to
+ cache this value one, and then free it in TkWinXCleanup.
+ (HandleIMEComposition): add support for Win98 and ATOK13
+ IME. (yamamoto)
+
+ * generic/tkConsole.c (ConsoleCmd): correct return that should
+ have just set result code.
+
+ * generic/tkImgPhoto.c: Added PhotoFormatThreadExitProc to clean
+ up on thread exit. (Tk_PhotoPutBlock) slight code updates
+
+ * generic/tkPanedWindow.c (DestroyPanedWindow, ConfigureSlaves):
+ fix mem leaks in not freeing slave info
+
+ * win/configure:
+ * win/tcl.m4: Enabled COFF as well as CV style debug info with
+ --enable-symbols to allow Dr. Watson users to see function info.
+ More info on debugging levels can be obtained at:
+ http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
+
+2002-04-10 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * doc/wm.n:
+ * mac/tkMacWm.c:
+ * tests/wm.test:
+ * unix/tkUnixWm.c:
+ * win/tkWinWm.c: Update wm stackorder usage message
+ to make it clear that either 1 or 3 arguments are
+ required. [Bug 540013]
+
+2002-04-08 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacProjects.sea.hqx: added tkPanedWindow.c to projects
+ * mac/tkMacAppInit.c: fixes to MSL stdin/stdout hookup to the
+ TkConsole when using shared MSL libraries; fix for crashing
+ bug on exit: writing to stdin/sterr when console has already
+ been destroyed. (both fixes need support in MSL, see
+ 'CW Pro6 changes' in tcl/mac/tcltkMacBuildSupport.sea.hqx)
+ * mac/tkMacDialog.c: fixes to Navigation Services Dialog filter.
+ * mac/tkMacDraw.c: add panic for overwide TkImages that would
+ crash Tk on mac otherwise.
+
+2002-04-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * mac/tkMacXStubs.c: added Tk_SetCaretPos stub (does nothing).
+ * win/tkWinX.c: added Tk_SetCaretPos code to position IME windows
+ correctly when WM_IME_STARTCOMPOSITION is received.
+ * unix/tkUnixKey.c: added Tk_SetCaretPos and code for setting
+ XIM caret in TkpGetString.
+
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tk.decls: added Tk_SetCaretPos declaration. This command
+ allows users to indicate the cursor position and is used by XIM
+ (Unix) or IME (Windows) to place the caret box correctly. It is
+ also part of correct Accessibility style on Windows to make the
+ magnifier jump to the focus point.
+
+ * win/tkWinButton.c (TkpDisplayButton):
+ * generic/tkTextMark.c (TkTextInsertDisplayProc):
+ * generic/tkCanvText.c (DisplayCanvText):
+ * generic/tkEntry.c (DisplayEntry): added Tk_SetCaretPos calls
+
+ * generic/tkInt.h: added TK_XIM_SPOT #define (default 1).
+ Added XFontSet attribute to TkDisplay when TK_XIM_SPOT is true.
+ * generic/tkEvent.c (Tk_HandleEvent): made sure inputContexts are
+ not getting created on DestroyNotify events (for dead windows).
+ Added over-the-spot support if TK_XIM_SPOT is defined (default).
+ The is the nicer XIM behavior, but uses a bit more memory.
+
+ * unix/tkUnixEvent.c:
+ * generic/tkWindow.c: moved OpenIM over to tkUnixEvent.c.
+ Removed setting inputContext to null in Tk_MakeWindowExist as it
+ was redundant.
+
+ * unix/tkUnixWm.c (CreateWrapper): Removed redundat setting of
+ inputContext to null.
+
+ * win/Makefile.in: changed gdb and shell targets to properly build
+ all binaries before running (otherwise an error often occured).
+
+2002-03-28 David Gravereaux <davygrvy@pobox.com>
+
+ * win/.cvsignore (new):
+ * win/lamp.bmp (new):
+ * win/makefile.vc:
+ * win/nmakehlp.c (new):
+ * win/rules.vc: Brought the makefile up-to-date with Tcl's one.
+ This now has support for Win9x issues and the winhelp target now
+ exists. Color scheme can be changed. I'm just imparting a first
+ suggestion using orange :) I'll have to think about the install
+ portion of the helpfile as I'll need to do some tricks to insert
+ tk's contents file into Tcl's using some special winhlp32.exe
+ switches. [Bug 533862 527941]
+
+ * win/makefile.vc: Tk helpfile is now installing itself into Tcl's
+ contents file as part of the install target and rebuilding the
+ contents table as desired. [Bug 527941]
+
+ * doc/console.n: Changed topic from "Tcl Built-In Commands" to
+ "Tk Built-In Commands"
+
+ * win/buildall.vc.bat: Update to match Tcl.
+
+2002-03-26 Andreas Kupries <andreask_kupries@users.sourceforge.net>
+
+ * unix/tkUnixFont.c: Added inclusion of <arpa/inet.h>. This fixes
+ a GCC/HPUX problem with missing a "htons". See also
+ "tclUnixPort.h" for equivalent code.
+
+2002-03-21 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Changed optimize flag to -0ti instead of -02.
+ [Bug 528441]
+
+2002-03-20 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkButton.c (ButtonTextVarProc,ButtonVarProc):
+ * generic/tkCmds.c (WaitVariableProc):
+ * generic/tkEntry.c (EntryTextVarProc):
+ * generic/tkListbox.c (ListboxListVarProc):
+ * generic/tkMenu.c (MenuVarProc):
+ * generic/tkMenubutton.c (MenuButtonTextVarProc):
+ * generic/tkMessage.c (MessageTextVarProc):
+ * generic/tkScale.c (ScaleVarProc): Updates to handle change in
+ type of part2 argument of Tcl_VarTraceProc typedef. [TIP 27]
+ [Patch 532644].
+
+2002-03-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkOldConfig.c (Tk_ConfigureValue): prevent leaving
+ interp->result as NULL.
+
+2002-03-07 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/text.tcl (TextPasteSelection): Renaming of TextPaste to
+ prevent confusion with tk_textPaste. Stopped code from inserting
+ selections twice, which seems to have happened with TIP#26, and
+ reorganized code to reduce amount of stuff protected by catch
+ which is tricky to maintain.
+ (tk_textPaste): Reduce amount of code protected by catch.
+
+2002-03-06 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinX.c: Define _WIN32_IE as 0x0300
+ before including commctrl.h so that we can
+ access the InitCommonControlsEx API when
+ building Tk with mingw.
+
+2002-03-06 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * README, generic/tk.h, unix/configure.in, unix/tk.spec:
+ * win/configure.in: Bumped patchlevel; this might need to change
+ in the future, but it will help us distinguish between the CVS
+ version and the most recent released version.
+
+2002-03-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ *** 8.4a4 TAGGED FOR RELEASE ***
+
+ * unix/README: updated --* options docs.
+
+ * unix/tk.spec: fixed URL refs to use www.tcl.tk or SF.
+
+2002-03-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README:
+ * mac/README:
+ * unix/README:
+ * win/README: updated to use www.tcl.tk URL.
+
+2002-03-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/entry.tcl: added catch around Triple-1 binding use of
+ sel.last
+
+2002-02-28 Don Porter <dgp@users.sourceforge.net>
+
+ * library/console.tcl (ConsoleBind): Corrected console <<Paste>>
+ binding on Unix platforms.
+
+2002-02-26 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+ * generic/tkWindow.c (Tk_MainWindow, Tk_GetNumMainWindows):
+ protect against being called before Tcl stubs are init'ed.
+ [Bug #220916] (porter)
+
+2002-02-25 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c (ConfigureText): reenable the blinking cursor
+ on state change where necessary. [Bug #503772]
+
+ * tests/listbox.test:
+ * generic/tkListbox.c: corrected error handling when setting to an
+ invalid listvar value. [Bug #503613]
+
+ * library/scale.tcl: mirror B2 bindings to B3 on Windows to better
+ accomodate two button mice. [Patch #493145]
+
+ * library/panedwindow.tcl: improved proxy sash handling. (boudaillier)
+
+2002-02-25 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/filebox.test: Reorganised and fixed so that tests are
+ executed fewer times (!) and the automatic extension adding
+ behaviour of tk_getSaveFile is tested.
+
+2002-02-23 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2002-02-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkPanedWindow.c (PanedWindowWidgetObjCmd): fixed returns
+ that should have been breaks instead. Corrected .pw configure
+ handling for insufficient args. [Patch #521436] (boudaillier)
+
+ * mac/tkMacDefault.h:
+ * unix/tkUnixDefault.h:
+ * win/tkWinDefault.h: changed panedwindow default relief to flat,
+ a more natural outer relief.
+
+ * library/panedwindow.tcl (ReleaseSash): changed to not pass x and
+ y args at all (they aren't used).
+ Added proc comments. Made configuring sash cursor more efficient.
+ Added Cursor timer that restores the default cursor when pointer
+ is no longer over the sash. This is necessary because Leave
+ events won't be seen when moving into a paned child.
+
+2002-02-22 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/widget: New section "Paned Windows"
+ * library/demos/paned2.tcl, library/demos/paned1.tcl: New files.
+
+ * library/panedwindow.tcl (ReleaseSash): Added missing arguments.
+ * library/tk.tcl: Bindings for paned window were not being loaded
+ by default.
+
+ * unix/tkUnixMenu.c (GetMenuLabelGeometry,DrawMenuEntryLabel):
+ Stop meaningless GCC warnings.
+
+2002-02-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/panedwindow.n (new):
+ * generic/tkPanedWindow.c (new):
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * library/panedwindow.tcl (new):
+ * mac/tkMacDefault.h:
+ * tests/panedwindow.test (new):
+ * unix/Makefile.in:
+ * unix/tkUnixDefault.h:
* win/Makefile.in:
- * win/configure: Regen.
- * win/configure.in:
- * win/tcl.m4:
- Revert ill-conceived EXTRA_CFLAGS changes made on 2001-07-09.
- The change ended up causing big problems with the
- tclConfig.sh file since it exported EXTRA_CFLAGS and did
- not deal with the debug/non-debug case.
+ * win/makefile.vc:
+ * win/tkWinDefault.h: added implementation of TIP #41, panedwindow
+ widget. [Patch #512503] (melski)
+
+ * generic/tkOption.c (ReadOptionFile): fixed Tcl_Seek casting to
+ remove warnings (we expect no option files with be > 2GB).
+
+ * unix/configure: regenerated
+ * unix/tcl.m4: updated to sync with Tcl's tcl.m4
+ Added --enable-64bit support for AIX-4 using IBM's xlc (-q64 flag).
+
+2002-02-19 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: First draft of updated changes for 8.4a4 release.
+
+2002-02-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImgPhoto.c (MatchFileFormat): Tcl_Seek takes
+ Tcl_WideInt offset (three places.)
+ * generic/tkImgPPM.c (FileReadPPM): Tcl_Seek takes Tcl_WideInt offset.
+ * generic/tkFrame.c (ConfigureFrame): Stop GCC warning.
+
+ * generic/tkImgGIF.c: Made file meet the formatting rules from the
+ Tcl Engineering Manual better; mostly differences in whitespace.
+
+2002-02-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: regen'd
+ * unix/tcl.m4:
+ * unix/configure.in: added macros and calls to SC_TCL_EARLY_FLAGS
+ and SC_TCL_64BIT_FLAGS, part of TIP #72.
+
+2002-02-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * library/entry.tcl:
+ * library/text.tcl: Adjust <Double-1> and <Triple-1> bindings
+ so that no anchor point is set and the insertion cursor is
+ set to the last character in the selection. [Bug 220943]
+ * tests/event.test: Add test cases for double click and
+ drag as well as triple click and drag in the text and
+ entry widgets.
-2001-07-11 Mo DeJong <mdejong@redhat.com>
+2002-02-14 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/event.test (_text_ind_to_x_y, _get_selection): Fix
+ incorrect use of results from bbox invocation so that
+ y center point for a give index is calculated correctly.
+ Add new method to return the selection and use it in
+ test cases. Always lappend to the result list to avoid
+ case where initial result includes a space.
+
+2002-02-07 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c:
+ * mac/tkMacInit.c:
+ * mac/tkMacKeyboard.c:
+ * win/tkWinDialog.c:
+ * win/tkWinTest.c: modified some callers of Tcl routines that
+ were restored to return (char *) pointing into Tcl_DStrings.
+
+2002-02-03 eric melski <ericm@interwoven.com>
+
+ * generic/tkImage.c (Tk_ImageObjCmd): Clean up bogus for loop in
+ [image inuse] subcommand [Bug #485803].
+
+2002-02-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkCmds.c (Tk_TkObjCmd): don't use 'bool' as an arg as it
+ conflicts with the C99 spec. [Bug #511956] (ingham)
+
+2002-02-01 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: unset macro located in the tktest target
+ caused a failure to build. [Bug 511652]
+
+2002-01-30 Don Porter <dgp@users.sourceforge.net>
+
+ * win/stubs.c (XSetCommand): Overlooked CONSTification.
+
+2002-02-01 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/photo.n: Documented transparency subcommand.
+ * tests/imgPhoto.test (imgPhoto-4.40...imgPhoto-4.68): Tests for
+ the transparency subcommand.
+ * generic/tkImgPhoto.c (ImgPhotoCmd): Added transparency
+ subcommand (see TIP #14.)
+
+2002-01-31 Todd Helfter <tmh@users.sourceforge.net>
+ * generic/tkMenu.c (ConfigureMenuCloneEntries)
+ * tests/menu.test (menu3.68)
+ Correct and test for logic error when cloning menus. [Bug #508988]
+
+2002-01-30 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk.decls: The POTENTIAL INCOMPATIBILITY in the changing
+ interface of Tk_ParseArgv can now be removed by the -DUSE_NON_CONST
+ compiler flag.
+ * generic/tkDecls.h: make genstubs
+
+2002-01-29 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * win/tkWinInit.c (TkpGetAppName): TIP 27 fixup. The code now does
+ not write into the CONST path returned by "argv0" and
+ Tcl_SplitPath anymore.
+
+2002-01-28 Mo DeJong <mdejong@users.sourceforge.net>
* unix/configure: Regen.
+ * unix/configure.in: Don't set TCL_LIB_SPEC and
+ TCL_STUB_LIB_SPEC variables since this breaks
+ the AIX build. This was used in the past to
+ support linking with Tcl from the build dir
+ or the install dir, but it is no longer needed.
+
+2002-01-28 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Remove commented out vars.
+ * unix/configure: Regen.
+ * unix/configure.in: Don't subst vars that are already
+ taken care of in SC_LOAD_TCLCONFIG.
* unix/tcl.m4: Update from Tcl.
+ * win/configure: Regen.
+ * win/tcl.m4: Update from Tcl.
-2001-07-11 Mo DeJong <mdejong@redhat.com>
+2001-01-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * generic/tkFileFilter.c:
+ * mac/tkMacInit.c:
+ * mac/tkMacKeyboard.c:
+ * mac/tkMacMenus.c: TIP 27 CONSTification induced changes
+
+2002-01-25 Don Porter <dgp@users.sourceforge.net>
+
+ * All changes below are Patch 505159
+
+ * doc/AddOption.3:
+ * doc/CanvTkWin.3:
+ * doc/GetPixels.3:
+ * doc/Name.3:
+ * doc/ParseArgv.3:
+ * generic/tk.decls (Tk_AddOption,Tk_CanvasGetCoord,Tk_GetPixels,
+ Tk_GetScreenMM,Tk_NameToWindow,Tk_ParseArgv):
+ * generic/tkArgv.c (Tk_ParseArgv):
+ * generic/tkCanvLine.c (ParseArrowShape):
+ * generic/tkCanvUtil.c (Tk_CanvasGetCoord,Tk_CanvasTagsParseProc,
+ Tk_CanvasTagsPrintProc,Tk_GetDash):
+ * generic/tkCanvas.c (ConfigureCanvas):
+ * generic/tkGet.c (Tk_GetPixels,Tk_GetScreenMM):
+ * generic/tkImgPhoto.c (ImgPhotoCmd):
+ * generic/tkMain.c (Tk_MainEx):
+ * generic/tkOldConfig.c (FormatConfigInfo):
+ * generic/tkOption.c (Tk_AddOption):
+ * generic/tkText.c (TextWidgetCmd,TkTextGetTabs,DumpSegment):
+ * generic/tkText.h (TkTextCreateTag):
+ * generic/tkTextTag.c (TkTextCreateTag):
+ * generic/tkWindow.c (Tk_NameToWindow,Initialize):
+ * mac/tkMacCursor.c (FindCursorByName,TkGetCursorByName):
+ * mac/tkMacWm.c (Tk_WmCmd):
+ * unix/tkUnixCursor.c (TkGetCursorByName):
+ * unix/tkUnixSend.c (ValidateName):
+ * unix/tkUnixWm.c (Tk_WmCmd):
+ * win/tkWinCursor.c (TkGetCursorByName):
+ * win/tkWinWm.c (Tk_WmCmd): Updated callers of Tcl_SplitList and
+ Tcl_Merge.
+ * generic/tkDecls.h: make genstubs
+ ***POTENTIAL INCOMPATIBILITY***
+ Includes a source incompatibility in the argv argument of Tcl_ParseArgv.
+
+ * generic/tkBind.c (DeleteVirtualEvent):
+ * generic/tkCanvas.c (ScrollFractions, CanvasWidgetCmd,
+ CanvasUpdateScrollbars):
+ * generic/tkTestTag.c (TkTextTagCmd): Updated callers of
+ Tcl_GetStringResult. Rewrote PrintScrollFractions to
+ ScrollFractions to stop scribbling directly on interp->result.
+
+ * generic/tkInt.decls (TkGetDefaultScreenName, TkpDisplayWarning,
+ TkpOpenDisplay):
+ * generic/tkCanvPs.c (Tk_PostscriptColor, Tk_PostscriptFont):
+ * generic/tkEntry.c (EntrySetValue, EntryValidateChange, ExpandPercents,
+ EntryValueChanged, Tk_EntryObjCmd, DestroyEntry, ConfigureEntry,
+ EntryComputeGeometry, InsertChars, DeleteChars, EntryFetchSelection,
+ EntryTextVarProc, Tk_SpinBoxObjCmd, SpinboxWidgetObjCmd):
+ * generic/tkMain.c (Prompt):
+ * generic/tkMenu.c (MenuVarProc):
+ * generic/tkMenubutton.c (ConfigureMenuButton, MenuButtonTextVarProc):
+ * generic/tkMessage.c (ConfigureMessage, MessageTextVarProc):
+ * generic/tkWindow.c (GetScreen, Initialize):
+ * mac/tkMacInit.c (TkpInit, TkpDisplayWarning):
+ * mac/tkMacXStubs.c (TkGetDefaultScreenName, TkpOpenDisplay):
+ * unix/tkUnix.c (TkGetDefaultScreenName):
+ * unix/tkUnixEvent.c (TkpOpenDisplay):
+ * unix/tkUnixInit.c (TkpGetAppName, TkpDisplayWarning):
+ * unix/tkUnixSend.c (SendEventProc):
+ * win/tkWinInit.c (TkpGetAppName, TkpDisplayWarning):
+ * win/tkWinX.c (TkGetDefaultScreenName,TkpOpenDisplay): Updated
+ callers of Tcl_GetVar, Tcl_GetVar2
+ * generic/tkIntDecls.h: make genstubs
+
+ * generic/tkCanvPs.c (TkCanvPostscriptCmd):
+ * generic/tkImgBmap.c (TkGetBitmapData):
+ * generic/tkOption.c (ReadOptionFile):
+ * mac/tkMacInit.c (TkpInit, TkpGetAppName):
+ * win/tkWinInit.c (TkpGetAppName): Updated callers of
+ Tcl_SplitPath, Tcl_JoinPath, and Tcl_TranslateFileName.
+
+2002-01-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * tests/wm.test: Rewrite stackorder tests that
+ deal with toplevels that have the overrideredirect
+ flag set. [Tk bug 492259]
+
+2002-01-18 Don Porter <dgp@users.sourceforge.net>
+
+ * win/tkWinDialog.c: Overlooked Tcl_GetIndexFromObj callers.
+
+2001-01-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacDialog.c:
+ * mac/tkMacSend.c: TIP 27 CONSTification broke the mac
+ build in a few places.
+
+2002-01-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkListbox.c (ChangeListboxOffset): improved tracking
+ when scrolling on x axis with entry/text. [Bug #225025] (voskuil)
+
+2002-01-16 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tk3d.c (Tk_GetReliefFromObj):
+ * generic/tkBind.c (Tk_EventObjCmd,HandleEventGenerate):
+ * generic/tkButton.c (ButtonWidgetObjCmd):
+ * generic/tkCanvas.c (CanvasWidgetCmd,FindItems):
+ * generic/tkClipboard.c (Tk_ClipboardObjCmd):
+ * generic/tkCmds.c (Tk_BellObjCmd, Tk_TkObjCmd, Tk_TkwaitObjCmd,
+ Tk_UpdateObjCmd, Tk_WinfoObjCmd, Tk_WmObjCmd):
+ * generic/tkConfig.c (DoObjConfig):
+ * generic/tkEntry.c (EntryWidgetObjCmd, SpinboxWidgetObjCmd):
+ * generic/tkFocus.c (Tk_FocusObjCmd):
+ * generic/tkFont.c (Tk_FocusObjCmd, ConfigAttributesObj):
+ * generic/tkFrame.c (Tk_FrameObjCmd):
+ * generic/tkGet.c (Tk_GetAnchorFromObj, Tk_GetJustifyFromObj):
+ * generic/tkGrab.c (Tk_GrabObjCmd):
+ * generic/tkGrid.c (Tk_GridObjCmd,GridRowColumnConfigureCommand,
+ GridSlavesCommand, ConfigureSlaves):
+ * generic/tkImage.c (Tk_ImageObjCmd):
+ * generic/tkImgBmap.c (ImgBmapCmd):
+ * generic/tkImgGIF.c (FileReadGIF):
+ * generic/tkImgPhoto.c (ImgPhotoCmd):
+ * generic/tkListbox.c (ListboxWidgetObjCmd, ListboxSelectionSubCmd,
+ GetListboxIndex):
+ * generic/tkMenu.c (MenuWidgetObjCmd, MenuAddOrInsert, MenuCmd,
+ ConfigureMenu, CloneMenu):
+ * generic/tkMenubutton.c (MenuButtonWidgetObjCmd):
+ * generic/tkMessage.c (MessageWidgetObjCmd):
+ * generic/tkOption.c (Tk_OptionObjCmd):
+ * generic/tkPack.c (Tk_PackObjCmd, ConfigureSlaves):
+ * generic/tkPlace.c (Tk_PlaceObjCmd):
+ * generic/tkScale.c (ScaleWidgetObjCmd):
+ * generic/tkSelect.c (Tk_SelectionObjCmd):
+ * generic/tkSquare.c (SquareWidgetObjCmd):
+ * generic/tkTest.c (TestobjconfigObjCmd, TrivialConfigObjCmd,
+ TestfontObjCmd): Updates to handle change in type of tablePtr
+ argument of Tcl_GetIndexFromObj(Struct) from (char **) to
+ (CONST char **). [TIP 27] [Patch 504705]
+
+ * generic/tkCanvText.c (GetSelText):
+ * generic/tkEntry.c (Entry{FetchSelection,Setvalue},ExpandPercents):
+ * generic/tkSelect.c (HandleTclCommand):
+ * generic/tkText.c (TextSearchCmd):
+ * generic/tkTextIndex.c (TkTextMakeByteIndex, TkTextIndexBackChars):
+ * mac/tkMacFont.c (Tk_MeasureChars, BreakLine):
+ * unix/tkUnixMenu.c (DrawMenuUnderline):
+ * win/tkWinMenu.c (GetEntryText, DrawMenuUnderline): Updated
+ callers of Tcl_Utf* and Tcl_Regexp* APIs to reflect TIP 27 API
+ changes (see Tcl Patch 471509). [Patch 471513]
+
+2002-01-16 Mo DeJong <mdejong@users.sourceforge.net>
- * unix/Makefile.in: Add AR and STLIB_LD variables.
* unix/configure: Regen.
- * unix/configure.in: Use STLIB_LD when defining MAKE_LIB
- and MAKE_STUB_LIB. Subst STLIB_LD, RANLIB, and AR.
* unix/tcl.m4: Update from Tcl.
* win/configure: Regen.
* win/tcl.m4: Update from Tcl.
-2001-07-10 Mo DeJong <mdejong@redhat.com>
+2002-01-04 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c (Tk_MainEx): Updated callers of CONSTified
+ Tcl interfaces Tcl_EvalFile and TclGetStartupScriptFileName.
+
+ * generic/tkConsole.c (ConsoleOutputProc, TkConsolePrint):
+ * generic/tkInt.h (TkConsolePrint):
+ * mac/tkMacAppInit.c (TkConsolePrint): Updated Tk's console to
+ CONSTified channel driver interface. [Tcl Patch 503565, Tk Patch
+ 503983]
+
+2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ Use ${libdir} instead of ${exec_prefix}/lib. [Tcl bug 489370]
+
+ * unix/configure: Regen.
+ * unix/configure.in: Define and use libdir.
+ * win/configure: Regen.
+ * win/configure.in: Define libdir.
+
+2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Burn Tcl and Tk build
+ directories into tktest executable to avoid crashes
+ caused by ld loading a previously installed version
+ of the tcl or tk shared libraries. Remove setting
+ of LD_LIBRARY_PATH, LIBPATH, and SHLIB_PATH
+ before running tktest since it should no
+ longer be required.
+
+2002-01-11 Mo DeJong <mdejong@users.sourceforge.net>
+
+ Enable use of Tcl stubs when building Tk as
+ a shared library. This should fix the build
+ under AIX. [Bugs 220858, 220955, 220921]
+
+ * unix/Makefile.in: Add TCL_STUB_LIB_SPEC and
+ TCL_STUB_LIB_FLAG variables.
+ * unix/configure: Regen.
+ * unix/configure.in: Pass TCL_STUB_LIB_SPEC into
+ Makefile and use it when linking the tk shared library.
+ Define USE_TCL_STUBS when building shared. Subst
+ TCL_STUB_LIB_SPEC and TCL_STUB_LIB_FLAG.
+
+2002-01-08 D. Richard Hipp <drh@hwaci.com>
+
+ * win/tkWinMenu.c: Fix the following bug: If you select an entry
+ on a cascade menu then the next time the parent menu is posted, the
+ cascade entry was active. Also, if you traverse to a disabled entry
+ using keystrokes and press ENTER on the disabled entry, then that
+ entry appears active the next time the menu is posted. The same
+ patch fixes both problems.
+
+2002-01-04 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkBind.c (TkBindFree):
+ * generic/tkGrid.c (ResolveConstraints,CheckSlotData,DestroyGrid):
+ * generic/tkSelect.c (Tk_DeleteSelHandler,TkSelDeadWindow): Replaced
+ Tcl_Free calls with ckfree so that memory debugging is fully supported.
+
+2001-12-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * test/winButton.test:
+ * win/tkWinButton.c: added updated patch #463234 which returns the
+ default sizing behavior (not so native), but enables native L&F
+ with negative sizing (-11 for example).
+
+ * library/text.tcl (tk::TextButton1): made text receive focus even
+ in disabled state for Windows to show selection and allow
+ mouse-wheel scrolling.
+
+ * win/tkWinInit.c (TkpDisplayWarning): added Tcl_DStringFree's
+
+ * win/tkWinInt.h:
+ * win/tkWinX.c: added TkWinProcs that represent a function table
+ to switch between unicode and ansi procs on Windows. This is
+ analogous to the TclWinProcs. Using Tcl_WinUtfToTChar, we can
+ easily take advantage of using unicode functions where available
+ without having to switch on the platform id each time.
+
+ * win/tkWinWm.c (InitWindowClass): corrected init routines to
+ allow unicode in window titles on Windows (for Win2K/XP).
+ (TkWmStackorderToplevel): Corrected casts to enable debug compile
+
+ * win/configure: regen'ed
+ * win/tcl.m4: added shell32.lib to link libs, as these are
+ necessary for new directory chooser (when enabled).
+
+ * win/tkWinDialog.c (Tk_MessageBoxObjCmd): use MessageBoxW for
+ proper display of unicode errors.
+ Added patch which uses new OLE based directory chooser. This
+ still has some issues, so is disabled by default. [Patch #468139]
+ (ColorDlgHookProc) Corrected ability to use unicode chars in
+ tk_chooseColor -title.
+
+2001-12-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinInit.c (TkpDisplayWarning): Use MessageBoxW in case the
+ error displayed has unicode chars. [Bug #485986]
+
+2001-12-27 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacInit.c:
+ * mac/tkMacResource.r: synced up tkInit features to unix/win:
+ use existing tkInit proc if defined. Added spinbox.tcl resource.
+ Used TclGetEnv() instead of Tcl_GetVar2(interp, env)
+ * mac/tkMacApplication.r:
+ * mac/tkMacLibrary.r: minor version resources cleanup
+
+2001-12-27 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkButton.c (ButtonTextVarProc): guard against being
+ called while the *button/label is being deleted. [Bug #490051]
+
+ * library/entry.tcl:
+ * library/spinbox.tcl:
+ * library/text.tcl: added extra checks against bug #220269 and
+ made spinbox reuse more of the entry procedure code.
+
+2001-12-20 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2001-12-19 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/tcl.m4: Update from Tcl.
+
+2001-12-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Move EXP file changes over from
+ Tcl configure script to fix AIX build with gcc. [Bug 220955]
+
+2001-12-18 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Use $(MAKE) instead of make
+ in the tcltest rule.
+
+2001-12-18 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/event.test (event-click-drag-1.2): Corrected test that
+ failed on Solaris/CDE due to text scrolling. [Bug 413735]
+
+2001-12-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/spinbox.tcl (ButtonDown): added catch to ignore
+ possible error in after cancel when Priv(afterId) isn't defined.
+
+ * doc/spinbox.n: corrected spin(up|down) -> button(up|down)
+
+2001-12-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/getOpenFile.n: Documented change.
+ * library/tkfbox.tcl (SetFilter): Added code to guess the correct
+ default extension from whatever value was selected in the
+ filetypes option menu. Adapted from code by Chris Nelson
+ submitted in Patch #492220.
+
+2001-12-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tkUnixWm.c (TkWmStackorderToplevelWrapperMap): added static
+
+2001-12-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c:
+ * generic/tkText.h: changed TkTextEditType enums to be prefaced
+ with TK_EDIT_ to prevent name collision.
+
+2001-12-05 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/tkMacWm.c: mac implementation of wm stackorder
+ (patch 481148, TIP 74)
+
+2001-12-03 Mo DeJong <mdejong@users.sourceforge.net>
+
+ Add TK patch 481148 to implement TIP 74, the
+ wm stackorder command.
+
+ * doc/winfo.n: Update documentation for the winfo
+ children command to indicate that top-level windows
+ are not returned in stacking order.
+ * doc/wm.n: Add documentation for wm stackorder.
+ * generic/tkInt.decls (TkWmStackorderToplevel):
+ Add decl for new function.
+ * generic/tkIntDecls.h: Regen.
+ * generic/tkStubInit.c: Regen.
+ * tests/unixWm.test: Add stackorder command to test
+ for wm command usage message.
+ * tests/wm.test: Add new set of tests for generic
+ window manager methods.
+ * unix/tkUnixWm.c (Tk_WmCmd,
+ TkWmStackorderToplevelWrapperMap,
+ TkWmStackorderToplevel): Add unix implementation of
+ new wm stackorder command.
+ * win/tkWinWm.c (Tk_WmCmd,
+ TkWmStackorderToplevelEnumProc,
+ TkWmStackorderToplevelWrapperMap,
+ TkWmStackorderToplevel): Add windows implementation
+ of new wm stackorder command.
+
+2001-12-03 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: install target changes by request from
+ Ryan Casey <scfiead@hotmail.com>.
+
+2001-11-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/widget: Further overhauling; shrank fonts, made
+ better use of fonts, added an icon, fixed the About box. Prompted
+ by Bug #487442 from Vincent Wartelle.
+
+2001-11-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/palette.tcl (tk_setPalette): Added heuristic to guess
+ from the background whether to use black or white for the
+ foreground when not told specifically. Suggested by Chris Nelson,
+ this makes the command fit the documentation better!
+
+2001-11-27 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Fixed CAT32 target. cat.c is located in the Tcl
+ source, not the Tk source.
+
+2001-11-27 D. Richard Hipp <drh@hwaci.com>
+
+ * library/menu.tcl: Do not allow keyboard traversal of torn-off
+ menus to visit the (invisible) tearoff bar.
+
+2001-11-26 D. Richard Hipp <drh@hwaci.com>
+
+ * win/tkWinMenu.c: disabled menu items show the activebackground
+ color in their background. This change makes menu behavior
+ consistent with what native windows does.
+
+2001-11-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in: Add comments to better describe
+ TCL_EXE and when it should be available. Add
+ rule that prints message about running `make genstubs`
+ when tkStubInit.c is out of date.
+ * win/Makefile.in: Add TCL_TOOL_DIR and TCL_EXE
+ variables to better match the Tcl Makefile. Add
+ genstubs rule so tkSTubInit.c can be regenerated.
+
+2001-11-24 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/configure: Regen.
+ * win/configure.in: Don't AC_SUBST CFLAGS_DEBUG, CFLAGS_OPTIMIZE,
+ or CFLAGS_WARNING since it is now done in SC_CONFIG_CFLAGS.
+ * win/tcl.m4 (SC_CONFIG_CFLAGS): AC_SUBST DL_LIBS, CFLAGS_DEBUG,
+ CFLAGS_OPTIMIZE, and CFLAGS_WARNING.
+
+2001-11-23 Daniel Steffen <das@users.sourceforge.net>
+
+ Up-port to 8.4 of mac code changes for 8.3.3 & various new
+ changes for 8.4, some already backported to 8.3.4 (patch #435660)
+
+ * library/tk.tcl: added <Key-F1> binding for <<Undo>> on the mac (TIP26)
+
+ * library/button.tcl: fixed undefined $Priv(repeated) error for button
+ without -repeatdelay support
+
+ * generic/tkConsole.c:
+ * library/console.tcl:
+ * mac/tkMacInit.c:
+ * mac/tkMacResource.r: corrected how mac deals with tcl library
+ files present both in resources and in $tk_library directory.
+
+ * generic/tkConsole.c: crashing bug fix when printing to console
+ at program exit after the console has already been closed.
+ Now setting gStdoutInterp=NULL in ConsoleClose().
+
+ * mac/tkMacInit.c: correct use of Tcl_JoinPath in tk_library
+ initialization
+
+ * mac/tkMacMenu.c: special MDEF_PROC_OFFSET only needed for
+ exactly one specific version of the MWERKS 68k compiler .
+
+ * mac/tkMacShLib.exp: removed file
+
+ * unix/Makefile.in: removed reference to .exp files
+
+ * mac/MWTkBuildLibHeader.h:
+ * mac/MW_TkBuildLibHeader.pch:
+ * mac/MW_TkHeaderCommon.h:
+ * mac/MW_TkOldImgStaticHeader.h:
+ * mac/MW_TkStaticHeader.h:
+ * mac/MW_TkStaticHeader.pch: new precompiled header files
+
+ * mac/MW_TkHeader.pch:
+ * mac/MW_TkOldImgHeader.h:
+ * mac/MW_TkTestHeader.pch: revised precompiled header handling: now
+ include a common header file 'MW_TkHeaderCommon.h' from all .pch files,
+ the .pch files themselves now only setup #defines (e.g. BUILD_tk,
+ STATIC_BUILD, TCL_DEBUG, TCL_THREADS) like in makefiles on other
+ platforms.
+
+ * mac/tkMac.h:
+ * mac/tkMacPort.h:
+ * mac/tkMacInt.h: use of BUILD_tk and TCL_STORAGE_CLASS like on other
+ platforms, standardize #include'd files to what's done on other
+ platforms, removed use of #pragma export, changed extern to EXTERN
+ where appropriate to enable DLL export via the TCL_STORAGE_CLASS
+ mechanism.
+
+ * mac/tkMacAppearanceStubs.c: removed use of #pragma export
+
+ * mac/widget.r: new resource file for 'Widget Demos'
+
+ * mac/tkMacProjects.sea.hqx: updated mac build project files:
+ build support for CodeWarrior Pro6, UnivIntf 3.4 & shared runtime
+ libraries (see Tcl ChangeLog for details).
+ changed weak linking so that CFM68k binaries now work on all OS
+ versions from the free 7.5.5 onwards, with or without AppearanceMgr
+ and/or NavigationMgr installed.
+ added target to automatically build 'Widget Demos'
+ included XML versions of the projects for CW Pro5 or Pro7 users.
+ use compat/strtod.c instead of MSL's strtod()
+
+ * generic/tkInt.decls:
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkStubInit.c:
+
+ * mac/tkMacInt.h: MAC_TCL tk stub support was badly broken due to
+ multiply defined (mac specific) names in tk.decls and tkInt.decls,
+ removed the duplicates from the internal unsupported interfaces
+ "interface tkInt" and "interface tkIntPlat"; moved declaration of
+ TkpIsWindowFloating from tkMacInt.h to tkInt.decls: interface tkIntPlat.
+ - these changes to the stub tables might require you to recompile your
+ Tk extensions if they turn out to reference one of the removed routines
+ in the wrong table (should be unlikely).
+
+ * generic/tkMain.c: MAC_TCL: workaround for broken/non-standard isatty
+ on MW Pro6, #include <unistd.h> instead of defining isatty
+
+ * generic/tkPointer.c: MAC_TCL: #include tkMacInt.h
+
+ * generic/tkStubLib.c: MAC_TCL: removed obsolete special casing of mac
+ headers, standardize #include'd files to what's done on other platforms
+
+ * mac/tclets.r:
+ * mac/tkMacWindowMgr.c:
+ * mac/tkMacScrlbr.c:
+ * mac/tkMacMenu.c:
+ * mac/tkMacMenus.c:
+ * mac/tkMacFont.c:
+ * mac/tkMacDialog.c:
+ * mac/tkMacButton.c: renamed obsolete apple API names to modern
+ equivalents; UH3.4 support: added #include <ControlDefinitions.h>;
+ fixed munged non-ASCII chars in sources due to bungled latin1<->mac
+ roman encoding in CVS repository.
+
+ * mac/tkMacDialog.c: added support for -filetypes option (fix for bug
+ tcl #221636); added update event handling for background windows while
+ in a NavigationMgr dialog; fixed nasty bug when calling CustomGetFile
+ (missing addr operator) (fix for bug tk #220911 & tcl #219367); renamed
+ routines conflicting with standard MoreFiles headers (see Tcl ChangeLog
+ for details)
+
+ * mac/tkMacApplication.r:
+ * mac/tkMacLibrary.r:
+ * mac/tkMacResource.r: fixed obsolete copyrights/dates in version
+ strings, updated version strings to standard usage, added support for
+ '(Support Libraries)' subfolder for shared runtime libraries in
+ unmerged binaries, commented out demo setting of "Tcl Environment
+ Variables"; reorganized resources among these files to avoid
+ multiple copies in applications and shared libraries, the script
+ libraries/Xcursors etc are now no longer duplicated in Wish but are
+ only included in the resources of Tk.shlb.
+
+ * mac/tkMacMenu.c:
+ * mac/tkMacMDEF.r: changes to support MW Pro 6 68k (vers 0x2400 only)
+ compiler producing different offset to start of MDEF; fix to static 68k
+ presence testing when calling the custom MDEF
+
+ * mac/tkMacWm.c.c:
+ * mac/tkMacWindowMgr.c: added/fixed AppearanceMgr checks; override
+ AppearanceMgr version detection on static 68k to ensure static 68k Wish
+ runs on PPCs with recent AppearanceMgr
+
+ * mac/tkMacButton.c: fixed misplaced/missing variable initialization.
+
+2001-11-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkText.c (TextGetText): reworked to use DString for
+ improved speed. (callewaert, darley)
+ (DestroyText): plugged mem leak when not clearing stack (callewaert)
+ (TextGetText): more efficient string size calculation (darley)
+
+2001-11-19 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/entry3.tcl: New demo showing off validation and
+ password entry.
+
+ * library/demos/widget: Some reorganization to make the code
+ simpler, plus a new entry demo.
+
+2001-11-17 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinButton.c (TkpComputeButtonGeometry): corrected the
+ default size of Windows buttons to conform to the Windows style.
+ This changes the default size of buttons on Windows.
+ [Patch #463234] (nelson)
+ **** POTENTIAL VISUAL INCOMPATABILITY ****
+
+2001-11-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/menu.tcl: corrected menu traversal code on Unix to
+ better handle entering cascades. [Patch #481219] (oleinick)
+
+2001-11-16 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: Install target repaired.
+
+2001-11-15 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/image2.tcl: Many improvements to this
+ image-viewing demo; now uses labelframes and tk_chooseDirectory
+
+ * library/palette.tcl (::tk::RecolorTree): Made this work better
+ with CDE, which does some extremely annoying things with the
+ option database that interact badly with Tk's way of handling
+ options.
+
+ * doc/text.n: Overhauled the documentation of undo to make it
+ easier to understand.
+ * library/tk.tcl (::tk::EventMotifBindings): Added Emacs-like undo
+ binding, but not behaviour (we separate undo and redo.)
+ * library/demos/text.tcl: Show off our undo capability!
+
+2001-11-12 David Gravereaux <davygrvy@pobox.com>
+
+ * win/mkd.bat:
+ * win/rmd.bat: Removed -kb CVS attribute and added changes
+ from Llyod Lim for better stability. [Patch #456761]
+
+ * win/rules.vc(new):
+ * win/buildall.vc.bat(new):
+ * win/makefile.vc: large rewrite following Tcl's makefile.vc as
+ a guide and Patch #456761. Appears BugFree(tm).
+
+2001-11-12 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/text.n:
+ * generic/tkText.c:
+ * generic/tkText.h:
+ * generic/tkTextTag.c:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * mac/tkMacDefault.h:
+ * tests/text.test:
+ * unix/tkUnixDefault.h:
+ * win/tkWinDefault.h: added TIP #26 implementation of simple
+ built-in undo/redo of text editing in the text widget.
+ [Patch #458879] (callewaert)
+
+2001-11-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/menu.tcl: Show off -compound support in menus.
+
+ * library/demos/radio.tcl: Added some code to both show off the
+ extra capabilities of the buttons and also show what can be done
+ with compound images on the sly.
+
+2001-11-10 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Add "make gdb" target. This target
+ can run wish inside either gdb or insight.
+
+2001-11-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/clrpick.tcl: changed a few parameters so that the full
+ 0..255 range could be accessed via the mouse. [Bug #478498]
+
+ * unix/configure:
+ * unix/tcl.m4: added -lc to AIX libs, fixed path to ldAix
* win/configure:
- * win/tcl.m4 (SC_CONFIG_CFLAGS): Use STLIB_LD in MAKE_LIB instead
- of AR which can be overridden on the make command line.
+ * win/tcl.m4:
+ * win/makefile.vc: add comctl32.lib to build libs.
+ * win/tkWinX.c (TkWinXInit): added InitCommonControlsEx call.
+ * win/rc/tk.rc:
+ * win/rc/wish.rc:
+ * win/rc/wish.exe.manifest: added resources that specify using v6
+ of the MS Common Controls library when available (WinXP+). This
+ enables use of the themeable widgets (like scrollbars) to be used
+ in Tk. [Patch #478933]
+
+2001-11-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Update from Tcl.
+
+2001-11-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/Makefile.in:
+ Avoid adding libc to the LIBS and WISH_LIBS
+ variables since it is not needed when linking with CC.
+ If required when linking with LD it should be done
+ on a case by case basis in tcl.m4.
+
+2001-11-05 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/dialog2.tcl: Typo-fix.
+ * library/demos/browse, library/demos/ixset, library/demos/rolodex:
+ Installation does version number fixup, so we shouldn't. Thanks
+ to wohnivec@iol.cz for pointing these (thankfully minor) problems
+ out.
+
+2001-10-30 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/widget: Integrated labelframe item into the labels
+ section and added a spinbox demo to the (retitled) entry section.
+
+ * library/demos/labelframe.tcl: Adjusted so as to show off the
+ labelframe widget to better effect and have a better description.
+
+ * library/demos/spin.tcl: New demo to show off spinbox capabilities.
+
+ * library/demos/rolodex: Changes up-ported from core-8-3-1-branch
+ to make the script use more 8.*-isms, but not menus due to the way
+ the context help system works.
+
+ * library/demos/ixset: Changed to use the labelframe widget and
+ the grid geometry manager.
+
+2001-10-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/browse: Changes up-ported from core-8-3-1-branch
+ to make the script much more robust, particularly when neither the
+ current version of wish or the script are on the path.
-2001-07-09 Mo DeJong <mdejong@redhat.com>
+ * library/demos/hello: Added emacs trailing tag-line.
+ * library/demos/tcolor: Changes up-ported from core-8-3-1-branch
+ to make the script compliant with current good practise, as well
+ as extensive use of the new labelframe widget.
+
+ * library/demos/timer: Changes up-ported from core-8-3-1-branch to
+ make the script look and work better.
+
+ * library/demos/rmt: Changes up-ported from core-8-3-1-branch to
+ use more 8.* features and make the demo script more generally
+ useful to people.
+
+2001-10-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkCursor.c (Tk_GetCursorFromData): Fixed uninit nextPtr
+ field. [adapted from Patch 473875]
+ (GetCursor): Removed double-assignment to nextPtr field.
+
+2001-10-19 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/console.tcl: removed transpose ability until the console
+ can get a proper rewrite of tag handling.
+
+2001-10-18 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/defs.tcl: removed threaded build warning under X.
+
+ * library/console.tcl (ConsoleOutput): fixed undefined widget
+ argument.
+
+2001-10-16 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/xmfbox.tcl: fixed filtering in motif file dialog.
+ [Patch #469670] (nelson)
+
+ * generic/tkWindow.c (OpenIM): Added simple XIM patch to enable
+ basic XIM input on Unix. [Patch #412727] (fabian)
+
+2001-10-15 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/configure.in:
* win/configure:
- * win/tcl.m4 (SC_CONFIG_CFLAGS): Fix quoting of CYGPATH
- argument to AC_CHECK_PROG.
+ * win/configure.in:
+ * win/tkConfig.sh.in: reworked to be a little cleaner in
+ comparison to each other, and to AC_SUBST even empty vars for
+ win/tkConfig.sh
+
+2001-10-12 Todd M. Helfter <tmh@purdue.edu>
+
+ * ChangeLog:
+ * doc/menu.n:
+ * generic/tkMenu.c:
+ * generic/tkMenu.h:
+ * generic/tkMenubutton.c:
+ * generic/tkMenubutton.h:
+ * mac/tkMacDefault.h:
+ * mac/tkMacMenu.c:
+ * mac/tkMacMenubutton.c:
+ * tests/menu.test:
+ * unix/tkUnixDefault.h:
+ * unix/tkUnixMenu.c:
+ * win/makefile.vc:
+ * win/tkWinDefault.h:
+ * win/tkWinMenu.c:
+ * win/tkWinWm.c: Implementation of TIP #63, the addition of
+ a -compound option to menu entries allowing text and an image to
+ be displayed at the same time.
+
+2001-10-09 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * library/console.tcl: added more smarts extracted from tkcon to
+ the default console.
+
+2001-10-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinTest.c: better error reporting from testclipboard
+
+ * win/tkWinDialog.c: minor cast changes to support Win64
+
+ * win/tkWinWindow.c: made use of standard Tk_GetHWND instead of
+ older, private TkWinGetHWND.
+
+ * win/configure: regen'ed
+ * win/tcl.m4:
+ * win/makefile.vc: updated for Win64 SDK RC1 compilation support
+
+2001-09-30 Peter Spjuth <peter.spjuth@space.se>
+
+ * doc/grid.n:
+ * generic/tkGrid.c:
+ * tests/grid.test: Added -uniform option to grid's row/column-
+ configure. [TIP 37] [Patch 459343]
+
+2001-09-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * win/tkWinFont.c (Tk_DrawChars): Added support for clipping text.
+
+ * doc/frame.n:
+ * doc/labelframe.n:
+ * doc/toplevel.n:
+ * generic/tkFrame.c:
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * library/demos/radio.tcl:
+ * library/demos/labelframe.tcl:
+ * library/demos/widget:
+ * mac/tkMacDefault.h:
+ * tests/frame.test:
+ * unix/tkUnixDefault.h:
+ * win/tkWinDefault.h: Added labelframe widget. Added -padx/y
+ options to frame and toplevel.
+
+ * tests/grid.test:
+ * tests/pack.test:
+ * tests/place.test: Used labelframe to test geometry manager changes.
+ [TIP 18] [Patch 429164]
+
+2001-09-26 Peter Spjuth <peter.spjuth@space.se>
+
+ * doc/GeomReq.3:
+ * doc/WindowId.3:
+ * generic/tk.decls:
+ * generic/tk.h:
+ * generic/tkDecls.h:
+ * generic/tkGeometry.c:
+ * generic/tkGrid.c (ArrangeGrid):
+ * generic/tkInt.h:
+ * generic/tkPack.c (ArrangePacking):
+ * generic/tkPlace.c (RecomputePlacement):
+ * generic/tkStubInit.c:
+ * generic/tkUtil.c (TkComputeAnchor):
+ * generic/tkWindow.c (TkAllocWindow):
+ * unix/mkLinks: Geometry manager changes to support TIP#18.
+ Allows a widget to set different internal border widths on
+ different sides, and to set a minimum requested size.
+ POTENTIAL INCOMPATIBILITY. [Patch 429164]
+
+2001-09-25 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkBind.c:
+ * generic/tkInt.decls (TkpScanWindowId):
+ * unix/tkUnixPort.h (Tkp{Print,Scan}WindowId):
+ * unix/tkUnixXId.c (TkpScanWindowId):
+ * win/tkWinWindow.c (TkpScanWindowId): Corrected definition of
+ TkpScanWindowId to handle situation where types Window and int
+ do not have the same number of bits. CONST-ified too.
+
+ * generic/tkIntPlatDecls.h:
+ * generic/tkStubInit.c: make genstubs
+
+2001-09-24 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkMain.c (StdinProc): Update to handle change in
+ return type of Tcl_DStringAppend() from (char *) to (CONST char *).
+ [TIP 27]
+
+2001-09-23 Peter Spjuth <peter.spjuth@space.se>
+ * generic/tkPack.c (ConfigureSlaves):
+ * tests/pack.test:
+ * tests/grid.test: Pack accepted asymmetric values for -ipadx/y.
+ Only -padx/y supports asymmetry. [Bug #462348]
+
+2001-09-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinWindow.c (TkpPrintWindowId, TkpScanWindowId): fixed to
+ work on Win64 with 64bit XIDs.
+
+ * generic/tkWindow.c (Tk_CreateAnonymousWindow):
+ * generic/tkEntry.c (GetSpinboxElement): fixed unreachable returns.
+
+ * win/tkWinX.c (TkGetServerInfo): added recognition of Win64.
+
+ * xlib/X11/X.h: made XID __int64 type for Win64.
+
+ * unix/tkUnixPort.h:
+ * mac/tkMacPort.h: add (int*) cast to TkpScanWindowId.
+ These may need to be changed to Window* (ulong).
+
+ * generic/tkCmds.c (Tk_WinfoObjCmd):
+ * generic/tkBind.c (NameToWindow):
+ correct Window id's to be of type Window
+
+ * generic/tkIntDecls.h:
+ * generic/tkIntPlatDecls.h:
+ * generic/tkInt.decls (TkpScanWindowId): changed decl to use
+ Window* instead of int*.
+
+ * xlib/xcolors.c:
+ * generic/tkPack.c,tkWindow.c:
+ * win/tkWinFont.c,tkWinMenu.c:
+ * unix/tkUnixScale.c: minor cast fixes to prevent 64bit warnings.
+
+ * tests/scrollbar.test (scrollbar-6.27): marked knownBug because
+ it is skewed by bad dimensions returned by Windows.
+
+ * tests/textDisp.test (textDisp-4.12): corrected test to work
+ properly on Windows.
+
+ * tests/id.test,macFont.test,macMenu.test,macscrollbar.test:
+ * tests/send.test,winClipboard.test,winDialog.test,winFont.test:
+ improved use of test constraints
+
+ * win/tkWinWm.c (WinSetIcon): fixed SetClassLong for 64bit support.
+
+2001-09-20 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure: regen'ed
+ * unix/tcl.m4: added --enable-64bit support for HP-11 with the
+ 64-bit kernel.
+
+2001-09-17 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkGrid.c (ConfigureSlaves):
+ * generic/tkPack.c (PackAfter): Corrected type definition of
+ argument passed to Tcl_GetStringFromObj() from size_t to int.
+ Incorrect type broke [pack] and [grid] on systems where
+ sizeof(size_t) != sizeof(int). [Bugs 462375, 462342, 462338]
+
+2001-09-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/choosedir.tcl (DblClick):
+ * library/tkfbox.tcl (OkCmd, ListInvoke): Rewrote so as to avoid
+ the highly confusing string "text" and to be consistent about what
+ is and what is not a list. [Bug 459895, reported by fandom]
+
+2001-09-14 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+
+ * generic/tkImgGIF.c:
+ * generic/tkImgPPM.c:
+ * generic/tkImgPhoto.c:
+ * generic/tkMenu.c: Applied patch [461578], provided by Vincent
+ Darley. This fixes several memory leaks in the image code. They
+ happen if there are errors during the initialization of the
+ channel the image is supposed to be read from.
+
+2001-09-12 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Update from Tcl.
+
+2001-09-12 D. Richard Hipp <drh@hwaci.com>
+
+ * library/tkfbox.tcl: fixed error that appeared when you would
+ click on the canvas while viewing an empty directory.
+
+2001-09-10 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * unix/configure:
+ * unix/tcl.m4: Update from Tcl.
+
+2001-09-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/Makefile.in: Fix Windows Makefile so that
+ tcltest will automatically be compiled if the
+ user tries to build tktest.
+
+2001-09-09 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/Makefile.in: Use TKTEST variable directly
+ instead of depending on the tktest alias.
+
+2001-09-08 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/mkd.bat:
+ * win/rmd.bat:
+ Apply binary property (cvs admin -kb) to files and convert
+ to CRLF linefeed format to fix the VC++ build. [Tcl Bug #219409]
+
+2001-08-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/menu.test:
+ * tests/send.test:
+ * tests/select.test: corrected to use testConfig constraints in
+ the TK_ALT_DISPLAY case
+
+ * tests/unixSend.test: removed test file completely identical to
+ send.test. Removed platform specific named file in case somebody
+ gets send working on Win/Mac in the future.
+
+ * tests/config.test: added config-14.1 to test namespace import
+ evaluation of widgets.
+ * generic/tkButton.c (ButtonCreate):
+ * generic/tkFrame.c (CreateFrame):
+ * generic/tkMenubutton.c (Tk_MenubuttonObjCmd):
+ * generic/tkPlace.c (Tk_PlaceObjCmd):
+ * generic/tkScale.c (Tk_ScaleObjCmd):
+ * generic/tkMessage.c (Tk_MessageObjCmd):
+ * generic/tkEntry.c (Tk_EntryObjCmd, Tk_SpinboxObjCmd):
+ * generic/tkSquare.c (SquareObjCmd): redid the handling of
+ optionTables in widgets to allow them to be imported into other
+ namespaces. [Bug #456632]
+
+2001-08-28 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinDialog.c (ChooseDirectoryHookProc): work-around for MS
+ bug that caused crashing in tk_chooseDirectory on Win95.
+ [Bug #224936] (baker)
+
+ * unix/tkUnixWm.c (TkWmRestackToplevel): reworked how
+ ConfigureNotify requests were handled in relation to the parent to
+ avoid the problem with potential 'raise' delays on some wms.
+ [Bug #220260] (baker) wms that were affected should notice the
+ difference in tests unixWm-51.* not failing that failed before.
+
+2001-08-26 Don Porter <dgp@users.sourceforge.net>
+
+ * library/text.tcl (<Shift-Up> binding): Corrected TIP 44 typo
+ that broke binding. Thanks to "Michal" for the fix.
+ [Bug 455468]
+
+2001-08-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/configure:
+ * unix/tcl.m4: added QNX-6 build support. [Bug #219410] (loverso)
+
+ * doc/CrtPhImgFmt.3: removed bogus note about including tkPhoto.h
-2001-07-09 Mo DeJong <mdejong@redhat.com>
+2001-08-22 Peter Spjuth <peter.spjuth@space.se>
+
+ * generics/tkGrid.c (ConfigureSlaves):
+ * tests/grid.test: Fixed a bug where adjacent 'x' and '^' where
+ not handled properly. [Bug #452040]
+
+2001-08-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkPack.c (TkParsePadAmount): added lint init for sepChar.
+
+ * tests/dialog.test (HitReturn): fixed failing dialog-2.1 test
+ because it wasn't always getting focus properly.
+
+2001-08-21 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/unixFont.test (unixFont-2.[234]): fixed to be more
+ sensitive on systems that have more installed fonts.
+
+ * library/dialog.tcl (tk_dialog): changed dialog to show bar on
+ Windows as well and added some y padding between the buttons and
+ the bar. [Patch #442835] (harrismh)
+
+2001-08-20 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkInt.h:
+ * generic/tkWindow.c:
+ * generic/tkGrid.c:
+ * generic/tkPack.c:
+ * tests/grid.test:
+ * tests/oldpack.test:
+ * tests/pack.test: Objectified grid and pack commands.
+
+2001-08-20 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkObj.c (TkGetWindowFromObj): Rewrote window code to
+ reuse a previously worked-out set of window information exactly
+ when the reference window is the same and no window deletions have
+ occurred since the object was allocated (display has same epoch
+ counter.) Required changing the internal rep of the window quite
+ a bit as now need to save three words-worth of information in the
+ internal rep (this window, reference window, display epoch.)
+ * generic/tkObj.c (SetWindowFromAny, DupWindowInternalRep,
+ FreeWindowInternalRep): Code to support new internal rep for
+ window objects.
+ * generic/tkInt.h: Added epoch counter to TkDisplay structure
+ * generic/tkWindow.c (GetScreen, Tk_DestroyWindow): Epoch counter
+ is incremented every time a window is deleted.
+
+2001-08-18 Peter Spjuth <peter.spjuth@space.se>
+
+ * doc/grid.n:
+ * tests/grid.test:
+ * generic/tkGrid.c: Grid configure rejected initial "x" and "^".
+ [Bug #418664]
+
+2001-08-17 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkObj.c (TkGetWindowFromObj): Was failing to reuse
+ cached window objects, forcing a call to Tcl_GetStringFromObj and
+ Tk_NameToWindow every time. This fault has been in there for
+ nearly three years...
+
+2001-08-15 Don Porter <dgp@users.sourceforge.net>
+
+ * changes: Labelled the TIP 44 changes as "POTENTIAL INCOMPATIBILITY".
+ Although technically internal changes are not incompatible, they'll
+ be perceived as such by those who get bitten, and this will help
+ them find the cause of their trouble.
+
+2001-08-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tk{Util,Font,Cursor,Color,Bitmap,3d}.c: Modified
+ objtype declarations so that they can be picked up in tkObj.c and
+ the names are now prefixed with "tk" too.
+ * generic/tkObj.c (TkRegisterObjTypes):
+ * generic/tkWindow.c (Initialize):
+ * generic/tkInt.h: Added code to register Tk's object types with
+ the Tcl runtime. [Tcl Bug 450545]
+
+2001-08-12 Mo DeJong <mdejong@redhat.com>
- * unix/Makefile.in: Add EXTRA_CFLAGS_DEBUG and EXTRA_CFLAGS_OPTIMIZE
- variables. These two do not actually differ in the unix version
- but are there to keep in sync with the Windows version.
* unix/configure: Regen.
- * unix/configure.in: Don't subst EXTRA_CFLAGS. Subst EXTRA_CFLAGS_DEFAULT,
- EXTRA_CFLAGS_DEBUG, and EXTRA_CFLAGS_OPTIMIZE.
* unix/tcl.m4: Update from Tcl.
- * win/Makefile.in: Add EXTRA_CFLAGS_DEBUG and EXTRA_CFLAGS_OPTIMIZE
- variables. This is needed so that the proper runtime lib gets linked
- into VC++ produced .obj files when CFLAGS is reset on the command line.
- * win/configure: Regen.
- * win/configure.in: Don't subst EXTRA_CFLAGS. Subst EXTRA_CFLAGS_DEFAULT,
- EXTRA_CFLAGS_DEBUG, and EXTRA_CFLAGS_OPTIMIZE.
- * win/tcl.m4: Update from Tcl.
-2001-07-06 Mo DeJong <mdejong@redhat.com>
+2001-08-10 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/demos/image2.tcl (loadDir): Converted non-portable
+ [glob [file join $dirName *]] to [glob -directory $dirName *]
+ which is both fully portable and more reliable when directory
+ names contain glob-significant characters. [Bug 223313]
+
+2001-08-08 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/dialog.test: New file testing [tk_dialog].
+
+ * library/dialog.tcl:
+ * library/tkfbox.tcl: Corrections to problems introduced by
+ the TIP 44 changes. [Bug 449261]
+
+ * README:
+ * generic/tk.h:
+ * unix/configure:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure:
+ * win/configure.in: Bumped up patchlevel to 8.4a4 to distinguish
+ CVS snapshots from the 8.4a3 release. This does not necessarily
+ mean there will be an 8.4a4 release. [Bug 448938].
+
+2001-08-07 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/Makefile.in (dist): added {unix,win}/tcl.m4 and
+ library/msgs/*.msg to dist target. [Bug: #448802]
+
+2001-08-06 Jeff Hobbs <jeffh@ActiveState.com>
+
+ 8.4a3 RELEASE
+
+ * changes:
+ * README: updated for 8.4a3 release
+
+ * unix/configure: regenerated
+ * unix/tcl.m4: added GNU (HURD) configuration target. (brinkmann)
+ [Patch: #442974]
+
+2001-08-06 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tkConsole.c:
+ * generic/tkWindow.c:
+ * library/bgerror.tcl:
+ * library/dialog.tcl:
+ * library/msgbox.tcl:
+ * library/unsupported.tcl:
+ * mac/tclets.tcl:
+ * mac/tkMacHLEvents.c:
+ * mac/tkMacWm.c: TIP 44 changes specific to the Mac and
+ Windows platforms that were overlooked before: tkOpenDocument,
+ tkConsoleExit, tkConsoleOutput, unsupported1 out of namespace :: .
+ Thanks to Vince Darley for prompting another look.
+
+2001-08-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/winMain.c (WishPanic): fixed CONST changes to go with
+ CONST-ification in Tcl.
+
+ * win/configure: regenerated
+ * win/tcl.m4: fixed DLLSUFFIX definition to always be ${DBGX}.dll.
+ This is necessary for TEA compliant builds that build shared
+ against a static-built Tk.
+ * win/Makefile.in ($(WISH)): added $(TK_STUB_LIB_FILE) to build
+ target, otherwise it wouldn't get generated in a static build.
+
+2001-08-01 Don Porter <dgp@users.sourceforge.net>
+
+ * doc/console.n:
+ * doc/menu.n:
+ * doc/text.n:
+ * doc/tkvars.n:
+ * generic/tkBind.c:
+ * generic/tkMenu.c:
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/choosedir.tcl:
+ * library/clrpick.tcl:
+ * library/comdlg.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/focus.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/optMenu.tcl:
+ * library/palette.tcl:
+ * library/scale.tcl:
+ * library/scrlbar.tcl:
+ * library/spinbox.tcl:
+ * library/tclIndex:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/tkfbox.tcl:
+ * library/unsupported.tcl:
+ * library/xmfbox.tcl:
+ * mac/tkMacMenu.c:
+ * tests/clrpick.test:
+ * tests/filebox.test:
+ * tests/macMenu.test:
+ * tests/menu.test:
+ * tests/menuDraw.test:
+ * tests/msgbox.test:
+ * tests/text.test:
+ * tests/unixMenu.test:
+ * tests/winMenu.test:
+ * tests/xmfbox.test:
+ * unix/mkLinks:
+ * unix/tkUnixDialog.c: Merged changes from feature branch
+ dgp-privates-into-namespace, implementing TIP 44. All
+ Tk commands and variables matching tk[A-Z]* are now in the
+ ::tk namespace. See "BRANCH: dgp-privates-into-namespace"
+ entries below for details. [FR 220936]
+
+2001-07-24 Mo DeJong <mdejong@redhat.com>
+
+ * generic/default.h: Include tkWinDefault.h
+ when built with Cygwin or Mingw.
+
+2001-07-18 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * doc/console.n: Updated names of private console commands.
+
+2001-07-16 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * library/console.tcl:
+ * library/unsupported.tcl: Renamed tk::histNum to tk::HistNum
+ as directed by the Tcl Style Guide.
+2001-07-10 Mo DeJong <mdejong@redhat.com>
+
+ * unix/Makefile.in: Add AR and STLIB_LD variables.
+ * unix/configure:
+ * unix/configure.in: Use STLIB_LD when defining MAKE_LIB
+ and MAKE_STUB_LIB. Subst STLIB_LD, RANLIB, and AR.
+ * unix/tcl.m4: Update from Tcl.
* win/configure: Regen.
* win/tcl.m4: Update from Tcl.
2001-07-06 Mo DeJong <mdejong@redhat.com>
- * unix/configure: Regen.
- * unix/configure.in: Replace call to SC_ENABLE_GCC with
- AC_PROG_CC so that CC passed in from the caller is respected.
- * unix/tcl.m4: Update from Tcl.
* win/configure: Regen.
- * win/configure.in: Replace call to SC_ENABLE_GCC with
- AC_PROG_CC so that CC passed in from the caller is respected.
* win/tcl.m4: Update from Tcl.
-2001-07-06 Mo DeJong <mdejong@redhat.com>
+2001-07-05 Mo DeJong <mdejong@redhat.com>
* win/Makefile.in: Subst DEPARG directly instead
- of relying on a variable. This will make Cygwin
- builds faster since an extra exec will be avoided.
+ of relying on a variable. This will make Cygwin
+ build faster since an extra exec will be avoided.
* win/configure: Regen.
* win/configure.in: Subst DEPARG.
* win/tcl.m4: Update from Tcl.
+2001-07-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README:
+ * mac/README:
+ * unix/README:
+ * win/README: updated READMEs with purls
+
+2001-07-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/canvas.test:
+ * generic/tkCanvPoly.c (PolygonToArea): Added patch that respects
+ the polygon difference of including points in the polygon even
+ when fill is empty. [Bug #226357]
+
+2001-07-03 Mo DeJong <mdejong@redhat.com>
+
+ * win/Makefile.in: Remove PATHTYPE variable.
+ * win/configure: Regen.
+ * win/configure.in: Don't subst PATHTYPE.
+ * win/tcl.m4: Update from Tcl.
+
+2001-07-03 Mo DeJong <mdejong@redhat.com>
+
+ * win/Makefile.in: Don't use VPSEP, instead just use :
+ in the VPATH.
+ * win/configure: Regen.
+ * win/configure.in: Don't subst VPSEP.
+
+2001-07-03 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * library/xmfbox.tcl (tkMotifFDialog_ActivateSEnt): Added missing
+ backslash [Bug #438247]
+
+2001-07-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkWindow.c (Tk_DestroyWindow): changed to use
+ Tcl_EventuallyFree instead of ckfree so that widgets that have
+ references to a tkwin can use them.
+
+ * generic/tkCanvArc.c:
+ * generic/tkCanvBmap.c:
+ * generic/tkCanvLine.c:
+ * generic/tkCanvPoly.c:
+ * generic/tkCanvText.c:
+ * generic/tkCanvWind.c:
+ * generic/tkRectOval.c: corrected argument handling in
+ Create<Item> functions that could lead to ABRs or FMRs and
+ corrected names of argc/argv to objc/objv.
+
+ * generic/tkImgGIF.c (Mgetc): corrected screwy use of ternary
+ operator and possible FMR.
+
+ * generic/tkEntry.c: corrected missing Tcl_Release that caused
+ font not freed complaints when trying valid cleanup calls.
+ * generic/tkListbox.c: made use of Tcl_Preserve/Tcl_Release to
+ prevent FMR errors in Display functions.
+
+ * unix/tkUnixScale.c (TkpDisplayScale): corrected FMR when scale
+ was deleted while calling its command.
+
+ * library/console.tcl:
+ * library/entry.tcl:
+ * library/spinbox.tcl:
+ * library/text.tcl:
+ * library/tk.tcl: added private ::tk::GetSelection command to
+ handle requesting selection. This is to support requesting
+ UTF8_STRING before generic STRING on Unix. Changed Text, Spinbox,
+ Entry and Console to use this command.
+
+ * tests/select.test:
+ * generic/tkSelect.c (Tk_CreateSelHandler, Tk_DeleteSelHandler):
+ on Unix, a UTF8_STRING handler will be created when the user
+ requests a STRING handler (in addition to the STRING handler).
+ This provides implicit support for the new UTF8_STRING selection
+ target.
+ * unix/tkUnixSelect.c (TkSelEventProc, ConvertSelection): Added
+ support for UTF8_STRING target. [RFE #418653, Patch #433283]
+
+ * generic/tkInt.h: added utf8Atom to TkDisplay structure.
+
+ * tests/listbox.test: changed 'darkblue' to 'white' in a test
+ because it isn't a portable color name.
+
+ * generic/tkEntry.c (DestroyEntry): used Tcl_EventuallyFree
+ instead of ckfree for entryPtr to prevent FMRs. [Bug #413904]
+
+2001-06-26 Mo DeJong <mdejong@redhat.com>
+
+ * unix/Makefile.in:
+ * win/Makefile.in: Add `make shell` target. This target
+ will set the proper env vars before invoking wish
+ from the build directory.
+
+2001-06-26 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure:
+ * win/configure.in: Revert cross compiling change
+ accidently added during last checkin.
+
2001-06-26 Mo DeJong <mdejong@redhat.com>
- * cygtcl.m4: Update from Tcl.
* unix/configure: Regen.
- * win/Makefile.in: Remove PATHTYPE variable.
- Use : in VPATH instead of VPSEP.
+ * unix/configure.in: Fix last checkin by removing
+ export since that only works in bash.
+ * win/configure: Regen.
+ * win/configure.in: Ditto.
+
+2001-06-26 Mo DeJong <mdejong@redhat.com>
+
+ * unix/configure: Regen.
+ * unix/configure.in: Set CFLAGS to "" if the user
+ did not set CFLAGS in the env. This keeps AC_PROG_CC
+ from adding "-g -O2" to the CFLAGS by default.
* win/configure: Regen.
- * win/configure.in: Don't subst PATHTYPE or VPSEP.
+ * win/configure.in: Ditto.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/configure.in: Use RC_DEFINE flag from tcl.m4.
* win/tcl.m4: Update from Tcl.
-2001-06-25 Mo DeJong <mdejong@redhat.com>
+2001-06-22 Mo DeJong <mdejong@redhat.com>
* win/configure: Regen.
* win/tcl.m4: Update from Tcl.
2001-06-22 Mo DeJong <mdejong@redhat.com>
+ * win/configure: Regen.
+ * win/tcl.m4 (SC_CONFIG_CFLAGS): Link to the
+ imm32 library when building with mingw gcc.
+ * win/tkWinX.c: Include the imm.h header
+ to fix compiling with mingw gcc.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/configure.in: Add resource compiler fix from
+ 8.3.3 to fix compiling with mingw.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure: Regen.
+ * win/tcl.m4: Fix silly typo in last checkin.
+
+2001-06-22 Mo DeJong <mdejong@redhat.com>
+
* unix/Makefile.in: Set CFLAGS to @CFLAGS@ and @CFLAGS_DEFAULT@.
Set LDFLAGS to @LDFLAGS@ and @LDFLAGS_DEFAULT@. Add LDFLAGS_DEBUG
and LDFLAGS_OPTIMIZE to match the way CFLAGS_DEFAULT works. Use
@@ -166,237 +3470,1581 @@
2001-06-22 Mo DeJong <mdejong@redhat.com>
- * configure:
- * configure.in: When a windows32 host is detected
- configure in the win subdirectory.
- * cygtcl.m4: Update from Tcl.
- * unix/configure: Regen.
- * win/configure: Regen.
+ * win/configure:
+ * win/tcl.m4: Update From Tcl.
-2001-06-22 Mo DeJong <mdejong@redhat.com>
+2001-06-21 eric melski <ericm@interwoven.com>
- * win/configure:
- * win/tcl.m4: Update from Tcl.
+ * doc/colors.n: Corrected bogus documentation with respect to
+ several shades of blue, all of which were listed as RGB 0 0 0.
+ [Bug #432104].
-2001-06-08 Mo DeJong <mdejong@redhat.com>
+2001-06-14 Donal K. Fellows <fellowsd@cs.man.ac.uk>
- * win/Makefile.in: Set TK_LIBRARY to
- $INSTALL/share/tk8.3 instead of
- $INSTALL/lib/tk8.3.
+ * library/demos/floor.tcl, library/demos/filebox.tcl,
+ * library/demos/clrpick.tcl, library/demos/vscale.tcl,
+ * library/demos/twind.tcl, library/demos/ruler.tcl,
+ * library/demos/plot.tcl, library/demos/items.tcl,
+ * library/demos/hscale.tcl, library/demos/ctext.tcl,
+ * library/demos/cscroll.tcl, library/demos/arrow.tcl,
+ * library/xmfbox.tcl, library/msgbox.tcl,
+ * library/clrpick.tcl, library/bgerror.tcl: Braced expressions.
2001-06-06 Mo DeJong <mdejong@redhat.com>
- * win/configure:
+ * win/configure: Regen.
* win/configure.in: Handle the --prefix option correctly
it should default to /usr/local like the unix version.
-2001-06-05 Mo DeJong <mdejong@redhat.com>
+2001-06-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * doc/selection.n:
+ * doc/clipboard.n: added SEE ALSOs to cross-reference selection
+ and clipboard, with extra note for clipboard command in selection
+ docs. [Patch #422256]
- * cygtcl.m4:
- * unix/configure: Update from Tcl.
+ * unix/tkUnixFont.c: Corrected support for iso10646 (X11 Unicode)
+ fonts on Unix. This adds a ucs-2be (UCS-2 Big Endian) encoding in
+ Tk on Unix that is used for those fonts (X11 requires
+ big-endianness). (welch) [Patch #406411; Bug #220890 #220899]
+ This differs from the 8.3.3 patch by not adding ucs-2be in the
+ preferred encodingList (seems works fine without).
+ Added alias for jisx0201* fonts to jis0201 encoding. [Bug #414033]
+
+2001-05-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinKey.c (TkpSetKeycodeAndState): removed old debug info
+
+2001-05-29 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinX.c: moved the initialization of tkPlatformId from
+ TkWinXInit to TkWinGetPlatformId because static builds could call
+ it before it was initialized. [Bug #427278]
+
+2001-05-28 Peter Spjuth <peter.spjuth@space.se>
+
+ * generic/tkFrame.c:
+ * generic/tkWindow.c:
+ * tests/frame.test: Upgraded frame to use the newer TK_OPTION
+ style when processing configuration options. Some cleanup of
+ bad comments and bad code. [part of patch #420861]
-2001-06-01 Mo DeJong <mdejong@redhat.com>
+2001-05-23 Mo DeJong <mdejong@redhat.com>
- * cygtcl.m4:
* unix/configure:
+ * unix/tcl.m4:
* win/configure:
- * win/tcl.m4: Update from Tcl.
+ * win/tcl.m4: Sync from Tcl sources.
-2001-05-30 Mo DeJong <mdejong@redhat.com>
+2001-05-21 Jeff Hobbs <jeffh@ActiveState.com>
- * unix/configure: Regen.
- * unix/tcl.m4:
- Update from Tcl version.
+ * unix/tcl.m4: sync'ed up wih Tcl tcl.m4. [Bug #419812]
-2001-05-30 Mo DeJong <mdejong@redhat.com>
+ * doc/TkInitStubs.3:
+ * generic/tk.h:
+ * generic/tkStubLib.c: CONST'ified Tk_InitStubs to match CONST
+ changes to Tcl_PkgRequireEx.
- * cygtcl.m4:
- * unix/configure: Regen.
- * unix/tcl.m4:
- Update from Tcl versions.
+2001-05-21 Todd M. Helfter <tmh@purdue.edu>
-2001-05-26 Mo DeJong <mdejong@redhat.com>
+ * doc/menubutton.n:
+ * generic/tkMenubutton.c:
+ * generic/tkMenubutton.h:
+ * mac/tkMacMenubutton.c:
+ * tests/menubut.test:
+ * unix/tkUnixMenubu.c: Implementation of TIP #11, the addition of
+ a -compound option to the menubutton allowing text and an image to
+ be displayed at the same time. This behavior is identical to the
+ behavior of the button widget.
- * cygtcl.m4:
- * unix/aclocal.m4:
- * unix/configure: Regen.
- * unix/tcl.m4:
- * win/aclocal.m4:
- * win/configure: Regen.
- * win/tcl.m4:
- Update from Tcl versions.
+2001-05-16 Donal K. Fellows <fellowsd@cs.man.ac.uk>
-2001-05-09 Mo DeJong <mdejong@redhat.com>
+ * doc/console.n: Added - was erroneously placed in Tcl before...
+
+2001-04-25 Mo DeJong <mdejong@redhat.com>
- * unix/Makefile.in: Use TK_STUB_LIB_FILE instead
- of STUB_LIB_FILE subst.
* unix/configure: Regen.
- * unix/configure.in: Use new path macros.
* unix/tcl.m4: Update from Tcl.
* win/configure: Regen.
- * win/configure.in: Use new path macros.
* win/tcl.m4: Update from Tcl.
-2001-05-08 Ian Roxborough <irox@redhat.com>
+2001-04-25 Mo DeJong <mdejong@redhat.com>
- * unix/configure.in: Cygnus local change
- to build gdbtk: Set TK_BUILD_INCLUDES to
- correct path.
- * unix/configure: Regenerated.
-
-2001-04-09 Mo DeJong <mdejong@redhat.com>
+ * unix/configure: Regen.
+ * unix/configure.in: Use $@ in MAKE_LIB and MAKE_STUB_LIB
+ commands instead of using a delayed subst variable. Replace
+ instances of STUB_LIB_FILE with TK_STUB_LIB_FILE.
+
+2001-04-25 Mo DeJong <mdejong@redhat.com>
- * unix/aclocal.m4: Pull in tcl.m4.
+ * unix/Makefile.in: Use TCL_STUB_LIB_FILE instead of STUB_LIB_FILE.
* unix/configure: Regen.
- * unix/tcl.m4: Add from tcl/unix.
- * win/Makefile.in: Append version to tclsh
- in the win subdirectory.
- * win/configure: Regen.
- * win/configure.in: The TK_BUILD_LIB_SPEC and
- TK_BUILD_LIB_SPEC variables need to use the
- lib file and not the dll file, since it is
- not possible to link to a dll with VC++.
- Use new TCL_TOOL_PATH macro to correctly
- set the XINCLUDES variable.
- * win/tcl.m4: Update from tcl/win so we can use
- the TCL_TOOL_PATH macro.
+ * unix/configure.in: Don't subst STUB_LIB_FILE, use TCL_STUB_LIB_FILE
+ instead.
+
+2001-04-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tkImage.c (Tk_ImageObjCmd,DeleteImage): Better detection
+ of deletion when world is falling apart. [Bug #220819]
+
+2001-04-04 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/tkWinMenu.c (TkWinHandleMenuEvent): corrected reseting of
+ service mode to only occur when it was set. [Bug #220948]
+
+2001-04-03 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/winClipboard.test: improved results for understanding when
+ tests fail.
+
+ * tests/winDialog.test: string totitle'd some results that
+ expected [pwd] to return a capital drive letter.
+
+ * tests/cursor.test: changed tests to use 'heart' cursor because
+ 'arrow' on windows has a pre-skewed use count.
+
+ * win/tkWinDialog.c (GetFileNameA): initialize multi to 0.
+
+2001-04-02 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * win/configure:
+ * win/tcl.m4 (SHLIB_LD): added -incremental:no. [Bug #219381]
+
+ * generic/tkMenu.c (TkInvokeMenu): checked for menu deletion
+ before calling associated menu entry command. [Bug #220821]
+
+ * doc/image.n: added warning about names chosen for images.
+
+ * generic/tkImgPhoto.c (ImgPhotoCmd): corrected the src and dest
+ values for $imageName put when -format and -to are used.
+ [Bug #232741]
+
+ * tests/listbox.test: added test listbox-27.1, delete during
+ scrollbar update
+ * generic/tkListbox.c (DestroyListbox, ListboxEventProc):
+ corrected listbox to make proper use of Tcl_EventuallyFree and
+ protect against unusual listbox deletion.
+
+ * tests/entry.test: added tests entry-20.*, delete during widget
+ activity
+ * generic/tkEntry.c (DestroyEntry, EntryEventProc): fixed the
+ entry widget to survive deletion while processing scrollbar
+ updates and validation.
+
+ * tests/canvas.test: test of canvas delete during event
+ * generic/tkCanvas.c (DestroyCanvas, CanvasEventProc): fixed the
+ canvas to survive deletion during event processing. [Bug #228024]
+
+2001-04-01 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * README:
+ * mac/README: updated patchlevel to 8.4a3 and corrected links and
+ notes.
+
+ * generic/tk.h:
+ * unix/configure.in (TK_PATCH_LEVEL):
+ * unix/configure:
+ * unix/tk.spec:
+ * win/configure.in (TK_PATCH_LEVEL):
+ * win/configure: updated patchlevel to 8.4a3
+
+2001-03-30 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tests/safe.test: added note about correcting failures in
+ safe.test.
+ * library/tk.tcl: moved package require msgcat inside if case to
+ not be used in safe interps.
+
+ * win/makefile.vc:
+ * win/configure:
+ * win/tcl.m4: added imm32.lib to LIBS_GUI for Tk IME support.
+ * win/tkWinInt.h:
+ * win/tkWinKey.c:
+ * win/tkWinX.c: added support for changing IME on the fly in
+ Windows (2000). (lam) [Patch #402993]
+
+ * tests/bind.test (bind-22.18):
+ * generic/tkBind.c (NameToWindow): handled the error case where a
+ valid-looking but invalid identifier could be passed in certain
+ event generate options causing a crash. [Bug #411307]
+
+ * win/tkWinWm.c (UpdateWrapper): ensured that the passed in winPtr
+ had an existent window to operate on. [Bug #409172]
+
+ * win/Makefile.in (install-*): improved install-* targets to use
+ their base build dependency.
+
+ * generic/tkImage.c (Tk_ImageObjCmd, EventuallyDeleteImage):
+ added casts to allow compiling on Windows with debbuging.
+
+2001-03-29 Jeff Hobbs <jeffh@ActiveState.com>
-2001-04-05 Mo DeJong <mdejong@redhat.com>
+ * library/msgs/de.msg: fixed translations. [Patch #403525]
- * win/Makefile.in: Don't depend on
- TCLSH_PROG variable from configure.
- * win/configure: Regen.
- * win/configure.in: Don't call
- SC_PROG_TCLSH, it was removed from
- Tcl. This macro required that Tcl
- be built before Tk could be configured.
- * win/tcl.m4: Update from Tcl version.
+ * doc/canvas.n: Noted ability to specify coords as a list in the
+ docs. (techentin) [Patch #403660]
-2000-08-08 Jeff Hobbs <hobbs@ajubasolutions.com>
+ * tests/canvas.test: added test case to check obj conversion
+ * generic/tkObj.c (UpdateStringOfMM, SetMMFromAny): better
+ obj-aware screen distances. (pgbaum, hobbs) [Patch #403327]
- 8.3.2 RELEASE finalized
+ * library/bgerror.tcl (bgerror): allow focus into details window
+ for Windows C&P to work. [Bug #220929]
- * changes: updated for release notes version of ChangeLog
+ * library/tk.tcl: put a catch around adding <hpBackTab> to the
+ <<PrevWindow>> virtual event as it doesn't seem to work on all HP
+ systems. [Bug #411669]
+
+ * library/tkfbox.tcl: fixed selecting directories and single files
+ with spaces using tk_getOpenFile -multiple 1. [Bug #411640]
+
+ * win/tkWinDialog.c (GetFileNameA): added support for -multiple to
+ ascii-based tk_getOpenFile (Win9*). (haneef) [Patch #403047]
+ (GetFileNameW): increased number of files that could be returned
+ by tk_getOpenFile -multiple. [Patch #412042]
+
+2001-03-29 Mo DeJong <mdejong@redhat.com>
+
+ * library/entry.tcl (tkEntryMouseSelect):
+ * library/text.tcl (tkTextSelectTo): When
+ the mouse is dragged with the button down,
+ move the insertion cursor to the current
+ mouse position.
+ * tests/event.test: Add a series of tests
+ for event generation. Add tests for selection,
+ check the position of the insertion cursor.
+
+2001-03-28 Jeff Hobbs <jeffh@gimlet.activestate.com>
+
+ * unix/configure:
+ * unix/tcl.m4: corrected IRIX-5.x config to not use -n32.
+ (english) [Patch 403626]
+
+2001-03-28 Don Porter <dgp@users.sourceforge.net>
+
+ * tests/focus.test (focus-6.1):
+ * tests/macEmbed.test (unixEmbed-5.1):
+ * tests/macMenu.test (macMenu-21.3):
+ * tests/menu.test (menu-27.1):
+ * tests/unixEmbed.test (unixEmbed-8.2):
+ * tests/unixWm.test (unixWm-50.4): Replaced all [load {} tk]
+ in Tk test suite with [load {} Tk]. [Bug 220940, Patch 411952]
+
+2001-03-12 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * doc/menu.n:
+ * unix/mkLinks: Added documentation for [tk_menuSetFocus].
+
+2001-03-12 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * doc/text.n:
+ * doc/tkvars.n:
+ * unix/mkLinks: Added documentation for commands and variables
+ matching tk_text*.
-2000-08-05 Jeff Hobbs <hobbs@ajubasolutions.com>
+2001-03-08 Don Porter <dgp@users.sourceforge.net>
- * win/Makefile.in (cat32.${OBJEXT}): corrected where to find cat.c
- given the change in default def'n of TCL_SRC_DIR.
+ BRANCH dgp-privates-into-namespace:
+ * generic/tkTextDisp.c:
+ * library/unsupported.tcl:
+ * tests/textDisp.test: Restored the global variables tk_textRedraw
+ and tk_textRelayout. Since they match tk_*, they should remain
+ publicly available until at least Tk 9.
- * win/tcl.m4: changed references from 8.4 to 8.3 (leftover from a
- backported file).
+2001-03-01 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace:
+ * library/unsupported.tcl: New file for Tk's unsupported
+ interfaces. Contains [tk::unsupported::ExposePrivateCommand]
+ and [tk::unsupported::ExposePrivateVariable] that restore the
+ availability of an old public name of one of Tk's private
+ commands and variables, respectively, for those applications
+ and extensions that depend on the old names against advice.
+
+2001-02-28 Don Porter <dgp@users.sourceforge.net>
+
+ BRANCH dgp-privates-into-namespace: Feature branch to move all
+ of Tk's private commands and variable into the ::tk namespace
+ and its children.
+
+ * doc/tkvars.n: Documented private variable tkPriv renamed tk::Priv.
+
+ * generic/tkBind.c:
+ * generic/tkMenu.c:
+ * generic/tkTextDisp.c:
+ * library/bgerror.tcl:
+ * library/button.tcl:
+ * library/choosedir.tcl:
+ * library/clrpick.tcl:
+ * library/comdlg.tcl:
+ * library/console.tcl:
+ * library/dialog.tcl:
+ * library/entry.tcl:
+ * library/focus.tcl:
+ * library/listbox.tcl:
+ * library/menu.tcl:
+ * library/msgbox.tcl:
+ * library/optMenu.tcl:
+ * library/palette.tcl:
+ * library/scale.tcl:
+ * library/scrlbar.tcl:
+ * library/spinbox.tcl:
+ * library/tclIndex:
+ * library/tearoff.tcl:
+ * library/text.tcl:
+ * library/tk.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl:
+ * mac/tkMacMenu.c:
+ * tests/clrpick.test:
+ * tests/filebox.test:
+ * tests/macMenu.test:
+ * tests/menu.test:
+ * tests/menuDraw.test:
+ * tests/msgbox.test:
+ * tests/text.test:
+ * tests/textDisp.test:
+ * tests/unixMenu.test:
+ * tests/winMenu.test:
+ * tests/xmfbox.test:
+ * unix/tkUnixDialog.c: All Tk commands matching ::tk[A-Z]* and
+ all Tk private variables in the global namespace were renamed to
+ live in the namespace ::tk or one of its children.
+
+2001-02-13 Eric Melski <ericm@interwoven.com>
+
+ * doc/photo.n: [Bug 132213] Added clarification on interpretation
+ of ranges for "photoName data -from" subcommand.
+
+2001-02-12 D. Richard Hipp <drh@hwaci.com>
+
+ TIP #21: Asymmetric padding in the pack and grid geometry managers.
+ With this changes, you can now say "-padx {10 20}" to put 10 pixels
+ of padding on the left and 20 on the right. Similar rules apply
+ for vertical padding. See the revised documentation for details.
+
+2001-01-02 Andreas Kupries <a.kupries@westend.com>
+
+ * Everything below belongs together and implements TIP #8
+ (SF patch #102833).
+
+ * win/tkWinWm.c (line 56f): Added icon structures.
+ * win/tkWinWm.c (struct WmInfo, line 242): Added reference to
+ optional icon for titlebar.
+ * win/tkWinWm.c (struct ThreadSpecificData, line 335): Added
+ reference to optional default icon for toplevel windows.
+ * win/tkWinWm.c (line 387 ... 1169): All the new functions required
+ to deal with icon specifications, 'InitWm' changed.
+ * win/tkWinWm.c (TkWmNewWindow, UpdateWrapper, TkWmDeadWindow, Tk_WmCmd):
+ Added initialization and handling of the new fields.
+ * doc/wm.n: Documentation updated to explain the newly available
+ functionality.
+
+2000-12-13 jeff hobbs <jhobbs@interwoven.com>
+
+ * generic/tkObj.c (SetMMFromAny): Added ability to recognize
+ double type object to speed up canvas coord calculations.
+ [Patch 403327]
+
+2000-12-12 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/entry.n: Improved documentation of interplay between the
+ -state and -textvariable options.
+
+2000-11-29 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * tests/image.test (image-1.10): Improved this test, which
+ previously only worked if the command failed to delete the root
+ window, and caused *major* trouble otherwise...
+ * generic/tkImage.c (EventuallyDeleteImage): Created this function
+ so that images that get deleted during the creation of an image
+ won't cause a nasty core dump. Properly fixes bug #120819.
+
+2000-11-28 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/image.n:
+ * generic/tkImage.c (Tk_ImageObjCmd): Backed out previous change.
+ Bug #120819 is back again in force. Left the test in there
+ though.
+
+2000-11-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/image.n:
+ * tests/image.test (image-1.10):
+ * generic/tkImage.c (Tk_ImageObjCmd): Prohibited image names that
+ start with "." since they can cause some really obscure
+ crashes. Fixes Bug #120819.
+
+2000-11-21 Eric Melski <ericm@ajubasolutions.com>
+
+ Overall change: Implemented TIP 5, which exports
+ TkClassProcs/TkSetClassProcs as Tk_ClassProcs/Tk_SetClassProcs,
+ adding a size field to Tk_ClassProcs to allow for future
+ expansion, and renaming the geometryProc to worldChangedProc,
+ which is more in keeping with the actual use of the callback.
+
+ * unix/mkLinks: Added link for Tk_SetClassProcs.
+
+ * doc/SetClassProcs.3: Documentation for
+ Tk_ClassProcs/Tk_SetClassProcs.
+
+ * generic/tkCanvas.c:
+ * generic/tkEntry.c:
+ * generic/tkFrame.c:
+ * generic/tkListbox.c:
+ * generic/tkMenu.c:
+ * generic/tkMessage.c:
+ * generic/tkScale.c:
+ * generic/tkText.c: Updated to use Tk_ClassProcs/Tk_SetClassProcs
+ instead of TkClassProcs/TkSetClassProcs.
+
+ * generic/tkMenubutton.c:
+ * generic/tkScrollbar.c:
+ * generic/tkButton.c: Updated to use Tk_SetClassProcs instead of
+ TkSetClassProcs.
+
+ * generic/tkMenubutton.h:
+ * generic/tkScrollbar.h:
+ * generic/tkButton.h:
+ * win/tkWinButton.c:
+ * win/tkWinScrlbr.c:
+ * mac/tkMacButton.c:
+ * mac/tkMacMenubutton.c:
+ * mac/tkMacScrlbr.c:
+ * unix/tkUnixButton.c:
+ * unix/tkUnixMenubu.c:
+ * unix/tkUnixScrlbr.c: Updated to use Tk_ClassProcs instead of
+ TkClassProcs.
+
+ * generic/tkDecls.h:
+ * generic/tkStubInit.c:
+ * generic/tkIntDecls.h: Regenned from tk.decls, tkInt.decls.
+
+ * generic/tk.h: Added declaration of Tk_ClassProcs, with size
+ field. Added typedef's for Tk_ClassCreateProc,
+ Tk_ClassWorldChangedProc, Tk_ClassModalProc. Added definition of
+ Tk_GetClassProc macro, shorthand for extracting a member of the
+ Tk_ClassProcs structure.
+
+ * generic/tkInt.h: Removed declaration of TkClassProcs,
+ TkClassGeometryProc, etc.
+
+ * generic/tkBind.c (Tk_BindEvent): Updated to use Tk_GetClassProc
+ macro to extract modalProc; added check that the modalProc is non-NULL.
+
+ * generic/tkFont.c (RecomputeWidgets): Updated to use
+ Tk_GetClassProc macro to extract worldChangedProc; added comment
+ about the choice of a recursive versus iterative algorithm for
+ propagating world changed messages.
+
+ * generic/tkWindow.c (Tk_MakeWindowExist): Updated to use
+ Tk_GetClassProc macro to extract createProc from Tk_ClassProcs.
+
+ * generic/tk.decls: Added declaration for Tk_SetClassProcs.
+
+ * generic/tkInt.decls: Commented out declaration for
+ TkSetClassProcs, which is made public by this change. The entry
+ is left in place, but commented, so that future developers will
+ know not to reuse it's stub number.
+
+2000-11-21 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * doc/ConfigWidg.3: Added deprecation note from Bug #120944 - use
+ Tk_SetOption() instead.
+
+ * generic/tkImgPhoto.c (TkPhotoGetValidRegion): Applied patch to
+ create this function and add it to tkInt stubs. Should now be
+ possible to write an extension that accesses the transparency data
+ in a photo image. Bug #120930
+
+2000-11-03 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ 8.4a2 RELEASE
+
+ * generic/tkWindow.c (Initialize): added call to Tcl_SetMainLoop.
+ This only has effect when tclsh is run (not wish), and then Tk is
+ loaded in interactively.
+
+2000-11-02 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * win/tkWinButton.c:
+ * win/tkWinDialog.c:
+ * win/tkWinScrlbr.c:
+ * win/tkWinWm.c: fixed up code for Win64 support. This mostly
+ remains in _WIN64 #ifdef's, until updated compilers are standard.
+
+ * win/tcl.m4:
+ * win/makefile.vc: updated for Win64 compile support
+
+ * unix/configure:
+ * win/configure: checked in configure scripts so people doing
+ CVS checkouts aren't required to have autoconf. Changes to
+ configure.in in the future will require the corresponding
+ configure script to also be re-autoconf'ed and checked in.
+
+ * doc/event.n: added note that key events require window focus.
+
+2000-11-01 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * win/tkWinDialog.c (GetFileNameW, GetFileNameA,
+ Tk_ChooseDirectoryObjCmd): created
+ work-around for change in NT5.0/98 that caused no initialdir
+ setting to open the browser up in the user's documents dir.
+
+ * tests/color.test: marked color-2.6 nonPortable as we can't
+ reliably assume what 'red' maps to.
+
+2000-11-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/winDialog.test: Corrected expected results for bad option
+ tests (5.2, 5.5) to include -multiple option.
+
+ * win/tkWinDialog.c: Added branch for 0 return from
+ CommDlgExtendedError() switches; this was formerly treated as an
+ error, but it actually is not, since it just means the user hit
+ cancel or closed the dialog. (GetFileNameW): Added better smarts
+ such that -multiple is not considered a valid option for
+ tk_getSaveFile.
+ Removed CommDlgExtendedError() checks for color and choosedir
+ dialogs, and removed all except the explicit invalid filename
+ checks for the file dialogs.
+
+2000-10-30 David Gravereaux <davygrvy@ajubasolutions.com>
+
+ * win/configure.in:
+ * win/Makefile.in:
+ * win/makefile.vc:
+ * win/rc/tk.rc:
+ * win/rc/tk_base.rc (new):
+ * win/rc/wish.rc: Added logic to derive filenames better in the
+ resource scripts based on compile options along with better
+ support for building a static wish shell with cursor resources.
+
+2000-10-27 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * unix/tcl.m4: added support for AIX-5.
+
+ * tests/tk.test:
+ * doc/tk.n: updated to reflect default on status of useinputmethods.
+ * library/tk.tcl: tk useinputmethods is set to 1 by default. This
+ enables Kanji and dead-char input by default. Intro'd in
+ 1999-12-16 with default off to avoid some problems with older X
+ servers that would slow down widget creation over time.
+
+ * win/Makefile.in (test, winhelp, tktest): corrected the
+ TCL_LIBRARY path specification.
+
+2000-10-18 Eric Melski <ericm@ajubasolutions.com>
+
+ * win/tkWinDraw.c (RenderObject): Applied patch from [Bug: 6368],
+ which corrects rendering of 1-pixel wide stippled lines on Windows.
+
+ * generic/tkCanvLine.c (DisplayLine): Applied patch from
+ [Bug: 6368], corrects bugs relating to use of active- and
+ disabledwidth values for displaying lines (disabledwidth was never
+ used, and activewidth/disablewidths would only possibly be used
+ when greater than default width, rather than when simply not equal
+ to default width).
+
+ * library/tkfbox.tcl (OkCmd): Applied patch from [Bug: 6365],
+ which adds safety for directory names containing spaces or which
+ are non-lists.
+
+ * win/tkWinDialog.c (GetFileNameW, GetFileNameA,
+ Tk_ChooseColorObjCmd, Tk_ChooseDirectoryObjCmd): Added error
+ checking for the return value from the common dialog functions, so
+ that the commands will not silently fail if the common dialog
+ returns an error. [Bug: 6369].
+
+2000-10-10 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkConfig.c (Tk_InitOptions): Added
+ Tcl_IncrRefCount/Tcl_DecrRefCount calls on valuePtr, to prevent
+ memory leaks when the value object comes from the option
+ database. [Bug: 6275].
+
+2000-10-06 Jeff Hobbs <hobbs@ajubasolutions.com>
+
+ * win/Makefile.in (cat32.${OBJEXT}): add win/ subdirectory to
+ cat32 target to correctly find the source file.
+
+2000-10-05 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkCmds.c (Tk_WinfoObjCmd): Added check for
+ TK_ANONYMOUS_WINDOW flag in the [winfo children] subcommand; if
+ set, the window will not be printed in the list of children.
+
+ * doc/CrtWindow.3: Added entry for Tk_CreateAnonymousWindow.
+
+ * generic/tkWindow.c
+ (Tk_CreateAnonymousWindow): New API for creating anonymous
+ windows. These windows are manipulable from C, but not from Tcl,
+ because they have no pathname associated with them. They are used
+ initially by widgets that do rubber-band resizing (panedwindow,
+ multi-column listbox, etc.), and may be useful for other widgets
+ as well (dropbox, combobox).
+ (Tk_DestroyWindow): Added check for TK_ANONYMOUS_WINDOW flag when
+ determining whether to generate a DestroyNotify event.
+
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h: Regen'd from tk.decls.
+
+ * generic/tk.decls: Added Tk_CreateAnonymousWindow declaration.
+
+ * generic/tk.h: Added TK_ANONYMOUS_WINDOW flag for Tk_Window's.
+
+2000-10-04 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/MaintGeom.3: Noted that Tk_MaintainGeometry handles direct
+ descendants properly.
+
+ * generic/tkGeometry.c (Tk_MaintainGeometry): Added a check for
+ the case in which the slave window is a direct descendant of the
+ master window. In this case, we need not set up the additional
+ infrastructure normally provide by Tk_MaintainGeometry, because we
+ can rely on the parent/child relationship to handle it for us
+ implicitly. In this case, Tk_MaintainGeometry just calls directly
+ to Tk_MoveResizeWindow. This allows geometry managers to simply
+ always use Tk_MaintainGeometry to maintain geometry for slaves,
+ and avoid doing the direct descendant check themselves.
+ (Tk_UnmaintainGeometry): Added a matching check for the direct
+ descendant case; in this case, Tk_UnmaintainGeometry simply
+ returns immediately.
+
+2000-10-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkButton.c (ConfigureButton): Added tests for -compound
+ option, so that when there is a textvariable and an image, and
+ -compound is not none, the button will display both the
+ textvariable and the image.
+
+ * doc/SetOptions.3: Added note that restoreProc and freeProc may
+ be NULL.
+
+ * generic/tkConfig.c (Tk_RestoreSavedOptions): For custom options,
+ added test that the restoreProc is not NULL, to allow for custom
+ options that don't care about supporting Tk_RestoreSavedOptions.
+
+2000-09-29 D. Richard Hipp <drh@hwaci.com>
+
+ * generic/tkBitmap.c: Changes to prevent a BadMatch error from the
+ Xserver when the same bitmap is used on two or more screens of the
+ same display.
+
+ * tests/menu.test: Print a warning if the TK_ALT_DISPLAY environment
+ variable is not configured so as to test for the bug fix above.
+
+ * library/tk.tcl (::tk::SetGrabFocus): "Catch" the grab in case
+ another application already holds the grab and the "grab" command
+ fails.
+
+2000-09-29 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/Makefile.in: commented use of TESTFLAGS
+ * unix/Makefile.in: added TESTFLAGS to test and testlang targets to
+ conform with Windows makefile and TEA style.
+
+2000-09-29 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkTest.c: Fixed tests to use updated API.
+
+ * doc/SetOptions.3:
+ * generic/tk.h:
+ * generic/tkConfig.c: Changed interface for Tk_CustomOptionSetProc
+ and Tk_CustomOptionGetProc; these now take a pointer to the start
+ of the widget record, and an integer offset to the slot for the
+ option value, instead of just a pointer to the slot. This allows
+ more sophisticated options to do interesting things based on other
+ data in the widget record.
+
+2000-09-17 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tk.h: Added declaration of Tk_ObjCustomOption structure,
+ used for TK_OPTION_CUSTOM, and typedef's of the functions
+ Tk_CustomOptionSetProc, Tk_CustomOptionGetProc,
+ Tk_CustomOptionRestoreProc, and Tk_CustomOptionFreeProc, used for
+ TK_OPTION_CUSTOM.
+
+ * doc/SetOptions.3: Added documentation of TK_OPTION_CUSTOM, and
+ section "CUSTOM OPTION TYPES" explaining how to create and use
+ custom options.
+
+ * tests/config.test: Added tests for custom option type.
+
+ * generic/tkTest.c: Added test support for TK_OPTION_CUSTOM to
+ TestobjconfigObjCmd. Added CustomOption* functions to implement a
+ test custom option.
+
+ * generic/tkConfig.c: Added new option type TK_OPTION_CUSTOM,
+ which allows the definition of custom option types by creating
+ parsing, printing, freeing, and restoring procedures for a custom
+ option. This is needed by the text and canvas widgets if they are
+ to be fully objectified.
+
+2000-09-07 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/Tk_Init.3:
+ * doc/bell.n:
+ * doc/loadTk.n: minor doc cleanup
+
+2000-09-06 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/HWNDToWindow.3:
+ * doc/GetHWND.3: Changed synopsis to indicate the tkPlatDecls.h
+ should be included, not tk.h.
+
+ * generic/tkPlatDecls.h: Removed #include <windows.h> for Windows,
+ a better solution for now is to update the docs and have extension
+ authors #include <tkPlatDecls.h>.
+
+ * generic/tk.h: Removed '#include "tkPlatDecls.h"', as the
+ incorrect inclusion order between windows.h/tkPlatDecls.h causes
+ build conflicts on Windows.
+
+ * generic/tkPlatDecls.h: Added #include <windows.h> for Windows,
+ so that HWND, etc., are defined properly.
+
+2000-09-06 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/canvas.n: fixed doc bug (ellson). [Bug: 6218]
+
+ * README:
+ * generic/tk.h:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/configure.in: updated to patchlevel 8.4a2
+
+ * generic/tkMessage.c (MessageWidgetObjCmd): initialized result to
+ avoid pedantic warning.
+
+ * generic/tkGrab.c (Tk_GrabObjCmd): changed len arg from size_t to
+ int to fix pedantic warning.
+
+2000-09-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * win/makefile.vc (install-libraries):
+ * win/Makefile.in (install-libraries):
+ * unix/Makefile.in (install-libraries): Added tkPlatDecls.h to
+ list of header files to install.
+
+ * generic/tk.h: Added #include "tkPlatDecls.h", which declares the
+ platform specific component of the public Tk stubs API's.
+
+2000-08-29 Eric Melski <ericm@ajubasolutions.com>
+
+ * win/tkWinMenu.c (DrawWindowsSystemBitmap): Use scratchDC
+ for determining the source's logical coordinates. Patch from
+ [Bug: 6134 (Markus Oberhumer)].
+
+ * win/tkWinMenu.c (SetDefaults): Compute the indicatorDimensions[]
+ under Windows NT/2000 in the same way as under Windows 95/98.
+ Patch from [Bug: 6134 (Markus Oberhumer)].
+
+ * win/tkWinFont.c (GetScreenFont): Added a memset() to
+ pacify memory checkers. Patch from [Bug: 6134 (Markus Oberhumer)].
+
+ * library/tkfbox.tcl (::tk::dialog::file::Update): Corrected
+ handling of multi-pattern filters (eg, "* *.*"), which was broken
+ by the getOpenFile performance patches applied earlier.
+
+2000-08-24 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/toplevel.n:
+ * doc/spinbox.n:
+ * doc/scrollbar.n:
+ * doc/scale.n:
+ * doc/menubutton.n:
+ * doc/menu.n:
+ * doc/listbox.n:
+ * doc/entry.n:
+ * doc/frame.n:
+ * doc/message.n:
+ * doc/checkbutton.n:
+ * doc/radiobutton.n:
+ * doc/button.n:
+ * doc/label.n:
+ * doc/canvas.n:
+ * doc/text.n: Fixed Standard Options section to make best use of
+ new tab settings in man.macros.
+
+2000-08-24 Mo DeJong <mdejong@redhat.com>
+
+ * unix/README: Update to account for removal of --enable-gcc.
+ * unix/configure.in:
+ * unix/tcl.m4 (SC_ENABLE_GCC): Remove --enable-gcc option.
+ * win/configure.in:
+ * win/tcl.m4 (SC_ENABLE_GCC): Remove --enable-gcc option.
+ Remove quick hack that provided cross compile support for
+ windows builds.
+
+2000-08-23 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkButton.c (ButtonTextVarProc): reversed change below,
+ it was not correct.
+
+2000-08-22 Jeff Hobbs <hobbs@scriptics.com>
+
+ * generic/tkButton.c (ButtonTextVarProc): changed order of
+ incr/decr of new value object, in case they are equal.
+
+2000-08-18 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkImgPhoto.c (ImgPhotoGet): Removed redundant call to
+ DitherInstance; this call was formerly being made from
+ ImgPhotoGet->ImgPhotoConfigureInstance->DitherInstance, and
+ ImgPhotoGet->DitherInstance. The second call was removed.
+
+2000-08-10 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/SetOptions.3: added missing ')'.
+
+2000-08-09 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/SetOptions.3: Updated documentation to reflect support for
+ TK_OPTION_NULL_OK for TK_OPTION_DOUBLE and TK_OPTION_PIXELS.
+
+ * generic/tkConfig.c: Added for TK_OPTION_NULL_OK support for
+ TK_OPTION_DOUBLE and TK_OPTION_PIXELS.
+
+ * doc/place.n: Updated, reformatted manual entry.
+
+ * tests/place.test: Added many tests.
+
+ * generic/tkPlace.c (Tk_PlaceObjCmd): Updated to use Tk
+ widget-option management facilities to manage place options (-x,
+ -y, etc.), which simplifies the placer code. Added support for
+ [place configure pathName] and [place configure pathName -option],
+ similar to the behavior of the configure subcommand supported by
+ widgets.
+
+2000-08-08 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/place.test: Extended test suite to test error returns from
+ [place].
+
+ * generic/tkInt.h: Replaced Tk_PlaceCmd prototype with
+ Tk_PlaceObjCmd prototype.
+
+ * generic/tkWindow.c: Updated [place] command entry to use new
+ Tcl_Obj interface.
+
+ * generic/tkPlace.c (Tk_PlaceObjCmd): Tcl_Obj'ified [place] command.
+
+2000-08-07 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkWindow.c: Updated [selection] command entry to use
+ new Tcl_Obj interface.
+
+ * generic/tkInt.h: Replaced Tk_SelectionCmd prototype with
+ Tk_SelectionObjCmd prototype.
+
+ * tests/select.test: Updated test suite to recognize standardized
+ error messages.
+
+ * generic/tkSelect.c (Tk_SelectionObjCmd): Tcl_Obj'ified
+ [selection] command.
+
+2000-08-07 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/cursors.n: changed .SS to more compatible macros.
+
+2000-08-05 Jeff Hobbs <hobbs@scriptics.com>
* library/safetk.tcl: rationalized the setting of tk_library when
initialized Tk in a safe interpreter.
-2000-08-04 Jeff Hobbs <hobbs@ajubasolutions.com>
+2000-08-03 Eric Melski <ericm@ajubasolutions.com>
- * BACKPORTED FROM 8.4 (HEAD) BRANCH:
+ * generic/tkWindow.c: Updated "grab" command entry to use
+ Tcl_Obj'ified command.
- * tests/button.test:
- * generic/tkButton.c: Added -activeforeground, -activebackground
- for labels, for the -state option.
+ * generic/tkInt.h: Replaced Tk_GrabCmd prototype with
+ Tk_GrabObjCmd prototype.
+
+ * tests/grab.test: Initial suite of tests for [grab] command.
+
+ * generic/tkGrab.c (Tk_GrabObjCmd): Tcl_Obj'ified [grab] command.
+
+ * generic/tkInt.h: Removed Tk_AfterCmd function prototype; the
+ function does not exist (since 4.0p3). Cleaned up some line
+ wrapping.
+
+ * generic/tk.h: Removed "#define Tk_AfterCmd Tcl_AfterCmd";
+ nothing in the core uses Tk_AfterCmd, and Tcl_AfterCmd doesn't exist
+ anymore anyway.
+
+ * generic/tkInt.h: Replace Tk_BindCmd prototype with
+ Tk_BindObjCmd prototype.
+
+ * generic/tkWindow.c: Updated "bind" command entry to use
+ Tcl_Obj'ified command.
+
+ * generic/tkCmds.c (Tk_BindObjCmd): Tcl_Obj'ified [bind] command.
+
+ * tests/bind.test: Tweaked expected error messages for [bindtags]
+ to comply with updated error messages.
+
+ * generic/tkMenu.c (CloneMenu): Replaced calls to Tk_BindtagsCmd
+ with equivalent calls to Tk_BindtagsObjCmd.
+
+ * generic/tkInt.h: Replace Tk_BindtagsCmd prototype with
+ Tk_BindtagsObjCmd prototype.
+
+ * generic/tkWindow.c: Updated "bindtags" command entry to use
+ Tcl_Obj'ified command.
+
+ * generic/tkCmds.c (Tk_BindtagsObjCmd): Tcl_Obj'ified [bindtags]
+ command.
+
+2000-08-02 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkCmds.c (Tk_TkwaitObjCmd): Tcl_Obj'ified [tkwait] command.
+
+ * generic/tkWindow.c: Updated "tkwait" command entry to use
+ Tcl_Obj'ified command.
+
+ * generic/tkInt.h: Replace Tk_TkwaitCmd prototype with
+ Tk_TkwaitObjCmd prototype.
+
+ * generic/tkGrid.c (Tk_GridCmd): Split [grid] subcommands into
+ separate functions instead of inlining them all in Tk_GridCmd.
+
+2000-08-01 Eric Melski <ericm@ajubasolutions.com>
+
+ * generic/tkInt.h: Replaced prototype for Tk_MessageCmd with
+ prototype for Tk_MessageObjCmd.
+
+ * generic/tkWindow.c: Marked message command as using the new
+ MessageObjCmd instead of the old MessageCmd.
+
+ * tests/message.test: Added tests for the message widget.
+
+ * generic/tkMessage.c: Obj'ified the message widget.
+
+ * generic/tkInt.h: Removed prototype for Tk_ClipboardCmd, added
+ prototype for Tk_ClipboardObjCmd.
+
+ * generic/tkWindow.c: Updated function pointers for clipboard
+ command to use Tcl_Obj version.
+
+ * tests/clipboard.test: Updated tests to expect standard error
+ messages.
+
+ * generic/tkClipboard.c (Tk_ClipboardObjCmd): Obj'ified
+ Tk_ClipboardCmd -> Tk_ClipboardObjCmd.
+
+2000-07-28 Eric Melski <ericm@ajubasolutions.com>
+
+ * unix/tkUnixButton.c (TkpDisplayButton): Added bits to change
+ the indicator color when radio-/check-buttons are disabled. This
+ reduces the visual incongruity when a group of these controls are
+ disabled together.
+
+ * win/tkWinMenu.c (ReconfigureWindowsMenu): Added MF_GRAYED bit
+ for disabled menu entries, to ensure that those which are drawn by
+ the system are shown grayed (such as entries on menubars) [Bug: 4372].
* doc/label.n: Added -disabledforeground to list of options [Bug:
6053].
- * tests/focus.test (focusSetupAlt): removed wm withdraw from proc
- as it would cause a hang for tkwait visibility
+ * mac/tkMacDefault.h:
+ * unix/tkUnixDefault.h: Added default values for listbox
+ disabledforeground and state.
- * tests/menu.test:
- * generic/tk3d.c:
- * generic/tkColor.c:
- * generic/tkCursor.c: corrected handling of 3DBorder, Cursor and
- Color objects on multiple screens. [Bug: 5454]
+ * win/tkWinDefault.h: Changed default listbox background color to
+ white and listbox selection borderwidth to 0, in keeping with the
+ "Microsoft Windows User Experience"; added default values for
+ listbox disabledforeground and listbox state.
- * generic/tkCursor.c: Added initialization for nextPtr field of
- TkCursor, patch from Nijtmans/Howlett.
+ * doc/listbox.n: Added documentation for -state option.
- * canvas.test: added test for 5783.
- * generic/tkCanvPoly.c (DisplayPolygon): added checks for the
- polygon fillGC not being empty to prevent segfault. [Bug: 5783]
+ * generic/tkListbox.c: Added support for -state to listbox. [RFE:
+ 6052].
- * generic/tkImgGIF.c: Applied patch from Jan Nijtmans to fix a
- problem with the GIF writing code [Bug: 5823].
- * generic/tkImgGIF.c: Changed defines for GIF87a/GIF89a to be
- static char arrays with integer initialization, to address EBCIDIC
- vs. ASCII encoding issues and to handle compilers that don't deal
- with "\xAB" syntax for specifying hex values in strings.
+ * tests/listbox.test: Tests for listbox disabled state.
- * generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from
- [Bug: 5275], which corrected a segfault-causing indexing problem
- when deleting entries from torn-off menus.
+2000-07-27 Mo DeJong <mdejong@redhat.com>
- * generic/tkPlace.c (Tk_PlaceCmd): reworked place master/slave
- table init'n to prevent seg fault when using place on multiple
- displays.
+ * win/configure.in: TCL_STUB_LIB_FLAG and
+ TK_STUB_LIB_FLAG should not include ${TCL_DBGX}
+ in win/tkConfig.sh, fix that.
+
+2000-07-25 Joe English <jenglish@flightlab.com>
+ * doc: CanvPsY.3, ConfigWidg.3, CrtImgType.3, CrtItemType.3,
+ FontId.3, GetFont.3, canvas.n, font.n, options.n, text.n:
+ Documentation fix: Replaced references to XFontStruct *
+ and Tk_FontStruct with Tk_Font.
+
+2000-07-24 Eric Melski <ericm@ajubasolutions.com>
* tests/text.test: Added tests for -regexp -nocase searches with
backslash character classes.
- * tests/text.test: Added tests for searching when text is elided.
+
* generic/tkText.c (TextSearchCmd): Text search did not work
properly when -regexp and -nocase were used, in combination with
backslash character classes represented by capital letters (ie,
\W, \M); altered implementation of -regexp -nocase searches to use
new regexp interfaces to fix this problem. [Bug: 5988].
+
+2000-07-21 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/text.test: Added tests for searching when text is elided.
+
* generic/tkText.c (TextSearchCmd): Text search was not returning
the correct index when the search covered (but did not search)
elided characters; corrected this by adjusting the match index by
the number of elided characters preceeding the start of the match,
just as is done with embedded windows, etc. [Bug: 5470].
+
+2000-07-21 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure.in: Add TK_STUB_LIB_FLAG and
+ TK_BUILD_STUB_LIB_SPEC. These are needed to build a stub enabled
+ extension.
+
+2000-07-20 Eric Melski <ericm@ajubasolutions.com>
+
+ * unix/tkUnixDraw.c (TkScrollWindow): Replaced a use of a trinary
+ operator with an if/else, to avoid build problems on some
+ platforms [Bug: 5819].
+
+ * win/makefile.vc: Applied patch from Don Porter to enhance nmake
+ support on NT/Alpha [RFE: 5939].
+
+2000-07-19 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/text.tcl: Enhanced <Tab> binding to behave like normal
+ <Tab> bindings when the text widget is disabled (ie, it advances
+ focus to the next widget).
+
* generic/tkText.c (TextSearchCmd): Added a test for a NULL
segment pointer when doing backwards searches for "" on an empty
text widget. [Bug: 6007].
- * library/focus.tcl: fixed calling of takeFocus proc [Bug: 5372]
+2000-07-18 Mo DeJong <mdejong@redhat.com>
+
+ * unix/aclocal.m4: Use tcl.m4.
+
+ * unix/configure.in: Properly quote LOCALES variable. Properly quote
+ argument to m4 macro.
+
+ * unix/tcl.m4: Add updated file from tcl.
+
+ * win/tcl.m4: Updated file from tcl.
+
+2000-07-18 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/tkfbox.tcl: Fixed keyboard navigation in the iconlist.
+
+ * unix/configure.in (MAKE_LIB): Corrected definition of MAKE_LIB
+ for shared builds, with patch from Mike Hopkirk.
+
+2000-07-18 Mo DeJong <mdejong@redhat.com>
+
+ * win/Makefile.in: Fix TCL_GENERIC_DIR variable
+ so that it uses the TK_SRC_DIR in the same way
+ as the unix version.
+
+2000-07-17 David Gravereaux <davygrvy@ajubasolutions.com>
+
+ * generic/tkConsole.c: Added comments for a Win2K OS bug with
+ GetStdHandle(STD_OUTPUT_HANDLE). No change was done to the code
+ as the resulting behaviour of ShouldUseConsoleChannel() was
+ correct, anyways. [BUG: 5971]
+
+2000-07-17 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkStubImg.c (Tk_InitImageArgs): Applied patch from [Bug:
+ 5990], from Anselm Lingnau, which correctly sets the value of
+ useNewImage to 0 when the new image system is not to be used,
+ instead of leaving it at -1, which causes the check to be
+ performed more times than is really necessary.
+
+ * library/bgerror.tcl: Fixed a typo in one of the bgerror dialog
+ label.
+
+ * library/msgs/it.msg: Italian message catalog, from Paolo
+ Brutti. [RFE: 6012].
+
+2000-07-07 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/msgs/el.msg: Greek message catalog, from George Petasis.
+
+2000-07-07 Mo DeJong <mdejong@redhat.com>
+
+ * win/configure.in: Fix subst of TK_SHARED_BUILD
+ variable in tkConfig.sh.in. Fix definition of
+ TK_SRC_DIR variable so that it matches the
+ unix version.
+
+2000-07-05 Mo DeJong <mdejong@redhat.com>
+
+ * generic/tkFileFilter.c (AddClause): Cast to match function prototype.
+ * win/stubs.c (_XInitImageFuncPtrs): Add return value for function.
+ * win/tkWinButton.c (buttonStyles, ButtonBindProc, ComputeStyle):
+ Remove unused declarations.
+ * win/tkWinColor.c (GetColorByName, GetColorByValue): Remove unused
+ function declarations.
+ * win/tkWinDialog.c (TrySetDirectory): Remove unused function
+ declaration.
+ * win/tkWinEmbed.c (TkWinEmbeddedEventProc): Cast to match function
+ prototype.
+ * win/tkWinMenu.c (winMenuMutex, MenuExitProc): Remove unused
+ declaration.
+ * win/tkWinWindow.c (StackWindow): Remove unused declaration.
+ * win/tkWinWm.c (ConfigureEvent): Remove unused declaration.
+ * win/tkWinX.c (winXMutex): Remove unused declaration.
+ * xlib/ximage.c (XCreateBitmapFromData): Cast to match function
+ prototype.
+
+2000-07-05 Eric Melski <ericm@ajubasolutions.com>
+
+ * tests/imgPhoto.test: Added test for GIF writing code [Bug: 5823].
+
+ * generic/tkImgGIF.c: Applied patch from Jan Nijtmans to fix a
+ problem with the GIF writing code [Bug: 5823].
+
+ * generic/tkCursor.c: Added initialization for nextPtr field of
+ TkCursor, patch from Nijtmans/Howlett.
+
+2000-07-05 Eric Melski <ericm@ajubasolutions.com>
+
+ * library/msgs/nl.msg: Dutch message catalog for dialogs, from Jan
+ Nijtmans.
+
+2000-06-30 Eric Melski <ericm@scriptics.com>
+
+ * doc/keysyms.n:
+ * doc/colors.n: Added extra .CE/.CS pairs to break up the large
+ text block, so that the generated Windows help file could
+ accomodate the manual entry. [Bug: 5862]
+
+ * tests/filebox.test: Adjusted tests to accomodate -multiple.
+
+ * library/xmfbox.tcl: Adjusted arguments list construction such
+ that -multiple is not presented as an option for tk_getSaveFile.
+
+ * library/tk.tcl: Added test for safe interpreter status before
+ attempting to load message catalogs (which is impossible in a
+ standard safe interpreter). This means that SafeTk will not have
+ localized dialogs, unless a means is found for loading the message
+ catalog files.
+
+2000-06-29 Eric Melski <ericm@scriptics.com>
+
+ * library/msgs/de.msg: German message catalog.
+
+ * library/msgs/en.msg: English message catalog.
+
+ * library/msgs/es.msg: Spanish message catalog.
+
+ * library/msgs/fr.msg: French message catalog.
+
+ * unix/Makefile.in:
+ * unix/configure.in:
+ * library/tk.tcl:
+ * library/clrpick.tcl:
+ * library/choosedir.tcl:
+ * library/console.tcl:
+ * library/msgbox.tcl:
+ * library/tkfbox.tcl:
+ * library/xmfbox.tcl:
+ * library/bgerror.tcl: Applied patches from Laurent Duperval to
+ provide localization of Tk dialogs. [RFE: 2671].
+
+2000-06-27 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from
+ [Bug: 5275], which corrected a segfault-causing indexing problem
+ when deleting entries from torn-off menus.
+
+2000-06-22 Eric Melski <ericm@ajubasolutions.com>
+
+ * doc/getOpenFile.n: Updated with information about -multiple.
+
+ * library/choosedir.tcl: Tweaked to handle modified tkIconList API's.
+
+ * library/tkfbox.tcl: Preliminary implementation of multiple
+ selection; based on patch from [RFE: 604]. Some of the tkIconList
+ functions changed to support this and to make the dialog faster.
+
+ * library/xmfbox.tcl: Added support for multiple selection, from
+ patch in [RFE: 4999].
+
+2000-06-21 Eric Melski <ericm@scriptics.com>
+
+ * library/text.tcl: Corrected behavior of text widget with respect
+ to this sequence of events: click, shift-click. Previously, the
+ shift-click just moved the cursor and anchor; now, the shift-click
+ will select the text between the click and the shift-click, which
+ is the behavior most users expect. [Bug: 5929].
+
+2000-06-19 Eric Melski <ericm@scriptics.com>
+
+ * library/bgerror.tcl: Added auto-truncation for long error
+ messages (more than 30 characters wide, or more than 4 lines
+ long), so that the dialog remains a manageable size. [RFE: 5782]
+
+2000-06-15 Eric Melski <ericm@scriptics.com>
+
+ * win/tkWinDialog.c: Patched to support tk_getOpenFile
+ -multiple. [RFE: 604].
+
+2000-06-13 Eric Melski <ericm@scriptics.com>
+
+ * win/aclocal.m4:
+ * win/configure.in:
+ * win/Makefile.in: Applied patch from [RFE: 5844], to provide
+ support for the mingw compile environment for Windows.
+
+2000-06-06 Jeff Hobbs <hobbs@scriptics.com>
+
+ 8.4a1 RELEASE
+
+2000-06-03 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/CrtCmHdlr.3: new doc for ClientMessage handler procs
+ * generic/tk.h: added typdef for Tk_ClientMessageProc
+ * generic/tkStubInit.c:
+ * generic/tkDecls.h:
+ * generic/tk.decls: Added Tk_CreateClientMessageHandler and
+ Tk_DeleteClientMessageHandler declarations.
+ * generic/tkEvent.c (Tk_HandleEvent): Added
+ Tk_CreateClientMessageHandler and Tk_DeleteClientMessageHandler to
+ allow adding event handlers that invoke for ClientMessage events.
+ This is necessary to support unix dnd protocols.
+
+2000-06-02 Jeff Hobbs <hobbs@scriptics.com>
+
+ * canvas.test: added test for 5783.
+ * generic/tkCanvPoly.c (DisplayPolygon): added checks for the
+ polygon fillGC not being empty to prevent segfault. [Bug: 5783]
+
+2000-05-31 Eric Melski <ericm@scriptics.com>
+
+ * library/bgerror.tcl: Improved bgerror based on work by Donal
+ K. Fellows; no longer dependant on tk_dialog; features a
+ Windows-esque "Details" button, and a customizable extra function
+ button that allows the user to (for example) save the stack trace
+ to a file.
+
+2000-05-30 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkImgGIF.c: Changed defines for GIF87a/GIF89a to be
+ static char arrays with integer initialization, to address EBCIDIC
+ vs. ASCII encoding issues and to handle compilers that don't deal
+ with "\xAB" syntax for specifying hex values in strings.
+
+2000-05-28 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/spinbox.n: (new file) docs for spinbox widget
+ * generic/tkInt.h: added Tk_SpinboxObjCmd declaration
+ * generic/tkEntry.c: added 'spinbox' widget - an extension of the
+ entry widget type.
+ * generic/tkWindow.c: added 'spinbox' to core Tk commands
+ * library/spinbox.tcl: (new file) binding and helper procs for spinbox
+ * library/tk.tcl: added spinbox.tcl to list of files to source
+ * tests/entry.test: updated changed error messages
+ * tests/spinbox.test: (new file) test suite for spinbox
+
+ * generic/tkPlace.c (Tk_PlaceCmd): reworked place master/slave
+ table init'n to prevent seg fault when using place on multiple
+ displays.
+
+ * generic/tk.h: added comments ot Tk_FakeWin structure
+
+2000-05-26 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkOption.c (Tk_GetOption): Extended Tk_GetOption to
+ support a new syntax for option names in option tables. If the
+ option name has an embedded ".", it indicates that the name field
+ contains both an option name and an overriding widget class, in
+ the form "class.option". The lookup for the option value will be
+ performed as though the widget class is that specified, rather
+ than the actual widget class.
+ (SetupStacks): Replaced several lines of array element copying
+ with a for loop for conciseness.
+
+2000-05-25 Eric Melski <ericm@scriptics.com>
+
+ * library/button.tcl: Tweaks for -overrelief handling on Windows.
+
+ * doc/radiobutton.n: Added documentation for -overrelief option.
+
+ * doc/checkbutton.n: Added documentation for -overrelief option.
+
+ * doc/label.n: Added documentation for -state option.
+
+ * generic/tkButton.c: Added -overrelief option for checkbuttons,
+ and radiobuttons.
+
+ * library/button.tcl (tkButtonDown, macintosh version): Added
+ protection against querying the -repeatdelay option from a widget
+ that doesn't support it (ie, checkbuttons, radiobuttons, etc).
+ Other platforms use a different binding script for checkbuttons
+ and radiobuttons, so they don't have this issue.
+ (tkCheckRadioEnter, windows version): Added code to handle
+ -overrelief for check/radiobuttons on windows.
+
+2000-05-22 Eric Melski <ericm@scriptics.com>
+
+ * generic/tkButton.c: Added -activeforeground, -activebackground
+ for labels, for the -state option.
+
+ * doc/label.n: Added documentation for -state option,
+ -activeforeground, -activebackground.
+
+2000-05-22 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/Makefile.in (install-libraries): corrected to install X
+ headers [Bug: 5516]
+
+ * doc/bind.n:
+ * doc/canvas.n:
+ * doc/entry.n:
+ * doc/listbox.n:
+ * doc/photo.n: doc fix-ups [Bug: 5396]
+
+2000-05-17 Jeff Hobbs <hobbs@scriptics.com>
+
+ * doc/bell.n:
+ * tests/bell.test:
+ * generic/tkCmds.c (Tk_BellObjCmd): added -nice option to
+ optionally avoid resetting screen saver [Bug: 4279]
+
+2000-05-15 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinWm.c (Tk_WmCmd): changed wm deiconify from using idle
+ callback to calling restack and focus code immediately.
+
+2000-05-17 Eric Melski <ericm@scriptics.com>
+
+ Overall change: Added "-readonlybackground" option for entries,
+ to enable a visual change when state goes to readonly.
+
+ * mac/tkMacDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
+ DEF_ENTRY_READONLY_BG_COLOR):
+ * win/tkWinDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
+ DEF_ENTRY_READONLY_BG_COLOR):
+ * unix/tkUnixDefault.h (DEF_ENTRY_READONLY_BG_COLOR,
+ DEF_ENTRY_READONLY_BG_COLOR): Added default values for entry
+ -readonlybackground option.
+
+ * generic/tkEntry.c: Added -readonlybackground option, cleaned up
+ excessive use of graphics contexts.
+
+ * tests/entry.test: Added configuration test for
+ -readonlybackground option.
+
+ * doc/entry.n: Added documentation for -readonlybackground option.
+
+ Overall change: changed implementation of "link" relief for
+ buttons. Instead of a new relief style (-relief link), there is a
+ new option, -overrelief, which if set is used when the mouse is
+ over the button.
+
+ * doc/SetOptions.3: Added information about TK_OPTION_NULL_OK with
+ TK_OPTION_RELIEF.
+
+ * win/tkWinButton.c: Removed bits about TK_RELIEF_LINK.
+
+ * tests/button.test: Added tests for -overrelief; removed tests
+ for -relief link.
+
+ * mac/tkMacButton.c: Removed bits about TK_RELIEF_LINK.
+
+ * generic/tkOldConfig.c: Removed bits about TK_RELIEF_LINK.
+
+ * generic/tkConfig.c: Removed bits about TK_RELIEF_LINK; added
+ support for TK_OPTION_NULL_OK for TK_OPTION_RELIEF.
+
+ * library/button.tcl: Added binding support for -overrelief.
+
+ * generic/tk3d.c (Tk_GetRelief): Added branch for TK_RELIEF_NULL.
+
+ * generic/tkButton.c: Added -overrelief option; removed
+ Enter/Leave EventProc masks and handlers.
+
+ * generic/tk.h: Added TK_RELIEF_NULL definition, removed
+ TK_RELIEF_LINK.
+
+ * mac/tkMacDefault.h (DEF_BUTTON_OVER_RELIEF):
+ * win/tkWinDefault.h (DEF_BUTTON_OVER_RELIEF):
+ * unix/tkUnixDefault.h (DEF_BUTTON_OVER_RELIEF): Added default
+ value for the -overrelief option.
+
+2000-05-16 Eric Melski <ericm@scriptics.com>
- * win/tkWinMenu.c (ReconfigureWindowsMenu): Added MF_GRAYED bit
- for disabled menu entries, to ensure that those which are drawn by
- the system are shown grayed (such as entries on menubars) [Bug: 4372].
* win/tkWinMenu.c (ReconfigureWindowsMenu): Added code to add the
MF_SEPARATOR bit for SEPARATOR_ENTRY menu items. This causes
separator entries on the system menu to be drawn correctly [Bug: 5451].
+
+2000-05-15 Eric Melski <ericm@scriptics.com>
+
+ * doc/image.n: Added documentation for [image inuse] command.
+
+ * tests/image.test: Added tests for [image inuse] command.
+
+ * generic/tkImage.c (Tk_ImageObjCmd): Added [image inuse] command,
+ which provides a means for programmers to determine if a given
+ image is in use by any widgets. [RFE: 3327].
+
+2000-05-14 Eric Melski <ericm@scriptics.com>
+
+ * doc/clipboard.n: Added documentation for "clipboard get".
+
+ * generic/tkClipboard.c (Tk_ClipboardCmd): Added "clipboard get"
+ subcommand [RFE: 4628].
+
+ * tests/clipboard.test: Updated to use "clipboard get" instead of
+ "selection get -s CLIPBOARD".
+
+ * library/entry.tcl: Adjusted Button-1 binding to set focus to the
+ entry when it is readonly or normal.
+
+ * doc/entry.n: Added documentation for readonly state,
+ -disabledforeground, -disabledbackground.
+
+ * tests/entry.test: Added tests for readonly state.
+
+ * generic/tkEntry.c: Added support for "readonly" state, and
+ redefined "disabled" state. A disabled entry will display its
+ text in a dimmed color and possibly with a different background,
+ and will be completely unusable (no selection, no editing). A
+ readonly entry will look like a normal entry, but it will not be
+ editable; selection is still allowed. [RFE: 4239]. To support the
+ new disabled state properly, "-disabledforeground" and
+ "-disabledbackground" options were added.
+ *** THIS IS A BACKWARDS INCOMPATIBLE BEHAVIOR CHANGE ***
+
+ * win/tkWinDefault.h:
+ * mac/tkMacDefault.h:
+ * unix/tkUnixDefault.h: Added DEF_ENTRY_DISABLED_FG,
+ DEF_ENTRY_DISABLED_BG_COLOR, DEF_ENTRY_DISABLED_BG_MONO.
+
+2000-05-12 Eric Melski <ericm@scriptics.com>
+
+ * unix/tkUnixButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
+ * mac/tkMacButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
+ * win/tkWinButton.c (TkpDisplayButton, TkpComputeButtonGeometry):
+ Added code for drawing compound buttons.
+
+ * tests/button.test: Added configuration tests for -repeatdelay,
+ -repeatinterval, -compound.
+
+ * library/button.tcl: Added support for -repeatedelay,
+ -repeatinterval options.
+
+ * generic/tkOldConfig.c: Changed handling of link relief so that
+ proper error messages are used.
+
+ * generic/tkButton.h: Added -compound, -repeatdelay,
+ -repeatinterval options.
+
+ * generic/tkButton.c: Added event watchers for enter/leave events,
+ for link relief support.
+
+ * generic/tk3d.c: Changed handling of link relief so that proper
+ error messages are used.
+
+ * generic/tk.h: Changed values of
+ TK_OPTION_LINK_OK/TK_CONFIG_LINK_OK for link relief support.
+
+2000-05-12 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinFont.c (LoadFontRanges): improved support for all chars
+ in 0-255 range for bitmap ANSI fonts. May be improved to handle
+ bitmap non-ANSI fonts in the future. [Bug: 2172]
+
+ * win/tkWinWm.c (RaiseWinWhenIdle): added TK_DONT_DESTROY_WINDOW
+ to flag check to prevent timing related core dump. [Bug: 5438]
+
+2000-05-11 Jeff Hobbs <hobbs@scriptics.com>
+
+ * win/tkWinTest.c (TestclipboardObjCmd): ensured CloseClipboard
+ would always get called for each OpenClipboard.
+
+ * tests/focus.test (focusSetupAlt): removed wm withdraw from proc
+ as it would cause a hang for tkwait visibility
+
+ * tests/menu.test:
+ * generic/tk3d.c:
+ * generic/tkColor.c:
+ * generic/tkCursor.c: corrected handling of 3DBorder, Cursor and
+ Color objects on multiple screens. [Bug: 5454]
+
+2000-05-09 Eric Melski <ericm@scriptics.com>
+
+ * doc/button.n: Added documentation for link relief.
+
+ * tests/button.test: Added tests for link relief for buttons.
+
+ * generic/tk.h (TK_CONFIG_LINK_OK): Added definition of
+ TK_RELIEF_LINK, TK_OPTION_LINK_OK and TK_CONFIG_LINK_OK. [RFE: 4348]
+
+ * generic/tk3d.c: Added support for link relief. [RFE: 4348]
+
+ * mac/tkMacButton.c (TkpDisplayButton):
+ * unix/tkUnixButton.c (TkpDisplayButton): Added support for link
+ relief. [RFE: 4348]
+
+ * generic/tkOldConfig.c (Tk_ConfigureWidget):
+ * generic/tkConfig.c (DoObjConfig): Added understanding of link
+ relief, which is allowed only for widgets that have
+ TK_OPTION_LINK_OK or TK_CONFIG_LINK_OK set for the "-relief"
+ option. [RFE: 4348]
+
+ * generic/tkButton.c: Added TK_OPTION_LINK_OK to "-relief" option
+ for buttons. [RFE: 4348]
+
+ * win/tkWinWm.c (EX_TRANSIENT_STYLE): Removed WS_EX_TOOLWINDOW
+ style bit, so that transient windows have full-size titlebars
+ (like the tk_getOpenFile dialog).
+
* win/tkWinMenu.c (GetMenuSeparatorGeometry): Tweaked height
requested for separator bars to be (linespace - (2*descent))
instead of just (linespace); this makes the separator occupy a
more correct amount of vertical space. [Bug: 5303].
-2000-07-20 Brent Welch <welch@ajubasolutions.com>
+2000-05-09 Jeff Hobbs <hobbs@scriptics.com>
- * win/tkConfig.sh.in:
- Made corresponding changes to match gcc for windows mods
- to the rest of the files.
+ * library/focus.tcl: fixed calling of takeFocus proc [Bug: 5372]
-2000-07-28 Mo DeJong <mdejong@redhat.com>
+2000-05-02 Jeff Hobbs <hobbs@scriptics.com>
- * win/Makefile.in:
+ * README:
+ * generic/tk.h:
+ * library/tk.tcl:
+ * mac/README:
+ * unix/README:
+ * unix/configure.in:
+ * unix/tk.spec:
+ * win/README:
* win/aclocal.m4:
* win/configure.in:
- * win/tcl.m4: Back port of gcc for windows
- build system from 8.4.
+ * win/makefile.vc: updated patchlevel to 8.4a1
-2000-07-26 Jeff Hobbs <hobbs@scriptics.com>
+ * unix/Makefile.in: added tk.spec to dist target
- * unix/configure.in (TK_PATCH_LEVEL): updated to 8.3.2
- * unix/tk.spec:
- * win/configure.in:
- * generic/tk.h:
- * README:
+2000-04-27 Eric Melski <ericm@scriptics.com>
-2000-07-22 Brent Welch <welch@ajubasolutions.com>
- * win/Makefile.in, win/configure.in, win/rc/tk.rc, win/rc/tk_base.rc
- Trying to generalize .rc files so they work with both DLL's and
- static shell builds.
+ * doc/Tk_Init.3: Added Tk_SafeInit information [Bug: 1884].
-2000-07-10 Brent Welch <welch@ajubasolutions.com>
+ * doc/keysyms.n: Man page enumerating keysyms [RFE: 1645].
- * win/{Makefile.in,configure.in,tkConfig.sh.in}:
- Cleanup of defines in tkConfig.sh
+ * doc/colors.n: Man page enumerating valid color names [RFE: 1645].
-2000-05-15 Jeff Hobbs <hobbs@scriptics.com>
+ * doc/cursors.n: Man page enumerating valid cursor values [RFE: 1645].
- * win/tkWinWm.c: changed wm deiconify from using idle
- callback to calling restack and focus code immediately.
+ * library/msgbox.tcl: Corrected Unix tk_messageBox implementation
+ to make the first button the default when no default is specified
+ [Bug: 2218].
+
+ * doc/messageBox.n: Updated documentation with regards to
+ selection of default button when none is specified (now it will
+ use the first button as the default in that case) [Bug: 2218].
2000-04-26 Jeff Hobbs <hobbs@scriptics.com>
@@ -1931,7 +6579,7 @@
here to draw the text.
* mac/tkMacProjects.sea.hqx: Rearrange the projects so that the build
directory is separate from the sources. Much more convenient!
-
+
1999-08-10 Jeff Hobbs <hobbs@scriptics.com>
* win/tkWinWm.c: changed "wm deiconify" on Windows to raise and
@@ -2357,9 +7005,9 @@
1999-03-26 <suresh@scriptics.com>
* unix/configure.in:
- --nameble-shared is now the default and builds Tk as a shared
- library; specify --disable-shared to build a static Tk library
- and shell.
+ --nameble-shared is now the default and builds Tk as a shared
+ library; specify --disable-shared to build a static Tk library
+ and shell.
1999-03-26 <surles@scriptics.com>
@@ -2670,1036 +7318,69 @@
1998-12-08 <stanton@GASPODE>
- * tkMacMenu.c, tkUnixMenu.c, tkWinMenu.c, tkMenuDraw.c, tkMenu.h,
- * tkMenu.c: Backed out the previous fix for bug 620 and
- eliminated a bunch of code that created unnecessary objects.
- Changed back to using internal types instead of objects for many
- configuration options. There are many more fixes like this that
- could be made, but some require a little restructuring of the
- code. In any case the leaks are fixed and there is a lot less
- allocation happening. [Bug: 620]
-
-2000-03-21 Syd Polk <spolk@cygnus.com>
-
- * configure.in: Compare to cygwin, not cygwin32.
- * configure: Regenerate.
-
-1999-05-24 Syd Polk <spolk@cygnus.com>
-
- * generic/tkArgv.c: Updated version string.
-
-1999-04-22 Syd Polk <spolk@cygnus.com>
-
- * unix/Makefile.in: Don't install tk.h for install-libraries.
-
-1999-03-19 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * library/tkfbox.tcl (tkFDialog_OkCmd): Bug fix for double-click on
- a directory when multiple-mode is turned on, double-clicking a
- directory didn't switch to that directory.
-
-1999-03-19 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * win/tkWinDialog.c (GetFileName): set the multi flag to the boolean
- value it was given to turn multi-selection on/off.
-
- * library/tkfbox.tcl (tkFDialog): mask list of selected files using the
- list command only when the string isn't empty to avoid getting "{}"
- in the entry box.
-
-1999-03-19 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * library/tkfbox.tcl (tkFDialog): Corrected reference to not valid
- variable name.
-
- * win/tkWinDialog.c (GetFileName): set the multi flag to the boolean
- value it was given to turn multi-selection on/off.
-
-1999-03-18 Syd Polk <spolk@cygnus.com>
-
- * library/tkfbox.txl (tkFDialog): Fix a reference to an unknown
- variable $text.
-
-1999-03-18 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * win/tkWinDialog.c (GetFileName): When only one file is selected and
- multi selection is enabled, add the file using tcl_AppendElement to the
- result to get a list of files (here with only one file). This makes
- the functionality consistent to the case when multiple files are
- selected. This has produced a bug when only one file is selected that
- contains spaces.
-
- * library/tkfbox.tcl (tkFDialog): mask a file containing spaces using
- the list command when -multipl flag is set to yes.
- (tkFDialog_ListBrowse): likewise.
-
-1999-03-03 Syd Polk <spolk@cygnus.com>
-
- * generic/tkText.c (TextSearchCmd): Was incorrectly returning
- number of bytes instead of number of characters in search subcommand.
-
-1999-03-04 Syd Polk <spolk@cygnus.com>
-
- * win/tkWinMenu.c: Fixed compile error introduced by merge
- of 1999-03-02.
-
-1999-02-28 Ian Roxborough <irox@cygnus.com>
-
- * win/tkWin3d(Tk_3DHorizontalBevel,Tk_3DVerticalBevel):
- Draw sunken 3D effect the same as Window95/98/NT.
- * win/tkWinButton: Decrease this minimum button high
- for a better Windowz look and feel.
- * win/tkWinDefault.h: Increase default button y padding.
-
-1999-02-22 Syd Polk <spolk@cygnus.com>
-
- * win/configure.in: Fix TK_LIB_FULL_PATH for cygwin build.
- * win/configure: Regenerate.
-
-1999-02-18 Syd Polk <spolk@cygnus.com>
-
- * win/configure.in: Set TK_SRC_DIR and export it.
- Set TK_LIB_FULL_PATH and export it.
- * win/configure: Regenerate.
-
-1999-02-09 Syd Polk <spolk@cygnus.com>
-
- * unix/configure.in: Export TK_LIB_FULL_PATH so that dependency
- tracking can be done.
- Use TCL_LIB_FULL_PATH to track dependencies.
- * unix/configure: Regenerate.
- * unix/tkConfig.sh.in: Export TK_LIB_FULL_PATH so that dependecy
- tracking can be done.
- * unix/Makefile.in: Add dependency for TCL_LIB_FULL_PATH.
-
-1998-12-31 Syd Polk <spolk@cygnus.com>
-
- * generic/tkFont.c (Tk_UnderlineTextLayout):
- Don't draw an underline if underline value is
- -1.
-
-1998-12-30 Syd Polk <spolk@cygnus.com>
+ * win/tkWinClipboard.c (TkSelGetSelection, TkWinClipboardRender):
+ Changed to handle multibyte characters properly. [Bug: 935]
- * generic/tkFont.c (Tk_UnderlineTextLayout):
- Tk_CharBBox needs a byte offset, not a character
- offset.
+1998-12-07 <stanton@GASPODE>
-1998-12-17 Syd Polk <spolk@cygnus.com>
+ * library/xmfbox.tcl (tkMotifFDialog_Create): In the cached case,
+ the data array was not being initialized with the correct set of
+ widgets.
- * win/tkWinMenu.c: (TkWinMenuHandleEvent): WM_MENUCHAR
- needs to index characters, not bytes, when handling the
- underline character.
+1998-12-4 <welch@SAGE>
-1998-12-11 Syd Polk <spolk@cygnus.com>
+ * Changed patchLevel to 8.1b1
- * generic/tkMain.c (Tk_Main): All arguments except the filename
- on the command-line were not being translated to UTF.
+ * generic/tkMenu.c (ConfigureMenuCloneEntries): The -menu configuration
+ option was being incorrectly specified as just "menu".
-1998-12-10 Ian Roxborough <irox@cygnus.com>
+1998-11-30 <stanton@GASPODE>
- * win/tkWinDialog.c (GetFileName): Increased the buffer size in the
- file select dialog so that there is less change of it filling up
- if the user selects a lot of files.
+ * generic/tkButton.c (ConfigureButton): The error result was
+ getting lost when restoring configuration options. [Bug: 619]
-1998-12-04 Syd Polk <spolk@cygnus.com>
+1998-11-25 <stanton@GASPODE>
- * win/tkWinClipboard.c: The clipboard was not translating to
- and from the Windows character set.
+ * unix/tkUnixFont.c (GetFontAttributes): Initialize an unspecified
+ family to an empty string.
+ (FontMapLoadPage): if the font included characters below 32, the
+ index computation was incorrect because the range was shifted up
+ to 32.
+ (CreateClosestFont): check for empty locale as well as NULL.
-1998-12-03 Ian Roxborough <irox@cygnus.com>
+ * generic/tkFont.c (TkFontParseXLFD): initialize charset to
+ iso8859-1 if no charset is specified.
- * win/tkWinInit.c: Merged in changes from WishCon.
- * win/tkMain.c: Merged in changes from WishCon.
+ * mac/tkMacHLEvents.c (OdocHandler): added conversion from
+ external string to UTF [Bug: 869]
-1998-11-18 Syd Polk <spolk@cygnus.com>
- * generic/tkMenu.c (ConfigureMenuCloneEntries): The parameter for
- the configure command when reconfiguring entries for a clone menu
- should have been "-menu", not "menu".
-
-1998-11-19 Ben Elliston <bje@cygnus.com>
-
- * win/tkWinWm.c: Local grabs did not exclude menus or the caption
- bar. `wm frame' would crash if the window had not been mapped yet.
- Patch obtained from the Scriptics CVS repository.
-
- * win/tkWinWindow.c: Reduce message traffic by setting
- WS_EX_NOPARENTNOTIFY on TkChild windows. Patch obtained from the
- Scriptics CVS repository.
-
-1998-11-13 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * generic/tkMenu.c (MenuWidgetObjCmd): added patch for selection
- problem. Disabled menu entries remain disabled.
- (DestroyMenuEntry): added patch for memory leak.
-
-1998-11-11 Syd Polk <spolk@cygnus.com>
-
- * win/tkWinMenu.c: Merged from latest tcl8.1 source.
-
-1998-11-06 Ian Roxborough <irox@cygnus.com>
-
- * win/tkWinDialog.c (GetFileName): Add support for --multiple to
- tk_getOpenFile.
-
-1998-11-06 Syd Polk <spolk@cygnus.com>
-
- * win/tkWinMenu.c (GetEntryText): Fixed menubars and system
- menu character set problems.
- * win/tkWinWm.c: Fixed title bar text character set problems.
-
-1998-10-28 Syd Polk <spolk@cygnus.com>
-
- * win/Makefile.in: Remove prolog.ps from install
-
-1998-10-26 Syd Polk <spolk@cygnus.com>
-
- * win/Makefile.in: Change tcl directory.
- * win/configure.in: XINCLUDES needs be generated correctly.
- * win/configure: Regenerated.
-
-1998-10-23 Ben Elliston <bje@cygnus.com>
-
- * generic/tkFont.c (Tk_UnderlineChars): Count multibyte characters
- correctly when underlining. Contributed by Scott Stanton
- <stanton@scriptics.com>.
-
-1998-10-20 Syd Polk <spolk@cygnus.com>
-
- * unix/configure.in: Work with tcl8.1 directory name
- * unix/configure: Regenerated
+ * integrated tk8.0.4 changes.
-1998-10-04 Syd Polk <spolk@cygnus.com>
-
- * win/Makefile.in: Somehow this ended up on the main branch.
-
-1998-10-14 Syd Polk <spolk@cygnus.com>
-
- * win/Makefile.in configure.in: More work for tk 8.1 build.
- * win/configure: Regenerated
- * win/tkWinDialog.c: Added dummy -multiple option. irox will re-implement
- this soon.
-
-1998-09-29 Syd Polk <spolk@cygnus.com>
-
- * win/configure.in: Generate the correct version number
- * win/configure: Regenerated.
- * win/Makefile.in: Now compiles for Visual C++.
- * win/tkWinFont.c win/TkWinInt.h win/TkWinWm.c: Removed changing
- font map when system changes. 8.1 is eventually supposed to support
- this and the font package changed dramatically. The changes were
- not easy to bring forward, so we will have to do something if
- Tk 8.1 does not support this.
-
-1998-09-29 Syd Polk <spolk@cygnus.com>
-
- * win/configure.in: Merged from devo
- * win/configure: Regenerated.
-
-1998-09-28 Syd Polk <spolk@cygnus.com>
-
- * win/Makefile.in: Fixes for OBJEXT; removed hard-coded 80
- references; added new tk files for 8.1.
-
-Wed Aug 19 17:48:00 PDT 1998 Syd Polk <spolk@cygnus.com>
-
- * Continued 8.1 integration
-
-Mon Jul 6 18:13:02 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * win/Makefile.in: Remove bad line with just "mv" on it.
-
-Mon Jul 6 15:53:35 1998 Ian Roxborough <irox@cygnus.com>
- * win/Makefile.in: Don't set lflags or lcommon if you're not
- setting OBJEXT to 'obj', (i.e. for MSVC).
-
-Sat Jul 4 16:21:25 1998 Ian Roxborough <irox@cygnus.com>
- * win/Makefile.in: Don't make dumpext.exe unless you're using MSVC
- and setting OBJEXT = obj.
-
-1998-07-03 Ben Elliston <bje@cygnus.com>
-
- Patches from Ian Roxborough <irox@cygnus.com>.
- * win/configure.in: Add AC_OBJEXT macro invocation.
-
- * win/configure: Regenerate.
-
- * win/Makefile.in: Don't assume object files end in `.o'.
-
-Wed Jul 1 00:11:02 1998 Khamis Abuelkomboz <khamis@cygnus.com>
-
- * unix/tkUnixDefault.h (DEF_TEXT_TAB_SIZE): new macro to define
- the default tab size "8".
-
- * win/tkWinDefault.h (DEF_TEXT_TAB_SIZE): new macro to define the
- default tab size "8".
-
- * mac/tkMacDefault.h (DEF_TEXT_TAB_SIZE): new macro to define the
- default tab size "8".
-
- * generic/tkTextDisp.c (NextTabStop): Added the text widget pointer
- as an argument for this function to read the set tab-width for
- the default tabulator behavior. Default is 8.
-
- * generic/tkText.c: (configSpecs) Added "-tabsize" to the option
- command list of the text widget. It defines the width of the
- default tabulator, default 8.
-
- * generic/tkText.h: added a new structur member to TkText "tabsize",
- it stores the tab width (default 8). "-tabs" doesn't support
- normal text tabulator behaviar, so we can't use it in SN.
-
-Thu Jun 18 10:27:00 1998 Syd Polk <spolk@cygnus.com>
-
- * Removed all of the files in Tk 8.1a2 not in Tk 8.0p2. They
- were added when the import was done.
-
-Fri Jun 12 11:48:26 1998 Mumit Khan <khan@xraylith.wisc.edu>
-
- * configure.in (*-*-mingw32*): Support.
- * win/Makefile.in (DLL_LDLIBS, DLL_LDFLAGS): New variables.
- (tkcyg.def): Ignore errors.
- (plugin.def): Likewise.
- ($(TKDLL),$(TKPLUGINDLL)): Cleanup DLL build flags and use
- DLL_LDLIBS and DLL_LDFLAGS.
- * win/configure.in (DLL_LDLIBS, DLL_LDFLAGS): Define and substitute.
- (TK_PATCH_LEVEL): Bump to p2.
- * win/tkWinPort.h (TK_READ_DATA_PENDING): Define for Mingw32.
- (timezone,timeval,gettimeofday): Don't define/declare for Mingw32.
- * win/tkWinX.c (GetCurrentTime): Define as GetTickCount if
- __MINGW32__ as well.
- * win/configure: Rebuild.
-
-Fri May 29 17:12:29 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in (X11_INCLUDE_INSTALL_DIR): New variable.
- (install-libraries): Install X11 header files in
- X11_INCLUDE_INSTALL_DIR.
- (install-minimal): Don't create INCLUDE_INSTALL_DIR.
- * win/configure.in: Call AC_CANONICAL_HOST.
- * win/configure: Rebuild.
-
-Wed May 27 17:00:35 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * library/tkfbox.tcl (tkFDialog): Save the old multiple setting,
- and recreate the dialog if it changes.
-
-Thu Apr 30 18:10:15 1998 Geoffrey Noer <noer@cygnus.com>
-
- * win/Makefile.in: invoke gcc instead of ld when producing
- dlls. Pass the linker options down via args to -Wl options.
-
-Sun Apr 26 15:45:18 1998 Khamis Abuelkomboz <khamis@mxbig.multix.de>
-
- * generic/tkCanvBmap.c (tkCreateBitmap): renamed from "CreateBitmap"
- to avoid conflicts with the already defined MSVC procedure.
-
-Thu Apr 23 10:09:29 1998 Tom Tromey <tromey@cygnus.com>
-
- * library/tkfbox.tcl (tkFDialog_Config): Use lindex, not join, to
- extract list item.
- (tkFDialog_Config): Recognize -choosedir option.
- (tkFDialog_OkCmd): If -choosedir set, then don't special-case
- directories.
- (tkFDialog_VerifyFileName): Handle -choosedir.
- (tkFDialog_ListBrowse): Likewise.
-
-Thu Apr 16 17:30:46 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinButton.c (WinButton): Add pixFlags field.
- (TkpCreateButton): Initialize new pixFlags field.
- (TkpDestroyButton): Clear pixmap field if we free the pixmap.
- (TkpRealDisplayButton): Don't free the pixmap just because we're
- unmapping the window. Check pixFlags field to see if we can use
- the cached pixmap. Set pixFlag field if we cache the pixmap.
- * generic/tkButton.c (TkButtonWorldChanged): Remove Cygnus local
- patch; once again check whether the button is mapped before
- scheduling a call to TkpDisplayButton.
- (ButtonVarProc): Likewise.
-
-Thu Apr 16 15:59:55 MEST 1998 Khamis Abuelkomboz <khamis@multix.de>
- * library/tkfbox.tcl
- -One COMMENT: I have never seen so bad tcl/source code as how this
- stuped tk/filedialog is implemented!!!!!!!!!!!!!
-
- (tkIconList_Select): Include the fact that by multi-selection a file
- could contain blanks, so that the file is added as a list
- element.
- (tkFDialog): When the dialog is not new created (withdrawn) don't
- center it again
- -Define Tracer before calling the dialog and immediatly remove
- it after selection.
- -tk dialog box doesn't use dynamic array names, so it's
- not possible to use more than one dialog box at the same
- time. Other dialogs must be deleted!
- (tkFDialog_SetPath): Accept the fact that the variable could be bound
- on a already deleted widget (trace).
- -No tracer here.
- (tkFDialog_Config): "glob" command returns a list of items, so we must
- join the result, this was bugy when a file has contained blanks.
- (tkFDialog_ActivateEnt): We can't trim a list.
- (tkFDialog_OkCmd): Join file name only by single selection.
- (tkFDialog_ListInvoke): Differ between single and multi selection by
- joining files.
- -return a list of files by multi-selection and the file itself
- by single-selection.
-
-Tue Apr 14 15:01:10 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * generic/tkText.c (TextBlinkProc): Remove test of TkTextCharBbox,
- since it is a difference from standard releases, and it will never
- change what happens.
-
-Mon Apr 13 17:55:13 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * compat/memmove.c: Remove.
-
-Thu Apr 9 15:00:47 1998 Martin M. Hunt <hunt@cygnus.com>
-
- * library/msgbox.tcl (tkMessageBox): When a default button
- is supplied, simply set the focus on it, don't bind <Return>.
- For all buttons, bind <Return> for them so the button command
- is invoked.
-
-Tue Apr 7 20:32:40 1998 Ian Lance Taylor <ian@cygnus.com>
-
- * tests/msgbox.test: Update unknown option message for -modal
- option.
-
-Fri Mar 27 15:18:30 1998 Jeff Holcomb <jeffh@cygnus.com>
-
- * win/tkWinX.c: Added temporary define for MNC_CLOSE.
-
-Wed Mar 11 13:48:31 1998 Tom Tromey <tromey@cygnus.com>
-
- * library/entry.tcl: Only bind <Insert> when not on Windows.
-
-Sat Mar 21 21:18:06 1998 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
-
- Merged changes from Foundry (list follows in reverse chronological order)
-
- - Tom Tromey <tromey@cygnus.com>
- * win/tkWinWm.c (InitWm): Look for "tk" icon first in
- application's resources and then in Tk DLL's.
- * generic/tkButton.c (TkButtonWorldChanged): Don't check to see if
- button is unmapped before scheduling a redraw.
- * win/tkWinWm.c (Tk_WmCmd): In "frame" case, make window exist if
- it doesn't already.
- * generic/tkButton.c (ButtonVarProc): Don't check to see if button
- is unmapped before scheduling a redraw.
- * win/tkWinButton.c (TkpRealDisplayButton): Destroy backing pixmap
- if window is unmapped.
- * win/tkWinWm.c (EX_TRANSIENT_STYLE): Define as 0.
- * win/tkWinX.c (Tk_TranslateWinEvent): Handle WM_MENUCHAR.
- (GenerateXEvent): Likewise.
- * win/tkWinWm.c (UpdateWrapper): Turn off maximize box and sizebox
- for non-resizable windows.
- * win/tkWinDialog.c (Tk_MessageBoxCmd): Don't pass
- MB_SETFOREGROUND for "-modal system".
-
- - Ian Lance Taylor <ian@cygnus.com>
- * win/Makefile.in ($(TKDLL)): Don't generate relocs for debugging
- information.
- * win/tkWinFont.c (Tk_MeasureChars): Free the partials array.
- * win/tkWinFont.c (Tk_MeasureChars): Rearrange to always use sizes
- from partials array, rather than size.cx.
-
- - Tom Tromey <tromey@cygnus.com>
- * win/tkWinMenu.c (TkWinHandleMenuEvent): Don't use height element
- of indicatorDimensions when computing width.
- * win/tkWinDialog.c: Reverted previous change. It turns out that
- with the change, if the user selects too many files, the list will
- be truncated in the middle but no error message will be returned.
- This makes it impossible to detect failures.
- * win/tkWinDialog.c (ParseFileDlgArgs): If -multiple passed, don't
- require files to exist. This is a hack to work around a bug in
- the common dialog.
- (CYG_MAX_PATH): New define.
- (_OpenFileData): Use CYG_MAX_PATH.
- (GetFileName): Likewise.
- * generic/tkTextDisp.c (DisplayDLine): Display cursor for disabled
- widgets on Windows.
-
- - Ian Lance Taylor <ian@cygnus.com>
- * win/tkWinFont.c (WinFont): Remove widths field.
- (Tk_MeasureChars): Rewrite to use GetTextExtentExPoint, and not
- assume that Windows doesn't do kerning, since in reality it does
- do kerning.
- (AllocFont): Don't initialize widths field.
-
- - Tom Tromey <tromey@cygnus.com>
- * library/text.tcl (tkTextButton1): Unconditionally set the
- focus.
-
- - Ian Lance Taylor <ian@cygnus.com>
- * win/tkWinDialog.c (Tk_MessageBoxCmd): If -modal system, pass
- MB_SETFOREGROUND. May or may not be useless.
- * generic/tkFocus.c (SetFocus): If force, then don't just return
- even if the desired window is already the focus window.
- * win/tkWinPointer.c (TkpChangeFocus): Call XSetInputFocus even if
- force.
- * win/tkWinWm.c (EX_TRANSIENT_STYLE): Remove WS_EX_TOOLWINDOW.
-
-Mon Jan 12 15:45:03 1997 Syd Polk <spolk@cygnus.com>
-
- * library/tkfbox.tcl (tk_getOpenFile): tk_getOpenFile would complain
- and behave incorrectly if the -initialdir argument had a space
- in it.
-
-Wed Dec 31 12:27:25 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in (install-libraries): Install the X11 header
- files as well as tk.h.
-
-Tue Dec 23 16:31:07 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in ($(TKDLL)): Don't generate relocs for debugging
- information.
-
-Mon Nov 17 18:07:12 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinButton.c (TkpCreateButton): Initialize pixmap field.
- (TkpDestroyButton): Free pixmap field.
- (TkpDisplayButton): Entire function moved into
- TkpRealDisplayButton.
- (TkpRealDisplayButton): New static function, from old
- TkpDisplayButton.
- (TkpComputeButtonGeometry): Discard any saved pixmap.
- (ButtonProc): Call TkpRealDisplayButton, not TkpDisplayButton.
-
-Fri Nov 14 12:24:04 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinMenu.c (TkpDestroyMenu): Remove the menu handle from
- winMenuTable. Clear modalMenuPtr if we're destroying it.
- (TkWinHandleMenuEvent): Don't treat WM_SYSCOMMAND like
- WM_COMMAND.
-
- * win/tkWinDialog.c (Tk_MessageBoxCmd): If -modal task, and
- -parent not used, pass hWnd as NULL to MessageBox.
-
-Tue Nov 11 20:07:04 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinMenu.c (TkWinHandleMenuEvent): If TkPreprocessMenu
- returns an error, call Tcl_BackgroundError.
-
-Fri Nov 7 15:52:23 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinDialog.c (Tk_MessageBoxCmd): Accept -modal option.
- * library/msgbox.tcl (tkMessageBox): Accept and ignore -modal
- option.
-
-Tue Oct 28 17:51:06 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * generic/tkText.c: Patch text.txt from the net. Fixes
- Win95 selection bug.
-
- * library/dialog.tcl (tk_dialog): Two fixes from the net for
- Windows 95 dialogs. Patch "dialog.txt" from "Robert Embleton"
- <embleton@crystal.cirrus.com>
-
-Tue Oct 28 16:36:11 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (install-minimal): New target.
- * win/Makefile.in (install-minimal): New target.
-
-Thu Oct 23 12:59:18 1997 Tom Tromey <tromey@cygnus.com>
-
- * generic/tkScale.c (ConfigureScale): When setting scale value,
- don't cause scale to invoke command.
-
-Fri Oct 10 19:41:57 1997 Tom Tromey <tromey@cygnus.com>
-
- * xlib/X11/Xlib.h: On Windows, use a typdef for Status.
-
- * win/tkWinPort.h: Declare struct timeval.
-
-Wed Oct 8 18:33:41 1997 Jeffrey A Law (law@cygnus.com)
-
- * generic/tkText.c: Avoid ANSI-C code.
-
-Tue Oct 7 10:32:01 1997 Tom Tromey <tromey@cygnus.com>
-
- * library/button.tcl: Bind <Return> to invoke buttons on Windows.
-
-Thu Oct 2 17:05:14 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * generic/tkColor.c (struct TkGCList): Define.
- (Tk_GetColor): Initialize gcList element.
- (Tk_GetColorByValue): Likewise.
- (TkMapOverColors): New function.
- (TkRegisterColorGC, TkDeregisterColorGC): New functions.
- (TkColorChanged): New function.
- * generic/tkColor.h (TkGCList): Define typedef.
- (TkColor): Add gcList field.
- (TkMapOverColors, TkColorChanged): Declare.
- * generic/tkGC.c: Include tkInt.h.
- (TkGC): Add foreground and background fields.
- (ValueKey): Add foreground and background fields.
- (Tk_GetGCColor): Rename from Tk_GetGC. Add foreground and
- background parameters. Register the GC with the colors.
- (Tk_GetGC): New function which just calls Tk_GetGCColor.
- (Tk_FreeGC): Deregister colors.
- * generic/tk.h (Tk_GetGCColor): Declare.
- * generic/tkInt.h (TkRegisterColorGC): Declare.
- (TkDeregisterColorGC): Declare.
- * win/tkWinColor.c (ChangeColor): New static function.
- (TkWinSysColorChange): New function.
- * win/tkWinWm.c (WmProc): Handle WM_SYSCOLORCHANGE.
- * win/tkWinInt.h (TkWinSysColorChange): Declare.
- * generic/tk3d.c: Change some calls to Tk_GetGC to call
- Tk_GetGCColor instead.
- * generic/tkButton.c: Likewise.
- * generic/tkCanvArc.c: Likewise.
- * generic/tkCanvBmap.c: Likewise.
- * generic/tkCanvLine.c: Likewise.
- * generic/tkCanvPoly.c: Likewise.
- * generic/tkCanvText.c: Likewise.
- * generic/tkCanvas.c: Likewise.
- * generic/tkEntry.c: Likewise.
- * generic/tkImgBmap.c: Likewise.
- * generic/tkImgPhoto.c: Likewise.
- * generic/tkListbox.c: Likewise.
- * generic/tkMenuDraw.c: Likewise.
- * generic/tkMenuButton.c: Likewise.
- * generic/tkMessage.c: Likewise.
- * generic/tkRectOval.c: Likewise.
- * generic/tkScale.c: Likewise.
- * generic/tkTextDisp.c: Likewise.
-
-Tue Sep 30 17:13:16 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinPointer.c (TkWinCancelMouseTimer): New function.
- * win/tkWinWm.c (WmProc): Call it in WM_ENTERSIZEMOVE case.
-
-Mon Sep 15 16:29:16 PDT 1997 Khamis Abuelkomboz <khamis@cygnus.com>
- generic/tkText.[ch]
- Added a new functionality for the editor '-synccommand'. When it es
- not empty, this command is called, when ever the contents in the
- editor is changed (insert, delete). The function is called with the
- same parameters how it called for the editor.
- This functionality is used in the new GUI for SN to be able to open
- more than one editor with the same file (like emacs multiple buffers).
-
-Wed Sep 10 12:56:43 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * generic/tkImgPhoto.c (FreeColorTable): Add force parameter.
- Change all callers.
- (DisposeInstance): Force FreeColorTable to free the color table
- immediately, in case we are being called from TkDeleteAllImages
- when Tk is exiting.
-
- * win/tkWinMenu.c (TkWinHandleMenuEvent): If TkInvokeMenu returns
- an error, call Tcl_BackgroundError.
-
- * win/Makefile.in (install-libraries): Don't try to install *.gif
- or *.xbm.
-
-Mon Sep 8 17:13:49 MET DST 1997 Zsolt Koppany <zkoppany@multix.de>
- unix/tkUnixEvent.c
- Deleted the second unnecessary call of XOpenDisplay().
-
-Thu Sep 4 20:07:23 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinFont.c (nonClientMap): New static array.
- (TkpGetFontFromAttributes): If the font is in a magic windows-*
- family, use SystemParametersInfo to get the attributes.
- (TkWinNCMetricsChanged): New function.
- (FontChanged): New static function.
- * win/tkWinInt.h (TkWinNCMetricsChanged): Declare.
- * generic/tkFont.c (TkUpdateFonts): New function.
- * generic/tkFont.h (TkUpdateFonts): Declare.
- * win/tkWinWm.c (WmProc): Handle WM_SETTINGCHANGE with a wParam
- value of SPI_SETNONCLIENTMETRICS.
-
-Thu Sep 4 11:34:20 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * library/palette.tcl (tkRecolorTree): If color isn't
- set don't try to apply it.
-
- * library/menu.tcl: Apply patch "menu2.txt" from patches
- archive.
-
-Fri Aug 29 11:27:17 1997 Tom Tromey <tromey@cygnus.com>
-
- * library/menu.tcl (tk_popup): Use Tcl syntax for call to
- tk_menuSetFocus.
-
-Thu Aug 28 15:25:31 MET DST 1997 Zsolt Koppany <zkoppany@multix.de>
- * generic/tkImgGIF.c
- Memory bug fix.
-
-Thu Aug 28 13:36:30 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * testsuite/tk.tests/tk-test.exp: Permit capital letters in test
- case names. Try better error string handling.
-
- * generic/tkInitScript.h (initScript): Don't call pwd in a safe
- interpreter.
-
- * library/tkfbox.tcl (tkFDialog_VerifyFileName): Only add file to
- selectFile using lappend if -multiple.
- * tests/filebox.tcl: Set the expected unknown options based on the
- command and mode.
-
-Sun Aug 24 21:40:30 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in ($(TKDLL)): Set base address to 0x66300000.
-
-Mon Aug 18 18:13:00 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinDialog.c (GetFileName): Handle the case of a single
- file when OFN_ALLOWMULTISELECT is set.
-
-Fri Aug 15 19:26:39 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinInit.c (initScript): Don't append share to [info
- library] (revert patch of Aug 7).
-
-Thu Aug 14 09:29:45 1997 Tom Tromey <tromey@sanguine.cygnus.com>
-
- * library/dialog.tcl (tk_dialog): Run update after setting
- geometry. From the net.
-
-Wed Aug 13 12:28:08 1997 Tom Tromey <tromey@sanguine.cygnus.com>
-
- * library/tkfbox.tcl (tkFDialog_VerifyFileName): Use fname and not
- contents of entry to compute flat, path, and file.
-
-Tue Aug 12 18:02:15 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/rc/cygnus.ico: Change color to match other Cygnus designs.
-
-Tue Aug 12 17:37:36 MET DST 1997 Zsolt Koppany <zkoppany@multix.de>
-
- * unix/tkUnixWm.c
- Memory leak bug fixes.
-
- * generic/tkText.c
- TkTextRedrawRegion() should be called only if TkTextCharBbox()
- does not return -1, because in that case x,y and h variables
- will not be set.
-
-Mon Aug 11 16:58:08 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * configure.in: Call AC_CANONICAL_HOST. Check host, not target,
- for cygwin32.
- * configure: Rebuild.
-
- * win/rc/cygnus.ico: New file.
- * win/rc/tk.rc: Replace tk.ico with cygnus.ico.
-
-Mon Aug 11 11:14:31 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * generic/tk.h, generic/tkImage.c, generic/tkImgBmap.c,
- generic/tkImgGIF.c, generic/tkImgPhoto.c, generic/tkTest.c,
- generic/tkWindow.c, library/tkfbox.tcl, tests/imgPhoto.test,
- doc/photo.n: Two patches from Jan.Nijtmans@cmg.nl. Fixes
- numerous image problems including GIF transparency.
-
-Fri Aug 8 21:14:55 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinPointer.c (TkpChangeFocus): If force is set, call
- SetForegroundWindow.
-
-Thu Aug 7 12:55:50 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * generic/tkFrame.c (mapFrameWindow): New static variable.
- (mapFrameFrame): New static variable.
- (MapFrame): Set new variables.
- (TkInstallFrameMenu): Use new variables.
+ * generic/tkBind.c: fixed deletion order bug where a crash would
+ result if a binding deleted "."
- * win/tkWinInit.c (initScript): Look under share.
+ * generic/tkMenu.c (MenuWidgetObjCmd): disabled menu entries were
+ getting reenabled whenever the mouse passed over the entry [Bug: 860]
-Wed Aug 6 23:47:01 1997 Ian Lance Taylor <ian@cygnus.com>
+ * unix/tkUnixMenu.c (TkpComputeStandardMenuGeometry): hidemargin
+ option was not honored properly in menus [Bug: 859]
- * win/Makefile.in: Update for Tk 8.0.
- * win/configure.in: Likewise.
- * win/configure: Rebuild.
- * win/tkWinInt.h (TkFontAttributes): Don't use typedef if
- __GNUC__.
- * win/tkWinPort.h (strnicmp, stricmp): Define if __CYGWIN32__.
- (strncasecmp, strcasecmp): Don't define if __CYGWIN32__.
+1998-11-24 <stanton@GASPODE>
-Tue Aug 5 14:00:53 1997 Tom Tromey <tromey@cygnus.com>
-
- * tests/all: Preserved local changes.
- * tests/defs: Preserved local changes.
-
-Fri Jul 25 12:42:54 1997 Stephen Peters <speters@cygnus.com>
-
- * win/tkWinDialog.c (GetFileName, ParseFileDlgArgs): Changes to
- let tk_getOpenFile and tk_getSaveFile deal with multi-file
- selections on Windows.
- * doc/getOpenFile.n: Add documentation for `-multiple' option.
-
-Thu Jul 24 13:12:02 1997 Stephen Peters <speters@cygnus.com>
-
- * library/tkfbox.tcl: Changes to let tk_getOpenFile take a
- `-multiple yes' argument and handle multi-file selections.
-
-Tue Jul 22 12:40:50 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in (.c.o): Use CFLAGS.
-
-Sat Jul 12 11:28:22 MET DST 1997 Zsolt Koppany <zkoppany@multix.de>
-
- * generic/tkImgGIF.c
- Patch from tk8.b2 in GetCode().
- * generic/tkImgPhoto.c
- Purify UMR bug fix in AllocateColors().
-
-Wed Jul 9 14:43:57 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * generic/tkMain.c: Include winuser.h if _WIN32.
- (Tk_Main): If _WIN32, call MessageBox on error.
-
-Fri Jul 4 13:36:03 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinImage.c (PutPixel): Correct yet another bug.
-
-Thu Jul 3 16:00:57 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/tkWinImage.c (PutPixel): For a depth of 16 bits, convert a
- 24 bit truecolor value into a 16 bit truecolor value. Correct
- error in storing high byte. For a depth of 1 bit, correct error
- in clearing bit.
-
-Thu Jun 26 14:02:03 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in (WINDRES): New variable.
- (install-binaries): Don't install DLL here...
- (install-libraries): ...install it here instead.
- ($(TKDLL)): Depend upon and link with tkres.o.
- ($(WISH)): Depend upon and link with wishres.o.
- ($(TKTEST)): Likewise.
- (tkres.o, wishres.o): New targets.
- * win/tkWinX.c (TkWinGetTkModule): If __CYGWIN32__, use cygtkdll
- as the DLL name.
- * win/configure.in: Define and substitute WINDRES.
- * win/configure: Rebuild.
-
-Tue Jun 24 11:42:06 1997 Tom Tromey <tromey@cygnus.com>
-
- * library/palette.tcl (tkRecolorTree): Properly quote color name.
- From Jeffrey Hobbs.
-
-Mon Jun 23 10:15:56 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * Makefile.in (install-binaries, install-libraries): New targets.
-
-Wed Jun 18 12:21:57 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in: Copy install, install-binaries,
- install-libraries, and install-demos rules, and associated
- variables from unix/Makefile.in, with appropriate adjustments.
-
-Thu Jun 12 19:20:57 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/Makefile.in (tkcyg.def): Don't export impure_ptr.
-
-Tue Jun 10 19:16:39 1997 Stephen Peters <speters@cygnus.com>
-
- * unix/configure.in: Use a real replacement for memmove, instead
- of using memcpy (which doesn't guarantee overlaps will copy
- correctly).
- * unix/configure: Rebuilt.
- * unix/Makefile.in: Use replacement memmove if needed.
- * compat/memmove.c: New file for replacing memmove.
-
-Mon Jun 9 16:26:13 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/configure.in: Set TK_BUILD_INCLUDES.
- * win/configure: Rebuild.
-
-Fri Jun 6 23:43:34 1997 Ian Lance Taylor <ian@cygnus.com>
-
- Add support for building with cygwin32:
- * win/Makefile.in: Rewrite completely based on makefile.vc.
- * win/configure.in: Rewrite completely.
- * win/configure: Rebuild.
- * win/tkWin32Dll.c (_impure_ptr): Define if __CYGWIN32__.
- (__imp_reent_data): Declare if __CYGWIN32__.
- (DllMain): Initialize _impure_ptr if __CYGWIN32__.
- * win/tkWinX.c (GetCurrentTime): Define as GetTickCount if
- __CYGWIN32__.
-
-Thu May 22 15:49:40 1997 Ian Lance Taylor <ian@cygnus.com>
-
- * win/configure.in: Use win rather than CONFIGDIR.
- * win/configure: Rebuild.
-
-Fri May 9 19:07:17 1997 Zsolt Koppany <zkoppany@multix.de>
-
- * generic/tkWindow.c (GetScreen): Init metaModMask, altModMask
- (from Purify).
-
-Tue May 13 23:19:20 1997 Zsolt Koppany <zsolt@cygnus.com>
-
- * generic/tkText.c (ConfigureText): Bug fix from Ousterhout.
-
-Wed Apr 23 14:36:14 1997 Tom Tromey <tromey@cygnus.com>
-
- * library/tkfbox.tcl: Incorporated version from Tk 8.0.
-
-Tue Mar 25 23:35:02 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * library/palette.tcl: Patch from kcorey@eng.sun.com
- (Ken Corey)
-
-Tue Mar 18 16:01:05 1997 Martin M. Hunt <hunt@cygnus.com>
-
- * generic/tkImgGIF.c: Fix GIF transparency. Patch from
- nijtmans@nici.kun.nl
-
-Thu Mar 13 10:42:01 1997 Tom Tromey <tromey@cygnus.com>
-
- * win/configure.in: Don't run AC_C_CROSS.
- (AC_CONFIG_AUX_DIR): Look in srcdir.
-
-Fri Mar 7 13:08:47 1997 Tom Tromey <tromey@cygnus.com>
-
- * Updated to Tk 4.2p2.
-
-Thu Nov 21 10:07:02 1996 Tom Tromey <tromey@cygnus.com>
-
- * generic/tkGrid.c (Tk_GridCmd): Applied fix suggested by Stephen
- Uhler.
-
- * library/menu.tcl: Applied patch from Ousterhout.
-
-Mon Oct 14 12:17:11 1996 Tom Tromey <tromey@cygnus.com>
-
- * Makefile.in (RUNTEST): Use srcdir, not SRC_DIR.
- (tk-check): Ditto.
- (check): Renamed from tk-check.
-
- * testsuite/config/default.exp (find_x_display): New proc.
- (tk_start): Use find_x_display.
-
-Mon Aug 19 12:30:51 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * testsuite/config/default.exp, testsuite/tk.tests/tk-test.exp:
- New files.
-
- * Makefile.in (EXPECT, RUNTESTFLAGS, RUNTEST): New variables.
- (tk-check): New target.
-
- * tests/all: Look for tests in srcdir.
- * tests/defs: Set srcdir if not already set.
-
-Thu Aug 15 12:50:47 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * generic/tkArgv.c (defaultTable): Added -version.
- (Tk_ParseArgv): Handle -version option.
- * generic/tk.h (TK_ARGV_VERSION): New define.
-
-Mon Aug 5 10:47:09 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * Makefile.in (configure): Don't depend on configure.in.
- (config.status): Depend on configure.
-
-Wed Jun 26 12:51:43 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
-
- * configure.in (AC_PREREQ): autoconf 2.5 or higher.
- * configure: Rebuilt.
-
-Mon May 6 09:45:20 1996 Tom Tromey <tromey@lisa.cygnus.com>
-
- * generic/tkMain.c (Tk_Main): Exit after printing version number.
-
-Tue Apr 30 13:40:04 1996 Tom Tromey <tromey@snuffle.cygnus.com>
-
- * generic/tkMain.c (Tk_Main): Removed "-inet-1.0".
-
-Mon Apr 29 17:43:15 1996 Tom Tromey <tromey@snuffle.cygnus.com>
-
- * generic/tkMain.c (argTable): Added -version.
- (Tk_Main): Handle -version.
-
-Thu Mar 7 10:08:57 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * Makefile.in (config.status): Depend on nothing.
-
-Wed Mar 6 19:07:38 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * Makefile.in (Makefile): Removed redundant target.
-
-Thu Feb 29 21:32:44 1996 Fred Fish <fnf@cygnus.com>
-
- * Makefile.in (srcdir): Add macro.
- (configure): Run autoconf in source dir, not build dir.
-
-Thu Feb 29 14:59:03 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * Makefile.in (Makefile): New rule.
- (config.status): New rule.
-
-Wed Jan 24 09:42:29 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * Makefile.in: Replaced realclean with maintainer-clean.
-
-Fri Jan 12 11:00:06 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * library/tclIndex: Removed all references to console.tcl.
- (Hack).
-
- * library/console.tcl (tkConsoleInvoke): Use "interp eval" with
- history command, not nonexistent "interp record" command.
- (tkConsoleHistory, tkConsolePrompt): Include pathname argument to
- "interp eval".
-
-Wed Jan 10 12:49:00 1996 Tom Tromey <tromey@creche.cygnus.com>
-
- * configure.in, configure, Makefile.in, README.configure: New
- files.
-
- * Tk: Updated to Tk4.1a2. Entries after this line mostly likely
- apply to files in some subdirectory.
-
-Tue Dec 19 18:32:36 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (check, installcheck): New null rules.
-
-Wed Oct 25 20:12:01 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
-
- * Makefile.in (prefix, exec_prefix): Set to @prefix@ and
- @exec_prefix@, so configure can substitute them properly.
-
-Tue Oct 24 18:49:59 1995 Jason Molenda (crash@phydeaux.cygnus.com)
-
- * Makefile.in (X11_INCLUDES, X11_LIB_SWITCHES): switch to
- X11_CFLAGS, X11_LDFLAGS and X11_LIBS.
- (CC_SWITCHES): Use X11_CFLAGS.
-
- * configure.in: Statically link X libraries on Solaris, SunOS,
- and HPUX.
-
-Tue Oct 10 14:33:17 1995 Stu Grossman (grossman@cygnus.com)
-
- * tkConfig.c (Tk_ConfigureInfo), tkSelect.c (HandleTclCommand
- LostSelection): Use free() instead of TCL_DYNAMIC in
- interp->freeProc to prevent crashes. Apparantly tcl7.4 changed
- the result protocol around slightly.
-
-Sat Sep 30 09:39:11 1995 Jason Molenda (crash@phydeaux.cygnus.com)
-
- * configure.in: Upgraded to autoconf v2, removed cruft which did a poor
- job of finding X location in favor of AC_PATH_X.
- * configure: Regenerated.
-
-Sun Aug 20 00:15:51 1995 Jason Molenda (crash@phydeaux.cygnus.com)
+ * tkMacMenu.c, tkUnixMenu.c, tkWinMenu.c, tkMenuDraw.c, tkMenu.h,
+ * tkMenu.c: Backed out the previous fix for bug 620 and
+ eliminated a bunch of code that created unnecessary objects.
+ Changed back to using internal types instead of objects for many
+ configuration options. There are many more fixes like this that
+ could be made, but some require a little restructuring of the
+ code. In any case the leaks are fixed and there is a lot less
+ allocation happening. [Bug: 620]
- * tkMain.c: make tcl_RcFileName defn an extern so it doesn't
- conflict with the one in the new tcl/tclBasic.c.
+1998-11-19 <stanton@GASPODE>
-Mon Jun 12 17:09:28 1995 Stu Grossman (grossman@cygnus.com)
+ * tkMenu.c (DestroyMenuEntry): fixed memory leaks [Bug: 620]
- * configure: Ignore --cache-file option instead of bombing out.
-
-Mon Dec 12 12:17:16 1994 Stu Grossman (grossman@cygnus.com)
-
- * tkConfig.h: Don't use prototype for select. This allows HPUX
- 8.x build.
-
-Tue Oct 18 12:41:49 1994 Jim Wilson (wilson@chestnut.cygnus.com)
+ * tkWinX.c (GetTranslatedKey): fixed bad code merge
- * Makefile.in (CC_SWITCHES): Add X11_INCLUDE_FLAGS.
+ * tkWinWm.c, tkWinMenu.c: fixed titles and menus so they properly
+ display Unicode [Bug: 819]
diff --git a/tk/README b/tk/README
index 15233d6471c..45c0ea1d2d7 100644
--- a/tk/README
+++ b/tk/README
@@ -1,9 +1,9 @@
README: Tk
- This is the Tk 8.3.2 source distribution.
- You can get any release of Tcl from:
- http://dev.scriptics.com/registration/<version>.html
+ This is the Tk 8.4.0 source distribution.
Tcl/Tk is also available through NetCVS:
- http://dev.scriptics.com/software/tcltk/netcvs.html
+ http://tcl.sourceforge.net/
+ You can get any source release of Tcl from the file distributions
+ link at the above URL.
RCS: @(#) $Id$
@@ -14,18 +14,22 @@ This directory contains the sources and documentation for Tk, an X11
toolkit implemented with the Tcl scripting language.
For details on features, incompatibilities, and potential problems with
-this release, see the Tcl/Tk 8.3 Web page at
+this release, see the Tcl/Tk 8.4 Web page at
- http://dev.scriptics.com/software/tcltk/8.3.html
+ http://www.tcl.tk/software/tcltk/8.4.html
or refer to the "changes" file in this directory, which contains a
historical record of all changes to Tk.
-Tk is maintained, enhanced, and distributed freely as a
-service to the Tcl community by Scriptics Corporation.
-The official home for Tcl/Tk is on the Scriptics Web site:
+Tk is maintained, enhanced, and distributed freely by members of the
+Tcl community. The home for Tcl/Tk sources and bug database is on
+SourceForge at:
- http://dev.scriptics.com
+ http://tcl.sourceforge.net/
+
+with the Tcl Developer Xchange at:
+
+ http://www.tcl.tk/
Tk is a freely available open source package. You can do virtually
anything you like with it, such as modifying it, redistributing it,
@@ -39,5 +43,3 @@ Please see the README file that comes with the associated Tcl release
for more information. There are pointers there to extensive
documentation. In addition, there are additional README files
in the subdirectories of this distribution.
-
-
diff --git a/tk/changes b/tk/changes
index 21e10a07dcf..8d8da5bf953 100644
--- a/tk/changes
+++ b/tk/changes
@@ -4849,6 +4849,9 @@ then widget was destroyed (hobbs)
2000-03-02 (feature enhancement) added %V substitution to entry widget
validation to clarify type of validation occuring (hobbs)
+2000-03-07 (feature enhancement) added -disabledforeground/-state to labels
+(melski)
+
2000-03-29 (config enhancement) improved build support for gcc/mingw on
Windows (nijtmans, hobbs) and added RPM target (melski)
@@ -4900,6 +4903,49 @@ redraws (hobbs)
2000-04 more docs for public APIs (melski)
--- Released 8.3.1, April 26, 2000 --- See ChangeLog for details ---
+2000-04 (doc updates) extended, updated docs (melski)
+
+2000-05-09 (feature change) removed WS_EX_TOOLWINDOW style bit for
+transient windows on Windows platforms, so that transients have
+full-size titlebars (melski)
+
+2000-05-09 (bug fix) fixed calling of takeFocus proc (nemethi)
+
+2000-05-11 (bug fix) corrected handling of 3DBorder, Cursor and Color
+objects on multiple screens (hobbs)
+
+2000-05-12 (feature enhancement) improved support for chars in 0-255
+range for bitmap ANSI fonts (spjuth, hobbs)
+
+2000-05-12 (widget enhancement) added support for -repeatdelay,
+-repeatinterval for command buttons; and -compound (image and text
+simultaneously) for labels, check-, radio-, and command buttons (melski)
+
+2000-05-14 (widget change) added "readonly" state for entries and
+changed behavior of "disabled" entries; added -readonlybackground
+option for entries (melski)
+*** THIS IS A BACKWARDS INCOMPATIBLE BEHAVIOR CHANGE ***
+
+2000-05-15 (feature enhancement) added [image inuse] command (melski)
+
+2000-05-15 (feature enhancement) added -nice option to [bell] command (duncan)
+
+2000-05-17 (widget enhancement) added -overrelief option for
+check/radio/buttons (melski)
+
+2000-05-26 (feature change) added support for new syntax in
+Tk_OptionSpec tables; if the database name for an option contains an
+embedded "." it indicates that the name contains an overriding window
+class specifier in addition to the database name, which allows widgets
+to perform queries for certain options as if they were options for a
+different widget class (melski)
+
+2000-05-28 (new widget) added spinbox widget (hobbs)
+
+2000-05-31 (feature change) replaced bgerror dialog with a new and
+improved one (fellows, melski)
+
+--- Released 8.4a1, June 6, 2000 --- See ChangeLog for details ---
2000-05-15 (bug fix) changed wm deiconify from using idle callback to
calling restack and focus code immediately. (hobbs)
@@ -4926,3 +4972,343 @@ and corrected search combining -regexp and -nocase. (melski)
borders on multiple screens simultaneously. (hobbs, hipp)
--- Released 8.3.2, August 9, 2000 --- See ChangeLog for details ---
+
+2000-06-15 (new feature) [tk_getOpenFile ... -multiple] (melski)
+
+2000-06-29 (new feature) localization support in Tk dialogs (duperval,
+melski, et al)
+
+200-07-28 (new feature) -state option for listbox, better native color
+defaults (melski)
+
+2000-08 (feature rewrites) Tcl_Obj'ified clipboard, message, tkwait,
+bindtags, grab. place, selection commands (melski)
+
+2000-08-24 (new feature) More correct GNU configure support (no more
+--enable-gcc) (dejong)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2000-08-29 (bug fix) Corrected Windows menu indicator drawing (oberhumer)
+
+2000-09-01 (bug fix) Added tkPlatDecls.h to default install (melski)
+
+2000-09-17 (new feature) Added TK_OPTION_CUSTOM type, similar to
+TK_CONFIG_CUSTOM (melski)
+
+2000-09-29 (bug fix) Several fixes for multi-display uses of Tk (hipp, hobbs)
+
+2000-10-05 (new feature) Tk_CreateAnonymousWindow API to create anonymous
+Tk windows controllable from C (melski)
+
+2000-10-27 (new default behavior) [tk useinputmethods 1] is the default
+in tk.tcl, for users of XIM and "dead" keys (hobbs)
+
+2000-10-30 Improved support for static builds on Windows (gravereaux)
+
+ * Added support for mingw (gcc on Windows), AIX-5 and Win64 builds
+ (dejong, hobbs)
+
+ * Improved error checking in Windows native dialogs (melski, hobbs)
+
+--- Released 8.4a2, November 3, 2000 --- See ChangeLog for details ---
+
+2001-04-04 (build improvements) redid Mac build structure (steffen)
+Corrected IRIX-5* configure (english). Added support for AIX-5 (hobbs).
+Added support for Win64 (hobbs).
+
+2001-04-04 (doc fixes) numerous doc corrections and clarifications.
+Update of READMEs.
+
+2001-04-04 (bug fix) corrected reseting of service mode to only occur when
+it was set (hedin, hobbs)
+
+2001-04-02 (bug fix) Improved tests on Windows for correctness.
+Checked for menu deletion before calling associated menu entry command.
+Fixed listbox, canvas and entry destruction to be more aware of current
+widget activity. (hobbs)
+
+2001-03-30 (feature enhancement) added support for changing IME on the fly
+in Windows (2000) (lam)
+(bug fix) handled the error case where a valid-looking but invalid
+identifier could be passed in certain event generate options causing a
+crash (hobbs)
+
+2001-03-29 (bug fix) corrected handling of drag-selection (dejong)
+
+2001-01-02 (feature enhancement) added Windows icon support in wm
+iconbitmap (darley)
+
+2000-10-27 (feature enhancement) made [tk useinputmethods 1] the default
+for Tk (hobbs)
+
+2000-10-18 (bug fix) Corrected rendering of 1-pixel wide stippled lines on
+Windows. Correct use of active- and disabledwidth values for displaying
+lines. Enhanced error handling in Windows native dialogs (melski)
+
+2000-09-29 (bug fix) corrected BadMatch errors when using Tk on multiple
+screens (hipp)
+
+2000-08-18 (feature enhancement) Removed redundant call to DitherInstance
+(melski)
+
+--- Released 8.3.3, April 6, 2001 --- See ChangeLog for details ---
+
+2000-11-21 (new feature)[TIP 5] Tk_ClassProcs, Tk_SetClassProcs API (melski)
+
+2000-12-13 (performance enhancement)[403327] Tcl_Objs of type "double"
+are recognized in SetMMFromAny to speed up canvas coord calculations (hobbs)
+
+2001-01-02 (new feature)[TIP 8] [wn iconbitmap -default] on Windows (darley)
+
+2001-02-12 (new feature)[TIP #21] asymmetric padding in the pack and grid
+geometry managers (hipp)
+
+2001-05-21 (new feature)[TIP #11], -compound for [menubutton] widget (helfter)
+
+2001-06-03 (bug fix) corrected support for is10646 fonts on Unix, added a
+ucs-2be encoding (welch)
+
+2001-07-02 (bug fix) allowed tkwin to be Tcl_EventuallyFree'd in
+Tk_DestroyWindow so other widgets could register their use of it. Updated
+entry and listbox widgets to use this, correcting potential crashes. (hobbs)
+
+2001-08-01 (interface rewrite)[TIP 44] moved all private tk[A-Z]* commands and
+variables into the ::tk:: namespace (porter)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ * overhaul of configure scripts for cleaner standard support and support
+ of mingw gcc on Windows. (mdejong)
+
+ * improved tests to better handle results on variant systems (hobbs)
+
+ * correct several minor Purify complaints (hobbs)
+
+--- Released 8.4a3, August 6, 2000 --- See ChangeLog for details ---
+
+2001-08-06 (new feature) added GNU (HURD) build support. (brinkman)
+
+2001-08-23 (new feature) added QNX-6 build support. (loverso)
+
+2001-08-24 (bug fix) correct several possible free memory reads and array
+bounds read errors reported by purify. (hobbs)
+
+2001-08-27 (new feature) added call to Tcl_SetMainLoop which enables Tk to
+be loaded interactively into tclsh and have the event loop kick in
+correctly. (hobbs)
+
+2001-08-28 (bug fix) fixed tk_chooseDirectory crash on Win95. (baker)
+
+2001-08-28 (bug fix) removed 2 second 'raise' delay seen by some Unix
+window managers. (hobbs, baker)
+
+2001-09-14 (bug fix) fixed memory leaks that occured if errors were
+thrown while initializing the channel for an image. (darley)
+
+2001-09-20 (new feature) --enable-64bit support was added for HP 11 when
+using the native compiler.
+
+2001-10-03 (new feature) finalized Win64 support with latest RC1 release
+and SDK. (hobbs, stacy)
+
+2001-10-04 (new feature) added enhanced bgerror dialog from Hipp. (hobbs)
+
+2001-10-09 (new feature) added brace/quote matching and file/path/var
+expansion to the Win/Mac console. (hobbs)
+
+2001-10-17 (bug fix) fixed file filtering in the motif file dialog (nelson)
+
+2001-10-17 (bug fix) updated Mac build support. (steffen)
+
+--- Released 8.3.4, October 19, 2001 --- See ChangeLog for details ---
+
+2001-08-14 (bug fix)[450545] Tk's Tcl_ObjTypes now registered (fellows)
+
+2001-08-20 (performance enhancement) internal use of a "window" Tcl_ObjType
+(fellows)
+
+2001-08-20 (performance enhancement) Obj-ified [grid] and [pack] (spjuth)
+
+2001-09-26 (new feature)[TIP 18] add labels to frames, update geometry
+managers (spjuth)
+
+2001-09-30 (new feature)[TIP 37] [grid {row|column}configure -uniform] (spjuth)
+
+2001-10-12 (new feature)[TIP 63] [$menu add ... -compound] (helfter)
+
+2001-10-18 (build improvement) no more warnings about building with
+thread-enabled Tcl (hobbs)
+
+2001-11-10 (build improvement) new make target 'make gdb' (dejong)
+
+2001-11-12 (new feature)[TIP 26] simple undo/redo in text widget (callewaert)
+
+2001-11-12 (build improvement) revitalized makefile.vc (gravereaux)
+
+2001-11-17 (visual change) default button size on Windows changed to
+conform to Windows style (hobbs)
+ **** POTENTIAL VISUAL INCOMPATABILITY ****
+
+2001-12-03 (new feature)[TIP 74] [wm stackorder] (dejong, steffen)
+
+2001-12 (new feature) more use of Unicode in native widgets on Windows (hobbs)
+
+2001-12-18 (bug fix)[413735] event-click-drag-1.2 test failure (porter)
+
+2001-12-28 (new feature) On Windows, buttons accept negative widths, meaning
+minimum size, enabling native L&F (hobbs)
+
+2002-01 (bug fix) updates for CONST-ification in Tcl API, notably
+Tcl_ParseArgv. Use -DUSE_NON_CONST to suppress source incompatibility
+ **** POTENTIAL INCOMPATABILITY ****
+
+2002-01-31 (bug fix)[508988] logic error in menu cloning (helfter)
+
+2002-02-01 (new feature)[TIP 14] [$photo transparency] (fellows)
+
+2002-02-01 (bug fix)[511956] C99 spec: avoid 'bool' as a variable name (hobbs)
+
+2002-02-19 (bug fix) updates to image code calls of Tcl_Seek/Tcl_Tell to
+address TIP 72 changes (64-bit) in Tcl (fellows)
+
+2002-02-21 (new widget)[TIP 41] added [panedwindow] (hobbs)
+
+2002-02-22 (new feature) 64-bit support for xlc compiler on AIX-4 (hobbs)
+
+2002-02-25 (bug fix)[503772] blinking cursor fix in [text] (hobbs)
+
+2002-02-25 (bug fix)[503613] [listbox] handling of invalid listvar (hobbs)
+
+2002-02-25 (feature change)[493145] mirror B2 bindings to B3 on Windows (hobbs)
+
+ * (updated demos) many updates to show new features (fellows)
+
+--- Released 8.4a4, March 5, 2002 --- See ChangeLog for details ---
+
+2002-03-20 (feature change)[TIP 27][532644] Constness changes (porter)
+
+2002-03-21 (bug fix)[528441] Change in optimization flags for windows
+(gravereaux)
+
+2002-04-08 (bug fix) MSL stdin/out fixes prevent crash on exit (steffen)
+
+2002-04-12 (bug fix) Centralized closing of display, mem-leak fixes (hobbs)
+
+2002-04-22 (bug fix)[223739] More robust FP comparisons for odd
+architectures (fellows)
+
+2002-04-22 (bug fix)[541999] Fixed posible overun of 16-bit size limit
+of X windows in drawchars (hobbs,bonfield)
+
+2002-04-22 (bug fix)[541849] ButtonLeave implementation corrected (hobbs)
+
+2002-04-24 (new feature) TCLTK_NO_LIBRARY_TEXT_RESOURCES check added,
+allowing disable of inclusion of tk lib into resources (steffen)
+
+2002-05-07 (bug fix)[553208] Makefile/Win fix (TCLDIR, INSTALLDIR
+forward slash trouble resolved) (gravereaux)
+
+2002-05-20 (bug fix) msgcat added to resources, fixed setup of bindings
+on startup (steffen, porter)
+
+2002-05-21 (bug fix) Build system fix, SC_ENABLE_SHARED before
+SC_CONFIG_CFLAGS for usage for SHARED_BUILD (dejong)
+
+2002-05-26 (bug fix)[548765] Fixed -value "" redraw error for variable
+created by radiobutton (spjuth)
+
+2002-05-27 (feature change) [wm transient .t .t] now raises an error (dejong)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2002-06-10 (new feature)[566605] Utilities for -underline, ampersand magic
+(kovalenko)
+
+2002-06-12 (feature change) A transient toplevel now mirrors state changes
+in the master. (dejong)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2002-06-13 (bug fix) Fixed handling of cursor specs across platforms to
+be consistent. (fellows)
+
+2002-06-14 (new feature) [TIP 98] Enhanced photo compositing (fellows)
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2002-06-14 (bug fix) Removed references to matherr (kupries)
+
+2002-06-14 (new feature) [TIP 47] Reorganized Tk to allow usage in writing
+an X wm (english)
+
+2002-06-14 (new feature) [TIP 84] Full motion events upon request (hobbs)
+
+2002-06-17 (new feature) [TIP 82] -offrelief option for check/radiobutton
+(hipp)
+
+2002-06-17 (enhancement) Added msg catalog for UK English. (porter)
+
+2002-06-17 (new feature) [TIP 96] Added caret handling (hobbs)
+
+2002-06-19 (new feature) [TIP 48] Added style engine (bonnet)
+
+2002-06-19 (bug fix)[570902] Reorganized Tk shutdown to work around bugs in
+X (dejong)
+
+2002-06-20 (new feature) [TIP 94] Added -activestyle for [listbox] (hobbs)
+
+2002-06-21 (new feature) [TIP 104] generalized text undo/redo (callewart,
+hobbs)
+
+2002-06-22 (new feature) [TIP 95] Added [wm attributes] command (hobbs)
+
+2002-06-22 (new feature) [TIP 93] enhanced get/delete to accept accept
+multiple range pairs (hobbs)
+
+--- Released 8.4b1, July 5, 2002 --- See ChangeLog for details ---
+
+2002-07-11 (bug fix) some memory allocation failures now result in
+ error messages rather than panic (fellows)
+
+2002-07-15 (platform support) Borland makefile on Windows (gravereaux,giese)
+
+2002-07-16 (bug fix)[220800,581627] icon reading (darley)
+
+2002-07-19 (bug fix) Postscript generation on Win2K (hipp)
+
+2002-07-22 (bug fix)[570764,568278] transient windows (dejong)
+
+2002-07-24 (bug fix)[581560] canvas memory management (hobbs)
+
+2002-07-24 (bug fix)[584691] focus ring on compound button (hobbs)
+
+2002-07-25 (feature enhancement)[564521] Obj-ified [wm] (spjuth)
+
+2002-08-04 (new feature)[589853][TIP 27] Tk interfaces are now fully
+ CONST-ified. Use the symbols USE_NON_CONST or USE_COMPAT_CONST
+ to select interfaces with fewer changes.
+ *** POTENTIAL INCOMPATIBILITY ***
+
+2002-08-07 (bug fix)[578654] bezier curves on canvas (hobbs)
+
+2002-08-07 (platform support)[468139] native directory browser on Win (hobbs)
+
+2002-08-07 (bug fix)[467524] fixed -from handling for gifs (obermeier)
+
+2002-08-08 (bug fix)[592201] wm transient panic (english,dejong)
+
+Rewrote Tk test suite to use tcltest package.
+
+--- Released 8.4b2, August 9, 2002 --- See ChangeLog for details ---
+
+2002-08-20 (bug fix) tk.h checks for matching tcl.h version (porter)
+
+2002-08-27 (bug fix)[582457] toolbar button bindings (hipp)
+
+2002-08-31 (platform support)[602770] Mac OS X / Aqua port (steffen)
+
+2002-09-02 (bug fix)[565485] button height on windows (hobbs)
+
+2002-09-02 (new feature)[TIP 108] new comand [tk windowingsystem] (steffen)
+
+2002-09-02 (new feature)[TIP 107][601518] [raise] is non-blocking (english)
+
+2002-09-02 (platfrom support) 64-bit compile on HP-11 (martin)
+
+--- Released 8.4.0, September 10, 2002 --- See ChangeLog for details ---
diff --git a/tk/compat/limits.h b/tk/compat/limits.h
index cdeea13d40b..9487dac2200 100644
--- a/tk/compat/limits.h
+++ b/tk/compat/limits.h
@@ -22,4 +22,3 @@
#define INT_MAX 0x7fffffff
#define SHRT_MIN 0x8000
#define SHRT_MAX 0x7fff
-
diff --git a/tk/compat/stdlib.h b/tk/compat/stdlib.h
index 908d1fae288..45f39551de6 100644
--- a/tk/compat/stdlib.h
+++ b/tk/compat/stdlib.h
@@ -43,4 +43,3 @@ extern unsigned long strtoul _ANSI_ARGS_((CONST char *string,
char **endPtr, int base));
#endif /* _STDLIB */
-
diff --git a/tk/compat/unistd.h b/tk/compat/unistd.h
index 1eb01cae482..1a13f585e63 100644
--- a/tk/compat/unistd.h
+++ b/tk/compat/unistd.h
@@ -82,4 +82,3 @@ extern int vfork _ANSI_ARGS_((void));
#endif /* _UNISTD */
-
diff --git a/tk/doc/3DBorder.3 b/tk/doc/3DBorder.3
index 34482f08c08..e57dfef0cff 100644
--- a/tk/doc/3DBorder.3
+++ b/tk/doc/3DBorder.3
@@ -48,7 +48,7 @@ void
void
\fBTk_SetBackgroundFromBorder(\fItkwin, border\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOf3DBorder(\fIborder\fB)\fR
.sp
XColor *
@@ -303,4 +303,3 @@ or \fBTk_Get3DBorder\fR.
.SH KEYWORDS
3D, background, border, color, depressed, illumination, object, polygon, raised, shadow, three-dimensional effect
-
diff --git a/tk/doc/AddOption.3 b/tk/doc/AddOption.3
index 4aadf526a62..93a482e4380 100644
--- a/tk/doc/AddOption.3
+++ b/tk/doc/AddOption.3
@@ -19,9 +19,9 @@ void
.SH ARGUMENTS
.AP Tk_Window tkwin in
Token for window.
-.AP char *name in
+.AP "CONST char" *name in
Multi-element name of option.
-.AP char *value in
+.AP "CONST char" *value in
Value of option.
.AP int priority in
Overall priority level to use for option.
diff --git a/tk/doc/BindTable.3 b/tk/doc/BindTable.3
index bbfa74b41de..b5e78748e62 100644
--- a/tk/doc/BindTable.3
+++ b/tk/doc/BindTable.3
@@ -27,7 +27,7 @@ unsigned long
int
\fBTk_DeleteBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
.sp
-char *
+CONST char *
\fBTk_GetBinding(\fIinterp, bindingTable, object, eventString\fB)\fR
.sp
\fBTk_GetAllBindings(\fIinterp, bindingTable, object\fB)\fR
@@ -45,7 +45,7 @@ Token for binding table; must have been returned by some previous
call to \fBTk_CreateBindingTable\fR.
.AP ClientData object in
Identifies object with which binding is associated.
-.AP char *eventString in
+.AP "CONST char" *eventString in
String describing event sequence.
.AP char *script in
Tcl script to invoke when binding triggers.
@@ -155,4 +155,3 @@ described in the documentation for \fBbind\fR.
.SH KEYWORDS
binding, event, object, script
-
diff --git a/tk/doc/CanvPsY.3 b/tk/doc/CanvPsY.3
index 3901af5dcf5..fda70a767e8 100644
--- a/tk/doc/CanvPsY.3
+++ b/tk/doc/CanvPsY.3
@@ -7,7 +7,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH Tk_CanvasPsY 3 4.0 Tk "Tk Library Procedures"
+.TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures"
.BS
.SH NAME
Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases
@@ -25,14 +25,14 @@ int
\fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR)
.sp
int
-\fBTk_CanvasPsFont\fR(\fIinterp, canvas, fontStructPtr\fR)
+\fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR)
.sp
\fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR)
.sp
int
\fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR)
.SH ARGUMENTS
-.AS "unsigned int" *fontStructPtr
+.AS "unsigned int" "numPoints"
.AP Tk_Canvas canvas in
A token that identifies a canvas widget for which Postscript is
being generated.
@@ -53,7 +53,7 @@ Width of region of bitmap to output, in pixels.
Height of region of bitmap to output, in pixels.
.AP XColor *colorPtr in
Information about color value to set in Postscript.
-.AP XFontStruct *fontStructPtr in
+.AP Tk_Font tkFont in
Font for which Postscript is to be generated.
.AP double *coordPtr in
Pointer to an array of coordinates for one or more
@@ -97,7 +97,7 @@ TCL_OK unless an error occurs, in which case TCL_ERROR is returned and
\fIinterp->result\fR is overwritten with an error message.
.PP
\fBTk_CanvasPsFont\fR generates Postscript that sets the current font
-to match \fIfontStructPtr\fR as closely as possible.
+to match \fItkFont\fR as closely as possible.
\fBTk_CanvasPsFont\fR takes into account any font map specified
in the \fBpostscript\fR command, and it does
the best it can at mapping X fonts to Postscript fonts.
@@ -120,4 +120,3 @@ returned, unless an error occurs, in which case TCL_ERROR is returned and
.SH KEYWORDS
bitmap, canvas, color, font, path, Postscript, stipple
-
diff --git a/tk/doc/CanvTkwin.3 b/tk/doc/CanvTkwin.3
index a35a0a5fc7c..7a214228330 100644
--- a/tk/doc/CanvTkwin.3
+++ b/tk/doc/CanvTkwin.3
@@ -38,7 +38,7 @@ Tk_OptionPrintProc *\fBTk_CanvasTagsPrintProc\fR;
A token that identifies a canvas widget.
.AP Tcl_Interp *interp in/out
Interpreter to use for error reporting.
-.AP char *string in
+.AP "CONST char" *string in
Textual description of a canvas coordinate.
.AP double *doublePtr out
Points to place to store a converted coordinate.
@@ -159,4 +159,3 @@ static Tk_ConfigSpec configSpecs[] = {
.SH KEYWORDS
canvas, focus, item type, redisplay, selection, type manager
-
diff --git a/tk/doc/CanvTxtInfo.3 b/tk/doc/CanvTxtInfo.3
index 5eafcf565af..81d069a52dc 100644
--- a/tk/doc/CanvTxtInfo.3
+++ b/tk/doc/CanvTxtInfo.3
@@ -102,4 +102,3 @@ selection.
.SH KEYWORDS
canvas, focus, insertion cursor, selection, selection anchor, text
-
diff --git a/tk/doc/Clipboard.3 b/tk/doc/Clipboard.3
index 573bd90d96e..612c17ae0dc 100644
--- a/tk/doc/Clipboard.3
+++ b/tk/doc/Clipboard.3
@@ -78,4 +78,3 @@ any calling function should take care to be reentrant at the point
.SH KEYWORDS
append, clipboard, clear, format, type
-
diff --git a/tk/doc/ClrSelect.3 b/tk/doc/ClrSelect.3
index b40c4e56ddc..1de0c1887b0 100644
--- a/tk/doc/ClrSelect.3
+++ b/tk/doc/ClrSelect.3
@@ -40,4 +40,3 @@ procedure has no effect.
.SH KEYWORDS
clear, selection
-
diff --git a/tk/doc/ConfigWidg.3 b/tk/doc/ConfigWidg.3
index c558352eae1..dd4be4e1f21 100644
--- a/tk/doc/ConfigWidg.3
+++ b/tk/doc/ConfigWidg.3
@@ -40,7 +40,7 @@ Pointer to table specifying legal configuration options for this
widget.
.AP int argc in
Number of arguments in \fIargv\fR.
-.AP char **argv in
+.AP "CONST char" **argv in
Command-line options for configuring widget.
.AP char *widgRec in/out
Points to widget record structure. Fields in this structure get
@@ -55,7 +55,7 @@ selectively disable entries in \fIspecs\fR.
The name of the type of a widget record.
.AP "field name" field in
The name of a field in records of type \fItype\fR.
-.AP char *argvName in
+.AP "CONST char" *argvName in
The name used on Tcl command lines to refer to a particular option
(e.g. when creating a widget or invoking the \fBconfigure\fR widget
command). If non-NULL, then information is returned only for this
@@ -66,6 +66,12 @@ Display containing widget whose record is being freed; needed in
order to free up resources.
.BE
.SH DESCRIPTION
+.VS 8.1
+.PP
+Note: \fBTk_ConfigureWidget\fP should be replaced with the new
+\fBTcl_Obj\fP based API \fBTk_SetOptions\fP. The old interface is
+retained for backward compatibility.
+.VE
.PP
\fBTk_ConfigureWidget\fR is called to configure various aspects of a
widget, such as colors, fonts, border width, etc.
@@ -259,7 +265,7 @@ will never match any arguments.
\fBTK_CONFIG_FONT\fR
The value must be an ASCII string identifying a font in a form
suitable for passing to \fBTk_GetFont\fR. The value is converted
-to an (\fBXFontStruct *\fR) by calling \fBTk_GetFont\fR and the result
+to a \fBTk_Font\fR by calling \fBTk_GetFont\fR and the result
is stored in the target.
If TK_CONFIG_NULL_OK is specified in \fIspecFlags\fR then the value
may be an empty string, in which case the target will be set to NULL.
@@ -613,8 +619,10 @@ The library implementation of frames
implementation of buttons (tkButton.c) has a much more complex
table that uses many of the fancy \fIspecFlags\fR mechanisms.
+.SH "SEE ALSO"
+Tk_SetOptions(3)
+
.SH KEYWORDS
anchor, bitmap, boolean, border, cap style, color, configuration options,
cursor, custom, double, font, integer, join style, justify, millimeters,
pixels, relief, synonym, uid
-
diff --git a/tk/doc/ConfigWind.3 b/tk/doc/ConfigWind.3
index ae9c1da9480..fd1c2c6919e 100644
--- a/tk/doc/ConfigWind.3
+++ b/tk/doc/ConfigWind.3
@@ -151,4 +151,3 @@ Tk_MoveToplevelWindow, Tk_RestackWindow
.SH KEYWORDS
attributes, border, color, configure, height, pixel, pixmap, width, window, x, y
-
diff --git a/tk/doc/CoordToWin.3 b/tk/doc/CoordToWin.3
index 90467211417..9cfd2ee5dc9 100644
--- a/tk/doc/CoordToWin.3
+++ b/tk/doc/CoordToWin.3
@@ -49,4 +49,3 @@ both contain the point then the highest one in the stacking order
.SH KEYWORDS
containing, coordinates, root window
-
diff --git a/tk/doc/CrtCmHdlr.3 b/tk/doc/CrtCmHdlr.3
new file mode 100644
index 00000000000..10cae345e5b
--- /dev/null
+++ b/tk/doc/CrtCmHdlr.3
@@ -0,0 +1,69 @@
+'\"
+'\" Copyright (c) 2000 Ajuba Solutions.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" RCS: @(#) $Id$
+'\"
+.so man.macros
+.TH Tk_CreateClientMessageHandler 3 "8.4" Tk "Tk Library Procedures"
+.BS
+.SH NAME
+Tk_CreateClientMessageHandler, Tk_DeleteClientMessageHandler \- associate procedure callback with ClientMessage type X events
+.SH SYNOPSIS
+.nf
+\fB#include <tk.h>\fR
+.sp
+\fBTk_CreateClientMessageHandler\fR(\fIproc\fR)
+.sp
+\fBTk_DeleteClientMessageHandler\fR(\fIproc\fR)
+.SH ARGUMENTS
+.AP Tk_ClientMessageProc *proc in
+Procedure to invoke whenever a ClientMessage X event occurs on any display.
+.BE
+
+.SH DESCRIPTION
+.PP
+
+\fBTk_CreateClientMessageHandler\fR arranges for \fIproc\fR to be invoked
+in the future whenever a ClientMessage X event occurs that isn't handled by
+\fBWM_PROTOCOL\fR. \fBTk_CreateClientMessageHandler\fR is intended for use
+by applications which need to watch X ClientMessage events, such as drag and
+drop applications.
+.PP
+The callback to \fIproc\fR will be made by \fBTk_HandleEvent\fR;
+this mechanism only works in programs that dispatch events
+through \fBTk_HandleEvent\fR (or through other Tk procedures that
+call \fBTk_HandleEvent\fR, such as \fBTk_DoOneEvent\fR or
+\fBTk_MainLoop\fR).
+.PP
+\fIProc\fR should have arguments and result that match the
+type \fBTk_ClientMessageProc\fR:
+.CS
+typedef int Tk_ClientMessageProc(
+ Tk_Window \fItkwin\fR,
+ XEvent *\fIeventPtr\fR);
+.CE
+The \fItkwin\fR parameter to \fIproc\fR is the Tk window which is
+associated with this event. \fIEventPtr\fR is a pointer to the X event.
+.PP
+Whenever an X ClientMessage event is processed by \fBTk_HandleEvent\fR,
+the \fIproc\fR is called if it wasn't handled as a \fBWM_PROTOCOL\fR.
+The return value from \fIproc\fR is normally 0.
+A non-zero return value indicates that the event is not to be handled
+further; that is, \fIproc\fR has done all processing that is to be
+allowed for the event.
+.PP
+If there are multiple ClientMessage event handlers, each one is called
+for each event, in the order in which they were established.
+.PP
+\fBTk_DeleteClientMessageHandler\fR may be called to delete a
+previously-created ClientMessage event handler: it deletes each handler it
+finds that matches the \fIproc\fR argument. If no such handler exists,
+then \fBTk_DeleteClientMessageHandler\fR returns without doing anything.
+Although Tk supports it, it's probably a bad idea to have more than one
+callback with the same \fIproc\fR argument.
+
+.SH KEYWORDS
+bind, callback, event, handler
diff --git a/tk/doc/CrtErrHdlr.3 b/tk/doc/CrtErrHdlr.3
index 58fee382f90..77495830332 100644
--- a/tk/doc/CrtErrHdlr.3
+++ b/tk/doc/CrtErrHdlr.3
@@ -143,4 +143,3 @@ applications should use only \fBTk_CreateErrorHandler\fR.
.SH KEYWORDS
callback, error, event, handler
-
diff --git a/tk/doc/CrtGenHdlr.3 b/tk/doc/CrtGenHdlr.3
index 43aec19bec7..c4d6609bfae 100644
--- a/tk/doc/CrtGenHdlr.3
+++ b/tk/doc/CrtGenHdlr.3
@@ -82,4 +82,3 @@ For example, it is the caller's responsibility to invoke
\fBXSelectInput\fR to select the desired events, if that is necessary.
.SH KEYWORDS
bind, callback, event, handler
-
diff --git a/tk/doc/CrtImgType.3 b/tk/doc/CrtImgType.3
index ebbae05ef3e..e0f4d72da29 100644
--- a/tk/doc/CrtImgType.3
+++ b/tk/doc/CrtImgType.3
@@ -31,14 +31,14 @@ Must be static: a
pointer to this structure is retained by the image code.
.AP Tcl_Interp *interp in
Interpreter in which image was created.
-.AP char *name in
+.AP "CONST char" *name in
Name of existing image.
.AP Tk_ImageType **typePtrPtr out
Points to word in which to store a pointer to type information for
the given image, if it exists.
-.AP int argc
+.AP int argc in
Number of arguments
-.AP char ***argvPtr
+.AP char ***argvPtr in/out
Pointer to argument list
.VE
.BE
@@ -281,4 +281,3 @@ Tk_ImageChanged, Tk_GetImage, Tk_FreeImage, Tk_RedrawImage, Tk_SizeOfImage
.SH KEYWORDS
image manager, image type, instance, master
-
diff --git a/tk/doc/CrtItemType.3 b/tk/doc/CrtItemType.3
index 4d839cdd13b..d389c7bc8d0 100644
--- a/tk/doc/CrtItemType.3
+++ b/tk/doc/CrtItemType.3
@@ -531,7 +531,7 @@ It is only relevant for item types that support an insertion cursor;
that don't support an insertion cursor.
The procedure must match the following prototype:
.CS
-typedef void Tk_ItemIndexProc(
+typedef void Tk_ItemCursorProc(
Tk_Canvas \fIcanvas\fR,
Tk_Item *\fIitemPtr\fR,
int \fIindex\fR);
@@ -624,5 +624,3 @@ Tk_CanvasPsY, Tk_CanvasTextInfo, Tk_CanvasTkwin
.SH KEYWORDS
canvas, focus, item type, selection, type manager
-
-
diff --git a/tk/doc/CrtPhImgFmt.3 b/tk/doc/CrtPhImgFmt.3
index c150267c563..7ad3c87a070 100644
--- a/tk/doc/CrtPhImgFmt.3
+++ b/tk/doc/CrtPhImgFmt.3
@@ -19,7 +19,6 @@ Tk_CreatePhotoImageFormat \- define new file format for photo images
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
-\fB#include <tkPhoto.h>\fR
.sp
\fBTk_CreatePhotoImageFormat\fR(\fIformatPtr\fR)
.SH ARGUMENTS
@@ -244,4 +243,3 @@ Tk_FindPhoto, Tk_PhotoPutBlock
.SH KEYWORDS
photo image, image file
-
diff --git a/tk/doc/CrtSelHdlr.3 b/tk/doc/CrtSelHdlr.3
index e8ec7a111a6..91d4dfbfe89 100644
--- a/tk/doc/CrtSelHdlr.3
+++ b/tk/doc/CrtSelHdlr.3
@@ -118,4 +118,3 @@ If there is no such handler then it has no effect.
.SH KEYWORDS
format, handler, selection, target
-
diff --git a/tk/doc/CrtWindow.3 b/tk/doc/CrtWindow.3
index 4f477057618..2e7ff4d72b7 100644
--- a/tk/doc/CrtWindow.3
+++ b/tk/doc/CrtWindow.3
@@ -20,6 +20,9 @@ Tk_Window
\fBTk_CreateWindow\fR(\fIinterp, parent, name, topLevScreen\fR)
.sp
Tk_Window
+\fBTk_CreateAnonymousWindow\fR(\fIinterp, parent, topLevScreen\fR)
+.sp
+Tk_Window
\fBTk_CreateWindowFromPath\fR(\fIinterp, tkwin, pathName, topLevScreen\fR)
.sp
\fBTk_DestroyWindow\fR(\fItkwin\fR)
@@ -33,10 +36,10 @@ then \fI*interp\fR isn't modified.
.AP Tk_Window parent in
Token for the window that is to serve as the logical parent of
the new window.
-.AP char *name in
+.AP "CONST char" *name in
Name to use for this window. Must be unique among all children of
the same \fIparent\fR.
-.AP char *topLevScreen in
+.AP "CONST char" *topLevScreen in
Has same format as \fIscreenName\fR. If NULL, then new window is
created as an internal window. If non-NULL, new window is created as
a top-level window on screen \fItopLevScreen\fR. If \fItopLevScreen\fR
@@ -44,16 +47,16 @@ is an empty string (``'') then new
window is created as top-level window of \fIparent\fR's screen.
.AP Tk_Window tkwin in
Token for window.
-.AP char *pathName in
+.AP "CONST char" *pathName in
Name of new window, specified as path name within application
(e.g. \fB.a.b.c\fR).
.BE
.SH DESCRIPTION
.PP
-The procedures \fBTk_CreateWindow\fR
+The procedures \fBTk_CreateWindow\fR,
.VS
-and \fBTk_CreateWindowFromPath\fR
+\fBTk_CreateAnonymousWindow\fR, and \fBTk_CreateWindowFromPath\fR
are used to create new windows for
use in Tk-based applications. Each of the procedures returns a token
that can be used to manipulate the window in other calls to the Tk
@@ -86,6 +89,12 @@ menu's \fIparent\fR would be the button-like window used to invoke it,
which would in turn be a child of the menu bar window. A dialog box might
have the application's main window as its parent.
.PP
+\fBTk_CreateAnonymousWindow\fR differs from \fBTk_CreateWindow\fR in
+that it creates an unnamed window. This window will be manipulable
+only using C interfaces, and will not be visible to Tcl scripts. Both
+interior windows and top-level windows may be created with
+\fBTk_CreateAnonymousWindow\fR.
+.PP
\fBTk_CreateWindowFromPath\fR offers an alternate way of specifying
new windows. In \fBTk_CreateWindowFromPath\fR the new
window is specified with a token for any window in the target
@@ -140,4 +149,3 @@ the X commands to instantiate the window given by \fItkwin\fR.
.SH KEYWORDS
create, deferred creation, destroy, display, internal window,
screen, top-level window, window
-
diff --git a/tk/doc/DeleteImg.3 b/tk/doc/DeleteImg.3
index ddfd1f0a325..6cdbffd6aa6 100644
--- a/tk/doc/DeleteImg.3
+++ b/tk/doc/DeleteImg.3
@@ -20,7 +20,7 @@ Tk_DeleteImage \- Destroy an image.
.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
Interpreter for which the image was created.
-.AP char *name in
+.AP "CONST char" *name in
Name of the image.
.BE
@@ -33,4 +33,3 @@ exist then the procedure has no effect.
.SH KEYWORDS
delete image, image manager
-
diff --git a/tk/doc/DrawFocHlt.3 b/tk/doc/DrawFocHlt.3
index b3d810d1769..d659933b08c 100644
--- a/tk/doc/DrawFocHlt.3
+++ b/tk/doc/DrawFocHlt.3
@@ -38,5 +38,3 @@ It is typically invoked by widgets during redisplay.
.SH KEYWORDS
focus, traversal highlight
-
-
diff --git a/tk/doc/EventHndlr.3 b/tk/doc/EventHndlr.3
index a77d957f231..234daea0f03 100644
--- a/tk/doc/EventHndlr.3
+++ b/tk/doc/EventHndlr.3
@@ -77,4 +77,3 @@ order they were created.
.SH KEYWORDS
bind, callback, event, handler
-
diff --git a/tk/doc/FindPhoto.3 b/tk/doc/FindPhoto.3
index 1d6b5468aad..60a0fdb9705 100644
--- a/tk/doc/FindPhoto.3
+++ b/tk/doc/FindPhoto.3
@@ -27,11 +27,11 @@ Tk_PhotoHandle
.VE
.sp
void
-\fBTk_PhotoPutBlock\fR(\fIhandle, blockPtr, x, y, width, height\fR)
+\fBTk_PhotoPutBlock\fR(\fIhandle, blockPtr, x, y, width, height, compRule\fR)
.sp
void
\fBTk_PhotoPutZoomedBlock\fR(\fIhandle, blockPtr, x, y, width, height,\
-zoomX, zoomY, subsampleX, subsampleY\fR)
+zoomX, zoomY, subsampleX, subsampleY, compRule\fR)
.sp
int
\fBTk_PhotoGetImage\fR(\fIhandle, blockPtr\fR)
@@ -53,7 +53,7 @@ void
.VS
Interpreter in which image was created.
.VE
-.AP char *imageName in
+.AP "CONST char" *imageName in
Name of the photo image.
.AP Tk_PhotoHandle handle in
Opaque handle identifying the photo image to be affected.
@@ -69,6 +69,16 @@ to be placed within the image.
Specifies the width of the image area to be affected (for
\fBTk_PhotoPutBlock\fR) or the desired image width (for
\fBTk_PhotoExpand\fR and \fBTk_PhotoSetSize\fR).
+.VS 8.4
+.AP int compRule in
+Specifies the compositing rule used when combining transparent pixels
+in a block of data with a photo image. Must be one of
+TK_PHOTO_COMPOSITE_OVERLAY (which puts the block of data over the top
+of the existing photo image, with the previous contents showing
+through in the transparent bits) or TK_PHOTO_COMPOSITE_SET (which
+discards the existing photo image contents in the rectangle covered by
+the data block.)
+.VE 8.4
.AP int height in
Specifies the height of the image area to be affected (for
\fBTk_PhotoPutBlock\fR) or the desired image height (for
@@ -135,6 +145,17 @@ to the addresses of the bytes containing the red, green, blue and alpha
have other values, e.g., for images that are stored as separate red,
green and blue planes.
.PP
+.VS 8.4
+The \fIcompRule\fR parameter to \fBTk_PhotoPutBlock\fR specifies a
+compositing rule that says what to do with transparent pixels. The
+value TK_PHOTO_COMPOSITE_OVERLAY says that the previous contents of
+the photo image should show through, and the value
+TK_PHOTO_COMPOSITE_SET says that the previous contents of the photo
+image should be completely ignored, and the values from the block be
+copied directly across. The behavior in Tk8.3 and earlier was
+equivalent to having TK_PHOTO_COMPOSITE_OVERLAY as a compositing rule.
+.VE 8.4
+.PP
The value given for the \fIwidth\fR and \fIheight\fR parameters to
\fBTk_PhotoPutBlock\fR do not have to correspond to the values specified
in \fIblock\fR. If they are smaller, \fBTk_PhotoPutBlock\fR extracts a
@@ -193,6 +214,17 @@ calls to \fBTk_PhotoPutBlock\fR, \fBTk_PhotoPutZoomedBlock\fR or
\fBTk_PhotoGetSize\fR returns the dimensions of the image in
*\fIwidthPtr\fR and *\fIheightPtr\fR.
+.SH PORTABILITY
+.VS 8.4
+.PP
+In Tk 8.3 and earlier, \fBTk_PhotoPutBlock\fR and
+\fBTk_PhotoPutZoomedBlock\fR had different signatures. If you want to
+compile code that uses the old interface against 8.4 without updating
+your code, compile it with the flag
+-DUSE_COMPOSITELESS_PHOTO_PUT_BLOCK. Code linked using Stubs against
+older versions of Tk will continue to work.
+.VE 8.4
+
.SH CREDITS
.PP
The code for the photo image type was developed by Paul Mackerras,
@@ -200,4 +232,3 @@ based on his earlier photo widget code.
.SH KEYWORDS
photo, image
-
diff --git a/tk/doc/FontId.3 b/tk/doc/FontId.3
index fc7bd83795d..2c55153e4f0 100644
--- a/tk/doc/FontId.3
+++ b/tk/doc/FontId.3
@@ -10,7 +10,7 @@
.TH Tk_FontId 3 8.0 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_FontId, Tk_FontMetrics, Tk_PostscriptFontName \- accessor functions for
+Tk_FontId, Tk_GetFontMetrics, Tk_PostscriptFontName \- accessor functions for
fonts
.SH SYNOPSIS
.nf
@@ -68,7 +68,7 @@ following screen font families should print correctly:
Any other font families may not print correctly because the computed
Postscript font name may be incorrect or not exist on the printer.
.VS 8.0 br
-.SH DATA STRUCTURES
+.SH "DATA STRUCTURES"
The Tk_FontMetrics data structure is used by Tk_GetFontMetrics to return
information about a font and is defined as follows:
.CS
@@ -93,4 +93,3 @@ other line.
.VE
.SH KEYWORDS
font
-
diff --git a/tk/doc/FreeXId.3 b/tk/doc/FreeXId.3
index a9cb1fb8d36..3f8419c737b 100644
--- a/tk/doc/FreeXId.3
+++ b/tk/doc/FreeXId.3
@@ -50,4 +50,3 @@ to lose all of the available identifiers.
.SH KEYWORDS
resource identifier
-
diff --git a/tk/doc/GeomReq.3 b/tk/doc/GeomReq.3
index 6bdd459c600..71278f3ae81 100644
--- a/tk/doc/GeomReq.3
+++ b/tk/doc/GeomReq.3
@@ -9,17 +9,21 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH Tk_GeometryRequest 3 "" Tk "Tk Library Procedures"
+.TH Tk_GeometryRequest 3 "8.4" Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_GeometryRequest, Tk_SetInternalBorder \- specify desired geometry or internal border for a window
+Tk_GeometryRequest, Tk_SetMinimumRequestSize, Tk_SetInternalBorder, Tk_SetInternalBorderEx \- specify desired geometry or internal border for a window
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
\fBTk_GeometryRequest\fR(\fItkwin, reqWidth, reqHeight\fR)
.sp
+\fBTk_SetMinimumRequestSize\fR(\fItkwin, minWidth, minHeight\fR)
+.sp
\fBTk_SetInternalBorder\fR(\fItkwin, width\fR)
+.sp
+\fBTk_SetInternalBorderEx\fR(\fItkwin, left, right, top, bottom\fR)
.SH ARGUMENTS
.AS baseHeight clientData
.AP Tk_Window tkwin in
@@ -28,8 +32,20 @@ Window for which geometry is being requested.
Desired width for \fItkwin\fR, in pixel units.
.AP int reqHeight in
Desired height for \fItkwin\fR, in pixel units.
+.AP int minWidth in
+Desired minimum requested width for \fItkwin\fR, in pixel units.
+.AP int minHeight in
+Desired minimum requested height for \fItkwin\fR, in pixel units.
.AP int width in
Space to leave for internal border for \fItkwin\fR, in pixel units.
+.AP int left in
+Space to leave for left side of internal border for \fItkwin\fR, in pixel units.
+.AP int right in
+Space to leave for right side of internal border for \fItkwin\fR, in pixel units.
+.AP int top in
+Space to leave for top side of internal border for \fItkwin\fR, in pixel units.
+.AP int bottom in
+Space to leave for bottom side of internal border for \fItkwin\fR, in pixel units.
.BE
.SH DESCRIPTION
@@ -60,11 +76,22 @@ specifies the width of the border in pixels. Geometry managers will
use this information to avoid placing any children of \fItkwin\fR
overlapping the outermost \fIwidth\fR pixels of \fItkwin\fR's area.
.PP
-The information specified in calls to \fBTk_GeometryRequest\fR and
-\fBTk_SetInternalBorder\fR can be retrieved using the macros
-\fBTk_ReqWidth\fR, \fBTk_ReqHeight\fR, and \fBTk_InternalBorderWidth\fR.
+\fBTk_SetInternalBorderEx\fR works like \fBTk_SetInternalBorder\fR
+but lets you specify different widths for different sides of the window.
+.PP
+\fBTk_SetMinimumRequestSize\fR is called by widget code to indicate
+that a geometry manager should request at least this size for the
+widget. This allows a widget to have some control over its size when
+a propagating geometry manager is used inside it.
+.PP
+The information specified in calls to \fBTk_GeometryRequest\fR,
+\fBTk_SetMinimumRequestSize\fR, \fBTk_SetInternalBorder\fR and
+\fBTk_SetInternalBorderEx\fR can be retrieved using the macros
+\fBTk_ReqWidth\fR, \fBTk_ReqHeight\fR, \fBTk_MinReqWidth\fR,
+\fBTk_MinReqHeight\fR, \fBTk_MinReqWidth\fR, \fBTk_InternalBorderLeft\fR,
+\fBTk_InternalBorderRight\fR, \fBTk_InternalBorderTop\fR and
+\fBTk_InternalBorderBottom\fR.
See the \fBTk_WindowId\fR manual entry for details.
.SH KEYWORDS
geometry, request
-
diff --git a/tk/doc/GetAnchor.3 b/tk/doc/GetAnchor.3
index 3c1f7cb3e6b..a245349ba70 100644
--- a/tk/doc/GetAnchor.3
+++ b/tk/doc/GetAnchor.3
@@ -24,7 +24,7 @@ int
int
\fBTk_GetAnchor(\fIinterp, string, anchorPtr\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfAnchor(\fIanchor\fB)\fR
.SH ARGUMENTS
.AS "Tk_Anchor" *anchorPtr
@@ -35,7 +35,7 @@ Interpreter to use for error reporting, or NULL.
String value contains name of anchor point: \fBn\fR, \fBne\fR,
\fBe\fR, \fBse\fR, \fBs\fR, \fBsw\fR, \fBw\fR, \fBnw\fR, or \fBcenter\fR;
internal rep will be modified to cache corresponding Tk_Anchor.
-.AP char *string in
+.AP "CONST char" *string in
Same as \fIobjPtr\fR except description of anchor point is passed as
a string.
.VE
@@ -84,4 +84,3 @@ If \fIanchor\fR isn't a legal anchor value, then
.SH KEYWORDS
anchor position
-
diff --git a/tk/doc/GetBitmap.3 b/tk/doc/GetBitmap.3
index 4705b95b6f4..b0da2f26382 100644
--- a/tk/doc/GetBitmap.3
+++ b/tk/doc/GetBitmap.3
@@ -11,7 +11,7 @@
.TH Tk_AllocBitmapFromObj 3 8.1 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeBitmapFromObj, Tk_FreeBitmap, Tk_GetBitmapFromData \- maintain database of single-plane pixmaps
+Tk_AllocBitmapFromObj, Tk_GetBitmap, Tk_GetBitmapFromObj, Tk_DefineBitmap, Tk_NameOfBitmap, Tk_SizeOfBitmap, Tk_FreeBitmapFromObj, Tk_FreeBitmap \- maintain database of single-plane pixmaps
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
@@ -30,7 +30,7 @@ Pixmap
int
\fBTk_DefineBitmap(\fIinterp, name, source, width, height\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfBitmap(\fIdisplay, bitmap\fB)\fR
.sp
\fBTk_SizeOfBitmap(\fIdisplay, bitmap, widthPtr, heightPtr\fB)\fR
@@ -57,7 +57,7 @@ resulting Pixmap isn't cached.
.VE
.AP "CONST char" *name in
Name for new bitmap to be defined.
-.AP char *source in
+.AP "CONST char" *source in
Data for bitmap, in standard bitmap format.
Must be stored in static memory whose value will never change.
.AP "int" width in
@@ -316,4 +316,3 @@ a different file.
.SH KEYWORDS
bitmap, pixmap
-
diff --git a/tk/doc/GetCapStyl.3 b/tk/doc/GetCapStyl.3
index 0e847473d62..5a88045a824 100644
--- a/tk/doc/GetCapStyl.3
+++ b/tk/doc/GetCapStyl.3
@@ -19,13 +19,13 @@ Tk_GetCapStyle, Tk_NameOfCapStyle \- translate between strings and cap styles
int
\fBTk_GetCapStyle(\fIinterp, string, capPtr\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfCapStyle(\fIcap\fB)\fR
.SH ARGUMENTS
.AS "Tcl_Interp" *capPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP char *string in
+.AP "CONST char" *string in
String containing name of cap style: one of ```butt'', ``projecting'',
or ``round''.
.AP int *capPtr out
@@ -61,4 +61,3 @@ If \fIcap\fR isn't a legal cap style, then
.SH KEYWORDS
butt, cap style, projecting, round
-
diff --git a/tk/doc/GetClrmap.3 b/tk/doc/GetClrmap.3
index ce94295c3df..490ef780108 100644
--- a/tk/doc/GetClrmap.3
+++ b/tk/doc/GetClrmap.3
@@ -26,7 +26,7 @@ Colormap
Interpreter to use for error reporting.
.AP Tk_Window tkwin in
Token for window in which colormap will be used.
-.AP char *string in
+.AP "CONST char" *string in
Selects a colormap: either \fBnew\fR or the name of a window
with the same screen and visual as \fItkwin\fR.
.AP Display *display in
@@ -71,4 +71,3 @@ name as \fIstring\fR.
.SH KEYWORDS
colormap
-
diff --git a/tk/doc/GetColor.3 b/tk/doc/GetColor.3
index 178dafe3820..cd67e41ec00 100644
--- a/tk/doc/GetColor.3
+++ b/tk/doc/GetColor.3
@@ -30,7 +30,7 @@ XColor *
XColor *
\fBTk_GetColorByValue(\fItkwin, prefPtr\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfColor(\fIcolorPtr\fB)\fR
.sp
GC
@@ -188,4 +188,3 @@ or \fBTk_FreeColor\fR for each call to \fBTk_AllocColorFromObj\fR,
.VE
.SH KEYWORDS
color, intensity, object, pixel value
-
diff --git a/tk/doc/GetCursor.3 b/tk/doc/GetCursor.3
index a0a3bcb350c..ab1d103fa8e 100644
--- a/tk/doc/GetCursor.3
+++ b/tk/doc/GetCursor.3
@@ -30,7 +30,7 @@ Tk_Cursor
Tk_Cursor
\fBTk_GetCursorFromData(\fIinterp, tkwin, source, mask, width, height, xHot, yHot, fg, bg\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfCursor(\fIdisplay, cursor\fB)\fR
.sp
.VS 8.1
@@ -52,9 +52,9 @@ modified to cache pointer to corresponding Tk_Cursor.
Same as \fIobjPtr\fR except description of cursor is passed as a string and
resulting Tk_Cursor isn't cached.
.VE
-.AP char *source in
+.AP "CONST char" *source in
Data for cursor cursor, in standard cursor format.
-.AP char *mask in
+.AP "CONST char" *mask in
Data for mask cursor, in standard cursor format.
.AP "int" width in
Width of \fIsource\fR and \fImask\fR.
@@ -244,4 +244,3 @@ see if the actual data values have changed.
.SH KEYWORDS
cursor
-
diff --git a/tk/doc/GetDash.3 b/tk/doc/GetDash.3
index c7e0f8a43a3..c9cc357f19f 100644
--- a/tk/doc/GetDash.3
+++ b/tk/doc/GetDash.3
@@ -68,4 +68,3 @@ displayed identically as the first one.
.SH KEYWORDS
dash, conversion
-
diff --git a/tk/doc/GetFont.3 b/tk/doc/GetFont.3
index 1df9fc26ad5..259b8fa1f88 100644
--- a/tk/doc/GetFont.3
+++ b/tk/doc/GetFont.3
@@ -27,7 +27,7 @@ Tk_Font
\fBTk_GetFontFromObj(\fItkwin, objPtr\fB)\fR
.VE
.sp
-char *
+CONST char *
\fBTk_NameOfFont(\fItkfont\fB)\fR
.sp
.VS 8.1
@@ -62,7 +62,7 @@ Opaque font token.
.VS 8.1
\fBTk_AllocFontFromObj\fR finds the font indicated by \fIobjPtr\fR and
returns a token that represents the font. The return value can be used
-in subsequent calls to procedures such as \fBTk_FontMetrics\fR,
+in subsequent calls to procedures such as \fBTk_GetFontMetrics\fR,
\fBTk_MeasureChars\fR, and \fBTk_FreeFont\fR. The Tk_Font token
will remain valid until
\fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR is called to release it.
@@ -118,6 +118,8 @@ exactly one call to \fBTk_FreeFontFromObj\fR or \fBTk_FreeFont\fR
for each call to \fBTk_AllocFontFromObj\fR or \fBTk_GetFont\fR.
.VE
+.SH "SEE ALSO"
+Tk_FontId(3)
+
.SH KEYWORDS
font
-
diff --git a/tk/doc/GetGC.3 b/tk/doc/GetGC.3
index 4bc7f911a14..53e120663c7 100644
--- a/tk/doc/GetGC.3
+++ b/tk/doc/GetGC.3
@@ -72,4 +72,3 @@ will release it to the X server and delete it from the database.
.SH KEYWORDS
graphics context
-
diff --git a/tk/doc/GetHWND.3 b/tk/doc/GetHWND.3
index fb1684c0689..5ed1b22ca4a 100644
--- a/tk/doc/GetHWND.3
+++ b/tk/doc/GetHWND.3
@@ -12,7 +12,7 @@
Tk_GetHWND \- retrieve the Windows handle for an X window
.SH SYNOPSIS
.nf
-\fB#include <tk.h>\fR
+\fB#include <tkPlatDecls.h>\fR
.sp
HWND
\fBTk_GetHWND\fR(\fIwindow\fR)
diff --git a/tk/doc/GetImage.3 b/tk/doc/GetImage.3
index de795c49ea0..da3f751d2fc 100644
--- a/tk/doc/GetImage.3
+++ b/tk/doc/GetImage.3
@@ -30,7 +30,7 @@ Tk_Image
Place to leave error message.
.AP Tk_Window tkwin in
Window in which image will be used.
-.AP char *name in
+.AP "CONST char" *name in
Name of image.
.AP Tk_ImageChangedProc *changeProc in
Procedure for Tk to invoke whenever image content or size changes.
@@ -133,4 +133,3 @@ Tk_CreateImageType
.SH KEYWORDS
images, redisplay
-
diff --git a/tk/doc/GetJoinStl.3 b/tk/doc/GetJoinStl.3
index 6cd457ad006..44f6777cd5c 100644
--- a/tk/doc/GetJoinStl.3
+++ b/tk/doc/GetJoinStl.3
@@ -19,13 +19,13 @@ Tk_GetJoinStyle, Tk_NameOfJoinStyle \- translate between strings and join styles
int
\fBTk_GetJoinStyle(\fIinterp, string, joinPtr\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfJoinStyle(\fIjoin\fB)\fR
.SH ARGUMENTS
.AS "Tcl_Interp" *joinPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
-.AP char *string in
+.AP "CONST char" *string in
String containing name of join style: one of ``bevel'', ``miter'',
or ``round''.
.AP int *joinPtr out
@@ -60,4 +60,3 @@ If \fIjoin\fR isn't a legal join style, then
.SH KEYWORDS
bevel, join style, miter, round
-
diff --git a/tk/doc/GetJustify.3 b/tk/doc/GetJustify.3
index b6416ff9f65..3604c3e028a 100644
--- a/tk/doc/GetJustify.3
+++ b/tk/doc/GetJustify.3
@@ -23,7 +23,7 @@ int
int
\fBTk_GetJustify(\fIinterp, string, justifyPtr\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfJustify(\fIjustify\fB)\fR
.SH ARGUMENTS
.AS "Tk_Justify" *justifyPtr
@@ -34,7 +34,7 @@ Interpreter to use for error reporting, or NULL.
String value contains name of justification style (\fBleft\fR, \fBright\fR, or
\fBcenter\fR). The
internal rep will be modified to cache corresponding justify value.
-.AP char *string in
+.AP "CONST char" *string in
Same as \fIobjPtr\fR except description of justification style is passed as
a string.
.VE
@@ -91,4 +91,3 @@ If \fIjustify\fR isn't a legal justify value, then
.SH KEYWORDS
center, fill, justification, string
-
diff --git a/tk/doc/GetOption.3 b/tk/doc/GetOption.3
index 5d848c8630b..775d59215c9 100644
--- a/tk/doc/GetOption.3
+++ b/tk/doc/GetOption.3
@@ -22,9 +22,9 @@ Tk_Uid
.AS Tk_Window *class
.AP Tk_Window tkwin in
Token for window.
-.AP char *name in
+.AP "CONST char" *name in
Name of desired option.
-.AP char *class in
+.AP "CONST char" *class in
Class of desired option. Null means there is no class for
this option; do lookup based on name only.
.BE
@@ -44,4 +44,3 @@ quickly than successive calls for different windows.
.SH KEYWORDS
class, name, option, retrieve
-
diff --git a/tk/doc/GetPixels.3 b/tk/doc/GetPixels.3
index bb32539f8e4..6ec9f57ac76 100644
--- a/tk/doc/GetPixels.3
+++ b/tk/doc/GetPixels.3
@@ -42,7 +42,7 @@ units and pixels.
.AP Tcl_Obj *objPtr in/out
String value specifies a distance on the screen;
internal rep will be modified to cache converted distance.
-.AP char *string in
+.AP "CONST char" *string in
Same as \fIobjPtr\fR except specification of distance is passed as
a string.
.VE
@@ -109,4 +109,3 @@ store a double-precision floating-point result at \fI*doublePtr\fR.
.SH KEYWORDS
centimeters, convert, inches, millimeters, pixels, points, screen units
-
diff --git a/tk/doc/GetPixmap.3 b/tk/doc/GetPixmap.3
index c96624f0276..777ba33e482 100644
--- a/tk/doc/GetPixmap.3
+++ b/tk/doc/GetPixmap.3
@@ -54,4 +54,3 @@ its resource identifier available for reuse.
.SH KEYWORDS
pixmap, resource identifier
-
diff --git a/tk/doc/GetRelief.3 b/tk/doc/GetRelief.3
index 4d80fe6fc66..28532e6fe4c 100644
--- a/tk/doc/GetRelief.3
+++ b/tk/doc/GetRelief.3
@@ -24,7 +24,7 @@ int
int
\fBTk_GetRelief(\fIinterp, name, reliefPtr\fB)\fR
.sp
-char *
+CONST char *
\fBTk_NameOfRelief(\fIrelief\fB)\fR
.SH ARGUMENTS
.AS "Tcl_Interp" *reliefPtr
@@ -42,6 +42,8 @@ a string.
.AP int *reliefPtr out
Pointer to location in which to store relief value corresponding to
\fIobjPtr\fR or \fIname\fR.
+.AP "CONST char" *name
+Name of the relief.
.AP int relief in
Relief value (one of TK_RELIEF_FLAT, TK_RELIEF_RAISED, TK_RELIEF_SUNKEN,
TK_RELIEF_GROOVE, TK_RELIEF_SOLID, or TK_RELIEF_RIDGE).
@@ -79,4 +81,3 @@ is returned.
.SH KEYWORDS
name, relief, string
-
diff --git a/tk/doc/GetRootCrd.3 b/tk/doc/GetRootCrd.3
index 283433a0dae..9726a382b54 100644
--- a/tk/doc/GetRootCrd.3
+++ b/tk/doc/GetRootCrd.3
@@ -41,4 +41,3 @@ communicate with the X server.
.SH KEYWORDS
coordinates, root window
-
diff --git a/tk/doc/GetScroll.3 b/tk/doc/GetScroll.3
index 576f1905d52..985d2c1bab8 100644
--- a/tk/doc/GetScroll.3
+++ b/tk/doc/GetScroll.3
@@ -27,7 +27,7 @@ int
Interpreter to use for error reporting.
.AP int argc in
Number of strings in \fIargv\fR array.
-.AP char *argv[] in
+.AP "CONST char" *argv[] in
Argument strings. These represent the entire widget command, of
which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR.
@@ -76,5 +76,3 @@ development.
.SH KEYWORDS
parse, scrollbar, scrolling command, xview, yview
-
-
diff --git a/tk/doc/GetSelect.3 b/tk/doc/GetSelect.3
index d4a0ce0d646..92c03eb6f19 100644
--- a/tk/doc/GetSelect.3
+++ b/tk/doc/GetSelect.3
@@ -77,4 +77,3 @@ and return TCL_ERROR; this will abort the selection retrieval.
.SH KEYWORDS
format, get, selection retrieval
-
diff --git a/tk/doc/GetUid.3 b/tk/doc/GetUid.3
index 433a1fad1a0..77e896771dc 100644
--- a/tk/doc/GetUid.3
+++ b/tk/doc/GetUid.3
@@ -48,4 +48,3 @@ same string value as its argument (strcmp(Tk_GetUid(a), a) == 0).
.SH KEYWORDS
atom, unique identifier
-
diff --git a/tk/doc/GetVRoot.3 b/tk/doc/GetVRoot.3
index cc7bc918836..9cf7d1bd0f3 100644
--- a/tk/doc/GetVRoot.3
+++ b/tk/doc/GetVRoot.3
@@ -47,4 +47,3 @@ will be set to the dimensions of the screen containing \fItkwin\fR.
.SH KEYWORDS
geometry, height, location, virtual root, width, window manager
-
diff --git a/tk/doc/GetVisual.3 b/tk/doc/GetVisual.3
index b210abc50b3..943dad7559c 100644
--- a/tk/doc/GetVisual.3
+++ b/tk/doc/GetVisual.3
@@ -24,7 +24,7 @@ Visual *
Interpreter to use for error reporting.
.AP Tk_Window tkwin in
Token for window in which the visual will be used.
-.AP char *string in
+.AP "CONST char" *string in
String that identifies the desired visual. See below for
valid formats.
.AP int *depthPtr out
@@ -96,4 +96,3 @@ from Paul Mackerras.
.SH KEYWORDS
colormap, screen, visual
-
diff --git a/tk/doc/HWNDToWindow.3 b/tk/doc/HWNDToWindow.3
index 05367bf4f8c..34baf022a1b 100644
--- a/tk/doc/HWNDToWindow.3
+++ b/tk/doc/HWNDToWindow.3
@@ -11,7 +11,7 @@
Tk_HWNDToWindow \- Find Tk's window information for a Windows window
.SH SYNOPSIS
.nf
-\fB#include <tk.h>\fR
+\fB#include <tkPlatDecls.h>\fR
.sp
Tk_Window
\fBTk_HWNDToWindow\fR(\fIhwnd\fR)
diff --git a/tk/doc/HandleEvent.3 b/tk/doc/HandleEvent.3
index 1d8de4395d3..26b75278bec 100644
--- a/tk/doc/HandleEvent.3
+++ b/tk/doc/HandleEvent.3
@@ -47,4 +47,3 @@ doing anything else.
.SH KEYWORDS
callback, event, handler, window
-
diff --git a/tk/doc/IdToWindow.3 b/tk/doc/IdToWindow.3
index e8235b35926..0755f35bbb9 100644
--- a/tk/doc/IdToWindow.3
+++ b/tk/doc/IdToWindow.3
@@ -34,4 +34,3 @@ NULL is returned.
.SH KEYWORDS
X window id
-
diff --git a/tk/doc/ImgChanged.3 b/tk/doc/ImgChanged.3
index fa2093f8e89..7588fb8cc4d 100644
--- a/tk/doc/ImgChanged.3
+++ b/tk/doc/ImgChanged.3
@@ -67,4 +67,3 @@ Tk_CreateImageType
.SH KEYWORDS
images, redisplay, image size changes
-
diff --git a/tk/doc/InternAtom.3 b/tk/doc/InternAtom.3
index d4b0f2fbcbd..6264a265d59 100644
--- a/tk/doc/InternAtom.3
+++ b/tk/doc/InternAtom.3
@@ -19,13 +19,13 @@ Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms
Atom
\fBTk_InternAtom(\fItkwin, name\fR)
.sp
-char *
+CONST char *
\fBTk_GetAtomName(\fItkwin, atom\fR)
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
Token for window. Used to map atom or name relative to a particular display.
-.AP char *name in
+.AP "CONST char" *name in
String name for which atom is desired.
.AP Atom atom in
Atom for which corresponding string name is desired.
@@ -56,4 +56,3 @@ should be used in place of the Xlib procedures.
.SH KEYWORDS
atom, cache, display
-
diff --git a/tk/doc/MainLoop.3 b/tk/doc/MainLoop.3
index e1947e621bb..2cbe3c9d06b 100644
--- a/tk/doc/MainLoop.3
+++ b/tk/doc/MainLoop.3
@@ -30,4 +30,3 @@ entirely of callbacks invoked via \fBTcl_DoOneEvent\fR.
.SH KEYWORDS
application, event, main loop
-
diff --git a/tk/doc/MainWin.3 b/tk/doc/MainWin.3
index 81f2144c163..b409509b93f 100644
--- a/tk/doc/MainWin.3
+++ b/tk/doc/MainWin.3
@@ -44,5 +44,3 @@ windows currently open in the process.
.SH KEYWORDS
application, main window
-
-
diff --git a/tk/doc/MaintGeom.3 b/tk/doc/MaintGeom.3
index 20a8cf84d79..7137973f487 100644
--- a/tk/doc/MaintGeom.3
+++ b/tk/doc/MaintGeom.3
@@ -64,7 +64,8 @@ is unmapped, the slave is automatically removed by the screen
by X.
.PP
\fBTk_MaintainGeometry\fR deals with these problems for slaves
-whose masters aren't their parents.
+whose masters aren't their parents, as well as handling the simpler
+case of slaves whose masters are their parents.
\fBTk_MaintainGeometry\fR is typically called by a window manager
once it has decided where a slave should be positioned relative
to its master.
@@ -100,4 +101,3 @@ pair that is isn't currently managed, the call has no effect.
.SH KEYWORDS
geometry manager, map, master, parent, position, slave, unmap
-
diff --git a/tk/doc/ManageGeom.3 b/tk/doc/ManageGeom.3
index e72249cd4c2..50e0c7aa682 100644
--- a/tk/doc/ManageGeom.3
+++ b/tk/doc/ManageGeom.3
@@ -92,4 +92,3 @@ corresponding parameters passed to \fBTk_ManageGeometry\fR.
.SH KEYWORDS
callback, geometry, managed, request, unmanaged
-
diff --git a/tk/doc/MapWindow.3 b/tk/doc/MapWindow.3
index 4f8a550262a..b23cee7a14f 100644
--- a/tk/doc/MapWindow.3
+++ b/tk/doc/MapWindow.3
@@ -51,4 +51,3 @@ directly.
.SH KEYWORDS
map, unmap, window
-
diff --git a/tk/doc/MeasureChar.3 b/tk/doc/MeasureChar.3
index 57ba4b1fa9c..38cbf754153 100644
--- a/tk/doc/MeasureChar.3
+++ b/tk/doc/MeasureChar.3
@@ -135,4 +135,3 @@ text, the appropriate underlined font should be constructed and used.
.SH KEYWORDS
font
-
diff --git a/tk/doc/MoveToplev.3 b/tk/doc/MoveToplev.3
index 915a70c9283..b0b076f4ada 100644
--- a/tk/doc/MoveToplev.3
+++ b/tk/doc/MoveToplev.3
@@ -53,4 +53,3 @@ using the \fBTk_DoWhenIdle\fR mechanism.
.SH KEYWORDS
position, top-level window, window manager
-
diff --git a/tk/doc/Name.3 b/tk/doc/Name.3
index 867745b33b5..d4a2dbed7b2 100644
--- a/tk/doc/Name.3
+++ b/tk/doc/Name.3
@@ -30,7 +30,7 @@ Tk_Window
Token for window.
.AP Tcl_Interp *interp out
Interpreter to use for error reporting.
-.AP char *pathName in
+.AP "CONST char" *pathName in
Character string containing path name of window.
.BE
@@ -80,4 +80,3 @@ need not be the case: any window in the desired hierarchy may be used.
.SH KEYWORDS
name, path name, token, window
-
diff --git a/tk/doc/NameOfImg.3 b/tk/doc/NameOfImg.3
index 2b2edb7b8f9..fdc71f52b9c 100644
--- a/tk/doc/NameOfImg.3
+++ b/tk/doc/NameOfImg.3
@@ -15,7 +15,7 @@ Tk_NameOfImage \- Return name of image.
.nf
\fB#include <tk.h>\fR
.sp
-char *
+CONST char *
\fBTk_NameOfImage\fR(\fItypePtr\fR)
.SH ARGUMENTS
.AS Tk_ImageMaster *masterPtr
@@ -32,4 +32,3 @@ string name for the image.
.SH KEYWORDS
image manager, image name
-
diff --git a/tk/doc/OwnSelect.3 b/tk/doc/OwnSelect.3
index ad300a69acc..9b2e59d1e14 100644
--- a/tk/doc/OwnSelect.3
+++ b/tk/doc/OwnSelect.3
@@ -50,4 +50,3 @@ information about \fItkwin\fR.
.SH KEYWORDS
own, selection owner
-
diff --git a/tk/doc/ParseArgv.3 b/tk/doc/ParseArgv.3
index 791a8e36726..4fc886d2fe0 100644
--- a/tk/doc/ParseArgv.3
+++ b/tk/doc/ParseArgv.3
@@ -28,7 +28,7 @@ no Tk options will be processed.
.AP int argcPtr in/out
Pointer to number of arguments in argv; gets modified to hold
number of unprocessed arguments that remain after the call.
-.AP char **argv in/out
+.AP "CONST char" **argv in/out
Command line arguments passed to main program. Modified to
hold unprocessed arguments that remain after the call.
.AP Tk_ArgvInfo *argTable in
@@ -349,4 +349,3 @@ and \fIargv\fR[2] will be NULL.
.SH KEYWORDS
arguments, command line, options
-
diff --git a/tk/doc/QWinEvent.3 b/tk/doc/QWinEvent.3
index a07d399152a..7e58055d465 100644
--- a/tk/doc/QWinEvent.3
+++ b/tk/doc/QWinEvent.3
@@ -10,14 +10,21 @@
.TH Tk_QueueWindowEvent 3 7.5 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_QueueWindowEvent \- Add a window event to the Tcl event queue
+Tk_CollapseMotionEvents, Tk_QueueWindowEvent \- Add a window event to the Tcl event queue
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
+int
+\fBTk_CollapseMotionEvents\fR(\fIdisplay, collapse\fR)
+.sp
\fBTk_QueueWindowEvent\fR(\fIeventPtr, position\fR)
.SH ARGUMENTS
.AS Tcl_QueuePosition position
+.AP Display *display in
+Display for which to control motion event collapsing.
+.AP int collapse in
+Indicates whether motion events should be collapsed or not.
.AP XEvent *eventPtr in
An event to add to the event queue.
.AP Tcl_QueuePosition position in
@@ -27,17 +34,20 @@ Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR,
.SH DESCRIPTION
.PP
-This procedure places a window event on Tcl's
-internal event queue for eventual servicing. It creates a
-Tcl_Event structure, copies the event into that structure,
-and calls \fBTcl_QueueEvent\fR to add the event to the queue.
-When the event is eventually removed from the queue it is
+\fBTk_QueueWindowEvent\fR places a window event on Tcl's internal event
+queue for eventual servicing. It creates a Tcl_Event structure, copies the
+event into that structure, and calls \fBTcl_QueueEvent\fR to add the event
+to the queue. When the event is eventually removed from the queue it is
processed just like all window events.
.PP
+When multiple motion events are received for the same window in rapid
+succession, they are collapsed by default. This behavior can be controlled
+with \fBTk_CollapseMotionEvents\fR. \fBTk_CollapseMotionEvents\fR always
+returns the previous value for collapse behavior on the \fIdisplay\fR.
+.PP
The \fIposition\fR argument to \fBTk_QueueWindowEvent\fR has
the same significance as for \fBTcl_QueueEvent\fR; see the
documentation for \fBTcl_QueueEvent\fR for details.
.SH KEYWORDS
-callback, clock, handler, modal timeout
-
+callback, clock, handler, modal timeout, events
diff --git a/tk/doc/Restack.3 b/tk/doc/Restack.3
index c7e41d3bab9..6389d09d36f 100644
--- a/tk/doc/Restack.3
+++ b/tk/doc/Restack.3
@@ -47,4 +47,3 @@ Both of these values are defined by the include file <X11/Xlib.h>.
.SH KEYWORDS
above, below, obscure, stacking order
-
diff --git a/tk/doc/RestrictEv.3 b/tk/doc/RestrictEv.3
index d9508a15219..cb5653fe03a 100644
--- a/tk/doc/RestrictEv.3
+++ b/tk/doc/RestrictEv.3
@@ -79,4 +79,3 @@ queue. Instead, call \fBTk_RestrictEvents\fR to set up a filter,
then call \fBTk_DoOneEvent\fR to retrieve the desired event(s).
.SH KEYWORDS
delay, event, filter, restriction
-
diff --git a/tk/doc/SetAppName.3 b/tk/doc/SetAppName.3
index 0601c802095..293129fd153 100644
--- a/tk/doc/SetAppName.3
+++ b/tk/doc/SetAppName.3
@@ -16,14 +16,14 @@ Tk_SetAppName \- Set the name of an application for ``send'' commands
.nf
\fB#include <tk.h>\fR
.sp
-char *
+CONST char *
\fBTk_SetAppName\fR(\fItkwin, name\fR)
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
Token for window in application. Used only to select a particular
application.
-.AP char *name in
+.AP "CONST char" *name in
Name under which to register the application.
.BE
@@ -63,4 +63,3 @@ functionality of \fBTk_SetAppName\fR.
.SH KEYWORDS
application, name, register, send command
-
diff --git a/tk/doc/SetCaret.3 b/tk/doc/SetCaret.3
new file mode 100644
index 00000000000..067ee4a5d92
--- /dev/null
+++ b/tk/doc/SetCaret.3
@@ -0,0 +1,40 @@
+'\"
+'\" 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.
+'\"
+'\" RCS: @(#) $Id$
+'\"
+.so man.macros
+.TH Tk_SetCaretPos 3 8.4 Tk "Tk Library Procedures"
+.BS
+.SH NAME
+Tk_SetCaretPos \- set the display caret location
+.SH SYNOPSIS
+.nf
+\fB#include <tk.h>\fR
+.sp
+int
+\fBTk_SetCaretPos\fR(\fItkwin, x, y, height\fR)
+.SH ARGUMENTS
+.AP Tk_Window tkwin in
+Token for window.
+.AP int x in
+Window-relative x coordinate.
+.AP int y in
+Window-relative y coordinate.
+.AP int h in
+Height of the caret in the window.
+.BE
+
+.SH DESCRIPTION
+.PP
+\fBTk_SetCaretPos\fR sets the caret location for the display of the
+specified Tk_Window \fItkwin\fR. The caret is the per-display cursor
+location used for indicating global focus (e.g. to comply with Microsoft
+Accessibility guidelines), as well as for location of the over-the-spot XIM
+(X Input Methods) or Windows IME windows.
+
+.SH KEYWORDS
+caret, cursor
diff --git a/tk/doc/SetClass.3 b/tk/doc/SetClass.3
index 47baa9f6c49..9b2f9814724 100644
--- a/tk/doc/SetClass.3
+++ b/tk/doc/SetClass.3
@@ -59,4 +59,3 @@ If \fItkwin\fR has not yet been given a class, then
.SH KEYWORDS
class, unique identifier, window, window manager
-
diff --git a/tk/doc/SetClassProcs.3 b/tk/doc/SetClassProcs.3
new file mode 100644
index 00000000000..5b563ee3dc8
--- /dev/null
+++ b/tk/doc/SetClassProcs.3
@@ -0,0 +1,91 @@
+'\"
+'\" Copyright (c) 2000 Ajuba Solutions.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" RCS: @(#) $Id$
+'\"
+.so man.macros
+.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures"
+.BS
+.SH NAME
+Tk_SetClassProcs \- register widget specific procedures
+.SH SYNOPSIS
+.nf
+\fB#include <tk.h>\fR
+.sp
+\fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR)
+.SH ARGUMENTS
+.AS Tk_ClassProc instanceData
+.AP Tk_Window tkwin in
+Token for window to modify.
+.AP Tk_ClassProcs *procs in
+Pointer to data structure containing widget specific procedures.
+The data structure pointed to by \fIprocs\fR must be static:
+Tk keeps a reference to it as long as the window exists.
+.AP ClientData instanceData in
+Arbitrary one-word value to pass to widget callbacks.
+.BE
+
+.SH DESCRIPTION
+.PP
+\fBTk_SetClassProcs\fR is called to register a set of procedures that
+are used as callbacks in different places.
+.PP
+The structure pointed to by \fIprocs\fR contains the following:
+.CS
+typedef struct Tk_ClassProcs {
+ unsigned int \fIsize\fR;
+ Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
+ Tk_ClassCreateProc *\fIcreateProc\fR;
+ Tk_ClassModalProc *\fImodalProc\fR;
+} Tk_ClassProcs;
+.CE
+The \fIsize\fR field is used to simplify future expansion of the
+structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR.
+.PP
+\fIworldChangedProc\fR is invoked when the system has altered
+in some way that requires some reaction from the widget. For example,
+when a font alias (see the \fBfont\fR manual entry) is reconfigured,
+widgets configured to use that font alias must update their display
+accordingly. \fIworldChangedProc\fR should have arguments and results
+that match the type \fBTk_ClassWorldChangedProc\fR:
+.CS
+typedef void Tk_ClassWorldChangedProc(
+ ClientData \fIinstanceData\fR);
+.CE
+The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR
+will be identical to the \fIinstanceData\fR paramter passed to
+\fBTk_SetClassProcs\fR.
+.PP
+\fIcreateProc\fR is used to create platform-dependant windows. It is
+invoked by \fBTk_MakeWindowExist\fR. \fIcreateProc\fR should have
+arguments and results that match the type \fBTk_ClassCreateProc\fR:
+.CS
+typedef Window Tk_ClassCreateProc(
+ Tk_Window \fItkwin\fR,
+ Window \fIparent\fR,
+ ClientData \fIinstanceData\fR);
+.CE
+The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to
+the \fItkwin\fR and \fIinstanceData\fR parameters passed to
+\fBTk_SetClassProcs\fR. The \fIparent\fR parameter will be the parent
+of the window to be created. The \fIcreateProc\fR should return the
+created window.
+.PP
+\fImodalProc\fR is invoked after all bindings on a widget have been
+triggered in order to handle a modal loop. \fImodalProc\fR should
+have arguments and results that match the type \fBTk_ClassModalProc\fR:
+.CS
+typedef void Tk_ClassModalProc(
+ Tk_Window \fItkwin\fR,
+ XEvent *\fIeventPtr\fR);
+.CE
+The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the
+\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR. The
+\fIeventPtr\fR parameter will be a pointer to an XEvent structure
+describing the event being processed.
+
+.SH KEYWORDS
+callback, class
diff --git a/tk/doc/SetGrid.3 b/tk/doc/SetGrid.3
index 6602b632876..d867ca4c3ee 100644
--- a/tk/doc/SetGrid.3
+++ b/tk/doc/SetGrid.3
@@ -65,4 +65,3 @@ management.
.SH KEYWORDS
grid, window, window manager
-
diff --git a/tk/doc/SetOptions.3 b/tk/doc/SetOptions.3
index dcb8f969719..925a68767d5 100644
--- a/tk/doc/SetOptions.3
+++ b/tk/doc/SetOptions.3
@@ -311,8 +311,8 @@ The \fIflags\fR field consists of one or more bits ORed together. At
present only a single flag is supported: TK_OPTION_NULL_OK. If
this bit is set for an option then an empty string will be accepted as
the value for the option and the resulting internal form will be a
-NULL pointer or \fBNone\fR, depending on the type of the option.
-If the flag is not set then empty strings will result
+NULL pointer, a zero value, or \fBNone\fR, depending on the type of
+the option. If the flag is not set then empty strings will result
in errors.
TK_OPTION_NULL_OK is typically used to allow a
feature to be turned off entirely, e.g. set a cursor value to
@@ -368,10 +368,16 @@ such as \fBTk_SetOptions\fR, and when the option is set the cursor
for the window is changed by calling \fBXDefineCursor\fR. This
option type also supports the TK_OPTION_NULL_OK flag.
.TP
+\fBTK_OPTION_CUSTOM\fR
+This option allows applications to define new option types. The
+clientData field of the entry points to a structure defining the new
+option type. See the section CUSTOM OPTION TYPES below for details.
+.TP
\fBTK_OPTION_DOUBLE\fR
The string value must be a floating-point number in
the format accepted by \fBstrtol\fR. The internal form is a C
-\fBdouble\fR value.
+\fBdouble\fR value. This option type supports the TK_OPTION_NULL_OK
+flag; if a NULL value is set, the internal representation is set to zero.
.TP
\fBTK_OPTION_END\fR
Marks the end of the template. There must be a Tk_OptionSpec structure
@@ -406,12 +412,16 @@ The internal form is an integer value giving a
distance in pixels, like the values returned by
\fBTk_GetPixelsFromObj\fR. Note: if the \fIobjOffset\fR field isn't
used then information about the original value of this option will be lost.
-See \fBOBJOFFSET VS. INTERNALOFFSET\fR below for details.
+See \fBOBJOFFSET VS. INTERNALOFFSET\fR below for details. This option
+type supports the TK_OPTION_NULL_OK flag; if a NULL value is set, the
+internal representation is set to zero.
.TP
\fBTK_OPTION_RELIEF\fR
The value must be standard relief such as \fBraised\fR.
The internal form is an integer relief value such as
-TK_RELIEF_RAISED.
+TK_RELIEF_RAISED. This option type supports the TK_OPTION_NULL_OK
+flag; if the empty string is specified as the value for the option,
+the integer relief value is set to TK_RELIEF_NULL.
.TP
\fBTK_OPTION_STRING\fR
The value may be any string. The internal form is a (char *) pointer
@@ -447,7 +457,7 @@ If a field of a widget record has its offset stored in the \fIobjOffset\fR
or \fIinternalOffset\fR field of a Tk_OptionSpec structure then the
procedures described here will handle all of the storage allocation and
resource management issues associated with the field. When the value
-of an option is changed, \fBTk_SetOptions\fR (or \fBTk_FreeSavedOptions\fR
+of an option is changed, \fBTk_SetOptions\fR (or \fBTk_FreeSavedOptions\fR)
will automatically free any resources associated with the old value, such as
Tk_Fonts for TK_OPTION_FONT options or dynamically allocated memory for
TK_OPTION_STRING options. For an option stored as an object using the
@@ -491,13 +501,153 @@ on retrievals exists only for TK_OPTION_PIXELS options.
.PP
The second reason to use the \fIobjOffset\fR field is in order to
implement new types of options not supported by these procedures.
-To implement a new type of option, use TK_OPTION_STRING as
+To implement a new type of option, you can use TK_OPTION_STRING as
the type in the Tk_OptionSpec structure and set the \fIobjOffset\fR field
but not the \fIinternalOffset\fR field. Then, after calling
\fBTk_SetOptions\fR, convert the object to internal form yourself.
+.SH "CUSTOM OPTION TYPES"
+.PP
+Applications can extend the built-in configuration types with
+additional configuration types by writing procedures to parse, print,
+free, and restore saved copies of the type and creating a structure
+pointing to those procedures:
+.CS
+typedef struct Tk_ObjCustomOption {
+ char *name;
+ Tk_CustomOptionSetProc *\fIsetProc\fR;
+ Tk_CustomOptionGetProc *\fIgetProc\fR;
+ Tk_CustomOptionRestoreProc *\fIrestoreProc\fR;
+ Tk_CustomOptionFreeProc *\fIfreeProc\fR;
+ ClientData \fIclientData\fR;
+} Tk_ObjCustomOption;
+
+typedef int Tk_CustomOptionSetProc(
+ ClientData \fIclientData\fR,
+ Tcl_Interp *\fIinterp\fR,
+ Tk_Window \fItkwin\fR,
+ Tcl_Obj **\fIvaluePtr\fR,
+ char *\fIrecordPtr\fR,
+ int \fIinternalOffset\fR,
+ char *\fIsaveInternalPtr\fR,
+ int \fIflags\fR);
+
+typedef Tcl_Obj *Tk_CustomOptionGetProc(
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIrecordPtr\fR,
+ int \fIinternalOffset\fR);
+
+typedef void Tk_CustomOptionRestoreProc(
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIinternalPtr\fR,
+ char *\fIsaveInternalPtr\fR);
+
+typedef void Tk_CustomOptionFreeProc(
+ ClientData \fIclientData\fR,
+ Tk_Window \fItkwin\fR,
+ char *\fIinternalPtr\fR);
+.CE
+.PP
+The Tk_ObjCustomOption structure contains six fields: a name
+for the custom option type; pointers to the four procedures; and a
+\fIclientData\fR value to be passed to those procedures when they are
+invoked. The \fIclientData\fR value typically points to a structure
+containing information that is needed by the procedures when they are
+parsing and printing options. \fIRestoreProc\fR and \fIfreeProc\fR
+may be NULL, indicating that no function should be called for those
+operations.
+.PP
+The \fIsetProc\fR procedure is invoked by \fBTk_SetOptions\fR to
+convert a Tcl_Obj into an internal representation and store the
+resulting value in the widget record. The arguments are:
+.RS
+.TP
+\fIclientData\fR
+A copy of the \fIclientData\fR field in the Tk_ObjCustomOption
+structure.
+.TP
+\fIinterp\fR
+A pointer to a Tcl interpreter, used for error reporting.
+.TP
+\fITkwin\fR
+A copy of the \fItkwin\fR argument to \fBTk_SetOptions\fR
+.TP
+\fIvaluePtr\fR
+A pointer to a reference to a Tcl_Obj describing the new value for the
+option; it could have been specified explicitly in the call to
+\fBTk_SetOptions\fR or it could come from the option database or a
+default. If the objOffset for the option is non-negative (the option
+value is stored as a (Tcl_Obj *) in the widget record), the Tcl_Obj
+pointer referenced by \fIvaluePtr\fR is the pointer that will be
+stored at the objOffset for the option. \fISetProc\fR may modify the
+value if necessary; for example, \fIsetProc\fR may change the value to
+NULL to support the TK_OPTION_NULL_OK flag.
+.TP
+\fIrecordPtr\fR
+A pointer to the start of the widget record to modify.
+.TP
+\fIinternalOffset\fR
+Offset in bytes from the start of the widget record to the location
+where the internal representation of the option value is to be placed.
+.TP
+\fIsaveInternalPtr\fR
+A pointer to storage allocated in a Tk_SavedOptions structure for the
+internal representation of the original option value. Before setting
+the option to its new value, \fIsetProc\fR should set the value
+referenced by \fIsaveInternalPtr\fR to the original value of the
+option in order to support \fBTk_RestoreSavedOptions\fR.
+.TP
+\fIflags\fR
+A copy of the \fIflags\fR field in the Tk_OptionSpec structure for the
+option
+.RE
+.PP
+\fISetProc\fR returns a standard Tcl result: TCL_OK to indicate successful
+processing, or TCL_ERROR to indicate a failure of any kind. An error
+message may be left in the Tcl interpreter given by \fIinterp\fR in
+the case of an error.
+.PP
+The \fIgetProc\fR procedure is invoked by \fBTk_GetOptionValue\fR and
+\fBTk_GetOptionInfo\fR to retrieve a Tcl_Obj representation of the
+internal representation of an option. The \fIclientData\fR argument
+is a copy of the \fIclientData\fR field in the Tk_ObjCustomOption
+structure. \fITkwin\fR is a copy of the \fItkwin\fR argument to
+\fBTk_GetOptionValue\fR or \fBTk_GetOptionInfo\fR. \fIRecordPtr\fR
+is a pointer to the beginning of the widget record to query.
+\fIInternalOffset\fR is the offset in bytes from the beginning of the
+widget record to the location where the internal representation of the
+option value is stored. \fIGetProc\fR must return a pointer to a
+Tcl_Obj representing the value of the option.
+.PP
+The \fIrestoreProc\fR procedure is invoked by
+\fBTk_RestoreSavedOptions\fR to restore a previously saved internal
+representation of a custom option value. The \fIclientData\fR argument
+is a copy of the \fIclientData\fR field in the Tk_ObjCustomOption
+structure. \fITkwin\fR is a copy of the \fItkwin\fR argument to
+\fBTk_GetOptionValue\fR or \fBTk_GetOptionInfo\fR. \fIInternalPtr\fR
+is a pointer to the location where internal representation of the
+option value is stored.
+\fISaveInternalPtr\fR is a pointer to the saved value.
+\fIRestoreProc\fR must copy the value from \fIsaveInternalPtr\fR to
+\fIinternalPtr\fR to restore the value. \fIRestoreProc\fR need not
+free any memory associated with either \fIinternalPtr\fR or
+\fIsaveInternalPtr\fR; \fIfreeProc\fR will be invoked to free that
+memory if necessary. \fIRestoreProc\fR has no return value.
+.PP
+The \fIfreeProc\fR procedure is invoked by \fBTk_SetOptions\fR and
+\fBTk_FreeSavedOptions\fR to free any storage allocated for the
+internal representation of a custom option. The \fIclientData\fR argument
+is a copy of the \fIclientData\fR field in the Tk_ObjCustomOption
+structure. \fITkwin\fR is a copy of the \fItkwin\fR argument to
+\fBTk_GetOptionValue\fR or \fBTk_GetOptionInfo\fR. \fIInternalPtr\fR
+is a pointer to the location where the internal representation of the
+option value is stored. The \fIfreeProc\fR must free any storage
+associated with the option. \fIFreeProc\fR has no return value.
+
+
.SH KEYWORDS
anchor, bitmap, boolean, border, color, configuration option,
cursor, double, font, integer, justify,
pixels, relief, screen distance, synonym
-
diff --git a/tk/doc/SetVisual.3 b/tk/doc/SetVisual.3
index f349fe7b669..8895d3a36f9 100644
--- a/tk/doc/SetVisual.3
+++ b/tk/doc/SetVisual.3
@@ -52,4 +52,3 @@ call \fBTk_SetWindowColormap\fR instead.
.SH KEYWORDS
colormap, depth, visual
-
diff --git a/tk/doc/StrictMotif.3 b/tk/doc/StrictMotif.3
index 4b12e63b0b0..24c99051a2a 100644
--- a/tk/doc/StrictMotif.3
+++ b/tk/doc/StrictMotif.3
@@ -39,4 +39,3 @@ faster access to the variable's value than could be had by calling
.SH KEYWORDS
Motif compliance, tk_strictMotif variable
-
diff --git a/tk/doc/TextLayout.3 b/tk/doc/TextLayout.3
index bb00bb480aa..ba1273c5c99 100644
--- a/tk/doc/TextLayout.3
+++ b/tk/doc/TextLayout.3
@@ -278,4 +278,3 @@ actually drawn \- they are merely placeholders maintained in the
\fIlayout\fR.
.SH KEYWORDS
font
-
diff --git a/tk/doc/TkInitStubs.3 b/tk/doc/TkInitStubs.3
index c8d6fc28181..3edd93555b4 100644
--- a/tk/doc/TkInitStubs.3
+++ b/tk/doc/TkInitStubs.3
@@ -7,7 +7,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH Tk_InitStubs 3 8.1 Tk "Tk Library Procedures"
+.TH Tk_InitStubs 3 8.4 Tk "Tk Library Procedures"
.BS
.SH NAME
Tk_InitStubs \- initialize the Tk stubs mechanism
@@ -15,7 +15,7 @@ Tk_InitStubs \- initialize the Tk stubs mechanism
.nf
\fB#include <tk.h>\fR
.sp
-char *
+CONST char *
\fBTk_InitStubs\fR(\fIinterp, version, exact\fR)
.SH ARGUMENTS
.AS Tcl_Interp *interp in
@@ -55,9 +55,9 @@ Define the USE_TCL_STUBS symbol. Typically, you would include the
.IP 3) 5
Link the extension with the Tcl and Tk stubs libraries instead of
the standard Tcl and Tk libraries. On Unix platforms, the library
-names are \fIlibtclstub8.1.a\fR and \fIlibtkstub8.1.a\fR; on Windows
-platforms, the library names are
-\fItclstub81.lib\fR and \fItkstub81.lib\fR.
+names are \fIlibtclstub8.4.a\fR and \fIlibtkstub8.4.a\fR; on Windows
+platforms, the library names are \fItclstub84.lib\fR and \fItkstub84.lib\fR
+(adjust names with appropriate version number).
.SH DESCRIPTION
\fBTk_InitStubs\fR attempts to initialize the Tk stub table pointers
and ensure that the correct version of Tk is loaded. In addition
diff --git a/tk/doc/Tk_Init.3 b/tk/doc/Tk_Init.3
index 4587f5012b5..b9be1e227f5 100644
--- a/tk/doc/Tk_Init.3
+++ b/tk/doc/Tk_Init.3
@@ -7,18 +7,20 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH Tk_Init 3 4.1 Tk "Tk Library Procedures"
+.TH Tk_Init 3 8.0 Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_Init \- add Tk to an interpreter and make a new Tk application.
+Tk_Init, Tk_SafeInit \- add Tk to an interpreter and make a new Tk application.
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
int
\fBTk_Init\fR(\fIinterp\fR)
+.sp
+int
+\fBTk_SafeInit\fR(\fIinterp\fR)
.SH ARGUMENTS
-.AS Tcl_Interp *interp
.AP Tcl_Interp *interp in
Interpreter in which to load Tk. Tk should not already be loaded
in this interpreter.
@@ -42,7 +44,45 @@ new Tk application.
The options may have any of the forms documented for the
\fBwish\fR application (in fact, \fBwish\fR uses Tk_Init to process
its command-line arguments).
+.PP
+\fBTk_SafeInit\fR is identical to \fBTk_Init\fR except that it removes
+all Tk commands that are considered unsafe. Those commands and the
+reasons for their exclusion are:
+.TP
+\fBbell\fR
+Continuous ringing of the bell is a nuisance.
+.TP
+\fBclipboard\fR
+A malicious script could replace the contents of the clipboard with
+the string \fB"rm -r *"\fR and lead to surprises when the contents of
+the clipboard are pasted.
+.TP
+\fBgrab\fR
+Grab can be used to block the user from using any other applications.
+.TP
+\fBmenu\fR
+Menus can be used to cover the entire screen and to steal input from
+the user.
+.TP
+\fBselection\fR
+See clipboard.
+.TP
+\fBsend\fR
+Send can be used to cause unsafe interpreters to execute commands.
+.TP
+\fBtk\fR
+The tk command recreates the send command, which is unsafe.
+.TP
+\fBtkwait\fR
+Tkwait can block the containing process forever
+.TP
+\fBtoplevel\fR
+Toplevels can be used to cover the entire screen and to steal input
+from the user.
+.TP
+\fBwm\fR
+If toplevels are ever allowed, wm can be used to remove decorations,
+move windows around, etc.
.SH KEYWORDS
-application, initialization, load, main window
-
+safe, application, initialization, load, main window
diff --git a/tk/doc/Tk_Main.3 b/tk/doc/Tk_Main.3
index 813f6ba6f88..72f506638ed 100644
--- a/tk/doc/Tk_Main.3
+++ b/tk/doc/Tk_Main.3
@@ -59,4 +59,3 @@ for \fBTcl_AppInit\fR.
.SH KEYWORDS
application-specific initialization, command-line arguments, main program
-
diff --git a/tk/doc/WindowId.3 b/tk/doc/WindowId.3
index 26cf5828fdb..c414644597b 100644
--- a/tk/doc/WindowId.3
+++ b/tk/doc/WindowId.3
@@ -8,10 +8,10 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH Tk_WindowId 3 "" Tk "Tk Library Procedures"
+.TH Tk_WindowId 3 "8.4" Tk "Tk Library Procedures"
.BS
.SH NAME
-Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_InternalBorderWidth, Tk_Visual, Tk_Depth, Tk_Colormap \- retrieve information from Tk's local data structure
+Tk_WindowId, Tk_Parent, Tk_Display, Tk_DisplayName, Tk_ScreenNumber, Tk_Screen, Tk_X, Tk_Y, Tk_Width, Tk_Height, Tk_Changes, Tk_Attributes, Tk_IsContainer, Tk_IsEmbedded, Tk_IsMapped, Tk_IsTopLevel, Tk_ReqWidth, Tk_ReqHeight, Tk_MinReqWidth, Tk_MinReqHeight, Tk_InternalBorderLeft, Tk_InternalBorderRight, Tk_InternalBorderTop, Tk_InternalBorderBottom, Tk_Visual, Tk_Depth, Tk_Colormap \- retrieve information from Tk's local data structure
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
@@ -25,7 +25,7 @@ Tk_Window
Display *
\fBTk_Display\fR(\fItkwin\fR)
.sp
-char *
+CONST char *
\fBTk_DisplayName\fR(\fItkwin\fR)
.sp
int
@@ -71,7 +71,22 @@ int
\fBTk_ReqHeight\fR(\fItkwin\fR)
.sp
int
-\fBTk_InternalBorderWidth\fR(\fItkwin\fR)
+\fBTk_MinReqWidth\fR(\fItkwin\fR)
+.sp
+int
+\fBTk_MinReqHeight\fR(\fItkwin\fR)
+.sp
+int
+\fBTk_InternalBorderLeft\fR(\fItkwin\fR)
+.sp
+int
+\fBTk_InternalBorderRight\fR(\fItkwin\fR)
+.sp
+int
+\fBTk_InternalBorderTop\fR(\fItkwin\fR)
+.sp
+int
+\fBTk_InternalBorderBottom\fR(\fItkwin\fR)
.sp
Visual *
\fBTk_Visual\fR(\fItkwin\fR)
@@ -145,10 +160,16 @@ screen) and zero if \fItkwin\fR isn't a top-level window.
the window's requested size. These values correspond to the last
call to \fBTk_GeometryRequest\fR for \fItkwin\fR.
.PP
-\fBTk_InternalBorderWidth\fR returns the width of internal border
-that has been requested for \fItkwin\fR, or 0 if no internal border
-was requested. The return value is simply the last value passed
-to \fBTk_SetInternalBorder\fR for \fItkwin\fR.
+\fBTk_MinReqWidth\fR and \fBTk_MinReqHeight\fR return information about
+the window's minimum requested size. These values correspond to the last
+call to \fBTk_SetMinimumRequestSize\fR for \fItkwin\fR.
+.PP
+\fBTk_InternalBorderLeft\fR, \fBTk_InternalBorderRight\fR,
+\fBTk_InternalBorderTop\fR and \fBTk_InternalBorderBottom\fR
+return the width of one side of the internal border
+that has been requested for \fItkwin\fR, or 0 if no internal border was
+requested. The return value is simply the last value passed to
+\fBTk_SetInternalBorder\fR or \fBTk_SetInternalBorderEx\fR for \fItkwin\fR.
.PP
\fBTk_Visual\fR, \fBTk_Depth\fR, and \fBTk_Colormap\fR return
information about the visual characteristics of a window.
@@ -163,4 +184,3 @@ they may be overridden by calling \fBTk_SetWindowVisual\fR.
attributes, colormap, depth, display, height, geometry manager,
identifier, mapped, requested size, screen, top-level,
visual, width, window, x, y
-
diff --git a/tk/doc/bell.n b/tk/doc/bell.n
index 312983d360a..3b0e50cbd86 100644
--- a/tk/doc/bell.n
+++ b/tk/doc/bell.n
@@ -1,6 +1,7 @@
'\"
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
+'\" Copyright (c) 2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -8,13 +9,13 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH bell n 4.0 Tk "Tk Built-In Commands"
+.TH bell n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
bell \- Ring a display's bell
.SH SYNOPSIS
-\fBbell \fR?\fB\-displayof \fIwindow\fR?
+\fBbell \fR?\fB\-displayof \fIwindow\fR? ?\fB\-nice\fR?
.BE
.SH DESCRIPTION
@@ -26,10 +27,9 @@ application's main window is used by default.
The command uses the current bell-related settings for the display, which
may be modified with programs such as \fBxset\fR.
.PP
-This command also resets the screen saver for the screen. Some
-screen savers will ignore this, but others will reset so that the
-screen becomes visible again.
+If \fB\-nice\fR is not specified, this command also resets the screen saver
+for the screen. Some screen savers will ignore this, but others will reset
+so that the screen becomes visible again.
.SH KEYWORDS
beep, bell, ring
-
diff --git a/tk/doc/bind.n b/tk/doc/bind.n
index 6618f446c05..82b3e1b6d67 100644
--- a/tk/doc/bind.n
+++ b/tk/doc/bind.n
@@ -119,7 +119,7 @@ Modifiers consist of any of the following values:
\fBButton3, B3\fR \fBAlt\fR
\fBButton4, B4\fR \fBDouble\fR
\fBButton5, B5\fR \fBTriple\fR
-\fBMod1, M1\fR
+\fBMod1, M1\fR \fBQuadruple\fR
.DE
Where more than one value is listed, separated by commas, the values
are equivalent.
@@ -145,16 +145,15 @@ Similarly, the \fBAlt\fR modifier refers to whichever modifier
is associated with the alt key(s) on the keyboard (keysyms
\fBAlt_L\fR and \fBAlt_R\fR).
.PP
-The \fBDouble\fR and \fBTriple\fR modifiers are a convenience
-for specifying double mouse clicks and other repeated
-events. They cause a particular event pattern to be
-repeated 2 or 3 times, and also place a time and space requirement
-on the sequence: for a sequence of events to match a \fBDouble\fR
-or \fBTriple\fR pattern, all of the events must occur close together
-in time and without substantial mouse motion in between.
-For example, \fB<Double-Button-1>\fR
-is equivalent to \fB<Button-1><Button-1>\fR with the extra
-time and space requirement.
+The \fBDouble\fR, \fBTriple\fR and \fBQuadruple\fR modifiers are a
+convenience for specifying double mouse clicks and other repeated
+events. They cause a particular event pattern to be repeated 2, 3 or 4
+times, and also place a time and space requirement on the sequence: for a
+sequence of events to match a \fBDouble\fR, \fBTriple\fR or \fBQuadruple\fR
+pattern, all of the events must occur close together in time and without
+substantial mouse motion in between. For example, \fB<Double-Button-1>\fR
+is equivalent to \fB<Button-1><Button-1>\fR with the extra time and space
+requirement.
.SH "EVENT TYPES"
.PP
@@ -163,18 +162,18 @@ few extra abbreviations. The \fItype\fR field will also accept a
couple non-standard X event types that were added to better support
the Macintosh and Windows platforms. Below is a list of all the valid
types; where two names appear together, they are synonyms.
-.DS C
+.DS
.ta 5c 10c
-\fBActivate Enter Map
-ButtonPress, Button Expose Motion
-.VS
-ButtonRelease FocusIn MouseWheel
-.VE
-Circulate FocusOut Property
+\fBActivate Destroy Map
+ButtonPress, Button Enter MapRequest
+ButtonRelease Expose Motion
+Circulate FocusIn MouseWheel
+CirculateRequest FocusOut Property
Colormap Gravity Reparent
-Configure KeyPress, Key Unmap
-Deactivate KeyRelease Visibility
-Destroy Leave\fR
+Configure KeyPress, Key ResizeRequest
+ConfigureRequest KeyRelease Unmap
+Create Leave Visibility
+Deactivate\fR
.DE
.PP
.VS
@@ -291,6 +290,13 @@ NotifyDetailNone NotifyPointer
NotifyInferior NotifyPointerRoot
NotifyNonlinear NotifyVirtual\fR
.DE
+For \fBConfigureRequest\fR events, the string will be one of:
+.DS
+.ta 6c
+\fBAbove Opposite
+Below None
+BottomIf TopIf\fR
+.DE
For events other than these, the substituted string is undefined.
.RE
.IP \fB%f\fR 5
@@ -298,9 +304,13 @@ The \fIfocus\fR field from the event (\fB0\fR or \fB1\fR). Valid only
for \fBEnter\fR and \fBLeave\fR events.
.IP \fB%h\fR 5
.VS
-The \fIheight\fR field from the event. Valid for the \fBConfigure\fR and
+The \fIheight\fR field from the event. Valid for the \fBConfigure\fR,
+\fBConfigureRequest\fR, \fBCreate\fR, \fBResizeRequest\fR, and
\fBExpose\fR events.
.VE
+.IP \fB%i\fR 5
+The \fIwindow\fR field from the event, represented as a hexadecimal
+integer.
.IP \fB%k\fR 5
The \fIkeycode\fR field from the event. Valid only for \fBKeyPress\fR
and \fBKeyRelease\fR events.
@@ -317,7 +327,7 @@ The \fIoverride_redirect\fR field from the event. Valid only for
.IP \fB%p\fR 5
The \fIplace\fR field from the event, substituted as one of the
strings \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR. Valid only
-for \fBCirculate\fR events.
+for \fBCirculate\fR and \fBCirculateRequest\fR events.
.IP \fB%s\fR 5
The \fIstate\fR field from the event. For \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
@@ -331,7 +341,8 @@ contain a \fItime\fR field.
.IP \fB%w\fR 5
The \fIwidth\fR field from the event. Valid only for
.VS
-\fBConfigure\fR and \fBExpose\fR events.
+\fBConfigure\fR, \fBConfigureRequest\fR, \fBCreate\fR,
+\fBResizeRequest\fR, and \fBExpose\fR events.
.VE
.IP \fB%x\fR 5
The \fIx\fR field from the event. Valid only for events containing
@@ -347,7 +358,7 @@ work of translating from the event to an ASCII character.
Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
.IP \fB%B\fR 5
The \fIborder_width\fR field from the event. Valid only for
-\fBConfigure\fR events.
+\fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events.
.VS
.IP \fB%D\fR 5
This reports the \fIdelta\fR value of a \fBMouseWheel\fR event. The
@@ -417,7 +428,7 @@ string (open square bracket) as its first argument.
If the extra backslash hadn't been added, Tcl would not have been
able to parse the script correctly.
-.SH MULTIPLE MATCHES
+.SH "MULTIPLE MATCHES"
.PP
It is possible for several bindings to match a given X event.
If the bindings are associated with different \fItag\fR's,
@@ -437,7 +448,6 @@ associated with other \fItag\fR's.
If the \fBbreak\fR command is invoked within a binding script,
then that script terminates and no other scripts will be invoked
for the event.
-.VS
.PP
If more than one binding matches a particular event and they
have the same \fItag\fR, then the most specific binding
@@ -451,7 +461,6 @@ of events matched) is more specific than a shorter sequence;
(c) if the modifiers specified in one pattern are a subset of the
modifiers in another pattern, then the pattern with more modifiers
is more specific.
-.VS
(d) a virtual event whose physical pattern matches the sequence is less
specific than the same physical pattern that is not associated with a
virtual event.
@@ -478,7 +487,6 @@ If the user types Control-y, the \fB<<Paste>>\fR binding
will be invoked, but if the user presses button 2 then one of
either the \fB<<Paste>>\fR or the \fB<<Scroll>>\fR bindings will
be invoked, but exactly which one gets invoked is undefined.
-.VE
.PP
If an X event does not match any of the existing bindings, then the
event is ignored.
@@ -517,8 +525,7 @@ The \fBbgerror\fR command will be executed at global level
(outside the context of any Tcl procedure).
.SH "SEE ALSO"
-bgerror
+bgerror, keysyms
.SH KEYWORDS
form, manual
-
diff --git a/tk/doc/bindtags.n b/tk/doc/bindtags.n
index 1f6a30a5323..20e5291f459 100644
--- a/tk/doc/bindtags.n
+++ b/tk/doc/bindtags.n
@@ -79,4 +79,3 @@ bind
.SH KEYWORDS
binding, event, tag
-
diff --git a/tk/doc/bitmap.n b/tk/doc/bitmap.n
index 21c4135337a..0fa1c5afda9 100644
--- a/tk/doc/bitmap.n
+++ b/tk/doc/bitmap.n
@@ -112,4 +112,3 @@ this case the command returns an empty string.
.SH KEYWORDS
bitmap, image
-
diff --git a/tk/doc/button.n b/tk/doc/button.n
index 6cda7367623..ca07c4827cd 100644
--- a/tk/doc/button.n
+++ b/tk/doc/button.n
@@ -16,18 +16,31 @@ button \- Create and manipulate button widgets
.SH SYNOPSIS
\fBbutton\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-activebackground \-cursor \-highlightthickness \-takefocus
-\-activeforeground \-disabledforeground \-image \-text
-\-anchor \-font \-justify \-textvariable
-\-background \-foreground \-padx \-underline
-\-bitmap \-highlightbackground \-pady \-wraplength
-\-borderwidth \-highlightcolor \-relief
+\-activebackground \-foreground \-repeatdelay
+\-activeforeground \-highlightbackground \-repeatinterval
+\-anchor \-highlightcolor \-takefocus
+\-background \-highlightthickness \-text
+\-bitmap \-image \-textvariable
+\-borderwidth \-justify \-underline
+\-cursor \-padx \-wraplength
+\-disabledforeground \-pady
+\-font \-relief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-command command Command
Specifies a Tcl command to associate with the button. This command
is typically invoked when mouse button 1 is released over the button
window.
+.VS 8.4
+.OP \-compound compound Compound
+Specifies whether the button should display both an image and text,
+and if so, where the image should be placed relative to the text.
+Valid values for this option are \fBbottom\fR, \fBcenter\fR,
+\fBleft\fR, \fBnone\fR, \fBright\fR and \fBtop\fR. The default value
+is \fBnone\fR, meaning that the button will display either an image or
+text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR
+options.
+.VE
.OP \-default default Default
.VS
Specifies one of three states for the default ring: \fBnormal\fR,
@@ -49,6 +62,15 @@ screen units (i.e. any of the forms acceptable to \fBTk_GetPixels\fR);
for text it is in lines of text.
If this option isn't specified, the button's desired height is computed
from the size of the image or bitmap or text being displayed in it.
+.VS 8.4
+.OP \-overrelief overRelief OverRelief
+Specifies an alternative relief for the button, to be used when the
+mouse cursor is over the widget. This option can be used to make
+toolbar buttons, by configuring \fB\-relief flat \-overrelief
+raised\fR. If the value of this option is the empty string, then no
+alternative relief is used when the mouse cursor is over the button.
+The empty string is the default value.
+.VE 8.4
.OP \-state state State
Specifies one of three states for the button: \fBnormal\fR, \fBactive\fR,
or \fBdisabled\fR. In normal state the button is displayed using the
@@ -174,4 +196,3 @@ individual widgets or by redefining the class bindings.
.SH KEYWORDS
button, widget
-
diff --git a/tk/doc/canvas.n b/tk/doc/canvas.n
index b4c7d90c6d1..b67622799a2 100644
--- a/tk/doc/canvas.n
+++ b/tk/doc/canvas.n
@@ -17,11 +17,13 @@ canvas \- Create and manipulate canvas widgets
.SH SYNOPSIS
\fBcanvas\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-background \-highlightthickness \-insertwidth \-relief
-\-borderwidth \-insertbackground \-state
-\-cursor \-insertborderwidth \-selectbackground \-takefocus
-\-highlightbackground \-insertofftime \-selectborderwidth \-xscrollcommand
-\-highlightcolor \-insertontime \-selectforeground \-yscrollcommand
+\-background \-insertborderwidth \-selectborderwidth
+\-borderwidth \-insertofftime \-selectforeground
+\-cursor \-insertontime \-takefocus
+\-highlightbackground \-insertwidth \-xscrollcommand
+\-highlightcolor \-relief \-yscrollcommand
+\-highlightthickness \-state
+\-insertbackground \-selectbackground
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-closeenough closeEnough CloseEnough
@@ -167,7 +169,7 @@ item or a tag that selects zero or more items.
tags by using operators: '&&', '||', '^' '!', and parenthezised
subexpressions. For example:
.CS
- .c find withtag {(a&&!b)|(!a&&b)}
+ .c find withtag {(a&&!b)||(!a&&b)}
.CE
or equivalently:
.CS
@@ -196,6 +198,11 @@ the screen; if it is \fBc\fR then the distance is in centimeters;
\fBi\fR means inches, and \fBp\fR means printers points (1/72 inch).
Larger y-coordinates refer to points lower on the screen; larger
x-coordinates refer to points farther to the right.
+.VS
+Coordinates can be specified either as an even number of parameters,
+or as a single list parameter containing an even number of x and y
+coordinate values.
+.VE
.SH TRANSFORMATIONS
.PP
@@ -283,7 +290,7 @@ are drawn transparant.
The second possible syntax is a character list containing only
5 possible characters \fB[.,-_ ]\fR. The space can be used
to enlarge the space between other line elements, and can not
-occur as the first posibion in the string. Some examples:
+occur as the first position in the string. Some examples:
-dash . = -dash {2 4}
-dash - = -dash {6 4}
-dash -. = -dash {6 4 2 4}
@@ -297,11 +304,11 @@ list will be multiplied by the line width before display. This
assures that "." will always be displayed as a dot and "-"
always as a dash regardless of the line width.
.PP
-On systems where only a limited set of dash patterns, the dash
-pattern will be displayed as the most close dash pattern that
-is available. For example, on Windows only the first 4 of the
-above examples are available. The last 2 examples will be
-displayed identically as the first one.
+On systems which support only a limited set of dash patterns, the dash
+pattern will be displayed as the closest dash pattern that is available.
+For example, on Windows only the first 4 of the above examples are
+available. The last 2 examples will be displayed identically to the first
+one.
.SH "WIDGET COMMAND"
.PP
@@ -485,6 +492,8 @@ this case the command returns an empty string.
command.
.TP
\fIpathName\fR \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR?
+.TP
+\fIpathName\fR \fBcoords \fItagOrId \fR?\fIcoordList\fR?
Query or modify the coordinates that define an item.
If no coordinates are specified, this command returns a list
whose elements are the coordinates of the item named by
@@ -495,6 +504,8 @@ If \fItagOrId\fR refers to multiple items, then
the first one in the display list is used.
.TP
\fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR?
+.TP
+\fIpathName \fBcreate \fItype coordList \fR?\fIoption value ...\fR?
Create a new item in \fIpathName\fR of type \fItype\fR.
The exact format of the arguments after \fBtype\fR depends
on \fBtype\fR, but usually they consist of the coordinates for
@@ -1023,15 +1034,17 @@ explained here, and then referred to be each widget type for brevity.
\fB\-activedash \fIpattern\fR
.TP
\fB\-disableddash \fIpattern\fR
-This option specifies dash patterns for the normal state, the active
-state, and the disabled state of an arc item.
+This option specifies dash patterns for the normal, active
+state, and disabled state of an item.
\fIpattern\fR may have any of the forms accepted by \fBTk_GetDash\fR.
If the dash options are omitted then the default is a solid outline.
See "DASH PATTERNS" for more information.
.TP
\fB\-dashoffset \fIoffset\fR
-The starting \fIoffset\fR into the pattern provided by the \fB\-dash\fR option.
-\fB\-dashoffset\fR is ignored if there is no \fB-dash\fR pattern.
+The starting \fIoffset\fR in pixels into the pattern provided by the
+\fB\-dash\fR option. \fB\-dashoffset\fR is ignored if there is no
+\fB-dash\fR pattern. The \fIoffset\fR may have any of the forms described
+in the COORDINATES section above.
.TP
\fB\-fill \fIcolor\fR
.TP
@@ -1064,7 +1077,7 @@ Specifies the offset of stipples. The offset value can be of the form
first case the origin is the origin of the toplevel of the current window.
For the canvas itself and canvas objects the origin is the canvas origin,
but putting \fB#\fR in front of the coordinate pair indicates using the
-toplevel origin in stead. For canvas objects, the \fB-offset\fR option is
+toplevel origin instead. For canvas objects, the \fB-offset\fR option is
used for stippling as well. For the line and polygon canvas items you can
also specify an index as argument, which connects the stipple origin to one
of the coordinate points of the line/polygon.
@@ -1132,8 +1145,9 @@ one of several ways (specified by the \fB\-style\fR option).
Arcs are created with widget commands of the following form:
.CS
\fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate arc \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
+The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR give
the coordinates of two diagonally opposite corners of a
rectangular region enclosing the oval that defines the arc.
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
@@ -1202,8 +1216,9 @@ two colors, foreground and background.
Bitmaps are created with widget commands of the following form:
.CS
\fIpathName \fBcreate bitmap \fIx y \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate bitmap \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx\fR and \fIy\fR specify the coordinates of a
+The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a
point used to position the bitmap on the display (see the \fB\-anchor\fR
option below for more information on how bitmaps are displayed).
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
@@ -1266,8 +1281,9 @@ canvas.
Images are created with widget commands of the following form:
.CS
\fIpathName \fBcreate image \fIx y \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate image \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx\fR and \fIy\fR specify the coordinates of a
+The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a
point used to position the image on the display (see the \fB\-anchor\fR
option below for more information).
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
@@ -1311,8 +1327,9 @@ widget commands: \fBdchars, index, insert.\fR
Lines are created with widget commands of the following form:
.CS
\fIpathName \fBcreate line \fIx1 y1... xn yn \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate line \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx1\fR through \fIyn\fR give
+The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR give
the coordinates for a series of two or more points that describe
a series of connected line segments.
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
@@ -1380,8 +1397,12 @@ If this option isn't specified then it defaults to \fBmiter\fR.
If the line only contains two points then this option is
irrelevant.
.TP
-\fB\-smooth \fIboolean\fR
-\fIBoolean\fR must have one of the forms accepted by \fBTk_GetBoolean\fR.
+\fB\-smooth \fIsmoothMethod\fR
+\fIsmoothMethod\fR must have one of the forms accepted by
+\fBTk_GetBoolean\fR or a line smoothing method. Only \fBbezier\fR is
+supported in the core, but more can be added at runtime. If a boolean
+false value or empty string is given, no smoothing is applied. A boolean
+truth value assume \fBbezier\fR smoothing.
It indicates whether or not the line should be drawn as a curve.
If so, the line is rendered as a set of parabolic splines: one spline
is drawn for the first and second line segments, one for the second
@@ -1401,8 +1422,9 @@ both. Ovals are created with widget commands of the
following form:
.CS
\fIpathName \fBcreate oval \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate oval \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
+The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR give
the coordinates of two diagonally opposite corners of a
rectangular region enclosing the oval.
The oval will include the top and left edges of the rectangle
@@ -1450,8 +1472,9 @@ widget commands: \fBdchars, index, insert.\fR
Polygons are created with widget commands of the following form:
.CS
\fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate polygon \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx1\fR through \fIyn\fR specify the coordinates for
+The arguments \fIx1\fR through \fIyn\fR or \fIcoordList\fR specify the coordinates for
three or more points that define a polygon.
The first point should not be repeated as the last to
close the shape; Tk will automatically close the periphery between
@@ -1528,8 +1551,9 @@ both. Rectangles are created with widget commands of the
following form:
.CS
\fIpathName \fBcreate rectangle \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate rectangle \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
+The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR or \fIcoordList\fR give
the coordinates of two diagonally opposite corners of the rectangle
(the rectangle will include its upper and left edges but not
its lower or right edges).
@@ -1577,8 +1601,9 @@ Text items are created with widget commands of the following
form:
.CS
\fIpathName \fBcreate text \fIx y \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate text \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx\fR and \fIy\fR specify the coordinates of a
+The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a
point used to position the text on the display (see the options
below for more information on how text is displayed).
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
@@ -1612,7 +1637,7 @@ This option defaults to \fBcenter\fR.
.TP
\fB\-font \fIfontName\fR
Specifies the font to use for the text item.
-\fIFontName\fR may be any string acceptable to \fBTk_GetFontStruct\fR.
+\fIFontName\fR may be any string acceptable to \fBTk_GetFont\fR.
If this option isn't specified, it defaults to a system-dependent
font.
.TP
@@ -1649,8 +1674,9 @@ at a given position on the canvas.
Window items are created with widget commands of the following form:
.CS
\fIpathName \fBcreate window \fIx y \fR?\fIoption value option value ...\fR?
+\fIpathName \fBcreate window \fIcoordList\fR ?\fIoption value option value ...\fR?
.CE
-The arguments \fIx\fR and \fIy\fR specify the coordinates of a
+The arguments \fIx\fR and \fIy\fR or \fIcoordList\fR specify the coordinates of a
point used to position the window on the display (see the \fB\-anchor\fR
option below for more information on how bitmaps are displayed).
After the coordinates there may be any number of \fIoption\fR\-\fIvalue\fR
@@ -1722,4 +1748,3 @@ functions of canvases.
.SH KEYWORDS
canvas, widget
-
diff --git a/tk/doc/checkbutton.n b/tk/doc/checkbutton.n
index 4e8a2c01319..15e457f47c1 100644
--- a/tk/doc/checkbutton.n
+++ b/tk/doc/checkbutton.n
@@ -16,12 +16,14 @@ checkbutton \- Create and manipulate checkbutton widgets
.SH SYNOPSIS
\fBcheckbutton\fI pathName \fR?\fIoptions\fR?
.SO
-\-activebackground \-cursor \-highlightthickness \-takefocus
-\-activeforeground \-disabledforeground \-image \-text
-\-anchor \-font \-justify \-textvariable
-\-background \-foreground \-padx \-underline
-\-bitmap \-highlightbackground \-pady \-wraplength
-\-borderwidth \-highlightcolor \-relief
+\-activebackground \-font \-pady
+\-activeforeground \-foreground \-relief
+\-anchor \-highlightbackground \-takefocus
+\-background \-highlightcolor \-text
+\-bitmap \-highlightthickness \-textvariable
+\-borderwidth \-image \-underline
+\-cursor \-justify \-wraplength
+\-disabledforeground \-padx
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-command command Command
@@ -41,12 +43,32 @@ Specifies whether or not the indicator should be drawn. Must be a
proper boolean value. If false, the \fBrelief\fR option is
ignored and the widget's relief is always sunken if the widget is
selected and raised otherwise.
+.VS 8.4
+.OP \-offrelief offRelief OffRelief
+Specifies the relief for the checkbutton when the indicator is not drawn and
+the checkbutton is off. The default value is "raised". By setting this option
+to "flat" and setting -indicatoron to false and -overrelief to raised,
+the effect is achieved
+of having a flat button that raises on mouse-over and which is
+depressed when activated. This is the behavior typically exhibited by
+the Bold, Italic, and Underline checkbuttons on the toolbar of a
+word-processor, for example.
+.VE 8.4
.OP \-offvalue offValue Value
Specifies value to store in the button's associated variable whenever
this button is deselected. Defaults to ``0''.
.OP \-onvalue onValue Value
Specifies value to store in the button's associated variable whenever
this button is selected. Defaults to ``1''.
+.VS 8.4
+.OP \-overrelief overRelief OverRelief
+Specifies an alternative relief for the checkbutton, to be used when the
+mouse cursor is over the widget. This option can be used to make
+toolbar buttons, by configuring \fB\-relief flat \-overrelief
+raised\fR. If the value of this option is the empty string, then no
+alternative relief is used when the mouse cursor is over the checkbutton.
+The empty string is the default value.
+.VE 8.4
.OP \-selectcolor selectColor Background
Specifies a background color to use when the button is selected.
If \fBindicatorOn\fR is true then the color applies to the indicator.
@@ -236,4 +258,3 @@ individual widgets or by redefining the class bindings.
.SH KEYWORDS
checkbutton, widget
-
diff --git a/tk/doc/chooseColor.n b/tk/doc/chooseColor.n
index 6936030f169..18b5feffe2f 100644
--- a/tk/doc/chooseColor.n
+++ b/tk/doc/chooseColor.n
@@ -47,4 +47,3 @@ button .b \-fg [tk_chooseColor \-initialcolor gray \-title "Choose color"]
.SH KEYWORDS
color selection dialog
-
diff --git a/tk/doc/chooseDirectory.n b/tk/doc/chooseDirectory.n
index 0322b294ba8..17edd7e5cc3 100644
--- a/tk/doc/chooseDirectory.n
+++ b/tk/doc/chooseDirectory.n
@@ -50,4 +50,3 @@ tk_getOpenFile, tk_getSaveFile
.SH KEYWORDS
directory selection dialog
-
diff --git a/tk/doc/clipboard.n b/tk/doc/clipboard.n
index 76a28d647fc..0825cf8c0ff 100644
--- a/tk/doc/clipboard.n
+++ b/tk/doc/clipboard.n
@@ -8,7 +8,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH clipboard n 4.0 Tk "Tk Built-In Commands"
+.TH clipboard n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -20,7 +20,8 @@ clipboard \- Manipulate Tk clipboard
.SH DESCRIPTION
.PP
This command provides a Tcl interface to the Tk clipboard,
-which stores data for later retrieval using the selection mechanism.
+which stores data for later retrieval using the selection mechanism
+(via the \fB-selection CLIPBOARD\fR option).
In order to copy data into the clipboard, \fBclipboard clear\fR must
be called, followed by a sequence of one or more calls to \fBclipboard
append\fR. To ensure that the clipboard is updated atomically, all
@@ -76,7 +77,18 @@ next argument will always be used as \fIdata\fR.
This feature may be convenient if, for example, \fIdata\fR starts
with a \fB\-\fR.
.RE
+.TP
+.VS 8.4
+\fBclipboard get\fR ?\fB\-displayof\fR \fIwindow\fR? ?\fB\-type\fR?
+Retrieve data from the clipboard on \fIwindow\fR's display.
+\fIwindow\fR defaults to ".". \fIType\fR specifies the form in which
+the data is to be returned and should be an atom name such as STRING
+or FILE_NAME. \fIType\fR defaults to STRING. This command is
+equivalent to \fBselection get -selection CLIPBOARD\fR.
+.VE 8.4
+
+.SH "SEE ALSO"
+selection
.SH KEYWORDS
clear, format, clipboard, append, selection, type
-
diff --git a/tk/doc/colors.n b/tk/doc/colors.n
index 8b304fac72b..239de5bcd02 100644
--- a/tk/doc/colors.n
+++ b/tk/doc/colors.n
@@ -45,12 +45,12 @@ bisque4 139 125 125
black 0 0 0
blanched almond 255 235 235
BlanchedAlmond 255 235 235
-blue 0 0 0
+blue 0 0 255
blue violet 138 43 43
-blue1 0 0 0
-blue2 0 0 0
-blue3 0 0 0
-blue4 0 0 0
+blue1 0 0 255
+blue2 0 0 238
+blue3 0 0 205
+blue4 0 0 139
BlueViolet 138 43 43
brown 165 42 42
brown1 255 64 64
@@ -95,7 +95,7 @@ cyan1 0 255 255
cyan2 0 238 238
cyan3 0 205 205
cyan4 0 139 139
-dark blue 0 0 0
+dark blue 0 0 139
dark cyan 0 139 139
dark goldenrod 184 134 134
dark gray 169 169 169
@@ -114,7 +114,7 @@ dark slate gray 47 79 79
dark slate grey 47 79 79
dark turquoise 0 206 206
dark violet 148 0 0
-DarkBlue 0 0 0
+DarkBlue 0 0 139
DarkCyan 0 139 139
DarkGoldenrod 184 134 134
DarkGoldenrod1 255 185 185
@@ -538,7 +538,7 @@ maroon2 238 48 48
maroon3 205 41 41
maroon4 139 28 28
medium aquamarine 102 205 205
-medium blue 0 0 0
+medium blue 0 0 205
medium orchid 186 85 85
medium purple 147 112 112
medium sea green 60 179 179
@@ -547,7 +547,7 @@ medium spring green 0 250 250
medium turquoise 72 209 209
medium violet red 199 21 21
MediumAquamarine 102 205 205
-MediumBlue 0 0 0
+MediumBlue 0 0 205
MediumOrchid 186 85 85
MediumOrchid1 224 102 102
MediumOrchid2 209 95 95
@@ -580,9 +580,9 @@ NavajoWhite1 255 222 222
NavajoWhite2 238 207 207
NavajoWhite3 205 179 179
NavajoWhite4 139 121 121
-navy 0 0 0
-navy blue 0 0 0
-NavyBlue 0 0 0
+navy 0 0 128
+navy blue 0 0 128
+NavyBlue 0 0 128
old lace 253 245 245
OldLace 253 245 245
olive drab 107 142 142
diff --git a/tk/doc/console.n b/tk/doc/console.n
new file mode 100644
index 00000000000..8b80e4bb52f
--- /dev/null
+++ b/tk/doc/console.n
@@ -0,0 +1,142 @@
+'\"
+'\" Copyright (c) 2001 Donal K. Fellows
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" RCS: @(#) $Id$
+'\"
+.so man.macros
+.TH console n 8.4 Tk "Tk Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+console \- Control the console on systems without a real console
+.SH SYNOPSIS
+\fBconsole title \fR?\fIstring\fR?
+.sp
+\fBconsole hide\fR
+.sp
+\fBconsole show\fR
+.sp
+\fBconsole eval \fIscript\fR
+.BE
+
+.SH DESCRIPTION
+.PP
+The console window is a replacement for a real console to allow input
+and output on the standard I/O channels on platforms that do not have
+a real console. It is implemented as a separate interpreter with the
+Tk toolkit loaded, and control over this interpreter is given through
+the \fBconsole\fR command. The behaviour of the console window is
+defined mainly through the contents of the \fIconsole.tcl\fR file in
+the Tk library (or the \fIConsole\fR resource on Macintosh systems.)
+.PP
+.TP
+\fBconsole eval \fIscript\fR
+Evaluate the \fIscript\fR argument as a Tcl script in the console
+interpreter. The normal interpreter is accessed through the
+\fBconsoleinterp\fR command in the console interpreter.
+.TP
+\fBconsole hide\fR
+Hide the console window from view. Precisely equivalent to
+withdrawing the \fB.\fR window in the console interpreter.
+.TP
+\fBconsole show\fR
+Display the console window. Precisely equivalent to deiconifying the
+\fB.\fR window in the console interpreter.
+.TP
+\fBconsole title \fR?\fIstring\fR?
+Query or modify the title of the console window. If \fIstring\fR is
+not specified, queries the title of the console window, and sets the
+title of the console window to \fIstring\fR otherwise. Precisely
+equivalent to using the \fBwm title\fR command in the console
+interpreter.
+
+.SH "ACCESS TO THE MAIN INTERPRETER"
+.PP
+The \fBconsoleinterp\fR command in the console interpreter allows
+scripts to be evaluated in the main interpreter. It supports two
+subcommands: \fBeval\fR and \fBrecord\fR.
+.PP
+.TP
+\fBconsoleinterp eval \fIscript\fR
+Evaluates \fIscript\fR as a Tcl script at the global level in the main
+interpreter.
+.TP
+\fBconsoleinterp record \fIscript\fR
+Records and evaluates \fIscript\fR as a Tcl script at the global level
+in the main interpreter as if \fIscript\fR had been typed in at the
+console.
+
+.SH "ADDITIONAL TRAP CALLS"
+.PP
+There are several additional commands in the console interpreter that
+are called in response to activity in the main interpreter.
+\fIThese are documented here for completeness only; they form part of
+the internal implementation of the console and are likely to change or
+be modified without warning.\fR
+.PP
+Output to the console from the main interpreter via the stdout and
+stderr channels is handled by invoking the \fBtk::ConsoleOutput\fR
+command in the console interpreter with two arguments. The first
+argument is the name of the channel being written to, and the second
+argument is the string being written to the channel (after encoding
+and end-of-line translation processing has been performed.)
+.PP
+When the \fB.\fR window of the main interpreter is destroyed, the
+\fBtk::ConsoleExit\fR command in the console interpreter is called
+(assuming the console interpreter has not already been deleted itself,
+that is.)
+
+.SH "DEFAULT BINDINGS"
+.PP
+The default script creates a console window (implemented using a text
+widget) that has the following behaviour:
+.IP [1]
+Pressing the tab key inserts a TAB character (as defined by the Tcl
+\et escape.)
+.IP [2]
+Pressing the return key causes the current line (if complete by the
+rules of \fBinfo complete\fR) to be passed to the main interpreter for
+evaluation.
+.IP [3]
+Pressing the delete key deletes the selected text (if any text is
+selected) or the character to the right of the cursor (if not at the
+end of the line.)
+.IP [4]
+Pressing the backspace key deletes the selected text (if any text is
+selected) or the character to the left of the cursor (of not at the
+start of the line.)
+.IP [5]
+Pressing either Control+A or the home key causes the cursor to go to
+the start of the line (but after the prompt, if a prompt is present on
+the line.)
+.IP [6]
+Pressing either Control+E or the end key causes the cursor to go to
+the end of the line.
+.IP [7]
+Pressing either Control+P or the up key causes the previous entry in
+the command history to be selected.
+.IP [8]
+Pressing either Control+N or the down key causes the next entry in the
+command history to be selected.
+.IP [9]
+Pressing either Control+B or the left key causes the cursor to move
+one character backward as long as the cursor is not at the prompt.
+.IP [10]
+Pressing either Control+F or the right key causes the cursor to move
+one character forward.
+.IP [11]
+Pressing F9 rebuilds the console window by destroying all its children
+and reloading the Tcl script that defined the console's behaviour.
+.PP
+Most other behaviour is the same as a conventional text widget except
+for the way that the \fI<<Cut>>\fR event is handled identically to the
+\fI<<Copy>>\fR event.
+
+.SH KEYWORDS
+console, interpreter, window, interactive, output channels
+
+.SH "SEE ALSO"
+destroy(n), fconfigure(n), history(n), interp(n), puts(n), text(n), wm(n)
diff --git a/tk/doc/destroy.n b/tk/doc/destroy.n
index 11c3cf8e70f..f144ad86ebd 100644
--- a/tk/doc/destroy.n
+++ b/tk/doc/destroy.n
@@ -32,4 +32,3 @@ No error is returned if \fIwindow\fR does not exist.
.SH KEYWORDS
application, destroy, window
-
diff --git a/tk/doc/dialog.n b/tk/doc/dialog.n
index 17665d21f30..bd30e197b14 100644
--- a/tk/doc/dialog.n
+++ b/tk/doc/dialog.n
@@ -63,4 +63,3 @@ in any way except to invoke the dialog box.
.SH KEYWORDS
bitmap, dialog, modal
-
diff --git a/tk/doc/entry.n b/tk/doc/entry.n
index a62e551fc49..a00fb6c2fb2 100644
--- a/tk/doc/entry.n
+++ b/tk/doc/entry.n
@@ -17,14 +17,24 @@ entry \- Create and manipulate entry widgets
.SH SYNOPSIS
\fBentry\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-background \-highlightbackground \-insertontime \-selectforeground
-\-borderwidth \-highlightcolor \-insertwidth \-takefocus
-\-cursor \-highlightthickness \-justify \-textvariable
-\-exportselection \-insertbackground \-relief \-xscrollcommand
-\-font \-insertborderwidth \-selectbackground
-\-foreground \-insertofftime \-selectborderwidth
+\-background \-highlightthickness \-selectbackground
+\-borderwidth \-insertbackground \-selectborderwidth
+\-cursor \-insertborderwidth \-selectforeground
+\-exportselection \-insertofftime \-takefocus
+\-font \-insertontime \-textvariable
+\-foreground \-insertwidth \-xscrollcommand
+\-highlightbackground \-justify
+\-highlightcolor \-relief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
+.VS 8.4
+.OP \-disabledbackground disabledBackground DisabledBackground
+Specifies the background color to use when the entry is disabled. If
+this option is the empty string, the normal background color is used.
+.OP \-disabledforeground disabledForeground DisabledForeground
+Specifies the foreground color to use when the entry is disabled. If
+this option is the empty string, the normal foreground color is used.
+.VE 8.4
.VS 8.3
.OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
Specifies a script to eval when \fBvalidateCommand\fR returns 0.
@@ -32,6 +42,11 @@ Setting it to {} disables this feature (the default). The best use
of this option is to set it to \fIbell\fR. See \fBValidation\fR
below for more information.
.VE
+.VS 8.4
+.OP \-readonlybackground readonlyBackground ReadonlyBackground
+Specifies the background color to use when the entry is readonly. If
+this option is the empty string, the normal background color is used.
+.VE
.OP \-show show Show
If this option is specified, then the true contents of the entry
are not displayed in the window.
@@ -42,11 +57,18 @@ a password.
If characters in the entry are selected and copied elsewhere, the
information copied will be what is displayed, not the true contents
of the entry.
+.VS 8.4
.OP \-state state State
-Specifies one of two states for the entry: \fBnormal\fR or \fBdisabled\fR.
-If the entry is disabled then the value may not be changed using widget
-commands and no insertion cursor will be displayed, even if the input focus is
-in the widget.
+Specifies one of three states for the entry: \fBnormal\fR,
+\fBdisabled\fR, or \fBreadonly\fR. If the entry is readonly, then the
+value may not be changed using widget commands and no insertion cursor
+will be displayed, even if the input focus is in the widget; the
+contents of the widget may still be selected. If the entry is
+disabled, the value may not be changed, no insertion cursor will be
+displayed, the contents will not be selectable, and the entry may
+be displayed in a different color, depending on the values of the
+\fB-disabledforeground\fR and \fB-disabledbackground\fR options.
+.VE 8.4
.VS 8.3
.OP \-validate validate Validate
Specifies the mode in which validation should operate: \fBnone\fR,
@@ -123,7 +145,7 @@ loses focus.
.IP \fBall\fR 10
\fBvalidateCommand\fR will be called for all above conditions.
.PP
-It is posible to perform percent substitutions on the \fBvalidateCommand\fR
+It is possible to perform percent substitutions on the \fBvalidateCommand\fR
and \fBinvalidCommand\fR,
just as you would in a \fBbind\fR script. The following substitutions
are recognized:
@@ -513,12 +535,15 @@ the insertion cursor.
If the entry is disabled using the \fB\-state\fR option, then the entry's
view can still be adjusted and text in the entry can still be selected,
but no insertion cursor will be displayed and no text modifications will
-take place.
+take place
+.VS
+except if the entry is linked to a variable using the \fB\-textvariable\fR
+option, in which case any changes to the variable are reflected by the
+entry whatever the value of its \fB\-state\fR option.
+.VE
.PP
The behavior of entries can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.SH KEYWORDS
entry, widget
-
-
diff --git a/tk/doc/event.n b/tk/doc/event.n
index dc63b699126..1df47c4ada5 100644
--- a/tk/doc/event.n
+++ b/tk/doc/event.n
@@ -1,6 +1,6 @@
'\"
'\" Copyright (c) 1996 Sun Microsystems, Inc.
-'\" Copyright (c) 1998 by Scriptics Corporation.
+'\" Copyright (c) 1998-2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -68,7 +68,8 @@ EVENT FIELDS below. If the \fB\-when\fR option is not specified, the
event is processed immediately: all of the handlers for the event
will complete before the \fBevent generate\fR command returns.
If the \fB\-when\fR option is specified then it determines when the
-event is processed.
+event is processed. Certain events, such as key events, require
+that the window has focus to receive the event properly.
.TP
\fBevent info \fR?<<\fIvirtual\fB>>\fR?
Returns information about virtual events.
@@ -363,4 +364,3 @@ bind
.SH KEYWORDS
event, binding, define, handle, virtual event
-
diff --git a/tk/doc/focus.n b/tk/doc/focus.n
index 98015763b54..496563c943f 100644
--- a/tk/doc/focus.n
+++ b/tk/doc/focus.n
@@ -111,4 +111,3 @@ you use C code to query the X server directly.
.SH KEYWORDS
events, focus, keyboard, top-level, window manager
-
diff --git a/tk/doc/focusNext.n b/tk/doc/focusNext.n
index 34d4be22d3e..a98e0fc56ad 100644
--- a/tk/doc/focusNext.n
+++ b/tk/doc/focusNext.n
@@ -58,4 +58,3 @@ to write a script that deletes the bindings created by
.SH KEYWORDS
focus, keyboard traversal, top-level
-
diff --git a/tk/doc/font.n b/tk/doc/font.n
index 8da646a986b..e644ebeb13c 100644
--- a/tk/doc/font.n
+++ b/tk/doc/font.n
@@ -269,12 +269,14 @@ All valid X font names, including those listed by xlsfonts(1), are available.
.TP
MS Windows:
.DS
+.ta 3c 6c
\fBsystem ansi device
systemfixed ansifixed oemfixed\fR
.DE
.TP
Macintosh:
.DS
+.ta 3c 6c
\fBsystem application\fR
.DE
.RE
@@ -283,4 +285,3 @@ options
.SH KEYWORDS
font
-
diff --git a/tk/doc/frame.n b/tk/doc/frame.n
index fb15271f5ae..b2e88d472f0 100644
--- a/tk/doc/frame.n
+++ b/tk/doc/frame.n
@@ -9,7 +9,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH frame n 8.0 Tk "Tk Built-In Commands"
+.TH frame n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -17,8 +17,9 @@ frame \- Create and manipulate frame widgets
.SH SYNOPSIS
\fBframe\fR \fIpathName\fR ?\fIoptions\fR?
.SO
-\-borderwidth \-highlightbackground \-highlightthickness \-takefocus
-\-cursor \-highlightcolor \-relief
+\-borderwidth \-highlightcolor \-pady
+\-cursor \-highlightthickness \-relief
+\-highlightbackground \-padx \-takefocus
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-background background Background
@@ -45,7 +46,6 @@ If the \fBcolormap\fR option is not specified, the new window
uses the same colormap as its parent.
This option may not be changed with the \fBconfigure\fR
widget command.
-.VS "" br
.OP \-container container Container
The value must be a boolean. If true, it means that this window will
be used as a container in which some other application will be embedded
@@ -55,7 +55,6 @@ things like geometry requests. The window should not have any
children of its own in this application.
This option may not be changed with the \fBconfigure\fR
widget command.
-.VE
.OP \-height height Height
Specifies the desired height for the window in any of the forms
acceptable to \fBTk_GetPixels\fR.
@@ -130,6 +129,8 @@ command.
When a new frame is created, it has no default event bindings:
frames are not intended to be interactive.
+.SH "SEE ALSO"
+labelframe(n), toplevel(n)
+
.SH KEYWORDS
frame, widget
-
diff --git a/tk/doc/getOpenFile.n b/tk/doc/getOpenFile.n
index 88390e29fef..3c12dc1a7c5 100644
--- a/tk/doc/getOpenFile.n
+++ b/tk/doc/getOpenFile.n
@@ -12,8 +12,6 @@
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
tk_getOpenFile, tk_getSaveFile \- pop up a dialog box for the user to select a file to open or save.
-.PP
-.PP
.SH SYNOPSIS
\fBtk_getOpenFile \fR?\fIoption value ...\fR?
.br
@@ -44,7 +42,11 @@ Specifies a string that will be appended to the filename if the user
enters a filename without an extension. The defaut value is the empty
string, which means no extension will be appended to the filename in
any case. This option is ignored on the Macintosh platform, which
-does not require extensions to filenames.
+does not require extensions to filenames,
+.VS 8.4
+and the UNIX implementation guesses reasonable values for this from
+the \fB\-filetypes\fR option when this is not supplied.
+.VE 8.4
.TP
\fB\-filetypes\fR \fIfilePatternList\fR
If a \fBFile types\fR listbox exists in the file dialog on the particular
@@ -72,10 +74,10 @@ option is ignored on the Macintosh platform.
.TP
\fB\-multiple\fR
Allows the user to choose multiple files from the Open dialog.
-This is only available on the Macintosh, and only when Navigation
-Services are installed.
+On the Macintosh, this is only available when Navigation Services are
+installed.
.TP
-\fB\-message\fR
+\fB\-message\fR \fIstring\fR
Specifies a message to include in the client area of the dialog.
This is only available on the Macintosh, and only when Navigation
Services are installed.
diff --git a/tk/doc/grab.n b/tk/doc/grab.n
index e4038b94c8f..2d261d9c723 100644
--- a/tk/doc/grab.n
+++ b/tk/doc/grab.n
@@ -120,4 +120,3 @@ processes, this restriction doesn't exist.
.SH KEYWORDS
grab, keyboard events, pointer events, window
-
diff --git a/tk/doc/grid.n b/tk/doc/grid.n
index d4a8ac844dc..ee40d2169c9 100644
--- a/tk/doc/grid.n
+++ b/tk/doc/grid.n
@@ -7,7 +7,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH grid n 4.1 Tk "Tk Built-In Commands"
+.TH grid n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -25,9 +25,11 @@ The \fBgrid\fR command can have any of several forms, depending
on the \fIoption\fR argument:
.TP
\fBgrid \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR?
-If the first argument to \fBgrid\fR is a window name (any value
-starting with ``.''), then the command is processed in the same
-way as \fBgrid configure\fR.
+If the first argument to \fBgrid\fR is suitable as the first slave
+argument to \fBgrid configure\fR, either a window name (any value
+starting with \fB.\fP) or one of the characters \fBx\fP or \fB^\fP
+(see the ``RELATIVE PLACEMENT'' section below), then the command is
+processed in the same way as \fBgrid configure\fR.
.TP
\fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?
With no arguments,
@@ -44,11 +46,12 @@ indicated is returned.
\fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR?
Query or set the column properties of the \fIindex\fP column of the
geometry master, \fImaster\fP.
-The valid options are \fB\-minsize\fP, \fB\-weight\fP and \fB-pad\fP.
-.VS
+.VS 8.4
+The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
+and \fB-pad\fP.
+.VE
If one or more options are provided, then \fIindex\fP may be given as
a list of column indeces to which the configuration options will operate on.
-.VE
The \fB\-minsize\fP option sets the minimum size, in screen units,
that will be permitted for this column.
The \fB\-weight\fP option (an integer value)
@@ -58,6 +61,14 @@ columns.
A weight of zero (0) indicates the column will not deviate from its requested
size. A column whose weight is two will grow at twice the rate as a column
of weight one when extra space is allocated to the layout.
+.VS 8.4
+The \fB-uniform\fP option, when a non-empty value is supplied, places
+the column in a \fIuniform group\fP with other columns that have the
+same value for \fB-uniform\fP. The space for columns belonging to a
+uniform group is allocated so that their sizes are always in strict
+proportion to their \fB-weight\fP values. See
+``THE GRID ALGORITHM'' below for further details.
+.VE
The \fB-pad\fP option specifies the number of screen units that will be
added to the largest window contained completely in that column when the
grid geometry manager requests a size from the containing window.
@@ -113,12 +124,16 @@ The \fIamount\fR defaults to 0.
\fB\-padx \fIamount\fR
The \fIamount\fR specifies how much horizontal external padding to
leave on each side of the slave(s), in screen units.
+\fIAmount\fR may be a list
+of two values to specify padding for left and right separately.
The \fIamount\fR defaults to 0.
This space is added outside the slave(s) border.
.TP
\fB\-pady \fIamount\fR
The \fIamount\fR specifies how much vertical external padding to
leave on the top and bottom of the slave(s), in screen units.
+\fIAmount\fR may be a list
+of two values to specify padding for top and bottom separately.
The \fIamount\fR defaults to 0.
This space is added outside the slave(s) border.
.TP
@@ -189,11 +204,12 @@ Propagation is enabled by default.
\fBgrid rowconfigure \fImaster index \fR?\fI\-option value...\fR?
Query or set the row properties of the \fIindex\fP row of the
geometry master, \fImaster\fP.
-The valid options are \fB\-minsize\fP, \fB\-weight\fP and \fB-pad\fP.
-.VS
+.VS 8.4
+The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
+and \fB-pad\fP.
+.VE
If one or more options are provided, then \fIindex\fP may be given as
a list of row indeces to which the configuration options will operate on.
-.VE
The \fB\-minsize\fP option sets the minimum size, in screen units,
that will be permitted for this row.
The \fB\-weight\fP option (an integer value)
@@ -203,6 +219,14 @@ rows.
A weight of zero (0) indicates the row will not deviate from its requested
size. A row whose weight is two will grow at twice the rate as a row
of weight one when extra space is allocated to the layout.
+.VS 8.4
+The \fB-uniform\fP option, when a non-empty value is supplied, places
+the row in a \fIuniform group\fP with other rows that have the
+same value for \fB-uniform\fP. The space for rows belonging to a
+uniform group is allocated so that their sizes are always in strict
+proportion to their \fB-weight\fP values. See
+``THE GRID ALGORITHM'' below for further details.
+.VE
The \fB-pad\fP option specifies the number of screen units that will be
added to the largest window contained completely in that row when the
grid geometry manager requests a size from the containing window.
@@ -245,14 +269,15 @@ default values are chosen for
at the time the \fIslave\fP is managed. The values are chosen
based upon the current layout of the grid, the position of the \fIslave\fP
relative to other \fIslave\fPs in the same grid command, and the presence
-of the characters \fB\-\fP, \fB^\fP, and \fB^\fP in \fBgrid\fP
+of the characters \fB\-\fP, \fBx\fP, and \fB^\fP in \fBgrid\fP
command where \fIslave\fP names are normally expected.
.RS
.TP
\fB\-\fP
This increases the columnspan of the \fIslave\fP to the left. Several
\fB\-\fP's in a row will successively increase the columnspan. A \fB\-\fP
-may not follow a \fB^\fP or a \fBx\fP.
+may not follow a \fB^\fP or a \fBx\fP, nor may it be the first \fIslave\fP
+argument to \fBgrid configure\fR.
.TP
\fBx\fP
This leaves an empty column between the \fIslave\fP on the left and
@@ -279,14 +304,31 @@ To compute the minimum size of a layout, the grid geometry manager
first looks at all slaves whose columnspan and rowspan values are one,
and computes the nominal size of each row or column to be either the
\fIminsize\fP for that row or column, or the sum of the \fIpad\fPding
-plus the size of the largest slave, whichever is greater. Then the
-slaves whose rowspans or columnspans are greater than one are
+plus the size of the largest slave, whichever is greater. After that
+the rows or columns in each uniform group adapt to each other. Then
+the slaves whose rowspans or columnspans are greater than one are
examined. If a group of rows or columns need to be increased in size
in order to accommodate these slaves, then extra space is added to each
row or column in the group according to its \fIweight\fP. For each
group whose weights are all zero, the additional space is apportioned
equally.
.PP
+When multiple rows or columns belong to a uniform group, the space
+allocated to them is always in proportion to their weights. (A weight
+of zero is considered to be 1.) In other words, a row or column
+configured with \fB-weight 1 -uniform a\fP will have exactly the same
+size as any other row or column configured with \fB-weight 1 -uniform
+a\fP. A row or column configured with \fB-weight 2 -uniform b\fR will
+be exactly twice as large as one that is configured with \fB-weight 1
+-uniform b\fP.
+.PP
+More technically, each row or column in the group will have a size
+equal to \fIk*weight\fP for some constant \fIk\fP. The constant
+\fIk\fP is chosen so that no row or column becomes smaller than its
+minimum size. For example, if all rows or columns in a group have the
+same weight, then each row or column will have the same size as the
+largest row or column in the group.
+.PP
For masters whose size is larger than the requested layout, the additional
space is apportioned according to the row and column weights. If all of
the weights are zero, the layout is centered within its master.
@@ -335,4 +377,3 @@ geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry
manager, written by George Howlett.
.SH KEYWORDS
geometry manager, location, grid, cell, propagation, size, pack
-
diff --git a/tk/doc/image.n b/tk/doc/image.n
index e03cc849c02..7f26cbf94a0 100644
--- a/tk/doc/image.n
+++ b/tk/doc/image.n
@@ -37,6 +37,10 @@ type; see below for details on the options for built-in image types.
If an image already exists by the given name then it is replaced
with the new image and any instances of that image will redisplay
with the new contents.
+It is important to note that the image command will silently overwrite any
+procedure that may currently be defined by the given name, so choose the
+name wisely. It is recommended to use a separate namespace for image names
+(e.g., \fB::img::logo\fR, \fB::img::large\fR).
.TP
\fBimage delete \fR?\fIname name\fR ...?
Deletes each of the named images and returns an empty string.
@@ -54,6 +58,10 @@ the existing instances will use the new image.
Returns a decimal string giving the height of image \fIname\fR
in pixels.
.TP
+\fBimage inuse \fIname\fR
+Returns a boolean value indicating whether or not the image given by
+\fIname\fR is in use by any widgets.
+.TP
\fBimage names\fR
Returns a list containing the names of all existing images.
.TP
@@ -88,4 +96,3 @@ See the \fBphoto\fR manual entry for more information.
.SH KEYWORDS
height, image, types of images, width
-
diff --git a/tk/doc/label.n b/tk/doc/label.n
index 0410d82d848..274592d1e79 100644
--- a/tk/doc/label.n
+++ b/tk/doc/label.n
@@ -16,14 +16,14 @@ label \- Create and manipulate label widgets
.SH SYNOPSIS
\fBlabel\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-activebackground \-activeforeground \-anchor
-\-background \-bitmap \-borderwidth
-\-cursor \-disabledforeground \-font
-\-foreground \-highlightbackground \-highlightcolor
-\-highlightthickness \-image \-justify
-\-padx \-pady \-relief
-\-takefocus \-text \-textvariable
-\-underline \-wraplength
+\-activebackground \-font \-pady
+\-activeforeground \-foreground \-relief
+\-anchor \-highlightbackground \-takefocus
+\-background \-highlightcolor \-text
+\-bitmap \-highlightthickness \-textvariable
+\-borderwidth \-image \-underline
+\-cursor \-justify \-wraplength
+\-disabledforeground \-padx
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-height height Height
@@ -112,5 +112,3 @@ labels are not intended to be interactive.
.SH KEYWORDS
label, widget
-
-
diff --git a/tk/doc/labelframe.n b/tk/doc/labelframe.n
new file mode 100644
index 00000000000..29ac99c29c6
--- /dev/null
+++ b/tk/doc/labelframe.n
@@ -0,0 +1,147 @@
+'\"
+'\" Copyright (c) 1990-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.
+'\"
+'\"
+'\" RCS: @(#) $Id$
+'\"
+.so man.macros
+.TH labelframe n 8.4 Tk "Tk Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+labelframe \- Create and manipulate labelframe widgets
+.SH SYNOPSIS
+\fBlabelframe\fR \fIpathName\fR ?\fIoptions\fR?
+.SO
+\-borderwidth \-highlightbackground \-pady
+\-cursor \-highlightcolor \-relief
+\-font \-highlightthickness \-takefocus
+\-foreground \-padx \-text
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-background background Background
+This option is the same as the standard \fBbackground\fR option
+except that its value may also be specified as an empty string.
+In this case, the widget will display no background or border, and
+no colors will be consumed from its colormap for its background
+and border.
+.OP \-class class Class
+Specifies a class for the window.
+This class will be used when querying the option database for
+the window's other options, and it will also be used later for
+other purposes such as bindings.
+The \fBclass\fR option may not be changed with the \fBconfigure\fR
+widget command.
+.OP \-colormap colormap Colormap
+Specifies a colormap to use for the window.
+The value may be either \fBnew\fR, in which case a new colormap is
+created for the window and its children, or the name of another
+window (which must be on the same screen and have the same visual
+as \fIpathName\fR), in which case the new window will use the colormap
+from the specified window.
+If the \fBcolormap\fR option is not specified, the new window
+uses the same colormap as its parent.
+This option may not be changed with the \fBconfigure\fR
+widget command.
+.OP \-container container Container
+The value must be a boolean. If true, it means that this window will
+be used as a container in which some other application will be embedded
+(for example, a Tk toplevel can be embedded using the \fB\-use\fR option).
+The window will support the appropriate window manager protocols for
+things like geometry requests. The window should not have any
+children of its own in this application.
+This option may not be changed with the \fBconfigure\fR
+widget command.
+.OP \-height height Height
+Specifies the desired height for the window in any of the forms
+acceptable to \fBTk_GetPixels\fR.
+If this option is less than or equal to zero then the window will
+not request any size at all.
+.OP \-labelanchor labelAnchor LabelAnchor
+Specifies where to place the label. A label is only displayed if the
+\fB\-text\fR option is not the empty string.
+Valid values for this option are (listing them clockwise)
+\fBnw\fR, \fBn\fR, \fBne\fR, \fBen\fR, \fBe\fR, \fBes\fR,
+\fBse\fR, \fBs\fR,\fBsw\fR, \fBws\fR, \fBw\fR and \fBwn\fR.
+The default value is \fBnw\fR.
+.OP \-labelwidget labelWidget LabelWidget
+Specifies a widget to use as label. This overrides any \fB\-text\fR
+option. The widget must exist before being used as \fB\-labelwidget\fR
+and if it is not a descendant of this window, it will be raised
+above it in the stacking order.
+.OP \-visual visual Visual
+Specifies visual information for the new window in any of the
+forms accepted by \fBTk_GetVisual\fR.
+If this option is not specified, the new window will use the same
+visual as its parent.
+The \fBvisual\fR option may not be modified with the \fBconfigure\fR
+widget command.
+.OP \-width width Width
+Specifies the desired width for the window in any of the forms
+acceptable to \fBTk_GetPixels\fR.
+If this option is less than or equal to zero then the window will
+not request any size at all.
+.BE
+
+.SH DESCRIPTION
+.PP
+The \fBlabelframe\fR command creates a new window (given by the
+\fIpathName\fR argument) and makes it into a labelframe widget.
+Additional
+options, described above, may be specified on the command line
+or in the option database
+to configure aspects of the labelframe such as its background color
+and relief. The \fBlabelframe\fR command returns the
+path name of the new window.
+.PP
+A labelframe is a simple widget. Its primary purpose is to act as a
+spacer or container for complex window layouts. It has the features
+of a \fBframe\fR plus the ability to display a label.
+.SH "WIDGET COMMAND"
+.PP
+The \fBlabelframe\fR command creates a new Tcl command whose
+name is the same as the path name of the labelframe's window. This
+command may be used to invoke various
+operations on the widget. It has the following general form:
+.CS
+\fIpathName option \fR?\fIarg arg ...\fR?
+.CE
+\fIPathName\fR is the name of the command, which is the same as
+the labelframe widget's path name. \fIOption\fR and the \fIarg\fRs
+determine the exact behavior of the command. The following
+commands are possible for frame 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 \fBlabelframe\fR
+command.
+.TP
+\fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value 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 may have any of the values accepted by the \fBlabelframe\fR
+command.
+
+.SH BINDINGS
+.PP
+When a new labelframe is created, it has no default event bindings:
+labelframes are not intended to be interactive.
+
+.SH "SEE ALSO"
+frame(n), label(n)
+
+.SH KEYWORDS
+labelframe, widget
diff --git a/tk/doc/listbox.n b/tk/doc/listbox.n
index 424e8d473d9..ad86edf567c 100644
--- a/tk/doc/listbox.n
+++ b/tk/doc/listbox.n
@@ -8,7 +8,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH listbox n 8.0 Tk "Tk Built-In Commands"
+.TH listbox n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -16,29 +16,45 @@ listbox \- Create and manipulate listbox widgets
.SH SYNOPSIS
\fBlistbox\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-background \-foreground \-relief \-takefocus
-\-borderwidth \-height \-listvar \-selectbackground \-width
-\-cursor \-highlightbackground \-selectborderwidth \-xscrollcommand
-\-exportselection \-highlightcolor \-selectforeground \-yscrollcommand
-\-font \-highlightthickness \-setgrid
+\-activestyle \-height \-selectforeground
+\-background \-highlightbackground \-setgrid
+\-borderwidth \-highlightcolor \-state
+\-cursor \-highlightthickness \-takefocus
+\-disabledforeground \-relief \-width
+\-exportselection \-selectbackground \-xscrollcommand
+\-font \-selectborderwidth \-yscrollcommand
+\-foreground
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
+.VS 8.4
+.OP \-activestyle activeStyle ActiveStyle
+Specifies the style in which to draw the active element. This must be
+one of \fBdotbox\fR (show a focus ring around the active element),
+\fBnone\fR (nospecial indication of active element) or
+\fBunderline\fR (underline the active element).
+The default is \fBunderline\fR.
+.VS 8.4
.OP \-height height Height
Specifies the desired height for the window, in lines.
If zero or less, then the desired height for the window is made just
large enough to hold all the elements in the listbox.
-.OP \-listvar listVariable Variable
-Specifies the name of a variable. The value of the variable is a list
-to be displayed inside the widget; if the variable value changes
-then the widget will automatically update itself to reflect the new value.
-Attempts to assign a bad list value to a variable in use as a listvar
-will cause an error. Attempts to unset a variable in use as a listvar
-will fail but will not generate an error.
+.OP \-listvariable listVariable Variable
+Specifies the name of a variable. The value of the variable is a list to
+be displayed inside the widget; if the variable value changes then the
+widget will automatically update itself to reflect the new value. Attempts
+to assign a variable with an invalid list value to \fB\-listvariable\fR
+will cause an error. Attempts to unset a variable in use as a
+\fB\-listvariable\fR will fail but will not generate an error.
.OP \-selectmode selectMode SelectMode
Specifies one of several styles for manipulating the selection.
The value of the option may be arbitrary, but the default bindings
expect it to be either \fBsingle\fR, \fBbrowse\fR, \fBmultiple\fR,
or \fBextended\fR; the default value is \fBbrowse\fR.
+.OP \-state state State
+Specifies one of two states for the listbox: \fBnormal\fR or \fBdisabled\fR.
+If the listbox is disabled then items may not be inserted or deleted,
+items are drawn in the \fB-disabledforeground\fR color, and selection
+cannot be modified and is not shown (though selection information is retained).
.OP \-width width Width
Specifies the desired width for the window in characters.
If the font doesn't have a uniform width then the width of the
@@ -93,8 +109,8 @@ to the first element in the listbox.
.TP 12
\fBactive\fR
Indicates the element that has the location cursor. This element
-will be displayed with an underline when the listbox has the
-keyboard focus, and it is specified with the \fBactivate\fR
+will be displayed as specified by \fB\-activestyle\fR when the listbox
+has the keyboard focus, and it is specified with the \fBactivate\fR
widget command.
.TP 12
\fBanchor\fR
@@ -138,8 +154,8 @@ Sets the active element to the one indicated by \fIindex\fR.
If \fIindex\fR is outside the range of elements in the listbox
then the closest element is activated.
.VE
-The active element is drawn with an underline when the widget
-has the input focus, and its index may be retrieved with the
+The active element is drawn as specified by \fB\-activestyle\fR when the
+widget has the input focus, and its index may be retrieved with the
index \fBactive\fR.
.TP
\fIpathName \fBbbox\fR \fIindex\fR
@@ -538,4 +554,3 @@ individual widgets or by redefining the class bindings.
.SH KEYWORDS
listbox, widget
-
diff --git a/tk/doc/loadTk.n b/tk/doc/loadTk.n
index ef73f381937..4a1ca940b5d 100644
--- a/tk/doc/loadTk.n
+++ b/tk/doc/loadTk.n
@@ -29,20 +29,20 @@ The \fB::safe::loadTk\fR command initializes the required data structures
in the named safe interpreter and then loads Tk into it.
The command returns the name of the safe interpreter.
If \fB\-use\fR is specified, the window identified by the specified system
-dependent identifier \fIwindowId\fR is used to contain the \fB``.''\fR
+dependent identifier \fIwindowId\fR is used to contain the ``.''
window of the safe interpreter; it can be any valid id, eventually
referencing a window belonging to another application. As a convenience,
if the window you plan to use is a Tk Window of the application you
can use the window name (eg: \fB.x.y\fR) instead of its window Id
(\fB[winfo id .x.y]\fR).
When \fB\-use\fR is not specified,
-a new toplevel window is created for the \fB``.''\fR window of
+a new toplevel window is created for the ``.'' window of
the safe interpreter. On X11 if you want the embedded window
to use another display than the default one, specify it with
\fB\-display\fR.
See the \fBSECURITY ISSUES\fR section below for implementation details.
-.SH SECURITY ISSUES
+.SH "SECURITY ISSUES"
.PP
Please read the \fBsafe\fR manual page for Tcl to learn about the basic
security considerations for Safe Tcl.
@@ -74,4 +74,3 @@ safe(n), interp(n), library(n), load(n), package(n), source(n), unknown(n)
.SH KEYWORDS
alias, auto\-loading, auto_mkindex, load, master interpreter, safe
interpreter, slave interpreter, source
-
diff --git a/tk/doc/lower.n b/tk/doc/lower.n
index c2c81b4d276..8738c23e465 100644
--- a/tk/doc/lower.n
+++ b/tk/doc/lower.n
@@ -36,4 +36,3 @@ raise
.SH KEYWORDS
lower, obscure, stacking order
-
diff --git a/tk/doc/man.macros b/tk/doc/man.macros
index ae66ef928af..2f418cbae96 100644
--- a/tk/doc/man.macros
+++ b/tk/doc/man.macros
@@ -199,7 +199,7 @@
.SH "STANDARD OPTIONS"
.LP
.nf
-.ta 4c 8c 12c
+.ta 5.5c 11c
.ft B
..
'\" # SE - end of list of standard options
diff --git a/tk/doc/menu.n b/tk/doc/menu.n
index 07a169c461d..b14c6a050f1 100644
--- a/tk/doc/menu.n
+++ b/tk/doc/menu.n
@@ -12,13 +12,17 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-menu \- Create and manipulate menu widgets
+menu, tk_menuSetFocus \- Create and manipulate menu widgets
.SH SYNOPSIS
+.nf
\fBmenu\fR \fIpathName \fR?\fIoptions\fR?
+\fBtk_menuSetFocus\fR \fIpathName\fR
.SO
-\-activebackground \-background \-disabledforeground \-relief
-\-activeborderwidth \-borderwidth \-font \-takefocus
-\-activeforeground \-cursor \-foreground
+\-activebackground \-borderwidth \-foreground
+\-activeborderwidth \-cursor \-relief
+\-activeforeground \-disabledforeground \-takefocus
+\-background \-font
+
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.VS
@@ -423,6 +427,17 @@ menu.
Specifies a Tcl command to execute when the menu entry is invoked.
Not available for separator or tear-off entries.
.TP
+.VS 8.4
+\fB\-compound \fIvalue\fR
+Specifies whether the menu entry should display both an image and text,
+and if so, where the image should be placed relative to the text.
+Valid values for this option are \fBbottom\fR, \fBcenter\fR,
+\fBleft\fR, \fBnone\fR, \fBright\fR and \fBtop\fR. The default value
+is \fBnone\fR, meaning that the button will display either an image or
+text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR
+options.
+.VE
+.TP
\fB\-font \fIvalue\fR
Specifies the font to use when drawing the label or accelerator
string in this entry.
@@ -750,6 +765,12 @@ next menubutton to the right is posted.
Disabled menu entries are non-responsive: they don't activate and
they ignore mouse button presses and releases.
.PP
+.VS 8.4
+Several of the bindings make use of the command \fBtk_menuSetFocus\fR.
+It saves the current focus and sets the focus to its \fIpathName\fR
+argument, which is a menu widget.
+.VE
+.PP
The behavior of menus can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
@@ -761,5 +782,3 @@ entries.
.SH KEYWORDS
menu, widget
-
-
diff --git a/tk/doc/menubar.n b/tk/doc/menubar.n
index a58dcb3f3e1..59fc252860e 100644
--- a/tk/doc/menubar.n
+++ b/tk/doc/menubar.n
@@ -31,4 +31,3 @@ procedures will go away.
.SH KEYWORDS
keyboard traversal, menu, menu bar, post
-
diff --git a/tk/doc/menubutton.n b/tk/doc/menubutton.n
index aaf166e0511..c0cb46625ce 100644
--- a/tk/doc/menubutton.n
+++ b/tk/doc/menubutton.n
@@ -16,14 +16,24 @@ menubutton \- Create and manipulate menubutton widgets
.SH SYNOPSIS
\fBmenubutton\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-activebackground \-cursor \-highlightthickness \-takefocus
-\-activeforeground \-disabledforeground \-image \-text
-\-anchor \-font \-justify \-textvariable
-\-background \-foreground \-padx \-underline
-\-bitmap \-highlightbackground \-pady \-wraplength
-\-borderwidth \-highlightcolor \-relief
+\-activebackground \-font \-pady
+\-activeforeground \-foreground \-relief
+\-anchor \-highlightbackground \-takefocus
+\-background \-highlightcolor \-text
+\-bitmap \-highlightthickness \-textvariable
+\-borderwidth \-image \-underline
+\-cursor \-justify \-wraplength
+\-disabledforeground \-padx
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-compound compound Compound
+Specifies whether the menubutton should display both an image and text,
+and if so, where the image should be placed relative to the text.
+Valid values for this option are \fBbottom\fR, \fBcenter\fR,
+\fBleft\fR, \fBnone\fR, \fBright\fR and \fBtop\fR. The default value
+is \fBnone\fR, meaning that the menubutton will display either an image or
+text, depending on the values of the \fB\-image\fR and \fB\-bitmap\fR
+options.
.VS
.OP \-direction direction Height
Specifies where the menu is going to be popup up. \fBabove\fR tries to
@@ -191,4 +201,3 @@ individual widgets or by redefining the class bindings.
.SH KEYWORDS
menubutton, widget
-
diff --git a/tk/doc/message.n b/tk/doc/message.n
index 8f4280e4185..dedbf7e899e 100644
--- a/tk/doc/message.n
+++ b/tk/doc/message.n
@@ -16,10 +16,12 @@ message \- Create and manipulate message widgets
.SH SYNOPSIS
\fBmessage\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-anchor \-font \-highlightthickness \-takefocus
-\-background \-foreground \-padx \-text
-\-borderwidth \-highlightbackground \-pady \-textvariable
-\-cursor \-highlightcolor \-relief \-width
+\-anchor \-highlightbackground \-takefocus
+\-background \-highlightcolor \-text
+\-borderwidth \-highlightthickness \-textvariable
+\-cursor \-padx \-width
+\-font \-pady
+\-foreground \-relief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-aspect aspect Aspect
@@ -145,4 +147,3 @@ The most common result is that the line is justified wrong.
.SH KEYWORDS
message, widget
-
diff --git a/tk/doc/messageBox.n b/tk/doc/messageBox.n
index 4bebf4481bc..e06ee514548 100644
--- a/tk/doc/messageBox.n
+++ b/tk/doc/messageBox.n
@@ -30,9 +30,8 @@ The following option-value pairs are supported:
\fB\-default\fR \fIname\fR
\fIName\fR gives the symbolic name of the default button for
this message window ('ok', 'cancel', and so on). See \fB\-type\fR
-for a list of the symbolic names. If the message box has just one
-button it will automatically be made the default, otherwise if this
-option is not specified, there won't be any default button.
+for a list of the symbolic names. If this option is not specified,
+the first button in the dialog will be made the default.
.TP
\fB\-icon\fR \fIiconImage\fR
Specifies an icon to display. \fIIconImage\fR must be one of the
@@ -88,4 +87,3 @@ switch -- $answer {
.SH KEYWORDS
message box
-
diff --git a/tk/doc/option.n b/tk/doc/option.n
index 8e942a891f9..8f0dd6ad5de 100644
--- a/tk/doc/option.n
+++ b/tk/doc/option.n
@@ -89,4 +89,3 @@ levels other than the ones given above.
.SH KEYWORDS
database, option, priority, retrieve
-
diff --git a/tk/doc/optionMenu.n b/tk/doc/optionMenu.n
index 04f582bed09..9dd7147ed16 100644
--- a/tk/doc/optionMenu.n
+++ b/tk/doc/optionMenu.n
@@ -38,4 +38,3 @@ options or manipulate it in other ways.
.SH KEYWORDS
option menu
-
diff --git a/tk/doc/options.n b/tk/doc/options.n
index a556351e2a7..16e9a49eddd 100644
--- a/tk/doc/options.n
+++ b/tk/doc/options.n
@@ -108,6 +108,7 @@ requests when it has a selection. The default is usually for widgets
to export selections.
.OP \-font font Font
Specifies the font to use when drawing text inside the widget.
+The value may have any of the forms accepted by \fBTk_GetFont\fR.
.OP "\-foreground or \-fg" foreground Foreground
Specifies the normal foreground color to use when displaying the widget.
.OP \-highlightbackground highlightBackground HighlightBackground
@@ -325,6 +326,8 @@ scrollbars and is provided by widgets that support vertical scrolling.
See the description of \fBxScrollCommand\fR for details
on how this option is used.
+.SH "SEE ALSO"
+colors, cursors, font
+
.SH KEYWORDS
class, name, standard option, switch
-
diff --git a/tk/doc/pack-old.n b/tk/doc/pack-old.n
index d31e1825963..902fcc5970e 100644
--- a/tk/doc/pack-old.n
+++ b/tk/doc/pack-old.n
@@ -194,4 +194,3 @@ such that zero space would be leftover for \fBexpand\fR options.
.SH KEYWORDS
geometry manager, location, packer, parcel, size
-
diff --git a/tk/doc/pack.n b/tk/doc/pack.n
index ff00682ac7d..2ece2c92951 100644
--- a/tk/doc/pack.n
+++ b/tk/doc/pack.n
@@ -101,12 +101,14 @@ leave on each side of the slave(s).
.TP
\fB\-padx \fIamount\fR
\fIAmount\fR specifies how much horizontal external padding to
-leave on each side of the slave(s).
+leave on each side of the slave(s). \fIAmount\fR may be a list
+of two values to specify padding for left and right separately.
\fIAmount\fR defaults to 0.
.TP
\fB\-pady \fIamount\fR
\fIAmount\fR specifies how much vertical external padding to
-leave on each side of the slave(s).
+leave on each side of the slave(s). \fIAmount\fR may be a list
+of two values to specify padding for top and bottom separtely.
\fIAmount\fR defaults to 0.
.TP
\fB\-side \fIside\fR
@@ -264,4 +266,3 @@ the stacking order of either the master or the slave.
.SH KEYWORDS
geometry manager, location, packer, parcel, propagation, size
-
diff --git a/tk/doc/palette.n b/tk/doc/palette.n
index d340dd943d3..a0a3433e362 100644
--- a/tk/doc/palette.n
+++ b/tk/doc/palette.n
@@ -71,4 +71,3 @@ color scheme used in Tk 3.6 and earlier versions.
.SH KEYWORDS
bisque, color, palette
-
diff --git a/tk/doc/panedwindow.n b/tk/doc/panedwindow.n
new file mode 100644
index 00000000000..23edc37b2c5
--- /dev/null
+++ b/tk/doc/panedwindow.n
@@ -0,0 +1,246 @@
+'\"
+'\" Copyright (c) 1992 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.
+'\"
+'\" RCS: @(#) $Id$
+'\"
+.so man.macros
+.TH panedwindow n 8.4 Tk "Tk Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+panedwindow \- Create and manipulate panedwindow widgets
+.SH SYNOPSIS
+\fBpanedwindow\fR \fIpathName \fR?\fIoptions\fR?
+.SO
+\-background \-height \-width
+\-borderwidth \-orient
+\-cursor \-relief
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-handlepad handlePad HandlePad
+When sash handles are drawn, specifies the distance from the top or
+left end of the sash (depending on the orientation of the widget) at
+which to draw the handle. May be any value accepted by \fBTk_GetPixels\fR.
+.OP \-handlesize handleSize HandleSize
+Specifies the side length of a sash handle. Handles are always
+drawn as squares. May be any value accepted by \fBTk_GetPixels\fR.
+.OP \-opaqueresize opaqueResize OpaqueResize
+Specifies whether panes should be resized as a sash is moved (true),
+or if resizing should be deferred until the sash is placed (false).
+.OP \-sashcursor sashCursor SashCursor
+Mouse cursor to use when over a sash. If null,
+\fBsb_h_double_arrow\fR will be used for horizontal panedwindows, and
+\fBsb_v_double_arrow\fR will be used for vertical panedwindows.
+.OP \-sashpad sashPad SashPad
+Specifies the amount of padding to leave of each side of a sash. May
+be any value accepted by \fBTk_GetPixels\fR.
+.OP \-sashrelief sashRelief SashRelief
+Relief to use when drawing a sash. May be any of the standard Tk
+relief values.
+.OP \-sashwidth sashWidth SashWidth
+Specifies the width of each sash. May be any value accepted by
+\fBTk_GetPixels\fR.
+.OP \-showhandle showHandle ShowHandle
+Specifies whether sash handles should be shown. May be any valid Tcl
+boolean value.
+.BE
+
+.SH DESCRIPTION
+.PP
+The \fBpanedwindow\fR command creates a new window (given by the
+\fIpathName\fR argument) and makes it into a panedwindow widget.
+Additional options, described above, may be specified on the command
+line or in the option database to configure aspects of the panedwindow
+such as its default background color and relief. The
+\fBpanedwindow\fR command returns the path name of the new window.
+.PP
+A panedwindow widget contains any number of panes, arranged
+horizontally or vertically, according to the value of the
+\fB\-orient\fR option. Each pane contains one widget, and each pair of
+panes is separated by a moveable (via mouse movements) sash. Moving a
+sash causes the widgets on either side of the sash to be resized.
+
+.SH "WIDGET COMMAND"
+.PP
+The \fBpanedwindow\fR command creates a new Tcl command whose name is
+the same as the path name of the panedwindow's window. This command
+may be used to invoke various operations on the widget. It has the
+following general form:
+.CS
+\fIpathName option \fR?\fIarg arg ...\fR?
+.CE
+\fIPathName\fR is the name of the command, which is the same as
+the panedwindow widget's path name. \fIOption\fR and the \fIarg\fRs
+determine the exact behavior of the command. The following
+commands are possible for panedwindow widgets:
+.TP
+\fIpathName \fBadd \fIwindow ?window ...? ?option value ...?\fR
+Add one or more windows to the panedwindow, each in a separate pane.
+The arguments consist of the names of one or more windows
+followed by pairs of arguments that specify how to manage the windows.
+\fIOption\fR may have any of the values accepted by the
+\fBconfigure\fR subcommand.
+.TP
+\fIpathName \fBcget \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
+\fBpanedwindow\fR command.
+.TP
+\fIpathName \fBconfigure \fI?option? ?value 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 may have
+any of the values accepted by the \fBpanedwindow\fR command.
+.TP
+\fIpathName \fBforget \fIwindow ?window ...?\fR
+Remove the pane containing \fIwindow\fR from the panedwindow. All
+geometry management options for \fIwindow\fR will be forgotten.
+.TP
+\fIpathName \fBidentify \fIx y\fR
+Identify the panedwindow component underneath the point given by
+\fIx\fR and \fIy\fR, in window coordinates. If the point is over a
+sash or a sash handle, the result is a two element list containing the
+index of the sash or handle, and a word indicating whether it is over
+a sash or a handle, such as {0 sash} or {2 handle}. If the point is
+over any other part of the panedwindow, the result is an empty list.
+.TP
+\fIpathName \fBproxy \fI?args?\fR
+This command is used to query and change the position of the sash
+proxy, used for rubberband-style pane resizing. It can take any of
+the following forms:
+.RS
+.TP
+\fIpathName \fBproxy coord\fR
+Return a list containing the x and y coordinates of the most recent
+proxy location.
+.TP
+\fIpathname \fBproxy forget\fR
+Remove the proxy from the display.
+.TP
+\fIpathName \fBproxy place \fIx y\fR
+Place the proxy at the given \fIx\fR and \fIy\fR coordinates.
+.RE
+.TP
+\fIpathName \fBsash \fI?args?\fR
+This command is used to query and change the position of sashes in the
+panedwindow. It can take any of the following forms:
+.RS
+.TP
+\fIpathName \fBsash coord \fIindex\fR
+Return the current x and y coordinate pair for the sash given by
+\fIindex\fR. \fIIndex\fR must be an integer between 0 and 1 less than
+the number of panes in the panedwindow. The coordinates given are
+those of the top left corner of the region containing the sash.
+\fIpathName \fBsash dragto \fIindex x y\fR
+This command computes the difference between the given coordinates and the
+coordinates given to the last \fBsash coord\fR command for the given
+sash. It then moves that sash the computed difference. The return
+value is the empty string.
+.TP
+\fIpathName \fBsash mark \fIindex x y\fR
+Records \fIx\fR and \fIy\fR for the sash given by \fIindex\fR; used in
+conjunction with later dragto commands to move the sash.
+.TP
+\fIpathName \fBsash place \fIindex x y\fR
+Place the sash given by \fIindex\fR at the given coordinates.
+.RE
+.TP
+\fIpathName \fBpanecget \fIwindow option\fR
+Query a management option for \fIwindow\fR. \fIOption\fR may be any
+value allowed by the \fBpaneconfigure\fR subcommand.
+.TP
+\fIpathName \fBpaneconfigure \fIwindow ?option? ?value option value ...?\fR
+Query or modify the management options for \fIwindow\fR. 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. The following options
+are supported:
+.RS
+.TP
+\fB\-after \fIwindow\fR
+Insert the window after the window specified. \fIwindow\fR should be the
+name of a window already managed by \fIpathName\fR.
+.TP
+\fB\-before \fIwindow\fR
+Insert the window before the window specified. \fIwindow\fR should be
+the name of a window already managed by \fIpathName\fR.
+.TP
+\fB\-height \fIsize\fR
+Specify a height for the window. The height will be the outer
+dimension of the window including its border, if any. If \fIsize\fR
+is an empty string, or if \fB\-height\fR is not specified, then the
+height requested internally by the window will be used initially; the
+height may later be adjusted by the movement of sashes in the
+panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR.
+.TP
+\fB\-minsize \fIn\fR
+Specifies that the size of the window cannot be made less than
+\fIn\fR. This constraint only affects the size of the widget in the
+paned dimension -- the x dimension for horizontal panedwindows, the y
+dimension for vertical panedwindows. May be any value accepted by
+\fBTk_GetPixels\fR.
+.TP
+\fB\-padx \fIn\fR
+Specifies a non-negative value indicating how much extra space to
+leave on each side of the window in the X-direction. The value may
+have any of the forms accepted by \fBTk_GetPixels\fR.
+.TP
+\fB\-pady \fIn\fR
+Specifies a non-negative value indicating how much extra space to
+leave on each side of the window in the Y-direction. The value may
+have any of the forms accepted by \fBTk_GetPixels\fR.
+.TP
+\fB\-sticky \fIstyle\fR
+If a window's pane is larger than the requested dimensions of the
+window, this option may be used to position (or stretch) the window
+within its pane. \fIStyle\fR is a string that contains zero or more
+of the characters \fBn\fP, \fBs\fP, \fBe\fP or \fBw\fP. The string
+can optionally contains spaces or commas, but they are ignored. Each
+letter refers to a side (north, south, east, or west) that the window
+will "stick" to. If both \fBn\fP and \fBs\fP (or \fBe\fP and \fBw\fP)
+are specified, the window will be stretched to fill the entire height
+(or width) of its cavity.
+.TP
+\fB\-width \fIsize\fR
+Specify a width for the window. The width will be the outer
+dimension of the window including its border, if any. If \fIsize\fR
+is an empty string, or if \fB\-width\fR is not specified, then the
+width requested internally by the window will be used initially; the
+width may later be adjusted by the movement of sashes in the
+panedwindow. \fISize\fR may be any value accepted by \fBTk_GetPixels\fR.
+.RE
+.TP
+\fIpathName \fBpanes\fR
+Returns an ordered list of the widgets managed by \fIpathName\fR.
+
+.SH "RESIZING PANES"
+
+A pane is resized by grabbing the sash (or sash handle if present) and
+dragging with the mouse. This is accomplished via mouse motion
+bindings on the widget. When a sash is moved, the sizes of the panes
+on each side of the sash, and thus the widgets in those panes, are
+adjusted.
+.PP
+When a pane is resized from outside (eg, it is packed to expand and
+fill, and the containing toplevel is resized), space is added to the final
+(rightmost or bottommost) pane in the window.
+
+.SH KEYWORDS
+panedwindow, widget, geometry management
diff --git a/tk/doc/photo.n b/tk/doc/photo.n
index ddc491bd72a..e66d34e3eda 100644
--- a/tk/doc/photo.n
+++ b/tk/doc/photo.n
@@ -31,7 +31,11 @@ can be supplied from
C code through a procedural interface. At present, only GIF and PPM/PGM
formats are supported, but an interface exists to allow additional
image file formats to be added easily. A photo image is transparent
-in regions where no image data has been supplied.
+in regions where no image data has been supplied
+.VS 8.4
+or where it has been set transparent by the \fBtransparency set\fR
+subcommand.
+.VE 8.4
.SH "CREATING PHOTOS"
.PP
@@ -185,6 +189,18 @@ only every \fIx\fRth pixel in the X direction and \fIy\fRth pixel in
the Y direction. Negative values will cause the image to be flipped
about the Y or X axes, respectively. If \fIy\fR is not given, the
default value is the same as \fIx\fR.
+.TP
+\fB\-compositingrule \fIrule\fR
+.VS 8.4
+Specifies how transparent pixels in the source image are combined with
+the destination image. When a compositing rule of \fIoverlay\fR is
+set, the old contents of the destination image are visible, as if the
+source image were printed on a piece of transparent film and placed
+over the top of the destination. When a compositing rule of \fIset\fR
+is set, the old contents of the destination image are discarded and
+the source image is used as-is. The default compositing rule is
+\fIoverlay\fR.
+.VE 8.4
.RE
.TP
\fIimageName \fBdata ?\fIoption value(s) ...\fR?
@@ -198,20 +214,21 @@ information. In all transparent pixels the color will be replaced by
the specified color.
.TP
\fB\-format\fI format-name\fR
-Specifies the name of the image file format handler to be used to
-write the data to the file. Specifically, this subcommand searches
+Specifies the name of the image file format handler to be used.
+Specifically, this subcommand searches
for the first handler whose name matches a initial substring of
-\fIformat-name\fR and which has the capability to write an image
-file. If this option is not given, this subcommand uses the first
-handler that has the capability to write an image file.
+\fIformat-name\fR and which has the capability to read this image data.
+If this option is not given, this subcommand uses the first
+handler that has the capability to read the image data.
.TP
\fB\-from \fIx1 y1 x2 y2\fR
-Specifies a rectangular region of \fIimageName\fR to be written to the
-image file. If only \fIx1\fR and \fIy1\fR are specified, the region
+Specifies a rectangular region of \fIimageName\fR to be returned.
+If only \fIx1\fR and \fIy1\fR are specified, the region
extends from \fI(x1,y1)\fR to the bottom-right corner of
\fIimageName\fR. If all four coordinates are given, they specify
-diagonally opposite corners of the rectangular region. The default,
-if this option is not given, is the whole image.
+diagonally opposite corners of the rectangular region, including x1,y1
+and excluding x2,y2. The default, if this option is not given, is the
+whole image.
.TP
\fB\-grayscale\fR
If this options is specified, the data will not contain color
@@ -307,6 +324,21 @@ not noticeable, but if it is a problem, this command can be used to
recalculate the dithered image in each window where the image is
displayed.
.TP
+\fIimageName \fBtransparency \fIsubcommand ?arg arg ...?\fR
+.VS 8.4
+Allows examination and manipulation of the transparency information in
+the photo image. Several subcommands are available:
+.RS
+.TP
+\fIimageName \fBtransparency get \fIx y\fR
+Returns a boolean indicating if the pixel at (\fIx\fR,\fIy\fR) is
+transparent.
+\fIimageName \fBtransparency set \fIx y boolean\fR
+Makes the pixel at (\fIx\fR,\fIy\fR) transparent if \fIboolean\fR is
+true, and makes that pixel opaque otherwise.
+.RE
+.VE 8.4
+.TP
\fIimageName \fBwrite \fIfilename\fR ?\fIoption value(s) ...\fR?
Writes image data from \fIimageName\fR to a file named \fIfilename\fR.
The following options may be specified:
@@ -337,7 +369,6 @@ if this option is not given, is the whole image.
If this options is specified, the data will not contain color
information. All pixel data will be transformed into grayscale.
.RE
-.TP
.SH "IMAGE FORMATS"
.PP
The photo image code is structured to allow handlers for additional
@@ -367,6 +398,10 @@ for the \fB\-format\fR option must begin with the complete name of the
requested handler, and may contain additional information following
that, which the handler can use, for example, to specify which variant
to use of the formats supported by the handler.
+.VS 8.4
+Note that not all image handlers may support writing transparency data
+to a file, even where the target image format does.
+.VE 8.4
.SH "COLOR ALLOCATION"
.PP
@@ -406,4 +441,3 @@ John Ousterhout.
.SH KEYWORDS
photo, image, color
-
diff --git a/tk/doc/place.n b/tk/doc/place.n
index aaddaba37dd..4c21d72edf6 100644
--- a/tk/doc/place.n
+++ b/tk/doc/place.n
@@ -16,7 +16,7 @@ place \- Geometry manager for fixed or rubber-sheet placement
.SH SYNOPSIS
\fBplace \fIwindow option value \fR?\fIoption value ...\fR?
.sp
-\fBplace configure \fIwindow option value \fR?\fIoption value ...\fR?
+\fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR?
.sp
\fBplace forget \fIwindow\fR
.sp
@@ -39,16 +39,69 @@ Lastly, the placer allows you to mix these styles of placement so
that, for example, the slave has a fixed width and height but is
centered inside the master.
.PP
-If the first argument to the \fBplace\fR command is a window path
-name or \fBconfigure\fR then the command arranges for the placer
-to manage the geometry of a slave whose path name is \fIwindow\fR.
-The remaining arguments consist of one or more \fIoption\-value\fR
-pairs that specify the way in which \fIwindow\fR's
-geometry is managed.
-If the placer is already managing \fIwindow\fR, then the
-\fIoption\-value\fR pairs modify the configuration for \fIwindow\fR.
-In this form the \fBplace\fR command returns an empty string as result.
+.TP
+\fBplace \fIwindow option value \fR?\fIoption value ...\fR?
+Arrange for the placer to manage the geometry of a slave whose
+pathName is \fIwindow\fR. The remaining arguments consist of one or
+more \fIoption\-value\fR pairs that specify the way in which
+\fIwindow\fR's geometry is managed. \fIOption\fR may have any of the
+values accepted by the \fBplace configure\fR command.
+.TP
+\fBplace configure \fIwindow \fR?\fIoption\fR? ?\fIvalue option value ...\fR?
+Query or modify the geometry options of the slave given by
+\fIwindow\fR. If no \fIoption\fR is specified, this command returns a
+list describing 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 option(s) to have the given value(s); in this case
+the command returns an empty string.
+
The following \fIoption\-value\fR pairs are supported:
+.RS
+.TP
+\fB\-anchor \fIwhere\fR
+\fIWhere\fR specifies which point of \fIwindow\fR is to be positioned
+at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR,
+\fB\-relx\fR, and \fB\-rely\fR options.
+The anchor point is in terms of the outer area of \fIwindow\fR
+including its border, if any.
+Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of
+\fIwindow\fR's border will appear at the given (x,y) location
+in the master.
+The anchor position defaults to \fBnw\fR.
+.TP
+\fB\-bordermode \fImode\fR
+\fIMode\fR determines the degree to which borders within the
+master are used in determining the placement of the slave.
+The default and most common value is \fBinside\fR.
+In this case the placer considers the area of the master to
+be the innermost area of the master, inside any border:
+an option of \fB\-x 0\fR corresponds to an x-coordinate just
+inside the border and an option of \fB\-relwidth 1.0\fR
+means \fIwindow\fR will fill the area inside the master's
+border.
+
+If \fImode\fR is \fBoutside\fR then the placer considers
+the area of the master to include its border;
+this mode is typically used when placing \fIwindow\fR
+outside its master, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR.
+Lastly, \fImode\fR may be specified as \fBignore\fR, in which
+case borders are ignored: the area of the master is considered
+to be its official X area, which includes any internal border but
+no external border. A bordermode of \fBignore\fR is probably
+not very useful.
+.TP
+\fB\-height \fIsize\fR
+\fISize\fR specifies the height for \fIwindow\fR in screen units
+(i.e. any of the forms accepted by \fBTk_GetPixels\fR).
+The height will be the outer dimension of \fIwindow\fR including its
+border, if any.
+If \fIsize\fR is an empty string, or if no \fB\-height\fR or
+\fB\-relheight\fR option is specified, then the height requested
+internally by the window will be used.
.TP
\fB\-in \fImaster\fR
\fIMaster\fR specifes the path name of the window relative
@@ -62,12 +115,25 @@ that \fIwindow\fR is visible whenever \fImaster\fR is visible.
If this option isn't specified then the master defaults to
\fIwindow\fR's parent.
.TP
-\fB\-x \fIlocation\fR
-\fILocation\fR specifies the x-coordinate within the master window
-of the anchor point for \fIwindow\fR.
-The location is specified in screen units (i.e. any of the forms
-accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
-of the master window.
+\fB\-relheight \fIsize\fR
+\fISize\fR specifies the height for \fIwindow\fR.
+In this case the height is specified as a floating-point number
+relative to the height of the master: 0.5 means \fIwindow\fR will
+be half as high as the master, 1.0 means \fIwindow\fR will have
+the same height as the master, and so on.
+If both \fB\-height\fR and \fB\-relheight\fR are specified for a slave,
+their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR
+makes the slave 2 pixels shorter than the master.
+.TP
+\fB\-relwidth \fIsize\fR
+\fISize\fR specifies the width for \fIwindow\fR.
+In this case the width is specified as a floating-point number
+relative to the width of the master: 0.5 means \fIwindow\fR will
+be half as wide as the master, 1.0 means \fIwindow\fR will have
+the same width as the master, and so on.
+If both \fB\-width\fR and \fB\-relwidth\fR are specified for a slave,
+their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR
+makes the slave 5 pixels wider than the master.
.TP
\fB\-relx \fIlocation\fR
\fILocation\fR specifies the x-coordinate within the master window
@@ -81,13 +147,6 @@ then their values are summed. For example, \fB\-relx 0.5 \-x \-2\fR
positions the left edge of the slave 2 pixels to the left of the
center of its master.
.TP
-\fB\-y \fIlocation\fR
-\fILocation\fR specifies the y-coordinate within the master window
-of the anchor point for \fIwindow\fR.
-The location is specified in screen units (i.e. any of the forms
-accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
-of the master window.
-.TP
\fB\-rely \fIlocation\fR
\fILocation\fR specifies the y-coordinate within the master window
of the anchor point for \fIwindow\fR.
@@ -100,17 +159,6 @@ then their values are summed. For example, \fB\-rely 0.5 \-x 3\fR
positions the top edge of the slave 3 pixels below the
center of its master.
.TP
-\fB\-anchor \fIwhere\fR
-\fIWhere\fR specifies which point of \fIwindow\fR is to be positioned
-at the (x,y) location selected by the \fB\-x\fR, \fB\-y\fR,
-\fB\-relx\fR, and \fB\-rely\fR options.
-The anchor point is in terms of the outer area of \fIwindow\fR
-including its border, if any.
-Thus if \fIwhere\fR is \fBse\fR then the lower-right corner of
-\fIwindow\fR's border will appear at the given (x,y) location
-in the master.
-The anchor position defaults to \fBnw\fR.
-.TP
\fB\-width \fIsize\fR
\fISize\fR specifies the width for \fIwindow\fR in screen units
(i.e. any of the forms accepted by \fBTk_GetPixels\fR).
@@ -120,77 +168,42 @@ If \fIsize\fR is an empty string, or if no \fB\-width\fR
or \fB\-relwidth\fR option is specified, then the width requested
internally by the window will be used.
.TP
-\fB\-relwidth \fIsize\fR
-\fISize\fR specifies the width for \fIwindow\fR.
-In this case the width is specified as a floating-point number
-relative to the width of the master: 0.5 means \fIwindow\fR will
-be half as wide as the master, 1.0 means \fIwindow\fR will have
-the same width as the master, and so on.
-If both \fB\-width\fR and \fB\-relwidth\fR are specified for a slave,
-their values are summed. For example, \fB\-relwidth 1.0 \-width 5\fR
-makes the slave 5 pixels wider than the master.
-.TP
-\fB\-height \fIsize\fR
-\fISize\fR specifies the height for \fIwindow\fR in screen units
-(i.e. any of the forms accepted by \fBTk_GetPixels\fR).
-The height will be the outer dimension of \fIwindow\fR including its
-border, if any.
-If \fIsize\fR is an empty string, or if no \fB\-height\fR or
-\fB\-relheight\fR option is specified, then the height requested
-internally by the window will be used.
-.TP
-\fB\-relheight \fIsize\fR
-\fISize\fR specifies the height for \fIwindow\fR.
-In this case the height is specified as a floating-point number
-relative to the height of the master: 0.5 means \fIwindow\fR will
-be half as high as the master, 1.0 means \fIwindow\fR will have
-the same height as the master, and so on.
-If both \fB\-height\fR and \fB\-relheight\fR are specified for a slave,
-their values are summed. For example, \fB\-relheight 1.0 \-height \-2\fR
-makes the slave 2 pixels shorter than the master.
+\fB\-x \fIlocation\fR
+\fILocation\fR specifies the x-coordinate within the master window
+of the anchor point for \fIwindow\fR.
+The location is specified in screen units (i.e. any of the forms
+accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
+of the master window.
.TP
-\fB\-bordermode \fImode\fR
-\fIMode\fR determines the degree to which borders within the
-master are used in determining the placement of the slave.
-The default and most common value is \fBinside\fR.
-In this case the placer considers the area of the master to
-be the innermost area of the master, inside any border:
-an option of \fB\-x 0\fR corresponds to an x-coordinate just
-inside the border and an option of \fB\-relwidth 1.0\fR
-means \fIwindow\fR will fill the area inside the master's
-border.
-If \fImode\fR is \fBoutside\fR then the placer considers
-the area of the master to include its border;
-this mode is typically used when placing \fIwindow\fR
-outside its master, as with the options \fB\-x 0 \-y 0 \-anchor ne\fR.
-Lastly, \fImode\fR may be specified as \fBignore\fR, in which
-case borders are ignored: the area of the master is considered
-to be its official X area, which includes any internal border but
-no external border. A bordermode of \fBignore\fR is probably
-not very useful.
+\fB\-y \fIlocation\fR
+\fILocation\fR specifies the y-coordinate within the master window
+of the anchor point for \fIwindow\fR.
+The location is specified in screen units (i.e. any of the forms
+accepted by \fBTk_GetPixels\fR) and need not lie within the bounds
+of the master window.
.PP
If the same value is specified separately with
two different options, such as \fB\-x\fR and \fB\-relx\fR, then
the most recent option is used and the older one is ignored.
-.PP
-The \fBplace slaves\fR command returns a list of all the slave
-windows for which \fIwindow\fR is the master.
-If there are no slaves for \fIwindow\fR then an empty string is
-returned.
-.PP
-The \fBplace forget\fR command causes the placer to stop managing
-the geometry of \fIwindow\fR. As a side effect of this command
-\fIwindow\fR will be unmapped so that it doesn't appear on the
-screen.
-If \fIwindow\fR isn't currently managed by the placer then the
-command has no effect.
-\fBPlace forget\fR returns an empty string as result.
-.PP
-The \fBplace info\fR command returns a list giving the current
-configuration of \fIwindow\fR.
+.RE
+.TP
+\fBplace forget \fIwindow\fR
+Causes the placer to stop managing the geometry of \fIwindow\fR. As a
+side effect of this command \fIwindow\fR will be unmapped so that it
+doesn't appear on the screen. If \fIwindow\fR isn't currently managed
+by the placer then the command has no effect. This command returns an
+empty string.
+.TP
+\fBplace info \fIwindow\fR
+Returns a list giving the current configuration of \fIwindow\fR.
The list consists of \fIoption\-value\fR pairs in exactly the
same form as might be specified to the \fBplace configure\fR
command.
+.TP
+\fBplace slaves \fIwindow\fR
+Returns a list of all the slave windows for which \fIwindow\fR is the master.
+If there are no slaves for \fIwindow\fR then an empty string is returned.
+
If the configuration of a window has been retrieved with
\fBplace info\fR, that configuration can be restored later by
first using \fBplace forget\fR to erase any existing information
@@ -235,4 +248,3 @@ frames and canvases that provide configuration options for this purpose.
.SH KEYWORDS
geometry manager, height, location, master, place, rubber sheet, slave, width
-
diff --git a/tk/doc/popup.n b/tk/doc/popup.n
index 6103ac34f46..8f574c85ead 100644
--- a/tk/doc/popup.n
+++ b/tk/doc/popup.n
@@ -31,4 +31,3 @@ the given point.
.SH KEYWORDS
menu, popup
-
diff --git a/tk/doc/radiobutton.n b/tk/doc/radiobutton.n
index 977cb703bd8..db33fe66a68 100644
--- a/tk/doc/radiobutton.n
+++ b/tk/doc/radiobutton.n
@@ -16,12 +16,14 @@ radiobutton \- Create and manipulate radiobutton widgets
.SH SYNOPSIS
\fBradiobutton\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-activebackground \-cursor \-highlightthickness \-takefocus
-\-activeforeground \-disabledforeground \-image \-text
-\-anchor \-font \-justify \-textvariable
-\-background \-foreground \-padx \-underline
-\-bitmap \-highlightbackground \-pady \-wraplength
-\-borderwidth \-highlightcolor \-relief
+\-activebackground \-font \-pady
+\-activeforeground \-foreground \-relief
+\-anchor \-highlightbackground \-takefocus
+\-background \-highlightcolor \-text
+\-bitmap \-highlightthickness \-textvariable
+\-borderwidth \-image \-underline
+\-cursor \-justify \-wraplength
+\-disabledforeground \-padx
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-command command Command
@@ -51,6 +53,27 @@ for the entire widget, in place of \fBbackground\fR or \fBactiveBackground\fR,
whenever the widget is selected.
If specified as an empty string then no special color is used for
displaying when the widget is selected.
+.VS 8.4
+.OP \-offrelief offRelief OffRelief
+Specifies the relief for the checkbutton when the indicator is not drawn and
+the checkbutton is off. The default value is "raised". By setting this option
+to "flat" and setting -indicatoron to false and -overrelief to raised,
+the effect is achieved
+of having a flat button that raises on mouse-over and which is
+depressed when activated. This is the behavior typically exhibited by
+the Align-Left, Align-Right, and Center radiobuttons on the toolbar of a
+word-processor, for example.
+
+.VE 8.4
+.VS 8.4
+.OP \-overrelief overRelief OverRelief
+Specifies an alternative relief for the radiobutton, to be used when the
+mouse cursor is over the widget. This option can be used to make
+toolbar buttons, by configuring \fB\-relief flat \-overrelief
+raised\fR. If the value of this option is the empty string, then no
+alternative relief is used when the mouse cursor is over the radiobutton.
+The empty string is the default value.
+.VE 8.4
.OP \-selectimage selectImage SelectImage
Specifies an image to display (in place of the \fBimage\fR option)
when the radiobutton is selected.
@@ -231,4 +254,3 @@ individual widgets or by redefining the class bindings.
.SH KEYWORDS
radiobutton, widget
-
diff --git a/tk/doc/raise.n b/tk/doc/raise.n
index aedab0b021b..550e0914eba 100644
--- a/tk/doc/raise.n
+++ b/tk/doc/raise.n
@@ -36,4 +36,3 @@ lower
.SH KEYWORDS
obscure, raise, stacking order
-
diff --git a/tk/doc/scale.n b/tk/doc/scale.n
index 6daaa142923..9c21d8fa91e 100644
--- a/tk/doc/scale.n
+++ b/tk/doc/scale.n
@@ -16,10 +16,11 @@ scale \- Create and manipulate scale widgets
.SH SYNOPSIS
\fBscale\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-activebackground \-font \-highlightthickness \-repeatinterval
-\-background \-foreground \-orient \-takefocus
-\-borderwidth \-highlightbackground \-relief \-troughcolor
-\-cursor \-highlightcolor \-repeatdelay
+\-activebackground \-foreground \-relief
+\-background \-highlightbackground \-repeatdelay
+\-borderwidth \-highlightcolor \-repeatinterval
+\-cursor \-highlightthickness \-takefocus
+\-font \-orient \-troughcolor
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-bigincrement bigIncrement BigIncrement
@@ -244,4 +245,3 @@ individual widgets or by redefining the class bindings.
.SH KEYWORDS
scale, slider, trough, widget
-
diff --git a/tk/doc/scrollbar.n b/tk/doc/scrollbar.n
index a52cf95ce80..744889dec5d 100644
--- a/tk/doc/scrollbar.n
+++ b/tk/doc/scrollbar.n
@@ -16,10 +16,11 @@ scrollbar \- Create and manipulate scrollbar widgets
.SH SYNOPSIS
\fBscrollbar\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-activebackground \-highlightbackground \-orient \-takefocus
-\-background \-highlightcolor \-relief \-troughcolor
-\-borderwidth \-highlightthickness \-repeatdelay
-\-cursor \-jump \-repeatinterval
+\-activebackground \-highlightcolor \-repeatdelay
+\-background \-highlightthickness \-repeatinterval
+\-borderwidth \-jump \-takefocus
+\-cursor \-orient \-troughcolor
+\-highlightbackground \-relief
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-activerelief activeRelief ActiveRelief
@@ -338,4 +339,3 @@ The End key adjusts the view to the bottom (right edge) of the document.
.SH KEYWORDS
scrollbar, widget
-
diff --git a/tk/doc/selection.n b/tk/doc/selection.n
index 72feff07328..3c41f88fd72 100644
--- a/tk/doc/selection.n
+++ b/tk/doc/selection.n
@@ -23,6 +23,9 @@ This command provides a Tcl interface to the X selection mechanism and
implements the full selection functionality described in the
X Inter-Client Communication Conventions Manual (ICCCM).
.PP
+Note that for management of the CLIPBOARD selection (see below), the
+\fBclipboard\fR command may also be used.
+.PP
The first argument to \fBselection\fR determines the format of the
rest of the arguments and the behavior of the command. The following
forms are currently supported:
@@ -126,6 +129,8 @@ If \fIcommand\fR is specified, it is a Tcl script to execute when
some other window claims ownership of the selection away from
\fIwindow\fR. \fISelection\fR defaults to PRIMARY.
+.SH "SEE ALSO"
+clipboard
+
.SH KEYWORDS
clear, format, handler, ICCCM, own, selection, target, type
-
diff --git a/tk/doc/send.n b/tk/doc/send.n
index 4e35474f512..96056777d25 100644
--- a/tk/doc/send.n
+++ b/tk/doc/send.n
@@ -95,4 +95,3 @@ functionality is provided by the \fBdde\fR command instead.
.VS
application, dde, name, remote execution, security, send
.VE
-
diff --git a/tk/doc/spinbox.n b/tk/doc/spinbox.n
new file mode 100644
index 00000000000..7fe92995576
--- /dev/null
+++ b/tk/doc/spinbox.n
@@ -0,0 +1,582 @@
+'\"
+'\" Copyright (c) 2000 Jeffrey Hobbs.
+'\" Copyright (c) 2000 Ajuba Solutions.
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+'\" RCS: @(#) $Id$
+'\"
+.so man.macros
+.TH spinbox n 8.4 Tk "Tk Built-In Commands"
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+spinbox \- Create and manipulate spinbox widgets
+.SH SYNOPSIS
+\fBspinbox\fR \fIpathName \fR?\fIoptions\fR?
+.SO
+\-activebackground \-highlightthickness \-repeatinterval
+\-background \-insertbackground \-selectbackground
+\-borderwidth \-insertborderwidth \-selectborderwidth
+\-cursor \-insertontime \-selectforeground
+\-exportselection \-insertwidth \-takefocus
+\-font \-insertofftime \-textvariable
+\-foreground \-justify \-xscrollcommand
+\-highlightbackground \-relief
+\-highlightcolor \-repeatdelay
+.SE
+.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-buttonbackground buttonBackground Background
+The background color to be used for the spin buttons.
+.OP \-buttoncursor buttonCursor Cursor
+The cursor to be used when over the spin buttons. If this is empty
+(the default), a default cursor will be used.
+.OP \-buttondownrelief buttonDownRelief Relief
+The relief to be used for the upper spin button.
+.OP \-buttonuprelief buttonUpRelief Relief
+The relief to be used for the lower spin button.
+.OP \-command command Command
+Specifies a Tcl command to invoke whenever a spinbutton is invoked.
+The command recognizes several percent substitutions: \fB%W\fR for
+the widget path, \fB%s\fR for the current value of the widget, and
+\fB%d\fR for the direction of the button pressed (\fBup\fR or \fBdown\fR).
+.OP \-disabledbackground disabledBackground DisabledBackground
+Specifies the background color to use when the spinbox is disabled. If
+this option is the empty string, the normal background color is used.
+.OP \-disabledforeground disabledForeground DisabledForeground
+Specifies the foreground color to use when the spinbox is disabled. If
+this option is the empty string, the normal foreground color is used.
+.OP \-format format Format
+Specifies an alternate format to use when setting the string value
+when using the \fB\-from\fR and \fB\-to\fR range.
+This must be a format specifier of the form \fB%<pad>.<pad>f\fR,
+as it will format a floating-point number.
+.OP \-from from From
+A floating-point value corresponding to the lowest value for a spinbox, to
+be used in conjunction with \fB\-to\fR and \fB\-increment\fR. When all
+are specified correctly, the spinbox will use these values to control its
+contents. This value must be less than the \fB\-to\fR option.
+If \fB\-values\fR is specified, it supercedes this option.
+.OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
+Specifies a script to eval when \fBvalidateCommand\fR returns 0. Setting
+it to an empty string disables this feature (the default). The best use of
+this option is to set it to \fIbell\fR. See \fBValidation\fR below for
+more information.
+.OP \-increment increment Increment
+A floating-point value specifying the increment. When used with
+\fB\-from\fR and \fB\-to\fR, the value in the widget will be adjusted by
+\fB\-increment\fR when a spin button is pressed (up adds the value,
+down subtracts the value).
+.OP \-readonlybackground readonlyBackground ReadonlyBackground
+Specifies the background color to use when the spinbox is readonly. If
+this option is the empty string, the normal background color is used.
+.OP \-state state State
+Specifies one of three states for the spinbox: \fBnormal\fR,
+\fBdisabled\fR, or \fBreadonly\fR. If the spinbox is readonly, then the
+value may not be changed using widget commands and no insertion cursor
+will be displayed, even if the input focus is in the widget; the
+contents of the widget may still be selected. If the spinbox is
+disabled, the value may not be changed, no insertion cursor will be
+displayed, the contents will not be selectable, and the spinbox may
+be displayed in a different color, depending on the values of the
+\fB-disabledforeground\fR and \fB-disabledbackground\fR options.
+.OP \-to to To
+A floating-point value corresponding to the highest value for the spinbox,
+to be used in conjunction with \fB\-from\fR and \fB\-increment\fR. When
+all are specified correctly, the spinbox will use these values to control
+its contents. This value must be greater than the \fB\-from\fR option.
+If \fB\-values\fR is specified, it supercedes this option.
+.OP \-validate validate Validate
+Specifies the mode in which validation should operate: \fBnone\fR,
+\fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
+It defaults to \fBnone\fR. When you want validation, you must explicitly
+state which mode you wish to use. See \fBValidation\fR below for more.
+.OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand
+Specifies a script to evaluate when you want to validate the input in the
+widget. Setting it to an empty string disables this feature (the default).
+Validation occurs according to the value of \fB\-validate\fR.
+This command must return a valid Tcl boolean value. If it returns 0 (or
+the valid Tcl boolean equivalent) then the value of the widget will not
+change and the \fBinvalidCommand\fR will be evaluated if it is set. If it
+returns 1, then value will be changed.
+See \fBValidation\fR below for more information.
+.OP \-values values Values
+Must be a proper list value. If specified, the spinbox will use these
+values as to control its contents, starting with the first value. This
+option has precedence over the \fB\-from\fR and \fB\-to\fR range.
+.OP \-width width Width
+Specifies an integer value indicating the desired width of the spinbox window,
+in average-size characters of the widget's font.
+If the value is less than or equal to zero, the widget picks a
+size just large enough to hold its current text.
+.OP \-wrap wrap wrap
+Must be a proper boolean value. If on, the spinbox will wrap around the
+values of data in the widget.
+.BE
+
+.SH DESCRIPTION
+.PP
+The \fBspinbox\fR command creates a new window (given by the
+\fIpathName\fR argument) and makes it into a spinbox widget.
+Additional options, described above, may be specified on the
+command line or in the option database
+to configure aspects of the spinbox such as its colors, font,
+and relief. The \fBspinbox\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
+A \fBspinbox\fR is an extended \fBentry\fR widget that allows he user
+to move, or spin, through a fixed set of ascending or descending values
+such as times or dates in addition to editing the value as in an
+\fBentry\fR. When first created, a spinbox's string is empty.
+A portion of the spinbox may be selected as described below.
+If a spinbox is exporting its selection (see the \fBexportSelection\fR
+option), then it will observe the standard protocols for handling the
+selection; spinbox selections are available as type \fBSTRING\fR.
+Spinboxes also observe the standard Tk rules for dealing with the
+input focus. When a spinbox has the input focus it displays an
+\fIinsertion cursor\fR to indicate where new characters will be
+inserted.
+.PP
+Spinboxes are capable of displaying strings that are too long to
+fit entirely within the widget's window. In this case, only a
+portion of the string will be displayed; commands described below
+may be used to change the view in the window. Spinboxes use
+the standard \fBxScrollCommand\fR mechanism for interacting with
+scrollbars (see the description of the \fBxScrollCommand\fR option
+for details). They also support scanning, as described below.
+
+.SH VALIDATION
+.PP
+Validation works by setting the \fBvalidateCommand\fR
+option to a script which will be evaluated according to the \fBvalidate\fR
+option as follows:
+.PP
+.IP \fBnone\fR 10
+Default. This means no validation will occur.
+.IP \fBfocus\fR 10
+\fBvalidateCommand\fR will be called when the spinbox receives or
+loses focus.
+.IP \fBfocusin\fR 10
+\fBvalidateCommand\fR will be called when the spinbox receives focus.
+.IP \fBfocusout\fR 10
+\fBvalidateCommand\fR will be called when the spinbox loses focus.
+.IP \fBkey\fR 10
+\fBvalidateCommand\fR will be called when the spinbox is edited.
+.IP \fBall\fR 10
+\fBvalidateCommand\fR will be called for all above conditions.
+.PP
+It is posible to perform percent substitutions on the \fBvalidateCommand\fR
+and \fBinvalidCommand\fR, just as you would in a \fBbind\fR script. The
+following substitutions are recognized:
+.PP
+.IP \fB%d\fR 5
+Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR,
+or -1 for focus, forced or textvariable validation.
+.IP \fB%i\fR 5
+Index of char string to be inserted/deleted, if any, otherwise -1.
+.IP \fB%P\fR 5
+The value of the spinbox should edition occur. If you are configuring the
+spinbox widget to have a new textvariable, this will be the value of that
+textvariable.
+.IP \fB%s\fR 5
+The current value of spinbox before edition.
+.IP \fB%S\fR 5
+The text string being inserted/deleted, if any.
+Otherwise it is an empty string.
+.IP \fB%v\fR 5
+The type of validation currently set.
+.IP \fB%V\fR 5
+The type of validation that triggered the callback
+(key, focusin, focusout, forced).
+.IP \fB%W\fR 5
+The name of the spinbox widget.
+.PP
+In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
+dangerous to mix. Any problems have been overcome so that using the
+\fBvalidateCommand\fR will not interfere with the traditional behavior of
+the spinbox widget. Using the \fBtextVariable\fR for read-only purposes will
+never cause problems. The danger comes when you try set the
+\fBtextVariable\fR to something that the \fBvalidateCommand\fR would not
+accept, which causes \fBvalidate\fR to become \fInone\fR (the
+\fBinvalidCommand\fR will not be triggered). The same happens
+when an error occurs evaluating the \fBvalidateCommand\fR.
+.PP
+Primarily, an error will occur when the \fBvalidateCommand\fR or
+\fBinvalidCommand\fR encounters an error in its script while evaluating or
+\fBvalidateCommand\fR does not return a valid Tcl boolean value. The
+\fBvalidate\fR option will also set itself to \fBnone\fR when you edit the
+spinbox widget from within either the \fBvalidateCommand\fR or the
+\fBinvalidCommand\fR. Such editions will override the one that was being
+validated. If you wish to edit the value of the widget
+during validation and still have the \fBvalidate\fR option set, you should
+include the command
+.CS
+ \fI%W config -validate %v\fR
+.CE
+in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you
+were editing the spinbox widget from). It is also recommended to not set an
+associated \fBtextVariable\fR during validation, as that can cause the
+spinbox widget to become out of sync with the \fBtextVariable\fR.
+
+.SH "WIDGET COMMAND"
+.PP
+The \fBspinbox\fR 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:
+.CS
+\fIpathName option \fR?\fIarg arg ...\fR?
+.CE
+\fIOption\fR and the \fIarg\fRs
+determine the exact behavior of the command.
+.PP
+Many of the widget commands for spinboxes take one or more indices as
+arguments. An index specifies a particular character in the spinbox's
+string, in any of the following ways:
+.TP 12
+\fInumber\fR
+Specifies the character as a numerical index, where 0 corresponds
+to the first character in the string.
+.TP 12
+\fBanchor\fR
+Indicates the anchor point for the selection, which is set with the
+\fBselect from\fR and \fBselect adjust\fR widget commands.
+.TP 12
+\fBend\fR
+Indicates the character just after the last one in the spinbox's string.
+This is equivalent to specifying a numerical index equal to the length
+of the spinbox's string.
+.TP 12
+\fBinsert\fR
+Indicates the character adjacent to and immediately following the
+insertion cursor.
+.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 spinbox window.
+.TP 12
+\fBsel.last\fR
+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
+spinbox window.
+.TP 12
+\fB@\fInumber\fR
+In this form, \fInumber\fR is treated as an x-coordinate in the
+spinbox's window; the character spanning that x-coordinate is used.
+For example, ``\fB@0\fR'' indicates the left-most character in the
+window.
+.LP
+Abbreviations may be used for any of the forms above, e.g. ``\fBe\fR''
+or ``\fBsel.f\fR''. In general, out-of-range indices are automatically
+rounded to the nearest legal value.
+.PP
+The following commands are possible for spinbox widgets:
+.TP
+\fIpathName \fBbbox \fIindex\fR
+Returns a list of four numbers describing the bounding box of the
+character given by \fIindex\fR.
+The first two elements of the list give the x and y coordinates of
+the upper-left corner of the screen area covered by the character
+(in pixels relative to the widget) and the last two elements give
+the width and height of the character, in pixels.
+The bounding box may refer to a region outside the visible area
+of the window.
+.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 \fBspinbox\fR
+command.
+.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 may have any of the values accepted by the \fBspinbox\fR
+command.
+.TP
+\fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
+Delete one or more elements of the spinbox.
+\fIFirst\fR is the index of the first character to delete, and
+\fIlast\fR is the index of the character just after the last
+one to delete.
+If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
+i.e. a single character is deleted.
+This command returns an empty string.
+.TP
+\fIpathName \fBget\fR
+Returns the spinbox's string.
+.TP
+\fIpathName \fBicursor \fIindex\fR
+Arrange for the insertion cursor to be displayed just before the character
+given by \fIindex\fR. Returns an empty string.
+.TP
+\fIpathName \fBidentify\fI x y\fR
+Returns the name of the window element corresponding to coordinates
+\fIx\fR and \fIy\fR in the spinbox. Return value is one of:
+\fBnone\fR, \fBbuttondown\fR, \fBbuttonup\fR, \fBentry\fR.
+.TP
+\fIpathName \fBindex\fI index\fR
+Returns the numerical index corresponding to \fIindex\fR.
+.TP
+\fIpathName \fBinsert \fIindex string\fR
+Insert the characters of \fIstring\fR just before the character
+indicated by \fIindex\fR. Returns an empty string.
+.TP
+\fIpathName \fBinvoke\fI element\fR
+Causes the specified element, either \fBbuttondown\fR or \fBbuttonup\fR,
+to be invoked, triggering the action associated with it.
+.TP
+\fIpathName \fBscan\fR \fIoption args\fR
+This command is used to implement scanning on spinboxes. It has
+two forms, depending on \fIoption\fR:
+.RS
+.TP
+\fIpathName \fBscan mark \fIx\fR
+Records \fIx\fR and the current view in the spinbox 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\fR
+This command computes the difference between its \fIx\fR argument
+and the \fIx\fR argument to the last \fBscan mark\fR command for
+the widget. It then adjusts the view left or right by 10 times the
+difference in x-coordinates. This command is typically associated
+with mouse motion events in the widget, to produce the effect of
+dragging the spinbox at high speed through the window. The return
+value is an empty string.
+.RE
+.TP
+\fIpathName \fBselection \fIoption arg\fR
+This command is used to adjust the selection within a spinbox. It
+has several forms, depending on \fIoption\fR:
+.RS
+.TP
+\fIpathName \fBselection adjust \fIindex\fR
+Locate the end of the selection nearest to the character given by
+\fIindex\fR, and adjust that end of the selection to be at \fIindex\fR
+(i.e including but not going beyond \fIindex\fR). The other
+end of the selection is made the anchor point for future
+\fBselect to\fR commands. If the selection
+isn't currently in the spinbox, then a new selection is created to
+include the characters between \fIindex\fR and the most recent
+selection anchor point, inclusive.
+Returns an empty string.
+.TP
+\fIpathName \fBselection clear\fR
+Clear the selection if it is currently in this widget. If the
+selection isn't in this widget then the command has no effect.
+Returns an empty string.
+.TP
+\fIpathName \fBselection element\fR ?\fIelement\fR?
+Sets or gets the currently selected element. If a spinbutton element
+is specified, it will be displayed depressed.
+.TP
+\fIpathName \fBselection from \fIindex\fR
+Set the selection anchor point to just before the character
+given by \fIindex\fR. Doesn't change the selection.
+Returns an empty string.
+.TP
+\fIpathName \fBselection present\fR
+Returns 1 if there is are characters selected in the spinbox,
+0 if nothing is selected.
+.TP
+\fIpathName \fBselection range \fIstart\fR \fIend\fR
+Sets the selection to include the characters starting with
+the one indexed by \fIstart\fR and ending with the one just
+before \fIend\fR.
+If \fIend\fR refers to the same character as \fIstart\fR or an
+earlier one, then the spinbox's selection is cleared.
+.TP
+\fIpathName \fBselection to \fIindex\fR
+If \fIindex\fR is before the anchor point, set the selection
+to the characters from \fIindex\fR up to but not including
+the anchor point.
+If \fIindex\fR is the same as the anchor point, do nothing.
+If \fIindex\fR is after the anchor point, set the selection
+to the characters from the anchor point up to but not including
+\fIindex\fR.
+The anchor point is determined by the most recent \fBselect from\fR
+or \fBselect adjust\fR command in this widget.
+If the selection isn't in this widget then a new selection is
+created using the most recent anchor point specified for the widget.
+Returns an empty string.
+.RE
+.TP
+\fIpathName \fBset\fR ?\fIstring\fR?
+If \fIstring\fR is specified, the spinbox will try and set it to this
+value, otherwise it just returns the spinbox's string.
+If validation is on, it will occur when setting the string.
+.TP
+\fIpathName \fBvalidate\fR
+This command is used to force an evaluation of the \fBvalidateCommand\fR
+independent of the conditions specified by the \fBvalidate\fR option.
+This is done by temporarily setting the \fBvalidate\fR option to \fBall\fR.
+It returns 0 or 1.
+.TP
+\fIpathName \fBxview \fIargs\fR
+This command is used to query and change the horizontal position of the
+text 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 spinbox'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 \fIindex\fR
+Adjusts the view in the window so that the character given by \fIindex\fR
+is displayed at the left edge of the window.
+.TP
+\fIpathName \fBxview moveto\fI fraction\fR
+Adjusts the view in the window so that the character \fIfraction\fR of the
+way through the text appears at the left edge of the window.
+\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 average-width characters 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
+
+.SH "DEFAULT BINDINGS"
+.PP
+Tk automatically creates class bindings for spinboxes that give them
+the following default behavior.
+In the descriptions below, ``word'' refers to a contiguous group
+of letters, digits, or ``_'' characters, or any single character
+other than these.
+.IP [1]
+Clicking mouse button 1 positions the insertion cursor
+just before the character underneath the mouse cursor, sets the
+input focus to this widget, and clears any selection in the widget.
+Dragging with mouse button 1 strokes out a selection between
+the insertion cursor and the character under the mouse.
+.IP [2]
+Double-clicking with mouse button 1 selects the word under the mouse
+and positions the insertion cursor at the beginning of the word.
+Dragging after a double click will stroke out a selection consisting
+of whole words.
+.IP [3]
+Triple-clicking with mouse button 1 selects all of the text in the
+spinbox and positions the insertion cursor before the first character.
+.IP [4]
+The ends of the selection can be adjusted by dragging with mouse
+button 1 while the Shift key is down; this will adjust the end
+of the selection that was nearest to the mouse cursor when button
+1 was pressed.
+If the button is double-clicked before dragging then the selection
+will be adjusted in units of whole words.
+.IP [5]
+Clicking mouse button 1 with the Control key down will position the
+insertion cursor in the spinbox without affecting the selection.
+.IP [6]
+If any normal printing characters are typed in a spinbox, they are
+inserted at the point of the insertion cursor.
+.IP [7]
+The view in the spinbox can be adjusted by dragging with mouse button 2.
+If mouse button 2 is clicked without moving the mouse, the selection
+is copied into the spinbox at the position of the mouse cursor.
+.IP [8]
+If the mouse is dragged out of the spinbox on the left or right sides
+while button 1 is pressed, the spinbox will automatically scroll to
+make more text visible (if there is more text off-screen on the side
+where the mouse left the window).
+.IP [9]
+The Left and Right keys move the insertion cursor one character to the
+left or right; they also clear any selection in the spinbox and set
+the selection anchor.
+If Left or Right is typed with the Shift key down, then the insertion
+cursor moves and the selection is extended to include the new character.
+Control-Left and Control-Right move the insertion cursor by words, and
+Control-Shift-Left and Control-Shift-Right move the insertion cursor
+by words and also extend the selection.
+Control-b and Control-f behave the same as Left and Right, respectively.
+Meta-b and Meta-f behave the same as Control-Left and Control-Right,
+respectively.
+.IP [10]
+The Home key, or Control-a, will move the insertion cursor to the
+beginning of the spinbox and clear any selection in the spinbox.
+Shift-Home moves the insertion cursor to the beginning of the spinbox
+and also extends the selection to that point.
+.IP [11]
+The End key, or Control-e, will move the insertion cursor to the
+end of the spinbox and clear any selection in the spinbox.
+Shift-End moves the cursor to the end and extends the selection
+to that point.
+.IP [12]
+The Select key and Control-Space set the selection anchor to the position
+of the insertion cursor. They don't affect the current selection.
+Shift-Select and Control-Shift-Space adjust the selection to the
+current position of the insertion cursor, selecting from the anchor
+to the insertion cursor if there was not any selection previously.
+.IP [13]
+Control-/ selects all the text in the spinbox.
+.IP [14]
+Control-\e clears any selection in the spinbox.
+.IP [15]
+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.
+.IP [16]
+The F20 key (labelled Cut on many Sun workstations) or Control-w
+copies the selection in the widget to the clipboard and deletes
+the selection.
+If there is no selection in the widget then these keys have no effect.
+.IP [17]
+The F18 key (labelled Paste on many Sun workstations) or Control-y
+inserts the contents of the clipboard at the position of the
+insertion cursor.
+.IP [18]
+The Delete key deletes the selection, if there is one in the spinbox.
+If there is no selection, it deletes the character to the right of
+the insertion cursor.
+.IP [19]
+The BackSpace key and Control-h delete the selection, if there is one
+in the spinbox.
+If there is no selection, it deletes the character to the left of
+the insertion cursor.
+.IP [20]
+Control-d deletes the character to the right of the insertion cursor.
+.IP [21]
+Meta-d deletes the word to the right of the insertion cursor.
+.IP [22]
+Control-k deletes all the characters to the right of the insertion
+cursor.
+.IP [23]
+Control-t reverses the order of the two characters to the right of
+the insertion cursor.
+.PP
+If the spinbox is disabled using the \fB\-state\fR option, then the spinbox's
+view can still be adjusted and text in the spinbox can still be selected,
+but no insertion cursor will be displayed and no text modifications will
+take place.
+.PP
+The behavior of spinboxes can be changed by defining new bindings for
+individual widgets or by redefining the class bindings.
+
+.SH KEYWORDS
+spinbox, entry, widget
diff --git a/tk/doc/text.n b/tk/doc/text.n
index 5a0892d76fc..5cf8d9603c8 100644
--- a/tk/doc/text.n
+++ b/tk/doc/text.n
@@ -8,26 +8,45 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH text n 4.0 Tk "Tk Built-In Commands"
+.TH text n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
-text \- Create and manipulate text widgets
+text, tk_textCopy, tk_textCut, tk_textPaste \- Create and manipulate text widgets
.SH SYNOPSIS
+.nf
\fBtext\fR \fIpathName \fR?\fIoptions\fR?
+.VS 8.4
+\fBtk_textCopy\fR \fIpathName\fR
+\fBtk_textCut\fR \fIpathName\fR
+\fBtk_textPaste\fR \fIpathName\fR
+.VE 8.4
.SO
-\-background \-highlightbackground \-insertontime \-selectborderwidth
-\-borderwidth \-highlightcolor \-insertwidth \-selectforeground
-\-cursor \-highlightthickness \-padx \-setgrid
-\-exportselection \-insertbackground \-pady \-takefocus
-\-font \-insertborderwidth \-relief \-xscrollcommand
-\-foreground \-insertofftime \-selectbackground \-yscrollcommand
+\-background \-highlightthickness \-relief
+\-borderwidth \-insertbackground \-selectbackground
+\-cursor \-insertborderwidth \-selectborderwidth
+\-exportselection \-insertofftime \-selectforeground
+\-font \-insertontime \-setgrid
+\-foreground \-insertwidth \-takefocus
+\-highlightbackground \-padx \-xscrollcommand
+\-highlightcolor \-pady \-yscrollcommand
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
+.OP \-autoseparators autoSeparators AutoSeparators
+.VS 8.4
+Specifies a boolean that says whether separators are automatically
+inserted in the undo stack. Only meaningful when the \fB\-undo\fR
+option is true.
+.VE 8.4
.OP \-height height Height
Specifies the desired height for the window, in units of characters
in the font given by the \fB\-font\fR option.
Must be at least one.
+.OP \-maxundo maxUndo MaxUndo
+.VS 8.4
+Specifies the maximum number of compound undo actions on the undo
+stack. A zero or a negative value imply an unlimited undo stack.
+.VE 8.4
.OP \-spacing1 spacing1 Spacing1
Requests additional space above each text line in the widget,
using any of the standard forms for screen distances.
@@ -81,6 +100,11 @@ options in tags.
If no \fB\-tabs\fR option is specified, or if it is specified as
an empty list, then Tk uses default tabs spaced every eight
(average size) characters.
+.OP \-undo undo Undo
+.VS 8.4
+Specifies a boolean that says whether the undo mechanism is active or
+not.
+.VE 8.4
.OP \-width width Width
Specifies the desired width for the window in units of characters
in the font given by the \fB\-font\fR option.
@@ -113,10 +137,8 @@ path name of the new window.
.PP
A text widget displays one or more lines of text and allows that
text to be edited.
-.VS
Text widgets support four different kinds of annotations on the
text, called tags, marks, embedded windows or embedded images.
-.VE
Tags allow different portions of the text
to be displayed with different fonts and colors.
In addition, Tcl commands can be associated with tags so
@@ -134,11 +156,14 @@ The third form of annotation allows arbitrary windows to be
embedded in a text widget.
See EMBEDDED WINDOWS below for more details.
.PP
-.VS
The fourth form of annotation allows Tk images to be embedded in a text
widget.
See EMBEDDED IMAGES below for more details.
-.VE
+.PP
+.VS 8.4
+The text widget also has a built-in undo/redo mechanism.
+See UNDO MECHANISM below for more details.
+.VE 8.4
.SH INDICES
.PP
@@ -195,13 +220,11 @@ Indicates the position of the embedded window whose name is
This form generates an error if there is no embedded window
by the given name.
.TP 12
-.VS
\fIimageName\fR
Indicates the position of the embedded image whose name is
\fIimageName\fR.
This form generates an error if there is no embedded image
by the given name.
-.VE
.PP
If the \fIbase\fP could match more than one of the above forms, such
as a \fImark\fP and \fIimageName\fP both having the same value, then
@@ -339,7 +362,7 @@ as an empty string, then a solid fill will be used.
.TP
\fB\-font \fIfontName\fR
\fIFontName\fR is the name of a font to use for drawing characters.
-It may have any of the forms accepted by \fBTk_GetFontStruct\fR.
+It may have any of the forms accepted by \fBTk_GetFont\fR.
.TP
\fB\-foreground \fIcolor\fR
\fIColor\fR specifies the color to use when drawing text and other
@@ -524,7 +547,7 @@ motions if a mouse button is down; the update will be deferred
until all mouse buttons have been released).
Neither of these special marks may be deleted.
-.SH EMBEDDED WINDOWS
+.SH "EMBEDDED WINDOWS"
.PP
The third form of annotation in text widgets is an embedded window.
Each embedded window annotation causes a window to be displayed
@@ -594,8 +617,7 @@ stretched.
\fB\-window \fIpathName\fR
Specifies the name of a window to display in the annotation.
-.VS
-.SH EMBEDDED IMAGES
+.SH "EMBEDDED IMAGES"
.PP
The final form of annotation in text widgets is an embedded image.
Each embedded image annotation causes an image to be displayed
@@ -662,9 +684,8 @@ It may have any of the usual forms defined for a screen distance.
\fIPixels\fR specifies the amount of extra space to leave on
the top and on the bottom of the embedded image.
It may have any of the usual forms defined for a screen distance.
-.VE
-.SH THE SELECTION
+.SH "THE SELECTION"
.PP
Selection support is implemented via tags.
If the \fBexportSelection\fR option for the text widget is true
@@ -680,6 +701,9 @@ characters with the \fBsel\fR tag.
If the selection is claimed away by another application or by another
window within this application, then the \fBsel\fR tag will be removed
from all characters in the text.
+.IP [4]
+Whenever the \fBsel\fR tag range changes a virtual event
+\fB<<Selection>>\fR is generated.
.PP
The \fBsel\fR tag is automatically defined when a text widget is
created, and it may not be deleted with the ``\fIpathName \fBtag delete\fR''
@@ -690,7 +714,7 @@ the text widget are tied to the \fB\-background\fR,
tag: changes in either will automatically be reflected in the
other.
-.SH THE INSERTION CURSOR
+.SH "THE INSERTION CURSOR"
.PP
The mark named \fBinsert\fR has special significance in text widgets.
It is defined automatically when a text widget is created and it
@@ -700,6 +724,47 @@ The \fBinsert\fR mark represents the position of the insertion
cursor, and the insertion cursor will automatically be drawn at
this point whenever the text widget has the input focus.
+.SH "THE MODIFIED FLAG"
+The text widget can keep track of changes to the content of the widget
+by means of the modified flag. Inserting or deleting text will set
+this flag. The flag can be queried, set and cleared programatically
+as well. Whenever the flag changes state a \fB<<Modified>>\fR virtual
+event is generated. See the \fBedit modified\fR widget command for
+more details.
+
+.SH "THE UNDO MECHANISM"
+.PP
+.VS 8.4
+The text widget has an unlimited undo and redo mechanism (when the
+\fB-undo\fR widget option is true) which records every insert and
+delete action on a stack.
+.PP
+Boundaries (called "separators") are inserted between edit actions.
+The purpose of these separators is to group inserts and deletes into
+one compound edit action. When undoing a change everything between
+two separators will be undone. The undone changes are then moved to
+the redo stack, so that an undone edit can be redone again. The redo
+stack is cleared whenever new edit actions are recorded on the undo
+stack. The undo and redo stacks can be cleared to keep their depth
+under control.
+.PP
+Separators are inserted automatically when the \fB-autoseparators\fR
+widget option is true. You can insert separators programatically as
+well. If a separator is already present at the top of the undo stack
+no other will be inserted. That means that two separators on the undo
+stack are always separated by at least one insert or delete action.
+.PP
+The undo mechanism is also linked to the modified flag. This means
+that undoing or redoing changes can take a modified text widget back
+to the unmodified state or vice versa. The modified flag will be set
+automatically to the appropriate state. This automatic coupling
+does not work when the modified flag has been set by the user, until
+the flag has been reset again.
+.PP
+See below for the \fBedit\fR widget command that controls the undo
+mechanism.
+.VE 8.4
+
.SH "WIDGET COMMAND"
.PP
The \fBtext\fR command creates a new Tcl command whose
@@ -770,8 +835,15 @@ There is a single debugging switch shared by all text widgets: turning
debugging on or off in any widget turns it on or off for all widgets.
For widgets with large amounts of text, the consistency checks may
cause a noticeable slow-down.
-.TP
-\fIpathName \fBdelete \fIindex1 \fR?\fIindex2\fR?
+.PP
+.VS 8.4
+When debugging is turned on, the drawing routines of the text widget
+set the global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR
+to the lists of indices that are redrawn. The values of these variables
+are tested by Tk's test suite.
+.VE 8.4
+.TP
+\fIpathName \fBdelete \fIindex1 \fR?\fIindex2 ...\fR?
Delete a range of characters from the text.
If both \fIindex1\fR and \fIindex2\fR are specified, then delete
all the characters starting with the one given by \fIindex1\fR
@@ -784,6 +856,16 @@ If \fIindex2\fR isn't specified then the single character at
It is not allowable to delete characters in a way that would leave
the text without a newline as the last character.
The command returns an empty string.
+.VS 8.4
+If more indices are given, multiple ranges of text will be deleted.
+All indices are first checked for validity before any deletions are made.
+They are sorted and the text is removed from the last range to the
+first range to deleted text does not cause a undesired index shifting
+side-effects. If multiple ranges with the same start index are given,
+then the longest range is used. If overlapping ranges are given, then
+they will be merged into spans that do not cause deletion of text
+outside the given ranges due to text shifted during deletion.
+.VE 8.4
.TP
\fIpathName \fBdlineinfo \fIindex\fR
Returns a list with five elements describing the area occupied
@@ -861,7 +943,43 @@ In this case an empty string is returned, and you must query the
window by its index position to get more information.
.RE
.TP
-\fIpathName \fBget \fIindex1 \fR?\fIindex2\fR?
+\fIpathName \fBedit \fIoption \fR?\fIarg arg ...\fR?
+.VS 8.4
+This command controls the undo mechanism and the modified flag. The
+exact behavior of the command depends on the \fIoption\fR argument
+that follows the \fBedit\fR argument. The following forms of the
+command are currently supported:
+.RS
+.TP
+\fIpathName \fBedit modified ?\fIboolean\fR?
+If \fIboolean\fR is not specified, returns the modified flag of the
+widget. The insert, delete, edit undo and edit redo commands or the
+user can set or clear the modified flag. If \fIboolean\fR is
+specified, sets the modified flag of the widget to \fIboolean\fR.
+.TP
+\fIpathName \fBedit redo\fR
+When the \fB-undo\fR option is true, reapplies the last undone edits
+provided no other edits were done since then. Generates an error when
+the redo stack is empty. Does nothing when the \fB-undo\fR option is
+false.
+.TP
+\fIpathName \fBedit reset\fR
+Clears the undo and redo stacks.
+.TP
+\fIpathName \fBedit separator\fR
+Inserts a separator (boundary) on the undo stack. Does nothing when
+the \fB-undo\fR option is false.
+.TP
+\fIpathName \fBedit undo\fR
+Undoes the last edit action when the \fB-undo\fR option is true. An
+edit action is defined as all the insert and delete commands that are
+recorded on the undo stack in between two separators. Generates an
+error when the undo stack is empty. Does nothing when the \fB-undo\fR
+option is false.
+.RE
+.VE 8.4
+.TP
+\fIpathName \fBget \fIindex1 \fR?\fIindex2 ...\fR?
Return a range of characters from the text.
The return value will be all the characters in the text starting
with the one whose index is \fIindex1\fR and ending just before
@@ -874,6 +992,11 @@ is past the end of the file or \fIindex2\fR is less than or equal
to \fIindex1\fR) then an empty string is returned.
If the specified range contains embedded windows, no information
about them is included in the returned string.
+.VS 8.4
+If multiple index pairs are given, multiple ranges of text will be returned
+in a list. Invalid ranges will not be represented with empty strings in
+the list. The ranges are returned in the order passed to \fBget\fR.
+.VE 8.4
.TP
\fIpathName \fBimage \fIoption \fR?\fIarg arg ...\fR?
This command is used to manipulate embedded images.
@@ -1552,15 +1675,24 @@ Control-\e clears any selection in the widget.
.IP [20]
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.
+.VS 8.4
+This action is carried out by the command \fBtk_textCopy\fR.
+.VE 8.4
.IP [21]
The F20 key (labelled Cut on many Sun workstations) or Control-w
copies the selection in the widget to the clipboard and deletes
the selection.
+.VS 8.4
+This action is carried out by the command \fBtk_textCut\fR.
+.VE 8.4
If there is no selection in the widget then these keys have no effect.
.IP [22]
The F18 key (labelled Paste on many Sun workstations) or Control-y
inserts the contents of the clipboard at the position of the
insertion cursor.
+.VS 8.4
+This action is carried out by the command \fBtk_textPaste\fR.
+.VE 8.4
.IP [23]
The Delete key deletes the selection, if there is one in the widget.
If there is no selection, it deletes the character to the right of
@@ -1589,6 +1721,15 @@ Control-x deletes whatever is selected in the text widget.
.IP [31]
Control-t reverses the order of the two characters to the right of
the insertion cursor.
+.IP [32]
+.VS 8.4
+Control-z (and Control-underscore on UNIX when \fBtk_strictMotif\fR is
+true) undoes the last edit action if the \fB-undo\fR option is true.
+Does nothing otherwise.
+.IP [33]
+Control-Z (or Control-y on Windows) reapplies the last undone edit
+action if the \fB-undo\fR option is true. Does nothing otherwise.
+.VE 8.4
.PP
If the widget is disabled using the \fB\-state\fR option, then its
view can still be adjusted and text can still be selected,
@@ -1632,5 +1773,4 @@ The display line with the insert cursor is redrawn each time the
cursor blinks, which causes a steady stream of graphics traffic.
Set the \fBinsertOffTime\fP attribute to 0 avoid this.
.SH KEYWORDS
-text, widget
-
+text, widget, tkvars
diff --git a/tk/doc/tk.n b/tk/doc/tk.n
index 590ca6d5f4b..b60aa9e9e0c 100644
--- a/tk/doc/tk.n
+++ b/tk/doc/tk.n
@@ -8,7 +8,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH tk n 8.3 Tk "Tk Built-In Commands"
+.TH tk n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -43,6 +43,20 @@ be able to find some options for the application.
If sends have been disabled by deleting the \fBsend\fR command,
this command will reenable them and recreate the \fBsend\fR
command.
+.VS 8.4
+.TP
+\fBtk caret window \fR?\fB\-x \fIx\fR? ?\fB\-y \fIy\fR? ?\fB\-height \fIheight\fR?
+.
+Sets and queries the caret location for the display of the specified
+Tk window \fIwindow\fR. The caret is the per-display cursor location
+used for indicating global focus (e.g. to comply with Microsoft
+Accessibility guidelines), as well as for location of the over-the-spot
+XIM (X Input Methods) or Windows IME windows. If no options are specified,
+the last values used for setting the caret are return in option-value pair
+format. \fI\-x\fR and \fI\-y\fR represent window-relative coordinates, and
+\fI\-height\fR is the height of the current cursor location, or the height
+of the specified \fIwindow\fR if none is given.
+.VE
.TP
\fBtk scaling \fR?\fB\-displayof \fIwindow\fR? ?\fInumber\fR?
.
@@ -76,8 +90,15 @@ some locales (ie: Japanese, Korean), to handle special input devices. This
feature is only significant on X. If XIM support is not available, this
will always return 0. If the \fIwindow\fR argument is omitted, it defaults
to the main window. If the \fIboolean\fR argument is omitted, the current
-state is returned.
+state is returned. This is turned on by default for the main display.
+.VE
+.VS 8.4
+.TP
+\fBtk windowingsystem\fR
+.
+Returns the current Tk windowing system, one of
+\fBx11\fR (X11-based), \fBwin32\fR (MS Windows),
+\fBclassic\fR (Mac OS Classic), or \fBaqua\fR (Mac OS X Aqua).
.VE
.SH KEYWORDS
application name, send
-
diff --git a/tk/doc/tkerror.n b/tk/doc/tkerror.n
index 115eb033f89..9ccee96b1bc 100644
--- a/tk/doc/tkerror.n
+++ b/tk/doc/tkerror.n
@@ -36,4 +36,3 @@ documentation.
.SH KEYWORDS
background error, reporting
-
diff --git a/tk/doc/tkvars.n b/tk/doc/tkvars.n
index 652fc77b866..fe8b2e7d611 100644
--- a/tk/doc/tkvars.n
+++ b/tk/doc/tkvars.n
@@ -44,9 +44,9 @@ Contains a decimal integer giving the current patch level for Tk.
The patch level is incremented for each new release or patch, and
it uniquely identifies an official version of Tk.
.TP
-\fBtkPriv\fR
+\fBtk::Priv\fR
This variable is an array containing several pieces of information
-that are private to Tk. The elements of \fBtkPriv\fR are used by
+that are private to Tk. The elements of \fBtk::Priv\fR are used by
Tk library procedures and default bindings.
They should not be accessed by any code outside Tk.
.TP
@@ -56,6 +56,14 @@ If an application sets it to one, then Tk attempts to adhere as
closely as possible to Motif look-and-feel standards.
For example, active elements such as buttons and scrollbar
sliders will not change color when the pointer passes over them.
+.TP
+\fBtk_textRedraw\fR
+.TP
+\fBtk_textRelayout\fR
+These variables are set by text widgets when they have debugging
+turned on. The values written to these variables can be used to
+test or debug text widget operations. These variables are mostly
+used by Tk's test suite.
.TP 15
\fBtk_version\fR
Tk sets this variable in the interpreter for each application.
@@ -69,5 +77,4 @@ each new release of Tk, except that it resets to zero whenever the
major version number changes.
.SH KEYWORDS
-variables, version
-
+variables, version, text
diff --git a/tk/doc/tkwait.n b/tk/doc/tkwait.n
index e5da82a0beb..0c39f384975 100644
--- a/tk/doc/tkwait.n
+++ b/tk/doc/tkwait.n
@@ -49,4 +49,3 @@ to \fBtkwait\fR must complete before the outer call can complete.
.SH KEYWORDS
variable, visibility, wait, window
-
diff --git a/tk/doc/toplevel.n b/tk/doc/toplevel.n
index c8e7fc43a3e..070da077132 100644
--- a/tk/doc/toplevel.n
+++ b/tk/doc/toplevel.n
@@ -8,7 +8,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH toplevel n 8.0 Tk "Tk Built-In Commands"
+.TH toplevel n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -16,8 +16,9 @@ toplevel \- Create and manipulate toplevel widgets
.SH SYNOPSIS
\fBtoplevel\fR \fIpathName \fR?\fIoptions\fR?
.SO
-\-borderwidth \-highlightbackground \-highlightthickness \-takefocus
-\-cursor \-highlightcolor \-relief
+\-borderwidth \-highlightcolor \-pady
+\-cursor \-highlightthickness \-relief
+\-highlightbackground \-padx \-takefocus
.SE
.SH "WIDGET-SPECIFIC OPTIONS"
.OP \-background background Background
@@ -44,7 +45,6 @@ If the \fBcolormap\fR option is not specified, the new window
uses the default colormap of its screen.
This option may not be changed with the \fBconfigure\fR
widget command.
-.VS 8.0 br
.OP \-container container Container
The value must be a boolean. If true, it means that this window will
be used as a container in which some other application will be embedded
@@ -54,20 +54,17 @@ things like geometry requests. The window should not have any
children of its own in this application.
This option may not be changed with the \fBconfigure\fR
widget command.
-.VE
.OP \-height height Height
Specifies the desired height for the window in any of the forms
acceptable to \fBTk_GetPixels\fR.
If this option is less than or equal to zero then the window will
not request any size at all.
-.VS 8.0 br
.OP \-menu menu Menu
Specifies a menu widget to be used as a menubar. On the Macintosh, the
menubar will be displayed accross the top of the main monitor. On
Microsoft Windows and all UNIX platforms, the menu will appear accross
the toplevel window as part of the window dressing maintained by the
window manager.
-.VE
.OP \-screen "" ""
Specifies the screen on which to place the new window.
Any valid screen name may be used, even one associated with a
@@ -76,7 +73,6 @@ Defaults to the same screen as its parent.
This option is special in that it may not be specified via the option
database, and it may not be modified with the \fBconfigure\fR
widget command.
-.VS 8.0 br
.OP \-use use Use
This option is used for embedding. If the value isn't an empty string,
it must be the the window identifier of a container window, specified as
@@ -87,7 +83,6 @@ window is in a Tk application, it must be a frame or toplevel widget for
which the \fB\-container\fR option was specified.
This option may not be changed with the \fBconfigure\fR
widget command.
-.VE
.OP \-visual visual Visual
Specifies visual information for the new window in any of the
forms accepted by \fBTk_GetVisual\fR.
@@ -159,6 +154,8 @@ command.
When a new toplevel is created, it has no default event bindings:
toplevels are not intended to be interactive.
+.SH "SEE ALSO"
+frame(n)
+
.SH KEYWORDS
toplevel, widget
-
diff --git a/tk/doc/winfo.n b/tk/doc/winfo.n
index e8cae44aabb..2d1303e2b21 100644
--- a/tk/doc/winfo.n
+++ b/tk/doc/winfo.n
@@ -46,9 +46,11 @@ color map for \fIwindow\fR.
.TP
\fBwinfo children \fIwindow\fR
Returns a list containing the path names of all the children
-of \fIwindow\fR. The list is in stacking order, with the lowest
-window first. Top-level windows are returned as children
-of their logical parents.
+of \fIwindow\fR. Top-level windows are returned as children
+of their logical parents. The list is in stacking order, with
+the lowest window first, except for Top-level windows which
+are not returned in stacking order. Use the \fBwm stackorder\fR
+command to query the stacking order of Top-level windows.
.TP
\fBwinfo class \fIwindow\fR
Returns the class name for \fIwindow\fR.
@@ -328,4 +330,3 @@ has no border).
.SH KEYWORDS
atom, children, class, geometry, height, identifier, information, interpreters,
mapped, parent, path name, screen, virtual root, width, window
-
diff --git a/tk/doc/wish.1 b/tk/doc/wish.1
index 157729f01c0..4afc2be5dff 100644
--- a/tk/doc/wish.1
+++ b/tk/doc/wish.1
@@ -184,4 +184,3 @@ incomplete commands.
.SH KEYWORDS
shell, toolkit
-
diff --git a/tk/doc/wm.n b/tk/doc/wm.n
index 6d146bb4a6b..ab21e01afef 100644
--- a/tk/doc/wm.n
+++ b/tk/doc/wm.n
@@ -8,7 +8,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH wm n 4.3 Tk "Tk Built-In Commands"
+.TH wm n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -44,6 +44,30 @@ a Tcl list containing four elements, which are the current values
of \fIminNumer\fR, \fIminDenom\fR, \fImaxNumer\fR, and \fImaxDenom\fR
(if no aspect restrictions are in effect, then an empty string is
returned).
+.VS 8.4
+.TP
+\fBwm attributes \fIwindow\fR
+.TP
+\fBwm attributes \fIwindow\fR ?\fBoption\fR?
+.TP
+\fBwm attributes \fIwindow\fR ?\fBoption value option value...\fR?
+.RS
+This subcommand returns or sets platform specific attributes associated
+with a window. The first form returns a list of the platform specific
+flags and their values. The second form returns the value for the
+specific option. The third form sets one or more of the values. The
+values are as follows:
+.PP
+On Windows, \fB-disabled\fR gets or sets whether the window is in a
+disabled state. \fB-toolwindow\fR gets or sets the style of the window
+to toolwindow (as defined in the MSDN). \fB-topmost\fR gets or sets
+whether this is a topmost window (displays above all other windows).
+.PP
+On Macintosh,
+.PP
+On Unix, there are currently no special attribute values.
+.RE
+.VE 8.4
.TP
\fBwm client \fIwindow\fR ?\fIname\fR?
If \fIname\fR is specified, this command stores \fIname\fR (which
@@ -208,7 +232,19 @@ bitmap is cancelled for \fIwindow\fR.
If \fIbitmap\fR is specified then the command returns an empty string.
Otherwise it returns the name of
the current icon bitmap associated with \fIwindow\fR, or an empty
-string if \fIwindow\fR has no icon bitmap.
+string if \fIwindow\fR has no icon bitmap. On the Windows operating
+system, an additional flag is supported:
+\fBwm iconbitmap \fIwindow\fR ?\fI-default\fR? ?\fIimage\fR?.
+If the \fI-default\fR
+flag is given, the icon is applied to all toplevel windows (existing
+and future) to which no other specific icon has yet been applied.
+In addition to bitmap image types, a full path specification to
+any file which contains a valid
+Windows icon is also accepted (usually .ico or .icr files), or any
+file for which the shell has assigned an icon. Tcl will
+first test if the file contains an icon, then if it has an assigned
+icon, and finally, if that fails, test for
+a bitmap.
.TP
\fBwm iconify \fIwindow\fR
Arrange for \fIwindow\fR to be iconified. It \fIwindow\fR hasn't
@@ -391,6 +427,19 @@ source of the window's current size, or an empty string if
no source has been specified yet. Most window managers interpret
``no source'' as equivalent to \fBprogram\fR.
.TP
+\fBwm stackorder \fIwindow\fR ?\fIisabove|isbelow window\fR?
+The stackorder command returns a list of toplevel windows
+in stacking order, from lowest to highest. When a single toplevel
+window is passed, the returned list recursively includes all of the
+window's children that are toplevels. Only those toplevels
+that are currently mapped to the screen are returned.
+The stackorder command can also be used to determine if one
+toplevel is positioned above or below a second toplevel.
+When two window arguments separated by either \fIisabove\fR or
+\fIisbelow\fR are passed, a boolean result indicates whether
+or not the first window is currently above or below the second
+window in the stacking order.
+.TP
\fBwm state \fIwindow\fR ?newstate?
If \fInewstate\fR is specified, the window will be set to the new state,
otherwise it returns the current state of \fIwindow\fR: either
@@ -413,13 +462,14 @@ specified then the command returns the current title for the
If \fImaster\fR is specified, then the window manager is informed
that \fIwindow\fR is a transient window (e.g. pull-down menu) working
on behalf of \fImaster\fR (where \fImaster\fR is the
-path name for a top-level window). Some window managers will use
-this information to manage \fIwindow\fR specially. If \fImaster\fR
+path name for a top-level window). If \fImaster\fR
is specified as an empty string then \fIwindow\fR is marked as not
-being a transient window any more. If \fImaster\fR is specified,
-then the command returns an empty string. Otherwise the command
+being a transient window any more. Otherwise the command
returns the path name of \fIwindow\fR's current master, or an
empty string if \fIwindow\fR isn't currently a transient window.
+A transient window will mirror state changes in the master and
+inherit the state of the master when initially mapped. It is an
+error to attempt to make a window a transient of itself.
.TP
\fBwm withdraw \fIwindow\fR
Arranges for \fIwindow\fR to be withdrawn from the screen. This
@@ -504,4 +554,3 @@ to be withdrawn and de-iconified in order to make the change happen.
.SH KEYWORDS
aspect ratio, deiconify, focus model, geometry, grid, group, icon, iconify, increments, position, size, title, top-level window, units, window manager
-
diff --git a/tk/generic/default.h b/tk/generic/default.h
index 8db5f297b58..73e76864fc8 100644
--- a/tk/generic/default.h
+++ b/tk/generic/default.h
@@ -20,7 +20,9 @@
defined(__CYGWIN__) || defined(__MINGW32__)
# include "tkWinDefault.h"
#else
-# if defined(MAC_TCL)
+# if defined(MAC_OSX_TK)
+# include "tkMacOSXDefault.h"
+# elif defined(MAC_TCL)
# include "tkMacDefault.h"
# else
# include "tkUnixDefault.h"
@@ -28,4 +30,3 @@
#endif
#endif /* _DEFAULT */
-
diff --git a/tk/generic/ks_names.h b/tk/generic/ks_names.h
index 7c299e8b5f6..75b914981b5 100644
--- a/tk/generic/ks_names.h
+++ b/tk/generic/ks_names.h
@@ -921,5 +921,3 @@
{ "hebrew_shin", 0xcf9 },
{ "hebrew_taf", 0xcfa },
{ "Hebrew_switch", 0xFF7E },
-
-
diff --git a/tk/generic/prolog.ps b/tk/generic/prolog.ps
index 2ab137266ef..546408a34e6 100644
--- a/tk/generic/prolog.ps
+++ b/tk/generic/prolog.ps
@@ -282,4 +282,3 @@ systemdict /ISOLatin1Encoding known not {
} bind def
%%EndProlog
-
diff --git a/tk/generic/tk.decls b/tk/generic/tk.decls
index 51679e2ad3d..b35dbe16516 100644
--- a/tk/generic/tk.decls
+++ b/tk/generic/tk.decls
@@ -6,7 +6,8 @@
# tkStub.c, and tkPlatStub.c files.
#
#
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998-2000 Ajuba Solutions.
+#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
@@ -35,49 +36,49 @@ declare 1 generic {
}
declare 2 generic {
- GC Tk_3DBorderGC (Tk_Window tkwin, Tk_3DBorder border, \
+ GC Tk_3DBorderGC (Tk_Window tkwin, Tk_3DBorder border,
int which)
}
declare 3 generic {
- void Tk_3DHorizontalBevel (Tk_Window tkwin, \
- Drawable drawable, Tk_3DBorder border, int x, \
- int y, int width, int height, int leftIn, \
+ void Tk_3DHorizontalBevel (Tk_Window tkwin,
+ Drawable drawable, Tk_3DBorder border, int x,
+ int y, int width, int height, int leftIn,
int rightIn, int topBevel, int relief)
}
declare 4 generic {
- void Tk_3DVerticalBevel (Tk_Window tkwin, \
- Drawable drawable, Tk_3DBorder border, int x, \
- int y, int width, int height, int leftBevel, \
+ void Tk_3DVerticalBevel (Tk_Window tkwin,
+ Drawable drawable, Tk_3DBorder border, int x,
+ int y, int width, int height, int leftBevel,
int relief)
}
declare 5 generic {
- void Tk_AddOption (Tk_Window tkwin, char *name, \
- char *value, int priority)
+ void Tk_AddOption (Tk_Window tkwin, CONST char *name,
+ CONST char *value, int priority)
}
declare 6 generic {
- void Tk_BindEvent (Tk_BindingTable bindingTable, \
- XEvent *eventPtr, Tk_Window tkwin, int numObjects, \
+ void Tk_BindEvent (Tk_BindingTable bindingTable,
+ XEvent *eventPtr, Tk_Window tkwin, int numObjects,
ClientData *objectPtr)
}
declare 7 generic {
- void Tk_CanvasDrawableCoords (Tk_Canvas canvas, \
- double x, double y, short *drawableXPtr, \
+ void Tk_CanvasDrawableCoords (Tk_Canvas canvas,
+ double x, double y, short *drawableXPtr,
short *drawableYPtr)
}
declare 8 generic {
- void Tk_CanvasEventuallyRedraw (Tk_Canvas canvas, int x1, int y1, \
+ void Tk_CanvasEventuallyRedraw (Tk_Canvas canvas, int x1, int y1,
int x2, int y2)
}
declare 9 generic {
- int Tk_CanvasGetCoord (Tcl_Interp *interp, \
- Tk_Canvas canvas, char *str, double *doublePtr)
+ int Tk_CanvasGetCoord (Tcl_Interp *interp,
+ Tk_Canvas canvas, CONST char *str, double *doublePtr)
}
declare 10 generic {
@@ -85,28 +86,28 @@ declare 10 generic {
}
declare 11 generic {
- int Tk_CanvasPsBitmap (Tcl_Interp *interp, \
- Tk_Canvas canvas, Pixmap bitmap, int x, int y, \
+ int Tk_CanvasPsBitmap (Tcl_Interp *interp,
+ Tk_Canvas canvas, Pixmap bitmap, int x, int y,
int width, int height)
}
declare 12 generic {
- int Tk_CanvasPsColor (Tcl_Interp *interp, \
+ int Tk_CanvasPsColor (Tcl_Interp *interp,
Tk_Canvas canvas, XColor *colorPtr)
}
declare 13 generic {
- int Tk_CanvasPsFont (Tcl_Interp *interp, \
+ int Tk_CanvasPsFont (Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Font font)
}
declare 14 generic {
- void Tk_CanvasPsPath (Tcl_Interp *interp, \
+ void Tk_CanvasPsPath (Tcl_Interp *interp,
Tk_Canvas canvas, double *coordPtr, int numPoints)
}
declare 15 generic {
- int Tk_CanvasPsStipple (Tcl_Interp *interp, \
+ int Tk_CanvasPsStipple (Tcl_Interp *interp,
Tk_Canvas canvas, Pixmap bitmap)
}
@@ -119,12 +120,12 @@ declare 17 generic {
}
declare 18 generic {
- int Tk_CanvasTagsParseProc (ClientData clientData, Tcl_Interp *interp, \
- Tk_Window tkwin, char *value, char *widgRec, int offset)
+ int Tk_CanvasTagsParseProc (ClientData clientData, Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *value, char *widgRec, int offset)
}
declare 19 generic {
- char * Tk_CanvasTagsPrintProc (ClientData clientData, Tk_Window tkwin, \
+ char * Tk_CanvasTagsPrintProc (ClientData clientData, Tk_Window tkwin,
char *widgRec, int offset, Tcl_FreeProc **freeProcPtr)
}
@@ -133,17 +134,17 @@ declare 20 generic {
}
declare 21 generic {
- void Tk_CanvasWindowCoords (Tk_Canvas canvas, double x, double y, \
+ void Tk_CanvasWindowCoords (Tk_Canvas canvas, double x, double y,
short *screenXPtr, short *screenYPtr)
}
declare 22 generic {
- void Tk_ChangeWindowAttributes (Tk_Window tkwin, unsigned long valueMask, \
+ void Tk_ChangeWindowAttributes (Tk_Window tkwin, unsigned long valueMask,
XSetWindowAttributes *attsPtr)
}
declare 23 generic {
- int Tk_CharBbox (Tk_TextLayout layout, int index, int *xPtr, \
+ int Tk_CharBbox (Tk_TextLayout layout, int index, int *xPtr,
int *yPtr, int *widthPtr, int *heightPtr)
}
@@ -152,7 +153,7 @@ declare 24 generic {
}
declare 25 generic {
- int Tk_ClipboardAppend (Tcl_Interp *interp,Tk_Window tkwin, \
+ int Tk_ClipboardAppend (Tcl_Interp *interp,Tk_Window tkwin,
Atom target, Atom format, char* buffer)
}
@@ -161,33 +162,33 @@ declare 26 generic {
}
declare 27 generic {
- int Tk_ConfigureInfo (Tcl_Interp *interp, \
- Tk_Window tkwin, Tk_ConfigSpec *specs, \
- char *widgRec, char *argvName, int flags)
+ int Tk_ConfigureInfo (Tcl_Interp *interp,
+ Tk_Window tkwin, Tk_ConfigSpec *specs,
+ char *widgRec, CONST char *argvName, int flags)
}
declare 28 generic {
- int Tk_ConfigureValue (Tcl_Interp *interp, \
- Tk_Window tkwin, Tk_ConfigSpec *specs, \
- char *widgRec, char *argvName, int flags)
+ int Tk_ConfigureValue (Tcl_Interp *interp,
+ Tk_Window tkwin, Tk_ConfigSpec *specs,
+ char *widgRec, CONST char *argvName, int flags)
}
declare 29 generic {
- int Tk_ConfigureWidget (Tcl_Interp *interp, \
- Tk_Window tkwin, Tk_ConfigSpec *specs, \
- int argc, char **argv, char *widgRec, \
+ int Tk_ConfigureWidget (Tcl_Interp *interp,
+ Tk_Window tkwin, Tk_ConfigSpec *specs,
+ int argc, CONST84 char **argv, char *widgRec,
int flags)
}
declare 30 generic {
- void Tk_ConfigureWindow (Tk_Window tkwin, \
+ void Tk_ConfigureWindow (Tk_Window tkwin,
unsigned int valueMask, XWindowChanges *valuePtr)
}
declare 31 generic {
- Tk_TextLayout Tk_ComputeTextLayout (Tk_Font font, \
- CONST char *str, int numChars, int wrapLength, \
- Tk_Justify justify, int flags, int *widthPtr, \
+ Tk_TextLayout Tk_ComputeTextLayout (Tk_Font font,
+ CONST char *str, int numChars, int wrapLength,
+ Tk_Justify justify, int flags, int *widthPtr,
int *heightPtr)
}
@@ -196,9 +197,9 @@ declare 32 generic {
}
declare 33 generic {
- unsigned long Tk_CreateBinding (Tcl_Interp *interp, \
- Tk_BindingTable bindingTable, ClientData object, \
- char *eventStr, char *command, int append)
+ unsigned long Tk_CreateBinding (Tcl_Interp *interp,
+ Tk_BindingTable bindingTable, ClientData object,
+ CONST char *eventStr, CONST char *command, int append)
}
declare 34 generic {
@@ -206,14 +207,14 @@ declare 34 generic {
}
declare 35 generic {
- Tk_ErrorHandler Tk_CreateErrorHandler (Display *display, \
- int errNum, int request, int minorCode, \
+ Tk_ErrorHandler Tk_CreateErrorHandler (Display *display,
+ int errNum, int request, int minorCode,
Tk_ErrorProc *errorProc, ClientData clientData)
}
declare 36 generic {
- void Tk_CreateEventHandler (Tk_Window token, \
- unsigned long mask, Tk_EventProc *proc, \
+ void Tk_CreateEventHandler (Tk_Window token,
+ unsigned long mask, Tk_EventProc *proc,
ClientData clientData)
}
@@ -234,25 +235,25 @@ declare 40 generic {
}
declare 41 generic {
- void Tk_CreateSelHandler (Tk_Window tkwin, \
- Atom selection, Atom target, \
- Tk_SelectionProc *proc, ClientData clientData, \
+ void Tk_CreateSelHandler (Tk_Window tkwin,
+ Atom selection, Atom target,
+ Tk_SelectionProc *proc, ClientData clientData,
Atom format)
}
declare 42 generic {
- Tk_Window Tk_CreateWindow (Tcl_Interp *interp, \
- Tk_Window parent, char *name, char *screenName)
+ Tk_Window Tk_CreateWindow (Tcl_Interp *interp,
+ Tk_Window parent, CONST char *name, CONST char *screenName)
}
declare 43 generic {
- Tk_Window Tk_CreateWindowFromPath (Tcl_Interp *interp, Tk_Window tkwin, \
- char *pathName, char *screenName)
+ Tk_Window Tk_CreateWindowFromPath (Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *pathName, CONST char *screenName)
}
declare 44 generic {
- int Tk_DefineBitmap (Tcl_Interp *interp, CONST char *name, char *source, \
- int width, int height)
+ int Tk_DefineBitmap (Tcl_Interp *interp, CONST char *name,
+ CONST char *source, int width, int height)
}
declare 45 generic {
@@ -264,9 +265,9 @@ declare 46 generic {
}
declare 47 generic {
- int Tk_DeleteBinding (Tcl_Interp *interp, \
- Tk_BindingTable bindingTable, ClientData object, \
- char *eventStr)
+ int Tk_DeleteBinding (Tcl_Interp *interp,
+ Tk_BindingTable bindingTable, ClientData object,
+ CONST char *eventStr)
}
declare 48 generic {
@@ -278,8 +279,8 @@ declare 49 generic {
}
declare 50 generic {
- void Tk_DeleteEventHandler (Tk_Window token, \
- unsigned long mask, Tk_EventProc *proc, \
+ void Tk_DeleteEventHandler (Tk_Window token,
+ unsigned long mask, Tk_EventProc *proc,
ClientData clientData)
}
@@ -288,7 +289,7 @@ declare 51 generic {
}
declare 52 generic {
- void Tk_DeleteImage (Tcl_Interp *interp, char *name)
+ void Tk_DeleteImage (Tcl_Interp *interp, CONST char *name)
}
declare 53 generic {
@@ -300,7 +301,7 @@ declare 54 generic {
}
declare 55 generic {
- char * Tk_DisplayName (Tk_Window tkwin)
+ CONST84_RETURN char * Tk_DisplayName (Tk_Window tkwin)
}
declare 56 generic {
@@ -308,50 +309,50 @@ declare 56 generic {
}
declare 57 generic {
- void Tk_Draw3DPolygon (Tk_Window tkwin, \
- Drawable drawable, Tk_3DBorder border, \
- XPoint *pointPtr, int numPoints, int borderWidth, \
+ void Tk_Draw3DPolygon (Tk_Window tkwin,
+ Drawable drawable, Tk_3DBorder border,
+ XPoint *pointPtr, int numPoints, int borderWidth,
int leftRelief)
}
declare 58 generic {
- void Tk_Draw3DRectangle (Tk_Window tkwin, Drawable drawable, \
- Tk_3DBorder border, int x, int y, int width, int height, \
+ void Tk_Draw3DRectangle (Tk_Window tkwin, Drawable drawable,
+ Tk_3DBorder border, int x, int y, int width, int height,
int borderWidth, int relief)
}
declare 59 generic {
- void Tk_DrawChars (Display *display, Drawable drawable, GC gc, \
+ void Tk_DrawChars (Display *display, Drawable drawable, GC gc,
Tk_Font tkfont, CONST char *source, int numBytes, int x, int y)
}
declare 60 generic {
- void Tk_DrawFocusHighlight (Tk_Window tkwin, GC gc, int width, \
+ void Tk_DrawFocusHighlight (Tk_Window tkwin, GC gc, int width,
Drawable drawable)
}
declare 61 generic {
- void Tk_DrawTextLayout (Display *display, \
- Drawable drawable, GC gc, Tk_TextLayout layout, \
+ void Tk_DrawTextLayout (Display *display,
+ Drawable drawable, GC gc, Tk_TextLayout layout,
int x, int y, int firstChar, int lastChar)
}
declare 62 generic {
- void Tk_Fill3DPolygon (Tk_Window tkwin, \
- Drawable drawable, Tk_3DBorder border, \
- XPoint *pointPtr, int numPoints, int borderWidth, \
+ void Tk_Fill3DPolygon (Tk_Window tkwin,
+ Drawable drawable, Tk_3DBorder border,
+ XPoint *pointPtr, int numPoints, int borderWidth,
int leftRelief)
}
declare 63 generic {
- void Tk_Fill3DRectangle (Tk_Window tkwin, \
- Drawable drawable, Tk_3DBorder border, int x, \
- int y, int width, int height, int borderWidth, \
+ void Tk_Fill3DRectangle (Tk_Window tkwin,
+ Drawable drawable, Tk_3DBorder border, int x,
+ int y, int width, int height, int borderWidth,
int relief)
}
declare 64 generic {
- Tk_PhotoHandle Tk_FindPhoto (Tcl_Interp *interp, char *imageName)
+ Tk_PhotoHandle Tk_FindPhoto (Tcl_Interp *interp, CONST char *imageName)
}
declare 65 generic {
@@ -391,7 +392,7 @@ declare 73 generic {
}
declare 74 generic {
- void Tk_FreeOptions (Tk_ConfigSpec *specs, \
+ void Tk_FreeOptions (Tk_ConfigSpec *specs,
char *widgRec, Display *display, int needFlags)
}
@@ -416,28 +417,28 @@ declare 79 generic {
}
declare 80 generic {
- Tk_3DBorder Tk_Get3DBorder (Tcl_Interp *interp, Tk_Window tkwin, \
+ Tk_3DBorder Tk_Get3DBorder (Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid colorName)
}
declare 81 generic {
- void Tk_GetAllBindings (Tcl_Interp *interp, \
+ void Tk_GetAllBindings (Tcl_Interp *interp,
Tk_BindingTable bindingTable, ClientData object)
}
declare 82 generic {
- int Tk_GetAnchor (Tcl_Interp *interp, \
- char *str, Tk_Anchor *anchorPtr)
+ int Tk_GetAnchor (Tcl_Interp *interp,
+ CONST char *str, Tk_Anchor *anchorPtr)
}
declare 83 generic {
- char * Tk_GetAtomName (Tk_Window tkwin, Atom atom)
+ CONST84_RETURN char * Tk_GetAtomName (Tk_Window tkwin, Atom atom)
}
declare 84 generic {
- char * Tk_GetBinding (Tcl_Interp *interp, \
- Tk_BindingTable bindingTable, ClientData object, \
- char *eventStr)
+ CONST84_RETURN char * Tk_GetBinding (Tcl_Interp *interp,
+ Tk_BindingTable bindingTable, ClientData object,
+ CONST char *eventStr)
}
declare 85 generic {
@@ -445,12 +446,12 @@ declare 85 generic {
}
declare 86 generic {
- Pixmap Tk_GetBitmapFromData (Tcl_Interp *interp, \
- Tk_Window tkwin, char *source, int width, int height)
+ Pixmap Tk_GetBitmapFromData (Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *source, int width, int height)
}
declare 87 generic {
- int Tk_GetCapStyle (Tcl_Interp *interp, char *str, int *capPtr)
+ int Tk_GetCapStyle (Tcl_Interp *interp, CONST char *str, int *capPtr)
}
declare 88 generic {
@@ -462,23 +463,24 @@ declare 89 generic {
}
declare 90 generic {
- Colormap Tk_GetColormap (Tcl_Interp *interp, Tk_Window tkwin, char *str)
+ Colormap Tk_GetColormap (Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *str)
}
declare 91 generic {
- Tk_Cursor Tk_GetCursor (Tcl_Interp *interp, Tk_Window tkwin, \
+ Tk_Cursor Tk_GetCursor (Tcl_Interp *interp, Tk_Window tkwin,
Tk_Uid str)
}
declare 92 generic {
- Tk_Cursor Tk_GetCursorFromData (Tcl_Interp *interp, \
- Tk_Window tkwin, char *source, char *mask, \
- int width, int height, int xHot, int yHot, \
+ Tk_Cursor Tk_GetCursorFromData (Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *source, CONST char *mask,
+ int width, int height, int xHot, int yHot,
Tk_Uid fg, Tk_Uid bg)
}
declare 93 generic {
- Tk_Font Tk_GetFont (Tcl_Interp *interp, \
+ Tk_Font Tk_GetFont (Tcl_Interp *interp,
Tk_Window tkwin, CONST char *str)
}
@@ -495,13 +497,13 @@ declare 96 generic {
}
declare 97 generic {
- Tk_Image Tk_GetImage (Tcl_Interp *interp, Tk_Window tkwin, char *name, \
+ Tk_Image Tk_GetImage (Tcl_Interp *interp, Tk_Window tkwin, CONST char *name,
Tk_ImageChangedProc *changeProc, ClientData clientData)
}
declare 98 generic {
- ClientData Tk_GetImageMasterData (Tcl_Interp *interp, \
- char *name, Tk_ImageType **typePtrPtr)
+ ClientData Tk_GetImageMasterData (Tcl_Interp *interp,
+ CONST char *name, Tk_ImageType **typePtrPtr)
}
declare 99 generic {
@@ -509,12 +511,12 @@ declare 99 generic {
}
declare 100 generic {
- int Tk_GetJoinStyle (Tcl_Interp *interp, char *str, int *joinPtr)
+ int Tk_GetJoinStyle (Tcl_Interp *interp, CONST char *str, int *joinPtr)
}
declare 101 generic {
- int Tk_GetJustify (Tcl_Interp *interp, \
- char *str, Tk_Justify *justifyPtr)
+ int Tk_GetJustify (Tcl_Interp *interp,
+ CONST char *str, Tk_Justify *justifyPtr)
}
declare 102 generic {
@@ -522,21 +524,22 @@ declare 102 generic {
}
declare 103 generic {
- Tk_Uid Tk_GetOption (Tk_Window tkwin, char *name, char *className)
+ Tk_Uid Tk_GetOption (Tk_Window tkwin, CONST char *name,
+ CONST char *className)
}
declare 104 generic {
- int Tk_GetPixels (Tcl_Interp *interp, \
- Tk_Window tkwin, char *str, int *intPtr)
+ int Tk_GetPixels (Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *str, int *intPtr)
}
declare 105 generic {
- Pixmap Tk_GetPixmap (Display *display, Drawable d, \
+ Pixmap Tk_GetPixmap (Display *display, Drawable d,
int width, int height, int depth)
}
declare 106 generic {
- int Tk_GetRelief (Tcl_Interp *interp, char *name, int *reliefPtr)
+ int Tk_GetRelief (Tcl_Interp *interp, CONST char *name, int *reliefPtr)
}
declare 107 generic {
@@ -544,18 +547,18 @@ declare 107 generic {
}
declare 108 generic {
- int Tk_GetScrollInfo (Tcl_Interp *interp, \
- int argc, char **argv, double *dblPtr, int *intPtr)
+ int Tk_GetScrollInfo (Tcl_Interp *interp,
+ int argc, CONST84 char **argv, double *dblPtr, int *intPtr)
}
declare 109 generic {
- int Tk_GetScreenMM (Tcl_Interp *interp, \
- Tk_Window tkwin, char *str, double *doublePtr)
+ int Tk_GetScreenMM (Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *str, double *doublePtr)
}
declare 110 generic {
- int Tk_GetSelection (Tcl_Interp *interp, \
- Tk_Window tkwin, Atom selection, Atom target, \
+ int Tk_GetSelection (Tcl_Interp *interp,
+ Tk_Window tkwin, Atom selection, Atom target,
Tk_GetSelProc *proc, ClientData clientData)
}
@@ -564,13 +567,13 @@ declare 111 generic {
}
declare 112 generic {
- Visual * Tk_GetVisual (Tcl_Interp *interp, \
- Tk_Window tkwin, char *str, int *depthPtr, \
+ Visual * Tk_GetVisual (Tcl_Interp *interp,
+ Tk_Window tkwin, CONST char *str, int *depthPtr,
Colormap *colormapPtr)
}
declare 113 generic {
- void Tk_GetVRootGeometry (Tk_Window tkwin, \
+ void Tk_GetVRootGeometry (Tk_Window tkwin,
int *xPtr, int *yPtr, int *widthPtr, int *heightPtr)
}
@@ -587,7 +590,7 @@ declare 116 generic {
}
declare 117 generic {
- void Tk_ImageChanged (Tk_ImageMaster master, int x, int y, \
+ void Tk_ImageChanged (Tk_ImageMaster master, int x, int y,
int width, int height, int imageWidth, int imageHeight)
}
@@ -596,16 +599,16 @@ declare 118 generic {
}
declare 119 generic {
- Atom Tk_InternAtom (Tk_Window tkwin, char *name)
+ Atom Tk_InternAtom (Tk_Window tkwin, CONST char *name)
}
declare 120 generic {
- int Tk_IntersectTextLayout (Tk_TextLayout layout, int x, int y, \
+ int Tk_IntersectTextLayout (Tk_TextLayout layout, int x, int y,
int width, int height)
}
declare 121 generic {
- void Tk_MaintainGeometry (Tk_Window slave, \
+ void Tk_MaintainGeometry (Tk_Window slave,
Tk_Window master, int x, int y, int width, int height)
}
@@ -618,7 +621,7 @@ declare 123 generic {
}
declare 124 generic {
- void Tk_ManageGeometry (Tk_Window tkwin, \
+ void Tk_ManageGeometry (Tk_Window tkwin,
Tk_GeomMgr *mgrPtr, ClientData clientData)
}
@@ -627,13 +630,13 @@ declare 125 generic {
}
declare 126 generic {
- int Tk_MeasureChars (Tk_Font tkfont, \
- CONST char *source, int numBytes, int maxPixels, \
+ int Tk_MeasureChars (Tk_Font tkfont,
+ CONST char *source, int numBytes, int maxPixels,
int flags, int *lengthPtr)
}
declare 127 generic {
- void Tk_MoveResizeWindow (Tk_Window tkwin, \
+ void Tk_MoveResizeWindow (Tk_Window tkwin,
int x, int y, int width, int height)
}
@@ -646,76 +649,76 @@ declare 129 generic {
}
declare 130 generic {
- char * Tk_NameOf3DBorder (Tk_3DBorder border)
+ CONST84_RETURN char * Tk_NameOf3DBorder (Tk_3DBorder border)
}
declare 131 generic {
- char * Tk_NameOfAnchor (Tk_Anchor anchor)
+ CONST84_RETURN char * Tk_NameOfAnchor (Tk_Anchor anchor)
}
declare 132 generic {
- char * Tk_NameOfBitmap (Display *display, Pixmap bitmap)
+ CONST84_RETURN char * Tk_NameOfBitmap (Display *display, Pixmap bitmap)
}
declare 133 generic {
- char * Tk_NameOfCapStyle (int cap)
+ CONST84_RETURN char * Tk_NameOfCapStyle (int cap)
}
declare 134 generic {
- char * Tk_NameOfColor (XColor *colorPtr)
+ CONST84_RETURN char * Tk_NameOfColor (XColor *colorPtr)
}
declare 135 generic {
- char * Tk_NameOfCursor (Display *display, Tk_Cursor cursor)
+ CONST84_RETURN char * Tk_NameOfCursor (Display *display, Tk_Cursor cursor)
}
declare 136 generic {
- char * Tk_NameOfFont (Tk_Font font)
+ CONST84_RETURN char * Tk_NameOfFont (Tk_Font font)
}
declare 137 generic {
- char * Tk_NameOfImage (Tk_ImageMaster imageMaster)
+ CONST84_RETURN char * Tk_NameOfImage (Tk_ImageMaster imageMaster)
}
declare 138 generic {
- char * Tk_NameOfJoinStyle (int join)
+ CONST84_RETURN char * Tk_NameOfJoinStyle (int join)
}
declare 139 generic {
- char * Tk_NameOfJustify (Tk_Justify justify)
+ CONST84_RETURN char * Tk_NameOfJustify (Tk_Justify justify)
}
declare 140 generic {
- char * Tk_NameOfRelief (int relief)
+ CONST84_RETURN char * Tk_NameOfRelief (int relief)
}
declare 141 generic {
- Tk_Window Tk_NameToWindow (Tcl_Interp *interp, \
- char *pathName, Tk_Window tkwin)
+ Tk_Window Tk_NameToWindow (Tcl_Interp *interp,
+ CONST char *pathName, Tk_Window tkwin)
}
declare 142 generic {
- void Tk_OwnSelection (Tk_Window tkwin, \
- Atom selection, Tk_LostSelProc *proc, \
+ void Tk_OwnSelection (Tk_Window tkwin,
+ Atom selection, Tk_LostSelProc *proc,
ClientData clientData)
}
declare 143 generic {
- int Tk_ParseArgv (Tcl_Interp *interp, \
- Tk_Window tkwin, int *argcPtr, char **argv, \
+ int Tk_ParseArgv (Tcl_Interp *interp,
+ Tk_Window tkwin, int *argcPtr, CONST84 char **argv,
Tk_ArgvInfo *argTable, int flags)
}
declare 144 generic {
- void Tk_PhotoPutBlock (Tk_PhotoHandle handle, \
- Tk_PhotoImageBlock *blockPtr, int x, int y, \
+ void Tk_PhotoPutBlock_NoComposite (Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height)
}
declare 145 generic {
- void Tk_PhotoPutZoomedBlock (Tk_PhotoHandle handle, \
- Tk_PhotoImageBlock *blockPtr, int x, int y, \
- int width, int height, int zoomX, int zoomY, \
+ void Tk_PhotoPutZoomedBlock_NoComposite (Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock *blockPtr, int x, int y,
+ int width, int height, int zoomX, int zoomY,
int subsampleX, int subsampleY)
}
@@ -756,8 +759,8 @@ declare 154 generic {
}
declare 155 generic {
- void Tk_RedrawImage (Tk_Image image, int imageX, \
- int imageY, int width, int height, \
+ void Tk_RedrawImage (Tk_Image image, int imageX,
+ int imageY, int width, int height,
Drawable drawable, int drawableX, int drawableY)
}
@@ -770,7 +773,7 @@ declare 157 generic {
}
declare 158 generic {
- Tk_RestrictProc *Tk_RestrictEvents (Tk_RestrictProc *proc, \
+ Tk_RestrictProc *Tk_RestrictEvents (Tk_RestrictProc *proc,
ClientData arg, ClientData *prevArgPtr)
}
@@ -779,7 +782,7 @@ declare 159 generic {
}
declare 160 generic {
- char * Tk_SetAppName (Tk_Window tkwin, char *name)
+ CONST char * Tk_SetAppName (Tk_Window tkwin, CONST char *name)
}
declare 161 generic {
@@ -787,11 +790,11 @@ declare 161 generic {
}
declare 162 generic {
- void Tk_SetClass (Tk_Window tkwin, char *className)
+ void Tk_SetClass (Tk_Window tkwin, CONST char *className)
}
declare 163 generic {
- void Tk_SetGrid (Tk_Window tkwin, int reqWidth, int reqHeight, \
+ void Tk_SetGrid (Tk_Window tkwin, int reqWidth, int reqHeight,
int gridWidth, int gridHeight)
}
@@ -824,12 +827,12 @@ declare 170 generic {
}
declare 171 generic {
- int Tk_SetWindowVisual (Tk_Window tkwin, Visual *visual, int depth,\
+ int Tk_SetWindowVisual (Tk_Window tkwin, Visual *visual, int depth,
Colormap colormap)
}
declare 172 generic {
- void Tk_SizeOfBitmap (Display *display, Pixmap bitmap, int *widthPtr, \
+ void Tk_SizeOfBitmap (Display *display, Pixmap bitmap, int *widthPtr,
int *heightPtr)
}
@@ -854,15 +857,15 @@ declare 177 generic {
}
declare 178 generic {
- void Tk_UnderlineChars (Display *display, \
- Drawable drawable, GC gc, Tk_Font tkfont, \
- CONST char *source, int x, int y, int firstByte, \
+ void Tk_UnderlineChars (Display *display,
+ Drawable drawable, GC gc, Tk_Font tkfont,
+ CONST char *source, int x, int y, int firstByte,
int lastByte)
}
declare 179 generic {
- void Tk_UnderlineTextLayout (Display *display, Drawable drawable, GC gc, \
- Tk_TextLayout layout, int x, int y, \
+ void Tk_UnderlineTextLayout (Display *display, Drawable drawable, GC gc,
+ Tk_TextLayout layout, int x, int y,
int underline)
}
@@ -889,33 +892,33 @@ declare 184 generic {
# new functions for 8.1
declare 185 generic {
- Pixmap Tk_AllocBitmapFromObj (Tcl_Interp *interp, Tk_Window tkwin, \
+ Pixmap Tk_AllocBitmapFromObj (Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
declare 186 generic {
- Tk_3DBorder Tk_Alloc3DBorderFromObj (Tcl_Interp *interp, Tk_Window tkwin, \
+ Tk_3DBorder Tk_Alloc3DBorderFromObj (Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
declare 187 generic {
- XColor * Tk_AllocColorFromObj (Tcl_Interp *interp, Tk_Window tkwin, \
+ XColor * Tk_AllocColorFromObj (Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
declare 188 generic {
- Tk_Cursor Tk_AllocCursorFromObj (Tcl_Interp *interp, Tk_Window tkwin, \
+ Tk_Cursor Tk_AllocCursorFromObj (Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
declare 189 generic {
- Tk_Font Tk_AllocFontFromObj (Tcl_Interp *interp, Tk_Window tkwin, \
+ Tk_Font Tk_AllocFontFromObj (Tcl_Interp *interp, Tk_Window tkwin,
Tcl_Obj *objPtr)
}
declare 190 generic {
- Tk_OptionTable Tk_CreateOptionTable (Tcl_Interp *interp, \
+ Tk_OptionTable Tk_CreateOptionTable (Tcl_Interp *interp,
CONST Tk_OptionSpec *templatePtr)
}
@@ -936,7 +939,7 @@ declare 194 generic {
}
declare 195 generic {
- void Tk_FreeConfigOptions (char *recordPtr, Tk_OptionTable optionToken, \
+ void Tk_FreeConfigOptions (char *recordPtr, Tk_OptionTable optionToken,
Tk_Window tkwin)
}
@@ -958,7 +961,7 @@ declare 199 generic {
}
declare 200 generic {
- int Tk_GetAnchorFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr, \
+ int Tk_GetAnchorFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr,
Tk_Anchor *anchorPtr)
}
@@ -975,49 +978,48 @@ declare 203 generic {
}
declare 204 generic {
- Tcl_Obj * Tk_GetOptionInfo (Tcl_Interp *interp, \
- char *recordPtr, Tk_OptionTable optionTable, \
+ Tcl_Obj * Tk_GetOptionInfo (Tcl_Interp *interp,
+ char *recordPtr, Tk_OptionTable optionTable,
Tcl_Obj *namePtr, Tk_Window tkwin)
}
declare 205 generic {
- Tcl_Obj * Tk_GetOptionValue (Tcl_Interp *interp, char *recordPtr, \
+ Tcl_Obj * Tk_GetOptionValue (Tcl_Interp *interp, char *recordPtr,
Tk_OptionTable optionTable, Tcl_Obj *namePtr, Tk_Window tkwin)
}
declare 206 generic {
- int Tk_GetJustifyFromObj (Tcl_Interp *interp, \
+ int Tk_GetJustifyFromObj (Tcl_Interp *interp,
Tcl_Obj *objPtr, Tk_Justify *justifyPtr)
}
declare 207 generic {
- int Tk_GetMMFromObj (Tcl_Interp *interp, \
+ int Tk_GetMMFromObj (Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr, double *doublePtr)
}
declare 208 generic {
- int Tk_GetPixelsFromObj (Tcl_Interp *interp, \
+ int Tk_GetPixelsFromObj (Tcl_Interp *interp,
Tk_Window tkwin, Tcl_Obj *objPtr, int *intPtr)
}
declare 209 generic {
- int Tk_GetReliefFromObj (Tcl_Interp *interp, \
+ int Tk_GetReliefFromObj (Tcl_Interp *interp,
Tcl_Obj *objPtr, int *resultPtr)
}
declare 210 generic {
- int Tk_GetScrollInfoObj (Tcl_Interp *interp, \
+ int Tk_GetScrollInfoObj (Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[], double *dblPtr, int *intPtr)
}
declare 211 generic {
- int Tk_InitOptions (
- Tcl_Interp *interp, char *recordPtr, \
- Tk_OptionTable optionToken, Tk_Window tkwin)
+ int Tk_InitOptions (Tcl_Interp *interp, char *recordPtr,
+ Tk_OptionTable optionToken, Tk_Window tkwin)
}
declare 212 generic {
- void Tk_MainEx (int argc, char **argv, Tcl_AppInitProc *appInitProc, \
+ void Tk_MainEx (int argc, char **argv, Tcl_AppInitProc *appInitProc,
Tcl_Interp *interp)
}
@@ -1026,9 +1028,9 @@ declare 213 generic {
}
declare 214 generic {
- int Tk_SetOptions (Tcl_Interp *interp, char *recordPtr, \
- Tk_OptionTable optionTable, int objc, \
- Tcl_Obj *CONST objv[], Tk_Window tkwin, \
+ int Tk_SetOptions (Tcl_Interp *interp, char *recordPtr,
+ Tk_OptionTable optionTable, int objc,
+ Tcl_Obj *CONST objv[], Tk_Window tkwin,
Tk_SavedOptions *savePtr, int *maskPtr)
}
@@ -1062,70 +1064,186 @@ declare 222 generic {
void Tk_DeleteOutline (Display *display, Tk_Outline *outline)
}
declare 223 generic {
- int Tk_ConfigOutlineGC (XGCValues *gcValues, Tk_Canvas canvas, \
+ int Tk_ConfigOutlineGC (XGCValues *gcValues, Tk_Canvas canvas,
Tk_Item *item, Tk_Outline *outline)
}
declare 224 generic {
- int Tk_ChangeOutlineGC (Tk_Canvas canvas, Tk_Item *item, \
+ int Tk_ChangeOutlineGC (Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
declare 225 generic {
- int Tk_ResetOutlineGC (Tk_Canvas canvas, Tk_Item *item, \
+ int Tk_ResetOutlineGC (Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
declare 226 generic {
- int Tk_CanvasPsOutline (Tk_Canvas canvas, Tk_Item *item, \
+ int Tk_CanvasPsOutline (Tk_Canvas canvas, Tk_Item *item,
Tk_Outline *outline)
}
declare 227 generic {
void Tk_SetTSOrigin (Tk_Window tkwin, GC gc, int x, int y)
}
declare 228 generic {
- int Tk_CanvasGetCoordFromObj (Tcl_Interp *interp, Tk_Canvas canvas, \
+ int Tk_CanvasGetCoordFromObj (Tcl_Interp *interp, Tk_Canvas canvas,
Tcl_Obj *obj, double *doublePtr)
}
declare 229 generic {
void Tk_CanvasSetOffset (Tk_Canvas canvas, GC gc, Tk_TSOffset *offset)
}
declare 230 generic {
- void Tk_DitherPhoto (Tk_PhotoHandle handle, int x, int y, int width, \
+ void Tk_DitherPhoto (Tk_PhotoHandle handle, int x, int y, int width,
int height)
}
declare 231 generic {
- int Tk_PostscriptBitmap (Tcl_Interp *interp, Tk_Window tkwin, \
- Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX, \
+ int Tk_PostscriptBitmap (Tcl_Interp *interp, Tk_Window tkwin,
+ Tk_PostscriptInfo psInfo, Pixmap bitmap, int startX,
int startY, int width, int height)
}
declare 232 generic {
- int Tk_PostscriptColor (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, \
+ int Tk_PostscriptColor (Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
XColor *colorPtr)
}
declare 233 generic {
- int Tk_PostscriptFont (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, \
+ int Tk_PostscriptFont (Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
Tk_Font font)
}
declare 234 generic {
- int Tk_PostscriptImage (Tk_Image image, Tcl_Interp *interp, \
- Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y, \
+ int Tk_PostscriptImage (Tk_Image image, Tcl_Interp *interp,
+ Tk_Window tkwin, Tk_PostscriptInfo psinfo, int x, int y,
int width, int height, int prepass)
}
declare 235 generic {
- void Tk_PostscriptPath (Tcl_Interp *interp, Tk_PostscriptInfo psInfo, \
+ void Tk_PostscriptPath (Tcl_Interp *interp, Tk_PostscriptInfo psInfo,
double *coordPtr, int numPoints)
}
declare 236 generic {
- int Tk_PostscriptStipple (Tcl_Interp *interp, Tk_Window tkwin, \
+ int Tk_PostscriptStipple (Tcl_Interp *interp, Tk_Window tkwin,
Tk_PostscriptInfo psInfo, Pixmap bitmap)
}
declare 237 generic {
double Tk_PostscriptY (double y, Tk_PostscriptInfo psInfo)
}
declare 238 generic {
- int Tk_PostscriptPhoto (Tcl_Interp *interp, \
- Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo, \
+ int Tk_PostscriptPhoto (Tcl_Interp *interp,
+ Tk_PhotoImageBlock *blockPtr, Tk_PostscriptInfo psInfo,
int width, int height)
}
+# New in 8.4a1
+#
+declare 239 generic {
+ void Tk_CreateClientMessageHandler (Tk_ClientMessageProc *proc)
+}
+declare 240 generic {
+ void Tk_DeleteClientMessageHandler (Tk_ClientMessageProc *proc)
+}
+
+# New in 8.4a2
+#
+declare 241 generic {
+ Tk_Window Tk_CreateAnonymousWindow (Tcl_Interp *interp,
+ Tk_Window parent, CONST char *screenName)
+}
+declare 242 generic {
+ void Tk_SetClassProcs (Tk_Window tkwin,
+ Tk_ClassProcs *procs, ClientData instanceData)
+}
+
+# New in 8.4a4
+#
+declare 243 generic {
+ void Tk_SetInternalBorderEx (Tk_Window tkwin, int left, int right,
+ int top, int bottom)
+}
+declare 244 generic {
+ void Tk_SetMinimumRequestSize (Tk_Window tkwin,
+ int minWidth, int minHeight)
+}
+
+# New in 8.4a5
+#
+declare 245 generic {
+ void Tk_SetCaretPos (Tk_Window tkwin, int x, int y, int height)
+}
+
+declare 246 generic {
+ void Tk_PhotoPutBlock (Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock *blockPtr, int x, int y,
+ int width, int height, int compRule)
+}
+declare 247 generic {
+ void Tk_PhotoPutZoomedBlock (Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock *blockPtr, int x, int y,
+ int width, int height, int zoomX, int zoomY,
+ int subsampleX, int subsampleY, int compRule)
+}
+
+declare 248 generic {
+ int Tk_CollapseMotionEvents (Display *display, int collapse)
+}
+
+# Style engine
+declare 249 generic {
+ Tk_StyleEngine Tk_RegisterStyleEngine (CONST char *name,
+ Tk_StyleEngine parent)
+}
+declare 250 generic {
+ Tk_StyleEngine Tk_GetStyleEngine (CONST char *name)
+}
+declare 251 generic {
+ int Tk_RegisterStyledElement (Tk_StyleEngine engine,
+ Tk_ElementSpec *templatePtr)
+}
+declare 252 generic {
+ int Tk_GetElementId (CONST char *name)
+}
+declare 253 generic {
+ Tk_Style Tk_CreateStyle (CONST char *name, Tk_StyleEngine engine,
+ ClientData clientData)
+}
+declare 254 generic {
+ Tk_Style Tk_GetStyle (Tcl_Interp *interp, CONST char *name)
+}
+declare 255 generic {
+ void Tk_FreeStyle (Tk_Style style)
+}
+declare 256 generic {
+ CONST char * Tk_NameOfStyle (Tk_Style style)
+}
+declare 257 generic {
+ Tk_Style Tk_AllocStyleFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr)
+}
+declare 258 generic {
+ Tk_Style Tk_GetStyleFromObj (Tcl_Obj *objPtr)
+}
+declare 259 generic {
+ void Tk_FreeStyleFromObj (Tcl_Obj *objPtr)
+}
+declare 260 generic {
+ Tk_StyledElement Tk_GetStyledElement (Tk_Style style, int elementId,
+ Tk_OptionTable optionTable)
+}
+declare 261 generic {
+ void Tk_GetElementSize (Tk_Style style, Tk_StyledElement element,
+ char *recordPtr, Tk_Window tkwin, int width, int height,
+ int inner, int *widthPtr, int *heightPtr)
+}
+declare 262 generic {
+ void Tk_GetElementBox (Tk_Style style, Tk_StyledElement element,
+ char *recordPtr, Tk_Window tkwin, int x, int y, int width,
+ int height, int inner, int *xPtr, int *yPtr, int *widthPtr,
+ int *heightPtr)
+}
+declare 263 generic {
+ int Tk_GetElementBorderWidth (Tk_Style style, Tk_StyledElement element,
+ char *recordPtr, Tk_Window tkwin)
+}
+declare 264 generic {
+ void Tk_DrawElement (Tk_Style style, Tk_StyledElement element,
+ char *recordPtr, Tk_Window tkwin, Drawable d, int x, int y,
+ int width, int height, int state)
+}
+
+
# Define the platform specific public Tk interface. These functions are
# only available on the designated platform.
@@ -1157,18 +1275,18 @@ declare 4 win {
}
declare 5 win {
- int Tk_TranslateWinEvent (HWND hwnd, \
+ int Tk_TranslateWinEvent (HWND hwnd,
UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
}
# Mac specific functions
declare 0 mac {
- void Tk_MacSetEmbedHandler ( \
- Tk_MacEmbedRegisterWinProc *registerWinProcPtr, \
- Tk_MacEmbedGetGrafPortProc *getPortProcPtr, \
- Tk_MacEmbedMakeContainerExistProc *containerExistProcPtr, \
- Tk_MacEmbedGetClipProc *getClipProc, \
+ void Tk_MacSetEmbedHandler (
+ Tk_MacEmbedRegisterWinProc *registerWinProcPtr,
+ Tk_MacEmbedGetGrafPortProc *getPortProcPtr,
+ Tk_MacEmbedMakeContainerExistProc *containerExistProcPtr,
+ Tk_MacEmbedGetClipProc *getClipProc,
Tk_MacEmbedGetOffsetInParentProc *getOffsetProc)
}
@@ -1197,7 +1315,7 @@ declare 6 mac {
}
declare 7 mac {
- void TkGenWMConfigureEvent (Tk_Window tkwin, \
+ void TkGenWMConfigureEvent (Tk_Window tkwin,
int x, int y, int width, int height, int flags)
}
@@ -1213,3 +1331,54 @@ declare 10 mac {
GWorldPtr TkMacGetDrawablePort (Drawable drawable)
}
+# Mac OS X specific functions
+
+declare 0 aqua {
+ void Tk_MacOSXSetEmbedHandler ( \
+ Tk_MacOSXEmbedRegisterWinProc *registerWinProcPtr, \
+ Tk_MacOSXEmbedGetGrafPortProc *getPortProcPtr, \
+ Tk_MacOSXEmbedMakeContainerExistProc *containerExistProcPtr, \
+ Tk_MacOSXEmbedGetClipProc *getClipProc, \
+ Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)
+}
+
+declare 1 aqua {
+ void Tk_MacOSXTurnOffMenus (void)
+}
+
+declare 2 aqua {
+ void Tk_MacOSXTkOwnsCursor (int tkOwnsIt)
+}
+
+declare 3 aqua {
+ void TkMacOSXInitMenus (Tcl_Interp *interp)
+}
+
+declare 4 aqua {
+ void TkMacOSXInitAppleEvents (Tcl_Interp *interp)
+}
+
+declare 5 aqua {
+ void TkGenWMConfigureEvent (Tk_Window tkwin, \
+ int x, int y, int width, int height, int flags)
+}
+
+declare 6 aqua {
+ void TkMacOSXInvalClipRgns (TkWindow *winPtr)
+}
+
+declare 7 aqua {
+ GWorldPtr TkMacOSXGetDrawablePort (Drawable drawable)
+}
+
+declare 8 aqua {
+ ControlRef TkMacOSXGetRootControl (Drawable drawable)
+}
+
+declare 9 aqua {
+ void Tk_MacOSXSetupTkNotifier (void)
+}
+
+declare 10 aqua {
+ int Tk_MacOSXIsAppInFront (void)
+}
diff --git a/tk/generic/tk.h b/tk/generic/tk.h
index c4eb7145d56..49f7940a736 100644
--- a/tk/generic/tk.h
+++ b/tk/generic/tk.h
@@ -39,26 +39,34 @@ extern "C" {
* win/README (not patchlevel)
* unix/README (not patchlevel)
* unix/tk.spec (3 LOC Major/Minor, 2 LOC patch)
- * win/aclocal.m4 (not patchlevel)
+ * win/tcl.m4 (not patchlevel)
*
* You may also need to update some of these files when the numbers change
* for the version of Tcl that this release of Tk is compiled against.
*/
#define TK_MAJOR_VERSION 8
-#define TK_MINOR_VERSION 3
+#define TK_MINOR_VERSION 4
#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
-#define TK_RELEASE_SERIAL 2
+#define TK_RELEASE_SERIAL 0
-#define TK_VERSION "8.3"
-#define TK_PATCH_LEVEL "8.3.2"
+#define TK_VERSION "8.4"
+#define TK_PATCH_LEVEL "8.4.0"
/*
+ * A special define for MacOS & MacOS X, allows us to use the header
+ * in the resource compiler without having it choke on the more complex
+ * C preprocessor constructs.
+ */
+
+#ifndef RESOURCE_INCLUDED
+
+/*
* The following definitions set up the proper options for Macintosh
* compilers. We use this method because there is no autoconf equivalent.
*/
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
# ifndef REDO_KEYSYM_LOOKUP
# define REDO_KEYSYM_LOOKUP
# endif
@@ -66,6 +74,9 @@ extern "C" {
#ifndef _TCL
# include <tcl.h>
+# if (TCL_MAJOR_VERSION != 8) || (TCL_MINOR_VERSION != 4)
+# error Tk 8.4 must be compiled with tcl.h from Tcl 8.4
+# endif
#endif
/*
@@ -73,12 +84,15 @@ extern "C" {
* in resource files.
*/
-#ifndef RESOURCE_INCLUDED
+#ifndef RC_INVOKED
#ifndef _XLIB_H
-# ifdef MAC_TCL
+# if defined (MAC_TCL)
# include <Xlib.h>
# include <X.h>
+# elif defined(MAC_OSX_TK)
+# include <X11/Xlib.h>
+# include <X11/X.h>
# else
# include <X11/Xlib.h>
# endif
@@ -116,12 +130,15 @@ typedef struct Tk_PostscriptInfo_ *Tk_PostscriptInfo;
typedef struct Tk_TextLayout_ *Tk_TextLayout;
typedef struct Tk_Window_ *Tk_Window;
typedef struct Tk_3DBorder_ *Tk_3DBorder;
+typedef struct Tk_Style_ *Tk_Style;
+typedef struct Tk_StyleEngine_ *Tk_StyleEngine;
+typedef struct Tk_StyledElement_ *Tk_StyledElement;
/*
* Additional types exported to clients.
*/
-typedef char *Tk_Uid;
+typedef CONST char *Tk_Uid;
/*
* The enum below defines the valid types for Tk configuration options
@@ -145,9 +162,9 @@ typedef enum {
TK_OPTION_SYNONYM,
TK_OPTION_PIXELS,
TK_OPTION_WINDOW,
-/* CYGNUS LOCAL: Support -version argument. */
- TK_OPTION_VERSION,
- TK_OPTION_END
+ TK_OPTION_END,
+ TK_OPTION_CUSTOM,
+ TK_OPTION_STYLE
} Tk_OptionType;
/*
@@ -203,8 +220,41 @@ typedef struct Tk_OptionSpec {
* carefully.
*/
-#define TK_OPTION_NULL_OK 1
-#define TK_OPTION_DONT_SET_DEFAULT 8
+#define TK_OPTION_NULL_OK (1 << 0)
+#define TK_OPTION_DONT_SET_DEFAULT (1 << 3)
+
+/*
+ * The following structure and function types are used by TK_OPTION_CUSTOM
+ * options; the structure holds pointers to the functions needed by the Tk
+ * option config code to handle a custom option.
+ */
+
+typedef int (Tk_CustomOptionSetProc) _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj **value, char *widgRec,
+ int offset, char *saveInternalPtr, int flags));
+typedef Tcl_Obj *(Tk_CustomOptionGetProc) _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin, char *widgRec, int offset));
+typedef void (Tk_CustomOptionRestoreProc) _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin, char *internalPtr, char *saveInternalPtr));
+typedef void (Tk_CustomOptionFreeProc) _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin, char *internalPtr));
+
+typedef struct Tk_ObjCustomOption {
+ char *name; /* Name of the custom option. */
+ Tk_CustomOptionSetProc *setProc; /* Function to use to set a record's
+ * option value from a Tcl_Obj */
+ Tk_CustomOptionGetProc *getProc; /* Function to use to get a Tcl_Obj
+ * representation from an internal
+ * representation of an option. */
+ Tk_CustomOptionRestoreProc *restoreProc; /* Function to use to restore a
+ * saved value for the internal
+ * representation. */
+ Tk_CustomOptionFreeProc *freeProc; /* Function to use to free the internal
+ * representation of an option. */
+ ClientData clientData; /* Arbitrary one-word value passed to
+ * the handling procs. */
+} Tk_ObjCustomOption;
+
/*
* Macro to use to fill in "offset" fields of the Tk_OptionSpec.
@@ -286,7 +336,7 @@ typedef struct Tk_SavedOptions {
#ifndef __NO_OLD_CONFIG
typedef int (Tk_OptionParseProc) _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, Tk_Window tkwin, char *value, char *widgRec,
+ Tcl_Interp *interp, Tk_Window tkwin, CONST84 char *value, char *widgRec,
int offset));
typedef char *(Tk_OptionPrintProc) _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
@@ -317,9 +367,9 @@ typedef struct Tk_ConfigSpec {
* table must have type TK_CONFIG_END. */
char *argvName; /* Switch used to specify option in argv.
* NULL means this spec is part of a group. */
- char *dbName; /* Name for option in option database. */
- char *dbClass; /* Class for option in database. */
- char *defValue; /* Default value for option if not
+ 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 Tk_Offset macro to generate values
@@ -362,11 +412,11 @@ typedef enum {
* tkOldConfig.c (internal-use-only flags are defined there).
*/
-#define TK_CONFIG_NULL_OK 1
-#define TK_CONFIG_COLOR_ONLY 2
-#define TK_CONFIG_MONO_ONLY 4
-#define TK_CONFIG_DONT_SET_DEFAULT 8
-#define TK_CONFIG_OPTION_SPECIFIED 0x10
+#define TK_CONFIG_NULL_OK (1 << 0)
+#define TK_CONFIG_COLOR_ONLY (1 << 1)
+#define TK_CONFIG_MONO_ONLY (1 << 2)
+#define TK_CONFIG_DONT_SET_DEFAULT (1 << 3)
+#define TK_CONFIG_OPTION_SPECIFIED (1 << 4)
#define TK_CONFIG_USER_BIT 0x100
#endif /* __NO_OLD_CONFIG */
@@ -402,9 +452,7 @@ typedef struct {
#define TK_ARGV_CONST_OPTION 24
#define TK_ARGV_OPTION_VALUE 25
#define TK_ARGV_OPTION_NAME_VALUE 26
-/* CYGNUS LOCAL: Support -version argument. */
-#define TK_ARGV_VERSION 27
-#define TK_ARGV_END 28
+#define TK_ARGV_END 27
/*
* Flag bits for passing to Tk_ParseArgv:
@@ -438,6 +486,7 @@ typedef enum {
* Relief values returned by Tk_GetRelief:
*/
+#define TK_RELIEF_NULL -1
#define TK_RELIEF_FLAT 0
#define TK_RELIEF_GROOVE 1
#define TK_RELIEF_RAISED 2
@@ -517,6 +566,51 @@ typedef struct Tk_FontMetrics {
#define TK_IGNORE_NEWLINES 16
/*
+ * Widget class procedures used to implement platform specific widget
+ * behavior.
+ */
+
+typedef Window (Tk_ClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin,
+ Window parent, ClientData instanceData));
+typedef void (Tk_ClassWorldChangedProc) _ANSI_ARGS_((ClientData instanceData));
+typedef void (Tk_ClassModalProc) _ANSI_ARGS_((Tk_Window tkwin,
+ XEvent *eventPtr));
+
+typedef struct Tk_ClassProcs {
+ unsigned int size;
+ Tk_ClassWorldChangedProc *worldChangedProc;
+ /* Procedure to invoke when the widget needs to
+ * respond in some way to a change in the
+ * world (font changes, etc.) */
+ Tk_ClassCreateProc *createProc;
+ /* Procedure to invoke when the
+ * platform-dependent window needs to be
+ * created. */
+ Tk_ClassModalProc *modalProc;
+ /* Procedure to invoke after all bindings on a
+ * widget have been triggered in order to
+ * handle a modal loop. */
+} Tk_ClassProcs;
+
+/*
+ * Simple accessor for Tk_ClassProcs structure. Checks that the structure
+ * is not NULL, then checks the size field and returns either the requested
+ * field, if present, or NULL if the structure is too small to have the field
+ * (or NULL if the structure is NULL).
+ *
+ * A more general version of this function may be useful if other
+ * size-versioned structure pop up in the future:
+ *
+ * #define Tk_GetField(name, who, which) \
+ * (((who) == NULL) ? NULL :
+ * (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which))
+ */
+
+#define Tk_GetClassProc(procs, which) \
+ (((procs) == NULL) ? NULL : \
+ (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which))
+
+/*
* Each geometry manager (the packer, the placer, etc.) is represented
* by a structure of the following form, which indicates procedures
* to invoke in the geometry manager to carry out certain functions.
@@ -639,10 +733,27 @@ typedef XActivateDeactivateEvent XDeactivateEvent;
(((Tk_FakeWin *) (tkwin))->flags & TK_MAPPED)
#define Tk_IsTopLevel(tkwin) \
(((Tk_FakeWin *) (tkwin))->flags & TK_TOP_LEVEL)
+#define Tk_HasWrapper(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->flags & TK_HAS_WRAPPER)
+#define Tk_WinManaged(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->flags & TK_WIN_MANAGED)
+#define Tk_TopWinHierarchy(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY)
#define Tk_ReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->reqWidth)
#define Tk_ReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->reqHeight)
+/* Tk_InternalBorderWidth is deprecated */
#define Tk_InternalBorderWidth(tkwin) \
- (((Tk_FakeWin *) (tkwin))->internalBorderWidth)
+ (((Tk_FakeWin *) (tkwin))->internalBorderLeft)
+#define Tk_InternalBorderLeft(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->internalBorderLeft)
+#define Tk_InternalBorderRight(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->internalBorderRight)
+#define Tk_InternalBorderTop(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->internalBorderTop)
+#define Tk_InternalBorderBottom(tkwin) \
+ (((Tk_FakeWin *) (tkwin))->internalBorderBottom)
+#define Tk_MinReqWidth(tkwin) (((Tk_FakeWin *) (tkwin))->minReqWidth)
+#define Tk_MinReqHeight(tkwin) (((Tk_FakeWin *) (tkwin))->minReqHeight)
#define Tk_Parent(tkwin) (((Tk_FakeWin *) (tkwin))->parentPtr)
#define Tk_Colormap(tkwin) (((Tk_FakeWin *) (tkwin))->atts.colormap)
@@ -659,40 +770,45 @@ typedef XActivateDeactivateEvent XDeactivateEvent;
typedef struct Tk_FakeWin {
Display *display;
- char *dummy1;
+ char *dummy1; /* dispPtr */
int screenNum;
Visual *visual;
int depth;
Window window;
- char *dummy2;
- char *dummy3;
- Tk_Window parentPtr;
- char *dummy4;
- char *dummy5;
+ char *dummy2; /* childList */
+ char *dummy3; /* lastChildPtr */
+ Tk_Window parentPtr; /* parentPtr */
+ char *dummy4; /* nextPtr */
+ char *dummy5; /* mainPtr */
char *pathName;
Tk_Uid nameUid;
Tk_Uid classUid;
XWindowChanges changes;
- unsigned int dummy6;
+ unsigned int dummy6; /* dirtyChanges */
XSetWindowAttributes atts;
- unsigned long dummy7;
+ unsigned long dummy7; /* dirtyAtts */
unsigned int flags;
- char *dummy8;
+ char *dummy8; /* handlerList */
#ifdef TK_USE_INPUT_METHODS
- XIC dummy9;
+ XIC dummy9; /* inputContext */
#endif /* TK_USE_INPUT_METHODS */
- ClientData *dummy10;
- int dummy11;
- int dummy12;
- char *dummy13;
- char *dummy14;
- ClientData dummy15;
+ ClientData *dummy10; /* tagPtr */
+ int dummy11; /* numTags */
+ int dummy12; /* optionLevel */
+ char *dummy13; /* selHandlerList */
+ char *dummy14; /* geomMgrPtr */
+ ClientData dummy15; /* geomData */
int reqWidth, reqHeight;
- int internalBorderWidth;
- char *dummy16;
- char *dummy17;
- ClientData dummy18;
- char *dummy19;
+ int internalBorderLeft;
+ char *dummy16; /* wmInfoPtr */
+ char *dummy17; /* classProcPtr */
+ ClientData dummy18; /* instanceData */
+ char *dummy19; /* privatePtr */
+ int internalBorderRight;
+ int internalBorderTop;
+ int internalBorderBottom;
+ int minReqWidth;
+ int minReqHeight;
} Tk_FakeWin;
/*
@@ -700,9 +816,7 @@ typedef struct Tk_FakeWin {
*
* TK_MAPPED: 1 means window is currently mapped,
* 0 means unmapped.
- * TK_TOP_LEVEL: 1 means this is a top-level window (it
- * was or will be created as a child of
- * a root window).
+ * TK_TOP_LEVEL: 1 means this is a top-level widget.
* TK_ALREADY_DEAD: 1 means the window is in the process of
* being destroyed already.
* TK_NEED_CONFIG_NOTIFY: 1 means that the window has been reconfigured
@@ -752,6 +866,20 @@ typedef struct Tk_FakeWin {
* concerned it isn't a child of its Tk
* parent. Initially this is used only for
* special Unix menubar windows.
+ * TK_ANONYMOUS_WINDOW: 1 means that this window has no name, and is
+ * thus not accessible from Tk.
+ * TK_HAS_WRAPPER 1 means that this window has a wrapper window
+ * TK_WIN_MANAGED 1 means that this window is a child of the
+ * root window, and is managed by the window
+ * manager.
+ * TK_TOP_HIERARCHY 1 means this window is at the top of a
+ * physical window hierarchy within this
+ * process, i.e. the window's parent
+ * either doesn't exist or is not owned by
+ * this Tk application.
+ * TK_PROP_PROPCHANGE 1 means that PropertyNotify events in
+ * this window's children should propagate
+ * up to this window.
*/
@@ -769,6 +897,11 @@ typedef struct Tk_FakeWin {
#define TK_DEFER_MODAL 0x800
#define TK_WRAPPER 0x1000
#define TK_REPARENTED 0x2000
+#define TK_ANONYMOUS_WINDOW 0x4000
+#define TK_HAS_WRAPPER 0x8000
+#define TK_WIN_MANAGED 0x10000
+#define TK_TOP_HIERARCHY 0x20000
+#define TK_PROP_PROPCHANGE 0x40000
/*
*--------------------------------------------------------------
@@ -1175,6 +1308,15 @@ typedef struct Tk_PhotoImageBlock {
} Tk_PhotoImageBlock;
/*
+ * The following values control how blocks are combined into photo
+ * images when the alpha component of a pixel is not 255, a.k.a. the
+ * compositing rule.
+ */
+
+#define TK_PHOTO_COMPOSITE_OVERLAY 0
+#define TK_PHOTO_COMPOSITE_SET 1
+
+/*
* Procedure prototypes and structures used in reading and
* writing photo images:
*/
@@ -1183,14 +1325,14 @@ typedef struct Tk_PhotoImageFormat Tk_PhotoImageFormat;
#ifdef USE_OLD_IMAGE
typedef int (Tk_ImageFileMatchProc) _ANSI_ARGS_((Tcl_Channel chan,
char *fileName, char *formatString, int *widthPtr, int *heightPtr));
-typedef int (Tk_ImageStringMatchProc) _ANSI_ARGS_((Tcl_Obj *dataObj,
+typedef int (Tk_ImageStringMatchProc) _ANSI_ARGS_((char *string,
char *formatString, int *widthPtr, int *heightPtr));
typedef int (Tk_ImageFileReadProc) _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Channel chan, char *fileName, char *formatString,
Tk_PhotoHandle imageHandle, int destX, int destY,
int width, int height, int srcX, int srcY));
typedef int (Tk_ImageStringReadProc) _ANSI_ARGS_((Tcl_Interp *interp,
- Tcl_Obj *dataObj, char *formatString, Tk_PhotoHandle imageHandle,
+ char *string, char *formatString, Tk_PhotoHandle imageHandle,
int destX, int destY, int width, int height, int srcX, int srcY));
typedef int (Tk_ImageFileWriteProc) _ANSI_ARGS_((Tcl_Interp *interp,
char *fileName, char *formatString, Tk_PhotoImageBlock *blockPtr));
@@ -1265,6 +1407,77 @@ EXTERN void Tk_CreateOldPhotoImageFormat _ANSI_ARGS_((
/*
*--------------------------------------------------------------
*
+ * Procedure prototypes and structures used for managing styles:
+ *
+ *--------------------------------------------------------------
+ */
+
+/*
+ * Style support version tag.
+ */
+#define TK_STYLE_VERSION_1 0x1
+#define TK_STYLE_VERSION TK_STYLE_VERSION_1
+
+/*
+ * The following structures and prototypes are used as static templates to
+ * declare widget elements.
+ */
+
+typedef void (Tk_GetElementSizeProc) _ANSI_ARGS_((ClientData clientData,
+ char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin,
+ int width, int height, int inner, int *widthPtr, int *heightPtr));
+typedef void (Tk_GetElementBoxProc) _ANSI_ARGS_((ClientData clientData,
+ char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin,
+ int x, int y, int width, int height, int inner, int *xPtr, int *yPtr,
+ int *widthPtr, int *heightPtr));
+typedef int (Tk_GetElementBorderWidthProc) _ANSI_ARGS_((ClientData clientData,
+ char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin));
+typedef void (Tk_DrawElementProc) _ANSI_ARGS_((ClientData clientData,
+ char *recordPtr, CONST Tk_OptionSpec **optionsPtr, Tk_Window tkwin,
+ Drawable d, int x, int y, int width, int height, int state));
+
+typedef struct Tk_ElementOptionSpec {
+ char *name; /* Name of the required option. */
+ Tk_OptionType type; /* Accepted option type. TK_OPTION_END means
+ * any. */
+} Tk_ElementOptionSpec;
+
+typedef struct Tk_ElementSpec {
+ int version; /* Version of the style support. */
+ char *name; /* Name of element. */
+ Tk_ElementOptionSpec *options;
+ /* List of required options. Last one's name
+ * must be NULL. */
+
+ /*
+ * Hooks
+ */
+
+ Tk_GetElementSizeProc *getSize;
+ /* Compute the external (resp. internal) size of
+ * the element from its desired internal (resp.
+ * external) size. */
+ Tk_GetElementBoxProc *getBox;
+ /* Compute the inscribed or bounding boxes
+ * within a given area. */
+ Tk_GetElementBorderWidthProc *getBorderWidth;
+ /* Return the element's internal border width.
+ * Mostly useful for widgets. */
+ Tk_DrawElementProc *draw; /* Draw the element in the given bounding box.*/
+} Tk_ElementSpec;
+
+/*
+ * Element state flags. Can be OR'ed.
+ */
+
+#define TK_ELEMENT_STATE_ACTIVE 1<<0
+#define TK_ELEMENT_STATE_DISABLED 1<<1
+#define TK_ELEMENT_STATE_FOCUS 1<<2
+#define TK_ELEMENT_STATE_PRESSED 1<<3
+
+/*
+ *--------------------------------------------------------------
+ *
* The definitions below provide backward compatibility for
* functions and types related to event handling that used to
* be in Tk but have moved to Tcl.
@@ -1301,7 +1514,6 @@ EXTERN void Tk_CreateOldPhotoImageFormat _ANSI_ARGS_((
/* Additional stuff that has moved to Tcl: */
-#define Tk_AfterCmd Tcl_AfterCmd
#define Tk_EventuallyFree Tcl_EventuallyFree
#define Tk_FreeProc Tcl_FreeProc
#define Tk_Preserve Tcl_Preserve
@@ -1311,7 +1523,7 @@ EXTERN void Tk_CreateOldPhotoImageFormat _ANSI_ARGS_((
#define Tk_Main(argc, argv, proc) \
Tk_MainEx(argc, argv, proc, Tcl_CreateInterp())
-char *Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, char *version, int exact));
+CONST char *Tk_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, char *version, int exact));
#ifndef USE_TK_STUBS
@@ -1343,6 +1555,8 @@ typedef void (Tk_EventProc) _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
typedef int (Tk_GenericProc) _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
+typedef int (Tk_ClientMessageProc) _ANSI_ARGS_((Tk_Window tkwin,
+ XEvent *eventPtr));
typedef int (Tk_GetSelProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, char *portion));
typedef void (Tk_LostSelProc) _ANSI_ARGS_((ClientData clientData));
@@ -1355,7 +1569,7 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
/*
*--------------------------------------------------------------
*
- * Exported procedures and variables.
+ * Platform independant exported procedures and variables.
*
*--------------------------------------------------------------
*/
@@ -1363,15 +1577,37 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
#include "tkDecls.h"
/*
+ * Allow users to say that they don't want to alter their source to
+ * add the extra argument to Tk_PhotoPutBlock(); DO NOT DEFINE THIS
+ * WHEN BUILDING TK.
+ *
+ * This goes after the inclusion of the stubbed-decls so that the
+ * declarations of what is actually there can be correct.
+ */
+
+#ifdef USE_COMPOSITELESS_PHOTO_PUT_BLOCK
+# ifdef Tk_PhotoPutBlock
+# undef Tk_PhotoPutBlock
+# endif
+# define Tk_PhotoPutBlock Tk_PhotoPutBlock_NoComposite
+# ifdef Tk_PhotoPutZoomedBlock
+# undef Tk_PhotoPutZoomedBlock
+# endif
+# define Tk_PhotoPutZoomedBlock Tk_PhotoPutZoomedBlock_NoComposite
+#endif /* USE_COMPOSITELESS_PHOTO_PUT_BLOCK */
+
+/*
* Tcl commands exported by Tk:
*/
-#endif /* RESOURCE_INCLUDED */
+#endif /* RC_INVOKED */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
+#endif /* RESOURCE_INCLUDED */
+
/*
* end block for C++
*/
@@ -1381,5 +1617,3 @@ typedef int (Tk_SelectionProc) _ANSI_ARGS_((ClientData clientData,
#endif
#endif /* _TK */
-
-
diff --git a/tk/generic/tk3d.c b/tk/generic/tk3d.c
index 3073d2dfcbd..670b002f7a4 100644
--- a/tk/generic/tk3d.c
+++ b/tk/generic/tk3d.c
@@ -20,8 +20,9 @@
* used by Tk_GetReliefFromObj.
*/
-static char *reliefStrings[] = {"flat", "groove", "raised", "ridge", "solid",
- "sunken", (char *) NULL};
+static CONST char *reliefStrings[] = {"flat", "groove", "raised",
+ "ridge", "solid", "sunken",
+ (char *) NULL};
/*
* Forward declarations for procedures defined in this file:
@@ -45,7 +46,7 @@ static void ShiftLine _ANSI_ARGS_((XPoint *p1Ptr, XPoint *p2Ptr,
* is set.
*/
-static Tcl_ObjType borderObjType = {
+Tcl_ObjType tkBorderObjType = {
"border", /* name */
FreeBorderObjProc, /* freeIntRepProc */
DupBorderObjProc, /* dupIntRepProc */
@@ -86,7 +87,7 @@ Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr)
{
TkBorder *borderPtr;
- if (objPtr->typePtr != &borderObjType) {
+ if (objPtr->typePtr != &tkBorderObjType) {
InitBorderObj(objPtr);
}
borderPtr = (TkBorder *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -185,7 +186,7 @@ Tk_Get3DBorder(interp, tkwin, colorName)
Tcl_Interp *interp; /* Place to store an error message. */
Tk_Window tkwin; /* Token for window in which border will
* be drawn. */
- char *colorName; /* String giving name of color
+ Tk_Uid colorName; /* String giving name of color
* for window background. */
{
Tcl_HashEntry *hashPtr;
@@ -323,7 +324,7 @@ Tk_Draw3DRectangle(tkwin, drawable, border, x, y, width, height,
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOf3DBorder(border)
Tk_3DBorder border; /* Token for border. */
{
@@ -651,7 +652,7 @@ Tk_GetReliefFromObj(interp, objPtr, resultPtr)
int
Tk_GetRelief(interp, name, reliefPtr)
Tcl_Interp *interp; /* For error messages. */
- char *name; /* Name of a relief type. */
+ CONST char *name; /* Name of a relief type. */
int *reliefPtr; /* Where to store converted relief. */
{
char c;
@@ -702,7 +703,7 @@ Tk_GetRelief(interp, name, reliefPtr)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfRelief(relief)
int relief; /* One of TK_RELIEF_FLAT, TK_RELIEF_RAISED,
* or TK_RELIEF_SUNKEN. */
@@ -719,6 +720,8 @@ Tk_NameOfRelief(relief)
return "ridge";
} else if (relief == TK_RELIEF_SOLID) {
return "solid";
+ } else if (relief == TK_RELIEF_NULL) {
+ return "";
} else {
return "unknown relief";
}
@@ -1260,7 +1263,7 @@ Tk_Get3DBorderFromObj(tkwin, objPtr)
Tcl_HashEntry *hashPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (objPtr->typePtr != &borderObjType) {
+ if (objPtr->typePtr != &tkBorderObjType) {
InitBorderObj(objPtr);
}
@@ -1353,7 +1356,7 @@ InitBorderObj(objPtr)
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
(*typePtr->freeIntRepProc)(objPtr);
}
- objPtr->typePtr = &borderObjType;
+ objPtr->typePtr = &tkBorderObjType;
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
}
@@ -1405,5 +1408,3 @@ TkDebugBorder(tkwin, name)
}
return resultPtr;
}
-
-
diff --git a/tk/generic/tk3d.h b/tk/generic/tk3d.h
index c62cf12de5a..babc7844293 100644
--- a/tk/generic/tk3d.h
+++ b/tk/generic/tk3d.h
@@ -100,4 +100,3 @@ EXTERN void TkpFreeBorder _ANSI_ARGS_((TkBorder *borderPtr));
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TK3D */
-
diff --git a/tk/generic/tkArgv.c b/tk/generic/tkArgv.c
index ee86ad75cd4..d62bc082f08 100644
--- a/tk/generic/tkArgv.c
+++ b/tk/generic/tkArgv.c
@@ -24,8 +24,6 @@
static Tk_ArgvInfo defaultTable[] = {
{"-help", TK_ARGV_HELP, (char *) NULL, (char *) NULL,
"Print summary of command-line options and abort"},
- {"-version", TK_ARGV_VERSION, (char *) NULL, (char *) NULL,
- "Print version number and abort"},
{NULL, TK_ARGV_END, (char *) NULL, (char *) NULL,
(char *) NULL}
};
@@ -69,7 +67,7 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
* NULL means ignore Tk option specs. */
int *argcPtr; /* Number of arguments in argv. Modified
* to hold # args left in argv at end. */
- char **argv; /* Array of arguments. Modified to hold
+ CONST char **argv; /* Array of arguments. Modified to hold
* those that couldn't be processed here. */
Tk_ArgvInfo *argTable; /* Array of option descriptions */
int flags; /* Or'ed combination of various flag bits,
@@ -79,7 +77,7 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
/* Pointer to the current entry in the
* table of argument descriptions. */
Tk_ArgvInfo *matchPtr; /* Descriptor that matches current argument. */
- char *curArg; /* Current argument */
+ CONST char *curArg; /* Current argument */
register char c; /* Second character of current arg (used for
* quick check for matching; use 2nd char.
* because first char. will almost always
@@ -204,7 +202,7 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
if (argc == 0) {
goto missingArg;
} else {
- *((char **)infoPtr->dst) = argv[srcIndex];
+ *((CONST char **)infoPtr->dst) = argv[srcIndex];
srcIndex++;
argc--;
}
@@ -241,7 +239,8 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
}
break;
case TK_ARGV_FUNC: {
- typedef int (ArgvFunc)_ANSI_ARGS_((char *, char *, char *));
+ typedef int (ArgvFunc) _ANSI_ARGS_ ((char *, char *,
+ CONST char *));
ArgvFunc *handlerProc;
handlerProc = (ArgvFunc *) infoPtr->src;
@@ -254,7 +253,7 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
}
case TK_ARGV_GENFUNC: {
typedef int (ArgvGenFunc)_ANSI_ARGS_((char *, Tcl_Interp *,
- char *, int, char **));
+ char *, int, CONST char **));
ArgvGenFunc *handlerProc;
handlerProc = (ArgvGenFunc *) infoPtr->src;
@@ -293,10 +292,6 @@ Tk_ParseArgv(interp, tkwin, argcPtr, argv, argTable, flags)
srcIndex += 2;
argc -= 2;
break;
- case TK_ARGV_VERSION:
- Tcl_AppendResult(interp, "Tk version ", TK_VERSION, "-snavigator-99r1",
- (char *) NULL);
- return TCL_ERROR;
default: {
char buf[64 + TCL_INTEGER_SPACE];
@@ -441,4 +436,3 @@ PrintUsage(interp, argTable, flags)
(char *) NULL);
}
}
-
diff --git a/tk/generic/tkAtom.c b/tk/generic/tkAtom.c
index 45260d940e0..e095183427a 100644
--- a/tk/generic/tkAtom.c
+++ b/tk/generic/tkAtom.c
@@ -80,7 +80,7 @@ Atom
Tk_InternAtom(tkwin, name)
Tk_Window tkwin; /* Window token; map name to atom
* for this window's display. */
- char *name; /* Name to turn into atom. */
+ CONST char *name; /* Name to turn into atom. */
{
register TkDisplay *dispPtr;
register Tcl_HashEntry *hPtr;
@@ -127,7 +127,7 @@ Tk_InternAtom(tkwin, name)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_GetAtomName(tkwin, atom)
Tk_Window tkwin; /* Window token; map atom to name
* relative to this window's
@@ -168,7 +168,7 @@ Tk_GetAtomName(tkwin, atom)
&new);
Tcl_SetHashValue(hPtr, name);
}
- return (char *) Tcl_GetHashValue(hPtr);
+ return Tcl_GetHashValue(hPtr);
}
/*
@@ -215,4 +215,3 @@ AtomInit(dispPtr)
}
}
}
-
diff --git a/tk/generic/tkBind.c b/tk/generic/tkBind.c
index 233f3c308c4..143af5a2e7b 100644
--- a/tk/generic/tkBind.c
+++ b/tk/generic/tkBind.c
@@ -21,6 +21,11 @@
#include "tkWinInt.h"
#endif
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* UNIX */
+#include "tkUnixInt.h"
+#endif
+
+
/*
* File structure:
*
@@ -293,7 +298,7 @@ typedef struct PhysicalsOwned {
* One of the following structures exists for each interpreter. This
* structure keeps track of the current display and screen in the
* interpreter, so that a script can be invoked whenever the display/screen
- * changes (the script does things like point tkPriv at a display-specific
+ * changes (the script does things like point tk::Priv at a display-specific
* structure).
*/
@@ -501,6 +506,11 @@ static EventInfo eventArray[] = {
{"Activate", ActivateNotify, ActivateMask},
{"Deactivate", DeactivateNotify, ActivateMask},
{"MouseWheel", MouseWheelEvent, MouseWheelMask},
+ {"CirculateRequest", CirculateRequest, SubstructureRedirectMask},
+ {"ConfigureRequest", ConfigureRequest, SubstructureRedirectMask},
+ {"Create", CreateNotify, SubstructureNotifyMask},
+ {"MapRequest", MapRequest, SubstructureRedirectMask},
+ {"ResizeRequest", ResizeRequest, ResizeRedirectMask},
{(char *) NULL, 0, 0}
};
static Tcl_HashTable eventTable;
@@ -532,6 +542,10 @@ static Tcl_HashTable eventTable;
#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)
@@ -556,12 +570,12 @@ static int flagArray[TK_LASTEVENT] = {
/* DestroyNotify */ DESTROY,
/* UnmapNotify */ UNMAP,
/* MapNotify */ MAP,
- /* MapRequest */ 0,
+ /* MapRequest */ MAPREQ,
/* ReparentNotify */ REPARENT,
/* ConfigureNotify */ CONFIG,
- /* ConfigureRequest */ 0,
+ /* ConfigureRequest */ CONFIGREQ,
/* GravityNotify */ GRAVITY,
- /* ResizeRequest */ 0,
+ /* ResizeRequest */ RESIZEREQ,
/* CirculateNotify */ CIRC,
/* CirculateRequest */ 0,
/* PropertyNotify */ PROP,
@@ -631,6 +645,22 @@ static TkStateMap visNotify[] = {
{-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}
+};
+
/*
* Prototypes for local procedures defined in this file:
*/
@@ -646,13 +676,13 @@ static int DeleteVirtualEvent _ANSI_ARGS_((Tcl_Interp *interp,
static void DeleteVirtualEventTable _ANSI_ARGS_((
VirtualEventTable *vetPtr));
static void ExpandPercents _ANSI_ARGS_((TkWindow *winPtr,
- char *before, XEvent *eventPtr, KeySym keySym,
+ CONST char *before, XEvent *eventPtr, KeySym keySym,
Tcl_DString *dsPtr));
static void FreeTclBinding _ANSI_ARGS_((ClientData clientData));
static PatSeq * FindSequence _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_HashTable *patternTablePtr, ClientData object,
- char *eventString, int create, int allowVirtual,
- unsigned long *maskPtr));
+ CONST char *eventString, int create,
+ int allowVirtual, unsigned long *maskPtr));
static void GetAllVirtualEvents _ANSI_ARGS_((Tcl_Interp *interp,
VirtualEventTable *vetPtr));
static char * GetField _ANSI_ARGS_((char *p, char *copy, int size));
@@ -675,7 +705,7 @@ static int NameToWindow _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Window main, Tcl_Obj *objPtr,
Tk_Window *tkwinPtr));
static int ParseEventDescription _ANSI_ARGS_((Tcl_Interp *interp,
- char **eventStringPtr, Pattern *patPtr,
+ CONST char **eventStringPtr, Pattern *patPtr,
unsigned long *eventMaskPtr));
static void DoWarp _ANSI_ARGS_((ClientData clientData));
@@ -805,7 +835,7 @@ TkBindFree(mainPtr)
bindInfoPtr = (BindInfo *) mainPtr->bindInfo;
DeleteVirtualEventTable(&bindInfoPtr->virtualEventTable);
bindInfoPtr->deleted = 1;
- Tcl_EventuallyFree((ClientData) bindInfoPtr, Tcl_Free);
+ Tcl_EventuallyFree((ClientData) bindInfoPtr, TCL_DYNAMIC);
mainPtr->bindInfo = NULL;
}
@@ -942,9 +972,9 @@ Tk_CreateBinding(interp, bindingTable, object, eventString, command, append)
/* Table in which to create binding. */
ClientData object; /* Token for object with which binding is
* associated. */
- char *eventString; /* String describing event sequence that
+ CONST char *eventString; /* String describing event sequence that
* triggers binding. */
- char *command; /* Contains Tcl command to execute when
+ CONST char *command; /* Contains Tcl command to execute when
* binding triggers. */
int append; /* 0 means replace any existing binding for
* eventString; 1 means append to that
@@ -1046,7 +1076,7 @@ TkCreateBindingProcedure(interp, bindingTable, object, eventString,
/* Table in which to create binding. */
ClientData object; /* Token for object with which binding is
* associated. */
- char *eventString; /* String describing event sequence that
+ CONST char *eventString; /* String describing event sequence that
* triggers binding. */
TkBindEvalProc *eventProc; /* Procedure to invoke when binding
* triggers. Must not be NULL. */
@@ -1124,7 +1154,7 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString)
Tk_BindingTable bindingTable; /* Table in which to delete binding. */
ClientData object; /* Token for object with which binding
* is associated. */
- char *eventString; /* String describing event sequence
+ CONST char *eventString; /* String describing event sequence
* that triggers binding. */
{
BindingTable *bindPtr = (BindingTable *) bindingTable;
@@ -1213,14 +1243,14 @@ Tk_DeleteBinding(interp, bindingTable, object, eventString)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_GetBinding(interp, bindingTable, object, eventString)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Tk_BindingTable bindingTable; /* Table in which to look for
* binding. */
ClientData object; /* Token for object with which binding
* is associated. */
- char *eventString; /* String describing event sequence
+ CONST char *eventString; /* String describing event sequence
* that triggers binding. */
{
BindingTable *bindPtr = (BindingTable *) bindingTable;
@@ -1233,7 +1263,7 @@ Tk_GetBinding(interp, bindingTable, object, eventString)
return NULL;
}
if (psPtr->eventProc == EvalTclBinding) {
- return (char *) psPtr->clientData;
+ return (CONST char *) psPtr->clientData;
}
return "";
}
@@ -1426,7 +1456,7 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
PendingBinding staticPending;
TkWindow *winPtr = (TkWindow *)tkwin;
PatternTableKey key;
-
+ Tk_ClassModalProc *modalProc;
/*
* Ignore events on windows that don't have names: these are windows
* like wrapper windows that shouldn't be visible to the
@@ -1805,7 +1835,10 @@ Tk_BindEvent(bindingTable, eventPtr, tkwin, numObjects, objectPtr)
winPtr->flags = (winPtr->flags & (unsigned int) ~TK_DEFER_MODAL)
| (flags & TK_DEFER_MODAL);
if (deferModal) {
- (*winPtr->classProcsPtr->modalProc)(tkwin, eventPtr);
+ modalProc = Tk_GetClassProc(winPtr->classProcsPtr, modalProc);
+ if (modalProc != NULL) {
+ (*modalProc)(tkwin, eventPtr);
+ }
}
}
@@ -1874,6 +1907,13 @@ TkBindDeadWindow(winPtr)
BindInfo *bindInfoPtr;
PendingBinding *curPtr;
+ /*
+ * Certain special windows like those used for send and clipboard
+ * have no mainPtr.
+ */
+ if (winPtr->mainPtr == NULL)
+ return;
+
bindInfoPtr = (BindInfo *) winPtr->mainPtr->bindInfo;
curPtr = bindInfoPtr->pendingList;
while (curPtr != NULL) {
@@ -2024,6 +2064,10 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
}
goto nextEvent;
}
+ if (eventPtr->xany.type == CreateNotify
+ && eventPtr->xcreatewindow.parent != window) {
+ goto nextSequence;
+ } else
if (eventPtr->xany.window != window) {
goto nextSequence;
}
@@ -2237,6 +2281,7 @@ MatchPatterns(dispPtr, bindPtr, psPtr, bestPtr, objectPtr, sourcePtrPtr)
*sourcePtrPtr = bestSourcePtr;
return bestPtr;
}
+
/*
*--------------------------------------------------------------
@@ -2261,7 +2306,7 @@ static void
ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
TkWindow *winPtr; /* Window where event occurred: needed to
* get input context. */
- char *before; /* Command containing percent expressions
+ CONST char *before; /* Command containing percent expressions
* to be replaced. */
XEvent *eventPtr; /* X event containing information to be
* used in % replacements. */
@@ -2274,7 +2319,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
* list element. */
int number, flags, length;
#define NUM_SIZE 40
- char *string;
+ CONST char *string;
Tcl_DString buf;
char numStorage[NUM_SIZE+1];
@@ -2295,7 +2340,7 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
/* Empty loop body. */
}
if (string != before) {
- Tcl_DStringAppend(dsPtr, before, string-before);
+ Tcl_DStringAppend(dsPtr, before, (int) (string-before));
before = string;
}
if (*before == 0) {
@@ -2335,6 +2380,14 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
}
string = TkFindStateString(notifyDetail, number);
}
+ else if (flags & CONFIGREQ) {
+ if (eventPtr->xconfigurerequest.value_mask & CWStackMode) {
+ string = TkFindStateString(configureRequestDetail,
+ eventPtr->xconfigurerequest.detail);
+ } else {
+ string = "";
+ }
+ }
goto doString;
case 'f':
number = eventPtr->xcrossing.focus;
@@ -2345,7 +2398,26 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
} else if (flags & (CONFIG)) {
number = eventPtr->xconfigure.height;
}
+ else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.height;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.height;
+ } else if (flags & RESIZEREQ) {
+ number = eventPtr->xresizerequest.height;
+ }
goto doNumber;
+ case 'i':
+ if (flags & CREATE) {
+ TkpPrintWindowId(numStorage, eventPtr->xcreatewindow.window);
+ } else if (flags & CONFIGREQ) {
+ TkpPrintWindowId(numStorage, eventPtr->xconfigurerequest.window);
+ } else if (flags & MAPREQ) {
+ TkpPrintWindowId(numStorage, eventPtr->xmaprequest.window);
+ } else {
+ TkpPrintWindowId(numStorage, eventPtr->xany.window);
+ }
+ string = numStorage;
+ goto doString;
case 'k':
number = eventPtr->xkey.keycode;
goto doNumber;
@@ -2369,13 +2441,21 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
}
goto doNumber;
case 'p':
- string = TkFindStateString(circPlace, eventPtr->xcirculate.place);
+ if (flags & CIRC) {
+ string = TkFindStateString(circPlace, eventPtr->xcirculate.place);
+ } else if (flags & CIRCREQ) {
+ string = TkFindStateString(circPlace, eventPtr->xcirculaterequest.place);
+ }
goto doString;
case 's':
if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
number = eventPtr->xkey.state;
} else if (flags & CROSSING) {
number = eventPtr->xcrossing.state;
+ } else if (flags & PROP) {
+ string = TkFindStateString(propNotify,
+ eventPtr->xproperty.state);
+ goto doString;
} else if (flags & VISIBILITY) {
string = TkFindStateString(visNotify,
eventPtr->xvisibility.state);
@@ -2400,6 +2480,13 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
} else if (flags & CONFIG) {
number = eventPtr->xconfigure.width;
}
+ else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.width;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.width;
+ } else if (flags & RESIZEREQ) {
+ number = eventPtr->xresizerequest.width;
+ }
goto doNumber;
case 'x':
if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
@@ -2413,6 +2500,11 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
} else if (flags & REPARENT) {
number = eventPtr->xreparent.x;
}
+ else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.x;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.x;
+ }
goto doNumber;
case 'y':
if (flags & (KEY_BUTTON_MOTION_VIRTUAL)) {
@@ -2427,6 +2519,11 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
number = eventPtr->xcrossing.y;
}
+ else if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.y;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.y;
+ }
goto doNumber;
case 'A':
if (flags & KEY) {
@@ -2435,7 +2532,13 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
}
goto doString;
case 'B':
- number = eventPtr->xcreatewindow.border_width;
+ if (flags & CREATE) {
+ number = eventPtr->xcreatewindow.border_width;
+ } else if (flags & CONFIGREQ) {
+ number = eventPtr->xconfigurerequest.border_width;
+ } else {
+ number = eventPtr->xconfigure.border_width;
+ }
goto doNumber;
case 'D':
/*
@@ -2460,6 +2563,11 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
case 'N':
number = (int) keySym;
goto doNumber;
+ case 'P':
+ if (flags & PROP) {
+ string = Tk_GetAtomName((Tk_Window) winPtr, eventPtr->xproperty.atom);
+ }
+ goto doString;
case 'R':
TkpPrintWindowId(numStorage, eventPtr->xkey.root);
string = numStorage;
@@ -2542,16 +2650,16 @@ ExpandPercents(winPtr, before, eventPtr, keySym, dsPtr)
*
* This procedure is invoked whenever the current screen changes
* in an application. It invokes a Tcl procedure named
- * "tkScreenChanged", passing it the screen name as argument.
- * tkScreenChanged does things like making the tkPriv variable
+ * "tk::ScreenChanged", passing it the screen name as argument.
+ * tk::ScreenChanged does things like making the tk::Priv variable
* point to an array for the current display.
*
* Results:
* None.
*
* Side effects:
- * Depends on what tkScreenChanged does. If an error occurs
- * them tkError will be invoked.
+ * Depends on what tk::ScreenChanged does. If an error occurs
+ * them bgerror will be invoked.
*
*----------------------------------------------------------------------
*/
@@ -2568,7 +2676,7 @@ ChangeScreen(interp, dispName, screenIndex)
char screen[TCL_INTEGER_SPACE];
Tcl_DStringInit(&cmd);
- Tcl_DStringAppend(&cmd, "tkScreenChanged ", 16);
+ Tcl_DStringAppend(&cmd, "tk::ScreenChanged ", 18);
Tcl_DStringAppend(&cmd, dispName, -1);
sprintf(screen, ".%d", screenIndex);
Tcl_DStringAppend(&cmd, screen, -1);
@@ -2609,7 +2717,7 @@ Tk_EventObjCmd(clientData, interp, objc, objv)
Tk_Window tkwin;
VirtualEventTable *vetPtr;
TkBindInfo bindInfo;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"add", "delete", "generate", "info",
NULL
};
@@ -2933,7 +3041,7 @@ DeleteVirtualEvent(interp, vetPtr, virtString, eventString)
eventPSPtr = FindSequence(interp, &vetPtr->patternTable, NULL,
eventString, 0, 0, &eventMask);
if (eventPSPtr == NULL) {
- char *string;
+ CONST char *string;
string = Tcl_GetStringResult(interp);
return (string[0] != '\0') ? TCL_ERROR : TCL_OK;
@@ -3171,14 +3279,15 @@ HandleEventGenerate(interp, mainWin, objc, objv)
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
XEvent event;
- char *name, *p, *windowName;
+ CONST char *p;
+ char *name, *windowName;
int count, flags, synch, i, number, warp;
Tcl_QueuePosition pos;
Pattern pat;
Tk_Window tkwin, tkwin2;
TkWindow *mainPtr;
unsigned long eventMask;
- static char *fieldStrings[] = {
+ static CONST char *fieldStrings[] = {
"-when", "-above", "-borderwidth", "-button",
"-count", "-delta", "-detail", "-focus",
"-height",
@@ -3691,9 +3800,9 @@ HandleEventGenerate(interp, mainWin, objc, objv)
if ((warp != 0) && Tk_IsMapped(tkwin)) {
TkDisplay *dispPtr;
dispPtr = TkGetDisplay(event.xmotion.display);
- if (!dispPtr->warpInProgress) {
+ if (!(dispPtr->flags & TK_DISPLAY_IN_WARP)) {
Tcl_DoWhenIdle(DoWarp, (ClientData) dispPtr);
- dispPtr->warpInProgress = 1;
+ dispPtr->flags |= TK_DISPLAY_IN_WARP;
}
dispPtr->warpWindow = event.xany.window;
dispPtr->warpX = event.xkey.x;
@@ -3712,8 +3821,8 @@ NameToWindow(interp, mainWin, objPtr, tkwinPtr)
{
char *name;
Tk_Window tkwin;
- int id;
-
+ Window id;
+
name = Tcl_GetStringFromObj(objPtr, NULL);
if (name[0] == '.') {
tkwin = Tk_NameToWindow(interp, name, mainWin);
@@ -3722,12 +3831,18 @@ NameToWindow(interp, mainWin, objPtr, tkwinPtr)
}
*tkwinPtr = tkwin;
} else {
- if (TkpScanWindowId(NULL, name, &id) != TCL_OK) {
+ /*
+ * Check for the winPtr being valid, even if it looks ok to
+ * TkpScanWindowId. [Bug #411307]
+ */
+
+ if ((TkpScanWindowId(NULL, name, &id) != TCL_OK) ||
+ ((*tkwinPtr = Tk_IdToWindow(Tk_Display(mainWin), id))
+ == NULL)) {
Tcl_AppendResult(interp, "bad window name/identifier \"",
name, "\"", (char *) NULL);
return TCL_ERROR;
}
- *tkwinPtr = Tk_IdToWindow(Tk_Display(mainWin), (Window) id);
}
return TCL_OK;
}
@@ -3756,7 +3871,7 @@ DoWarp(clientData)
XWarpPointer(dispPtr->display, (Window) None, (Window) dispPtr->warpWindow,
0, 0, 0, 0, (int) dispPtr->warpX, (int) dispPtr->warpY);
XForceScreenSaver(dispPtr->display, ScreenSaverReset);
- dispPtr->warpInProgress = 0;
+ dispPtr->flags &= ~TK_DISPLAY_IN_WARP;
}
/*
@@ -3837,7 +3952,7 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
ClientData object; /* For binding table, token for object with
* which binding is associated.
* For virtual event table, NULL. */
- char *eventString; /* String description of pattern to
+ CONST char *eventString; /* String description of pattern to
* match on. See user documentation
* for details. */
int create; /* 0 means don't create the entry if
@@ -3853,7 +3968,7 @@ FindSequence(interp, patternTablePtr, object, eventString, create,
Pattern pats[EVENT_BUFFER_SIZE];
int numPats, virtualFound;
- char *p;
+ CONST char *p;
Pattern *patPtr;
PatSeq *psPtr;
Tcl_HashEntry *hPtr;
@@ -4008,7 +4123,7 @@ static int
ParseEventDescription(interp, eventStringPtr, patPtr,
eventMaskPtr)
Tcl_Interp *interp; /* For error messages. */
- char **eventStringPtr; /* On input, holds a pointer to start of
+ CONST char **eventStringPtr;/* On input, holds a pointer to start of
* event string. On exit, gets pointer to
* rest of string after parsed event. */
Pattern *patPtr; /* Filled with the pattern parsed from the
@@ -4022,8 +4137,10 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
#define FIELD_SIZE 48
char field[FIELD_SIZE];
Tcl_HashEntry *hPtr;
+ Tcl_DString copy;
- p = *eventStringPtr;
+ Tcl_DStringInit(&copy);
+ p = Tcl_DStringAppend(&copy, *eventStringPtr, -1);
patPtr->eventType = -1;
patPtr->needMods = 0;
@@ -4052,7 +4169,8 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
sprintf(buf, "bad ASCII character 0x%x", (unsigned char) *p);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return 0;
+ count = 0;
+ goto done;
}
}
p++;
@@ -4093,12 +4211,14 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
if (p == field) {
Tcl_SetResult(interp, "virtual event \"<<>>\" is badly formed",
TCL_STATIC);
- return 0;
+ count = 0;
+ goto done;
}
if ((p == NULL) || (p[1] != '>')) {
Tcl_SetResult(interp, "missing \">\" in virtual binding",
TCL_STATIC);
- return 0;
+ count = 0;
+ goto done;
}
*p = '\0';
patPtr->eventType = VirtualEvent;
@@ -4161,7 +4281,8 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
} else if ((eventFlags & BUTTON) == 0) {
Tcl_AppendResult(interp, "specified button \"", field,
"\" for non-button event", (char *) NULL);
- return 0;
+ count = 0;
+ goto done;
}
patPtr->detail.button = (*field - '0');
} else {
@@ -4170,7 +4291,8 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
if (patPtr->detail.keySym == NoSymbol) {
Tcl_AppendResult(interp, "bad event type or keysym \"",
field, "\"", (char *) NULL);
- return 0;
+ count = 0;
+ goto done;
}
if (eventFlags == 0) {
patPtr->eventType = KeyPress;
@@ -4178,13 +4300,15 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
} else if ((eventFlags & KEY) == 0) {
Tcl_AppendResult(interp, "specified keysym \"", field,
"\" for non-key event", (char *) NULL);
- return 0;
+ count = 0;
+ goto done;
}
}
} else if (eventFlags == 0) {
Tcl_SetResult(interp, "no event type or button # or keysym",
TCL_STATIC);
- return 0;
+ count = 0;
+ goto done;
}
while ((*p == '-') || isspace(UCHAR(*p))) {
@@ -4197,17 +4321,21 @@ ParseEventDescription(interp, eventStringPtr, patPtr,
Tcl_SetResult(interp,
"extra characters after detail in binding",
TCL_STATIC);
- return 0;
+ count = 0;
+ goto done;
}
}
Tcl_SetResult(interp, "missing \">\" in binding", TCL_STATIC);
- return 0;
+ count = 0;
+ goto done;
}
p++;
end:
- *eventStringPtr = p;
+ *eventStringPtr += (p - Tcl_DStringValue(&copy));
*eventMaskPtr |= eventMask;
+done:
+ Tcl_DStringFree(&copy);
return count;
}
@@ -4514,5 +4642,3 @@ TkCopyAndGlobalEval(interp, script)
}
-
-
diff --git a/tk/generic/tkBitmap.c b/tk/generic/tkBitmap.c
index ff8e7e3e5a2..4d2b6749c80 100644
--- a/tk/generic/tkBitmap.c
+++ b/tk/generic/tkBitmap.c
@@ -57,6 +57,7 @@ typedef struct TkBitmap {
* and it isn't currently in use. */
int width, height; /* Dimensions of bitmap. */
Display *display; /* Display for which bitmap is valid. */
+ int screenNum; /* Screen on which bitmap is valid */
int resourceRefCount; /* Number of active uses of this bitmap (each
* active use corresponds to a call to
* Tk_AllocBitmapFromObj or Tk_GetBitmap).
@@ -75,9 +76,9 @@ typedef struct TkBitmap {
* (needed when deleting). */
struct TkBitmap *nextPtr; /* Points to the next TkBitmap structure with
* the same name. All bitmaps with the
- * same name (but different displays) are
- * chained together off a single entry in
- * nameTable. */
+ * same name (but different displays or
+ * screens) are chained together off a
+ * single entry in nameTable. */
} TkBitmap;
/*
@@ -86,7 +87,7 @@ typedef struct TkBitmap {
*/
typedef struct {
- char *source; /* Bitmap bits. */
+ CONST char *source; /* Bitmap bits. */
int width, height; /* Dimensions of bitmap. */
} DataKey;
@@ -124,7 +125,7 @@ static void InitBitmapObj _ANSI_ARGS_((Tcl_Obj *objPtr));
* ptr1 field of the Tcl_Obj points to a TkBitmap object.
*/
-static Tcl_ObjType bitmapObjType = {
+Tcl_ObjType tkBitmapObjType = {
"bitmap", /* name */
FreeBitmapObjProc, /* freeIntRepProc */
DupBitmapObjProc, /* dupIntRepProc */
@@ -167,7 +168,7 @@ Tk_AllocBitmapFromObj(interp, tkwin, objPtr)
{
TkBitmap *bitmapPtr;
- if (objPtr->typePtr != &bitmapObjType) {
+ if (objPtr->typePtr != &tkBitmapObjType) {
InitBitmapObj(objPtr);
}
bitmapPtr = (TkBitmap *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -186,7 +187,8 @@ Tk_AllocBitmapFromObj(interp, tkwin, objPtr)
FreeBitmapObjProc(objPtr);
bitmapPtr = NULL;
- } else if (Tk_Display(tkwin) == bitmapPtr->display) {
+ } else if ( (Tk_Display(tkwin) == bitmapPtr->display)
+ && (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum) ) {
bitmapPtr->resourceRefCount++;
return bitmapPtr->bitmap;
}
@@ -204,7 +206,8 @@ Tk_AllocBitmapFromObj(interp, tkwin, objPtr)
FreeBitmapObjProc(objPtr);
for (bitmapPtr = firstBitmapPtr; bitmapPtr != NULL;
bitmapPtr = bitmapPtr->nextPtr) {
- if (Tk_Display(tkwin) == bitmapPtr->display) {
+ if ( (Tk_Display(tkwin) == bitmapPtr->display) &&
+ (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum) ) {
bitmapPtr->resourceRefCount++;
bitmapPtr->objRefCount++;
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) bitmapPtr;
@@ -321,7 +324,8 @@ GetBitmap(interp, tkwin, string)
existingBitmapPtr = (TkBitmap *) Tcl_GetHashValue(nameHashPtr);
for (bitmapPtr = existingBitmapPtr; bitmapPtr != NULL;
bitmapPtr = bitmapPtr->nextPtr) {
- if (Tk_Display(tkwin) == bitmapPtr->display) {
+ if ( (Tk_Display(tkwin) == bitmapPtr->display) &&
+ (Tk_ScreenNumber(tkwin) == bitmapPtr->screenNum) ) {
bitmapPtr->resourceRefCount++;
return bitmapPtr;
}
@@ -418,6 +422,7 @@ GetBitmap(interp, tkwin, string)
bitmapPtr->width = width;
bitmapPtr->height = height;
bitmapPtr->display = Tk_Display(tkwin);
+ bitmapPtr->screenNum = Tk_ScreenNumber(tkwin);
bitmapPtr->resourceRefCount = 1;
bitmapPtr->objRefCount = 0;
bitmapPtr->nameHashPtr = nameHashPtr;
@@ -463,7 +468,7 @@ Tk_DefineBitmap(interp, name, source, width, height)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
CONST char *name; /* Name to use for bitmap. Must not already
* be defined as a bitmap. */
- char *source; /* Address of bits for bitmap. */
+ CONST char *source; /* Address of bits for bitmap. */
int width; /* Width of bitmap. */
int height; /* Height of bitmap. */
{
@@ -518,7 +523,7 @@ Tk_DefineBitmap(interp, name, source, width, height)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfBitmap(display, bitmap)
Display *display; /* Display for which bitmap was
* allocated. */
@@ -804,7 +809,7 @@ Pixmap
Tk_GetBitmapFromData(interp, tkwin, source, width, height)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
Tk_Window tkwin; /* Window in which bitmap will be used. */
- char *source; /* Bitmap data for bitmap shape. */
+ CONST char *source; /* Bitmap data for bitmap shape. */
int width, height; /* Dimensions of bitmap. */
{
DataKey nameKey;
@@ -895,7 +900,7 @@ GetBitmapFromObj(tkwin, objPtr)
Tcl_HashEntry *hashPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (objPtr->typePtr != &bitmapObjType) {
+ if (objPtr->typePtr != &tkBitmapObjType) {
InitBitmapObj(objPtr);
}
@@ -970,7 +975,7 @@ InitBitmapObj(objPtr)
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
(*typePtr->freeIntRepProc)(objPtr);
}
- objPtr->typePtr = &bitmapObjType;
+ objPtr->typePtr = &tkBitmapObjType;
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
}
@@ -1183,4 +1188,3 @@ TkGetBitmapPredefTable()
return &tsdPtr->predefBitmapTable;
}
-
diff --git a/tk/generic/tkButton.c b/tk/generic/tkButton.c
index 8a52f91217c..2d74fffee9f 100644
--- a/tk/generic/tkButton.c
+++ b/tk/generic/tkButton.c
@@ -17,6 +17,11 @@
#include "tkButton.h"
#include "default.h"
+typedef struct ThreadSpecificData {
+ int defaultsInitialized;
+} ThreadSpecificData;
+static Tcl_ThreadDataKey dataKey;
+
/*
* Class names for buttons, indexed by one of the type values defined
* in tkButton.h.
@@ -43,6 +48,15 @@ static char *stateStrings[] = {
};
/*
+ * The following table defines the legal values for the -compound option.
+ * It is used with the "enum compound" declaration in tkButton.h
+ */
+
+static char *compoundStrings[] = {
+ "bottom", "center", "left", "none", "right", "top", (char *) NULL
+};
+
+/*
* Information used for parsing configuration options. There is a
* separate table for each of the four widget classes.
*/
@@ -69,6 +83,9 @@ static Tk_OptionSpec labelOptionSpecs[] = {
{TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
DEF_BUTTON_BORDER_WIDTH, Tk_Offset(TkButton, borderWidthPtr),
Tk_Offset(TkButton, borderWidth), 0, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
+ DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0,
+ (ClientData) compoundStrings, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor),
TK_OPTION_NULL_OK, 0, 0},
@@ -155,6 +172,9 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
{TK_OPTION_STRING, "-command", "command", "Command",
DEF_BUTTON_COMMAND, Tk_Offset(TkButton, commandPtr), -1,
TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
+ DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0,
+ (ClientData) compoundStrings, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor),
TK_OPTION_NULL_OK, 0, 0},
@@ -189,6 +209,9 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0},
+ {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief",
+ DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-padx", "padX", "Pad",
DEF_BUTTON_PADX, Tk_Offset(TkButton, padXPtr),
Tk_Offset(TkButton, padX), 0, 0, 0},
@@ -196,7 +219,14 @@ static Tk_OptionSpec buttonOptionSpecs[] = {
DEF_BUTTON_PADY, Tk_Offset(TkButton, padYPtr),
Tk_Offset(TkButton, padY), 0, 0, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
- DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, relief), 0, 0, 0},
+ DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, relief),
+ 0, 0, 0},
+ {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
+ DEF_BUTTON_REPEAT_DELAY, -1, Tk_Offset(TkButton, repeatDelay),
+ 0, 0, 0},
+ {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
+ DEF_BUTTON_REPEAT_INTERVAL, -1, Tk_Offset(TkButton, repeatInterval),
+ 0, 0, 0},
{TK_OPTION_STRING_TABLE, "-state", "state", "State",
DEF_BUTTON_STATE, -1, Tk_Offset(TkButton, state),
0, (ClientData) stateStrings, 0},
@@ -244,6 +274,9 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
{TK_OPTION_STRING, "-command", "command", "Command",
DEF_BUTTON_COMMAND, Tk_Offset(TkButton, commandPtr), -1,
TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
+ DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0,
+ (ClientData) compoundStrings, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor),
TK_OPTION_NULL_OK, 0, 0},
@@ -277,10 +310,15 @@ static Tk_OptionSpec checkbuttonOptionSpecs[] = {
DEF_BUTTON_INDICATOR, -1, Tk_Offset(TkButton, indicatorOn), 0, 0, 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0},
+ {TK_OPTION_RELIEF, "-offrelief", "offRelief", "OffRelief",
+ DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, offRelief), 0, 0, 0},
{TK_OPTION_STRING, "-offvalue", "offValue", "Value",
DEF_BUTTON_OFF_VALUE, Tk_Offset(TkButton, offValuePtr), -1, 0, 0, 0},
{TK_OPTION_STRING, "-onvalue", "onValue", "Value",
DEF_BUTTON_ON_VALUE, Tk_Offset(TkButton, onValuePtr), -1, 0, 0, 0},
+ {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief",
+ DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-padx", "padX", "Pad",
DEF_LABCHKRAD_PADX, Tk_Offset(TkButton, padXPtr),
Tk_Offset(TkButton, padX), 0, 0, 0},
@@ -345,6 +383,9 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
{TK_OPTION_STRING, "-command", "command", "Command",
DEF_BUTTON_COMMAND, Tk_Offset(TkButton, commandPtr), -1,
TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
+ DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkButton, compound), 0,
+ (ClientData) compoundStrings, 0},
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_BUTTON_CURSOR, -1, Tk_Offset(TkButton, cursor),
TK_OPTION_NULL_OK, 0, 0},
@@ -379,6 +420,11 @@ static Tk_OptionSpec radiobuttonOptionSpecs[] = {
0, 0, 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_BUTTON_JUSTIFY, -1, Tk_Offset(TkButton, justify), 0, 0, 0},
+ {TK_OPTION_RELIEF, "-offrelief", "offRelief", "OffRelief",
+ DEF_BUTTON_RELIEF, -1, Tk_Offset(TkButton, offRelief), 0, 0, 0},
+ {TK_OPTION_RELIEF, "-overrelief", "overRelief", "OverRelief",
+ DEF_BUTTON_OVER_RELIEF, -1, Tk_Offset(TkButton, overRelief),
+ TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_PIXELS, "-padx", "padX", "Pad",
DEF_LABCHKRAD_PADX, Tk_Offset(TkButton, padXPtr),
Tk_Offset(TkButton, padX), 0, 0, 0},
@@ -439,7 +485,7 @@ static Tk_OptionSpec *optionSpecs[] = {
* into a single enumerated type used to dispatch the widget command.
*/
-static char *commandNames[][8] = {
+static CONST char *commandNames[][8] = {
{"cget", "configure", (char *) NULL},
{"cget", "configure", "flash", "invoke", (char *) NULL},
{"cget", "configure", "deselect", "flash", "invoke", "select",
@@ -478,11 +524,11 @@ static void ButtonSelectImageProc _ANSI_ARGS_((
ClientData clientData, int x, int y, int width,
int height, int imgWidth, int imgHeight));
static char * ButtonTextVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
static char * ButtonVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
static int ButtonWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
@@ -570,8 +616,7 @@ Tk_RadiobuttonObjCmd(clientData, interp, objc, objv)
static int
ButtonCreate(clientData, interp, objc, objv, type)
- ClientData clientData; /* Option table for this widget class, or
- * NULL if not created yet. */
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument values. */
@@ -582,25 +627,12 @@ ButtonCreate(clientData, interp, objc, objv, type)
TkButton *butPtr;
Tk_OptionTable optionTable;
Tk_Window tkwin;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- optionTable = (Tk_OptionTable) clientData;
- if (optionTable == NULL) {
- Tcl_CmdInfo info;
- char *name;
-
- /*
- * We haven't created the option table for this widget class
- * yet. Do it now and save the table as the clientData for
- * the command, so we'll have access to it in future
- * invocations of the command.
- */
-
+ if (!tsdPtr->defaultsInitialized) {
TkpButtonSetDefaults(optionSpecs[type]);
- optionTable = Tk_CreateOptionTable(interp, optionSpecs[type]);
- name = Tcl_GetString(objv[0]);
- Tcl_GetCommandInfo(interp, name, &info);
- info.objClientData = (ClientData) optionTable;
- Tcl_SetCommandInfo(interp, name, &info);
+ tsdPtr->defaultsInitialized = 1;
}
if (objc < 2) {
@@ -618,10 +650,17 @@ ButtonCreate(clientData, interp, objc, objv, type)
return TCL_ERROR;
}
+ /*
+ * Create the option table for this widget class. If it has already
+ * been created, the cached pointer will be returned.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, optionSpecs[type]);
+
Tk_SetClass(tkwin, classNames[type]);
butPtr = TkpCreateButton(tkwin);
- TkSetClassProcs(tkwin, &tkpButtonProcs, (ClientData) butPtr);
+ Tk_SetClassProcs(tkwin, &tkpButtonProcs, (ClientData) butPtr);
/*
* Initialize the data structure for the button.
@@ -907,9 +946,9 @@ static void
DestroyButton(butPtr)
TkButton *butPtr; /* Info about button widget. */
{
+ butPtr->flags |= BUTTON_DELETED;
TkpDestroyButton(butPtr);
- butPtr->flags |= BUTTON_DELETED;
if (butPtr->flags & REDRAW_PENDING) {
Tcl_CancelIdleCall(TkpDisplayButton, (ClientData) butPtr);
}
@@ -991,7 +1030,7 @@ ConfigureButton(interp, butPtr, objc, objv)
{
Tk_SavedOptions savedOptions;
Tcl_Obj *errorResult = NULL;
- int error;
+ int error, haveImage;
Tk_Image image;
/*
@@ -1094,6 +1133,16 @@ ConfigureButton(interp, butPtr, objc, objv)
== NULL) {
continue;
}
+
+ /*
+ * If a radiobutton has the empty string as value
+ * it should be selected.
+ */
+
+ if ((butPtr->type == TYPE_RADIO_BUTTON) &&
+ (*Tcl_GetString(butPtr->onValuePtr) == 0)) {
+ butPtr->flags |= SELECTED;
+ }
}
}
@@ -1132,7 +1181,11 @@ ConfigureButton(interp, butPtr, objc, objv)
}
butPtr->selectImage = image;
- if ((butPtr->imagePtr == NULL) && (butPtr->bitmap == None)
+ haveImage = 0;
+ if (butPtr->imagePtr != NULL || butPtr->bitmap != None) {
+ haveImage = 1;
+ }
+ if ((!haveImage || butPtr->compound != COMPOUND_NONE)
&& (butPtr->textVarNamePtr != NULL)) {
/*
* The button must display the value of a variable: set up a trace
@@ -1295,6 +1348,9 @@ TkButtonWorldChanged(instanceData)
} else {
gcValues.foreground = gcValues.background;
mask = GCForeground;
+ if (butPtr->compound != COMPOUND_NONE) {
+ mask |= GCFont;
+ }
if (butPtr->gray == None) {
butPtr->gray = Tk_GetBitmap(NULL, butPtr->tkwin, "gray50");
}
@@ -1499,8 +1555,8 @@ static char *
ButtonVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about button. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Name of variable. */
- char *name2; /* Second part of variable name. */
+ CONST char *name1; /* Name of variable. */
+ CONST char *name2; /* Second part of variable name. */
int flags; /* Information about what happened. */
{
register TkButton *butPtr = (TkButton *) clientData;
@@ -1578,14 +1634,18 @@ static char *
ButtonTextVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about button. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Not used. */
- char *name2; /* Not used. */
+ CONST char *name1; /* Not used. */
+ CONST char *name2; /* Not used. */
int flags; /* Information about what happened. */
{
TkButton *butPtr = (TkButton *) clientData;
char *name;
Tcl_Obj *valuePtr;
+ if (butPtr->flags & BUTTON_DELETED) {
+ return (char *) NULL;
+ }
+
name = Tcl_GetString(butPtr->textVarNamePtr);
/*
diff --git a/tk/generic/tkButton.h b/tk/generic/tkButton.h
index d0e28822c16..e9a78c32f84 100644
--- a/tk/generic/tkButton.h
+++ b/tk/generic/tkButton.h
@@ -25,6 +25,15 @@
#endif
/*
+ * Legal values for the "compound" field of TkButton records.
+ */
+
+enum compound {
+ COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE,
+ COMPOUND_RIGHT, COMPOUND_TOP
+};
+
+/*
* Legal values for the "state" field of TkButton records.
*/
@@ -107,6 +116,15 @@ typedef struct {
int relief; /* Value of -relief option: specifies 3-d
* effect for border, such as
* TK_RELIEF_RAISED. */
+ 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 offRelief; /* Value of -offrelief option: specifies a 3-d
+ * effect for the border, such as
+ * TK_RELIEF_RAISED, to be used when a
+ * checkbutton or radiobutton without
+ * indicator is off */
Tcl_Obj *highlightWidthPtr; /* Value of -highlightthickness option:
* specifies width in pixels of highlight to
* draw around widget when it has the focus.
@@ -226,6 +244,15 @@ typedef struct {
* to execute when button is invoked. If
* widget is label or has no command, this
* is NULL. */
+ int 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. */
} TkButton;
@@ -257,16 +284,15 @@ typedef struct {
* deleted.
*/
-#define REDRAW_PENDING 1
-#define SELECTED 2
-#define GOT_FOCUS 4
-#define BUTTON_DELETED 0x8
-
+#define REDRAW_PENDING (1 << 0)
+#define SELECTED (1 << 1)
+#define GOT_FOCUS (1 << 2)
+#define BUTTON_DELETED (1 << 3)
/*
* Declaration of variables shared between the files in the button module.
*/
-extern TkClassProcs tkpButtonProcs;
+extern Tk_ClassProcs tkpButtonProcs;
/*
* Declaration of procedures used in the implementation of the button
@@ -294,4 +320,3 @@ EXTERN int TkInvokeButton _ANSI_ARGS_((TkButton *butPtr));
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKBUTTON */
-
diff --git a/tk/generic/tkCanvArc.c b/tk/generic/tkCanvArc.c
index e2c3504fd1e..a229d3fc250 100644
--- a/tk/generic/tkCanvArc.c
+++ b/tk/generic/tkCanvArc.c
@@ -196,19 +196,19 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputeArcBbox _ANSI_ARGS_((Tk_Canvas canvas,
ArcItem *arcPtr));
static int ConfigureArc _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[], int flags));
static int CreateArc _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void DeleteArc _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
static void DisplayArc _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display, Drawable dst,
int x, int y, int width, int height));
static int ArcCoords _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[]));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[]));
static int ArcToArea _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, double *rectPtr));
static double ArcToPoint _ANSI_ARGS_((Tk_Canvas canvas,
@@ -286,29 +286,27 @@ Tk_ItemType tkArcType = {
*/
static int
-CreateArc(interp, canvas, itemPtr, argc, argv)
+CreateArc(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Arguments describing arc. */
+ int objc; /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing arc. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
- int i;
+ int i = 4;
- if (argc==1) {
+ if (objc == 1) {
i = 1;
- } else {
- char *arg = Tcl_GetStringFromObj(argv[1], NULL);
- if ((argc>1) && (arg[0] == '-')
- && (arg[1] >= 'a') && (arg[1] <= 'z')) {
+ } else if (objc > 1) {
+ char *arg = Tcl_GetString(objv[1]);
+ if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
- } else {
- i = 4;
}
}
- if (argc < i) {
+
+ if (objc < i) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tk_PathName(Tk_CanvasTkwin(canvas)), " create ",
itemPtr->typePtr->name, " x1 y1 x2 y2 ?options?\"",
@@ -342,10 +340,10 @@ CreateArc(interp, canvas, itemPtr, argc, argv)
* Process the arguments to fill in the item record.
*/
- if ((ArcCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {
+ if ((ArcCoords(interp, canvas, itemPtr, i, objv) != TCL_OK)) {
goto error;
}
- if (ConfigureArc(interp, canvas, itemPtr, argc-4, argv+4, 0) == TCL_OK) {
+ if (ConfigureArc(interp, canvas, itemPtr, objc-4, objv+4, 0) == TCL_OK) {
return TCL_OK;
}
error:
@@ -372,19 +370,19 @@ CreateArc(interp, canvas, itemPtr, argc, argv)
*/
static int
-ArcCoords(interp, canvas, itemPtr, argc, argv)
+ArcCoords(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Array of coordinates: x1, y1,
+ int objc; /* Number of coordinates supplied in
+ * objv. */
+ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
* x2, y2, ... */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
- if (argc == 0) {
+ if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
Tcl_Obj *subobj = Tcl_NewDoubleObj(arcPtr->bbox[0]);
Tcl_ListObjAppendElement(interp, obj, subobj);
@@ -395,26 +393,26 @@ ArcCoords(interp, canvas, itemPtr, argc, argv)
subobj = Tcl_NewDoubleObj(arcPtr->bbox[3]);
Tcl_ListObjAppendElement(interp, obj, subobj);
Tcl_SetObjResult(interp, obj);
- } else if ((argc == 1)||(argc == 4)) {
- if (argc==1) {
- if (Tcl_ListObjGetElements(interp, argv[0], &argc,
- (Tcl_Obj ***) &argv) != TCL_OK) {
+ } else if ((objc == 1)||(objc == 4)) {
+ if (objc==1) {
+ if (Tcl_ListObjGetElements(interp, objv[0], &objc,
+ (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
- } else if (argc != 4) {
+ } else if (objc != 4) {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 4, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 4, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
}
- if ((Tk_CanvasGetCoordFromObj(interp, canvas, argv[0],
+ if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0],
&arcPtr->bbox[0]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[1],
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1],
&arcPtr->bbox[1]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[2],
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[2],
&arcPtr->bbox[2]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[3],
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[3],
&arcPtr->bbox[3]) != TCL_OK)) {
return TCL_ERROR;
}
@@ -422,7 +420,7 @@ ArcCoords(interp, canvas, itemPtr, argc, argv)
} else {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 0 or 4, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 0 or 4, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
@@ -449,12 +447,12 @@ ArcCoords(interp, canvas, itemPtr, argc, argv)
*/
static int
-ConfigureArc(interp, canvas, itemPtr, argc, argv, flags)
+ConfigureArc(interp, canvas, itemPtr, objc, objv, flags)
Tcl_Interp *interp; /* Used for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* Arc item to reconfigure. */
- int argc; /* Number of elements in argv. */
- Tcl_Obj *CONST argv[]; /* Arguments describing things to configure. */
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
ArcItem *arcPtr = (ArcItem *) itemPtr;
@@ -469,8 +467,8 @@ ConfigureArc(interp, canvas, itemPtr, argc, argv, flags)
Tk_State state;
tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
- (char *) arcPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+ (CONST char **) objv, (char *) arcPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -2145,4 +2143,3 @@ StylePrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
return "pieslice";
}
}
-
diff --git a/tk/generic/tkCanvBmap.c b/tk/generic/tkCanvBmap.c
index dc35890505d..d015689f47f 100644
--- a/tk/generic/tkCanvBmap.c
+++ b/tk/generic/tkCanvBmap.c
@@ -92,8 +92,8 @@ static Tk_ConfigSpec configSpecs[] = {
*/
static int BitmapCoords _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[]));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[]));
static int BitmapToArea _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, double *rectPtr));
static double BitmapToPoint _ANSI_ARGS_((Tk_Canvas canvas,
@@ -103,11 +103,11 @@ static int BitmapToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
static void ComputeBitmapBbox _ANSI_ARGS_((Tk_Canvas canvas,
BitmapItem *bmapPtr));
static int ConfigureBitmap _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[], int flags));
static int CreateBitmap _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void DeleteBitmap _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
static void DisplayBitmap _ANSI_ARGS_((Tk_Canvas canvas,
@@ -168,22 +168,22 @@ Tk_ItemType tkBitmapType = {
*/
static int
-CreateBitmap(interp, canvas, itemPtr, argc, argv)
+CreateBitmap(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Arguments describing rectangle. */
+ int objc; /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing rectangle. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
int i;
- if (argc==1) {
+ if (objc==1) {
i = 1;
} else {
- char *arg = Tcl_GetStringFromObj(argv[1], NULL);
- if (((argc>1) && (arg[0] == '-')
+ char *arg = Tcl_GetStringFromObj(objv[1], NULL);
+ if (((objc>1) && (arg[0] == '-')
&& (arg[1] >= 'a') && (arg[1] <= 'z'))) {
i = 1;
} else {
@@ -191,7 +191,7 @@ CreateBitmap(interp, canvas, itemPtr, argc, argv)
}
}
- if (argc < i) {
+ if (objc < i) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tk_PathName(Tk_CanvasTkwin(canvas)), " create ",
itemPtr->typePtr->name, " x y ?options?\"",
@@ -219,10 +219,10 @@ CreateBitmap(interp, canvas, itemPtr, argc, argv)
* Process the arguments to fill in the item record.
*/
- if ((BitmapCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {
+ if ((BitmapCoords(interp, canvas, itemPtr, i, objv) != TCL_OK)) {
goto error;
}
- if (ConfigureBitmap(interp, canvas, itemPtr, argc-i, argv+i, 0) == TCL_OK) {
+ if (ConfigureBitmap(interp, canvas, itemPtr, objc-i, objv+i, 0) == TCL_OK) {
return TCL_OK;
}
@@ -250,40 +250,40 @@ CreateBitmap(interp, canvas, itemPtr, argc, argv)
*/
static int
-BitmapCoords(interp, canvas, itemPtr, argc, argv)
+BitmapCoords(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Array of coordinates: x1, y1,
+ int objc; /* Number of coordinates supplied in
+ * objv. */
+ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
* x2, y2, ... */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
- if (argc == 0) {
+ if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
Tcl_Obj *subobj = Tcl_NewDoubleObj(bmapPtr->x);
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewDoubleObj(bmapPtr->y);
Tcl_ListObjAppendElement(interp, obj, subobj);
Tcl_SetObjResult(interp, obj);
- } else if (argc <3) {
- if (argc==1) {
- if (Tcl_ListObjGetElements(interp, argv[0], &argc,
- (Tcl_Obj ***) &argv) != TCL_OK) {
+ } else if (objc <3) {
+ if (objc==1) {
+ if (Tcl_ListObjGetElements(interp, objv[0], &objc,
+ (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
- } else if (argc != 2) {
+ } else if (objc != 2) {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 2, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 2, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
}
- if ((Tk_CanvasGetCoordFromObj(interp, canvas, argv[0], &bmapPtr->x) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[1], &bmapPtr->y)
+ if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], &bmapPtr->x) != TCL_OK)
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1], &bmapPtr->y)
!= TCL_OK)) {
return TCL_ERROR;
}
@@ -291,7 +291,7 @@ BitmapCoords(interp, canvas, itemPtr, argc, argv)
} else {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
@@ -317,12 +317,12 @@ BitmapCoords(interp, canvas, itemPtr, argc, argv)
*/
static int
-ConfigureBitmap(interp, canvas, itemPtr, argc, argv, flags)
+ConfigureBitmap(interp, canvas, itemPtr, objc, objv, flags)
Tcl_Interp *interp; /* Used for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* Bitmap item to reconfigure. */
- int argc; /* Number of elements in argv. */
- Tcl_Obj *CONST argv[]; /* Arguments describing things to configure. */
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
BitmapItem *bmapPtr = (BitmapItem *) itemPtr;
@@ -336,8 +336,8 @@ ConfigureBitmap(interp, canvas, itemPtr, argc, argv, flags)
Tk_State state;
tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
- (char *) bmapPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+ (CONST char **) objv, (char *) bmapPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
diff --git a/tk/generic/tkCanvImg.c b/tk/generic/tkCanvImg.c
index ebfed526748..7bd7b4e3f91 100644
--- a/tk/generic/tkCanvImg.c
+++ b/tk/generic/tkCanvImg.c
@@ -319,8 +319,8 @@ ConfigureImage(interp, canvas, itemPtr, argc, argv, flags)
Tk_Image image;
tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
- (char *) imgPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, argc,
+ (CONST char **) argv, (char *) imgPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -897,4 +897,3 @@ ImageChangedProc(clientData, x, y, width, height, imgWidth, imgHeight)
imgPtr->header.y1 + y, (int) (imgPtr->header.x1 + x + width),
(int) (imgPtr->header.y1 + y + height));
}
-
diff --git a/tk/generic/tkCanvLine.c b/tk/generic/tkCanvLine.c
index fc2174b710b..af1ab3504bd 100644
--- a/tk/generic/tkCanvLine.c
+++ b/tk/generic/tkCanvLine.c
@@ -83,13 +83,13 @@ static int ArrowheadPostscript _ANSI_ARGS_((Tcl_Interp *interp,
static void ComputeLineBbox _ANSI_ARGS_((Tk_Canvas canvas,
LineItem *linePtr));
static int ConfigureLine _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[], int flags));
static int ConfigureArrows _ANSI_ARGS_((Tk_Canvas canvas,
LineItem *linePtr));
static int CreateLine _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void DeleteLine _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
static void DisplayLine _ANSI_ARGS_((Tk_Canvas canvas,
@@ -100,7 +100,7 @@ static int GetLineIndex _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *obj, int *indexPtr));
static int LineCoords _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void LineDeleteCoords _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, int first, int last));
static void LineInsert _ANSI_ARGS_((Tk_Canvas canvas,
@@ -291,13 +291,13 @@ Tk_ItemType tkLineType = {
*/
static int
-CreateLine(interp, canvas, itemPtr, argc, argv)
+CreateLine(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Arguments describing line. */
+ int objc; /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing line. */
{
LineItem *linePtr = (LineItem *) itemPtr;
int i;
@@ -330,17 +330,16 @@ CreateLine(interp, canvas, itemPtr, argc, argv)
* start with a digit or a minus sign followed by a digit.
*/
- for (i = 0; i < argc; i++) {
- char *arg = Tcl_GetStringFromObj(argv[i], NULL);
- if ((arg[0] == '-') && (arg[1] >= 'a')
- && (arg[1] <= 'z')) {
+ for (i = 0; i < objc; i++) {
+ char *arg = Tcl_GetString(objv[i]);
+ if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
}
}
- if (i && (LineCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {
+ if (i && (LineCoords(interp, canvas, itemPtr, i, objv) != TCL_OK)) {
goto error;
}
- if (ConfigureLine(interp, canvas, itemPtr, argc-i, argv+i, 0) == TCL_OK) {
+ if (ConfigureLine(interp, canvas, itemPtr, objc-i, objv+i, 0) == TCL_OK) {
return TCL_OK;
}
@@ -368,21 +367,21 @@ CreateLine(interp, canvas, itemPtr, argc, argv)
*/
static int
-LineCoords(interp, canvas, itemPtr, argc, argv)
+LineCoords(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Array of coordinates: x1, y1,
+ int objc; /* Number of coordinates supplied in
+ * objv. */
+ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
* x2, y2, ... */
{
LineItem *linePtr = (LineItem *) itemPtr;
int i, numPoints;
double *coordPtr;
- if (argc == 0) {
+ if (objc == 0) {
int numCoords;
Tcl_Obj *subobj, *obj = Tcl_NewObj();
@@ -405,27 +404,27 @@ LineCoords(interp, canvas, itemPtr, argc, argv)
Tcl_SetObjResult(interp, obj);
return TCL_OK;
}
- if (argc == 1) {
- if (Tcl_ListObjGetElements(interp, argv[0], &argc,
- (Tcl_Obj ***) &argv) != TCL_OK) {
+ if (objc == 1) {
+ if (Tcl_ListObjGetElements(interp, objv[0], &objc,
+ (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
}
}
- if (argc & 1) {
+ if (objc & 1) {
Tcl_AppendResult(interp,
"odd number of coordinates specified for line",
(char *) NULL);
return TCL_ERROR;
- } else if (argc < 4) {
+ } else if (objc < 4) {
Tcl_AppendResult(interp,
"too few coordinates specified for line",
(char *) NULL);
return TCL_ERROR;
} else {
- numPoints = argc/2;
+ numPoints = objc/2;
if (linePtr->numPoints != numPoints) {
coordPtr = (double *) ckalloc((unsigned)
- (sizeof(double) * argc));
+ (sizeof(double) * objc));
if (linePtr->coordPtr != NULL) {
ckfree((char *) linePtr->coordPtr);
}
@@ -433,8 +432,8 @@ LineCoords(interp, canvas, itemPtr, argc, argv)
linePtr->numPoints = numPoints;
}
coordPtr = linePtr->coordPtr;
- for (i = 0; i <argc; i++) {
- if (Tk_CanvasGetCoordFromObj(interp, canvas, argv[i],
+ for (i = 0; i <objc; i++) {
+ if (Tk_CanvasGetCoordFromObj(interp, canvas, objv[i],
coordPtr++) != TCL_OK) {
return TCL_ERROR;
}
@@ -481,12 +480,12 @@ LineCoords(interp, canvas, itemPtr, argc, argv)
*/
static int
-ConfigureLine(interp, canvas, itemPtr, argc, argv, flags)
+ConfigureLine(interp, canvas, itemPtr, objc, objv, flags)
Tcl_Interp *interp; /* Used for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* Line item to reconfigure. */
- int argc; /* Number of elements in argv. */
- Tcl_Obj *CONST argv[]; /* Arguments describing things to configure. */
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
LineItem *linePtr = (LineItem *) itemPtr;
@@ -497,8 +496,8 @@ ConfigureLine(interp, canvas, itemPtr, argc, argv, flags)
Tk_State state;
tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
- (char *) linePtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+ (CONST char **) objv, (char *) linePtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -866,18 +865,18 @@ DisplayLine(canvas, itemPtr, display, drawable, x, y, width, height)
}
linewidth = linePtr->outline.width;
if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) {
- if (linePtr->outline.activeStipple!=None) {
+ if (linePtr->outline.activeStipple != None) {
stipple = linePtr->outline.activeStipple;
}
- if (linePtr->outline.activeWidth>linewidth) {
+ if (linePtr->outline.activeWidth != linewidth) {
linewidth = linePtr->outline.activeWidth;
}
} else if (state==TK_STATE_DISABLED) {
- if (linePtr->outline.disabledStipple!=None) {
+ if (linePtr->outline.disabledStipple != None) {
stipple = linePtr->outline.disabledStipple;
}
- if (linePtr->outline.disabledWidth>linewidth) {
- linewidth = linePtr->outline.activeWidth;
+ if (linePtr->outline.disabledWidth != linewidth) {
+ linewidth = linePtr->outline.disabledWidth;
}
}
/*
@@ -981,7 +980,7 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
Tcl_Obj *obj; /* New coordinates to be inserted. */
{
LineItem *linePtr = (LineItem *) itemPtr;
- int length, argc, i;
+ int length, objc, i;
double *new, *coordPtr;
Tk_State state = itemPtr->state;
Tcl_Obj **objv;
@@ -990,8 +989,8 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
state = ((TkCanvas *)canvas)->canvas_state;
}
- if (!obj || (Tcl_ListObjGetElements((Tcl_Interp *) NULL, obj, &argc, &objv) != TCL_OK)
- || !argc || argc&1) {
+ if (!obj || (Tcl_ListObjGetElements((Tcl_Interp *) NULL, obj, &objc, &objv) != TCL_OK)
+ || !objc || objc&1) {
return;
}
length = 2*linePtr->numPoints;
@@ -1009,11 +1008,11 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
linePtr->coordPtr[length-2] = linePtr->lastArrowPtr[0];
linePtr->coordPtr[length-1] = linePtr->lastArrowPtr[1];
}
- new = (double *) ckalloc((unsigned)(sizeof(double) * (length + argc)));
+ new = (double *) ckalloc((unsigned)(sizeof(double) * (length + objc)));
for(i=0; i<beforeThis; i++) {
new[i] = linePtr->coordPtr[i];
}
- for(i=0; i<argc; i++) {
+ for(i=0; i<objc; i++) {
if (Tcl_GetDoubleFromObj((Tcl_Interp *) NULL,objv[i],
new+(i+beforeThis))!=TCL_OK) {
Tcl_ResetResult(((TkCanvas *)canvas)->interp);
@@ -1023,11 +1022,11 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
}
for(i=beforeThis; i<length; i++) {
- new[i+argc] = linePtr->coordPtr[i];
+ new[i+objc] = linePtr->coordPtr[i];
}
if(linePtr->coordPtr) ckfree((char *)linePtr->coordPtr);
linePtr->coordPtr = new;
- linePtr->numPoints = (length + argc)/2;
+ linePtr->numPoints = (length + objc)/2;
if ((length>3) && (state != TK_STATE_HIDDEN)) {
/*
@@ -1040,14 +1039,14 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
*/
itemPtr->redraw_flags |= TK_ITEM_DONT_REDRAW;
- if (beforeThis>0) {beforeThis -= 2; argc+=2; }
- if ((beforeThis+argc)<length) argc+=2;
+ if (beforeThis>0) {beforeThis -= 2; objc+=2; }
+ if ((beforeThis+objc)<length) objc+=2;
if (linePtr->smooth) {
if(beforeThis>0) {
- beforeThis-=2; argc+=2;
+ beforeThis-=2; objc+=2;
}
- if((beforeThis+argc+2)<length) {
- argc+=2;
+ if((beforeThis+objc+2)<length) {
+ objc+=2;
}
}
itemPtr->x1 = itemPtr->x2 = (int) linePtr->coordPtr[beforeThis];
@@ -1059,7 +1058,7 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
TkIncludePoint(itemPtr, coordPtr);
}
}
- if ((linePtr->lastArrowPtr != NULL) && ((beforeThis+argc)>=length)) {
+ if ((linePtr->lastArrowPtr != NULL) && ((beforeThis+objc)>=length)) {
/* include old last arrow */
for (i = 0, coordPtr = linePtr->lastArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
@@ -1067,7 +1066,7 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
}
}
coordPtr = linePtr->coordPtr+beforeThis+2;
- for(i=2; i<argc; i+=2) {
+ for(i=2; i<objc; i+=2) {
TkIncludePoint(itemPtr, coordPtr);
coordPtr+=2;
}
@@ -1094,7 +1093,7 @@ LineInsert(canvas, itemPtr, beforeThis, obj)
TkIncludePoint(itemPtr, coordPtr);
}
}
- if ((linePtr->lastArrowPtr != NULL) && ((beforeThis+argc)<(length-2))) {
+ if ((linePtr->lastArrowPtr != NULL) && ((beforeThis+objc)<(length-2))) {
/* include new right arrow */
for (i = 0, coordPtr = linePtr->lastArrowPtr; i < PTS_IN_ARROW;
i++, coordPtr += 2) {
@@ -1873,7 +1872,7 @@ ParseArrowShape(clientData, interp, tkwin, value, recordPtr, offset)
LineItem *linePtr = (LineItem *) recordPtr;
double a, b, c;
int argc;
- char **argv = NULL;
+ CONST char **argv = NULL;
if (offset != Tk_Offset(LineItem, arrowShapeA)) {
panic("ParseArrowShape received bogus offset");
@@ -2466,4 +2465,3 @@ ArrowheadPostscript(interp, canvas, linePtr, arrowPtr)
}
return TCL_OK;
}
-
diff --git a/tk/generic/tkCanvPoly.c b/tk/generic/tkCanvPoly.c
index 60616e173b9..58ffab55090 100644
--- a/tk/generic/tkCanvPoly.c
+++ b/tk/generic/tkCanvPoly.c
@@ -165,11 +165,11 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputePolygonBbox _ANSI_ARGS_((Tk_Canvas canvas,
PolygonItem *polyPtr));
static int ConfigurePolygon _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[], int flags));
static int CreatePolygon _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void DeletePolygon _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
static void DisplayPolygon _ANSI_ARGS_((Tk_Canvas canvas,
@@ -180,7 +180,7 @@ static int GetPolygonIndex _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *obj, int *indexPtr));
static int PolygonCoords _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void PolygonDeleteCoords _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, int first, int last));
static void PolygonInsert _ANSI_ARGS_((Tk_Canvas canvas,
@@ -255,13 +255,13 @@ Tk_ItemType tkPolygonType = {
*/
static int
-CreatePolygon(interp, canvas, itemPtr, argc, argv)
+CreatePolygon(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Arguments describing polygon. */
+ int objc; /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing polygon. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int i;
@@ -296,18 +296,17 @@ CreatePolygon(interp, canvas, itemPtr, argc, argv)
* start with a digit or a minus sign followed by a digit.
*/
- for (i = 0; i < argc; i++) {
- char *arg = Tcl_GetStringFromObj((Tcl_Obj *) argv[i], NULL);
- if ((arg[0] == '-') && (arg[1] >= 'a')
- && (arg[1] <= 'z')) {
+ for (i = 0; i < objc; i++) {
+ char *arg = Tcl_GetString(objv[i]);
+ if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
break;
}
}
- if (i && PolygonCoords(interp, canvas, itemPtr, i, argv) != TCL_OK) {
+ if (i && PolygonCoords(interp, canvas, itemPtr, i, objv) != TCL_OK) {
goto error;
}
- if (ConfigurePolygon(interp, canvas, itemPtr, argc-i, argv+i, 0)
+ if (ConfigurePolygon(interp, canvas, itemPtr, objc-i, objv+i, 0)
== TCL_OK) {
return TCL_OK;
}
@@ -336,20 +335,20 @@ CreatePolygon(interp, canvas, itemPtr, argc, argv)
*/
static int
-PolygonCoords(interp, canvas, itemPtr, argc, argv)
+PolygonCoords(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Array of coordinates: x1, y1,
+ int objc; /* Number of coordinates supplied in
+ * objv. */
+ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
* x2, y2, ... */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
int i, numPoints;
- if (argc == 0) {
+ if (objc == 0) {
/*
* Print the coords used to create the polygon. If we auto
* closed the polygon then we don't report the last point.
@@ -362,19 +361,19 @@ PolygonCoords(interp, canvas, itemPtr, argc, argv)
Tcl_SetObjResult(interp, obj);
return TCL_OK;
}
- if (argc == 1) {
- if (Tcl_ListObjGetElements(interp, argv[0], &argc,
- (Tcl_Obj ***) &argv) != TCL_OK) {
+ if (objc == 1) {
+ if (Tcl_ListObjGetElements(interp, objv[0], &objc,
+ (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
}
}
- if (argc & 1) {
+ if (objc & 1) {
Tcl_AppendResult(interp,
"odd number of coordinates specified for polygon",
(char *) NULL);
return TCL_ERROR;
} else {
- numPoints = argc/2;
+ numPoints = objc/2;
if (polyPtr->pointsAllocated <= numPoints) {
if (polyPtr->coordPtr != NULL) {
ckfree((char *) polyPtr->coordPtr);
@@ -386,11 +385,11 @@ PolygonCoords(interp, canvas, itemPtr, argc, argv)
*/
polyPtr->coordPtr = (double *) ckalloc((unsigned)
- (sizeof(double) * (argc+2)));
+ (sizeof(double) * (objc+2)));
polyPtr->pointsAllocated = numPoints+1;
}
- for (i = argc-1; i >= 0; i--) {
- if (Tk_CanvasGetCoordFromObj(interp, canvas, argv[i],
+ for (i = objc-1; i >= 0; i--) {
+ if (Tk_CanvasGetCoordFromObj(interp, canvas, objv[i],
&polyPtr->coordPtr[i]) != TCL_OK) {
return TCL_ERROR;
}
@@ -402,12 +401,12 @@ PolygonCoords(interp, canvas, itemPtr, argc, argv)
* Close the polygon if it isn't already closed.
*/
- if (argc>2 && ((polyPtr->coordPtr[argc-2] != polyPtr->coordPtr[0])
- || (polyPtr->coordPtr[argc-1] != polyPtr->coordPtr[1]))) {
+ if (objc>2 && ((polyPtr->coordPtr[objc-2] != polyPtr->coordPtr[0])
+ || (polyPtr->coordPtr[objc-1] != polyPtr->coordPtr[1]))) {
polyPtr->autoClosed = 1;
polyPtr->numPoints++;
- polyPtr->coordPtr[argc] = polyPtr->coordPtr[0];
- polyPtr->coordPtr[argc+1] = polyPtr->coordPtr[1];
+ polyPtr->coordPtr[objc] = polyPtr->coordPtr[0];
+ polyPtr->coordPtr[objc+1] = polyPtr->coordPtr[1];
}
ComputePolygonBbox(canvas, polyPtr);
}
@@ -434,12 +433,12 @@ PolygonCoords(interp, canvas, itemPtr, argc, argv)
*/
static int
-ConfigurePolygon(interp, canvas, itemPtr, argc, argv, flags)
+ConfigurePolygon(interp, canvas, itemPtr, objc, objv, flags)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* Polygon item to reconfigure. */
- int argc; /* Number of elements in argv. */
- Tcl_Obj *CONST argv[]; /* Arguments describing things to configure. */
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
@@ -452,8 +451,8 @@ ConfigurePolygon(interp, canvas, itemPtr, argc, argv, flags)
Tk_State state;
tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
- (char *) polyPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+ (CONST char **) objv, (char *) polyPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -1022,7 +1021,7 @@ PolygonInsert(canvas, itemPtr, beforeThis, obj)
Tcl_Obj *obj; /* New coordinates to be inserted. */
{
PolygonItem *polyPtr = (PolygonItem *) itemPtr;
- int length, argc, i;
+ int length, objc, i;
Tcl_Obj **objv;
double *new;
Tk_State state = itemPtr->state;
@@ -1031,18 +1030,18 @@ PolygonInsert(canvas, itemPtr, beforeThis, obj)
state = ((TkCanvas *)canvas)->canvas_state;
}
- if (!obj || (Tcl_ListObjGetElements((Tcl_Interp *) NULL, obj, &argc, &objv) != TCL_OK)
- || !argc || argc&1) {
+ if (!obj || (Tcl_ListObjGetElements((Tcl_Interp *) NULL, obj, &objc, &objv) != TCL_OK)
+ || !objc || objc&1) {
return;
}
length = 2*(polyPtr->numPoints - polyPtr->autoClosed);
while(beforeThis>length) beforeThis-=length;
while(beforeThis<0) beforeThis+=length;
- new = (double *) ckalloc((unsigned)(sizeof(double) * (length + 2 + argc)));
+ new = (double *) ckalloc((unsigned)(sizeof(double) * (length + 2 + objc)));
for (i=0; i<beforeThis; i++) {
new[i] = polyPtr->coordPtr[i];
}
- for (i=0; i<argc; i++) {
+ for (i=0; i<objc; i++) {
if (Tcl_GetDoubleFromObj((Tcl_Interp *) NULL,objv[i],
new+(i+beforeThis))!=TCL_OK) {
ckfree((char *) new);
@@ -1051,10 +1050,10 @@ PolygonInsert(canvas, itemPtr, beforeThis, obj)
}
for(i=beforeThis; i<length; i++) {
- new[i+argc] = polyPtr->coordPtr[i];
+ new[i+objc] = polyPtr->coordPtr[i];
}
if(polyPtr->coordPtr) ckfree((char *) polyPtr->coordPtr);
- length+=argc;
+ length+=objc;
polyPtr->coordPtr = new;
polyPtr->numPoints = (length/2) + polyPtr->autoClosed;
@@ -1078,7 +1077,7 @@ PolygonInsert(canvas, itemPtr, beforeThis, obj)
new[length] = new[0];
new[length+1] = new[1];
- if (((length-argc)>3) && (state != TK_STATE_HIDDEN)) {
+ if (((length-objc)>3) && (state != TK_STATE_HIDDEN)) {
/*
* This is some optimizing code that will result that only the part
* of the polygon that changed (and the objects that are overlapping
@@ -1101,11 +1100,11 @@ PolygonInsert(canvas, itemPtr, beforeThis, obj)
itemPtr->x1 = itemPtr->x2 = (int) polyPtr->coordPtr[beforeThis];
itemPtr->y1 = itemPtr->y2 = (int) polyPtr->coordPtr[beforeThis+1];
- beforeThis-=2; argc+=4;
+ beforeThis-=2; objc+=4;
if(polyPtr->smooth) {
- beforeThis-=2; argc+=4;
+ beforeThis-=2; objc+=4;
} /* be carefull; beforeThis could now be negative */
- for(i=beforeThis; i<beforeThis+argc; i+=2) {
+ for(i=beforeThis; i<beforeThis+objc; i+=2) {
j=i;
if(j<0) j+=length;
if(j>=length) j-=length;
@@ -1485,21 +1484,16 @@ PolygonToArea(canvas, itemPtr, rectPtr)
polyPoints = polyPtr->coordPtr;
}
- if (polyPtr->fillGC != None) {
- inside = TkPolygonToArea(polyPoints, numPoints, rectPtr);
- if (inside==0) goto donearea;
- } else {
- if ((polyPoints[0] >= rectPtr[0])
- && (polyPoints[0] <= rectPtr[2])
- && (polyPoints[1] >= rectPtr[1])
- && (polyPoints[1] <= rectPtr[3])) {
- inside = 1;
- }
- }
+ /*
+ * Simple test to see if we are in the polygon. Polygons are
+ * different from othe canvas items in that they register points
+ * being inside even if it isn't filled.
+ */
+ inside = TkPolygonToArea(polyPoints, numPoints, rectPtr);
+ if (inside==0) goto donearea;
if (polyPtr->outline.gc == None) goto donearea ;
-
/*
* Iterate through all of the edges of the line, computing a polygon
* for each edge and testing the area against that polygon. In
@@ -1932,5 +1926,3 @@ PolygonToPostscript(interp, canvas, itemPtr, prepass)
}
return TCL_OK;
}
-
-
diff --git a/tk/generic/tkCanvPs.c b/tk/generic/tkCanvPs.c
index 66b1cc9d7df..18ffd3ab6fb 100644
--- a/tk/generic/tkCanvPs.c
+++ b/tk/generic/tkCanvPs.c
@@ -116,320 +116,6 @@ static Tk_ConfigSpec configSpecs[] = {
};
/*
- * The prolog data. Generated by str2c from prolog.ps
- * This was split in small chunks by str2c because
- * some C compiler have limitations on the size of static strings.
- * (str2c is a small tcl script in tcl's tool directory (source release))
- */
-static CONST char * CONST prolog[]= {
- /* Start of part 1 (2000 characters) */
- "%%BeginProlog\n\
-50 dict begin\n\
-\n\
-% This is a standard prolog for Postscript generated by Tk's canvas\n\
-% widget.\n\
-% RCS: @(#) $Id$\n\
-\n\
-% The definitions below just define all of the variables used in\n\
-% any of the procedures here. This is needed for obscure reasons\n\
-% explained on p. 716 of the Postscript manual (Section H.2.7,\n\
-% \"Initializing Variables,\" in the section on Encapsulated Postscript).\n\
-\n\
-/baseline 0 def\n\
-/stipimage 0 def\n\
-/height 0 def\n\
-/justify 0 def\n\
-/lineLength 0 def\n\
-/spacing 0 def\n\
-/stipple 0 def\n\
-/strings 0 def\n\
-/xoffset 0 def\n\
-/yoffset 0 def\n\
-/tmpstip null def\n\
-\n\
-% Define the array ISOLatin1Encoding (which specifies how characters are\n\
-% encoded for ISO-8859-1 fonts), if it isn't already present (Postscript\n\
-% level 2 is supposed to define it, but level 1 doesn't).\n\
-\n\
-systemdict /ISOLatin1Encoding known not {\n\
- /ISOLatin1Encoding [\n\
- /space /space /space /space /space /space /space /space\n\
- /space /space /space /space /space /space /space /space\n\
- /space /space /space /space /space /space /space /space\n\
- /space /space /space /space /space /space /space /space\n\
- /space /exclam /quotedbl /numbersign /dollar /percent /ampersand\n\
- /quoteright\n\
- /parenleft /parenright /asterisk /plus /comma /minus /period /slash\n\
- /zero /one /two /three /four /five /six /seven\n\
- /eight /nine /colon /semicolon /less /equal /greater /question\n\
- /at /A /B /C /D /E /F /G\n\
- /H /I /J /K /L /M /N /O\n\
- /P /Q /R /S /T /U /V /W\n\
- /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore\n\
- /quoteleft /a /b /c /d /e /f /g\n\
- /h /i /j /k /l /m /n /o\n\
- /p /q /r /s /t /u /v /w\n\
- /x /y /z /braceleft /bar /braceright /asciitilde /space\n\
- /space /space /space /space /space /space /space /space\n\
- /space /space /space /space /space /space /space /space\n\
- /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent\n\
- /dieresis /space /ring /cedilla /space /hungarumlaut /ogonek /caron\n\
- /space /exclamdown /cent /sterling /currency /yen /brokenbar /section\n\
- /dieresis /copyright /ordfem",
- /* End of part 1 */
-
- /* Start of part 2 (2000 characters) */
- "inine /guillemotleft /logicalnot /hyphen\n\
- /registered /macron\n\
- /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph\n\
- /periodcentered\n\
- /cedillar /onesuperior /ordmasculine /guillemotright /onequarter\n\
- /onehalf /threequarters /questiondown\n\
- /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla\n\
- /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex\n\
- /Idieresis\n\
- /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply\n\
- /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn\n\
- /germandbls\n\
- /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla\n\
- /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex\n\
- /idieresis\n\
- /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide\n\
- /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn\n\
- /ydieresis\n\
- ] def\n\
-} if\n\
-\n\
-% font ISOEncode font\n\
-% This procedure changes the encoding of a font from the default\n\
-% Postscript encoding to ISOLatin1. It's typically invoked just\n\
-% before invoking \"setfont\". The body of this procedure comes from\n\
-% Section 5.6.1 of the Postscript book.\n\
-\n\
-/ISOEncode {\n\
- dup length dict begin\n\
- {1 index /FID ne {def} {pop pop} ifelse} forall\n\
- /Encoding ISOLatin1Encoding def\n\
- currentdict\n\
- end\n\
-\n\
- % I'm not sure why it's necessary to use \"definefont\" on this new\n\
- % font, but it seems to be important; just use the name \"Temporary\"\n\
- % for the font.\n\
-\n\
- /Temporary exch definefont\n\
-} bind def\n\
-\n\
-% StrokeClip\n\
-%\n\
-% This procedure converts the current path into a clip area under\n\
-% the assumption of stroking. It's a bit tricky because some Postscript\n\
-% interpreters get errors during strokepath for dashed lines. If\n\
-% this happens then turn off dashes and try again.\n\
-\n\
-/StrokeClip {\n\
- {strokepath} stopped {\n\
- (This Postscript printer gets limitcheck overflows when) =\n\
- (stippling dashed lines; lines will be printed solid instead.) =\n\
- [] 0 setdash strokepath} if\n\
- clip\n\
-} bind def\n\
-\n\
-% d",
- /* End of part 2 */
-
- /* Start of part 3 (2000 characters) */
- "esiredSize EvenPixels closestSize\n\
-%\n\
-% The procedure below is used for stippling. Given the optimal size\n\
-% of a dot in a stipple pattern in the current user coordinate system,\n\
-% compute the closest size that is an exact multiple of the device's\n\
-% pixel size. This allows stipple patterns to be displayed without\n\
-% aliasing effects.\n\
-\n\
-/EvenPixels {\n\
- % Compute exact number of device pixels per stipple dot.\n\
- dup 0 matrix currentmatrix dtransform\n\
- dup mul exch dup mul add sqrt\n\
-\n\
- % Round to an integer, make sure the number is at least 1, and compute\n\
- % user coord distance corresponding to this.\n\
- dup round dup 1 lt {pop 1} if\n\
- exch div mul\n\
-} bind def\n\
-\n\
-% width height string StippleFill --\n\
-%\n\
-% Given a path already set up and a clipping region generated from\n\
-% it, this procedure will fill the clipping region with a stipple\n\
-% pattern. \"String\" contains a proper image description of the\n\
-% stipple pattern and \"width\" and \"height\" give its dimensions. Each\n\
-% stipple dot is assumed to be about one unit across in the current\n\
-% user coordinate system. This procedure trashes the graphics state.\n\
-\n\
-/StippleFill {\n\
- % The following code is needed to work around a NeWSprint bug.\n\
-\n\
- /tmpstip 1 index def\n\
-\n\
- % Change the scaling so that one user unit in user coordinates\n\
- % corresponds to the size of one stipple dot.\n\
- 1 EvenPixels dup scale\n\
-\n\
- % Compute the bounding box occupied by the path (which is now\n\
- % the clipping region), and round the lower coordinates down\n\
- % to the nearest starting point for the stipple pattern. Be\n\
- % careful about negative numbers, since the rounding works\n\
- % differently on them.\n\
-\n\
- pathbbox\n\
- 4 2 roll\n\
- 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll\n\
- 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll\n\
-\n\
- % Stack now: width height string y1 y2 x1 x2\n\
- % Below is a doubly-nested for loop to iterate across this area\n\
- % in units of the stipple pattern size, going up columns then\n\
- % acr",
- /* End of part 3 */
-
- /* Start of part 4 (2000 characters) */
- "oss rows, blasting out a stipple-pattern-sized rectangle at\n\
- % each position\n\
-\n\
- 6 index exch {\n\
- 2 index 5 index 3 index {\n\
- % Stack now: width height string y1 y2 x y\n\
-\n\
- gsave\n\
- 1 index exch translate\n\
- 5 index 5 index true matrix tmpstip imagemask\n\
- grestore\n\
- } for\n\
- pop\n\
- } for\n\
- pop pop pop pop pop\n\
-} bind def\n\
-\n\
-% -- AdjustColor --\n\
-% Given a color value already set for output by the caller, adjusts\n\
-% that value to a grayscale or mono value if requested by the CL\n\
-% variable.\n\
-\n\
-/AdjustColor {\n\
- CL 2 lt {\n\
- currentgray\n\
- CL 0 eq {\n\
- .5 lt {0} {1} ifelse\n\
- } if\n\
- setgray\n\
- } if\n\
-} bind def\n\
-\n\
-% x y strings spacing xoffset yoffset justify stipple DrawText --\n\
-% This procedure does all of the real work of drawing text. The\n\
-% color and font must already have been set by the caller, and the\n\
-% following arguments must be on the stack:\n\
-%\n\
-% x, y - Coordinates at which to draw text.\n\
-% strings - An array of strings, one for each line of the text item,\n\
-% in order from top to bottom.\n\
-% spacing - Spacing between lines.\n\
-% xoffset - Horizontal offset for text bbox relative to x and y: 0 for\n\
-% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se.\n\
-% yoffset - Vertical offset for text bbox relative to x and y: 0 for\n\
-% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se.\n\
-% justify - 0 for left justification, 0.5 for center, 1 for right justify.\n\
-% stipple - Boolean value indicating whether or not text is to be\n\
-% drawn in stippled fashion. If text is stippled,\n\
-% procedure StippleText must have been defined to call\n\
-% StippleFill in the right way.\n\
-%\n\
-% Also, when this procedure is invoked, the color and font must already\n\
-% have been set for the text.\n\
-\n\
-/DrawText {\n\
- /stipple exch def\n\
- /justify exch def\n\
- /yoffset exch def\n\
- /xoffset exch def\n\
- /spacing exch def\n\
- /strings exch def\n\
-\n\
- % First scan through all of the text to find the widest line.\n\
-\n\
- /lineLength 0 def\n\
- strings {\n\
- stringwidth pop\n\
- dup lineLength gt {/lineLength exch def}",
- /* End of part 4 */
-
- /* Start of part 5 (1546 characters) */
- " {pop} ifelse\n\
- newpath\n\
- } forall\n\
-\n\
- % Compute the baseline offset and the actual font height.\n\
-\n\
- 0 0 moveto (TXygqPZ) false charpath\n\
- pathbbox dup /baseline exch def\n\
- exch pop exch sub /height exch def pop\n\
- newpath\n\
-\n\
- % Translate coordinates first so that the origin is at the upper-left\n\
- % corner of the text's bounding box. Remember that x and y for\n\
- % positioning are still on the stack.\n\
-\n\
- translate\n\
- lineLength xoffset mul\n\
- strings length 1 sub spacing mul height add yoffset mul translate\n\
-\n\
- % Now use the baseline and justification information to translate so\n\
- % that the origin is at the baseline and positioning point for the\n\
- % first line of text.\n\
-\n\
- justify lineLength mul baseline neg translate\n\
-\n\
- % Iterate over each of the lines to output it. For each line,\n\
- % compute its width again so it can be properly justified, then\n\
- % display it.\n\
-\n\
- strings {\n\
- dup stringwidth pop\n\
- justify neg mul 0 moveto\n\
- stipple {\n\
-\n\
- % The text is stippled, so turn it into a path and print\n\
- % by calling StippledText, which in turn calls StippleFill.\n\
- % Unfortunately, many Postscript interpreters will get\n\
- % overflow errors if we try to do the whole string at\n\
- % once, so do it a character at a time.\n\
-\n\
- gsave\n\
- /char (X) def\n\
- {\n\
- char 0 3 -1 roll put\n\
- currentpoint\n\
- gsave\n\
- char true charpath clip StippleText\n\
- grestore\n\
- char stringwidth translate\n\
- moveto\n\
- } forall\n\
- grestore\n\
- } {show} ifelse\n\
- 0 spacing neg translate\n\
- } forall\n\
-} bind def\n\
-\n\
-%%EndProlog\n\
-",
- /* End of part 5 */
-
- NULL /* End of data marker */
-};
-
-/*
* Forward declarations for procedures defined later in this file:
*/
@@ -460,7 +146,7 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
TkCanvas *canvasPtr; /* Information about canvas widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Caller has
+ CONST char **argv; /* Argument strings. Caller has
* already parsed this command enough
* to know that argv[1] is
* "postscript". */
@@ -470,7 +156,8 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
int result;
Tk_Item *itemPtr;
#define STRING_LENGTH 400
- char string[STRING_LENGTH+1], *p;
+ char string[STRING_LENGTH+1];
+ CONST char *p;
time_t now;
size_t length;
Tk_Window tkwin = canvasPtr->tkwin;
@@ -484,7 +171,7 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
Tcl_DString buffer;
- CONST char * CONST *chunk;
+ char psenccmd[]="::tk::ensure_psenc_is_loaded";
/*
*----------------------------------------------------------------
@@ -492,7 +179,10 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
* then process all the arguments to fill the data structure in.
*----------------------------------------------------------------
*/
-
+ result = Tcl_EvalEx(interp,psenccmd,-1,TCL_EVAL_GLOBAL);
+ if (result != TCL_OK) {
+ return result;
+ }
oldInfoPtr = canvasPtr->psInfo;
canvasPtr->psInfo = (Tk_PostscriptInfo) &psInfo;
psInfo.x = canvasPtr->xOrigin;
@@ -717,8 +407,8 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
*/
if (psInfo.prolog) {
- Tcl_AppendResult(interp, "%!PS-Adobe-3.0 EPSF-3.0\n",
- "%%Creator: Tk Canvas Widget\n", (char *) NULL);
+ Tcl_AppendResult(interp, "%!PS-Adobe-3.0 EPSF-3.0\n",
+ "%%Creator: Tk Canvas Widget\n", (char *) NULL);
#ifdef HAVE_PW_GECOS
if (!Tcl_IsSafe(interp)) {
struct passwd *pwPtr = getpwuid(getuid()); /* INTL: Native. */
@@ -768,14 +458,12 @@ TkCanvPostscriptCmd(canvasPtr, interp, argc, argv)
/*
* Insert the prolog
*/
- for (chunk=prolog; *chunk; chunk++) {
- Tcl_AppendResult(interp, *chunk, (char *) NULL);
- }
-
+ Tcl_AppendResult(interp, Tcl_GetVar(interp,"::tk::ps_preamable",TCL_GLOBAL_ONLY), (char *) NULL);
if (psInfo.chan != NULL) {
- Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
+ Tcl_Write(psInfo.chan, Tcl_GetStringResult(interp), -1);
Tcl_ResetResult(canvasPtr->interp);
}
+
/*
*-----------------------------------------------------------
@@ -967,7 +655,7 @@ Tk_PostscriptColor(interp, psInfo, colorPtr)
*/
if (psInfoPtr->colorVar != NULL) {
- char *cmdString;
+ CONST char *cmdString;
cmdString = Tcl_GetVar2(interp, psInfoPtr->colorVar,
Tk_NameOfColor(colorPtr), 0);
@@ -1047,10 +735,11 @@ Tk_PostscriptFont(interp, psInfo, tkfont)
Tcl_DStringInit(&ds);
if (psInfoPtr->fontVar != NULL) {
- char *list, **argv;
+ CONST char *list;
int argc;
double size;
- char *name;
+ CONST char **argv;
+ CONST char *name;
name = Tk_NameOfFont(tkfont);
list = Tcl_GetVar2(interp, psInfoPtr->fontVar, name, 0);
@@ -2143,4 +1832,3 @@ Tk_PostscriptPhoto(interp, blockPtr, psInfo, width, height)
Tcl_AppendResult(interp, ">\n", (char *) NULL);
return TCL_OK;
}
-
diff --git a/tk/generic/tkCanvText.c b/tk/generic/tkCanvText.c
index 688d86b6b05..d2ef1b865f3 100644
--- a/tk/generic/tkCanvText.c
+++ b/tk/generic/tkCanvText.c
@@ -141,10 +141,10 @@ static void ComputeTextBbox _ANSI_ARGS_((Tk_Canvas canvas,
TextItem *textPtr));
static int ConfigureText _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags));
+ Tcl_Obj *CONST objv[], int flags));
static int CreateText _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int argc, Tcl_Obj *CONST objv[]));
static void DeleteText _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
static void DisplayCanvText _ANSI_ARGS_((Tk_Canvas canvas,
@@ -163,7 +163,7 @@ static void SetTextCursor _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, int index));
static int TextCoords _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int argc, Tcl_Obj *CONST objv[]));
static void TextDeleteChars _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, int first, int last));
static void TextInsert _ANSI_ARGS_((Tk_Canvas canvas,
@@ -226,30 +226,27 @@ Tk_ItemType tkTextType = {
*/
static int
-CreateText(interp, canvas, itemPtr, argc, argv)
+CreateText(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Arguments describing rectangle. */
+ int objc; /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing rectangle. */
{
TextItem *textPtr = (TextItem *) itemPtr;
- int i;
+ int i = 2;
- if (argc==1) {
+ if (objc == 1) {
i = 1;
- } else {
- char *arg = Tcl_GetStringFromObj(argv[1], NULL);
- if ((argc>1) && (arg[0] == '-')
- && (arg[1] >= 'a') && (arg[1] <= 'z')) {
+ } else if (objc > 1) {
+ char *arg = Tcl_GetString(objv[1]);
+ if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
- } else {
- i = 2;
}
}
- if (argc < i) {
+ if (objc < i) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tk_PathName(Tk_CanvasTkwin(canvas)), " create ",
itemPtr->typePtr->name, " x y ?options?\"", (char *) NULL);
@@ -293,10 +290,10 @@ CreateText(interp, canvas, itemPtr, argc, argv)
* Process the arguments to fill in the item record.
*/
- if ((TextCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {
+ if ((TextCoords(interp, canvas, itemPtr, i, objv) != TCL_OK)) {
goto error;
}
- if (ConfigureText(interp, canvas, itemPtr, argc-i, argv+i, 0) == TCL_OK) {
+ if (ConfigureText(interp, canvas, itemPtr, objc-i, objv+i, 0) == TCL_OK) {
return TCL_OK;
}
@@ -324,38 +321,38 @@ CreateText(interp, canvas, itemPtr, argc, argv)
*/
static int
-TextCoords(interp, canvas, itemPtr, argc, argv)
+TextCoords(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Array of coordinates: x1, y1, x2, y2, ... */
+ int objc; /* Number of coordinates supplied in objv. */
+ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1, x2, y2, ... */
{
TextItem *textPtr = (TextItem *) itemPtr;
- if (argc == 0) {
+ if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
Tcl_Obj *subobj = Tcl_NewDoubleObj(textPtr->x);
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewDoubleObj(textPtr->y);
Tcl_ListObjAppendElement(interp, obj, subobj);
Tcl_SetObjResult(interp, obj);
- } else if (argc < 3) {
- if (argc==1) {
- if (Tcl_ListObjGetElements(interp, argv[0], &argc,
- (Tcl_Obj ***) &argv) != TCL_OK) {
+ } else if (objc < 3) {
+ if (objc==1) {
+ if (Tcl_ListObjGetElements(interp, objv[0], &objc,
+ (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
- } else if (argc != 2) {
+ } else if (objc != 2) {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 2, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 2, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
}
- if ((Tk_CanvasGetCoordFromObj(interp, canvas, argv[0], &textPtr->x) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[1],
+ if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], &textPtr->x) != TCL_OK)
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1],
&textPtr->y) != TCL_OK)) {
return TCL_ERROR;
}
@@ -363,7 +360,7 @@ TextCoords(interp, canvas, itemPtr, argc, argv)
} else {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
@@ -390,12 +387,12 @@ TextCoords(interp, canvas, itemPtr, argc, argv)
*/
static int
-ConfigureText(interp, canvas, itemPtr, argc, argv, flags)
+ConfigureText(interp, canvas, itemPtr, objc, objv, flags)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* Rectangle item to reconfigure. */
- int argc; /* Number of elements in argv. */
- Tcl_Obj *CONST argv[]; /* Arguments describing things to configure. */
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
TextItem *textPtr = (TextItem *) itemPtr;
@@ -410,8 +407,8 @@ ConfigureText(interp, canvas, itemPtr, argc, argv, flags)
Tk_State state;
tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
- (char *) textPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+ (CONST char **) objv, (char *) textPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -638,8 +635,8 @@ ComputeTextBbox(canvas, textPtr)
* of the bounding box for the text item.
*/
- leftX = (int) (textPtr->x + 0.5);
- topY = (int) (textPtr->y + 0.5);
+ leftX = (int) floor(textPtr->x + 0.5);
+ topY = (int) floor(textPtr->y + 0.5);
switch (textPtr->anchor) {
case TK_ANCHOR_NW:
case TK_ANCHOR_N:
@@ -774,7 +771,7 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
}
if ((selFirstChar >= 0) && (selFirstChar <= selLastChar)) {
int xFirst, yFirst, hFirst;
- int xLast, yLast;
+ int xLast, yLast, wLast;
/*
* Draw a special background under the selection.
@@ -783,7 +780,7 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
Tk_CharBbox(textPtr->textLayout, selFirstChar, &xFirst, &yFirst,
NULL, &hFirst);
Tk_CharBbox(textPtr->textLayout, selLastChar, &xLast, &yLast,
- NULL, NULL);
+ &wLast, NULL);
/*
* If the selection spans the end of this line, then display
@@ -796,7 +793,7 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
height = hFirst;
for (y = yFirst ; y <= yLast; y += height) {
if (y == yLast) {
- width = xLast - x;
+ width = xLast + wLast - x;
} else {
width = textPtr->rightEdge - textPtr->leftEdge - x;
}
@@ -831,6 +828,8 @@ DisplayCanvText(canvas, itemPtr, display, drawable, x, y, width, height)
- (textInfoPtr->insertWidth / 2)),
(double) (textPtr->header.y1 + y),
&drawableX, &drawableY);
+ Tk_SetCaretPos(Tk_CanvasTkwin(canvas), drawableX, drawableY,
+ height);
if (textInfoPtr->cursorOn) {
Tk_Fill3DRectangle(Tk_CanvasTkwin(canvas), drawable,
textInfoPtr->insertBorder,
@@ -1379,7 +1378,8 @@ GetSelText(canvas, itemPtr, offset, buffer, maxBytes)
{
TextItem *textPtr = (TextItem *) itemPtr;
int byteCount;
- char *text, *selStart, *selEnd;
+ char *text;
+ CONST char *selStart, *selEnd;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
if ((textInfoPtr->selectFirst < 0) ||
@@ -1513,4 +1513,3 @@ TextToPostscript(interp, canvas, itemPtr, prepass)
return TCL_OK;
}
-
diff --git a/tk/generic/tkCanvUtil.c b/tk/generic/tkCanvUtil.c
index 0abf9665574..50594016940 100644
--- a/tk/generic/tkCanvUtil.c
+++ b/tk/generic/tkCanvUtil.c
@@ -189,7 +189,7 @@ int
Tk_CanvasGetCoord(interp, canvas, string, doublePtr)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Tk_Canvas canvas; /* Canvas to which coordinate applies. */
- char *string; /* Describes coordinate (any screen
+ CONST char *string; /* Describes coordinate (any screen
* coordinate form may be used here). */
double *doublePtr; /* Place to store converted coordinate. */
{
@@ -369,14 +369,14 @@ Tk_CanvasTagsParseProc(clientData, interp, tkwin, value, widgRec, offset)
ClientData clientData; /* Not used.*/
Tcl_Interp *interp; /* Used for reporting errors. */
Tk_Window tkwin; /* Window containing canvas widget. */
- char *value; /* Value of option (list of tag
+ CONST char *value; /* Value of option (list of tag
* names). */
char *widgRec; /* Pointer to record for item. */
int offset; /* Offset into item (ignored). */
{
register Tk_Item *itemPtr = (Tk_Item *) widgRec;
int argc, i;
- char **argv;
+ CONST char **argv;
Tk_Uid *newPtr;
/*
@@ -454,7 +454,7 @@ Tk_CanvasTagsPrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
return (char *) itemPtr->tagPtr[0];
}
*freeProcPtr = TCL_DYNAMIC;
- return Tcl_Merge(itemPtr->numTags, (char **) itemPtr->tagPtr);
+ return Tcl_Merge(itemPtr->numTags, (CONST char **) itemPtr->tagPtr);
}
@@ -706,8 +706,15 @@ TkSmoothParseProc(clientData, interp, tkwin, value, widgRec, offset)
if (smooth) {
*smoothPtr = smooth;
return TCL_OK;
+ } else if (strncmp(value, tkBezierSmoothMethod.name, length) == 0) {
+ /*
+ * We need to do handle the built-in bezier method.
+ */
+ *smoothPtr = &tkBezierSmoothMethod;
+ return TCL_OK;
}
+
if (Tcl_GetBoolean(interp, (char *) value, &b) != TCL_OK) {
return TCL_ERROR;
}
@@ -777,7 +784,7 @@ Tk_GetDash(interp, value, dash)
* store dash information. */
{
int argc, i;
- char **largv, **argv = NULL;
+ CONST char **largv, **argv = NULL;
char *pt;
if ((value==(char *) NULL) || (*value==0) ) {
@@ -1472,4 +1479,3 @@ DashConvert (l, p, n, width)
}
return result;
}
-
diff --git a/tk/generic/tkCanvWind.c b/tk/generic/tkCanvWind.c
index 8a452b70d39..af18628a888 100644
--- a/tk/generic/tkCanvWind.c
+++ b/tk/generic/tkCanvWind.c
@@ -75,11 +75,11 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputeWindowBbox _ANSI_ARGS_((Tk_Canvas canvas,
WindowItem *winItemPtr));
static int ConfigureWinItem _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[], int flags));
static int CreateWinItem _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void DeleteWinItem _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
static void DisplayWinItem _ANSI_ARGS_((Tk_Canvas canvas,
@@ -91,8 +91,8 @@ static void ScaleWinItem _ANSI_ARGS_((Tk_Canvas canvas,
static void TranslateWinItem _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, double deltaX, double deltaY));
static int WinItemCoords _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[]));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[]));
static void WinItemLostSlaveProc _ANSI_ARGS_((
ClientData clientData, Tk_Window tkwin));
static void WinItemRequestProc _ANSI_ARGS_((ClientData clientData,
@@ -175,30 +175,27 @@ static Tk_GeomMgr canvasGeomType = {
*/
static int
-CreateWinItem(interp, canvas, itemPtr, argc, argv)
+CreateWinItem(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Arguments describing window. */
+ int objc; /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing window. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
- int i;
+ int i = 2;
- if (argc==1) {
+ if (objc == 1) {
i = 1;
- } else {
- char *arg = Tcl_GetStringFromObj(argv[1], NULL);
- if (((argc>1) && (arg[0] == '-')
- && (arg[1] >= 'a') && (arg[1] <= 'z'))) {
+ } else if (objc > 1) {
+ char *arg = Tcl_GetString(objv[1]);
+ if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
- } else {
- i = 2;
}
}
- if (argc < i) {
+ if (objc < i) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tk_PathName(Tk_CanvasTkwin(canvas)), " create ",
itemPtr->typePtr->name, " x y ?options?\"",
@@ -220,10 +217,10 @@ CreateWinItem(interp, canvas, itemPtr, argc, argv)
* Process the arguments to fill in the item record.
*/
- if ((WinItemCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {
+ if ((WinItemCoords(interp, canvas, itemPtr, i, objv) != TCL_OK)) {
goto error;
}
- if (ConfigureWinItem(interp, canvas, itemPtr, argc-i, argv+i, 0) == TCL_OK) {
+ if (ConfigureWinItem(interp, canvas, itemPtr, objc-i, objv+i, 0) == TCL_OK) {
return TCL_OK;
}
@@ -251,40 +248,40 @@ CreateWinItem(interp, canvas, itemPtr, argc, argv)
*/
static int
-WinItemCoords(interp, canvas, itemPtr, argc, argv)
+WinItemCoords(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Array of coordinates: x1, y1,
+ int objc; /* Number of coordinates supplied in
+ * objv. */
+ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
* x2, y2, ... */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
- if (argc == 0) {
+ if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
Tcl_Obj *subobj = Tcl_NewDoubleObj(winItemPtr->x);
Tcl_ListObjAppendElement(interp, obj, subobj);
subobj = Tcl_NewDoubleObj(winItemPtr->y);
Tcl_ListObjAppendElement(interp, obj, subobj);
Tcl_SetObjResult(interp, obj);
- } else if (argc < 3) {
- if (argc==1) {
- if (Tcl_ListObjGetElements(interp, argv[0], &argc,
- (Tcl_Obj ***) &argv) != TCL_OK) {
+ } else if (objc < 3) {
+ if (objc==1) {
+ if (Tcl_ListObjGetElements(interp, objv[0], &objc,
+ (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
- } else if (argc != 2) {
+ } else if (objc != 2) {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 2, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 2, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
}
- if ((Tk_CanvasGetCoordFromObj(interp, canvas, argv[0], &winItemPtr->x)
- != TCL_OK) || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[1],
+ if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0], &winItemPtr->x)
+ != TCL_OK) || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1],
&winItemPtr->y) != TCL_OK)) {
return TCL_ERROR;
}
@@ -292,7 +289,7 @@ WinItemCoords(interp, canvas, itemPtr, argc, argv)
} else {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
@@ -318,12 +315,12 @@ WinItemCoords(interp, canvas, itemPtr, argc, argv)
*/
static int
-ConfigureWinItem(interp, canvas, itemPtr, argc, argv, flags)
+ConfigureWinItem(interp, canvas, itemPtr, objc, objv, flags)
Tcl_Interp *interp; /* Used for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* Window item to reconfigure. */
- int argc; /* Number of elements in argv. */
- Tcl_Obj *CONST argv[]; /* Arguments describing things to configure. */
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
WindowItem *winItemPtr = (WindowItem *) itemPtr;
@@ -332,8 +329,8 @@ ConfigureWinItem(interp, canvas, itemPtr, argc, argv, flags)
oldWindow = winItemPtr->tkwin;
canvasTkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, argc, (char **) argv,
- (char *) winItemPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, canvasTkwin, configSpecs, objc,
+ (CONST char **) objv, (char *) winItemPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
@@ -356,7 +353,7 @@ ConfigureWinItem(interp, canvas, itemPtr, argc, argv, flags)
/*
* Make sure that the canvas is either the parent of the
* window associated with the item or a descendant of that
- * parent. Also, don't allow a top-level window to be
+ * parent. Also, don't allow a top-of-hierarchy window to be
* managed inside a canvas.
*/
@@ -366,7 +363,7 @@ ConfigureWinItem(interp, canvas, itemPtr, argc, argv, flags)
if (ancestor == parent) {
break;
}
- if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_LEVEL) {
+ if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) {
badWindow:
Tcl_AppendResult(interp, "can't use ",
Tk_PathName(winItemPtr->tkwin),
@@ -375,7 +372,7 @@ ConfigureWinItem(interp, canvas, itemPtr, argc, argv, flags)
return TCL_ERROR;
}
}
- if (((Tk_FakeWin *) (winItemPtr->tkwin))->flags & TK_TOP_LEVEL) {
+ if (((Tk_FakeWin *) (winItemPtr->tkwin))->flags & TK_TOP_HIERARCHY) {
goto badWindow;
}
if (winItemPtr->tkwin == canvasTkwin) {
@@ -1101,4 +1098,3 @@ WinItemLostSlaveProc(clientData, tkwin)
Tk_UnmapWindow(winItemPtr->tkwin);
winItemPtr->tkwin = NULL;
}
-
diff --git a/tk/generic/tkCanvas.c b/tk/generic/tkCanvas.c
index aea03485631..089ee3398a3 100644
--- a/tk/generic/tkCanvas.c
+++ b/tk/generic/tkCanvas.c
@@ -291,7 +291,7 @@ static int FindArea _ANSI_ARGS_((Tcl_Interp *interp,
TkCanvas *canvasPtr, Tcl_Obj *CONST *argv, Tk_Uid uid,
int enclosed));
static double GridAlign _ANSI_ARGS_((double coord, double spacing));
-static char** GetStringsFromObjs _ANSI_ARGS_((int argc,
+static CONST char** GetStringsFromObjs _ANSI_ARGS_((int argc,
Tcl_Obj *CONST *objv));
static void InitCanvas _ANSI_ARGS_((void));
#ifdef USE_OLD_TAG_SEARCH
@@ -299,9 +299,8 @@ static Tk_Item * NextItem _ANSI_ARGS_((TagSearch *searchPtr));
#endif /* USE_OLD_TAG_SEARCH */
static void PickCurrentItem _ANSI_ARGS_((TkCanvas *canvasPtr,
XEvent *eventPtr));
-static void PrintScrollFractions _ANSI_ARGS_((int screen1,
- int screen2, int object1, int object2,
- char *string));
+static Tcl_Obj * ScrollFractions _ANSI_ARGS_((int screen1,
+ int screen2, int object1, int object2));
#ifdef USE_OLD_TAG_SEARCH
static void RelinkItems _ANSI_ARGS_((TkCanvas *canvasPtr,
Tcl_Obj *tag, Tk_Item *prevPtr));
@@ -330,10 +329,9 @@ static Tk_Item * TagSearchNext _ANSI_ARGS_((TagSearch *searchPtr));
* that can be invoked from generic window code.
*/
-static TkClassProcs canvasClass = {
- NULL, /* createProc. */
- CanvasWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+static Tk_ClassProcs canvasClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ CanvasWorldChanged, /* worldChangedProc */
};
@@ -467,7 +465,7 @@ Tk_CanvasObjCmd(clientData, interp, argc, argv)
Tcl_InitHashTable(&canvasPtr->idTable, TCL_ONE_WORD_KEYS);
Tk_SetClass(canvasPtr->tkwin, "Canvas");
- TkSetClassProcs(canvasPtr->tkwin, &canvasClass, (ClientData) canvasPtr);
+ Tk_SetClassProcs(canvasPtr->tkwin, &canvasClass, (ClientData) canvasPtr);
Tk_CreateEventHandler(canvasPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
CanvasEventProc, (ClientData) canvasPtr);
@@ -528,7 +526,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
#endif /* USE_OLD_TAG_SEARCH */
int index;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"addtag", "bbox", "bind", "canvasx",
"canvasy", "cget", "configure", "coords",
"create", "dchars", "delete", "dtag",
@@ -772,12 +770,12 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
goto done;
}
} else if (argc == 4) {
- char *command;
+ CONST char *command;
command = Tk_GetBinding(interp, canvasPtr->bindingTable,
object, Tcl_GetStringFromObj(argv[3], NULL));
if (command == NULL) {
- char *string;
+ CONST char *string;
string = Tcl_GetStringResult(interp);
/*
@@ -793,7 +791,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
Tcl_ResetResult(interp);
}
} else {
- Tcl_SetResult(interp, command, TCL_STATIC);
+ Tcl_SetResult(interp, (char *) command, TCL_STATIC);
}
} else {
Tk_GetAllBindings(interp, canvasPtr->bindingTable, object);
@@ -902,7 +900,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
result = (*itemPtr->typePtr->coordProc)(interp,
(Tk_Canvas) canvasPtr, itemPtr, argc-3, argv+3);
} else {
- char **args = GetStringsFromObjs(argc-3, argv+3);
+ CONST char **args = GetStringsFromObjs(argc-3, argv+3);
result = (*itemPtr->typePtr->coordProc)(interp,
(Tk_Canvas) canvasPtr, itemPtr, argc-3, (Tcl_Obj **) args);
if (args) ckfree((char *) args);
@@ -961,7 +959,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
itemPtr, argc-3, argv+3);
} else {
- char **args = GetStringsFromObjs(argc-3, argv+3);
+ CONST char **args = GetStringsFromObjs(argc-3, argv+3);
result = (*typePtr->createProc)(interp, (Tk_Canvas) canvasPtr,
itemPtr, argc-3, (Tcl_Obj **) args);
if (args) ckfree((char *) args);
@@ -1390,7 +1388,8 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
case CANV_ITEMCGET: {
if (argc != 4) {
Tcl_WrongNumArgs(interp, 2, argv, "tagOrId option");
- return TCL_ERROR;
+ result = TCL_ERROR;
+ goto done;
}
#ifdef USE_OLD_TAG_SEARCH
itemPtr = StartTagSearch(canvasPtr, argv[2], &search);
@@ -1438,7 +1437,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
(Tk_Canvas) canvasPtr, itemPtr, argc-3, argv+3,
TK_CONFIG_ARGV_ONLY);
} else {
- char **args = GetStringsFromObjs(argc-3, argv+3);
+ CONST char **args = GetStringsFromObjs(argc-3, argv+3);
result = (*itemPtr->typePtr->configProc)(interp,
(Tk_Canvas) canvasPtr, itemPtr, argc-3, (Tcl_Obj **) args,
TK_CONFIG_ARGV_ONLY);
@@ -1527,7 +1526,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
break;
}
case CANV_POSTSCRIPT: {
- char **args = GetStringsFromObjs(argc, argv);
+ CONST char **args = GetStringsFromObjs(argc, argv);
result = TkCanvPostscriptCmd(canvasPtr, interp, argc, args);
if (args) ckfree((char *) args);
break;
@@ -1621,30 +1620,26 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
}
case CANV_SCAN: {
int x, y, gain=10;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"mark", "dragto", NULL
};
- if (Tcl_GetIndexFromObj(interp, argv[2], optionStrings, "scan option", 0,
- &index) != TCL_OK) {
- return TCL_ERROR;
- }
-
- if ((argc != 5) && (argc != 5+index)) {
+ if (argc < 5) {
+ Tcl_WrongNumArgs(interp, 2, argv, "mark|dragto x y ?dragGain?");
+ result = TCL_ERROR;
+ } else if (Tcl_GetIndexFromObj(interp, argv[2], optionStrings,
+ "scan option", 0, &index) != TCL_OK) {
+ result = TCL_ERROR;
+ } else if ((argc != 5) && (argc != 5+index)) {
Tcl_WrongNumArgs(interp, 3, argv, index?"x y ?gain?":"x y");
result = TCL_ERROR;
- goto done;
- }
- if ((Tcl_GetIntFromObj(interp, argv[3], &x) != TCL_OK)
+ } else if ((Tcl_GetIntFromObj(interp, argv[3], &x) != TCL_OK)
|| (Tcl_GetIntFromObj(interp, argv[4], &y) != TCL_OK)){
result = TCL_ERROR;
- goto done;
- }
- if ((argc == 6) && (Tcl_GetIntFromObj(interp, argv[5], &gain) != TCL_OK)) {
+ } else if ((argc == 6) &&
+ (Tcl_GetIntFromObj(interp, argv[5], &gain) != TCL_OK)) {
result = TCL_ERROR;
- goto done;
- }
- if (!index) {
+ } else if (!index) {
canvasPtr->scanX = x;
canvasPtr->scanXOrigin = canvasPtr->xOrigin;
canvasPtr->scanY = y;
@@ -1669,7 +1664,7 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
}
case CANV_SELECT: {
int index, optionindex;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"adjust", "clear", "from", "item", "to", NULL
};
enum options {
@@ -1719,7 +1714,8 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
}
if (Tcl_GetIndexFromObj(interp, argv[2], optionStrings, "select option", 0,
&optionindex) != TCL_OK) {
- return TCL_ERROR;
+ result = TCL_ERROR;
+ goto done;
}
switch ((enum options) optionindex) {
case CANV_ADJUST: {
@@ -1817,12 +1813,13 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
double fraction;
if (argc == 2) {
- PrintScrollFractions(canvasPtr->xOrigin + canvasPtr->inset,
+ Tcl_SetObjResult(interp, ScrollFractions(
+ canvasPtr->xOrigin + canvasPtr->inset,
canvasPtr->xOrigin + Tk_Width(canvasPtr->tkwin)
- canvasPtr->inset, canvasPtr->scrollX1,
- canvasPtr->scrollX2, Tcl_GetStringResult(interp));
+ canvasPtr->scrollX2));
} else {
- char **args = GetStringsFromObjs(argc, argv);
+ CONST char **args = GetStringsFromObjs(argc, argv);
type = Tk_GetScrollInfo(interp, argc, args, &fraction, &count);
if (args) ckfree((char *) args);
switch (type) {
@@ -1860,12 +1857,13 @@ CanvasWidgetCmd(clientData, interp, argc, argv)
double fraction;
if (argc == 2) {
- PrintScrollFractions(canvasPtr->yOrigin + canvasPtr->inset,
+ Tcl_SetObjResult(interp,ScrollFractions(\
+ canvasPtr->yOrigin + canvasPtr->inset,
canvasPtr->yOrigin + Tk_Height(canvasPtr->tkwin)
- canvasPtr->inset, canvasPtr->scrollY1,
- canvasPtr->scrollY2, Tcl_GetStringResult(interp));
+ canvasPtr->scrollY2));
} else {
- char **args = GetStringsFromObjs(argc, argv);
+ CONST char **args = GetStringsFromObjs(argc, argv);
type = Tk_GetScrollInfo(interp, argc, args, &fraction, &count);
if (args) ckfree((char *) args);
switch (type) {
@@ -1930,14 +1928,10 @@ DestroyCanvas(memPtr)
{
TkCanvas *canvasPtr = (TkCanvas *) memPtr;
Tk_Item *itemPtr;
+#ifndef USE_OLD_TAG_SEARCH
+ TagSearchExpr *expr, *next;
+#endif
- if (canvasPtr->tkwin != NULL) {
- Tcl_DeleteCommandFromToken(canvasPtr->interp, canvasPtr->widgetCmd);
- }
- if (canvasPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayCanvas, (ClientData) canvasPtr);
- }
-
/*
* Free up all of the items in the canvas.
*/
@@ -1964,15 +1958,11 @@ DestroyCanvas(memPtr)
Tk_FreeGC(canvasPtr->display, canvasPtr->pixmapGC);
}
#ifndef USE_OLD_TAG_SEARCH
- {
- TagSearchExpr *expr, *next;
-
- expr = canvasPtr->bindTagExprs;
- while (expr) {
- next = expr->next;
- TagSearchExprDestroy(expr);
- expr = next;
- }
+ expr = canvasPtr->bindTagExprs;
+ while (expr) {
+ next = expr->next;
+ TagSearchExprDestroy(expr);
+ expr = next;
}
#endif
Tcl_DeleteTimerHandler(canvasPtr->insertBlinkHandler);
@@ -2018,7 +2008,8 @@ ConfigureCanvas(interp, canvasPtr, argc, argv, flags)
GC new;
if (Tk_ConfigureWidget(interp, canvasPtr->tkwin, configSpecs,
- argc, (char **) argv, (char *) canvasPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ argc, (CONST char **) argv, (char *) canvasPtr,
+ flags|TK_CONFIG_OBJS) != TCL_OK) {
return TCL_ERROR;
}
@@ -2071,7 +2062,7 @@ ConfigureCanvas(interp, canvasPtr, argc, argv, flags)
canvasPtr->scrollY2 = 0;
if (canvasPtr->regionString != NULL) {
int argc2;
- char **argv2;
+ CONST char **argv2;
if (Tcl_SplitList(canvasPtr->interp, canvasPtr->regionString,
&argc2, &argv2) != TCL_OK) {
@@ -2448,7 +2439,16 @@ CanvasEventProc(clientData, eventPtr)
canvasPtr->flags |= REDRAW_BORDERS;
}
} else if (eventPtr->type == DestroyNotify) {
- DestroyCanvas((char *) canvasPtr);
+ if (canvasPtr->tkwin != NULL) {
+ canvasPtr->tkwin = NULL;
+ Tcl_DeleteCommandFromToken(canvasPtr->interp,
+ canvasPtr->widgetCmd);
+ }
+ if (canvasPtr->flags & REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DisplayCanvas, (ClientData) canvasPtr);
+ }
+ Tcl_EventuallyFree((ClientData) canvasPtr,
+ (Tcl_FreeProc *) DestroyCanvas);
} else if (eventPtr->type == ConfigureNotify) {
canvasPtr->flags |= UPDATE_SCROLLBARS;
@@ -3972,7 +3972,7 @@ FindItems(interp, canvasPtr, argc, argv, newTag, first, searchPtrPtr)
Tk_Item *itemPtr;
Tk_Uid uid;
int index;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"above", "all", "below", "closest",
"enclosed", "overlapping", "withtag", NULL
};
@@ -5205,12 +5205,12 @@ GridAlign(coord, spacing)
/*
*----------------------------------------------------------------------
*
- * PrintScrollFractions --
+ * ScrollFractions --
*
* Given the range that's visible in the window and the "100%
- * range" for what's in the canvas, print a string containing
- * the scroll fractions. This procedure is used for both x
- * and y scrolling.
+ * range" for what's in the canvas, return a list of two
+ * doubles representing the scroll fractions. This procedure
+ * is used for both x and y scrolling.
*
* Results:
* The memory pointed to by string is modified to hold
@@ -5223,17 +5223,15 @@ GridAlign(coord, spacing)
*----------------------------------------------------------------------
*/
-static void
-PrintScrollFractions(screen1, screen2, object1, object2, string)
+static Tcl_Obj *
+ScrollFractions(screen1, screen2, object1, object2)
int screen1; /* Lowest coordinate visible in the window. */
int screen2; /* Highest coordinate visible in the window. */
int object1; /* Lowest coordinate in the object. */
int object2; /* Highest coordinate in the object. */
- char *string; /* Two real numbers get printed here. Must
- * have enough storage for two %g
- * conversions. */
{
double range, f1, f2;
+ char buffer[2*TCL_DOUBLE_SPACE+2];
range = object2 - object1;
if (range <= 0) {
@@ -5252,7 +5250,8 @@ PrintScrollFractions(screen1, screen2, object1, object2, string)
f2 = f1;
}
}
- sprintf(string, "%g %g", f1, f2);
+ sprintf(buffer, "%g %g", f1, f2);
+ return Tcl_NewStringObj(buffer, -1);
}
/*
@@ -5281,7 +5280,6 @@ CanvasUpdateScrollbars(canvasPtr)
TkCanvas *canvasPtr; /* Information about canvas. */
{
int result;
- char buffer[200];
Tcl_Interp *interp;
int xOrigin, yOrigin, inset, width, height, scrollX1, scrollX2,
scrollY1, scrollY2;
@@ -5313,9 +5311,11 @@ CanvasUpdateScrollbars(canvasPtr)
scrollY2 = canvasPtr->scrollY2;
canvasPtr->flags &= ~UPDATE_SCROLLBARS;
if (canvasPtr->xScrollCmd != NULL) {
- PrintScrollFractions(xOrigin + inset, xOrigin + width - inset,
- scrollX1, scrollX2, buffer);
- result = Tcl_VarEval(interp, xScrollCmd, " ", buffer, (char *) NULL);
+ Tcl_Obj *fractions = ScrollFractions(xOrigin + inset,
+ xOrigin + width - inset, scrollX1, scrollX2);
+ result = Tcl_VarEval(interp, xScrollCmd, " ",
+ Tcl_GetString(fractions), (char *) NULL);
+ Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
Tcl_BackgroundError(interp);
}
@@ -5324,9 +5324,11 @@ CanvasUpdateScrollbars(canvasPtr)
}
if (yScrollCmd != NULL) {
- PrintScrollFractions(yOrigin + inset, yOrigin + height - inset,
- scrollY1, scrollY2, buffer);
- result = Tcl_VarEval(interp, yScrollCmd, " ", buffer, (char *) NULL);
+ Tcl_Obj *fractions = ScrollFractions(yOrigin + inset,
+ yOrigin + height - inset, scrollY1, scrollY2);
+ result = Tcl_VarEval(interp, yScrollCmd, " ",
+ Tcl_GetString(fractions), (char *) NULL);
+ Tcl_DecrRefCount(fractions);
if (result != TCL_OK) {
Tcl_BackgroundError(interp);
}
@@ -5484,17 +5486,17 @@ CanvasSetOrigin(canvasPtr, xOrigin, yOrigin)
*----------------------------------------------------------------------
*/
/* ARGSUSED */
-static char **
+static CONST char **
GetStringsFromObjs(argc, objv)
int argc;
Tcl_Obj *CONST objv[];
{
register int i;
- char **argv;
+ CONST char **argv;
if (argc <= 0) {
return NULL;
}
- argv = (char **) ckalloc((argc+1) * sizeof(char *));
+ argv = (CONST char **) ckalloc((argc+1) * sizeof(char *));
for (i = 0; i < argc; i++) {
argv[i]=Tcl_GetStringFromObj(objv[i], (int *) NULL);
}
@@ -5700,5 +5702,3 @@ Tk_CanvasPsPath(interp, canvas, coordPtr, numPoints)
Tk_PostscriptPath(interp, ((TkCanvas *) canvas)->psInfo,
coordPtr, numPoints);
}
-
-
diff --git a/tk/generic/tkCanvas.h b/tk/generic/tkCanvas.h
index 103c874aee1..169f659294f 100644
--- a/tk/generic/tkCanvas.h
+++ b/tk/generic/tkCanvas.h
@@ -293,7 +293,7 @@ typedef struct TkCanvas {
*/
extern int TkCanvPostscriptCmd _ANSI_ARGS_((TkCanvas *canvasPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
/*
* The following definition is shared between tkCanvPs.c and tkCanvImg.c,
@@ -310,4 +310,3 @@ typedef struct TkColormapData { /* Hold color information for a window */
} TkColormapData;
#endif /* _TKCANVAS */
-
diff --git a/tk/generic/tkClipboard.c b/tk/generic/tkClipboard.c
index c1a8c81ba5f..110b6ee3ecc 100644
--- a/tk/generic/tkClipboard.c
+++ b/tk/generic/tkClipboard.c
@@ -30,6 +30,8 @@ static int ClipboardWindowHandler _ANSI_ARGS_((
ClientData clientData, int offset, char *buffer,
int maxBytes));
static void ClipboardLostSel _ANSI_ARGS_((ClientData clientData));
+static int ClipboardGetProc _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, char *portion));
/*
*----------------------------------------------------------------------
@@ -139,7 +141,7 @@ ClipboardAppHandler(clientData, offset, buffer, maxBytes)
{
TkDisplay *dispPtr = (TkDisplay *) clientData;
size_t length;
- char *p;
+ CONST char *p;
p = dispPtr->clipboardAppPtr->winPtr->nameUid;
length = strlen(p);
@@ -406,7 +408,7 @@ Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
/*
*----------------------------------------------------------------------
*
- * Tk_ClipboardCmd --
+ * Tk_ClipboardObjCmd --
*
* This procedure is invoked to process the "clipboard" Tcl
* command. See the user documentation for details on what
@@ -422,117 +424,235 @@ Tk_ClipboardAppend(interp, tkwin, type, format, buffer)
*/
int
-Tk_ClipboardCmd(clientData, interp, argc, argv)
+Tk_ClipboardObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument strings. */
{
Tk_Window tkwin = (Tk_Window) clientData;
char *path = NULL;
- size_t length;
- int count;
- char c;
- char **args;
+ Atom selection;
+ static CONST char *optionStrings[] = { "append", "clear", "get", NULL };
+ enum options { CLIPBOARD_APPEND, CLIPBOARD_CLEAR, CLIPBOARD_GET };
+ int index, i;
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " option ?arg arg ...?\"", (char *) NULL);
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 'a') && (strncmp(argv[1], "append", length) == 0)) {
- Atom target, format;
- char *targetName = NULL;
- char *formatName = NULL;
-
- for (count = argc-2, args = argv+2; count > 1; count -= 2, args += 2) {
- if (args[0][0] != '-') {
- break;
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum options) index) {
+ case CLIPBOARD_APPEND: {
+ Atom target, format;
+ char *targetName = NULL;
+ char *formatName = NULL;
+ char *string;
+ static CONST char *appendOptionStrings[] = {
+ "-displayof", "-format", "-type", NULL
+ };
+ enum appendOptions { APPEND_DISPLAYOF, APPEND_FORMAT,
+ APPEND_TYPE };
+ int subIndex, length;
+
+ for (i = 2; i < objc - 1; i++) {
+ string = Tcl_GetStringFromObj(objv[i], &length);
+ if (string[0] != '-') {
+ break;
+ }
+
+ /*
+ * If the argument is "--", it signifies the end of arguments.
+ */
+ if (string[1] == '-' && length == 2) {
+ i++;
+ break;
+ }
+ if (Tcl_GetIndexFromObj(interp, objv[i], appendOptionStrings,
+ "option", 0, &subIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Increment i so that it points to the value for the flag
+ * instead of the flag itself.
+ */
+
+ i++;
+ if (i >= objc) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", (char *) NULL);
+ return TCL_ERROR;
+ }
+ switch ((enum appendOptions) subIndex) {
+ case APPEND_DISPLAYOF:
+ path = Tcl_GetString(objv[i]);
+ break;
+ case APPEND_FORMAT:
+ formatName = Tcl_GetString(objv[i]);
+ break;
+ case APPEND_TYPE:
+ targetName = Tcl_GetString(objv[i]);
+ break;
+ }
}
- c = args[0][1];
- length = strlen(args[0]);
- if ((c == '-') && (length == 2)) {
- args++;
- count--;
- break;
+ if (objc - i != 1) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options? data");
+ return TCL_ERROR;
}
- if ((c == 'd') && (strncmp(args[0], "-displayof", length) == 0)) {
- path = args[1];
- } else if ((c == 'f')
- && (strncmp(args[0], "-format", length) == 0)) {
- formatName = args[1];
- } else if ((c == 't')
- && (strncmp(args[0], "-type", length) == 0)) {
- targetName = args[1];
- } else {
- Tcl_AppendResult(interp, "unknown option \"", args[0],
- "\"", (char *) NULL);
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (tkwin == NULL) {
return TCL_ERROR;
}
+ if (targetName != NULL) {
+ target = Tk_InternAtom(tkwin, targetName);
+ } else {
+ target = XA_STRING;
+ }
+ if (formatName != NULL) {
+ format = Tk_InternAtom(tkwin, formatName);
+ } else {
+ format = XA_STRING;
+ }
+ return Tk_ClipboardAppend(interp, tkwin, target, format,
+ Tcl_GetString(objv[i]));
}
- if (count != 1) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " append ?options? data\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
- }
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (targetName != NULL) {
- target = Tk_InternAtom(tkwin, targetName);
- } else {
- target = XA_STRING;
- }
- if (formatName != NULL) {
- format = Tk_InternAtom(tkwin, formatName);
- } else {
- format = XA_STRING;
+ case CLIPBOARD_CLEAR: {
+ static CONST char *clearOptionStrings[] = { "-displayof", NULL };
+ enum clearOptions { CLEAR_DISPLAYOF };
+ int subIndex;
+ if (objc != 2 && objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?-displayof window?");
+ return TCL_ERROR;
+ }
+
+ if (objc == 4) {
+ if (Tcl_GetIndexFromObj(interp, objv[2], clearOptionStrings,
+ "option", 0, &subIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if ((enum clearOptions) subIndex == CLEAR_DISPLAYOF) {
+ path = Tcl_GetString(objv[3]);
+ }
+ }
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ return Tk_ClipboardClear(interp, tkwin);
}
- return Tk_ClipboardAppend(interp, tkwin, target, format, args[0]);
- } else if ((c == 'c') && (strncmp(argv[1], "clear", length) == 0)) {
- for (count = argc-2, args = argv+2; count > 0; count -= 2, args += 2) {
- if (args[0][0] != '-') {
- break;
+ case CLIPBOARD_GET: {
+ Atom target;
+ char *targetName = NULL;
+ Tcl_DString selBytes;
+ int result;
+ char *string;
+ static CONST char *getOptionStrings[] = {
+ "-displayof", "-type", NULL
+ };
+ enum getOptions { APPEND_DISPLAYOF, APPEND_TYPE };
+ int subIndex;
+
+ for (i = 2; i < objc; i++) {
+ string = Tcl_GetString(objv[i]);
+ if (string[0] != '-') {
+ break;
+ }
+ if (Tcl_GetIndexFromObj(interp, objv[i], getOptionStrings,
+ "option", 0, &subIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ i++;
+ if (i >= objc) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", (char *) NULL);
+ return TCL_ERROR;
+ }
+ switch ((enum getOptions) subIndex) {
+ case APPEND_DISPLAYOF:
+ path = Tcl_GetString(objv[i]);
+ break;
+ case APPEND_TYPE:
+ targetName = Tcl_GetString(objv[i]);
+ break;
+ }
+ }
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
}
- if (count < 2) {
- Tcl_AppendResult(interp, "value for \"", *args,
- "\" missing", (char *) NULL);
+ if (tkwin == NULL) {
return TCL_ERROR;
}
- c = args[0][1];
- length = strlen(args[0]);
- if ((c == 'd') && (strncmp(args[0], "-displayof", length) == 0)) {
- path = args[1];
- } else {
- Tcl_AppendResult(interp, "unknown option \"", args[0],
- "\"", (char *) NULL);
+ selection = Tk_InternAtom(tkwin, "CLIPBOARD");
+
+ if (objc - i > 1) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options?");
return TCL_ERROR;
+ } else if (objc - i == 1) {
+ target = Tk_InternAtom(tkwin, Tcl_GetString(objv[i]));
+ } else if (targetName != NULL) {
+ target = Tk_InternAtom(tkwin, targetName);
+ } else {
+ target = XA_STRING;
}
+
+ Tcl_DStringInit(&selBytes);
+ result = Tk_GetSelection(interp, tkwin, selection, target,
+ ClipboardGetProc, (ClientData) &selBytes);
+ if (result == TCL_OK) {
+ Tcl_DStringResult(interp, &selBytes);
+ } else {
+ Tcl_DStringFree(&selBytes);
+ }
+ return result;
}
- if (count > 0) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " clear ?options?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
- }
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- return Tk_ClipboardClear(interp, tkwin);
- } else {
- char buf[100 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "bad option \"%.50s\": must be clear or append", argv[1]);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkClipCleanup --
+ *
+ * This procedure is called to cleanup resources associated with
+ * claiming clipboard ownership and for receiving selection get
+ * results. This function is called in tkWindow.c. This has to be
+ * called by the display cleanup function because we still need the
+ * access display elements.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Resources are freed - the clipboard may no longer be used.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkClipCleanup(dispPtr)
+ TkDisplay *dispPtr; /* display associated with clipboard */
+{
+ if (dispPtr->clipWindow != NULL) {
+ Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
+ dispPtr->applicationAtom);
+ Tk_DeleteSelHandler(dispPtr->clipWindow, dispPtr->clipboardAtom,
+ dispPtr->windowAtom);
+
+ Tk_DestroyWindow(dispPtr->clipWindow);
+ Tcl_Release((ClientData) dispPtr->clipWindow);
+ dispPtr->clipWindow = NULL;
}
}
@@ -578,6 +698,7 @@ TkClipInit(interp, dispPtr)
if (dispPtr->clipWindow == NULL) {
return TCL_ERROR;
}
+ Tcl_Preserve((ClientData) dispPtr->clipWindow);
atts.override_redirect = True;
Tk_ChangeWindowAttributes(dispPtr->clipWindow, CWOverrideRedirect, &atts);
Tk_MakeWindowExist(dispPtr->clipWindow);
@@ -605,4 +726,35 @@ TkClipInit(interp, dispPtr)
(ClientData) dispPtr, XA_STRING);
return TCL_OK;
}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ClipboardGetProc --
+ *
+ * This procedure is invoked to process pieces of the selection
+ * as they arrive during "clipboard get" commands.
+ *
+ * Results:
+ * Always returns TCL_OK.
+ *
+ * Side effects:
+ * Bytes get appended to the dynamic string pointed to by the
+ * clientData argument.
+ *
+ *--------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+static int
+ClipboardGetProc(clientData, interp, portion)
+ ClientData clientData; /* Dynamic string holding partially
+ * assembled selection. */
+ Tcl_Interp *interp; /* Interpreter used for error
+ * reporting (not used). */
+ char *portion; /* New information to be appended. */
+{
+ Tcl_DStringAppend((Tcl_DString *) clientData, portion, -1);
+ return TCL_OK;
+}
diff --git a/tk/generic/tkCmds.c b/tk/generic/tkCmds.c
index 78f44ca294a..10843a10ceb 100644
--- a/tk/generic/tkCmds.c
+++ b/tk/generic/tkCmds.c
@@ -6,6 +6,7 @@
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 2000 Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -17,10 +18,12 @@
#include "tkInt.h"
#include <errno.h>
-#if defined(__WIN32__)
+#if defined(WIN32)
#include "tkWinInt.h"
#elif defined(MAC_TCL)
#include "tkMacInt.h"
+#elif defined(MAC_OSX_TK)
+#include "tkMacOSXInt.h"
#else
#include "tkUnixInt.h"
#endif
@@ -31,8 +34,8 @@
static TkWindow * GetToplevel _ANSI_ARGS_((Tk_Window tkwin));
static char * WaitVariableProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
static void WaitVisibilityProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
static void WaitWindowProc _ANSI_ARGS_((ClientData clientData,
@@ -62,30 +65,42 @@ Tk_BellObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *bellOptions[] = {"-displayof", (char *) NULL};
+ static CONST char *bellOptions[] = {"-displayof", "-nice", (char *) NULL};
+ enum options { TK_BELL_DISPLAYOF, TK_BELL_NICE };
Tk_Window tkwin = (Tk_Window) clientData;
- char *displayName;
- int index;
+ int i, index, nice = 0;
- if ((objc != 1) && (objc != 3)) {
- Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window?");
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?-displayof window? ?-nice?");
return TCL_ERROR;
}
- if (objc == 3) {
- if (Tcl_GetIndexFromObj(interp, objv[1], bellOptions, "option", 0,
+ for (i = 1; i < objc; i++) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], bellOptions, "option", 0,
&index) != TCL_OK) {
return TCL_ERROR;
}
- displayName = Tcl_GetStringFromObj(objv[2], (int *) NULL);
-
- tkwin = Tk_NameToWindow(interp, displayName, tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
+ switch ((enum options) index) {
+ case TK_BELL_DISPLAYOF:
+ if (++i >= objc) {
+ Tcl_WrongNumArgs(interp, 1, objv,
+ "?-displayof window? ?-nice?");
+ return TCL_ERROR;
+ }
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), tkwin);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ break;
+ case TK_BELL_NICE:
+ nice = 1;
+ break;
}
}
XBell(Tk_Display(tkwin), 0);
- XForceScreenSaver(Tk_Display(tkwin), ScreenSaverReset);
+ if (!nice) {
+ XForceScreenSaver(Tk_Display(tkwin), ScreenSaverReset);
+ }
XFlush(Tk_Display(tkwin));
return TCL_OK;
}
@@ -93,7 +108,7 @@ Tk_BellObjCmd(clientData, interp, objc, objv)
/*
*----------------------------------------------------------------------
*
- * Tk_BindCmd --
+ * Tk_BindObjCmd --
*
* This procedure is invoked to process the "bind" Tcl command.
* See the user documentation for details on what it does.
@@ -108,59 +123,87 @@ Tk_BellObjCmd(clientData, interp, objc, objv)
*/
int
-Tk_BindCmd(clientData, interp, argc, argv)
+Tk_BindObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr;
ClientData object;
-
- if ((argc < 2) || (argc > 4)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " window ?pattern? ?command?\"", (char *) NULL);
+ char *string;
+
+ if ((objc < 2) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "window ?pattern? ?command?");
return TCL_ERROR;
}
- if (argv[1][0] == '.') {
- winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[1], tkwin);
+ string = Tcl_GetString(objv[1]);
+
+ /*
+ * Bind tags either a window name or a tag name for the first argument.
+ * If the argument starts with ".", assume it is a window; otherwise, it
+ * is a tag.
+ */
+
+ if (string[0] == '.') {
+ winPtr = (TkWindow *) Tk_NameToWindow(interp, string, tkwin);
if (winPtr == NULL) {
return TCL_ERROR;
}
object = (ClientData) winPtr->pathName;
} else {
winPtr = (TkWindow *) clientData;
- object = (ClientData) Tk_GetUid(argv[1]);
+ object = (ClientData) Tk_GetUid(string);
}
- if (argc == 4) {
+ /*
+ * If there are four arguments, the command is modifying a binding. If
+ * there are three arguments, the command is querying a binding. If there
+ * are only two arguments, the command is querying all the bindings for
+ * the given tag/window.
+ */
+
+ if (objc == 4) {
int append = 0;
unsigned long mask;
+ char *sequence, *script;
+ sequence = Tcl_GetString(objv[2]);
+ script = Tcl_GetString(objv[3]);
+
+ /*
+ * If the script is null, just delete the binding.
+ */
- if (argv[3][0] == 0) {
+ if (script[0] == 0) {
return Tk_DeleteBinding(interp, winPtr->mainPtr->bindingTable,
- object, argv[2]);
+ object, sequence);
}
- if (argv[3][0] == '+') {
- argv[3]++;
+
+ /*
+ * If the script begins with "+", append this script to the existing
+ * binding.
+ */
+
+ if (script[0] == '+') {
+ script++;
append = 1;
}
mask = Tk_CreateBinding(interp, winPtr->mainPtr->bindingTable,
- object, argv[2], argv[3], append);
+ object, sequence, script, append);
if (mask == 0) {
return TCL_ERROR;
}
- } else if (argc == 3) {
- char *command;
+ } else if (objc == 3) {
+ CONST char *command;
command = Tk_GetBinding(interp, winPtr->mainPtr->bindingTable,
- object, argv[2]);
+ object, Tcl_GetString(objv[2]));
if (command == NULL) {
Tcl_ResetResult(interp);
return TCL_OK;
}
- Tcl_SetResult(interp, command, TCL_STATIC);
+ Tcl_SetResult(interp, (char *) command, TCL_STATIC);
} else {
Tk_GetAllBindings(interp, winPtr->mainPtr->bindingTable, object);
}
@@ -229,7 +272,7 @@ TkBindEventProc(winPtr, eventPtr)
objPtr[0] = (ClientData) winPtr->pathName;
objPtr[1] = (ClientData) winPtr->classUid;
for (topLevPtr = winPtr;
- (topLevPtr != NULL) && !(topLevPtr->flags & TK_TOP_LEVEL);
+ (topLevPtr != NULL) && !(topLevPtr->flags & TK_TOP_HIERARCHY);
topLevPtr = topLevPtr->parentPtr) {
/* Empty loop body. */
}
@@ -251,7 +294,7 @@ TkBindEventProc(winPtr, eventPtr)
/*
*----------------------------------------------------------------------
*
- * Tk_BindtagsCmd --
+ * Tk_BindtagsObjCmd --
*
* This procedure is invoked to process the "bindtags" Tcl command.
* See the user documentation for details on what it does.
@@ -266,60 +309,70 @@ TkBindEventProc(winPtr, eventPtr)
*/
int
-Tk_BindtagsCmd(clientData, interp, argc, argv)
+Tk_BindtagsObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr, *winPtr2;
- int i, tagArgc;
- char *p, **tagArgv;
-
- if ((argc < 2) || (argc > 3)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " window ?tags?\"", (char *) NULL);
+ int i, length;
+ char *p;
+ Tcl_Obj *listPtr, **tags;
+
+ if ((objc < 2) || (objc > 3)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "window ?taglist?");
return TCL_ERROR;
}
- winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[1], tkwin);
+ winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetString(objv[1]),
+ tkwin);
if (winPtr == NULL) {
return TCL_ERROR;
}
- if (argc == 2) {
+ if (objc == 2) {
+ listPtr = Tcl_NewObj();
+ Tcl_IncrRefCount(listPtr);
if (winPtr->numTags == 0) {
- Tcl_AppendElement(interp, winPtr->pathName);
- Tcl_AppendElement(interp, winPtr->classUid);
- for (winPtr2 = winPtr;
- (winPtr2 != NULL) && !(winPtr2->flags & TK_TOP_LEVEL);
- winPtr2 = winPtr2->parentPtr) {
- /* Empty loop body. */
+ Tcl_ListObjAppendElement(interp, listPtr,
+ Tcl_NewStringObj(winPtr->pathName, -1));
+ Tcl_ListObjAppendElement(interp, listPtr,
+ Tcl_NewStringObj(winPtr->classUid, -1));
+ winPtr2 = winPtr;
+ while ((winPtr2 != NULL) && !(Tk_TopWinHierarchy(winPtr2))) {
+ winPtr2 = winPtr2->parentPtr;
}
if ((winPtr != winPtr2) && (winPtr2 != NULL)) {
- Tcl_AppendElement(interp, winPtr2->pathName);
+ Tcl_ListObjAppendElement(interp, listPtr,
+ Tcl_NewStringObj(winPtr2->pathName, -1));
}
- Tcl_AppendElement(interp, "all");
+ Tcl_ListObjAppendElement(interp, listPtr,
+ Tcl_NewStringObj("all", -1));
} else {
for (i = 0; i < winPtr->numTags; i++) {
- Tcl_AppendElement(interp, (char *) winPtr->tagPtr[i]);
+ Tcl_ListObjAppendElement(interp, listPtr,
+ Tcl_NewStringObj((char *)winPtr->tagPtr[i], -1));
}
}
+ Tcl_SetObjResult(interp, listPtr);
+ Tcl_DecrRefCount(listPtr);
return TCL_OK;
}
if (winPtr->tagPtr != NULL) {
TkFreeBindingTags(winPtr);
}
- if (argv[2][0] == 0) {
- return TCL_OK;
- }
- if (Tcl_SplitList(interp, argv[2], &tagArgc, &tagArgv) != TCL_OK) {
+ if (Tcl_ListObjGetElements(interp, objv[2], &length, &tags) != TCL_OK) {
return TCL_ERROR;
}
- winPtr->numTags = tagArgc;
+ if (length == 0) {
+ return TCL_OK;
+ }
+
+ winPtr->numTags = length;
winPtr->tagPtr = (ClientData *) ckalloc((unsigned)
- (tagArgc * sizeof(ClientData)));
- for (i = 0; i < tagArgc; i++) {
- p = tagArgv[i];
+ (length * sizeof(ClientData)));
+ for (i = 0; i < length; i++) {
+ p = Tcl_GetString(tags[i]);
if (p[0] == '.') {
char *copy;
@@ -337,7 +390,6 @@ Tk_BindtagsCmd(clientData, interp, argc, argv)
winPtr->tagPtr[i] = (ClientData) Tk_GetUid(p);
}
}
- ckfree((char *) tagArgv);
return TCL_OK;
}
@@ -567,11 +619,13 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
{
int index;
Tk_Window tkwin;
- static char *optionStrings[] = {
- "appname", "scaling", "useinputmethods", NULL
+ static CONST char *optionStrings[] = {
+ "appname", "caret", "scaling", "useinputmethods",
+ "windowingsystem", NULL
};
enum options {
- TK_APPNAME, TK_SCALING, TK_USE_IM
+ TK_APPNAME, TK_CARET, TK_SCALING, TK_USE_IM,
+ TK_WINDOWINGSYSTEM
};
tkwin = (Tk_Window) clientData;
@@ -590,6 +644,13 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
TkWindow *winPtr;
char *string;
+ if (Tcl_IsSafe(interp)) {
+ Tcl_SetResult(interp,
+ "appname not accessible in a safe interpreter",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
winPtr = (TkWindow *) tkwin;
if (objc > 3) {
@@ -603,11 +664,97 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
Tcl_AppendResult(interp, winPtr->nameUid, NULL);
break;
}
+ case TK_CARET: {
+ Tcl_Obj *objPtr;
+ TkCaret *caretPtr;
+ Tk_Window window;
+ static CONST char *caretStrings[]
+ = { "-x", "-y", "-height", NULL };
+ enum caretOptions
+ { TK_CARET_X, TK_CARET_Y, TK_CARET_HEIGHT };
+
+ if ((objc < 3) || ((objc > 4) && !(objc & 1))) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?-x x? ?-y y? ?-height height?");
+ return TCL_ERROR;
+ }
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
+ if (window == NULL) {
+ return TCL_ERROR;
+ }
+ caretPtr = &(((TkWindow *) window)->dispPtr->caret);
+ if (objc == 3) {
+ /*
+ * Return all the current values
+ */
+ objPtr = Tcl_NewObj();
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewStringObj("-height", 7));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewIntObj(caretPtr->height));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewStringObj("-x", 2));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewIntObj(caretPtr->x));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewStringObj("-y", 2));
+ Tcl_ListObjAppendElement(interp, objPtr,
+ Tcl_NewIntObj(caretPtr->y));
+ Tcl_SetObjResult(interp, objPtr);
+ } else if (objc == 4) {
+ int value;
+ /*
+ * Return the current value of the selected option
+ */
+ if (Tcl_GetIndexFromObj(interp, objv[3], caretStrings,
+ "caret option", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == TK_CARET_X) {
+ value = caretPtr->x;
+ } else if (index == TK_CARET_Y) {
+ value = caretPtr->y;
+ } else /* if (index == TK_CARET_HEIGHT) -- last case */ {
+ value = caretPtr->height;
+ }
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), value);
+ } else {
+ int i, value, x = 0, y = 0, height = -1;
+
+ for (i = 3; i < objc; i += 2) {
+ if ((Tcl_GetIndexFromObj(interp, objv[i], caretStrings,
+ "caret option", 0, &index) != TCL_OK) ||
+ (Tcl_GetIntFromObj(interp, objv[i+1], &value)
+ != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if (index == TK_CARET_X) {
+ x = value;
+ } else if (index == TK_CARET_Y) {
+ y = value;
+ } else /* if (index == TK_CARET_HEIGHT) -- last case */ {
+ height = value;
+ }
+ }
+ if (height < 0) {
+ height = Tk_Height(window);
+ }
+ Tk_SetCaretPos(window, x, y, height);
+ }
+ break;
+ }
case TK_SCALING: {
Screen *screenPtr;
int skip, width, height;
double d;
+ if (Tcl_IsSafe(interp)) {
+ Tcl_SetResult(interp,
+ "scaling not accessible in a safe interpreter",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
screenPtr = Tk_Screen(tkwin);
skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
@@ -645,6 +792,13 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
int skip;
+ if (Tcl_IsSafe(interp)) {
+ Tcl_SetResult(interp,
+ "useinputmethods not accessible in a safe interpreter",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+
skip = TkGetDisplayOf(interp, objc-2, objv+2, &tkwin);
if (skip < 0) {
return TCL_ERROR;
@@ -658,13 +812,17 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
* That will indicate to the user that input methods
* are just not available.
*/
- int bool;
- if (Tcl_GetBooleanFromObj(interp, objv[2+skip], &bool)
+ int boolVal;
+ if (Tcl_GetBooleanFromObj(interp, objv[2+skip], &boolVal)
!= TCL_OK) {
return TCL_ERROR;
}
#ifdef TK_USE_INPUT_METHODS
- dispPtr->useInputMethods = bool;
+ if (boolVal) {
+ dispPtr->flags |= TK_DISPLAY_USE_IM;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_USE_IM;
+ }
#endif /* TK_USE_INPUT_METHODS */
} else if ((objc - skip) != 2) {
Tcl_WrongNumArgs(interp, 2, objv,
@@ -672,7 +830,26 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
- dispPtr->useInputMethods);
+ (int) (dispPtr->flags & TK_DISPLAY_USE_IM));
+ break;
+ }
+ case TK_WINDOWINGSYSTEM: {
+ CONST char *windowingsystem;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, NULL);
+ return TCL_ERROR;
+ }
+#if defined(WIN32)
+ windowingsystem = "win32";
+#elif defined(MAC_TCL)
+ windowingsystem = "classic";
+#elif defined(MAC_OSX_TK)
+ windowingsystem = "aqua";
+#else
+ windowingsystem = "x11";
+#endif
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), windowingsystem, -1);
break;
}
}
@@ -682,7 +859,7 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
/*
*----------------------------------------------------------------------
*
- * Tk_TkwaitCmd --
+ * Tk_TkwaitObjCmd --
*
* This procedure is invoked to process the "tkwait" Tcl command.
* See the user documentation for details on what it does.
@@ -698,87 +875,97 @@ Tk_TkObjCmd(clientData, interp, objc, objv)
/* ARGSUSED */
int
-Tk_TkwaitCmd(clientData, interp, argc, argv)
+Tk_TkwaitObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- int c, done;
- size_t length;
+ int done, index;
+ static CONST char *optionStrings[] = { "variable", "visibility", "window",
+ (char *) NULL };
+ enum options { TKWAIT_VARIABLE, TKWAIT_VISIBILITY, TKWAIT_WINDOW };
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "variable|visibility|window name");
+ return TCL_ERROR;
+ }
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " variable|visibility|window name\"", (char *) NULL);
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 'v') && (strncmp(argv[1], "variable", length) == 0)
- && (length >= 2)) {
- if (Tcl_TraceVar(interp, argv[2],
- TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- WaitVariableProc, (ClientData) &done) != TCL_OK) {
- return TCL_ERROR;
- }
- done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
- }
- Tcl_UntraceVar(interp, argv[2],
- TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- WaitVariableProc, (ClientData) &done);
- } else if ((c == 'v') && (strncmp(argv[1], "visibility", length) == 0)
- && (length >= 2)) {
- Tk_Window window;
- window = Tk_NameToWindow(interp, argv[2], tkwin);
- if (window == NULL) {
- return TCL_ERROR;
+ switch ((enum options) index) {
+ case TKWAIT_VARIABLE: {
+ if (Tcl_TraceVar(interp, Tcl_GetString(objv[2]),
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ WaitVariableProc, (ClientData) &done) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ done = 0;
+ while (!done) {
+ Tcl_DoOneEvent(0);
+ }
+ Tcl_UntraceVar(interp, Tcl_GetString(objv[2]),
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ WaitVariableProc, (ClientData) &done);
+ break;
}
- Tk_CreateEventHandler(window, VisibilityChangeMask|StructureNotifyMask,
- WaitVisibilityProc, (ClientData) &done);
- done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
+
+ case TKWAIT_VISIBILITY: {
+ Tk_Window window;
+
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
+ if (window == NULL) {
+ return TCL_ERROR;
+ }
+ Tk_CreateEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ WaitVisibilityProc, (ClientData) &done);
+ done = 0;
+ while (!done) {
+ Tcl_DoOneEvent(0);
+ }
+ if (done != 1) {
+ /*
+ * Note that we do not delete the event handler because it
+ * was deleted automatically when the window was destroyed.
+ */
+
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "window \"", Tcl_GetString(objv[2]),
+ "\" was deleted before its visibility changed",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ Tk_DeleteEventHandler(window,
+ VisibilityChangeMask|StructureNotifyMask,
+ WaitVisibilityProc, (ClientData) &done);
+ break;
}
- if (done != 1) {
+
+ case TKWAIT_WINDOW: {
+ Tk_Window window;
+
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin);
+ if (window == NULL) {
+ return TCL_ERROR;
+ }
+ Tk_CreateEventHandler(window, StructureNotifyMask,
+ WaitWindowProc, (ClientData) &done);
+ done = 0;
+ while (!done) {
+ Tcl_DoOneEvent(0);
+ }
/*
- * Note that we do not delete the event handler because it
- * was deleted automatically when the window was destroyed.
+ * Note: there's no need to delete the event handler. It was
+ * deleted automatically when the window was destroyed.
*/
-
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "window \"", argv[2],
- "\" was deleted before its visibility changed",
- (char *) NULL);
- return TCL_ERROR;
- }
- Tk_DeleteEventHandler(window, VisibilityChangeMask|StructureNotifyMask,
- WaitVisibilityProc, (ClientData) &done);
- } else if ((c == 'w') && (strncmp(argv[1], "window", length) == 0)) {
- Tk_Window window;
-
- window = Tk_NameToWindow(interp, argv[2], tkwin);
- if (window == NULL) {
- return TCL_ERROR;
- }
- Tk_CreateEventHandler(window, StructureNotifyMask,
- WaitWindowProc, (ClientData) &done);
- done = 0;
- while (!done) {
- Tcl_DoOneEvent(0);
+ break;
}
- /*
- * Note: there's no need to delete the event handler. It was
- * deleted automatically when the window was destroyed.
- */
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be variable, visibility, or window", (char *) NULL);
- return TCL_ERROR;
}
/*
@@ -795,8 +982,8 @@ static char *
WaitVariableProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Pointer to integer to set to 1. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Name of variable. */
- char *name2; /* Second part of variable name. */
+ CONST char *name1; /* Name of variable. */
+ CONST char *name2; /* Second part of variable name. */
int flags; /* Information about what happened. */
{
int *donePtr = (int *) clientData;
@@ -859,7 +1046,7 @@ Tk_UpdateObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *updateOptions[] = {"idletasks", (char *) NULL};
+ static CONST char *updateOptions[] = {"idletasks", (char *) NULL};
int flags, index;
TkDisplay *dispPtr;
@@ -947,7 +1134,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
{StaticGray, "staticgray"},
{-1, NULL}
};
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"cells", "children", "class", "colormapfull",
"depth", "geometry", "height", "id",
"ismapped", "manager", "name", "parent",
@@ -1021,8 +1208,10 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
winPtr = winPtr->childList;
for ( ; winPtr != NULL; winPtr = winPtr->nextPtr) {
- strPtr = Tcl_NewStringObj(winPtr->pathName, -1);
- Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
+ if (!(winPtr->flags & TK_ANONYMOUS_WINDOW)) {
+ strPtr = Tcl_NewStringObj(winPtr->pathName, -1);
+ Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
+ }
}
break;
}
@@ -1184,7 +1373,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
if ((winPtr == NULL) || !(winPtr->flags & TK_MAPPED)) {
break;
}
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
viewable = 1;
break;
}
@@ -1264,7 +1453,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
break;
}
case WIN_ATOMNAME: {
- char *name;
+ CONST char *name;
long id;
skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
@@ -1329,7 +1518,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
return result;
}
case WIN_PATHNAME: {
- int id;
+ Window id;
skip = TkGetDisplayOf(interp, objc - 2, objv + 2, &tkwin);
if (skip < 0) {
@@ -1343,8 +1532,7 @@ Tk_WinfoObjCmd(clientData, interp, objc, objv)
if (TkpScanWindowId(interp, string, &id) != TCL_OK) {
return TCL_ERROR;
}
- winPtr = (TkWindow *)
- Tk_IdToWindow(Tk_Display(tkwin), (Window) id);
+ winPtr = (TkWindow *)Tk_IdToWindow(Tk_Display(tkwin), id);
if ((winPtr == NULL) ||
(winPtr->mainPtr != ((TkWindow *) tkwin)->mainPtr)) {
Tcl_AppendStringsToObj(resultPtr, "window id \"", string,
@@ -1537,7 +1725,7 @@ Tk_WmObjCmd(clientData, interp, objc, objv)
Tk_Window tkwin;
TkWindow *winPtr;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"aspect", "client", "command", "deiconify",
"focusmodel", "frame", "geometry", "grid",
"group", "iconbitmap", "iconify", "iconmask",
@@ -1568,6 +1756,7 @@ Tk_WmObjCmd(clientData, interp, objc, objv)
}
if (index == TKWM_TRACING) {
+ int wmTracing;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
if ((objc != 2) && (objc != 3)) {
@@ -1575,10 +1764,19 @@ Tk_WmObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
if (objc == 2) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(dispPtr->wmTracing));
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj(dispPtr->flags & TK_DISPLAY_WM_TRACING));
return TCL_OK;
}
- return Tcl_GetBooleanFromObj(interp, objv[2], &dispPtr->wmTracing);
+ if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (wmTracing) {
+ dispPtr->flags |= TK_DISPLAY_WM_TRACING;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_WM_TRACING;
+ }
+ return TCL_OK;
}
if (objc < 3) {
@@ -1811,7 +2009,7 @@ TkDeadAppCmd(clientData, interp, argc, argv)
ClientData clientData; /* Dummy. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
Tcl_AppendResult(interp, "can't invoke \"", argv[0],
"\" command: application has been destroyed", (char *) NULL);
@@ -1851,5 +2049,3 @@ GetToplevel(tkwin)
}
return winPtr;
}
-
-
diff --git a/tk/generic/tkColor.c b/tk/generic/tkColor.c
index 19659fcf159..94ea80c09be 100644
--- a/tk/generic/tkColor.c
+++ b/tk/generic/tkColor.c
@@ -54,7 +54,7 @@ static void InitColorObj _ANSI_ARGS_((Tcl_Obj *objPtr));
* ptr1 field of the Tcl_Obj points to a TkColor object.
*/
-static Tcl_ObjType colorObjType = {
+Tcl_ObjType tkColorObjType = {
"color", /* name */
FreeColorObjProc, /* freeIntRepProc */
DupColorObjProc, /* dupIntRepProc */
@@ -98,7 +98,7 @@ Tk_AllocColorFromObj(interp, tkwin, objPtr)
{
TkColor *tkColPtr;
- if (objPtr->typePtr != &colorObjType) {
+ if (objPtr->typePtr != &tkColorObjType) {
InitColorObj(objPtr);
}
tkColPtr = (TkColor *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -187,7 +187,7 @@ Tk_GetColor(interp, tkwin, name)
Tcl_Interp *interp; /* Place to leave error message if
* color can't be found. */
Tk_Window tkwin; /* Window in which color will be used. */
- char *name; /* Name of color to be allocated (in form
+ Tk_Uid name; /* Name of color to be allocated (in form
* suitable for passing to XParseColor). */
{
Tcl_HashEntry *nameHashPtr;
@@ -257,7 +257,6 @@ Tk_GetColor(interp, tkwin, name)
tkColPtr->type = TK_COLOR_BY_NAME;
tkColPtr->hashPtr = nameHashPtr;
tkColPtr->nextPtr = existingColPtr;
- tkColPtr->gcList = NULL;
Tcl_SetHashValue(nameHashPtr, tkColPtr);
return &tkColPtr->color;
@@ -338,7 +337,6 @@ Tk_GetColorByValue(tkwin, colorPtr)
tkColPtr->type = TK_COLOR_BY_VALUE;
tkColPtr->hashPtr = valueHashPtr;
tkColPtr->nextPtr = NULL;
- tkColPtr->gcList = NULL;
Tcl_SetHashValue(valueHashPtr, tkColPtr);
return &tkColPtr->color;
}
@@ -365,7 +363,7 @@ Tk_GetColorByValue(tkwin, colorPtr)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfColor(colorPtr)
XColor *colorPtr; /* Color whose name is desired. */
{
@@ -645,7 +643,7 @@ Tk_GetColorFromObj(tkwin, objPtr)
Tcl_HashEntry *hashPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (objPtr->typePtr != &colorObjType) {
+ if (objPtr->typePtr != &tkColorObjType) {
InitColorObj(objPtr);
}
@@ -733,7 +731,7 @@ InitColorObj(objPtr)
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
(*typePtr->freeIntRepProc)(objPtr);
}
- objPtr->typePtr = &colorObjType;
+ objPtr->typePtr = &tkColorObjType;
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
}
@@ -813,4 +811,3 @@ TkDebugColor(tkwin, name)
}
return resultPtr;
}
-
diff --git a/tk/generic/tkColor.h b/tk/generic/tkColor.h
index 2f38ac4db65..c82a87f7454 100644
--- a/tk/generic/tkColor.h
+++ b/tk/generic/tkColor.h
@@ -22,23 +22,6 @@
# define TCL_STORAGE_CLASS DLLEXPORT
#endif
-/* CYGNUS LOCAL. */
-
-/* A linked list of GC structures. */
-
-typedef struct TkGCList {
- /* Next item on list. */
- struct TkGCList *next;
- /* The display for the GC. */
- Display *display;
- /* The GC. */
- GC gc;
- /* GCForeground or GCBackground. */
- unsigned long mask;
-} TkGCList;
-
-/* END CYGNUS LOCAL */
-
/*
* One of the following data structures is used to keep track of
* each color that is being used by the application; typically there
@@ -86,8 +69,6 @@ typedef struct TkColor {
* valueTable (those allocated by
* Tk_GetColorByValue) this field is always
* NULL. */
- /* CYGNUS LOCAL */
- TkGCList *gcList; /* List of GCs which use this color. */
} TkColor;
/*
@@ -102,12 +83,7 @@ EXTERN TkColor * TkpGetColor _ANSI_ARGS_((Tk_Window tkwin,
EXTERN TkColor * TkpGetColorByValue _ANSI_ARGS_((Tk_Window tkwin,
XColor *colorPtr));
-/* CYGNUS LOCAL. */
-EXTERN void TkMapOverColors _ANSI_ARGS_((void (*) (TkColor *)));
-EXTERN void TkColorChanged _ANSI_ARGS_((TkColor *));
-
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKCOLOR */
-
diff --git a/tk/generic/tkConfig.c b/tk/generic/tkConfig.c
index f12893607c7..c3ded1cda43 100644
--- a/tk/generic/tkConfig.c
+++ b/tk/generic/tkConfig.c
@@ -66,6 +66,7 @@ typedef struct TkOption {
* use on monochrome displays. */
struct TkOption *synonymPtr; /* For synonym options, this points to
* the master entry. */
+ struct Tk_ObjCustomOption *custom; /* For TK_OPTION_CUSTOM. */
} extra;
int flags; /* Miscellaneous flag values; see
* below for definitions. */
@@ -126,6 +127,8 @@ static Tcl_Obj * GetConfigList _ANSI_ARGS_((char *recordPtr,
Option *optionPtr, Tk_Window tkwin));
static Tcl_Obj * GetObjectForOption _ANSI_ARGS_((char *recordPtr,
Option *optionPtr, Tk_Window tkwin));
+static Option * GetOption _ANSI_ARGS_((CONST char *name,
+ OptionTable *tablePtr));
static Option * GetOptionFromObj _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr, OptionTable *tablePtr));
static int ObjectIsEmpty _ANSI_ARGS_((Tcl_Obj *objPtr));
@@ -139,7 +142,7 @@ static int SetOptionFromAny _ANSI_ARGS_((Tcl_Interp *interp,
* and the internalPtr2 field points to the entry that matched.
*/
-Tcl_ObjType optionType = {
+Tcl_ObjType tkOptionObjType = {
"option", /* name */
(Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */
(Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */
@@ -279,6 +282,14 @@ Tk_CreateOptionTable(interp, templatePtr)
Tcl_NewStringObj((char *) specPtr->clientData, -1);
Tcl_IncrRefCount(optionPtr->extra.monoColorPtr);
}
+
+ if (specPtr->type == TK_OPTION_CUSTOM) {
+ /*
+ * Get the custom parsing, etc., functions.
+ */
+ optionPtr->extra.custom =
+ (Tk_ObjCustomOption *)specPtr->clientData;
+ }
}
if (((specPtr->type == TK_OPTION_STRING)
&& (specPtr->internalOffset >= 0))
@@ -286,7 +297,8 @@ Tk_CreateOptionTable(interp, templatePtr)
|| (specPtr->type == TK_OPTION_FONT)
|| (specPtr->type == TK_OPTION_BITMAP)
|| (specPtr->type == TK_OPTION_BORDER)
- || (specPtr->type == TK_OPTION_CURSOR)) {
+ || (specPtr->type == TK_OPTION_CURSOR)
+ || (specPtr->type == TK_OPTION_CUSTOM)) {
optionPtr->flags |= OPTION_NEEDS_FREEING;
}
}
@@ -453,7 +465,7 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
OptionTable *tablePtr = (OptionTable *) optionTable;
Option *optionPtr;
int count;
- char *value;
+ Tk_Uid value;
Tcl_Obj *valuePtr;
enum {
OPTION_DATABASE, SYSTEM_DEFAULT, TABLE_DEFAULT
@@ -539,6 +551,13 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
continue;
}
+ /*
+ * Bump the reference count on valuePtr, so that it is strongly
+ * referenced here, and will be properly free'd when finished,
+ * regardless of what DoObjConfig does.
+ */
+ Tcl_IncrRefCount(valuePtr);
+
if (DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin,
(Tk_SavedOption *) NULL) != TCL_OK) {
if (interp != NULL) {
@@ -563,8 +582,10 @@ Tk_InitOptions(interp, recordPtr, optionTable, tkwin)
}
Tcl_AddErrorInfo(interp, msg);
}
+ Tcl_DecrRefCount(valuePtr);
return TCL_ERROR;
}
+ Tcl_DecrRefCount(valuePtr);
}
return TCL_OK;
}
@@ -685,10 +706,15 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
case TK_OPTION_DOUBLE: {
double new;
- if (Tcl_GetDoubleFromObj(interp, valuePtr, &new)
- != TCL_OK) {
- return TCL_ERROR;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ new = 0;
+ } else {
+ if (Tcl_GetDoubleFromObj(interp, valuePtr, &new) != TCL_OK) {
+ return TCL_ERROR;
+ }
}
+
if (internalPtr != NULL) {
*((double *) oldInternalPtr) = *((double *) internalPtr);
*((double *) internalPtr) = new;
@@ -719,7 +745,7 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
int new;
if (Tcl_GetIndexFromObj(interp, valuePtr,
- (char **) optionPtr->specPtr->clientData,
+ (CONST char **) optionPtr->specPtr->clientData,
optionPtr->specPtr->optionName+1, 0, &new) != TCL_OK) {
return TCL_ERROR;
}
@@ -765,6 +791,24 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
break;
}
+ case TK_OPTION_STYLE: {
+ Tk_Style new;
+
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ new = NULL;
+ } else {
+ new = Tk_AllocStyleFromObj(interp, valuePtr);
+ if (new == NULL) {
+ return TCL_ERROR;
+ }
+ }
+ if (internalPtr != NULL) {
+ *((Tk_Style *) oldInternalPtr) = *((Tk_Style *) internalPtr);
+ *((Tk_Style *) internalPtr) = new;
+ }
+ break;
+ }
case TK_OPTION_BITMAP: {
Pixmap new;
@@ -805,8 +849,13 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
case TK_OPTION_RELIEF: {
int new;
- if (Tk_GetReliefFromObj(interp, valuePtr, &new) != TCL_OK) {
- return TCL_ERROR;
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ new = TK_RELIEF_NULL;
+ } else {
+ if (Tk_GetReliefFromObj(interp, valuePtr, &new) != TCL_OK) {
+ return TCL_ERROR;
+ }
}
if (internalPtr != NULL) {
*((int *) oldInternalPtr) = *((int *) internalPtr);
@@ -861,10 +910,15 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
case TK_OPTION_PIXELS: {
int new;
-
- if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
- &new) != TCL_OK) {
- return TCL_ERROR;
+
+ if (nullOK && ObjectIsEmpty(valuePtr)) {
+ valuePtr = NULL;
+ new = 0;
+ } else {
+ if (Tk_GetPixelsFromObj(interp, tkwin, valuePtr,
+ &new) != TCL_OK) {
+ return TCL_ERROR;
+ }
}
if (internalPtr != NULL) {
*((int *) oldInternalPtr) = *((int *) internalPtr);
@@ -890,6 +944,17 @@ DoObjConfig(interp, recordPtr, optionPtr, valuePtr, tkwin, savedOptionPtr)
}
break;
}
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ if (custom->setProc(custom->clientData, interp, tkwin,
+ &valuePtr, recordPtr, optionPtr->specPtr->internalOffset,
+ (char *)oldInternalPtr,
+ optionPtr->specPtr->flags) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ }
+
default: {
char buf[40+TCL_INTEGER_SPACE];
sprintf(buf, "bad config table: unknown type %d",
@@ -959,53 +1024,38 @@ ObjectIsEmpty(objPtr)
/*
*----------------------------------------------------------------------
*
- * GetOptionFromObj --
+ * GetOption --
*
* This procedure searches through a chained option table to find
* the entry for a particular option name.
*
* Results:
* The return value is a pointer to the matching entry, or NULL
- * if no matching entry could be found. If NULL is returned and
- * interp is not NULL than an error message is left in its result.
+ * if no matching entry could be found.
* Note: if the matching entry is a synonym then this procedure
* returns a pointer to the synonym entry, *not* the "real" entry
* that the synonym refers to.
*
* Side effects:
- * Information about the matching entry is cached in the object
- * containing the name, so that future lookups can proceed more
- * quickly.
+ * None.
*
*----------------------------------------------------------------------
*/
static Option *
-GetOptionFromObj(interp, objPtr, tablePtr)
- Tcl_Interp *interp; /* Used only for error reporting; if NULL
- * no message is left after an error. */
- Tcl_Obj *objPtr; /* Object whose string value is to be
- * looked up in the option table. */
- OptionTable *tablePtr; /* Table in which to look up objPtr. */
+GetOption(name, tablePtr)
+ CONST char *name; /* String balue to be looked up in the
+ * option table. */
+ OptionTable *tablePtr; /* Table in which to look up name. */
{
Option *bestPtr, *optionPtr;
OptionTable *tablePtr2;
- char *p1, *p2, *name;
+ CONST char *p1, *p2;
int count;
/*
- * First, check to see if the object already has the answer cached.
- */
-
- if (objPtr->typePtr == &optionType) {
- if (objPtr->internalRep.twoPtrValue.ptr1 == (VOID *) tablePtr) {
- return (Option *) objPtr->internalRep.twoPtrValue.ptr2;
- }
- }
-
- /*
- * The answer isn't cached. Search through all of the option tables
- * in the chain to find the best match. Some tricky aspects:
+ * Search through all of the option tables in the chain to find the
+ * best match. Some tricky aspects:
*
* 1. We have to accept unique abbreviations.
* 2. The same name could appear in different tables in the chain.
@@ -1015,7 +1065,6 @@ GetOptionFromObj(interp, objPtr, tablePtr)
*/
bestPtr = NULL;
- name = Tcl_GetStringFromObj(objPtr, (int *) NULL);
for (tablePtr2 = tablePtr; tablePtr2 != NULL;
tablePtr2 = tablePtr2->nextPtr) {
for (optionPtr = tablePtr2->options, count = tablePtr2->numOptions;
@@ -1052,18 +1101,76 @@ GetOptionFromObj(interp, objPtr, tablePtr)
}
}
}
+
+ done:
+ return bestPtr;
+
+ error:
+ return NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetOptionFromObj --
+ *
+ * This procedure searches through a chained option table to find
+ * the entry for a particular option name.
+ *
+ * Results:
+ * The return value is a pointer to the matching entry, or NULL
+ * if no matching entry could be found. If NULL is returned and
+ * interp is not NULL than an error message is left in its result.
+ * Note: if the matching entry is a synonym then this procedure
+ * returns a pointer to the synonym entry, *not* the "real" entry
+ * that the synonym refers to.
+ *
+ * Side effects:
+ * Information about the matching entry is cached in the object
+ * containing the name, so that future lookups can proceed more
+ * quickly.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Option *
+GetOptionFromObj(interp, objPtr, tablePtr)
+ Tcl_Interp *interp; /* Used only for error reporting; if NULL
+ * no message is left after an error. */
+ Tcl_Obj *objPtr; /* Object whose string value is to be
+ * looked up in the option table. */
+ OptionTable *tablePtr; /* Table in which to look up objPtr. */
+{
+ Option *bestPtr;
+ char *name;
+
+ /*
+ * First, check to see if the object already has the answer cached.
+ */
+
+ if (objPtr->typePtr == &tkOptionObjType) {
+ if (objPtr->internalRep.twoPtrValue.ptr1 == (VOID *) tablePtr) {
+ return (Option *) objPtr->internalRep.twoPtrValue.ptr2;
+ }
+ }
+
+ /*
+ * The answer isn't cached.
+ */
+
+ name = Tcl_GetStringFromObj(objPtr, (int *) NULL);
+ bestPtr = GetOption(name, tablePtr);
if (bestPtr == NULL) {
goto error;
}
- done:
if ((objPtr->typePtr != NULL)
&& (objPtr->typePtr->freeIntRepProc != NULL)) {
objPtr->typePtr->freeIntRepProc(objPtr);
}
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tablePtr;
objPtr->internalRep.twoPtrValue.ptr2 = (VOID *) bestPtr;
- objPtr->typePtr = &optionType;
+ objPtr->typePtr = &tkOptionObjType;
return bestPtr;
error:
@@ -1077,6 +1184,44 @@ GetOptionFromObj(interp, objPtr, tablePtr)
/*
*----------------------------------------------------------------------
*
+ * TkGetOptionSpec --
+ *
+ * This procedure searches through a chained option table to find
+ * the option spec for a particular option name.
+ *
+ * Results:
+ * The return value is a pointer to the option spec of the matching
+ * entry, or NULL if no matching entry could be found.
+ * Note: if the matching entry is a synonym then this procedure
+ * returns a pointer to the option spec of the synonym entry, *not*
+ * the "real" entry that the synonym refers to.
+ * Note: this call is primarily used by the style management code
+ * (tkStyle.c) to look up an element's option spec into a widget's
+ * option table.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CONST Tk_OptionSpec *
+TkGetOptionSpec(name, optionTable)
+ CONST char *name; /* String value to be looked up. */
+ Tk_OptionTable optionTable; /* Table in which to look up name. */
+{
+ Option *optionPtr;
+
+ optionPtr = GetOption(name, (OptionTable *) optionTable);
+ if (optionPtr == NULL) {
+ return NULL;
+ }
+ return optionPtr->specPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* SetOptionFromAny --
*
* This procedure is called to convert a Tcl object to option
@@ -1352,6 +1497,11 @@ Tk_RestoreSavedOptions(savePtr)
= *((Tk_Font *) &savePtr->items[i].internalForm);
break;
}
+ case TK_OPTION_STYLE: {
+ *((Tk_Style *) internalPtr)
+ = *((Tk_Style *) &savePtr->items[i].internalForm);
+ break;
+ }
case TK_OPTION_BITMAP: {
*((Pixmap *) internalPtr)
= *((Pixmap *) &savePtr->items[i].internalForm);
@@ -1394,6 +1544,15 @@ Tk_RestoreSavedOptions(savePtr)
= *((Tk_Window *) &savePtr->items[i].internalForm);
break;
}
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ if (custom->restoreProc != NULL) {
+ custom->restoreProc(custom->clientData, savePtr->tkwin,
+ internalPtr,
+ (char *)&savePtr->items[i].internalForm);
+ }
+ break;
+ }
default: {
panic("bad option type in Tk_RestoreSavedOptions");
}
@@ -1573,6 +1732,14 @@ FreeResources(optionPtr, objPtr, internalPtr, tkwin)
Tk_FreeFontFromObj(tkwin, objPtr);
}
break;
+ case TK_OPTION_STYLE:
+ if (internalFormExists) {
+ Tk_FreeStyle(*((Tk_Style *) internalPtr));
+ *((Tk_Style *) internalPtr) = NULL;
+ } else if (objPtr != NULL) {
+ Tk_FreeStyleFromObj(objPtr);
+ }
+ break;
case TK_OPTION_BITMAP:
if (internalFormExists) {
if (*((Pixmap *) internalPtr) != None) {
@@ -1604,6 +1771,13 @@ FreeResources(optionPtr, objPtr, internalPtr, tkwin)
Tk_FreeCursorFromObj(tkwin, objPtr);
}
break;
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ if (internalFormExists && custom->freeProc != NULL) {
+ custom->freeProc(custom->clientData, tkwin, internalPtr);
+ }
+ break;
+ }
default:
break;
}
@@ -1839,6 +2013,13 @@ GetObjectForOption(recordPtr, optionPtr, tkwin)
}
break;
}
+ case TK_OPTION_STYLE: {
+ Tk_Style style = *((Tk_Style *) internalPtr);
+ if (style != NULL) {
+ objPtr = Tcl_NewStringObj(Tk_NameOfStyle(style), -1);
+ }
+ break;
+ }
case TK_OPTION_BITMAP: {
Pixmap pixmap = *((Pixmap *) internalPtr);
if (pixmap != None) {
@@ -1888,6 +2069,12 @@ GetObjectForOption(recordPtr, optionPtr, tkwin)
}
break;
}
+ case TK_OPTION_CUSTOM: {
+ Tk_ObjCustomOption *custom = optionPtr->extra.custom;
+ objPtr = custom->getProc(custom->clientData, tkwin, recordPtr,
+ optionPtr->specPtr->internalOffset);
+ break;
+ }
default: {
panic("bad option type in GetObjectForOption");
}
@@ -2028,5 +2215,3 @@ TkDebugConfig(interp, table)
}
return objPtr;
}
-
-
diff --git a/tk/generic/tkConsole.c b/tk/generic/tkConsole.c
index 69b113b13ba..62f5237ca21 100644
--- a/tk/generic/tkConsole.c
+++ b/tk/generic/tkConsole.c
@@ -47,21 +47,18 @@ TCL_DECLARE_MUTEX(consoleMutex)
* The first three will be used in the tk app shells...
*/
-void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
- int devId, char *buffer, long size));
-
static int ConsoleCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static void ConsoleDeleteProc _ANSI_ARGS_((ClientData clientData));
static void ConsoleEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
static int InterpreterCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
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));
+ CONST char *buf, int toWrite, int *errorCode));
static int ConsoleClose _ANSI_ARGS_((ClientData instanceData,
Tcl_Interp *interp));
static void ConsoleWatch _ANSI_ARGS_((ClientData instanceData,
@@ -151,6 +148,23 @@ static int ShouldUseConsoleChannel(type)
if ((handle == INVALID_HANDLE_VALUE) || (handle == 0)) {
return 1;
}
+
+ /*
+ * Win2K BUG: GetStdHandle(STD_OUTPUT_HANDLE) can return what appears
+ * to be a valid handle. See TclpGetDefaultStdChannel() for this change
+ * implemented. We didn't change it here because GetFileType() [below]
+ * will catch this with FILE_TYPE_UNKNOWN and appropriately return a
+ * value of 1, anyways.
+ *
+ * char dummyBuff[1];
+ * DWORD dummyWritten;
+ *
+ * if ((type == TCL_STDOUT)
+ * && !WriteFile(handle, dummyBuff, 0, &dummyWritten, NULL)) {
+ * return 1;
+ * }
+ */
+
fileType = GetFileType(handle);
/*
@@ -319,7 +333,7 @@ Tk_CreateConsoleWindow(interp)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
#ifdef MAC_TCL
- static char initCmd[] = "source -rsrc {Console}";
+ static char initCmd[] = "if {[catch {source $tk_library:console.tcl}]} {source -rsrc console}";
#else
static char initCmd[] = "source $tk_library/console.tcl";
#endif
@@ -391,7 +405,7 @@ Tk_CreateConsoleWindow(interp)
static int
ConsoleOutput(instanceData, buf, toWrite, errorCode)
ClientData instanceData; /* Indicates which device to use. */
- char *buf; /* The data buffer. */
+ CONST char *buf; /* The data buffer. */
int toWrite; /* How many bytes to write? */
int *errorCode; /* Where to store error code. */
{
@@ -459,6 +473,9 @@ ConsoleClose(instanceData, interp)
ClientData instanceData; /* Unused. */
Tcl_Interp *interp; /* Unused. */
{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ tsdPtr->gStdoutInterp = NULL;
return 0;
}
@@ -543,7 +560,7 @@ ConsoleCmd(clientData, interp, argc, argv)
ClientData clientData; /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
ConsoleInfo *info = (ConsoleInfo *) clientData;
char c;
@@ -585,7 +602,7 @@ ConsoleCmd(clientData, interp, argc, argv)
} else {
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" eval command\"", (char *) NULL);
- return TCL_ERROR;
+ result = TCL_ERROR;
}
} else {
Tcl_AppendResult(interp, "bad option \"", argv[1],
@@ -620,7 +637,7 @@ InterpreterCmd(clientData, interp, argc, argv)
ClientData clientData; /* Not used. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
ConsoleInfo *info = (ConsoleInfo *) clientData;
char c;
@@ -691,13 +708,13 @@ ConsoleDeleteProc(clientData)
* 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".
+ * interpreter by invoking "::tk::ConsoleExit".
*
* Results:
* None.
*
* Side effects:
- * Invokes the "tkConsoleExit" procedure in the console interp.
+ * Invokes the "::tk::ConsoleExit" procedure in the console interp.
*
*----------------------------------------------------------------------
*/
@@ -728,7 +745,7 @@ ConsoleEventProc(clientData, eventPtr)
return;
}
Tcl_Preserve((ClientData) consoleInterp);
- Tcl_DStringAppend(&dString, "tkConsoleExit", -1);
+ Tcl_DStringAppend(&dString, "::tk::ConsoleExit", -1);
Tcl_Eval(consoleInterp, Tcl_DStringValue(&dString));
Tcl_DStringFree(&dString);
Tcl_Release((ClientData) consoleInterp);
@@ -758,7 +775,7 @@ TkConsolePrint(interp, devId, buffer, size)
Tcl_Interp *interp; /* Main interpreter. */
int devId; /* TCL_STDOUT for stdout, TCL_STDERR for
* stderr. */
- char *buffer; /* Text buffer. */
+ CONST char *buffer; /* Text buffer. */
long size; /* Size of text buffer. */
{
Tcl_DString command, output;
@@ -773,9 +790,9 @@ TkConsolePrint(interp, devId, buffer, size)
}
if (devId == TCL_STDERR) {
- cmd = "tkConsoleOutput stderr ";
+ cmd = "::tk::ConsoleOutput stderr ";
} else {
- cmd = "tkConsoleOutput stdout ";
+ cmd = "::tk::ConsoleOutput stdout ";
}
result = Tcl_GetCommandInfo(interp, "console", &cmdInfo);
@@ -799,4 +816,3 @@ TkConsolePrint(interp, devId, buffer, size)
Tcl_DStringFree(&command);
Tcl_DStringFree(&output);
}
-
diff --git a/tk/generic/tkCursor.c b/tk/generic/tkCursor.c
index 6782550b3ba..e389d267150 100644
--- a/tk/generic/tkCursor.c
+++ b/tk/generic/tkCursor.c
@@ -26,8 +26,8 @@
*/
typedef struct {
- char *source; /* Cursor bits. */
- char *mask; /* Mask bits. */
+ CONST char *source; /* Cursor bits. */
+ CONST char *mask; /* Mask bits. */
int width, height; /* Dimensions of cursor (and data
* and mask). */
int xHot, yHot; /* Location of cursor hot-spot. */
@@ -45,7 +45,7 @@ static void DupCursorObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
static void FreeCursor _ANSI_ARGS_((TkCursor *cursorPtr));
static void FreeCursorObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
static TkCursor * GetCursor _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, char *name));
+ Tk_Window tkwin, CONST char *name));
static TkCursor * GetCursorFromObj _ANSI_ARGS_((Tk_Window tkwin,
Tcl_Obj *objPtr));
static void InitCursorObj _ANSI_ARGS_((Tcl_Obj *objPtr));
@@ -58,7 +58,7 @@ static void InitCursorObj _ANSI_ARGS_((Tcl_Obj *objPtr));
* option is set.
*/
-static Tcl_ObjType cursorObjType = {
+Tcl_ObjType tkCursorObjType = {
"cursor", /* name */
FreeCursorObjProc, /* freeIntRepProc */
DupCursorObjProc, /* dupIntRepProc */
@@ -101,7 +101,7 @@ Tk_AllocCursorFromObj(interp, tkwin, objPtr)
{
TkCursor *cursorPtr;
- if (objPtr->typePtr != &cursorObjType) {
+ if (objPtr->typePtr != &tkCursorObjType) {
InitCursorObj(objPtr);
}
cursorPtr = (TkCursor *) objPtr->internalRep.twoPtrValue.ptr1;
@@ -189,7 +189,7 @@ Tk_Cursor
Tk_GetCursor(interp, tkwin, string)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
Tk_Window tkwin; /* Window in which cursor will be used. */
- char *string; /* Description of cursor. See manual entry
+ Tk_Uid string; /* Description of cursor. See manual entry
* for details on legal syntax. */
{
TkCursor *cursorPtr = GetCursor(interp, tkwin, string);
@@ -230,7 +230,7 @@ static TkCursor *
GetCursor(interp, tkwin, string)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
Tk_Window tkwin; /* Window in which cursor will be used. */
- char *string; /* Description of cursor. See manual entry
+ CONST char *string; /* Description of cursor. See manual entry
* for details on legal syntax. */
{
Tcl_HashEntry *nameHashPtr;
@@ -276,13 +276,12 @@ GetCursor(interp, tkwin, string)
cursorPtr->objRefCount = 0;
cursorPtr->otherTable = &dispPtr->cursorNameTable;
cursorPtr->hashPtr = nameHashPtr;
- cursorPtr->nextPtr = NULL;
+ cursorPtr->nextPtr = existingCursorPtr;
cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
(char *) cursorPtr->cursor, &new);
if (!new) {
panic("cursor already registered in Tk_GetCursor");
}
- cursorPtr->nextPtr = existingCursorPtr;
Tcl_SetHashValue(nameHashPtr, cursorPtr);
Tcl_SetHashValue(cursorPtr->idHashPtr, cursorPtr);
@@ -319,8 +318,8 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
xHot, yHot, fg, bg)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
Tk_Window tkwin; /* Window in which cursor will be used. */
- char *source; /* Bitmap data for cursor shape. */
- char *mask; /* Bitmap data for cursor mask. */
+ CONST char *source; /* Bitmap data for cursor shape. */
+ CONST char *mask; /* Bitmap data for cursor mask. */
int width, height; /* Dimensions of cursor. */
int xHot, yHot; /* Location of hot-spot in cursor. */
Tk_Uid fg; /* Foreground color for cursor. */
@@ -384,6 +383,7 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
cursorPtr->objRefCount = 0;
cursorPtr->idHashPtr = Tcl_CreateHashEntry(&dispPtr->cursorIdTable,
(char *) cursorPtr->cursor, &new);
+ cursorPtr->nextPtr = NULL;
if (!new) {
panic("cursor already registered in Tk_GetCursorFromData");
@@ -418,7 +418,7 @@ Tk_GetCursorFromData(interp, tkwin, source, mask, width, height,
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfCursor(display, cursor)
Display *display; /* Display for which cursor was allocated. */
Tk_Cursor cursor; /* Identifier for cursor whose name is
@@ -694,7 +694,7 @@ GetCursorFromObj(tkwin, objPtr)
Tcl_HashEntry *hashPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (objPtr->typePtr != &cursorObjType) {
+ if (objPtr->typePtr != &tkCursorObjType) {
InitCursorObj(objPtr);
}
@@ -770,7 +770,7 @@ InitCursorObj(objPtr)
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
(*typePtr->freeIntRepProc)(objPtr);
}
- objPtr->typePtr = &cursorObjType;
+ objPtr->typePtr = &tkCursorObjType;
objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) NULL;
}
@@ -866,5 +866,3 @@ TkDebugCursor(tkwin, name)
}
return resultPtr;
}
-
-
diff --git a/tk/generic/tkDecls.h b/tk/generic/tkDecls.h
index c60345ad2f7..b80e12be9ad 100644
--- a/tk/generic/tkDecls.h
+++ b/tk/generic/tkDecls.h
@@ -50,7 +50,8 @@ EXTERN void Tk_3DVerticalBevel _ANSI_ARGS_((Tk_Window tkwin,
int relief));
/* 5 */
EXTERN void Tk_AddOption _ANSI_ARGS_((Tk_Window tkwin,
- char * name, char * value, int priority));
+ CONST char * name, CONST char * value,
+ int priority));
/* 6 */
EXTERN void Tk_BindEvent _ANSI_ARGS_((
Tk_BindingTable bindingTable,
@@ -66,7 +67,7 @@ EXTERN void Tk_CanvasEventuallyRedraw _ANSI_ARGS_((
int y2));
/* 9 */
EXTERN int Tk_CanvasGetCoord _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Canvas canvas, char * str,
+ Tk_Canvas canvas, CONST char * str,
double * doublePtr));
/* 10 */
EXTERN Tk_CanvasTextInfo * Tk_CanvasGetTextInfo _ANSI_ARGS_((
@@ -96,7 +97,7 @@ EXTERN void Tk_CanvasSetStippleOrigin _ANSI_ARGS_((
/* 18 */
EXTERN int Tk_CanvasTagsParseProc _ANSI_ARGS_((
ClientData clientData, Tcl_Interp * interp,
- Tk_Window tkwin, char * value,
+ Tk_Window tkwin, CONST char * value,
char * widgRec, int offset));
/* 19 */
EXTERN char * Tk_CanvasTagsPrintProc _ANSI_ARGS_((
@@ -130,16 +131,18 @@ EXTERN int Tk_ClipboardClear _ANSI_ARGS_((Tcl_Interp * interp,
/* 27 */
EXTERN int Tk_ConfigureInfo _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, Tk_ConfigSpec * specs,
- char * widgRec, char * argvName, int flags));
+ char * widgRec, CONST char * argvName,
+ int flags));
/* 28 */
EXTERN int Tk_ConfigureValue _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, Tk_ConfigSpec * specs,
- char * widgRec, char * argvName, int flags));
+ char * widgRec, CONST char * argvName,
+ int flags));
/* 29 */
EXTERN int Tk_ConfigureWidget _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, Tk_ConfigSpec * specs,
- int argc, char ** argv, char * widgRec,
- int flags));
+ int argc, CONST84 char ** argv,
+ char * widgRec, int flags));
/* 30 */
EXTERN void Tk_ConfigureWindow _ANSI_ARGS_((Tk_Window tkwin,
unsigned int valueMask,
@@ -155,8 +158,8 @@ EXTERN Tk_Window Tk_CoordsToWindow _ANSI_ARGS_((int rootX, int rootY,
/* 33 */
EXTERN unsigned long Tk_CreateBinding _ANSI_ARGS_((Tcl_Interp * interp,
Tk_BindingTable bindingTable,
- ClientData object, char * eventStr,
- char * command, int append));
+ ClientData object, CONST char * eventStr,
+ CONST char * command, int append));
/* 34 */
EXTERN Tk_BindingTable Tk_CreateBindingTable _ANSI_ARGS_((
Tcl_Interp * interp));
@@ -187,16 +190,17 @@ EXTERN void Tk_CreateSelHandler _ANSI_ARGS_((Tk_Window tkwin,
ClientData clientData, Atom format));
/* 42 */
EXTERN Tk_Window Tk_CreateWindow _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window parent, char * name,
- char * screenName));
+ Tk_Window parent, CONST char * name,
+ CONST char * screenName));
/* 43 */
EXTERN Tk_Window Tk_CreateWindowFromPath _ANSI_ARGS_((
Tcl_Interp * interp, Tk_Window tkwin,
- char * pathName, char * screenName));
+ CONST char * pathName,
+ CONST char * screenName));
/* 44 */
EXTERN int Tk_DefineBitmap _ANSI_ARGS_((Tcl_Interp * interp,
- CONST char * name, char * source, int width,
- int height));
+ CONST char * name, CONST char * source,
+ int width, int height));
/* 45 */
EXTERN void Tk_DefineCursor _ANSI_ARGS_((Tk_Window window,
Tk_Cursor cursor));
@@ -207,7 +211,7 @@ EXTERN void Tk_DeleteAllBindings _ANSI_ARGS_((
/* 47 */
EXTERN int Tk_DeleteBinding _ANSI_ARGS_((Tcl_Interp * interp,
Tk_BindingTable bindingTable,
- ClientData object, char * eventStr));
+ ClientData object, CONST char * eventStr));
/* 48 */
EXTERN void Tk_DeleteBindingTable _ANSI_ARGS_((
Tk_BindingTable bindingTable));
@@ -223,14 +227,14 @@ EXTERN void Tk_DeleteGenericHandler _ANSI_ARGS_((
Tk_GenericProc * proc, ClientData clientData));
/* 52 */
EXTERN void Tk_DeleteImage _ANSI_ARGS_((Tcl_Interp * interp,
- char * name));
+ CONST char * name));
/* 53 */
EXTERN void Tk_DeleteSelHandler _ANSI_ARGS_((Tk_Window tkwin,
Atom selection, Atom target));
/* 54 */
EXTERN void Tk_DestroyWindow _ANSI_ARGS_((Tk_Window tkwin));
/* 55 */
-EXTERN char * Tk_DisplayName _ANSI_ARGS_((Tk_Window tkwin));
+EXTERN CONST84_RETURN char * Tk_DisplayName _ANSI_ARGS_((Tk_Window tkwin));
/* 56 */
EXTERN int Tk_DistanceToTextLayout _ANSI_ARGS_((
Tk_TextLayout layout, int x, int y));
@@ -269,7 +273,7 @@ EXTERN void Tk_Fill3DRectangle _ANSI_ARGS_((Tk_Window tkwin,
int borderWidth, int relief));
/* 64 */
EXTERN Tk_PhotoHandle Tk_FindPhoto _ANSI_ARGS_((Tcl_Interp * interp,
- char * imageName));
+ CONST char * imageName));
/* 65 */
EXTERN Font Tk_FontId _ANSI_ARGS_((Tk_Font font));
/* 66 */
@@ -318,24 +322,24 @@ EXTERN void Tk_GetAllBindings _ANSI_ARGS_((Tcl_Interp * interp,
ClientData object));
/* 82 */
EXTERN int Tk_GetAnchor _ANSI_ARGS_((Tcl_Interp * interp,
- char * str, Tk_Anchor * anchorPtr));
+ CONST char * str, Tk_Anchor * anchorPtr));
/* 83 */
-EXTERN char * Tk_GetAtomName _ANSI_ARGS_((Tk_Window tkwin,
+EXTERN CONST84_RETURN char * Tk_GetAtomName _ANSI_ARGS_((Tk_Window tkwin,
Atom atom));
/* 84 */
-EXTERN char * Tk_GetBinding _ANSI_ARGS_((Tcl_Interp * interp,
+EXTERN CONST84_RETURN char * Tk_GetBinding _ANSI_ARGS_((Tcl_Interp * interp,
Tk_BindingTable bindingTable,
- ClientData object, char * eventStr));
+ ClientData object, CONST char * eventStr));
/* 85 */
EXTERN Pixmap Tk_GetBitmap _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, CONST char * str));
/* 86 */
EXTERN Pixmap Tk_GetBitmapFromData _ANSI_ARGS_((
Tcl_Interp * interp, Tk_Window tkwin,
- char * source, int width, int height));
+ CONST char * source, int width, int height));
/* 87 */
EXTERN int Tk_GetCapStyle _ANSI_ARGS_((Tcl_Interp * interp,
- char * str, int * capPtr));
+ CONST char * str, int * capPtr));
/* 88 */
EXTERN XColor * Tk_GetColor _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, Tk_Uid name));
@@ -344,16 +348,16 @@ EXTERN XColor * Tk_GetColorByValue _ANSI_ARGS_((Tk_Window tkwin,
XColor * colorPtr));
/* 90 */
EXTERN Colormap Tk_GetColormap _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * str));
+ Tk_Window tkwin, CONST char * str));
/* 91 */
EXTERN Tk_Cursor Tk_GetCursor _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, Tk_Uid str));
/* 92 */
EXTERN Tk_Cursor Tk_GetCursorFromData _ANSI_ARGS_((
Tcl_Interp * interp, Tk_Window tkwin,
- char * source, char * mask, int width,
- int height, int xHot, int yHot, Tk_Uid fg,
- Tk_Uid bg));
+ CONST char * source, CONST char * mask,
+ int width, int height, int xHot, int yHot,
+ Tk_Uid fg, Tk_Uid bg));
/* 93 */
EXTERN Tk_Font Tk_GetFont _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, CONST char * str));
@@ -369,45 +373,46 @@ EXTERN GC Tk_GetGC _ANSI_ARGS_((Tk_Window tkwin,
XGCValues * valuePtr));
/* 97 */
EXTERN Tk_Image Tk_GetImage _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * name,
+ Tk_Window tkwin, CONST char * name,
Tk_ImageChangedProc * changeProc,
ClientData clientData));
/* 98 */
EXTERN ClientData Tk_GetImageMasterData _ANSI_ARGS_((
- Tcl_Interp * interp, char * name,
+ Tcl_Interp * interp, CONST char * name,
Tk_ImageType ** typePtrPtr));
/* 99 */
EXTERN Tk_ItemType * Tk_GetItemTypes _ANSI_ARGS_((void));
/* 100 */
EXTERN int Tk_GetJoinStyle _ANSI_ARGS_((Tcl_Interp * interp,
- char * str, int * joinPtr));
+ CONST char * str, int * joinPtr));
/* 101 */
EXTERN int Tk_GetJustify _ANSI_ARGS_((Tcl_Interp * interp,
- char * str, Tk_Justify * justifyPtr));
+ CONST char * str, Tk_Justify * justifyPtr));
/* 102 */
EXTERN int Tk_GetNumMainWindows _ANSI_ARGS_((void));
/* 103 */
EXTERN Tk_Uid Tk_GetOption _ANSI_ARGS_((Tk_Window tkwin,
- char * name, char * className));
+ CONST char * name, CONST char * className));
/* 104 */
EXTERN int Tk_GetPixels _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * str, int * intPtr));
+ Tk_Window tkwin, CONST char * str,
+ int * intPtr));
/* 105 */
EXTERN Pixmap Tk_GetPixmap _ANSI_ARGS_((Display * display,
Drawable d, int width, int height, int depth));
/* 106 */
EXTERN int Tk_GetRelief _ANSI_ARGS_((Tcl_Interp * interp,
- char * name, int * reliefPtr));
+ CONST char * name, int * reliefPtr));
/* 107 */
EXTERN void Tk_GetRootCoords _ANSI_ARGS_((Tk_Window tkwin,
int * xPtr, int * yPtr));
/* 108 */
EXTERN int Tk_GetScrollInfo _ANSI_ARGS_((Tcl_Interp * interp,
- int argc, char ** argv, double * dblPtr,
- int * intPtr));
+ int argc, CONST84 char ** argv,
+ double * dblPtr, int * intPtr));
/* 109 */
EXTERN int Tk_GetScreenMM _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * str,
+ Tk_Window tkwin, CONST char * str,
double * doublePtr));
/* 110 */
EXTERN int Tk_GetSelection _ANSI_ARGS_((Tcl_Interp * interp,
@@ -417,8 +422,8 @@ EXTERN int Tk_GetSelection _ANSI_ARGS_((Tcl_Interp * interp,
EXTERN Tk_Uid Tk_GetUid _ANSI_ARGS_((CONST char * str));
/* 112 */
EXTERN Visual * Tk_GetVisual _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * str, int * depthPtr,
- Colormap * colormapPtr));
+ Tk_Window tkwin, CONST char * str,
+ int * depthPtr, Colormap * colormapPtr));
/* 113 */
EXTERN void Tk_GetVRootGeometry _ANSI_ARGS_((Tk_Window tkwin,
int * xPtr, int * yPtr, int * widthPtr,
@@ -439,7 +444,7 @@ EXTERN void Tk_ImageChanged _ANSI_ARGS_((Tk_ImageMaster master,
EXTERN int Tk_Init _ANSI_ARGS_((Tcl_Interp * interp));
/* 119 */
EXTERN Atom Tk_InternAtom _ANSI_ARGS_((Tk_Window tkwin,
- char * name));
+ CONST char * name));
/* 120 */
EXTERN int Tk_IntersectTextLayout _ANSI_ARGS_((
Tk_TextLayout layout, int x, int y,
@@ -471,47 +476,51 @@ EXTERN void Tk_MoveWindow _ANSI_ARGS_((Tk_Window tkwin, int x,
EXTERN void Tk_MoveToplevelWindow _ANSI_ARGS_((Tk_Window tkwin,
int x, int y));
/* 130 */
-EXTERN char * Tk_NameOf3DBorder _ANSI_ARGS_((Tk_3DBorder border));
+EXTERN CONST84_RETURN char * Tk_NameOf3DBorder _ANSI_ARGS_((
+ Tk_3DBorder border));
/* 131 */
-EXTERN char * Tk_NameOfAnchor _ANSI_ARGS_((Tk_Anchor anchor));
+EXTERN CONST84_RETURN char * Tk_NameOfAnchor _ANSI_ARGS_((Tk_Anchor anchor));
/* 132 */
-EXTERN char * Tk_NameOfBitmap _ANSI_ARGS_((Display * display,
+EXTERN CONST84_RETURN char * Tk_NameOfBitmap _ANSI_ARGS_((Display * display,
Pixmap bitmap));
/* 133 */
-EXTERN char * Tk_NameOfCapStyle _ANSI_ARGS_((int cap));
+EXTERN CONST84_RETURN char * Tk_NameOfCapStyle _ANSI_ARGS_((int cap));
/* 134 */
-EXTERN char * Tk_NameOfColor _ANSI_ARGS_((XColor * colorPtr));
+EXTERN CONST84_RETURN char * Tk_NameOfColor _ANSI_ARGS_((XColor * colorPtr));
/* 135 */
-EXTERN char * Tk_NameOfCursor _ANSI_ARGS_((Display * display,
+EXTERN CONST84_RETURN char * Tk_NameOfCursor _ANSI_ARGS_((Display * display,
Tk_Cursor cursor));
/* 136 */
-EXTERN char * Tk_NameOfFont _ANSI_ARGS_((Tk_Font font));
+EXTERN CONST84_RETURN char * Tk_NameOfFont _ANSI_ARGS_((Tk_Font font));
/* 137 */
-EXTERN char * Tk_NameOfImage _ANSI_ARGS_((
+EXTERN CONST84_RETURN char * Tk_NameOfImage _ANSI_ARGS_((
Tk_ImageMaster imageMaster));
/* 138 */
-EXTERN char * Tk_NameOfJoinStyle _ANSI_ARGS_((int join));
+EXTERN CONST84_RETURN char * Tk_NameOfJoinStyle _ANSI_ARGS_((int join));
/* 139 */
-EXTERN char * Tk_NameOfJustify _ANSI_ARGS_((Tk_Justify justify));
+EXTERN CONST84_RETURN char * Tk_NameOfJustify _ANSI_ARGS_((
+ Tk_Justify justify));
/* 140 */
-EXTERN char * Tk_NameOfRelief _ANSI_ARGS_((int relief));
+EXTERN CONST84_RETURN char * Tk_NameOfRelief _ANSI_ARGS_((int relief));
/* 141 */
EXTERN Tk_Window Tk_NameToWindow _ANSI_ARGS_((Tcl_Interp * interp,
- char * pathName, Tk_Window tkwin));
+ CONST char * pathName, Tk_Window tkwin));
/* 142 */
EXTERN void Tk_OwnSelection _ANSI_ARGS_((Tk_Window tkwin,
Atom selection, Tk_LostSelProc * proc,
ClientData clientData));
/* 143 */
EXTERN int Tk_ParseArgv _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, int * argcPtr, char ** argv,
- Tk_ArgvInfo * argTable, int flags));
+ Tk_Window tkwin, int * argcPtr,
+ CONST84 char ** argv, Tk_ArgvInfo * argTable,
+ int flags));
/* 144 */
-EXTERN void Tk_PhotoPutBlock _ANSI_ARGS_((Tk_PhotoHandle handle,
+EXTERN void Tk_PhotoPutBlock_NoComposite _ANSI_ARGS_((
+ Tk_PhotoHandle handle,
Tk_PhotoImageBlock * blockPtr, int x, int y,
int width, int height));
/* 145 */
-EXTERN void Tk_PhotoPutZoomedBlock _ANSI_ARGS_((
+EXTERN void Tk_PhotoPutZoomedBlock_NoComposite _ANSI_ARGS_((
Tk_PhotoHandle handle,
Tk_PhotoImageBlock * blockPtr, int x, int y,
int width, int height, int zoomX, int zoomY,
@@ -560,14 +569,14 @@ EXTERN Tk_RestrictProc * Tk_RestrictEvents _ANSI_ARGS_((
/* 159 */
EXTERN int Tk_SafeInit _ANSI_ARGS_((Tcl_Interp * interp));
/* 160 */
-EXTERN char * Tk_SetAppName _ANSI_ARGS_((Tk_Window tkwin,
- char * name));
+EXTERN CONST char * Tk_SetAppName _ANSI_ARGS_((Tk_Window tkwin,
+ CONST char * name));
/* 161 */
EXTERN void Tk_SetBackgroundFromBorder _ANSI_ARGS_((
Tk_Window tkwin, Tk_3DBorder border));
/* 162 */
EXTERN void Tk_SetClass _ANSI_ARGS_((Tk_Window tkwin,
- char * className));
+ CONST char * className));
/* 163 */
EXTERN void Tk_SetGrid _ANSI_ARGS_((Tk_Window tkwin,
int reqWidth, int reqHeight, int gridWidth,
@@ -820,6 +829,93 @@ EXTERN int Tk_PostscriptPhoto _ANSI_ARGS_((Tcl_Interp * interp,
Tk_PhotoImageBlock * blockPtr,
Tk_PostscriptInfo psInfo, int width,
int height));
+/* 239 */
+EXTERN void Tk_CreateClientMessageHandler _ANSI_ARGS_((
+ Tk_ClientMessageProc * proc));
+/* 240 */
+EXTERN void Tk_DeleteClientMessageHandler _ANSI_ARGS_((
+ Tk_ClientMessageProc * proc));
+/* 241 */
+EXTERN Tk_Window Tk_CreateAnonymousWindow _ANSI_ARGS_((
+ Tcl_Interp * interp, Tk_Window parent,
+ CONST char * screenName));
+/* 242 */
+EXTERN void Tk_SetClassProcs _ANSI_ARGS_((Tk_Window tkwin,
+ Tk_ClassProcs * procs,
+ ClientData instanceData));
+/* 243 */
+EXTERN void Tk_SetInternalBorderEx _ANSI_ARGS_((Tk_Window tkwin,
+ int left, int right, int top, int bottom));
+/* 244 */
+EXTERN void Tk_SetMinimumRequestSize _ANSI_ARGS_((
+ Tk_Window tkwin, int minWidth, int minHeight));
+/* 245 */
+EXTERN void Tk_SetCaretPos _ANSI_ARGS_((Tk_Window tkwin, int x,
+ int y, int height));
+/* 246 */
+EXTERN void Tk_PhotoPutBlock _ANSI_ARGS_((Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock * blockPtr, int x, int y,
+ int width, int height, int compRule));
+/* 247 */
+EXTERN void Tk_PhotoPutZoomedBlock _ANSI_ARGS_((
+ Tk_PhotoHandle handle,
+ Tk_PhotoImageBlock * blockPtr, int x, int y,
+ int width, int height, int zoomX, int zoomY,
+ int subsampleX, int subsampleY, int compRule));
+/* 248 */
+EXTERN int Tk_CollapseMotionEvents _ANSI_ARGS_((
+ Display * display, int collapse));
+/* 249 */
+EXTERN Tk_StyleEngine Tk_RegisterStyleEngine _ANSI_ARGS_((
+ CONST char * name, Tk_StyleEngine parent));
+/* 250 */
+EXTERN Tk_StyleEngine Tk_GetStyleEngine _ANSI_ARGS_((CONST char * name));
+/* 251 */
+EXTERN int Tk_RegisterStyledElement _ANSI_ARGS_((
+ Tk_StyleEngine engine,
+ Tk_ElementSpec * templatePtr));
+/* 252 */
+EXTERN int Tk_GetElementId _ANSI_ARGS_((CONST char * name));
+/* 253 */
+EXTERN Tk_Style Tk_CreateStyle _ANSI_ARGS_((CONST char * name,
+ Tk_StyleEngine engine, ClientData clientData));
+/* 254 */
+EXTERN Tk_Style Tk_GetStyle _ANSI_ARGS_((Tcl_Interp * interp,
+ CONST char * name));
+/* 255 */
+EXTERN void Tk_FreeStyle _ANSI_ARGS_((Tk_Style style));
+/* 256 */
+EXTERN CONST char * Tk_NameOfStyle _ANSI_ARGS_((Tk_Style style));
+/* 257 */
+EXTERN Tk_Style Tk_AllocStyleFromObj _ANSI_ARGS_((
+ Tcl_Interp * interp, Tcl_Obj * objPtr));
+/* 258 */
+EXTERN Tk_Style Tk_GetStyleFromObj _ANSI_ARGS_((Tcl_Obj * objPtr));
+/* 259 */
+EXTERN void Tk_FreeStyleFromObj _ANSI_ARGS_((Tcl_Obj * objPtr));
+/* 260 */
+EXTERN Tk_StyledElement Tk_GetStyledElement _ANSI_ARGS_((Tk_Style style,
+ int elementId, Tk_OptionTable optionTable));
+/* 261 */
+EXTERN void Tk_GetElementSize _ANSI_ARGS_((Tk_Style style,
+ Tk_StyledElement element, char * recordPtr,
+ Tk_Window tkwin, int width, int height,
+ int inner, int * widthPtr, int * heightPtr));
+/* 262 */
+EXTERN void Tk_GetElementBox _ANSI_ARGS_((Tk_Style style,
+ Tk_StyledElement element, char * recordPtr,
+ Tk_Window tkwin, int x, int y, int width,
+ int height, int inner, int * xPtr,
+ int * yPtr, int * widthPtr, int * heightPtr));
+/* 263 */
+EXTERN int Tk_GetElementBorderWidth _ANSI_ARGS_((Tk_Style style,
+ Tk_StyledElement element, char * recordPtr,
+ Tk_Window tkwin));
+/* 264 */
+EXTERN void Tk_DrawElement _ANSI_ARGS_((Tk_Style style,
+ Tk_StyledElement element, char * recordPtr,
+ Tk_Window tkwin, Drawable d, int x, int y,
+ int width, int height, int state));
typedef struct TkStubHooks {
struct TkPlatStubs *tkPlatStubs;
@@ -837,11 +933,11 @@ typedef struct TkStubs {
GC (*tk_3DBorderGC) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border, int which)); /* 2 */
void (*tk_3DHorizontalBevel) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftIn, int rightIn, int topBevel, int relief)); /* 3 */
void (*tk_3DVerticalBevel) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int leftBevel, int relief)); /* 4 */
- void (*tk_AddOption) _ANSI_ARGS_((Tk_Window tkwin, char * name, char * value, int priority)); /* 5 */
+ void (*tk_AddOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name, CONST char * value, int priority)); /* 5 */
void (*tk_BindEvent) _ANSI_ARGS_((Tk_BindingTable bindingTable, XEvent * eventPtr, Tk_Window tkwin, int numObjects, ClientData * objectPtr)); /* 6 */
void (*tk_CanvasDrawableCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short * drawableXPtr, short * drawableYPtr)); /* 7 */
void (*tk_CanvasEventuallyRedraw) _ANSI_ARGS_((Tk_Canvas canvas, int x1, int y1, int x2, int y2)); /* 8 */
- int (*tk_CanvasGetCoord) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, char * str, double * doublePtr)); /* 9 */
+ int (*tk_CanvasGetCoord) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, CONST char * str, double * doublePtr)); /* 9 */
Tk_CanvasTextInfo * (*tk_CanvasGetTextInfo) _ANSI_ARGS_((Tk_Canvas canvas)); /* 10 */
int (*tk_CanvasPsBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Pixmap bitmap, int x, int y, int width, int height)); /* 11 */
int (*tk_CanvasPsColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, XColor * colorPtr)); /* 12 */
@@ -850,7 +946,7 @@ typedef struct TkStubs {
int (*tk_CanvasPsStipple) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Canvas canvas, Pixmap bitmap)); /* 15 */
double (*tk_CanvasPsY) _ANSI_ARGS_((Tk_Canvas canvas, double y)); /* 16 */
void (*tk_CanvasSetStippleOrigin) _ANSI_ARGS_((Tk_Canvas canvas, GC gc)); /* 17 */
- int (*tk_CanvasTagsParseProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, Tk_Window tkwin, char * value, char * widgRec, int offset)); /* 18 */
+ int (*tk_CanvasTagsParseProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, Tk_Window tkwin, CONST char * value, char * widgRec, int offset)); /* 18 */
char * (*tk_CanvasTagsPrintProc) _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin, char * widgRec, int offset, Tcl_FreeProc ** freeProcPtr)); /* 19 */
Tk_Window (*tk_CanvasTkwin) _ANSI_ARGS_((Tk_Canvas canvas)); /* 20 */
void (*tk_CanvasWindowCoords) _ANSI_ARGS_((Tk_Canvas canvas, double x, double y, short * screenXPtr, short * screenYPtr)); /* 21 */
@@ -859,13 +955,13 @@ typedef struct TkStubs {
void (*tk_ClearSelection) _ANSI_ARGS_((Tk_Window tkwin, Atom selection)); /* 24 */
int (*tk_ClipboardAppend) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Atom target, Atom format, char* buffer)); /* 25 */
int (*tk_ClipboardClear) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin)); /* 26 */
- int (*tk_ConfigureInfo) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, char * argvName, int flags)); /* 27 */
- int (*tk_ConfigureValue) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, char * argvName, int flags)); /* 28 */
- int (*tk_ConfigureWidget) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, int argc, char ** argv, char * widgRec, int flags)); /* 29 */
+ int (*tk_ConfigureInfo) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, CONST char * argvName, int flags)); /* 27 */
+ int (*tk_ConfigureValue) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, char * widgRec, CONST char * argvName, int flags)); /* 28 */
+ int (*tk_ConfigureWidget) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_ConfigSpec * specs, int argc, CONST84 char ** argv, char * widgRec, int flags)); /* 29 */
void (*tk_ConfigureWindow) _ANSI_ARGS_((Tk_Window tkwin, unsigned int valueMask, XWindowChanges * valuePtr)); /* 30 */
Tk_TextLayout (*tk_ComputeTextLayout) _ANSI_ARGS_((Tk_Font font, CONST char * str, int numChars, int wrapLength, Tk_Justify justify, int flags, int * widthPtr, int * heightPtr)); /* 31 */
Tk_Window (*tk_CoordsToWindow) _ANSI_ARGS_((int rootX, int rootY, Tk_Window tkwin)); /* 32 */
- unsigned long (*tk_CreateBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, char * eventStr, char * command, int append)); /* 33 */
+ unsigned long (*tk_CreateBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr, CONST char * command, int append)); /* 33 */
Tk_BindingTable (*tk_CreateBindingTable) _ANSI_ARGS_((Tcl_Interp * interp)); /* 34 */
Tk_ErrorHandler (*tk_CreateErrorHandler) _ANSI_ARGS_((Display * display, int errNum, int request, int minorCode, Tk_ErrorProc * errorProc, ClientData clientData)); /* 35 */
void (*tk_CreateEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc * proc, ClientData clientData)); /* 36 */
@@ -874,20 +970,20 @@ typedef struct TkStubs {
void (*tk_CreateItemType) _ANSI_ARGS_((Tk_ItemType * typePtr)); /* 39 */
void (*tk_CreatePhotoImageFormat) _ANSI_ARGS_((Tk_PhotoImageFormat * formatPtr)); /* 40 */
void (*tk_CreateSelHandler) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target, Tk_SelectionProc * proc, ClientData clientData, Atom format)); /* 41 */
- Tk_Window (*tk_CreateWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, char * name, char * screenName)); /* 42 */
- Tk_Window (*tk_CreateWindowFromPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * pathName, char * screenName)); /* 43 */
- int (*tk_DefineBitmap) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, char * source, int width, int height)); /* 44 */
+ Tk_Window (*tk_CreateWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, CONST char * name, CONST char * screenName)); /* 42 */
+ Tk_Window (*tk_CreateWindowFromPath) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * pathName, CONST char * screenName)); /* 43 */
+ int (*tk_DefineBitmap) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * source, int width, int height)); /* 44 */
void (*tk_DefineCursor) _ANSI_ARGS_((Tk_Window window, Tk_Cursor cursor)); /* 45 */
void (*tk_DeleteAllBindings) _ANSI_ARGS_((Tk_BindingTable bindingTable, ClientData object)); /* 46 */
- int (*tk_DeleteBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, char * eventStr)); /* 47 */
+ int (*tk_DeleteBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr)); /* 47 */
void (*tk_DeleteBindingTable) _ANSI_ARGS_((Tk_BindingTable bindingTable)); /* 48 */
void (*tk_DeleteErrorHandler) _ANSI_ARGS_((Tk_ErrorHandler handler)); /* 49 */
void (*tk_DeleteEventHandler) _ANSI_ARGS_((Tk_Window token, unsigned long mask, Tk_EventProc * proc, ClientData clientData)); /* 50 */
void (*tk_DeleteGenericHandler) _ANSI_ARGS_((Tk_GenericProc * proc, ClientData clientData)); /* 51 */
- void (*tk_DeleteImage) _ANSI_ARGS_((Tcl_Interp * interp, char * name)); /* 52 */
+ void (*tk_DeleteImage) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 52 */
void (*tk_DeleteSelHandler) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Atom target)); /* 53 */
void (*tk_DestroyWindow) _ANSI_ARGS_((Tk_Window tkwin)); /* 54 */
- char * (*tk_DisplayName) _ANSI_ARGS_((Tk_Window tkwin)); /* 55 */
+ CONST84_RETURN char * (*tk_DisplayName) _ANSI_ARGS_((Tk_Window tkwin)); /* 55 */
int (*tk_DistanceToTextLayout) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y)); /* 56 */
void (*tk_Draw3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint * pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 57 */
void (*tk_Draw3DRectangle) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief)); /* 58 */
@@ -896,7 +992,7 @@ typedef struct TkStubs {
void (*tk_DrawTextLayout) _ANSI_ARGS_((Display * display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, int firstChar, int lastChar)); /* 61 */
void (*tk_Fill3DPolygon) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, XPoint * pointPtr, int numPoints, int borderWidth, int leftRelief)); /* 62 */
void (*tk_Fill3DRectangle) _ANSI_ARGS_((Tk_Window tkwin, Drawable drawable, Tk_3DBorder border, int x, int y, int width, int height, int borderWidth, int relief)); /* 63 */
- Tk_PhotoHandle (*tk_FindPhoto) _ANSI_ARGS_((Tcl_Interp * interp, char * imageName)); /* 64 */
+ Tk_PhotoHandle (*tk_FindPhoto) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * imageName)); /* 64 */
Font (*tk_FontId) _ANSI_ARGS_((Tk_Font font)); /* 65 */
void (*tk_Free3DBorder) _ANSI_ARGS_((Tk_3DBorder border)); /* 66 */
void (*tk_FreeBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap)); /* 67 */
@@ -914,44 +1010,44 @@ typedef struct TkStubs {
void (*tk_GeometryRequest) _ANSI_ARGS_((Tk_Window tkwin, int reqWidth, int reqHeight)); /* 79 */
Tk_3DBorder (*tk_Get3DBorder) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid colorName)); /* 80 */
void (*tk_GetAllBindings) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object)); /* 81 */
- int (*tk_GetAnchor) _ANSI_ARGS_((Tcl_Interp * interp, char * str, Tk_Anchor * anchorPtr)); /* 82 */
- char * (*tk_GetAtomName) _ANSI_ARGS_((Tk_Window tkwin, Atom atom)); /* 83 */
- char * (*tk_GetBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, char * eventStr)); /* 84 */
+ int (*tk_GetAnchor) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, Tk_Anchor * anchorPtr)); /* 82 */
+ CONST84_RETURN char * (*tk_GetAtomName) _ANSI_ARGS_((Tk_Window tkwin, Atom atom)); /* 83 */
+ CONST84_RETURN char * (*tk_GetBinding) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventStr)); /* 84 */
Pixmap (*tk_GetBitmap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 85 */
- Pixmap (*tk_GetBitmapFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * source, int width, int height)); /* 86 */
- int (*tk_GetCapStyle) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * capPtr)); /* 87 */
+ Pixmap (*tk_GetBitmapFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * source, int width, int height)); /* 86 */
+ int (*tk_GetCapStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * capPtr)); /* 87 */
XColor * (*tk_GetColor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid name)); /* 88 */
XColor * (*tk_GetColorByValue) _ANSI_ARGS_((Tk_Window tkwin, XColor * colorPtr)); /* 89 */
- Colormap (*tk_GetColormap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * str)); /* 90 */
+ Colormap (*tk_GetColormap) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 90 */
Tk_Cursor (*tk_GetCursor) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid str)); /* 91 */
- Tk_Cursor (*tk_GetCursorFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * source, char * mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg)); /* 92 */
+ Tk_Cursor (*tk_GetCursorFromData) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * source, CONST char * mask, int width, int height, int xHot, int yHot, Tk_Uid fg, Tk_Uid bg)); /* 92 */
Tk_Font (*tk_GetFont) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str)); /* 93 */
Tk_Font (*tk_GetFontFromObj) _ANSI_ARGS_((Tk_Window tkwin, Tcl_Obj * objPtr)); /* 94 */
void (*tk_GetFontMetrics) _ANSI_ARGS_((Tk_Font font, Tk_FontMetrics * fmPtr)); /* 95 */
GC (*tk_GetGC) _ANSI_ARGS_((Tk_Window tkwin, unsigned long valueMask, XGCValues * valuePtr)); /* 96 */
- Tk_Image (*tk_GetImage) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * name, Tk_ImageChangedProc * changeProc, ClientData clientData)); /* 97 */
- ClientData (*tk_GetImageMasterData) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tk_ImageType ** typePtrPtr)); /* 98 */
+ Tk_Image (*tk_GetImage) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * name, Tk_ImageChangedProc * changeProc, ClientData clientData)); /* 97 */
+ ClientData (*tk_GetImageMasterData) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, Tk_ImageType ** typePtrPtr)); /* 98 */
Tk_ItemType * (*tk_GetItemTypes) _ANSI_ARGS_((void)); /* 99 */
- int (*tk_GetJoinStyle) _ANSI_ARGS_((Tcl_Interp * interp, char * str, int * joinPtr)); /* 100 */
- int (*tk_GetJustify) _ANSI_ARGS_((Tcl_Interp * interp, char * str, Tk_Justify * justifyPtr)); /* 101 */
+ int (*tk_GetJoinStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, int * joinPtr)); /* 100 */
+ int (*tk_GetJustify) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * str, Tk_Justify * justifyPtr)); /* 101 */
int (*tk_GetNumMainWindows) _ANSI_ARGS_((void)); /* 102 */
- Tk_Uid (*tk_GetOption) _ANSI_ARGS_((Tk_Window tkwin, char * name, char * className)); /* 103 */
- int (*tk_GetPixels) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * str, int * intPtr)); /* 104 */
+ Tk_Uid (*tk_GetOption) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name, CONST char * className)); /* 103 */
+ int (*tk_GetPixels) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, int * intPtr)); /* 104 */
Pixmap (*tk_GetPixmap) _ANSI_ARGS_((Display * display, Drawable d, int width, int height, int depth)); /* 105 */
- int (*tk_GetRelief) _ANSI_ARGS_((Tcl_Interp * interp, char * name, int * reliefPtr)); /* 106 */
+ int (*tk_GetRelief) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, int * reliefPtr)); /* 106 */
void (*tk_GetRootCoords) _ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr)); /* 107 */
- int (*tk_GetScrollInfo) _ANSI_ARGS_((Tcl_Interp * interp, int argc, char ** argv, double * dblPtr, int * intPtr)); /* 108 */
- int (*tk_GetScreenMM) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * str, double * doublePtr)); /* 109 */
+ int (*tk_GetScrollInfo) _ANSI_ARGS_((Tcl_Interp * interp, int argc, CONST84 char ** argv, double * dblPtr, int * intPtr)); /* 108 */
+ int (*tk_GetScreenMM) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, double * doublePtr)); /* 109 */
int (*tk_GetSelection) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Atom selection, Atom target, Tk_GetSelProc * proc, ClientData clientData)); /* 110 */
Tk_Uid (*tk_GetUid) _ANSI_ARGS_((CONST char * str)); /* 111 */
- Visual * (*tk_GetVisual) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * str, int * depthPtr, Colormap * colormapPtr)); /* 112 */
+ Visual * (*tk_GetVisual) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * str, int * depthPtr, Colormap * colormapPtr)); /* 112 */
void (*tk_GetVRootGeometry) _ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 113 */
int (*tk_Grab) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, int grabGlobal)); /* 114 */
void (*tk_HandleEvent) _ANSI_ARGS_((XEvent * eventPtr)); /* 115 */
Tk_Window (*tk_IdToWindow) _ANSI_ARGS_((Display * display, Window window)); /* 116 */
void (*tk_ImageChanged) _ANSI_ARGS_((Tk_ImageMaster master, int x, int y, int width, int height, int imageWidth, int imageHeight)); /* 117 */
int (*tk_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 118 */
- Atom (*tk_InternAtom) _ANSI_ARGS_((Tk_Window tkwin, char * name)); /* 119 */
+ Atom (*tk_InternAtom) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name)); /* 119 */
int (*tk_IntersectTextLayout) _ANSI_ARGS_((Tk_TextLayout layout, int x, int y, int width, int height)); /* 120 */
void (*tk_MaintainGeometry) _ANSI_ARGS_((Tk_Window slave, Tk_Window master, int x, int y, int width, int height)); /* 121 */
Tk_Window (*tk_MainWindow) _ANSI_ARGS_((Tcl_Interp * interp)); /* 122 */
@@ -962,22 +1058,22 @@ typedef struct TkStubs {
void (*tk_MoveResizeWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height)); /* 127 */
void (*tk_MoveWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 128 */
void (*tk_MoveToplevelWindow) _ANSI_ARGS_((Tk_Window tkwin, int x, int y)); /* 129 */
- char * (*tk_NameOf3DBorder) _ANSI_ARGS_((Tk_3DBorder border)); /* 130 */
- char * (*tk_NameOfAnchor) _ANSI_ARGS_((Tk_Anchor anchor)); /* 131 */
- char * (*tk_NameOfBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap)); /* 132 */
- char * (*tk_NameOfCapStyle) _ANSI_ARGS_((int cap)); /* 133 */
- char * (*tk_NameOfColor) _ANSI_ARGS_((XColor * colorPtr)); /* 134 */
- char * (*tk_NameOfCursor) _ANSI_ARGS_((Display * display, Tk_Cursor cursor)); /* 135 */
- char * (*tk_NameOfFont) _ANSI_ARGS_((Tk_Font font)); /* 136 */
- char * (*tk_NameOfImage) _ANSI_ARGS_((Tk_ImageMaster imageMaster)); /* 137 */
- char * (*tk_NameOfJoinStyle) _ANSI_ARGS_((int join)); /* 138 */
- char * (*tk_NameOfJustify) _ANSI_ARGS_((Tk_Justify justify)); /* 139 */
- char * (*tk_NameOfRelief) _ANSI_ARGS_((int relief)); /* 140 */
- Tk_Window (*tk_NameToWindow) _ANSI_ARGS_((Tcl_Interp * interp, char * pathName, Tk_Window tkwin)); /* 141 */
+ CONST84_RETURN char * (*tk_NameOf3DBorder) _ANSI_ARGS_((Tk_3DBorder border)); /* 130 */
+ CONST84_RETURN char * (*tk_NameOfAnchor) _ANSI_ARGS_((Tk_Anchor anchor)); /* 131 */
+ CONST84_RETURN char * (*tk_NameOfBitmap) _ANSI_ARGS_((Display * display, Pixmap bitmap)); /* 132 */
+ CONST84_RETURN char * (*tk_NameOfCapStyle) _ANSI_ARGS_((int cap)); /* 133 */
+ CONST84_RETURN char * (*tk_NameOfColor) _ANSI_ARGS_((XColor * colorPtr)); /* 134 */
+ CONST84_RETURN char * (*tk_NameOfCursor) _ANSI_ARGS_((Display * display, Tk_Cursor cursor)); /* 135 */
+ CONST84_RETURN char * (*tk_NameOfFont) _ANSI_ARGS_((Tk_Font font)); /* 136 */
+ CONST84_RETURN char * (*tk_NameOfImage) _ANSI_ARGS_((Tk_ImageMaster imageMaster)); /* 137 */
+ CONST84_RETURN char * (*tk_NameOfJoinStyle) _ANSI_ARGS_((int join)); /* 138 */
+ CONST84_RETURN char * (*tk_NameOfJustify) _ANSI_ARGS_((Tk_Justify justify)); /* 139 */
+ CONST84_RETURN char * (*tk_NameOfRelief) _ANSI_ARGS_((int relief)); /* 140 */
+ Tk_Window (*tk_NameToWindow) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * pathName, Tk_Window tkwin)); /* 141 */
void (*tk_OwnSelection) _ANSI_ARGS_((Tk_Window tkwin, Atom selection, Tk_LostSelProc * proc, ClientData clientData)); /* 142 */
- int (*tk_ParseArgv) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, int * argcPtr, char ** argv, Tk_ArgvInfo * argTable, int flags)); /* 143 */
- void (*tk_PhotoPutBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height)); /* 144 */
- void (*tk_PhotoPutZoomedBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY)); /* 145 */
+ int (*tk_ParseArgv) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, int * argcPtr, CONST84 char ** argv, Tk_ArgvInfo * argTable, int flags)); /* 143 */
+ void (*tk_PhotoPutBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height)); /* 144 */
+ void (*tk_PhotoPutZoomedBlock_NoComposite) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY)); /* 145 */
int (*tk_PhotoGetImage) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr)); /* 146 */
void (*tk_PhotoBlank) _ANSI_ARGS_((Tk_PhotoHandle handle)); /* 147 */
void (*tk_PhotoExpand) _ANSI_ARGS_((Tk_PhotoHandle handle, int width, int height)); /* 148 */
@@ -992,9 +1088,9 @@ typedef struct TkStubs {
int (*tk_RestackWindow) _ANSI_ARGS_((Tk_Window tkwin, int aboveBelow, Tk_Window other)); /* 157 */
Tk_RestrictProc * (*tk_RestrictEvents) _ANSI_ARGS_((Tk_RestrictProc * proc, ClientData arg, ClientData * prevArgPtr)); /* 158 */
int (*tk_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 159 */
- char * (*tk_SetAppName) _ANSI_ARGS_((Tk_Window tkwin, char * name)); /* 160 */
+ CONST char * (*tk_SetAppName) _ANSI_ARGS_((Tk_Window tkwin, CONST char * name)); /* 160 */
void (*tk_SetBackgroundFromBorder) _ANSI_ARGS_((Tk_Window tkwin, Tk_3DBorder border)); /* 161 */
- void (*tk_SetClass) _ANSI_ARGS_((Tk_Window tkwin, char * className)); /* 162 */
+ void (*tk_SetClass) _ANSI_ARGS_((Tk_Window tkwin, CONST char * className)); /* 162 */
void (*tk_SetGrid) _ANSI_ARGS_((Tk_Window tkwin, int reqWidth, int reqHeight, int gridWidth, int gridHeight)); /* 163 */
void (*tk_SetInternalBorder) _ANSI_ARGS_((Tk_Window tkwin, int width)); /* 164 */
void (*tk_SetWindowBackground) _ANSI_ARGS_((Tk_Window tkwin, unsigned long pixel)); /* 165 */
@@ -1071,6 +1167,32 @@ typedef struct TkStubs {
int (*tk_PostscriptStipple) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_PostscriptInfo psInfo, Pixmap bitmap)); /* 236 */
double (*tk_PostscriptY) _ANSI_ARGS_((double y, Tk_PostscriptInfo psInfo)); /* 237 */
int (*tk_PostscriptPhoto) _ANSI_ARGS_((Tcl_Interp * interp, Tk_PhotoImageBlock * blockPtr, Tk_PostscriptInfo psInfo, int width, int height)); /* 238 */
+ void (*tk_CreateClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 239 */
+ void (*tk_DeleteClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 240 */
+ Tk_Window (*tk_CreateAnonymousWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, CONST char * screenName)); /* 241 */
+ void (*tk_SetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, Tk_ClassProcs * procs, ClientData instanceData)); /* 242 */
+ void (*tk_SetInternalBorderEx) _ANSI_ARGS_((Tk_Window tkwin, int left, int right, int top, int bottom)); /* 243 */
+ void (*tk_SetMinimumRequestSize) _ANSI_ARGS_((Tk_Window tkwin, int minWidth, int minHeight)); /* 244 */
+ void (*tk_SetCaretPos) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int height)); /* 245 */
+ void (*tk_PhotoPutBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int compRule)); /* 246 */
+ void (*tk_PhotoPutZoomedBlock) _ANSI_ARGS_((Tk_PhotoHandle handle, Tk_PhotoImageBlock * blockPtr, int x, int y, int width, int height, int zoomX, int zoomY, int subsampleX, int subsampleY, int compRule)); /* 247 */
+ int (*tk_CollapseMotionEvents) _ANSI_ARGS_((Display * display, int collapse)); /* 248 */
+ Tk_StyleEngine (*tk_RegisterStyleEngine) _ANSI_ARGS_((CONST char * name, Tk_StyleEngine parent)); /* 249 */
+ Tk_StyleEngine (*tk_GetStyleEngine) _ANSI_ARGS_((CONST char * name)); /* 250 */
+ int (*tk_RegisterStyledElement) _ANSI_ARGS_((Tk_StyleEngine engine, Tk_ElementSpec * templatePtr)); /* 251 */
+ int (*tk_GetElementId) _ANSI_ARGS_((CONST char * name)); /* 252 */
+ Tk_Style (*tk_CreateStyle) _ANSI_ARGS_((CONST char * name, Tk_StyleEngine engine, ClientData clientData)); /* 253 */
+ Tk_Style (*tk_GetStyle) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name)); /* 254 */
+ void (*tk_FreeStyle) _ANSI_ARGS_((Tk_Style style)); /* 255 */
+ CONST char * (*tk_NameOfStyle) _ANSI_ARGS_((Tk_Style style)); /* 256 */
+ Tk_Style (*tk_AllocStyleFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 257 */
+ Tk_Style (*tk_GetStyleFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 258 */
+ void (*tk_FreeStyleFromObj) _ANSI_ARGS_((Tcl_Obj * objPtr)); /* 259 */
+ Tk_StyledElement (*tk_GetStyledElement) _ANSI_ARGS_((Tk_Style style, int elementId, Tk_OptionTable optionTable)); /* 260 */
+ void (*tk_GetElementSize) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, int width, int height, int inner, int * widthPtr, int * heightPtr)); /* 261 */
+ void (*tk_GetElementBox) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, int x, int y, int width, int height, int inner, int * xPtr, int * yPtr, int * widthPtr, int * heightPtr)); /* 262 */
+ int (*tk_GetElementBorderWidth) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin)); /* 263 */
+ void (*tk_DrawElement) _ANSI_ARGS_((Tk_Style style, Tk_StyledElement element, char * recordPtr, Tk_Window tkwin, Drawable d, int x, int y, int width, int height, int state)); /* 264 */
} TkStubs;
#ifdef __cplusplus
@@ -1663,13 +1785,13 @@ extern TkStubs *tkStubsPtr;
#define Tk_ParseArgv \
(tkStubsPtr->tk_ParseArgv) /* 143 */
#endif
-#ifndef Tk_PhotoPutBlock
-#define Tk_PhotoPutBlock \
- (tkStubsPtr->tk_PhotoPutBlock) /* 144 */
+#ifndef Tk_PhotoPutBlock_NoComposite
+#define Tk_PhotoPutBlock_NoComposite \
+ (tkStubsPtr->tk_PhotoPutBlock_NoComposite) /* 144 */
#endif
-#ifndef Tk_PhotoPutZoomedBlock
-#define Tk_PhotoPutZoomedBlock \
- (tkStubsPtr->tk_PhotoPutZoomedBlock) /* 145 */
+#ifndef Tk_PhotoPutZoomedBlock_NoComposite
+#define Tk_PhotoPutZoomedBlock_NoComposite \
+ (tkStubsPtr->tk_PhotoPutZoomedBlock_NoComposite) /* 145 */
#endif
#ifndef Tk_PhotoGetImage
#define Tk_PhotoGetImage \
@@ -2037,6 +2159,110 @@ extern TkStubs *tkStubsPtr;
#define Tk_PostscriptPhoto \
(tkStubsPtr->tk_PostscriptPhoto) /* 238 */
#endif
+#ifndef Tk_CreateClientMessageHandler
+#define Tk_CreateClientMessageHandler \
+ (tkStubsPtr->tk_CreateClientMessageHandler) /* 239 */
+#endif
+#ifndef Tk_DeleteClientMessageHandler
+#define Tk_DeleteClientMessageHandler \
+ (tkStubsPtr->tk_DeleteClientMessageHandler) /* 240 */
+#endif
+#ifndef Tk_CreateAnonymousWindow
+#define Tk_CreateAnonymousWindow \
+ (tkStubsPtr->tk_CreateAnonymousWindow) /* 241 */
+#endif
+#ifndef Tk_SetClassProcs
+#define Tk_SetClassProcs \
+ (tkStubsPtr->tk_SetClassProcs) /* 242 */
+#endif
+#ifndef Tk_SetInternalBorderEx
+#define Tk_SetInternalBorderEx \
+ (tkStubsPtr->tk_SetInternalBorderEx) /* 243 */
+#endif
+#ifndef Tk_SetMinimumRequestSize
+#define Tk_SetMinimumRequestSize \
+ (tkStubsPtr->tk_SetMinimumRequestSize) /* 244 */
+#endif
+#ifndef Tk_SetCaretPos
+#define Tk_SetCaretPos \
+ (tkStubsPtr->tk_SetCaretPos) /* 245 */
+#endif
+#ifndef Tk_PhotoPutBlock
+#define Tk_PhotoPutBlock \
+ (tkStubsPtr->tk_PhotoPutBlock) /* 246 */
+#endif
+#ifndef Tk_PhotoPutZoomedBlock
+#define Tk_PhotoPutZoomedBlock \
+ (tkStubsPtr->tk_PhotoPutZoomedBlock) /* 247 */
+#endif
+#ifndef Tk_CollapseMotionEvents
+#define Tk_CollapseMotionEvents \
+ (tkStubsPtr->tk_CollapseMotionEvents) /* 248 */
+#endif
+#ifndef Tk_RegisterStyleEngine
+#define Tk_RegisterStyleEngine \
+ (tkStubsPtr->tk_RegisterStyleEngine) /* 249 */
+#endif
+#ifndef Tk_GetStyleEngine
+#define Tk_GetStyleEngine \
+ (tkStubsPtr->tk_GetStyleEngine) /* 250 */
+#endif
+#ifndef Tk_RegisterStyledElement
+#define Tk_RegisterStyledElement \
+ (tkStubsPtr->tk_RegisterStyledElement) /* 251 */
+#endif
+#ifndef Tk_GetElementId
+#define Tk_GetElementId \
+ (tkStubsPtr->tk_GetElementId) /* 252 */
+#endif
+#ifndef Tk_CreateStyle
+#define Tk_CreateStyle \
+ (tkStubsPtr->tk_CreateStyle) /* 253 */
+#endif
+#ifndef Tk_GetStyle
+#define Tk_GetStyle \
+ (tkStubsPtr->tk_GetStyle) /* 254 */
+#endif
+#ifndef Tk_FreeStyle
+#define Tk_FreeStyle \
+ (tkStubsPtr->tk_FreeStyle) /* 255 */
+#endif
+#ifndef Tk_NameOfStyle
+#define Tk_NameOfStyle \
+ (tkStubsPtr->tk_NameOfStyle) /* 256 */
+#endif
+#ifndef Tk_AllocStyleFromObj
+#define Tk_AllocStyleFromObj \
+ (tkStubsPtr->tk_AllocStyleFromObj) /* 257 */
+#endif
+#ifndef Tk_GetStyleFromObj
+#define Tk_GetStyleFromObj \
+ (tkStubsPtr->tk_GetStyleFromObj) /* 258 */
+#endif
+#ifndef Tk_FreeStyleFromObj
+#define Tk_FreeStyleFromObj \
+ (tkStubsPtr->tk_FreeStyleFromObj) /* 259 */
+#endif
+#ifndef Tk_GetStyledElement
+#define Tk_GetStyledElement \
+ (tkStubsPtr->tk_GetStyledElement) /* 260 */
+#endif
+#ifndef Tk_GetElementSize
+#define Tk_GetElementSize \
+ (tkStubsPtr->tk_GetElementSize) /* 261 */
+#endif
+#ifndef Tk_GetElementBox
+#define Tk_GetElementBox \
+ (tkStubsPtr->tk_GetElementBox) /* 262 */
+#endif
+#ifndef Tk_GetElementBorderWidth
+#define Tk_GetElementBorderWidth \
+ (tkStubsPtr->tk_GetElementBorderWidth) /* 263 */
+#endif
+#ifndef Tk_DrawElement
+#define Tk_DrawElement \
+ (tkStubsPtr->tk_DrawElement) /* 264 */
+#endif
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
@@ -2047,4 +2273,3 @@ extern TkStubs *tkStubsPtr;
#endif /* _TKDECLS */
-
diff --git a/tk/generic/tkEntry.c b/tk/generic/tkEntry.c
index 6ed11d6f9b7..5ab3846d292 100644
--- a/tk/generic/tkEntry.c
+++ b/tk/generic/tkEntry.c
@@ -1,12 +1,15 @@
/*
- * tkEntry.c --
+ * Entry.c --
*
- * This module implements entry widgets for the Tk
- * toolkit. An entry displays a string and allows
- * the string to be edited.
+ * This module implements entry and spinbox widgets for the Tk toolkit.
+ * An entry displays a string and allows the string to be edited.
+ * A spinbox expands on the entry by adding up/down buttons that control
+ * the value of the entry widget.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 2000 Ajuba Solutions.
+ * 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.
@@ -17,8 +20,12 @@
#include "tkInt.h"
#include "default.h"
+enum EntryType {
+ TK_ENTRY, TK_SPINBOX
+};
+
/*
- * A data structure of the following type is kept for each entry
+ * A data structure of the following type is kept for each Entry
* widget managed by this file:
*/
@@ -34,13 +41,13 @@ typedef struct {
Tcl_Command widgetCmd; /* Token for entry's widget command. */
Tk_OptionTable optionTable; /* Table that defines configuration options
* available for this widget. */
-
+ enum EntryType type; /* Specialized type of Entry widget */
/*
* Fields that are set by widget commands other than "configure".
*/
- char *string; /* Pointer to storage for string;
+ CONST char *string; /* Pointer to storage for string;
* NULL-terminated; malloc-ed. */
int insertPos; /* Character index before which next typed
* character will be inserted. */
@@ -72,12 +79,19 @@ typedef struct {
Tk_3DBorder normalBorder; /* Used for drawing border around whole
* window, plus used for background. */
+ Tk_3DBorder disabledBorder; /* Used for drawing border around whole
+ * window in disabled state, plus used for
+ * background. */
+ Tk_3DBorder readonlyBorder; /* Used for drawing border around whole
+ * window in readonly state, plus used for
+ * background. */
int borderWidth; /* Width of 3-D border around window. */
Tk_Cursor cursor; /* Current cursor for window, or None. */
int exportSelection; /* Non-zero means tie internal entry selection
* to X selection. */
Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *fgColorPtr; /* Text color in normal mode. */
+ XColor *dfgColorPtr; /* Text color in disabled mode. */
XColor *highlightBgColorPtr;/* Color for drawing traversal highlight
* area when highlight is off. */
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
@@ -99,9 +113,6 @@ typedef struct {
* characters. */
int selBorderWidth; /* Width of border around selection. */
XColor *selFgColorPtr; /* Foreground color for selected text. */
- char *showChar; /* Value of -show option. If non-NULL, first
- * character is used for displaying all
- * characters in entry. Malloc'ed. */
int state; /* Normal or disabled. Entry is read-only
* when disabled. */
char *textVarName; /* Name of variable (malloc'ed) or NULL.
@@ -115,23 +126,27 @@ typedef struct {
char *scrollCmd; /* Command prefix for communicating with
* scrollbar(s). Malloc'ed. NULL means
* no command to issue. */
+ char *showChar; /* Value of -show option. If non-NULL, first
+ * character is used for displaying all
+ * characters in entry. Malloc'ed.
+ * This is only used by the Entry widget. */
/*
* Fields whose values are derived from the current values of the
* configuration settings above.
*/
+ CONST char *displayString; /* String to use when displaying. This may
+ * be a pointer to string, or a pointer to
+ * malloced memory with the same character
+ * length as string but whose characters
+ * are all equal to showChar. */
int numBytes; /* Length of string in bytes. */
int numChars; /* Length of string in characters. Both
* string and displayString have the same
* character length, but may have different
* byte lengths due to being made from
* different UTF-8 characters. */
- char *displayString; /* String to use when displaying. This may
- * be a pointer to string, or a pointer to
- * malloced memory with the same character
- * length as string but whose characters
- * are all equal to showChar. */
int numDisplayBytes; /* Length of displayString in bytes. */
int inset; /* Number of pixels on the left and right
* sides that are taken up by XPAD, borderWidth
@@ -149,19 +164,78 @@ typedef struct {
GC selTextGC; /* For drawing selected text. */
GC highlightGC; /* For drawing traversal highlight. */
int avgWidth; /* Width of average character. */
+ int xWidth; /* Extra width to reserve for widget.
+ * Used by spinboxes for button space. */
int flags; /* Miscellaneous flags; see below for
* definitions. */
- Tk_TSOffset tsoffset;
+ int validate; /* Non-zero means try to validate */
char *validateCmd; /* Command prefix to use when invoking
* validate command. NULL means don't
* invoke commands. Malloc'ed. */
- int validate; /* Non-zero means try to validate */
char *invalidCmd; /* Command called when a validation returns 0
* (successfully fails), defaults to {}. */
+
} Entry;
/*
+ * A data structure of the following type is kept for each spinbox
+ * widget managed by this file:
+ */
+
+typedef struct {
+ Entry entry; /* A pointer to the generic entry structure.
+ * This must be the first element of the
+ * Spinbox. */
+
+ /*
+ * Spinbox specific configuration settings.
+ */
+
+ Tk_3DBorder activeBorder; /* Used for drawing border around active
+ * buttons. */
+ Tk_3DBorder buttonBorder; /* Used for drawing border around buttons. */
+ Tk_Cursor bCursor; /* cursor for buttons, or None. */
+ int bdRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
+ int buRelief; /* 3-D effect: TK_RELIEF_RAISED, etc. */
+ char *command; /* Command to invoke for spin buttons.
+ * NULL means no command to issue. */
+
+ /*
+ * Spinbox specific fields for use with configuration settings above.
+ */
+
+ int wrap; /* whether to wrap around when spinning */
+
+ int selElement; /* currently selected control */
+ int curElement; /* currently mouseover control */
+
+ int repeatDelay; /* repeat delay */
+ int repeatInterval; /* repeat interval */
+
+ double fromValue; /* Value corresponding to left/top of dial */
+ double toValue; /* Value corresponding to right/bottom
+ * of dial */
+ double increment; /* If > 0, all values are rounded to an
+ * even multiple of this value. */
+ char *formatBuf; /* string into which to format value.
+ * Malloc'ed. */
+ char *reqFormat; /* Sprintf conversion specifier used for the
+ * value that the users requests. Malloc'ed. */
+ char *valueFormat; /* Sprintf conversion specifier used for
+ * the value. */
+ char digitFormat[10]; /* Sprintf conversion specifier computed from
+ * digits and other information; used for
+ * the value. */
+
+ char *valueStr; /* Values List. Malloc'ed. */
+ Tcl_Obj *listObj; /* Pointer to the list object being used */
+ int eIndex; /* Holds the current index into elements */
+ int nElements; /* Holds the current count of elements */
+
+} Spinbox;
+
+/*
* Assigned bits of "flags" fields of Entry structures, and what those
* bits mean:
*
@@ -205,17 +279,23 @@ typedef struct {
#define YPAD 1
/*
+ * A comparison function for double values. For Spinboxes.
+ */
+#define MIN_DBL_VAL 1E-9
+#define DOUBLES_EQ(d1, d2) (fabs((d1) - (d2)) < MIN_DBL_VAL)
+
+/*
* The following enum is used to define a type for the -state option
* of the Entry widget. These values are used as indices into the
* string table below.
*/
enum state {
- STATE_DISABLED, STATE_NORMAL
+ STATE_DISABLED, STATE_NORMAL, STATE_READONLY
};
static char *stateStrings[] = {
- "disabled", "normal", (char *) NULL
+ "disabled", "normal", "readonly", (char *) NULL
};
/*
@@ -231,16 +311,16 @@ enum validateType {
/*
* These extra enums are for use with EntryValidateChange
*/
- VALIDATE_FORCED, VALIDATE_DELETE, VALIDATE_INSERT
+ VALIDATE_FORCED, VALIDATE_DELETE, VALIDATE_INSERT, VALIDATE_BUTTON
};
#define DEF_ENTRY_VALIDATE "none"
#define DEF_ENTRY_INVALIDCMD ""
/*
- * Information used for argv parsing.
+ * Information used for Entry objv parsing.
*/
-static Tk_OptionSpec optionSpecs[] = {
+static Tk_OptionSpec entryOptSpec[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder),
0, (ClientData) DEF_ENTRY_BG_MONO, 0},
@@ -254,6 +334,13 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_ENTRY_CURSOR, -1, Tk_Offset(Entry, cursor),
TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground",
+ "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1,
+ Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
+ {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
+ "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1,
+ Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
"ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1,
Tk_Offset(Entry, exportSelection), 0, 0, 0},
@@ -298,6 +385,10 @@ static Tk_OptionSpec optionSpecs[] = {
(char *) NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0},
{TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0},
+ {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground",
+ "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1,
+ Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief),
0, 0, 0},
@@ -341,11 +432,166 @@ static Tk_OptionSpec optionSpecs[] = {
};
/*
- * Flags for GetEntryIndex procedure:
+ * Information used for Spinbox objv parsing.
*/
-#define ZERO_OK 1
-#define LAST_PLUS_ONE_OK 2
+#define DEF_SPINBOX_REPEAT_DELAY "400"
+#define DEF_SPINBOX_REPEAT_INTERVAL "100"
+
+#define DEF_SPINBOX_CMD ""
+
+#define DEF_SPINBOX_FROM "0"
+#define DEF_SPINBOX_TO "0"
+#define DEF_SPINBOX_INCREMENT "1"
+#define DEF_SPINBOX_FORMAT ""
+
+#define DEF_SPINBOX_VALUES ""
+#define DEF_SPINBOX_WRAP "0"
+
+static Tk_OptionSpec sbOptSpec[] = {
+ {TK_OPTION_BORDER, "-activebackground", "activeBackground", "Background",
+ DEF_BUTTON_ACTIVE_BG_COLOR, -1, Tk_Offset(Spinbox, activeBorder),
+ 0, (ClientData) DEF_BUTTON_ACTIVE_BG_MONO, 0},
+ {TK_OPTION_BORDER, "-background", "background", "Background",
+ DEF_ENTRY_BG_COLOR, -1, Tk_Offset(Entry, normalBorder),
+ 0, (ClientData) DEF_ENTRY_BG_MONO, 0},
+ {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
+ DEF_ENTRY_BORDER_WIDTH, -1, Tk_Offset(Entry, borderWidth),
+ 0, 0, 0},
+ {TK_OPTION_BORDER, "-buttonbackground", "Button.background", "Background",
+ DEF_BUTTON_BG_COLOR, -1, Tk_Offset(Spinbox, buttonBorder),
+ 0, (ClientData) DEF_BUTTON_BG_MONO, 0},
+ {TK_OPTION_CURSOR, "-buttoncursor", "Button.cursor", "Cursor",
+ DEF_BUTTON_CURSOR, -1, Tk_Offset(Spinbox, bCursor),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_RELIEF, "-buttondownrelief", "Button.relief", "Relief",
+ DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, bdRelief),
+ 0, 0, 0},
+ {TK_OPTION_RELIEF, "-buttonuprelief", "Button.relief", "Relief",
+ DEF_BUTTON_RELIEF, -1, Tk_Offset(Spinbox, buRelief),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-command", "command", "Command",
+ DEF_SPINBOX_CMD, -1, Tk_Offset(Spinbox, command),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
+ DEF_ENTRY_CURSOR, -1, Tk_Offset(Entry, cursor),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground",
+ "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1,
+ Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0},
+ {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
+ "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1,
+ Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
+ "ExportSelection", DEF_ENTRY_EXPORT_SELECTION, -1,
+ Tk_Offset(Entry, exportSelection), 0, 0, 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_FONT, "-font", "font", "Font",
+ DEF_ENTRY_FONT, -1, Tk_Offset(Entry, tkfont), 0, 0, 0},
+ {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
+ DEF_ENTRY_FG, -1, Tk_Offset(Entry, fgColorPtr), 0,
+ 0, 0},
+ {TK_OPTION_STRING, "-format", "format", "Format",
+ DEF_SPINBOX_FORMAT, -1, Tk_Offset(Spinbox, reqFormat),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_DOUBLE, "-from", "from", "From",
+ DEF_SPINBOX_FROM, -1, Tk_Offset(Spinbox, fromValue), 0, 0, 0},
+ {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
+ "HighlightBackground", DEF_ENTRY_HIGHLIGHT_BG,
+ -1, Tk_Offset(Entry, highlightBgColorPtr),
+ 0, 0, 0},
+ {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
+ DEF_ENTRY_HIGHLIGHT, -1, Tk_Offset(Entry, highlightColorPtr),
+ 0, 0, 0},
+ {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
+ "HighlightThickness", DEF_ENTRY_HIGHLIGHT_WIDTH, -1,
+ Tk_Offset(Entry, highlightWidth), 0, 0, 0},
+ {TK_OPTION_DOUBLE, "-increment", "increment", "Increment",
+ DEF_SPINBOX_INCREMENT, -1, Tk_Offset(Spinbox, increment), 0, 0, 0},
+ {TK_OPTION_BORDER, "-insertbackground", "insertBackground", "Foreground",
+ DEF_ENTRY_INSERT_BG, -1, Tk_Offset(Entry, insertBorder),
+ 0, 0, 0},
+ {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth",
+ "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1,
+ Tk_Offset(Entry, insertBorderWidth), 0,
+ (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0},
+ {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime",
+ DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime),
+ 0, 0, 0},
+ {TK_OPTION_INT, "-insertontime", "insertOnTime", "OnTime",
+ DEF_ENTRY_INSERT_ON_TIME, -1, Tk_Offset(Entry, insertOnTime),
+ 0, 0, 0},
+ {TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
+ DEF_ENTRY_INSERT_WIDTH, -1, Tk_Offset(Entry, insertWidth),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-invalidcommand", "invalidCommand", "InvalidCommand",
+ DEF_ENTRY_INVALIDCMD, -1, Tk_Offset(Entry, invalidCmd),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_SYNONYM, "-invcmd", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-invalidcommand", 0},
+ {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
+ DEF_ENTRY_JUSTIFY, -1, Tk_Offset(Entry, justify), 0, 0, 0},
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
+ DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief),
+ 0, 0, 0},
+ {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground",
+ "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1,
+ Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK,
+ (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0},
+ {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay",
+ DEF_SPINBOX_REPEAT_DELAY, -1, Tk_Offset(Spinbox, repeatDelay),
+ 0, 0, 0},
+ {TK_OPTION_INT, "-repeatinterval", "repeatInterval", "RepeatInterval",
+ DEF_SPINBOX_REPEAT_INTERVAL, -1, Tk_Offset(Spinbox, repeatInterval),
+ 0, 0, 0},
+ {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
+ DEF_ENTRY_SELECT_COLOR, -1, Tk_Offset(Entry, selBorder),
+ 0, (ClientData) DEF_ENTRY_SELECT_MONO, 0},
+ {TK_OPTION_PIXELS, "-selectborderwidth", "selectBorderWidth",
+ "BorderWidth", DEF_ENTRY_SELECT_BD_COLOR, -1,
+ Tk_Offset(Entry, selBorderWidth),
+ 0, (ClientData) DEF_ENTRY_SELECT_BD_MONO, 0},
+ {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
+ DEF_ENTRY_SELECT_FG_COLOR, -1, Tk_Offset(Entry, selFgColorPtr),
+ 0, (ClientData) DEF_ENTRY_SELECT_FG_MONO, 0},
+ {TK_OPTION_STRING_TABLE, "-state", "state", "State",
+ DEF_ENTRY_STATE, -1, Tk_Offset(Entry, state),
+ 0, (ClientData) stateStrings, 0},
+ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
+ DEF_ENTRY_TAKE_FOCUS, -1, Tk_Offset(Entry, takeFocus),
+ TK_CONFIG_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
+ DEF_ENTRY_TEXT_VARIABLE, -1, Tk_Offset(Entry, textVarName),
+ TK_CONFIG_NULL_OK, 0, 0},
+ {TK_OPTION_DOUBLE, "-to", "to", "To",
+ DEF_SPINBOX_TO, -1, Tk_Offset(Spinbox, toValue), 0, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-validate", "validate", "Validate",
+ DEF_ENTRY_VALIDATE, -1, Tk_Offset(Entry, validate),
+ 0, (ClientData) validateStrings, 0},
+ {TK_OPTION_STRING, "-validatecommand", "validateCommand", "ValidateCommand",
+ (char *) NULL, -1, Tk_Offset(Entry, validateCmd),
+ TK_CONFIG_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-values", "values", "Values",
+ DEF_SPINBOX_VALUES, -1, Tk_Offset(Spinbox, valueStr),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_SYNONYM, "-vcmd", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-validatecommand", 0},
+ {TK_OPTION_INT, "-width", "width", "Width",
+ DEF_ENTRY_WIDTH, -1, Tk_Offset(Entry, prefWidth), 0, 0, 0},
+ {TK_OPTION_BOOLEAN, "-wrap", "wrap", "Wrap",
+ DEF_SPINBOX_WRAP, -1, Tk_Offset(Spinbox, wrap), 0, 0, 0},
+ {TK_OPTION_STRING, "-xscrollcommand", "xScrollCommand", "ScrollCommand",
+ DEF_ENTRY_SCROLL_COMMAND, -1, Tk_Offset(Entry, scrollCmd),
+ TK_CONFIG_NULL_OK, 0, 0},
+ {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, 0, 0}
+};
/*
* The following tables define the entry widget commands (and sub-
@@ -353,27 +599,74 @@ static Tk_OptionSpec optionSpecs[] = {
* enumerated types used to dispatch the entry widget command.
*/
-static char *commandNames[] = {
+static CONST char *entryCmdNames[] = {
"bbox", "cget", "configure", "delete", "get", "icursor", "index",
"insert", "scan", "selection", "validate", "xview", (char *) NULL
};
-enum command {
+enum entryCmd {
COMMAND_BBOX, COMMAND_CGET, COMMAND_CONFIGURE, COMMAND_DELETE,
COMMAND_GET, COMMAND_ICURSOR, COMMAND_INDEX, COMMAND_INSERT,
COMMAND_SCAN, COMMAND_SELECTION, COMMAND_VALIDATE, COMMAND_XVIEW
};
-static char *selCommandNames[] = {
+static CONST char *selCmdNames[] = {
"adjust", "clear", "from", "present", "range", "to", (char *) NULL
};
-enum selcommand {
+enum selCmd {
SELECTION_ADJUST, SELECTION_CLEAR, SELECTION_FROM,
SELECTION_PRESENT, SELECTION_RANGE, SELECTION_TO
};
/*
+ * The following tables define the spinbox widget commands (and sub-
+ * commands) and map the indexes into the string tables into
+ * enumerated types used to dispatch the spinbox widget command.
+ */
+
+static CONST char *sbCmdNames[] = {
+ "bbox", "cget", "configure", "delete", "get", "icursor", "identify",
+ "index", "insert", "invoke", "scan", "selection", "set",
+ "validate", "xview", (char *) NULL
+};
+
+enum sbCmd {
+ SB_CMD_BBOX, SB_CMD_CGET, SB_CMD_CONFIGURE, SB_CMD_DELETE,
+ SB_CMD_GET, SB_CMD_ICURSOR, SB_CMD_IDENTIFY, SB_CMD_INDEX,
+ SB_CMD_INSERT, SB_CMD_INVOKE, SB_CMD_SCAN, SB_CMD_SELECTION,
+ SB_CMD_SET, SB_CMD_VALIDATE, SB_CMD_XVIEW
+};
+
+static CONST char *sbSelCmdNames[] = {
+ "adjust", "clear", "element", "from", "present", "range", "to",
+ (char *) NULL
+};
+
+enum sbselCmd {
+ SB_SEL_ADJUST, SB_SEL_CLEAR, SB_SEL_ELEMENT, SB_SEL_FROM,
+ SB_SEL_PRESENT, SB_SEL_RANGE, SB_SEL_TO
+};
+
+/*
+ * Extra for selection of elements
+ */
+
+static CONST char *selElementNames[] = {
+ "none", "buttondown", "buttonup", (char *) NULL, "entry"
+};
+enum selelement {
+ SEL_NONE, SEL_BUTTONDOWN, SEL_BUTTONUP, SEL_NULL, SEL_ENTRY
+};
+
+/*
+ * Flags for GetEntryIndex procedure:
+ */
+
+#define ZERO_OK 1
+#define LAST_PLUS_ONE_OK 2
+
+/*
* Forward declarations for procedures defined later in this file:
*/
@@ -399,21 +692,23 @@ static void EntryLostSelection _ANSI_ARGS_((
static void EventuallyRedraw _ANSI_ARGS_((Entry *entryPtr));
static void EntryScanTo _ANSI_ARGS_((Entry *entryPtr, int y));
static void EntrySetValue _ANSI_ARGS_((Entry *entryPtr,
- char *value));
+ CONST char *value));
static void EntrySelectTo _ANSI_ARGS_((
Entry *entryPtr, int index));
static char * EntryTextVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
static void EntryUpdateScrollbar _ANSI_ARGS_((Entry *entryPtr));
static int EntryValidate _ANSI_ARGS_((Entry *entryPtr,
char *cmd));
static int EntryValidateChange _ANSI_ARGS_((Entry *entryPtr,
- char *change, char *new, int index, int type));
+ char *change, CONST char *new, int index,
+ int type));
static void ExpandPercents _ANSI_ARGS_((Entry *entryPtr,
- char *before, char *change, char *new,
+ CONST char *before, char *change, CONST char *new,
int index, int type, Tcl_DString *dsPtr));
-static void EntryValueChanged _ANSI_ARGS_((Entry *entryPtr));
+static void EntryValueChanged _ANSI_ARGS_((Entry *entryPtr,
+ CONST char *newValue));
static void EntryVisibleRange _ANSI_ARGS_((Entry *entryPtr,
double *firstPtr, double *lastPtr));
static int EntryWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
@@ -427,14 +722,26 @@ static void InsertChars _ANSI_ARGS_((Entry *entryPtr, int index,
char *string));
/*
- * The structure below defines entry class behavior by means of procedures
+ * These forward declarations are the spinbox specific ones:
+ */
+
+static int SpinboxWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int GetSpinboxElement _ANSI_ARGS_((Spinbox *sbPtr,
+ int x, int y));
+static int SpinboxInvoke _ANSI_ARGS_((Tcl_Interp *interp,
+ Spinbox *sbPtr, int element));
+static int ComputeFormat _ANSI_ARGS_((Spinbox *sbPtr));
+
+/*
+ * The structure below defines widget class behavior by means of procedures
* that can be invoked from generic window code.
*/
-static TkClassProcs entryClass = {
- NULL, /* createProc. */
- EntryWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+static Tk_ClassProcs entryClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ EntryWorldChanged, /* worldChangedProc */
};
@@ -458,7 +765,7 @@ static TkClassProcs entryClass = {
int
Tk_EntryObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
@@ -466,25 +773,7 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
register Entry *entryPtr;
Tk_OptionTable optionTable;
Tk_Window tkwin;
-
- optionTable = (Tk_OptionTable) clientData;
- if (optionTable == NULL) {
- Tcl_CmdInfo info;
- char *name;
-
- /*
- * We haven't created the option table for this widget class
- * yet. Do it now and save the table as the clientData for
- * the command, so we'll have access to it in future
- * invocations of the command.
- */
-
- optionTable = Tk_CreateOptionTable(interp, optionSpecs);
- name = Tcl_GetString(objv[0]);
- Tcl_GetCommandInfo(interp, name, &info);
- info.objClientData = (ClientData) optionTable;
- Tcl_SetCommandInfo(interp, name, &info);
- }
+ char *tmp;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
@@ -498,12 +787,22 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
}
/*
+ * Create the option table for this widget class. If it has already
+ * been created, Tk will return the cached value.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, entryOptSpec);
+
+ /*
* Initialize the fields of the structure that won't be initialized
* by ConfigureEntry, or that ConfigureEntry requires to be
- * initialized already (e.g. resource pointers).
+ * initialized already (e.g. resource pointers). Only the non-NULL/0
+ * data must be initialized as memset covers the rest.
*/
entryPtr = (Entry *) ckalloc(sizeof(Entry));
+ memset((VOID *) entryPtr, 0, sizeof(Entry));
+
entryPtr->tkwin = tkwin;
entryPtr->display = Tk_Display(tkwin);
entryPtr->interp = interp;
@@ -511,62 +810,35 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
Tk_PathName(entryPtr->tkwin), EntryWidgetObjCmd,
(ClientData) entryPtr, EntryCmdDeletedProc);
entryPtr->optionTable = optionTable;
- entryPtr->string = (char *) ckalloc(1);
- entryPtr->string[0] = '\0';
- entryPtr->insertPos = 0;
+ entryPtr->type = TK_ENTRY;
+ tmp = (char *) ckalloc(1);
+ tmp[0] = '\0';
+ entryPtr->string = tmp;
entryPtr->selectFirst = -1;
entryPtr->selectLast = -1;
- entryPtr->selectAnchor = 0;
- entryPtr->scanMarkX = 0;
- entryPtr->scanMarkIndex = 0;
- entryPtr->normalBorder = NULL;
- entryPtr->borderWidth = 0;
entryPtr->cursor = None;
entryPtr->exportSelection = 1;
- entryPtr->tkfont = NULL;
- entryPtr->fgColorPtr = NULL;
- entryPtr->highlightBgColorPtr = NULL;
- entryPtr->highlightColorPtr = NULL;
- entryPtr->highlightWidth = 0;
- entryPtr->insertBorder = NULL;
- entryPtr->insertBorderWidth = 0;
- entryPtr->insertOffTime = 0;
- entryPtr->insertOnTime = 0;
- entryPtr->insertWidth = 0;
entryPtr->justify = TK_JUSTIFY_LEFT;
entryPtr->relief = TK_RELIEF_FLAT;
- entryPtr->selBorder = NULL;
- entryPtr->selBorderWidth = 0;
- entryPtr->selFgColorPtr = NULL;
- entryPtr->showChar = NULL;
entryPtr->state = STATE_NORMAL;
- entryPtr->textVarName = NULL;
- entryPtr->takeFocus = NULL;
- entryPtr->prefWidth = 0;
- entryPtr->scrollCmd = NULL;
- entryPtr->numBytes = 0;
- entryPtr->numChars = 0;
entryPtr->displayString = entryPtr->string;
- entryPtr->numDisplayBytes = 0;
entryPtr->inset = XPAD;
- entryPtr->textLayout = NULL;
- entryPtr->layoutX = 0;
- entryPtr->layoutY = 0;
- entryPtr->leftX = 0;
- entryPtr->leftIndex = 0;
- entryPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
entryPtr->textGC = None;
entryPtr->selTextGC = None;
entryPtr->highlightGC = None;
entryPtr->avgWidth = 1;
- entryPtr->flags = 0;
- entryPtr->validateCmd = NULL;
entryPtr->validate = VALIDATE_NONE;
- entryPtr->invalidCmd = NULL;
+
+ /*
+ * Keep a hold of the associated tkwin until we destroy the listbox,
+ * otherwise Tk might free it while we still need it.
+ */
+
+ Tcl_Preserve((ClientData) entryPtr->tkwin);
Tk_SetClass(entryPtr->tkwin, "Entry");
- TkSetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
+ Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
Tk_CreateEventHandler(entryPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
EntryEventProc, (ClientData) entryPtr);
@@ -579,7 +851,7 @@ Tk_EntryObjCmd(clientData, interp, objc, objv)
Tk_DestroyWindow(entryPtr->tkwin);
return TCL_ERROR;
}
-
+
Tcl_SetResult(interp, Tk_PathName(entryPtr->tkwin), TCL_STATIC);
return TCL_OK;
}
@@ -617,20 +889,20 @@ EntryWidgetObjCmd(clientData, interp, objc, objv)
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
return TCL_ERROR;
}
- Tcl_Preserve((ClientData) entryPtr);
/*
* Parse the widget command by looking up the second token in
* the list of valid command names.
*/
- result = Tcl_GetIndexFromObj(interp, objv[1], commandNames,
+ result = Tcl_GetIndexFromObj(interp, objv[1], entryCmdNames,
"option", 0, &cmdIndex);
if (result != TCL_OK) {
return result;
}
- switch (cmdIndex) {
+ Tcl_Preserve((ClientData) entryPtr);
+ switch ((enum entryCmd) cmdIndex) {
case COMMAND_BBOX: {
int index, x, y, width, height;
char buf[TCL_INTEGER_SPACE * 4];
@@ -717,7 +989,7 @@ EntryWidgetObjCmd(clientData, interp, objc, objv)
Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
goto error;
}
- Tcl_SetResult(interp, entryPtr->string, TCL_STATIC);
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
break;
}
@@ -799,19 +1071,27 @@ EntryWidgetObjCmd(clientData, interp, objc, objv)
int index, index2;
if (objc < 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "option ?index?");
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?index?");
goto error;
}
-
+
/*
* Parse the selection sub-command, using the command
- * table "selCommandNames" defined above.
+ * table "selCmdNames" defined above.
*/
- result = Tcl_GetIndexFromObj(interp, objv[2], selCommandNames,
- "selection option", 0, &selIndex);
+ result = Tcl_GetIndexFromObj(interp, objv[2], selCmdNames,
+ "selection option", 0, &selIndex);
if (result != TCL_OK) {
- goto error;
+ goto error;
+ }
+
+ /*
+ * Disabled entries don't allow the selection to be modified.
+ */
+
+ if (entryPtr->state == STATE_DISABLED) {
+ goto done;
}
switch(selIndex) {
@@ -1043,12 +1323,6 @@ DestroyEntry(memPtr)
char *memPtr; /* Info about entry widget. */
{
Entry *entryPtr = (Entry *) memPtr;
- entryPtr->flags |= ENTRY_DELETED;
-
- Tcl_DeleteCommandFromToken(entryPtr->interp, entryPtr->widgetCmd);
- if (entryPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayEntry, (ClientData) entryPtr);
- }
/*
* Free up all the stuff that requires special handling, then
@@ -1056,7 +1330,7 @@ DestroyEntry(memPtr)
* stuff.
*/
- ckfree(entryPtr->string);
+ ckfree((char *)entryPtr->string);
if (entryPtr->textVarName != NULL) {
Tcl_UntraceVar(entryPtr->interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
@@ -1070,12 +1344,25 @@ DestroyEntry(memPtr)
}
Tcl_DeleteTimerHandler(entryPtr->insertBlinkHandler);
if (entryPtr->displayString != entryPtr->string) {
- ckfree(entryPtr->displayString);
+ ckfree((char *)entryPtr->displayString);
+ }
+ if (entryPtr->type == TK_SPINBOX) {
+ Spinbox *sbPtr = (Spinbox *) entryPtr;
+
+ if (sbPtr->listObj != NULL) {
+ Tcl_DecrRefCount(sbPtr->listObj);
+ sbPtr->listObj = NULL;
+ }
+ if (sbPtr->formatBuf) {
+ ckfree(sbPtr->formatBuf);
+ }
}
Tk_FreeTextLayout(entryPtr->textLayout);
Tk_FreeConfigOptions((char *) entryPtr, entryPtr->optionTable,
entryPtr->tkwin);
+ Tcl_Release((ClientData) entryPtr->tkwin);
entryPtr->tkwin = NULL;
+
ckfree((char *) entryPtr);
}
@@ -1110,9 +1397,17 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
Tk_SavedOptions savedOptions;
+ Tk_3DBorder border;
Tcl_Obj *errorResult = NULL;
+ Spinbox *sbPtr = (Spinbox *) entryPtr; /* Only used when this widget
+ * is of type TK_SPINBOX */
+ char *oldValues = NULL; /* lint initialization */
+ char *oldFormat = NULL; /* lint initialization */
int error;
- int oldExport;
+ int oldExport = 0; /* lint initialization */
+ int valuesChanged = 0; /* lint initialization */
+ double oldFrom = 0.0; /* lint initialization */
+ double oldTo = 0.0; /* lint initialization */
/*
* Eliminate any existing trace on a variable monitored by the entry.
@@ -1124,7 +1419,17 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
EntryTextVarProc, (ClientData) entryPtr);
}
- oldExport = entryPtr->exportSelection;
+ /*
+ * Store old values that we need to effect certain behavior if
+ * they change value
+ */
+ oldExport = entryPtr->exportSelection;
+ if (entryPtr->type == TK_SPINBOX) {
+ oldValues = sbPtr->valueStr;
+ oldFormat = sbPtr->reqFormat;
+ oldFrom = sbPtr->fromValue;
+ oldTo = sbPtr->toValue;
+ }
for (error = 0; error <= 1; error++) {
if (!error) {
@@ -1152,7 +1457,16 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
* the geometry and setting the background from a 3-D border.
*/
- Tk_SetBackgroundFromBorder(entryPtr->tkwin, entryPtr->normalBorder);
+ if ((entryPtr->state == STATE_DISABLED) &&
+ (entryPtr->disabledBorder != NULL)) {
+ border = entryPtr->disabledBorder;
+ } else if ((entryPtr->state == STATE_READONLY) &&
+ (entryPtr->readonlyBorder != NULL)) {
+ border = entryPtr->readonlyBorder;
+ } else {
+ border = entryPtr->normalBorder;
+ }
+ Tk_SetBackgroundFromBorder(entryPtr->tkwin, border);
if (entryPtr->insertWidth <= 0) {
entryPtr->insertWidth = 2;
@@ -1161,6 +1475,80 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
entryPtr->insertBorderWidth = entryPtr->insertWidth/2;
}
+ if (entryPtr->type == TK_SPINBOX) {
+ if (sbPtr->fromValue > sbPtr->toValue) {
+ Tcl_SetResult(interp,
+ "-to value must be greater than -from value",
+ TCL_VOLATILE);
+ continue;
+ }
+
+ if (sbPtr->reqFormat && (oldFormat != sbPtr->reqFormat)) {
+ /*
+ * Make sure that the given format is somewhat correct, and
+ * calculate the minimum space we'll need for the values as
+ * strings.
+ */
+ int min, max;
+ size_t formatLen, formatSpace = TCL_DOUBLE_SPACE;
+ char fbuf[4], *fmt = sbPtr->reqFormat;
+
+ formatLen = strlen(fmt);
+ if ((fmt[0] != '%') || (fmt[formatLen-1] != 'f')) {
+ badFormatOpt:
+ Tcl_AppendResult(interp, "bad spinbox format specifier \"",
+ sbPtr->reqFormat, "\"", (char *) NULL);
+ continue;
+ }
+ if ((sscanf(fmt, "%%%d.%d%[f]", &min, &max, fbuf) == 3)
+ && (max >= 0)) {
+ formatSpace = min + max + 1;
+ } else if (((sscanf(fmt, "%%.%d%[f]", &min, fbuf) == 2)
+ || (sscanf(fmt, "%%%d%[f]", &min, fbuf) == 2)
+ || (sscanf(fmt, "%%%d.%[f]", &min, fbuf) == 2))
+ && (min >= 0)) {
+ formatSpace = min + 1;
+ } else {
+ goto badFormatOpt;
+ }
+ if (formatSpace < TCL_DOUBLE_SPACE) {
+ formatSpace = TCL_DOUBLE_SPACE;
+ }
+ sbPtr->formatBuf = ckrealloc(sbPtr->formatBuf, formatSpace);
+ /*
+ * We perturb the value of oldFrom to allow us to go into
+ * the branch below that will reformat the displayed value.
+ */
+ oldFrom = sbPtr->fromValue - 1;
+ }
+
+ /*
+ * See if we have to rearrange our listObj data
+ */
+ if (oldValues != sbPtr->valueStr) {
+ if (sbPtr->listObj != NULL) {
+ Tcl_DecrRefCount(sbPtr->listObj);
+ }
+ sbPtr->listObj = NULL;
+ if (sbPtr->valueStr != NULL) {
+ Tcl_Obj *newObjPtr;
+ int nelems;
+
+ newObjPtr = Tcl_NewStringObj(sbPtr->valueStr, -1);
+ if (Tcl_ListObjLength(interp, newObjPtr, &nelems)
+ != TCL_OK) {
+ valuesChanged = -1;
+ continue;
+ }
+ sbPtr->listObj = newObjPtr;
+ Tcl_IncrRefCount(sbPtr->listObj);
+ sbPtr->nElements = nelems;
+ sbPtr->eIndex = 0;
+ valuesChanged++;
+ }
+ }
+ }
+
/*
* Restart the cursor timing sequence in case the on-time or
* off-time just changed. Set validate temporarily to none,
@@ -1205,20 +1593,67 @@ ConfigureEntry(interp, entryPtr, objc, objv, flags)
}
/*
- * If the entry is tied to the value of a variable, then set up
- * a trace on the variable's value, create the variable if it doesn't
- * exist, and set the entry's value from the variable's value.
+ * If the entry is tied to the value of a variable, create the variable if
+ * it doesn't exist, and set the entry's value from the variable's value.
*/
if (entryPtr->textVarName != NULL) {
- char *value;
+ CONST char *value;
value = Tcl_GetVar(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY);
if (value == NULL) {
- EntryValueChanged(entryPtr);
+ EntryValueChanged(entryPtr, NULL);
} else {
EntrySetValue(entryPtr, value);
}
+ }
+
+ if (entryPtr->type == TK_SPINBOX) {
+ ComputeFormat(sbPtr);
+
+ if (valuesChanged > 0) {
+ Tcl_Obj *objPtr;
+
+ /*
+ * No check for error return, because there shouldn't be one
+ * given the check for valid list above
+ */
+ Tcl_ListObjIndex(interp, sbPtr->listObj, 0, &objPtr);
+ EntryValueChanged(entryPtr, Tcl_GetString(objPtr));
+ } else if ((sbPtr->valueStr == NULL)
+ && !DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue)
+ && (!DOUBLES_EQ(sbPtr->fromValue, oldFrom)
+ || !DOUBLES_EQ(sbPtr->toValue, oldTo))) {
+ /*
+ * If the valueStr is empty and -from && -to are specified, check
+ * to see if the current string is within the range. If not,
+ * it will be constrained to the nearest edge. If the current
+ * string isn't a double value, we set it to -from.
+ */
+ int code;
+ double dvalue;
+
+ code = Tcl_GetDouble(NULL, entryPtr->string, &dvalue);
+ if (code != TCL_OK) {
+ dvalue = sbPtr->fromValue;
+ } else {
+ if (dvalue > sbPtr->toValue) {
+ dvalue = sbPtr->toValue;
+ } else if (dvalue < sbPtr->fromValue) {
+ dvalue = sbPtr->fromValue;
+ }
+ }
+ sprintf(sbPtr->formatBuf, sbPtr->valueFormat, dvalue);
+ EntryValueChanged(entryPtr, sbPtr->formatBuf);
+ }
+ }
+
+ /*
+ * Set up a trace on the variable's value after we've possibly
+ * constrained the value according to new -from/-to values.
+ */
+
+ if (entryPtr->textVarName != NULL) {
Tcl_TraceVar(interp, entryPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
EntryTextVarProc, (ClientData) entryPtr);
@@ -1259,20 +1694,52 @@ EntryWorldChanged(instanceData)
XGCValues gcValues;
GC gc = None;
unsigned long mask;
- Entry *entryPtr;
-
- entryPtr = (Entry *) instanceData;
+ Tk_3DBorder border;
+ XColor *colorPtr;
+ Entry *entryPtr = (Entry *) instanceData;
entryPtr->avgWidth = Tk_TextWidth(entryPtr->tkfont, "0", 1);
if (entryPtr->avgWidth == 0) {
entryPtr->avgWidth = 1;
}
- if (entryPtr->normalBorder != NULL) {
- Tk_SetBackgroundFromBorder(entryPtr->tkwin, entryPtr->normalBorder);
+ if (entryPtr->type == TK_SPINBOX) {
+ /*
+ * Compute the button width for a spinbox
+ */
+
+ entryPtr->xWidth = entryPtr->avgWidth + 2 * (1+XPAD);
+ if (entryPtr->xWidth < 11) {
+ entryPtr->xWidth = 11; /* we want a min visible size */
+ }
+ }
+
+ /*
+ * Default background and foreground are from the normal state.
+ * In a disabled state, both of those may be overridden; in the readonly
+ * state, the background may be overridden.
+ */
+
+ border = entryPtr->normalBorder;
+ colorPtr = entryPtr->fgColorPtr;
+ switch (entryPtr->state) {
+ case STATE_DISABLED:
+ if (entryPtr->disabledBorder != NULL) {
+ border = entryPtr->disabledBorder;
+ }
+ if (entryPtr->dfgColorPtr != NULL) {
+ colorPtr = entryPtr->dfgColorPtr;
+ }
+ break;
+ case STATE_READONLY:
+ if (entryPtr->readonlyBorder != NULL) {
+ border = entryPtr->readonlyBorder;
+ }
+ break;
}
- gcValues.foreground = entryPtr->fgColorPtr->pixel;
+ Tk_SetBackgroundFromBorder(entryPtr->tkwin, border);
+ gcValues.foreground = colorPtr->pixel;
gcValues.font = Tk_FontId(entryPtr->tkfont);
gcValues.graphics_exposures = False;
mask = GCForeground | GCFont | GCGraphicsExposures;
@@ -1324,13 +1791,13 @@ DisplayEntry(clientData)
Entry *entryPtr = (Entry *) clientData;
Tk_Window tkwin = entryPtr->tkwin;
int baseY, selStartX, selEndX, cursorX;
- int xBound;
+ int showSelection, xBound;
Tk_FontMetrics fm;
Pixmap pixmap;
- int showSelection;
+ Tk_3DBorder border;
entryPtr->flags &= ~REDRAW_PENDING;
- if ((entryPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ if ((entryPtr->flags & ENTRY_DELETED) || !Tk_IsMapped(tkwin)) {
return;
}
@@ -1342,7 +1809,20 @@ DisplayEntry(clientData)
if (entryPtr->flags & UPDATE_SCROLLBAR) {
entryPtr->flags &= ~UPDATE_SCROLLBAR;
+
+ /*
+ * Preserve/Release because updating the scrollbar can have
+ * the side-effect of destroying or unmapping the entry widget.
+ */
+
+ Tcl_Preserve((ClientData) entryPtr);
EntryUpdateScrollbar(entryPtr);
+
+ if ((entryPtr->flags & ENTRY_DELETED) || !Tk_IsMapped(tkwin)) {
+ Tcl_Release((ClientData) entryPtr);
+ return;
+ }
+ Tcl_Release((ClientData) entryPtr);
}
/*
@@ -1360,7 +1840,7 @@ DisplayEntry(clientData)
* one, plus vertical position of baseline of text.
*/
- xBound = Tk_Width(tkwin) - entryPtr->inset;
+ xBound = Tk_Width(tkwin) - entryPtr->inset - entryPtr->xWidth;
baseY = (Tk_Height(tkwin) + fm.ascent - fm.descent) / 2;
/*
@@ -1380,10 +1860,19 @@ DisplayEntry(clientData)
* insertion cursor background.
*/
- Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->normalBorder,
- 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+ if ((entryPtr->state == STATE_DISABLED) &&
+ (entryPtr->disabledBorder != NULL)) {
+ border = entryPtr->disabledBorder;
+ } else if ((entryPtr->state == STATE_READONLY) &&
+ (entryPtr->readonlyBorder != NULL)) {
+ border = entryPtr->readonlyBorder;
+ } else {
+ border = entryPtr->normalBorder;
+ }
+ Tk_Fill3DRectangle(tkwin, pixmap, border,
+ 0, 0, Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
- if (showSelection
+ if (showSelection && (entryPtr->state != STATE_DISABLED)
&& (entryPtr->selectLast > entryPtr->leftIndex)) {
if (entryPtr->selectFirst <= entryPtr->leftIndex) {
selStartX = entryPtr->leftX;
@@ -1414,23 +1903,26 @@ DisplayEntry(clientData)
* cursor isn't on. Otherwise the selection would hide the cursor.
*/
- if ((entryPtr->insertPos >= entryPtr->leftIndex)
- && (entryPtr->state == STATE_NORMAL)
- && (entryPtr->flags & GOT_FOCUS)) {
+ if ((entryPtr->state == STATE_NORMAL) && (entryPtr->flags & GOT_FOCUS)) {
Tk_CharBbox(entryPtr->textLayout, entryPtr->insertPos, &cursorX, NULL,
NULL, NULL);
cursorX += entryPtr->layoutX;
cursorX -= (entryPtr->insertWidth)/2;
- if (cursorX < xBound) {
- if (entryPtr->flags & CURSOR_ON) {
- Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->insertBorder,
- cursorX, baseY - fm.ascent, entryPtr->insertWidth,
- fm.ascent + fm.descent, entryPtr->insertBorderWidth,
- TK_RELIEF_RAISED);
- } else if (entryPtr->insertBorder == entryPtr->selBorder) {
- Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->normalBorder,
- cursorX, baseY - fm.ascent, entryPtr->insertWidth,
- fm.ascent + fm.descent, 0, TK_RELIEF_FLAT);
+ Tk_SetCaretPos(entryPtr->tkwin, cursorX, baseY - fm.ascent,
+ fm.ascent + fm.descent);
+ if (entryPtr->insertPos >= entryPtr->leftIndex) {
+ if (cursorX < xBound) {
+ if (entryPtr->flags & CURSOR_ON) {
+ Tk_Fill3DRectangle(tkwin, pixmap, entryPtr->insertBorder,
+ cursorX, baseY - fm.ascent, entryPtr->insertWidth,
+ fm.ascent + fm.descent,
+ entryPtr->insertBorderWidth,
+ TK_RELIEF_RAISED);
+ } else if (entryPtr->insertBorder == entryPtr->selBorder) {
+ Tk_Fill3DRectangle(tkwin, pixmap, border,
+ cursorX, baseY - fm.ascent, entryPtr->insertWidth,
+ fm.ascent + fm.descent, 0, TK_RELIEF_FLAT);
+ }
}
}
}
@@ -1444,7 +1936,7 @@ DisplayEntry(clientData)
entryPtr->textLayout, entryPtr->layoutX, entryPtr->layoutY,
entryPtr->leftIndex, entryPtr->numChars);
- if (showSelection
+ if (showSelection && (entryPtr->state != STATE_DISABLED)
&& (entryPtr->selTextGC != entryPtr->textGC)
&& (entryPtr->selectFirst < entryPtr->selectLast)) {
int selFirst;
@@ -1459,29 +1951,106 @@ DisplayEntry(clientData)
selFirst, entryPtr->selectLast);
}
+ if (entryPtr->type == TK_SPINBOX) {
+ int startx, height, inset, pad, tHeight, xWidth;
+ Spinbox *sbPtr = (Spinbox *) entryPtr;
+
+ /*
+ * Draw the spin button controls.
+ */
+ xWidth = entryPtr->xWidth;
+ pad = XPAD + 1;
+ inset = entryPtr->inset - XPAD;
+ startx = Tk_Width(tkwin) - (xWidth + inset);
+ height = (Tk_Height(tkwin) - 2*inset)/2;
+#if 0
+ Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
+ startx, inset, xWidth, height, 1, sbPtr->buRelief);
+ Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
+ startx, inset+height, xWidth, height, 1, sbPtr->bdRelief);
+#else
+ Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
+ startx, inset, xWidth, height, 1,
+ (sbPtr->selElement == SEL_BUTTONUP) ?
+ TK_RELIEF_SUNKEN : TK_RELIEF_RAISED);
+ Tk_Fill3DRectangle(tkwin, pixmap, sbPtr->buttonBorder,
+ startx, inset+height, xWidth, height, 1,
+ (sbPtr->selElement == SEL_BUTTONDOWN) ?
+ TK_RELIEF_SUNKEN : TK_RELIEF_RAISED);
+#endif
+
+ xWidth -= 2*pad;
+ /*
+ * Only draw the triangles if we have enough display space
+ */
+ if ((xWidth > 1)) {
+ XPoint points[3];
+ int starty, space, offset;
+
+ space = height - 2*pad;
+ /*
+ * Ensure width of triangle is odd to guarantee a sharp tip
+ */
+ if (!(xWidth % 2)) {
+ xWidth++;
+ }
+ tHeight = (xWidth + 1) / 2;
+ if (tHeight > space) {
+ tHeight = space;
+ }
+ space = (space - tHeight) / 2;
+ startx += pad;
+ starty = inset + height - pad - space;
+ offset = (sbPtr->selElement == SEL_BUTTONUP);
+ /*
+ * The points are slightly different for the up and down arrows
+ * because (for *.x), we need to account for a bug in the way
+ * XFillPolygon draws triangles, and we want to shift
+ * the arrows differently when allowing for depressed behavior.
+ */
+ points[0].x = startx + offset;
+ points[0].y = starty + (offset ? 0 : -1);
+ points[1].x = startx + xWidth/2 + offset;
+ points[1].y = starty - tHeight + (offset ? 0 : -1);
+ points[2].x = startx + xWidth + offset;
+ points[2].y = points[0].y;
+ XFillPolygon(entryPtr->display, pixmap, entryPtr->textGC,
+ points, 3, Convex, CoordModeOrigin);
+
+ starty = inset + height + pad + space;
+ offset = (sbPtr->selElement == SEL_BUTTONDOWN);
+ points[0].x = startx + 1 + offset;
+ points[0].y = starty + (offset ? 1 : 0);
+ points[1].x = startx + xWidth/2 + offset;
+ points[1].y = starty + tHeight + (offset ? 0 : -1);
+ points[2].x = startx - 1 + xWidth + offset;
+ points[2].y = points[0].y;
+ XFillPolygon(entryPtr->display, pixmap, entryPtr->textGC,
+ points, 3, Convex, CoordModeOrigin);
+ }
+ }
+
/*
* Draw the border and focus highlight last, so they will overwrite
* any text that extends past the viewable part of the window.
*/
+ xBound = entryPtr->highlightWidth;
if (entryPtr->relief != TK_RELIEF_FLAT) {
- Tk_Draw3DRectangle(tkwin, pixmap, entryPtr->normalBorder,
- entryPtr->highlightWidth, entryPtr->highlightWidth,
- Tk_Width(tkwin) - 2 * entryPtr->highlightWidth,
- Tk_Height(tkwin) - 2 * entryPtr->highlightWidth,
+ Tk_Draw3DRectangle(tkwin, pixmap, border, xBound, xBound,
+ Tk_Width(tkwin) - 2 * xBound,
+ Tk_Height(tkwin) - 2 * xBound,
entryPtr->borderWidth, entryPtr->relief);
}
- if (entryPtr->highlightWidth != 0) {
+ if (xBound > 0) {
GC fgGC, bgGC;
bgGC = Tk_GCForColor(entryPtr->highlightBgColorPtr, pixmap);
if (entryPtr->flags & GOT_FOCUS) {
fgGC = Tk_GCForColor(entryPtr->highlightColorPtr, pixmap);
- TkpDrawHighlightBorder(tkwin, fgGC, bgGC,
- entryPtr->highlightWidth, pixmap);
+ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, xBound, pixmap);
} else {
- TkpDrawHighlightBorder(tkwin, bgGC, bgGC,
- entryPtr->highlightWidth, pixmap);
+ TkpDrawHighlightBorder(tkwin, bgGC, bgGC, xBound, pixmap);
}
}
@@ -1527,7 +2096,7 @@ EntryComputeGeometry(entryPtr)
char *p;
if (entryPtr->displayString != entryPtr->string) {
- ckfree(entryPtr->displayString);
+ ckfree((char *)entryPtr->displayString);
entryPtr->displayString = entryPtr->string;
entryPtr->numDisplayBytes = entryPtr->numBytes;
}
@@ -1553,15 +2122,15 @@ EntryComputeGeometry(entryPtr)
size = Tcl_UniCharToUtf(ch, buf);
entryPtr->numDisplayBytes = entryPtr->numChars * size;
- entryPtr->displayString =
- (char *) ckalloc((unsigned) (entryPtr->numDisplayBytes + 1));
+ p = (char *) ckalloc((unsigned) (entryPtr->numDisplayBytes + 1));
+ entryPtr->displayString = p;
- p = entryPtr->displayString;
for (i = entryPtr->numChars; --i >= 0; ) {
p += Tcl_UniCharToUtf(ch, p);
}
*p = '\0';
}
+
Tk_FreeTextLayout(entryPtr->textLayout);
entryPtr->textLayout = Tk_ComputeTextLayout(entryPtr->tkfont,
entryPtr->displayString, entryPtr->numChars, 0,
@@ -1576,16 +2145,18 @@ EntryComputeGeometry(entryPtr)
* window unless the entire window is full.
*/
- overflow = totalLength - (Tk_Width(entryPtr->tkwin) - 2*entryPtr->inset);
+ overflow = totalLength -
+ (Tk_Width(entryPtr->tkwin) - 2*entryPtr->inset - entryPtr->xWidth);
if (overflow <= 0) {
entryPtr->leftIndex = 0;
if (entryPtr->justify == TK_JUSTIFY_LEFT) {
entryPtr->leftX = entryPtr->inset;
} else if (entryPtr->justify == TK_JUSTIFY_RIGHT) {
entryPtr->leftX = Tk_Width(entryPtr->tkwin) - entryPtr->inset
- - totalLength;
+ - entryPtr->xWidth - totalLength;
} else {
- entryPtr->leftX = (Tk_Width(entryPtr->tkwin) - totalLength)/2;
+ entryPtr->leftX = (Tk_Width(entryPtr->tkwin)
+ - entryPtr->xWidth - totalLength)/2;
}
entryPtr->layoutX = entryPtr->leftX;
} else {
@@ -1622,6 +2193,12 @@ EntryComputeGeometry(entryPtr)
width = totalLength + 2*entryPtr->inset;
}
}
+
+ /*
+ * Add one extra length for the spin buttons
+ */
+ width += entryPtr->xWidth;
+
Tk_GeometryRequest(entryPtr->tkwin, width, height);
}
@@ -1651,7 +2228,8 @@ InsertChars(entryPtr, index, value)
* string). */
{
int byteIndex, byteCount, oldChars, charsAdded, newByteCount;
- char *new, *string;
+ CONST char *string;
+ char *new;
string = entryPtr->string;
byteIndex = Tcl_UtfAtIndex(string, index) - string;
@@ -1674,7 +2252,7 @@ InsertChars(entryPtr, index, value)
return;
}
- ckfree(string);
+ ckfree((char *)string);
entryPtr->string = new;
/*
@@ -1721,7 +2299,7 @@ InsertChars(entryPtr, index, value)
if (entryPtr->insertPos >= index) {
entryPtr->insertPos += charsAdded;
}
- EntryValueChanged(entryPtr);
+ EntryValueChanged(entryPtr, NULL);
}
/*
@@ -1748,7 +2326,8 @@ DeleteChars(entryPtr, index, count)
int count; /* How many characters to delete. */
{
int byteIndex, byteCount, newByteCount;
- char *new, *string, *todelete;
+ CONST char *string;
+ char *new, *todelete;
if ((index + count) > entryPtr->numChars) {
count = entryPtr->numChars - index;
@@ -1780,7 +2359,7 @@ DeleteChars(entryPtr, index, count)
}
ckfree(todelete);
- ckfree(entryPtr->string);
+ ckfree((char *)entryPtr->string);
entryPtr->string = new;
entryPtr->numChars -= count;
entryPtr->numBytes -= byteCount;
@@ -1835,7 +2414,7 @@ DeleteChars(entryPtr, index, count)
entryPtr->insertPos = index;
}
}
- EntryValueChanged(entryPtr);
+ EntryValueChanged(entryPtr, NULL);
}
/*
@@ -1858,10 +2437,14 @@ DeleteChars(entryPtr, index, count)
*/
static void
-EntryValueChanged(entryPtr)
+EntryValueChanged(entryPtr, newValue)
Entry *entryPtr; /* Entry whose value just changed. */
+ CONST char *newValue; /* If this value is not NULL, we first
+ * force the value of the entry to this */
{
- char *newValue;
+ if (newValue != NULL) {
+ EntrySetValue(entryPtr, newValue);
+ }
if (entryPtr->textVarName == NULL) {
newValue = NULL;
@@ -1916,9 +2499,9 @@ EntryValueChanged(entryPtr)
static void
EntrySetValue(entryPtr, value)
Entry *entryPtr; /* Entry whose value is to be changed. */
- char *value; /* New text to display in entry. */
+ CONST char *value; /* New text to display in entry. */
{
- char *oldSource;
+ CONST char *oldSource;
int code, valueLen, malloced = 0;
if (strcmp(value, entryPtr->string) == 0) {
@@ -1934,9 +2517,9 @@ EntrySetValue(entryPtr, value)
* point to volatile memory, like the value of the -textvar
* which may get freed during validation
*/
- oldSource = (char *) ckalloc((unsigned) (valueLen + 1));
- strcpy(oldSource, value);
- value = oldSource;
+ char *tmp = (char *) ckalloc((unsigned) (valueLen + 1));
+ strcpy(tmp, value);
+ value = tmp;
malloced = 1;
entryPtr->flags |= VALIDATE_VAR;
@@ -1949,19 +2532,20 @@ EntrySetValue(entryPtr, value)
*/
if (entryPtr->flags & VALIDATE_ABORT) {
entryPtr->flags &= ~VALIDATE_ABORT;
- ckfree(value);
+ ckfree((char *)value);
return;
}
}
oldSource = entryPtr->string;
- ckfree(entryPtr->string);
+ ckfree((char *)entryPtr->string);
if (malloced) {
entryPtr->string = value;
} else {
- entryPtr->string = (char *) ckalloc((unsigned) (valueLen + 1));
- strcpy(entryPtr->string, value);
+ char *tmp = (char *) ckalloc((unsigned) (valueLen + 1));
+ strcpy(tmp, value);
+ entryPtr->string = tmp;
}
entryPtr->numBytes = valueLen;
entryPtr->numChars = Tcl_NumUtfChars(value, valueLen);
@@ -2001,7 +2585,7 @@ EntrySetValue(entryPtr, value)
* EntryEventProc --
*
* This procedure is invoked by the Tk dispatcher for various
- * events on entryes.
+ * events on entries.
*
* Results:
* None.
@@ -2019,25 +2603,62 @@ EntryEventProc(clientData, eventPtr)
XEvent *eventPtr; /* Information about event. */
{
Entry *entryPtr = (Entry *) clientData;
- if (eventPtr->type == Expose) {
- EventuallyRedraw(entryPtr);
- entryPtr->flags |= BORDER_NEEDED;
- } else if (eventPtr->type == DestroyNotify) {
- DestroyEntry((char *) clientData);
- } else if (eventPtr->type == ConfigureNotify) {
- Tcl_Preserve((ClientData) entryPtr);
- entryPtr->flags |= UPDATE_SCROLLBAR;
- EntryComputeGeometry(entryPtr);
- EventuallyRedraw(entryPtr);
- Tcl_Release((ClientData) entryPtr);
- } else if (eventPtr->type == FocusIn) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- EntryFocusProc(entryPtr, 1);
- }
- } else if (eventPtr->type == FocusOut) {
- if (eventPtr->xfocus.detail != NotifyInferior) {
- EntryFocusProc(entryPtr, 0);
+
+ if ((entryPtr->type == TK_SPINBOX) && (eventPtr->type == MotionNotify)) {
+ Spinbox *sbPtr = (Spinbox *) clientData;
+ int elem;
+
+ elem = GetSpinboxElement(sbPtr, eventPtr->xmotion.x,
+ eventPtr->xmotion.y);
+ if (elem != sbPtr->curElement) {
+ Tk_Cursor cursor;
+
+ sbPtr->curElement = elem;
+ if (elem == SEL_ENTRY) {
+ cursor = entryPtr->cursor;
+ } else if ((elem == SEL_BUTTONDOWN) || (elem == SEL_BUTTONUP)) {
+ cursor = sbPtr->bCursor;
+ } else {
+ cursor = None;
+ }
+ if (cursor != None) {
+ Tk_DefineCursor(entryPtr->tkwin, cursor);
+ } else {
+ Tk_UndefineCursor(entryPtr->tkwin);
+ }
}
+ return;
+ }
+
+ switch (eventPtr->type) {
+ case Expose:
+ EventuallyRedraw(entryPtr);
+ entryPtr->flags |= BORDER_NEEDED;
+ break;
+ case DestroyNotify:
+ if (!(entryPtr->flags & ENTRY_DELETED)) {
+ entryPtr->flags |= (ENTRY_DELETED | VALIDATE_ABORT);
+ Tcl_DeleteCommandFromToken(entryPtr->interp,
+ entryPtr->widgetCmd);
+ if (entryPtr->flags & REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DisplayEntry, clientData);
+ }
+ Tcl_EventuallyFree(clientData, DestroyEntry);
+ }
+ break;
+ case ConfigureNotify:
+ Tcl_Preserve((ClientData) entryPtr);
+ entryPtr->flags |= UPDATE_SCROLLBAR;
+ EntryComputeGeometry(entryPtr);
+ EventuallyRedraw(entryPtr);
+ Tcl_Release((ClientData) entryPtr);
+ break;
+ case FocusIn:
+ case FocusOut:
+ if (eventPtr->xfocus.detail != NotifyInferior) {
+ EntryFocusProc(entryPtr, (eventPtr->type == FocusIn));
+ }
+ break;
}
}
@@ -2123,8 +2744,9 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
*/
Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
- Tcl_AppendResult(interp, "bad entry index \"", string,
- "\"", (char *) NULL);
+ Tcl_AppendResult(interp, "bad ",
+ (entryPtr->type == TK_ENTRY) ? "entry" : "spinbox",
+ " index \"", string, "\"", (char *) NULL);
return TCL_ERROR;
}
} else if (string[0] == 'e') {
@@ -2141,7 +2763,9 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
}
} else if (string[0] == 's') {
if (entryPtr->selectFirst < 0) {
- Tcl_SetResult(interp, "selection isn't in entry", TCL_STATIC);
+ Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
+ Tcl_AppendResult(interp, "selection isn't in widget ",
+ Tk_PathName(entryPtr->tkwin), (char *) NULL);
return TCL_ERROR;
}
if (length < 5) {
@@ -2155,7 +2779,7 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
goto badIndex;
}
} else if (string[0] == '@') {
- int x, roundUp;
+ int x, roundUp, maxWidth;
if (Tcl_GetInt(interp, string + 1, &x) != TCL_OK) {
goto badIndex;
@@ -2164,8 +2788,10 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
x = entryPtr->inset;
}
roundUp = 0;
- if (x >= (Tk_Width(entryPtr->tkwin) - entryPtr->inset)) {
- x = Tk_Width(entryPtr->tkwin) - entryPtr->inset - 1;
+ maxWidth = Tk_Width(entryPtr->tkwin) - entryPtr->inset
+ - entryPtr->xWidth - 1;
+ if (x > maxWidth) {
+ x = maxWidth;
roundUp = 1;
}
*indexPtr = Tk_PointToChar(entryPtr->textLayout,
@@ -2191,8 +2817,6 @@ GetEntryIndex(interp, entryPtr, string, indexPtr)
*indexPtr = entryPtr->numChars;
}
}
- if(*indexPtr > entryPtr->numChars)
- *indexPtr = entryPtr->numChars;
return TCL_OK;
}
@@ -2348,7 +2972,8 @@ EntryFetchSelection(clientData, offset, buffer, maxBytes)
{
Entry *entryPtr = (Entry *) clientData;
int byteCount;
- char *string, *selStart, *selEnd;
+ CONST char *string;
+ CONST char *selStart, *selEnd;
if ((entryPtr->selectFirst < 0) || !(entryPtr->exportSelection)) {
return -1;
@@ -2433,7 +3058,7 @@ static void
EventuallyRedraw(entryPtr)
Entry *entryPtr; /* Information about widget. */
{
- if ((entryPtr->tkwin == NULL) || !Tk_IsMapped(entryPtr->tkwin)) {
+ if ((entryPtr->flags & ENTRY_DELETED) || !Tk_IsMapped(entryPtr->tkwin)) {
return;
}
@@ -2484,7 +3109,7 @@ EntryVisibleRange(entryPtr, firstPtr, lastPtr)
} else {
charsInWindow = Tk_PointToChar(entryPtr->textLayout,
Tk_Width(entryPtr->tkwin) - entryPtr->inset
- - entryPtr->layoutX - 1, 0);
+ - entryPtr->xWidth - entryPtr->layoutX - 1, 0);
if (charsInWindow < entryPtr->numChars) {
charsInWindow++;
}
@@ -2539,7 +3164,9 @@ EntryUpdateScrollbar(entryPtr)
code = Tcl_VarEval(interp, entryPtr->scrollCmd, args, (char *) NULL);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
- "\n (horizontal scrolling command executed by entry)");
+ "\n (horizontal scrolling command executed by ");
+ Tcl_AddErrorInfo(interp, Tk_PathName(entryPtr->tkwin));
+ Tcl_AddErrorInfo(interp, ")");
Tcl_BackgroundError(interp);
}
Tcl_SetResult(interp, (char *) NULL, TCL_STATIC);
@@ -2571,17 +3198,18 @@ EntryBlinkProc(clientData)
Entry *entryPtr = (Entry *) clientData;
if ((entryPtr->state == STATE_DISABLED) ||
+ (entryPtr->state == STATE_READONLY) ||
!(entryPtr->flags & GOT_FOCUS) || (entryPtr->insertOffTime == 0)) {
return;
}
if (entryPtr->flags & CURSOR_ON) {
entryPtr->flags &= ~CURSOR_ON;
entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- entryPtr->insertOffTime, EntryBlinkProc, (ClientData) entryPtr);
+ entryPtr->insertOffTime, EntryBlinkProc, (ClientData) entryPtr);
} else {
entryPtr->flags |= CURSOR_ON;
entryPtr->insertBlinkHandler = Tcl_CreateTimerHandler(
- entryPtr->insertOnTime, EntryBlinkProc, (ClientData) entryPtr);
+ entryPtr->insertOnTime, EntryBlinkProc, (ClientData) entryPtr);
}
EventuallyRedraw(entryPtr);
}
@@ -2660,12 +3288,12 @@ static char *
EntryTextVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about button. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Not used. */
- char *name2; /* Not used. */
+ CONST char *name1; /* Not used. */
+ CONST char *name2; /* Not used. */
int flags; /* Information about what happened. */
{
Entry *entryPtr = (Entry *) clientData;
- char *value;
+ CONST char *value;
/*
* If the variable is unset, then immediately recreate it unless
@@ -2729,13 +3357,21 @@ EntryValidate(entryPtr, cmd)
code = Tcl_EvalEx(interp, cmd, -1, TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);
+ /*
+ * We accept TCL_OK and TCL_RETURN as valid return codes from the
+ * command callback.
+ */
if (code != TCL_OK && code != TCL_RETURN) {
- Tcl_AddErrorInfo(interp,
- "\n\t(in validation command executed by entry)");
+ Tcl_AddErrorInfo(interp, "\n\t(in validation command executed by ");
+ Tcl_AddErrorInfo(interp, Tk_PathName(entryPtr->tkwin));
+ Tcl_AddErrorInfo(interp, ")");
Tcl_BackgroundError(interp);
return TCL_ERROR;
}
+ /*
+ * The command callback should return an acceptable Tcl boolean.
+ */
if (Tcl_GetBooleanFromObj(interp, Tcl_GetObjResult(interp),
&bool) != TCL_OK) {
Tcl_AddErrorInfo(interp,
@@ -2774,7 +3410,7 @@ EntryValidateChange(entryPtr, change, new, index, type)
register Entry *entryPtr; /* Entry that needs validation. */
char *change; /* Characters to be added/deleted
* (NULL-terminated string). */
- char *new; /* Potential new value of entry string */
+ CONST char *new; /* Potential new value of entry string */
int index; /* index of insert/delete, -1 otherwise */
int type; /* forced, delete, insert,
* focusin or focusout */
@@ -2819,15 +3455,27 @@ EntryValidateChange(entryPtr, change, new, index, type)
* it means that a loop condition almost occured. Do not allow
* this validation result to finish.
*/
+
if (entryPtr->validate == VALIDATE_NONE
|| (!varValidate && (entryPtr->flags & VALIDATE_VAR))) {
code = TCL_ERROR;
}
+
+ /*
+ * It's possible that the user deleted the entry during validation.
+ * In that case, abort future validation and return an error.
+ */
+
+ if (entryPtr->flags & ENTRY_DELETED) {
+ return TCL_ERROR;
+ }
+
/*
* If validate will return ERROR, then disallow further validations
* Otherwise, if it didn't accept the new string (returned TCL_BREAK)
* then eval the invalidCmd (if it's set)
*/
+
if (code == TCL_ERROR) {
entryPtr->validate = VALIDATE_NONE;
} else if (code == TCL_BREAK) {
@@ -2839,6 +3487,7 @@ EntryValidateChange(entryPtr, change, new, index, type)
* may want to do entry manipulation which the setting of the
* var will later wipe anyway.
*/
+
if (varValidate) {
entryPtr->validate = VALIDATE_NONE;
} else if (entryPtr->invalidCmd != NULL) {
@@ -2856,6 +3505,15 @@ EntryValidateChange(entryPtr, change, new, index, type)
entryPtr->validate = VALIDATE_NONE;
}
Tcl_DStringFree(&script);
+
+ /*
+ * It's possible that the user deleted the entry during validation.
+ * In that case, abort future validation and return an error.
+ */
+
+ if (entryPtr->flags & ENTRY_DELETED) {
+ return TCL_ERROR;
+ }
}
}
@@ -2886,11 +3544,12 @@ EntryValidateChange(entryPtr, change, new, index, type)
static void
ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
register Entry *entryPtr; /* Entry that needs validation. */
- register char *before; /* Command containing percent
+ register CONST char *before;
+ /* Command containing percent
* expressions to be replaced. */
char *change; /* Characters to added/deleted
* (NULL-terminated string). */
- char *new; /* Potential new value of entry string */
+ CONST char *new; /* Potential new value of entry string */
int index; /* index of insert/delete */
int type; /* INSERT or DELETE */
Tcl_DString *dsPtr; /* Dynamic string in which to append
@@ -2899,7 +3558,7 @@ ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
int spaceNeeded, cvtFlags; /* Used to substitute string as proper Tcl
* list element. */
int number, length;
- register char *string;
+ register CONST char *string;
Tcl_UniChar ch;
char numStorage[2*TCL_INTEGER_SPACE];
@@ -2933,69 +3592,1029 @@ ExpandPercents(entryPtr, before, change, new, index, type, dsPtr)
} else {
ch = '%';
}
- switch (ch) {
- case 'd': /* Type of call that caused validation */
- switch (type) {
- case VALIDATE_INSERT:
- number = 1;
- break;
- case VALIDATE_DELETE:
- number = 0;
- break;
- default:
- number = -1;
- break;
- }
- sprintf(numStorage, "%d", number);
- string = numStorage;
+ if (type == VALIDATE_BUTTON) {
+ /*
+ * -command %-substitution
+ */
+ switch (ch) {
+ case 's': /* Current string value of spinbox */
+ string = entryPtr->string;
+ break;
+ case 'd': /* direction, up or down */
+ string = change;
+ break;
+ case 'W': /* widget name */
+ string = Tk_PathName(entryPtr->tkwin);
+ break;
+ default:
+ length = Tcl_UniCharToUtf(ch, numStorage);
+ numStorage[length] = '\0';
+ string = numStorage;
+ break;
+ }
+ } else {
+ /*
+ * -validatecommand / -invalidcommand %-substitution
+ */
+ switch (ch) {
+ case 'd': /* Type of call that caused validation */
+ switch (type) {
+ case VALIDATE_INSERT:
+ number = 1;
+ break;
+ case VALIDATE_DELETE:
+ number = 0;
+ break;
+ default:
+ number = -1;
+ break;
+ }
+ sprintf(numStorage, "%d", number);
+ string = numStorage;
+ break;
+ case 'i': /* index of insert/delete */
+ sprintf(numStorage, "%d", index);
+ string = numStorage;
+ break;
+ case 'P': /* 'Peeked' new value of the string */
+ string = new;
+ break;
+ case 's': /* Current string value of spinbox */
+ string = entryPtr->string;
+ break;
+ case 'S': /* string to be inserted/deleted, if any */
+ string = change;
+ break;
+ case 'v': /* type of validation currently set */
+ string = validateStrings[entryPtr->validate];
+ break;
+ case 'V': /* type of validation in effect */
+ switch (type) {
+ case VALIDATE_INSERT:
+ case VALIDATE_DELETE:
+ string = validateStrings[VALIDATE_KEY];
+ break;
+ case VALIDATE_FORCED:
+ string = "forced";
+ break;
+ default:
+ string = validateStrings[type];
+ break;
+ }
+ break;
+ case 'W': /* widget name */
+ string = Tk_PathName(entryPtr->tkwin);
+ break;
+ default:
+ length = Tcl_UniCharToUtf(ch, numStorage);
+ numStorage[length] = '\0';
+ string = numStorage;
+ break;
+ }
+ }
+
+ spaceNeeded = Tcl_ScanCountedElement(string, -1, &cvtFlags);
+ length = Tcl_DStringLength(dsPtr);
+ Tcl_DStringSetLength(dsPtr, length + spaceNeeded);
+ spaceNeeded = Tcl_ConvertCountedElement(string, -1,
+ Tcl_DStringValue(dsPtr) + length,
+ cvtFlags | TCL_DONT_USE_BRACES);
+ Tcl_DStringSetLength(dsPtr, length + spaceNeeded);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * Tk_SpinboxObjCmd --
+ *
+ * This procedure is invoked to process the "spinbox" Tcl
+ * command. See the user documentation for details on what
+ * it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+Tk_SpinboxObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* NULL. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register Entry *entryPtr;
+ register Spinbox *sbPtr;
+ Tk_OptionTable optionTable;
+ Tk_Window tkwin;
+ char *tmp;
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ return TCL_ERROR;
+ }
+
+ tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
+ Tcl_GetString(objv[1]), (char *) NULL);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * Create the option table for this widget class. If it has already
+ * been created, Tk will return the cached value.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, sbOptSpec);
+
+ /*
+ * Initialize the fields of the structure that won't be initialized
+ * by ConfigureEntry, or that ConfigureEntry requires to be
+ * initialized already (e.g. resource pointers). Only the non-NULL/0
+ * data must be initialized as memset covers the rest.
+ */
+
+ sbPtr = (Spinbox *) ckalloc(sizeof(Spinbox));
+ entryPtr = (Entry *) sbPtr;
+ memset((VOID *) sbPtr, 0, sizeof(Spinbox));
+
+ entryPtr->tkwin = tkwin;
+ entryPtr->display = Tk_Display(tkwin);
+ entryPtr->interp = interp;
+ entryPtr->widgetCmd = Tcl_CreateObjCommand(interp,
+ Tk_PathName(entryPtr->tkwin), SpinboxWidgetObjCmd,
+ (ClientData) sbPtr, EntryCmdDeletedProc);
+ entryPtr->optionTable = optionTable;
+ entryPtr->type = TK_SPINBOX;
+ tmp = (char *) ckalloc(1);
+ tmp[0] = '\0';
+ entryPtr->string = tmp;
+ entryPtr->selectFirst = -1;
+ entryPtr->selectLast = -1;
+
+ entryPtr->cursor = None;
+ entryPtr->exportSelection = 1;
+ entryPtr->justify = TK_JUSTIFY_LEFT;
+ entryPtr->relief = TK_RELIEF_FLAT;
+ entryPtr->state = STATE_NORMAL;
+ entryPtr->displayString = entryPtr->string;
+ entryPtr->inset = XPAD;
+ entryPtr->textGC = None;
+ entryPtr->selTextGC = None;
+ entryPtr->highlightGC = None;
+ entryPtr->avgWidth = 1;
+ entryPtr->validate = VALIDATE_NONE;
+
+ sbPtr->selElement = SEL_NONE;
+ sbPtr->curElement = SEL_NONE;
+ sbPtr->bCursor = None;
+ sbPtr->repeatDelay = 400;
+ sbPtr->repeatInterval = 100;
+ sbPtr->fromValue = 0.0;
+ sbPtr->toValue = 100.0;
+ sbPtr->increment = 1.0;
+ sbPtr->formatBuf = (char *) ckalloc(TCL_DOUBLE_SPACE);
+ sbPtr->bdRelief = TK_RELIEF_FLAT;
+ sbPtr->buRelief = TK_RELIEF_FLAT;
+
+ /*
+ * Keep a hold of the associated tkwin until we destroy the listbox,
+ * otherwise Tk might free it while we still need it.
+ */
+
+ Tcl_Preserve((ClientData) entryPtr->tkwin);
+
+ Tk_SetClass(entryPtr->tkwin, "Spinbox");
+ Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
+ Tk_CreateEventHandler(entryPtr->tkwin,
+ PointerMotionMask|ExposureMask|StructureNotifyMask|FocusChangeMask,
+ EntryEventProc, (ClientData) entryPtr);
+ Tk_CreateSelHandler(entryPtr->tkwin, XA_PRIMARY, XA_STRING,
+ EntryFetchSelection, (ClientData) entryPtr, XA_STRING);
+
+ if (Tk_InitOptions(interp, (char *) sbPtr, optionTable, tkwin)
+ != TCL_OK) {
+ Tk_DestroyWindow(entryPtr->tkwin);
+ return TCL_ERROR;
+ }
+ if (ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0) != TCL_OK) {
+ goto error;
+ }
+
+ Tcl_SetResult(interp, Tk_PathName(entryPtr->tkwin), TCL_STATIC);
+ return TCL_OK;
+
+ error:
+ Tk_DestroyWindow(entryPtr->tkwin);
+ return TCL_ERROR;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SpinboxWidgetObjCmd --
+ *
+ * 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
+SpinboxWidgetObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* Information about spinbox widget. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Entry *entryPtr = (Entry *) clientData;
+ Spinbox *sbPtr = (Spinbox *) clientData;
+ int cmdIndex, selIndex, result;
+ Tcl_Obj *objPtr;
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ return TCL_ERROR;
+ }
+
+ /*
+ * Parse the widget command by looking up the second token in
+ * the list of valid command names.
+ */
+
+ result = Tcl_GetIndexFromObj(interp, objv[1], sbCmdNames,
+ "option", 0, &cmdIndex);
+ if (result != TCL_OK) {
+ return result;
+ }
+
+ Tcl_Preserve((ClientData) entryPtr);
+ switch ((enum sbCmd) cmdIndex) {
+ case SB_CMD_BBOX: {
+ int index, x, y, width, height;
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ if ((index == entryPtr->numChars) && (index > 0)) {
+ index--;
+ }
+ Tk_CharBbox(entryPtr->textLayout, index, &x, &y,
+ &width, &height);
+ sprintf(buf, "%d %d %d %d", x + entryPtr->layoutX,
+ y + entryPtr->layoutY, width, height);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ break;
+ }
+
+ case SB_CMD_CGET: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ goto error;
+ }
+
+ objPtr = Tk_GetOptionValue(interp, (char *) entryPtr,
+ entryPtr->optionTable, objv[2], entryPtr->tkwin);
+ if (objPtr == NULL) {
+ goto error;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ break;
+ }
+
+ case SB_CMD_CONFIGURE: {
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) entryPtr,
+ entryPtr->optionTable,
+ (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
+ entryPtr->tkwin);
+ if (objPtr == NULL) {
+ goto error;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
+ } else {
+ result = ConfigureEntry(interp, entryPtr, objc-2, objv+2, 0);
+ }
break;
- case 'i': /* index of insert/delete */
- sprintf(numStorage, "%d", index);
- string = numStorage;
+ }
+
+ case SB_CMD_DELETE: {
+ int first, last;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &first) != TCL_OK) {
+ goto error;
+ }
+ if (objc == 3) {
+ last = first + 1;
+ } else {
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[3]),
+ &last) != TCL_OK) {
+ goto error;
+ }
+ }
+ if ((last >= first) && (entryPtr->state == STATE_NORMAL)) {
+ DeleteChars(entryPtr, first, last - first);
+ }
break;
- case 'P': /* 'Peeked' new value of the string */
- string = new;
+ }
+
+ case SB_CMD_GET: {
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ goto error;
+ }
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
break;
- case 's': /* Current string value of entry */
- string = entryPtr->string;
+ }
+
+ case SB_CMD_ICURSOR: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "pos");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &entryPtr->insertPos) != TCL_OK) {
+ goto error;
+ }
+ EventuallyRedraw(entryPtr);
break;
- case 'S': /* string to be inserted/deleted, if any */
- string = change;
+ }
+
+ case SB_CMD_IDENTIFY: {
+ int x, y, elem;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "x y");
+ goto error;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK) ||
+ (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
+ goto error;
+ }
+ elem = GetSpinboxElement(sbPtr, x, y);
+ if (elem != SEL_NONE) {
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
+ selElementNames[elem], -1);
+ }
break;
- case 'v': /* type of validation currently set */
- string = validateStrings[entryPtr->validate];
+ }
+
+ case SB_CMD_INDEX: {
+ int index;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "string");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
break;
- case 'V': /* type of validation in effect */
- switch (type) {
- case VALIDATE_INSERT:
- case VALIDATE_DELETE:
- string = validateStrings[VALIDATE_KEY];
- break;
- case VALIDATE_FORCED:
- string = "forced";
- break;
- default:
- string = validateStrings[type];
- break;
+ }
+
+ case SB_CMD_INSERT: {
+ int index;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "index text");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ if (entryPtr->state == STATE_NORMAL) {
+ InsertChars(entryPtr, index, Tcl_GetString(objv[3]));
}
break;
- case 'W': /* widget name */
- string = Tk_PathName(entryPtr->tkwin);
+ }
+
+ case SB_CMD_INVOKE: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "elemName");
+ goto error;
+ }
+ result = Tcl_GetIndexFromObj(interp, objv[2],
+ selElementNames, "element", 0, &cmdIndex);
+ if (result != TCL_OK) {
+ goto error;
+ }
+ if (entryPtr->state != STATE_DISABLED) {
+ if (SpinboxInvoke(interp, sbPtr, cmdIndex) != TCL_OK) {
+ goto error;
+ }
+ }
break;
- default:
- length = Tcl_UniCharToUtf(ch, numStorage);
- numStorage[length] = '\0';
- string = numStorage;
+ }
+
+ case SB_CMD_SCAN: {
+ int x;
+ char *minorCmd;
+
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "mark|dragto x");
+ goto error;
+ }
+ if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) {
+ goto error;
+ }
+
+ minorCmd = Tcl_GetString(objv[2]);
+ if (minorCmd[0] == 'm'
+ && (strncmp(minorCmd, "mark", strlen(minorCmd)) == 0)) {
+ entryPtr->scanMarkX = x;
+ entryPtr->scanMarkIndex = entryPtr->leftIndex;
+ } else if ((minorCmd[0] == 'd')
+ && (strncmp(minorCmd, "dragto", strlen(minorCmd)) == 0)) {
+ EntryScanTo(entryPtr, x);
+ } else {
+ Tcl_AppendResult(interp, "bad scan option \"",
+ Tcl_GetString(objv[2]), "\": must be mark or dragto",
+ (char *) NULL);
+ goto error;
+ }
break;
}
- spaceNeeded = Tcl_ScanCountedElement(string, -1, &cvtFlags);
- length = Tcl_DStringLength(dsPtr);
- Tcl_DStringSetLength(dsPtr, length + spaceNeeded);
- spaceNeeded = Tcl_ConvertCountedElement(string, -1,
- Tcl_DStringValue(dsPtr) + length,
- cvtFlags | TCL_DONT_USE_BRACES);
- Tcl_DStringSetLength(dsPtr, length + spaceNeeded);
+ case SB_CMD_SELECTION: {
+ int index, index2;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?index?");
+ goto error;
+ }
+
+ /*
+ * Parse the selection sub-command, using the command
+ * table "sbSelCmdNames" defined above.
+ */
+
+ result = Tcl_GetIndexFromObj(interp, objv[2], sbSelCmdNames,
+ "selection option", 0, &selIndex);
+ if (result != TCL_OK) {
+ goto error;
+ }
+
+ /*
+ * Disabled entries don't allow the selection to be modified.
+ */
+
+ if (entryPtr->state == STATE_DISABLED) {
+ goto done;
+ }
+
+ switch(selIndex) {
+ case SB_SEL_ADJUST: {
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
+ }
+ if (entryPtr->selectFirst >= 0) {
+ int half1, half2;
+
+ half1 = (entryPtr->selectFirst
+ + entryPtr->selectLast)/2;
+ half2 = (entryPtr->selectFirst
+ + entryPtr->selectLast + 1)/2;
+ if (index < half1) {
+ entryPtr->selectAnchor = entryPtr->selectLast;
+ } else if (index > half2) {
+ entryPtr->selectAnchor = entryPtr->selectFirst;
+ } else {
+ /*
+ * We're at about the halfway point in the
+ * selection; just keep the existing anchor.
+ */
+ }
+ }
+ EntrySelectTo(entryPtr, index);
+ break;
+ }
+
+ case SB_SEL_CLEAR: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 3, objv, (char *) NULL);
+ goto error;
+ }
+ if (entryPtr->selectFirst >= 0) {
+ entryPtr->selectFirst = -1;
+ entryPtr->selectLast = -1;
+ EventuallyRedraw(entryPtr);
+ }
+ goto done;
+ }
+
+ case SB_SEL_FROM: {
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
+ }
+ entryPtr->selectAnchor = index;
+ break;
+ }
+
+ case SB_SEL_PRESENT: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 3, objv, (char *) NULL);
+ goto error;
+ }
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj((entryPtr->selectFirst >= 0)));
+ goto done;
+ }
+
+ case SB_SEL_RANGE: {
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 3, objv, "start end");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[4]),& index2) != TCL_OK) {
+ goto error;
+ }
+ if (index >= index2) {
+ entryPtr->selectFirst = -1;
+ entryPtr->selectLast = -1;
+ } else {
+ entryPtr->selectFirst = index;
+ entryPtr->selectLast = index2;
+ }
+ if (!(entryPtr->flags & GOT_SELECTION)
+ && (entryPtr->exportSelection)) {
+ Tk_OwnSelection(entryPtr->tkwin, XA_PRIMARY,
+ EntryLostSelection, (ClientData) entryPtr);
+ entryPtr->flags |= GOT_SELECTION;
+ }
+ EventuallyRedraw(entryPtr);
+ break;
+ }
+
+ case SB_SEL_TO: {
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
+ goto error;
+ }
+ if (GetEntryIndex(interp, entryPtr,
+ Tcl_GetString(objv[3]), &index) != TCL_OK) {
+ goto error;
+ }
+ EntrySelectTo(entryPtr, index);
+ break;
+ }
+
+ case SB_SEL_ELEMENT: {
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 3, objv, "?elemName?");
+ goto error;
+ }
+ if (objc == 3) {
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
+ selElementNames[sbPtr->selElement], -1);
+ } else {
+ int lastElement = sbPtr->selElement;
+
+ result = Tcl_GetIndexFromObj(interp, objv[3],
+ selElementNames, "selection element", 0,
+ &(sbPtr->selElement));
+ if (result != TCL_OK) {
+ goto error;
+ }
+ if (lastElement != sbPtr->selElement) {
+ EventuallyRedraw(entryPtr);
+ }
+ }
+ break;
+ }
+ }
+ break;
+ }
+
+ case SB_CMD_SET: {
+ if (objc > 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?string?");
+ goto error;
+ }
+ if (objc == 3) {
+ EntryValueChanged(entryPtr, Tcl_GetString(objv[2]));
+ }
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), entryPtr->string, -1);
+ break;
+ }
+
+ case SB_CMD_VALIDATE: {
+ int code;
+
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ goto error;
+ }
+ selIndex = entryPtr->validate;
+ entryPtr->validate = VALIDATE_ALL;
+ code = EntryValidateChange(entryPtr, (char *) NULL,
+ entryPtr->string, -1, VALIDATE_FORCED);
+ if (entryPtr->validate != VALIDATE_NONE) {
+ entryPtr->validate = selIndex;
+ }
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj((code == TCL_OK)));
+ break;
+ }
+
+ case SB_CMD_XVIEW: {
+ int index;
+
+ if (objc == 2) {
+ double first, last;
+ char buf[TCL_DOUBLE_SPACE * 2];
+
+ EntryVisibleRange(entryPtr, &first, &last);
+ sprintf(buf, "%g %g", first, last);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ goto done;
+ } else if (objc == 3) {
+ if (GetEntryIndex(interp, entryPtr, Tcl_GetString(objv[2]),
+ &index) != TCL_OK) {
+ goto error;
+ }
+ } else {
+ double fraction;
+ int count;
+
+ index = entryPtr->leftIndex;
+ switch (Tk_GetScrollInfoObj(interp, objc, objv, &fraction,
+ &count)) {
+ case TK_SCROLL_ERROR: {
+ goto error;
+ }
+ case TK_SCROLL_MOVETO: {
+ index = (int) ((fraction * entryPtr->numChars) + 0.5);
+ break;
+ }
+ case TK_SCROLL_PAGES: {
+ int charsPerPage;
+
+ charsPerPage = ((Tk_Width(entryPtr->tkwin)
+ - 2 * entryPtr->inset - entryPtr->xWidth)
+ / entryPtr->avgWidth) - 2;
+ if (charsPerPage < 1) {
+ charsPerPage = 1;
+ }
+ index += count * charsPerPage;
+ break;
+ }
+ case TK_SCROLL_UNITS: {
+ index += count;
+ break;
+ }
+ }
+ }
+ if (index >= entryPtr->numChars) {
+ index = entryPtr->numChars - 1;
+ }
+ if (index < 0) {
+ index = 0;
+ }
+ entryPtr->leftIndex = index;
+ entryPtr->flags |= UPDATE_SCROLLBAR;
+ EntryComputeGeometry(entryPtr);
+ EventuallyRedraw(entryPtr);
+ break;
+ }
+ }
+
+ done:
+ Tcl_Release((ClientData) entryPtr);
+ return result;
+
+ error:
+ Tcl_Release((ClientData) entryPtr);
+ return TCL_ERROR;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * GetSpinboxElement --
+ *
+ * Return the element associated with an x,y coord.
+ *
+ * Results:
+ * Element type as enum selelement.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static int
+GetSpinboxElement(sbPtr, x, y)
+ Spinbox *sbPtr; /* Spinbox for which the index is being
+ * specified. */
+ int x; /* x coord */
+ int y; /* y coord */
+{
+ Entry *entryPtr = (Entry *) sbPtr;
+
+ if ((x < 0) || (y < 0) || (y > Tk_Height(entryPtr->tkwin))
+ || (x > Tk_Width(entryPtr->tkwin))) {
+ return SEL_NONE;
+ }
+
+ if (x > (Tk_Width(entryPtr->tkwin) - entryPtr->inset - entryPtr->xWidth)) {
+ if (y > (Tk_Height(entryPtr->tkwin) / 2)) {
+ return SEL_BUTTONDOWN;
+ } else {
+ return SEL_BUTTONUP;
+ }
+ }
+ return SEL_ENTRY;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SpinboxInvoke --
+ *
+ * This procedure is invoked when the invoke method for the
+ * widget is called.
+ *
+ * Results:
+ * TCL_OK.
+ *
+ * Side effects:
+ * An background error condition may arise when invoking the
+ * callback. The widget value may change.
+ *
+ *--------------------------------------------------------------
+ */
+
+static int
+SpinboxInvoke(interp, sbPtr, element)
+ register Tcl_Interp *interp; /* Current interpreter. */
+ register Spinbox *sbPtr; /* Spinbox to invoke. */
+ int element; /* element to invoke, either the "up"
+ * or "down" button. */
+{
+ Entry *entryPtr = (Entry *) sbPtr;
+ char *type;
+ int code, up;
+ Tcl_DString script;
+
+ switch (element) {
+ case SEL_BUTTONUP:
+ type = "up";
+ up = 1;
+ break;
+ case SEL_BUTTONDOWN:
+ type = "down";
+ up = 0;
+ break;
+ default:
+ return TCL_OK;
+ }
+
+ if (fabs(sbPtr->increment) > MIN_DBL_VAL) {
+ if (sbPtr->listObj != NULL) {
+ Tcl_Obj *objPtr;
+
+ Tcl_ListObjIndex(interp, sbPtr->listObj, sbPtr->eIndex, &objPtr);
+ if (strcmp(Tcl_GetString(objPtr), entryPtr->string)) {
+ /*
+ * Somehow the string changed from what we expected,
+ * so let's do a search on the list to see if the current
+ * value is there. If not, move to the first element of
+ * the list.
+ */
+ int i, listc, elemLen, length = entryPtr->numChars;
+ char *bytes;
+ Tcl_Obj **listv;
+
+ Tcl_ListObjGetElements(interp, sbPtr->listObj, &listc, &listv);
+ for (i = 0; i < listc; i++) {
+ bytes = Tcl_GetStringFromObj(listv[i], &elemLen);
+ if ((length == elemLen) &&
+ (memcmp(bytes, entryPtr->string,
+ (size_t) length) == 0)) {
+ sbPtr->eIndex = i;
+ break;
+ }
+ }
+ }
+ if (up) {
+ if (++sbPtr->eIndex >= sbPtr->nElements) {
+ if (sbPtr->wrap) {
+ sbPtr->eIndex = 0;
+ } else {
+ sbPtr->eIndex = sbPtr->nElements-1;
+ }
+ }
+ } else {
+ if (--sbPtr->eIndex < 0) {
+ if (sbPtr->wrap) {
+ sbPtr->eIndex = sbPtr->nElements-1;
+ } else {
+ sbPtr->eIndex = 0;
+ }
+ }
+ }
+ Tcl_ListObjIndex(interp, sbPtr->listObj, sbPtr->eIndex, &objPtr);
+ EntryValueChanged(entryPtr, Tcl_GetString(objPtr));
+ } else if (!DOUBLES_EQ(sbPtr->fromValue, sbPtr->toValue)) {
+ double dvalue;
+
+ if (Tcl_GetDouble(NULL, entryPtr->string, &dvalue) != TCL_OK) {
+ /*
+ * If the string is empty, or isn't a valid double value,
+ * just use the -from value
+ */
+ dvalue = sbPtr->fromValue;
+ } else {
+ if (up) {
+ dvalue += sbPtr->increment;
+ if (dvalue > sbPtr->toValue) {
+ if (sbPtr->wrap) {
+ dvalue = sbPtr->fromValue;
+ } else {
+ dvalue = sbPtr->toValue;
+ }
+ } else if (dvalue < sbPtr->fromValue) {
+ /*
+ * It's possible that when pressing up, we are
+ * still less than the fromValue, because the
+ * user may have manipulated the value by hand.
+ */
+ dvalue = sbPtr->fromValue;
+ }
+ } else {
+ dvalue -= sbPtr->increment;
+ if (dvalue < sbPtr->fromValue) {
+ if (sbPtr->wrap) {
+ dvalue = sbPtr->toValue;
+ } else {
+ dvalue = sbPtr->fromValue;
+ }
+ } else if (dvalue > sbPtr->toValue) {
+ /*
+ * It's possible that when pressing down, we are
+ * still greater than the toValue, because the
+ * user may have manipulated the value by hand.
+ */
+ dvalue = sbPtr->toValue;
+ }
+ }
+ }
+ sprintf(sbPtr->formatBuf, sbPtr->valueFormat, dvalue);
+ EntryValueChanged(entryPtr, sbPtr->formatBuf);
+ }
}
+
+ if (sbPtr->command != NULL) {
+ Tcl_DStringInit(&script);
+ ExpandPercents(entryPtr, sbPtr->command, type, "", 0,
+ VALIDATE_BUTTON, &script);
+ Tcl_DStringAppend(&script, "", 1);
+
+ code = Tcl_EvalEx(interp, Tcl_DStringValue(&script), -1,
+ TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);
+ Tcl_DStringFree(&script);
+
+ if (code != TCL_OK) {
+ Tcl_AddErrorInfo(interp, "\n\t(in command executed by spinbox)");
+ Tcl_BackgroundError(interp);
+ /*
+ * Yes, it's an error, but a bg one, so we return OK
+ */
+ return TCL_OK;
+ }
+
+ Tcl_SetResult(interp, NULL, 0);
+ }
+
+ return TCL_OK;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ComputeFormat --
+ *
+ * This procedure is invoked to recompute the "format" fields
+ * of a spinbox's widget record, which determines how the value
+ * of the dial is converted to a string.
+ *
+ * Results:
+ * Tcl result code.
+ *
+ * Side effects:
+ * The format fields of the spinbox are modified.
+ *
+ *----------------------------------------------------------------------
+ */
+static int
+ComputeFormat(sbPtr)
+ Spinbox *sbPtr; /* Information about dial widget. */
+{
+ double maxValue, x;
+ int mostSigDigit, numDigits, leastSigDigit, afterDecimal;
+ int eDigits, fDigits;
+
+ /*
+ * Compute the displacement from the decimal of the most significant
+ * digit required for any number in the dial's range.
+ */
+
+ if (sbPtr->reqFormat) {
+ sbPtr->valueFormat = sbPtr->reqFormat;
+ return TCL_OK;
+ }
+
+ maxValue = fabs(sbPtr->fromValue);
+ x = fabs(sbPtr->toValue);
+ if (x > maxValue) {
+ maxValue = x;
+ }
+ if (maxValue == 0) {
+ maxValue = 1;
+ }
+ mostSigDigit = (int) floor(log10(maxValue));
+
+ if (fabs(sbPtr->increment) > MIN_DBL_VAL) {
+ /*
+ * A increment was specified, so use it.
+ */
+ leastSigDigit = (int) floor(log10(sbPtr->increment));
+ } else {
+ leastSigDigit = 0;
+ }
+ numDigits = mostSigDigit - leastSigDigit + 1;
+ if (numDigits < 1) {
+ numDigits = 1;
+ }
+
+ /*
+ * Compute the number of characters required using "e" format and
+ * "f" format, and then choose whichever one takes fewer characters.
+ */
+ eDigits = numDigits + 4;
+ if (numDigits > 1) {
+ eDigits++; /* Decimal point. */
+ }
+ afterDecimal = numDigits - mostSigDigit - 1;
+ if (afterDecimal < 0) {
+ afterDecimal = 0;
+ }
+ fDigits = (mostSigDigit >= 0) ? mostSigDigit + afterDecimal : afterDecimal;
+ if (afterDecimal > 0) {
+ fDigits++; /* Decimal point. */
+ }
+ if (mostSigDigit < 0) {
+ fDigits++; /* Zero to left of decimal point. */
+ }
+ if (fDigits <= eDigits) {
+ sprintf(sbPtr->digitFormat, "%%.%df", afterDecimal);
+ } else {
+ sprintf(sbPtr->digitFormat, "%%.%de", numDigits-1);
+ }
+ sbPtr->valueFormat = sbPtr->digitFormat;
+ return TCL_OK;
+}
diff --git a/tk/generic/tkError.c b/tk/generic/tkError.c
index aaf7c10b351..77909331a6f 100644
--- a/tk/generic/tkError.c
+++ b/tk/generic/tkError.c
@@ -305,4 +305,3 @@ ErrorProc(display, errEventPtr)
couldntHandle:
return (*defaultHandler)(display, errEventPtr);
}
-
diff --git a/tk/generic/tkEvent.c b/tk/generic/tkEvent.c
index bd70e881bae..602b044bc08 100644
--- a/tk/generic/tkEvent.c
+++ b/tk/generic/tkEvent.c
@@ -6,7 +6,7 @@
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1995 Sun Microsystems, Inc.
- * Copyright (c) 1998 by Scriptics Corporation.
+ * Copyright (c) 1998-2000 Ajuba Solutions.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -130,17 +130,16 @@ static unsigned long eventMasks[TK_LASTEVENT] = {
*/
typedef struct ThreadSpecificData {
-
- int genericHandlersActive;
- /* The following variable has a non-zero
+ int handlersActive; /* The following variable has a non-zero
* value when a handler is active. */
- InProgress *pendingPtr;
- /* Topmost search in progress, or
+ InProgress *pendingPtr; /* Topmost search in progress, or
* NULL if none. */
- GenericHandler *genericList;
- /* First handler in the list, or NULL. */
- GenericHandler *lastGenericPtr;
- /* Last handler in list. */
+
+ GenericHandler *genericList; /* First handler in the list, or NULL. */
+ GenericHandler *lastGenericPtr; /* Last handler in list. */
+
+ GenericHandler *cmList; /* First handler in the list, or NULL. */
+ GenericHandler *lastCmPtr; /* Last handler in list. */
/*
* If someone has called Tk_RestrictEvents, the information below
@@ -150,7 +149,7 @@ typedef struct ThreadSpecificData {
Tk_RestrictProc *restrictProc;
/* Procedure to call. NULL means no
* restrictProc is currently in effect. */
- ClientData restrictArg; /* Argument to pass to restrictProc. */
+ ClientData restrictArg; /* Argument to pass to restrictProc. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -162,6 +161,9 @@ static Tcl_ThreadDataKey dataKey;
static void DelayedMotionProc _ANSI_ARGS_((ClientData clientData));
static int WindowEventProc _ANSI_ARGS_((Tcl_Event *evPtr,
int flags));
+static int TkXErrorHandler _ANSI_ARGS_((ClientData clientData,
+ XErrorEvent *errEventPtr));
+
/*
*--------------------------------------------------------------
@@ -354,16 +356,16 @@ Tk_CreateGenericHandler(proc, clientData)
handlerPtr = (GenericHandler *) ckalloc (sizeof (GenericHandler));
- handlerPtr->proc = proc;
- handlerPtr->clientData = clientData;
- handlerPtr->deleteFlag = 0;
- handlerPtr->nextPtr = NULL;
+ handlerPtr->proc = proc;
+ handlerPtr->clientData = clientData;
+ handlerPtr->deleteFlag = 0;
+ handlerPtr->nextPtr = NULL;
if (tsdPtr->genericList == NULL) {
- tsdPtr->genericList = handlerPtr;
+ tsdPtr->genericList = handlerPtr;
} else {
tsdPtr->lastGenericPtr->nextPtr = handlerPtr;
}
- tsdPtr->lastGenericPtr = handlerPtr;
+ tsdPtr->lastGenericPtr = handlerPtr;
}
/*
@@ -392,7 +394,7 @@ Tk_DeleteGenericHandler(proc, clientData)
{
GenericHandler * handler;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (handler = tsdPtr->genericList; handler; handler = handler->nextPtr) {
if ((handler->proc == proc) && (handler->clientData == clientData)) {
@@ -401,6 +403,86 @@ Tk_DeleteGenericHandler(proc, clientData)
}
}
+/*--------------------------------------------------------------
+ *
+ * Tk_CreateClientMessageHandler --
+ *
+ * Register a procedure to be called on each ClientMessage event.
+ * ClientMessage handlers are useful for Drag&Drop extensions.
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * From now on, whenever a ClientMessage event is received that isn't
+ * a WM_PROTOCOL event or SelectionEvent, invoke proc, giving it
+ * tkwin and the event as arguments.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+Tk_CreateClientMessageHandler(proc)
+ Tk_ClientMessageProc *proc; /* Procedure to call on event. */
+{
+ GenericHandler *handlerPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ /*
+ * We use a GenericHandler struct, because it's basically the same,
+ * except with an extra clientData field we'll never use.
+ */
+ handlerPtr = (GenericHandler *)
+ ckalloc (sizeof (GenericHandler));
+
+ handlerPtr->proc = (Tk_GenericProc *) proc;
+ handlerPtr->clientData = NULL; /* never used */
+ handlerPtr->deleteFlag = 0;
+ handlerPtr->nextPtr = NULL;
+ if (tsdPtr->cmList == NULL) {
+ tsdPtr->cmList = handlerPtr;
+ } else {
+ tsdPtr->lastCmPtr->nextPtr = handlerPtr;
+ }
+ tsdPtr->lastCmPtr = handlerPtr;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * Tk_DeleteClientMessageHandler --
+ *
+ * Delete a previously-created ClientMessage handler.
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * If there existed a handler as described by the parameters,
+ * that handler is logically deleted so that proc will not be
+ * invoked again. The physical deletion happens in the event
+ * loop in TkClientMessageEventProc.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+Tk_DeleteClientMessageHandler(proc)
+ Tk_ClientMessageProc *proc;
+{
+ GenericHandler * handler;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ for (handler = tsdPtr->cmList; handler != NULL;
+ handler = handler->nextPtr) {
+ if (handler->proc == (Tk_GenericProc *) proc) {
+ handler->deleteFlag = 1;
+ }
+ }
+}
+
/*
*--------------------------------------------------------------
*
@@ -424,14 +506,101 @@ void
TkEventInit _ANSI_ARGS_((void))
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ tsdPtr->handlersActive = 0;
+ tsdPtr->pendingPtr = NULL;
+ tsdPtr->genericList = NULL;
+ tsdPtr->lastGenericPtr = NULL;
+ tsdPtr->cmList = NULL;
+ tsdPtr->lastCmPtr = NULL;
+ tsdPtr->restrictProc = NULL;
+ tsdPtr->restrictArg = NULL;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkXErrorHandler --
+ *
+ * TkXErrorHandler is an error handler, to be installed
+ * via Tk_CreateErrorHandler, that will set a flag if an
+ * X error occurred.
+ *
+ * Results:
+ * Always returns 0, indicating that the X error was
+ * handled.
+ *
+ * Side effects:
+ * None.
+ *
+ *--------------------------------------------------------------
+ */
- tsdPtr->genericHandlersActive = 0;
- tsdPtr->pendingPtr = NULL;
- tsdPtr->genericList = NULL;
- tsdPtr->lastGenericPtr = NULL;
- tsdPtr->restrictProc = NULL;
- tsdPtr->restrictArg = NULL;
+static int
+TkXErrorHandler (clientData, errEventPtr)
+ ClientData clientData; /* Pointer to flag we set */
+ XErrorEvent *errEventPtr; /* X error info */
+{
+ int *error;
+
+ error = (int *) clientData;
+ *error = 1;
+ return 0;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ParentXId --
+ *
+ * Returns the parent of the given window, or "None"
+ * if the window doesn't exist.
+ *
+ * Results:
+ * Returns an X window ID.
+ *
+ * Side effects:
+ * None.
+ *
+ *--------------------------------------------------------------
+ */
+
+static Window
+ParentXId(display, w)
+ Display *display;
+ Window w;
+{
+ Tk_ErrorHandler handler;
+ int gotXError;
+ Status status;
+ Window parent;
+ Window root;
+ Window *childList;
+ unsigned int nChildren;
+
+ /* Handle errors ourselves. */
+
+ gotXError = 0;
+ handler = Tk_CreateErrorHandler(display, -1, -1, -1,
+ TkXErrorHandler, (ClientData) (&gotXError));
+
+ /* Get the parent window. */
+
+ status = XQueryTree(display, w, &root, &parent, &childList, &nChildren);
+
+ /* Do some cleanup; gotta return "None" if we got an error. */
+
+ Tk_DeleteErrorHandler(handler);
+ XSync(display, False);
+ if (status != 0 && childList != NULL) {
+ XFree(childList);
+ }
+ if (status == 0) {
+ parent = None;
+ }
+
+ return parent;
}
/*
@@ -462,10 +631,11 @@ Tk_HandleEvent(eventPtr)
unsigned long mask;
InProgress ip;
Window handlerWindow;
+ Window parentXId;
TkDisplay *dispPtr;
Tcl_Interp *interp = (Tcl_Interp *) NULL;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
* Hack for simulated X-events: Correct the state field
@@ -503,7 +673,7 @@ Tk_HandleEvent(eventPtr)
for (genPrevPtr = NULL, genericPtr = tsdPtr->genericList;
genericPtr != NULL; ) {
if (genericPtr->deleteFlag) {
- if (!tsdPtr->genericHandlersActive) {
+ if (!tsdPtr->handlersActive) {
GenericHandler *tmpPtr;
/*
@@ -528,9 +698,9 @@ Tk_HandleEvent(eventPtr)
} else {
int done;
- tsdPtr->genericHandlersActive++;
+ tsdPtr->handlersActive++;
done = (*genericPtr->proc)(genericPtr->clientData, eventPtr);
- tsdPtr->genericHandlersActive--;
+ tsdPtr->handlersActive--;
if (done) {
return;
}
@@ -573,18 +743,38 @@ Tk_HandleEvent(eventPtr)
}
winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, handlerWindow);
if (winPtr == NULL) {
-
/*
* There isn't a TkWindow structure for this window.
* However, if the event is a PropertyNotify event then call
* the selection manager (it deals beneath-the-table with
- * certain properties).
+ * certain properties). Also, if the window's parent is a
+ * Tk window that has the TK_PROP_PROPCHANGE flag set, then
+ * we must propagate the PropertyNotify event up to the parent.
*/
- if (eventPtr->type == PropertyNotify) {
- TkSelPropProc(eventPtr);
+ if (eventPtr->type != PropertyNotify) {
+ return;
}
- return;
+
+ TkSelPropProc(eventPtr);
+
+ /* Get handlerWindow's parent. */
+
+ parentXId = ParentXId(eventPtr->xany.display, handlerWindow);
+ if (parentXId == None) {
+ return;
+ }
+
+ winPtr = (TkWindow *) Tk_IdToWindow(eventPtr->xany.display, parentXId);
+ if (winPtr == NULL) {
+ return;
+ }
+
+ if (!(winPtr->flags & TK_PROP_PROPCHANGE)) {
+ return;
+ }
+
+ handlerWindow = parentXId;
}
/*
@@ -667,18 +857,56 @@ Tk_HandleEvent(eventPtr)
* Pass the event to the input method(s), if there are any, and
* discard the event if the input method(s) insist. Create the
* input context for the window if it hasn't already been done
- * (XFilterEvent needs this context).
+ * (XFilterEvent needs this context). XIM is only ever enabled on
+ * Unix, but this hasn't been factored out of the generic code yet.
*/
- if (winPtr->dispPtr->useInputMethods) {
- if (!(winPtr->flags & TK_CHECKED_IC)) {
- if (winPtr->dispPtr->inputMethod != NULL) {
- winPtr->inputContext = XCreateIC(
- winPtr->dispPtr->inputMethod, XNInputStyle,
- XIMPreeditNothing|XIMStatusNothing,
- XNClientWindow, winPtr->window,
- XNFocusWindow, winPtr->window, NULL);
- }
+ dispPtr = winPtr->dispPtr;
+ if ((dispPtr->flags & TK_DISPLAY_USE_IM)) {
+ if (!(winPtr->flags & (TK_CHECKED_IC|TK_ALREADY_DEAD))) {
winPtr->flags |= TK_CHECKED_IC;
+ if (dispPtr->inputMethod != NULL) {
+#if TK_XIM_SPOT
+ if (dispPtr->flags & TK_DISPLAY_XIM_SPOT) {
+ XVaNestedList preedit_attr;
+ XPoint spot = {0, 0};
+
+ if (dispPtr->inputXfs == NULL) {
+ /*
+ * We only need to create one XFontSet
+ */
+ char **missing_list;
+ int missing_count;
+ char *def_string;
+
+ dispPtr->inputXfs = XCreateFontSet(dispPtr->display,
+ "-*-*-*-R-Normal--14-130-75-75-*-*",
+ &missing_list, &missing_count, &def_string);
+ if (missing_count > 0) {
+ XFreeStringList(missing_list);
+ }
+ }
+
+ preedit_attr = XVaCreateNestedList(0, XNSpotLocation,
+ &spot, XNFontSet, dispPtr->inputXfs, NULL);
+ if (winPtr->inputContext != NULL)
+ panic("inputContext not NULL");
+ winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
+ XNInputStyle, XIMPreeditPosition|XIMStatusNothing,
+ XNClientWindow, winPtr->window,
+ XNFocusWindow, winPtr->window,
+ XNPreeditAttributes, preedit_attr,
+ NULL);
+ XFree(preedit_attr);
+ } else
+#endif
+ if (winPtr->inputContext != NULL)
+ panic("inputContext not NULL");
+ winPtr->inputContext = XCreateIC(dispPtr->inputMethod,
+ XNInputStyle, XIMPreeditNothing|XIMStatusNothing,
+ XNClientWindow, winPtr->window,
+ XNFocusWindow, winPtr->window,
+ NULL);
+ }
}
if (XFilterEvent(eventPtr, None)) {
goto done;
@@ -710,10 +938,55 @@ Tk_HandleEvent(eventPtr)
|| (eventPtr->type == SelectionRequest)
|| (eventPtr->type == SelectionNotify)) {
TkSelEventProc((Tk_Window) winPtr, eventPtr);
- } else if ((eventPtr->type == ClientMessage)
- && (eventPtr->xclient.message_type ==
- Tk_InternAtom((Tk_Window) winPtr, "WM_PROTOCOLS"))) {
- TkWmProtocolEventProc(winPtr, eventPtr);
+ } else if (eventPtr->type == ClientMessage) {
+ if (eventPtr->xclient.message_type ==
+ Tk_InternAtom((Tk_Window) winPtr, "WM_PROTOCOLS")) {
+ TkWmProtocolEventProc(winPtr, eventPtr);
+ } else {
+ /*
+ * Finally, invoke any ClientMessage event handlers.
+ */
+
+ for (genPrevPtr = NULL, genericPtr = tsdPtr->cmList;
+ genericPtr != NULL; ) {
+ if (genericPtr->deleteFlag) {
+ if (!tsdPtr->handlersActive) {
+ GenericHandler *tmpPtr;
+
+ /*
+ * This handler needs to be deleted and there are
+ * no calls pending through any handlers, so now
+ * is a safe time to delete it.
+ */
+
+ tmpPtr = genericPtr->nextPtr;
+ if (genPrevPtr == NULL) {
+ tsdPtr->cmList = tmpPtr;
+ } else {
+ genPrevPtr->nextPtr = tmpPtr;
+ }
+ if (tmpPtr == NULL) {
+ tsdPtr->lastGenericPtr = genPrevPtr;
+ }
+ (void) ckfree((char *) genericPtr);
+ genericPtr = tmpPtr;
+ continue;
+ }
+ } else {
+ int done;
+
+ tsdPtr->handlersActive++;
+ done = (*(Tk_ClientMessageProc *)genericPtr->proc)
+ ((Tk_Window) winPtr, eventPtr);
+ tsdPtr->handlersActive--;
+ if (done) {
+ break;
+ }
+ }
+ genPrevPtr = genericPtr;
+ genericPtr = genPrevPtr->nextPtr;
+ }
+ }
}
} else {
for (handlerPtr = winPtr->handlerList; handlerPtr != NULL; ) {
@@ -733,7 +1006,14 @@ Tk_HandleEvent(eventPtr)
* these events here than in the lower-level procedures.
*/
- if ((ip.winPtr != None) && (mask != SubstructureNotifyMask)) {
+ /*
+ * ...well, except when we use the tkwm patches, in which case
+ * we DO handle CreateNotify events, so we gotta pass 'em through.
+ */
+
+ if ((ip.winPtr != None)
+ && ((mask != SubstructureNotifyMask)
+ || (eventPtr->type == CreateNotify))) {
TkBindEventProc(winPtr, eventPtr);
}
}
@@ -896,6 +1176,40 @@ Tk_RestrictEvents(proc, arg, prevArgPtr)
/*
*----------------------------------------------------------------------
*
+ * Tk_CollapseMotionEvents --
+ *
+ * This procedure controls whether we collapse motion events in a
+ * particular display or not.
+ *
+ * Results:
+ * The return value is the previous collapse value in effect.
+ *
+ * Side effects:
+ * Filtering of motion events may be changed after calling this.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_CollapseMotionEvents(display, collapse)
+ Display *display; /* Display handling these events. */
+ int collapse; /* boolean value that specifies whether
+ * motion events should be collapsed. */
+{
+ TkDisplay *dispPtr = (TkDisplay *) display;
+ int prev = (dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS);
+
+ if (collapse) {
+ dispPtr->flags |= TK_DISPLAY_COLLAPSE_MOTION_EVENTS;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_COLLAPSE_MOTION_EVENTS;
+ }
+ return prev;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tk_QueueWindowEvent --
*
* Given an X-style window event, this procedure adds it to the
@@ -937,6 +1251,19 @@ Tk_QueueWindowEvent(eventPtr, position)
}
}
+ /*
+ * Don't filter motion events if the user
+ * defaulting to true (1), which could be set to false (0) when the
+ * user wishes to receive all the motion data)
+ */
+ if (!(dispPtr->flags & TK_DISPLAY_COLLAPSE_MOTION_EVENTS)) {
+ wevPtr = (TkWindowEvent *) ckalloc(sizeof(TkWindowEvent));
+ wevPtr->header.proc = WindowEventProc;
+ wevPtr->event = *eventPtr;
+ Tcl_QueueEvent(&wevPtr->header, position);
+ return;
+ }
+
if ((dispPtr->delayedMotionPtr != NULL) && (position == TCL_QUEUE_TAIL)) {
if ((eventPtr->type == MotionNotify) && (eventPtr->xmotion.window
== dispPtr->delayedMotionPtr->event.xmotion.window)) {
@@ -1012,7 +1339,7 @@ TkQueueEventForAllChildren(winPtr, eventPtr)
childPtr = winPtr->childList;
while (childPtr != NULL) {
- if (!Tk_IsTopLevel(childPtr)) {
+ if (!Tk_TopWinHierarchy(childPtr)) {
TkQueueEventForAllChildren(childPtr, eventPtr);
}
childPtr = childPtr->nextPtr;
@@ -1130,4 +1457,3 @@ Tk_MainLoop()
Tcl_DoOneEvent(0);
}
}
-
diff --git a/tk/generic/tkFileFilter.c b/tk/generic/tkFileFilter.c
index 7604746bf9f..2263ebe4dca 100644
--- a/tk/generic/tkFileFilter.c
+++ b/tk/generic/tkFileFilter.c
@@ -17,7 +17,7 @@
static int AddClause _ANSI_ARGS_((
Tcl_Interp * interp, FileFilter * filterPtr,
- char * patternsStr, char * ostypesStr,
+ CONST char * patternsStr, CONST char * ostypesStr,
int isWindows));
static void FreeClauses _ANSI_ARGS_((FileFilter * filterPtr));
static void FreeGlobPatterns _ANSI_ARGS_((
@@ -25,7 +25,7 @@ static void FreeGlobPatterns _ANSI_ARGS_((
static void FreeMacFileTypes _ANSI_ARGS_((
FileFilterClause * clausePtr));
static FileFilter * GetFilter _ANSI_ARGS_((FileFilterList * flistPtr,
- char * name));
+ CONST char * name));
/*
*----------------------------------------------------------------------
@@ -86,8 +86,8 @@ TkGetFileFilters(interp, flistPtr, string, isWindows)
int isWindows; /* True if we are running on Windows. */
{
int listArgc;
- char ** listArgv = NULL;
- char ** typeInfo = NULL;
+ CONST char ** listArgv = NULL;
+ CONST char ** typeInfo = NULL;
int code = TCL_OK;
int i;
@@ -206,16 +206,16 @@ TkFreeFileFilters(flistPtr)
static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
Tcl_Interp * interp; /* Interpreter to use for error reporting. */
FileFilter * filterPtr; /* Stores the new filter clause */
- char * patternsStr; /* A TCL list of glob patterns. */
- char * ostypesStr; /* A TCL list of Mac OSType strings. */
+ CONST char * patternsStr; /* A TCL list of glob patterns. */
+ CONST char * ostypesStr; /* A TCL list of Mac OSType strings. */
int isWindows; /* True if we are running on Windows; False
* if we are running on the Mac; Glob
* patterns need to be processed differently
* on these two platforms */
{
- char ** globList = NULL;
+ CONST char ** globList = NULL;
int globCount;
- char ** ostypeList = NULL;
+ CONST char ** ostypeList = NULL;
int ostypeCount;
FileFilterClause * clausePtr;
int i;
@@ -270,7 +270,7 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
/*
* Prepend a "*" to patterns that do not have a leading "*"
*/
- globPtr->pattern = (char*)ckalloc(len+1);
+ globPtr->pattern = (char*)ckalloc((unsigned int) len+1);
globPtr->pattern[0] = '*';
strcpy(globPtr->pattern+1, globList[i]);
}
@@ -289,11 +289,11 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
strcpy(globPtr->pattern, "*.");
}
else {
- globPtr->pattern = (char*)ckalloc(len);
+ globPtr->pattern = (char*)ckalloc((unsigned int) len);
strcpy(globPtr->pattern, globList[i]);
}
} else {
- globPtr->pattern = (char*)ckalloc(len);
+ globPtr->pattern = (char*)ckalloc((unsigned int) len);
strcpy(globPtr->pattern, globList[i]);
}
@@ -358,7 +358,7 @@ static int AddClause(interp, filterPtr, patternsStr, ostypesStr, isWindows)
static FileFilter * GetFilter(flistPtr, name)
FileFilterList * flistPtr; /* The FileFilterList that contains the
* newly created filter */
- char * name; /* Name of the filter. It is usually displayed
+ CONST char * name; /* Name of the filter. It is usually displayed
* in the "File Types" listbox in the file
* dialogs. */
{
@@ -483,4 +483,3 @@ FreeMacFileTypes(clausePtr)
}
clausePtr->macTypes = NULL;
}
-
diff --git a/tk/generic/tkFileFilter.h b/tk/generic/tkFileFilter.h
index ec4d43f9c76..1550d76b45b 100644
--- a/tk/generic/tkFileFilter.h
+++ b/tk/generic/tkFileFilter.h
@@ -90,4 +90,3 @@ EXTERN int TkGetFileFilters _ANSI_ARGS_ ((Tcl_Interp *interp,
# define TCL_STORAGE_CLASS DLLIMPORT
#endif
-
diff --git a/tk/generic/tkFocus.c b/tk/generic/tkFocus.c
index 8ed77cbb309..2839aa16d1e 100644
--- a/tk/generic/tkFocus.c
+++ b/tk/generic/tkFocus.c
@@ -121,8 +121,9 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *focusOptions[] = {"-displayof", "-force", "-lastfor",
- (char *) NULL};
+ static CONST char *focusOptions[] = {
+ "-displayof", "-force", "-lastfor", (char *) NULL
+ };
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr = (TkWindow *) clientData;
TkWindow *newPtr, *focusWinPtr, *topLevelPtr;
@@ -215,7 +216,7 @@ Tk_FocusObjCmd(clientData, interp, objc, objv)
}
for (topLevelPtr = newPtr; topLevelPtr != NULL;
topLevelPtr = topLevelPtr->parentPtr) {
- if (topLevelPtr->flags & TK_TOP_LEVEL) {
+ if (topLevelPtr->flags & TK_TOP_HIERARCHY) {
for (tlFocusPtr = newPtr->mainPtr->tlFocusPtr;
tlFocusPtr != NULL;
tlFocusPtr = tlFocusPtr->nextPtr) {
@@ -587,7 +588,7 @@ TkSetFocusWin(winPtr, force)
if (!(topLevelPtr->flags & TK_MAPPED)) {
allMapped = 0;
}
- if (topLevelPtr->flags & TK_TOP_LEVEL) {
+ if (topLevelPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
@@ -812,6 +813,14 @@ TkFocusDeadWindow(winPtr)
TkDisplay *dispPtr = winPtr->dispPtr;
/*
+ * Certain special windows like those used for send and clipboard
+ * have no mainPtr.
+ */
+
+ if (winPtr->mainPtr == NULL)
+ return;
+
+ /*
* Search for focus records that refer to this window either as
* the top-level window or the current focus window.
*/
@@ -1011,4 +1020,39 @@ FindDisplayFocusInfo(mainPtr, dispPtr)
mainPtr->displayFocusPtr = displayFocusPtr;
return displayFocusPtr;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFocusFree --
+ *
+ * Free resources associated with maintaining the focus.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * This mainPtr should no long access focus information.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+TkFocusFree(mainPtr)
+ TkMainInfo *mainPtr; /* Record that identifies a particular
+ * application. */
+{
+ DisplayFocusInfo *displayFocusPtr;
+ ToplevelFocusInfo *tlFocusPtr;
+
+ while (mainPtr->displayFocusPtr != NULL) {
+ displayFocusPtr = mainPtr->displayFocusPtr;
+ mainPtr->displayFocusPtr = mainPtr->displayFocusPtr->nextPtr;
+ ckfree((char *) displayFocusPtr);
+ }
+ while (mainPtr->tlFocusPtr != NULL) {
+ tlFocusPtr = mainPtr->tlFocusPtr;
+ mainPtr->tlFocusPtr = mainPtr->tlFocusPtr->nextPtr;
+ ckfree((char *) tlFocusPtr);
+ }
+}
diff --git a/tk/generic/tkFont.c b/tk/generic/tkFont.c
index 4ced32a9e59..33b3acf4c44 100644
--- a/tk/generic/tkFont.c
+++ b/tk/generic/tkFont.c
@@ -168,7 +168,7 @@ static TkStateMap xlfdSetwidthMap[] = {
* when configuring a set of font attributes.
*/
-static char *fontOpt[] = {
+static CONST char *fontOpt[] = {
"-family",
"-size",
"-weight",
@@ -355,7 +355,7 @@ static void UpdateDependentFonts _ANSI_ARGS_((TkFontInfo *fiPtr,
* NULL.
*/
-static Tcl_ObjType fontObjType = {
+Tcl_ObjType tkFontObjType = {
"font", /* name */
FreeFontObjProc, /* freeIntRepProc */
DupFontObjProc, /* dupIntRepProc */
@@ -435,9 +435,11 @@ TkFontPkgFree(mainPtr)
fprintf(stderr, "Font %s still in cache.\n",
Tcl_GetHashKey(&fiPtr->fontCache, searchPtr));
}
+#ifdef PURIFY
if (fontsLeft) {
panic("TkFontPkgFree: all fonts should have been freed already");
}
+#endif
Tcl_DeleteHashTable(&fiPtr->fontCache);
hPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search);
@@ -479,7 +481,7 @@ Tk_FontObjCmd(clientData, interp, objc, objv)
int index;
Tk_Window tkwin;
TkFontInfo *fiPtr;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"actual", "configure", "create", "delete",
"families", "measure", "metrics", "names",
NULL
@@ -684,7 +686,7 @@ Tk_FontObjCmd(clientData, interp, objc, objv)
Tk_Font tkfont;
int skip, index, i;
CONST TkFontMetrics *fmPtr;
- static char *switches[] = {
+ static CONST char *switches[] = {
"-ascent", "-descent", "-linespace", "-fixed", NULL
};
@@ -831,10 +833,30 @@ static void
RecomputeWidgets(winPtr)
TkWindow *winPtr; /* Window to which command is sent. */
{
- if ((winPtr->classProcsPtr != NULL)
- && (winPtr->classProcsPtr->geometryProc != NULL)) {
- (*winPtr->classProcsPtr->geometryProc)(winPtr->instanceData);
+ Tk_ClassWorldChangedProc *proc;
+ proc = Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc);
+ if (proc != NULL) {
+ (*proc)(winPtr->instanceData);
}
+
+ /*
+ * Notify all the descendants of this window that the world has changed.
+ *
+ * This could be done recursively or iteratively. The recursive version
+ * is easier to implement and understand, and typically, windows with a
+ * -font option will be leaf nodes in the widget heirarchy (buttons,
+ * labels, etc.), so the recursion depth will be shallow.
+ *
+ * However, the additional overhead of the recursive calls may become
+ * a performance problem if typical usage alters such that -font'ed widgets
+ * appear high in the heirarchy, causing deep recursion. This could happen
+ * with text widgets, or more likely with the (not yet existant) labeled
+ * frame widget. With these widgets it is possible, even likely, that a
+ * -font'ed widget (text or labeled frame) will not be a leaf node, but
+ * will instead have many descendants. If this is ever found to cause
+ * a performance problem, it may be worth investigating an iterative
+ * version of the code below.
+ */
for (winPtr = winPtr->childList; winPtr != NULL; winPtr = winPtr->nextPtr) {
RecomputeWidgets(winPtr);
}
@@ -985,7 +1007,7 @@ Tk_AllocFontFromObj(interp, tkwin, objPtr)
NamedFont *nfPtr;
fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
- if (objPtr->typePtr != &fontObjType) {
+ if (objPtr->typePtr != &tkFontObjType) {
SetFontFromAny(interp, objPtr);
}
@@ -1152,7 +1174,7 @@ Tk_GetFontFromObj(tkwin, objPtr)
TkFont *fontPtr;
Tcl_HashEntry *hashPtr;
- if (objPtr->typePtr != &fontObjType) {
+ if (objPtr->typePtr != &tkFontObjType) {
SetFontFromAny((Tcl_Interp *) NULL, objPtr);
}
@@ -1210,7 +1232,7 @@ Tk_GetFontFromObj(tkwin, objPtr)
* Always returns TCL_OK.
*
* Side effects:
- * The object is left with its typePtr pointing to fontObjType.
+ * The object is left with its typePtr pointing to tkFontObjType.
* The TkFont pointer is NULL.
*
*----------------------------------------------------------------------
@@ -1232,7 +1254,7 @@ SetFontFromAny(interp, objPtr)
if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
(*typePtr->freeIntRepProc)(objPtr);
}
- objPtr->typePtr = &fontObjType;
+ objPtr->typePtr = &tkFontObjType;
objPtr->internalRep.twoPtrValue.ptr1 = NULL;
return TCL_OK;
@@ -1257,7 +1279,7 @@ SetFontFromAny(interp, objPtr)
*---------------------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfFont(tkfont)
Tk_Font tkfont; /* Font whose name is desired. */
{
@@ -1528,7 +1550,7 @@ Tk_PostscriptFontName(tkfont, dsPtr)
* corresponds to tkfont will be appended. */
{
TkFont *fontPtr;
- char *family, *weightString, *slantString;
+ Tk_Uid family, weightString, slantString;
char *src, *dest;
int upper, len;
@@ -2222,21 +2244,18 @@ Tk_UnderlineTextLayout(display, drawable, gc, layout, x, y, underline)
int underline; /* Index of the single character to
* underline, or -1 for no underline. */
{
- TextLayout *layoutPtr = (TextLayout *) layout;
+ TextLayout *layoutPtr;
TkFont *fontPtr;
- int xx, yy, width, height, underlineByte;
+ int xx, yy, width, height;
- if (underline > -1) {
- underlineByte = Tcl_UtfAtIndex(layoutPtr->string, underline)
- - layoutPtr->string;
- if ((Tk_CharBbox(layout, underlineByte, &xx, &yy, &width, &height) != 0)
- && (width != 0)) {
- fontPtr = (TkFont *) layoutPtr->tkfont;
+ if ((Tk_CharBbox(layout, underline, &xx, &yy, &width, &height) != 0)
+ && (width != 0)) {
+ layoutPtr = (TextLayout *) layout;
+ fontPtr = (TkFont *) layoutPtr->tkfont;
- XFillRectangle(display, drawable, gc, x + xx,
- y + yy + fontPtr->fm.ascent + fontPtr->underlinePos,
- (unsigned int) width, (unsigned int) fontPtr->underlineHeight);
- }
+ XFillRectangle(display, drawable, gc, x + xx,
+ y + yy + fontPtr->fm.ascent + fontPtr->underlinePos,
+ (unsigned int) width, (unsigned int) fontPtr->underlineHeight);
}
}
@@ -2437,14 +2456,6 @@ Tk_CharBbox(layout, index, xPtr, yPtr, widthPtr, heightPtr)
CONST char *end;
if (index < 0) {
- if (xPtr)
- *xPtr = 0;
- if (yPtr)
- *yPtr = 0;
- if (widthPtr)
- *widthPtr = 0;
- if (heightPtr)
- *heightPtr = 0;
return 0;
}
@@ -2740,22 +2751,29 @@ Tk_TextLayoutToPostscript(interp, layout)
Tk_TextLayout layout; /* The layout to be rendered. */
{
#define MAXUSE 128
- char buf[MAXUSE+10];
+ char buf[MAXUSE+30];
LayoutChunk *chunkPtr;
int i, j, used, c, baseline;
Tcl_UniChar ch;
- CONST char *p;
+ CONST char *p, *last_p,*glyphname;
TextLayout *layoutPtr;
+ char uindex[5]="\0\0\0\0";
+ char one_char[5];
+ int charsize;
+ int bytecount=0;
layoutPtr = (TextLayout *) layout;
chunkPtr = layoutPtr->chunks;
baseline = chunkPtr->y;
used = 0;
+ buf[used++] = '[';
buf[used++] = '(';
for (i = 0; i < layoutPtr->numChunks; i++) {
if (baseline != chunkPtr->y) {
buf[used++] = ')';
+ buf[used++] = ']';
buf[used++] = '\n';
+ buf[used++] = '[';
buf[used++] = '(';
baseline = chunkPtr->y;
}
@@ -2772,23 +2790,43 @@ Tk_TextLayoutToPostscript(interp, layout)
* data and display the lower byte. Eventually this should
* be revised to handle international postscript fonts.
*/
+ last_p=p;
+ p +=(charsize= Tcl_UtfToUniChar(p,&ch));
+ Tcl_UtfToExternal(interp,NULL,last_p,charsize,0,NULL,one_char,4,
+ NULL,&bytecount,NULL);
+ if (bytecount == 1) {
+ c = UCHAR(one_char[0]);
+ /* c = UCHAR( ch & 0xFF) */;
+ if ((c == '(') || (c == ')') || (c == '\\') || (c < 0x20)
+ || (c >= UCHAR(0x7f))) {
+ /*
+ * Tricky point: the "03" is necessary in the sprintf
+ * below, so that a full three digits of octal are
+ * always generated. Without the "03", a number
+ * following this sequence could be interpreted by
+ * Postscript as part of this sequence.
+ */
- p += Tcl_UtfToUniChar(p, &ch);
- c = UCHAR(ch & 0xff);
- if ((c == '(') || (c == ')') || (c == '\\') || (c < 0x20)
- || (c >= UCHAR(0x7f))) {
- /*
- * Tricky point: the "03" is necessary in the sprintf
- * below, so that a full three digits of octal are
- * always generated. Without the "03", a number
- * following this sequence could be interpreted by
- * Postscript as part of this sequence.
- */
-
- sprintf(buf + used, "\\%03o", c);
- used += 4;
+ sprintf(buf + used, "\\%03o", c);
+ used += 4;
+ } else {
+ buf[used++] = c;
+ }
} else {
- buf[used++] = c;
+ /* This character doesn't belong to system character set.
+ * So, we must use full glyph name */
+ sprintf(uindex,"%04X",ch); /* endianness? */
+ if ((glyphname = Tcl_GetVar2( interp , "::tk::psglyphs",uindex,0))) {
+ if (used > 0 && buf [used-1] == '(')
+ --used;
+ else
+ buf[used++] = ')';
+ buf[used++] = '/';
+ while( (*glyphname) && (used < (MAXUSE+27)))
+ buf[used++] = *glyphname++ ;
+ buf[used++] = '(';
+ }
+
}
if (used >= MAXUSE) {
buf[used] = '\0';
@@ -2810,6 +2848,7 @@ Tk_TextLayoutToPostscript(interp, layout)
chunkPtr++;
}
buf[used++] = ')';
+ buf[used++] = ']';
buf[used++] = '\n';
buf[used] = '\0';
Tcl_AppendResult(interp, buf, (char *) NULL);
@@ -2954,7 +2993,7 @@ GetAttributeInfoObj(interp, faPtr, objPtr)
* returned for all options. */
{
int i, index, start, end;
- char *str;
+ CONST char *str;
Tcl_Obj *optionPtr, *valuePtr, *resultPtr;
resultPtr = Tcl_GetObjResult(interp);
@@ -3675,28 +3714,46 @@ TkDebugFont(tkwin, name)
return resultPtr;
}
-/* CYGNUS LOCAL: This routine is called on Windows to update a named
- font to a possibly new set of font attributes. */
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFontGetFirstTextLayout --
+ *
+ * This procedure returns the first chunk of a Tk_TextLayout,
+ * i.e. until the first font change on the first line (or the
+ * whole first line if there is no such font change).
+ *
+ * Results:
+ * The return value is the byte length of the chunk, the chunk
+ * itself is copied into dst and its Tk_Font into font.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
-void
-TkUpdateFonts(tkwin, changed)
- Tk_Window tkwin;
- int (*changed) _ANSI_ARGS_((TkFontAttributes *faPtr));
+int
+TkFontGetFirstTextLayout(
+ Tk_TextLayout layout, /* Layout information, from a previous call
+ * to Tk_ComputeTextLayout(). */
+ Tk_Font * font,
+ char * dst)
{
- TkFontInfo *fiPtr;
- Tcl_HashEntry *namedHashPtr;
- Tcl_HashSearch search;
- NamedFont *nfPtr;
-
- fiPtr = ((TkWindow *) tkwin)->mainPtr->fontInfoPtr;
+ TextLayout *layoutPtr;
+ LayoutChunk *chunkPtr;
+ int numBytesInChunk;
- namedHashPtr = Tcl_FirstHashEntry(&fiPtr->namedTable, &search);
- while (namedHashPtr != NULL) {
- nfPtr = (NamedFont *) Tcl_GetHashValue(namedHashPtr);
- if ((*changed)(&nfPtr->fa)) {
- UpdateDependentFonts(fiPtr, tkwin, namedHashPtr);
- }
- namedHashPtr = Tcl_NextHashEntry(&search);
+ layoutPtr = (TextLayout *)layout;
+ if ((layoutPtr==NULL)
+ || (layoutPtr->numChunks==0)
+ || (layoutPtr->chunks->numDisplayChars <= 0)) {
+ dst[0] = '\0';
+ return 0;
}
+ chunkPtr = layoutPtr->chunks;
+ numBytesInChunk = chunkPtr->numBytes;
+ strncpy(dst, chunkPtr->start, (size_t) numBytesInChunk);
+ *font = layoutPtr->tkfont;
+ return numBytesInChunk;
}
-
diff --git a/tk/generic/tkFont.h b/tk/generic/tkFont.h
index 5c891e3e8e5..ee99ae74e21 100644
--- a/tk/generic/tkFont.h
+++ b/tk/generic/tkFont.h
@@ -220,13 +220,7 @@ EXTERN void TkpGetFontFamilies _ANSI_ARGS_((Tcl_Interp *interp,
EXTERN TkFont * TkpGetNativeFont _ANSI_ARGS_((Tk_Window tkwin,
CONST char *name));
-/* CYGNUS LOCAL */
-EXTERN void TkUpdateFonts _ANSI_ARGS_((Tk_Window tkwin,
- int (*changed) (TkFontAttributes *faPtr)));
-
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKFONT */
-
-
diff --git a/tk/generic/tkFrame.c b/tk/generic/tkFrame.c
index 949fb18c226..0bf63824032 100644
--- a/tk/generic/tkFrame.c
+++ b/tk/generic/tkFrame.c
@@ -1,8 +1,8 @@
/*
* tkFrame.c --
*
- * This module implements "frame" and "toplevel" widgets for
- * the Tk toolkit. Frames are windows with a background color
+ * This module implements "frame", "labelframe" 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.
*
@@ -20,6 +20,14 @@
#include "tkInt.h"
/*
+ * The following enum is used to define the type of the frame.
+ */
+
+enum FrameType {
+ TYPE_FRAME, TYPE_TOPLEVEL, TYPE_LABELFRAME
+};
+
+/*
* A data structure of the following type is kept for each
* frame that currently exists for this process:
*/
@@ -35,11 +43,11 @@ typedef struct {
Tcl_Interp *interp; /* Interpreter associated with widget. Used
* to delete widget command. */
Tcl_Command widgetCmd; /* Token for frame's widget command. */
+ Tk_OptionTable optionTable; /* Table that defines configuration options
+ * available for this widget. */
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. */
+ enum FrameType type; /* Type of widget, such as TYPE_FRAME. */
char *screenName; /* Screen on which widget is created. Non-null
* only for top-levels. Malloc-ed, may be
* NULL. */
@@ -82,9 +90,63 @@ typedef struct {
* windows this is NULL. */
int flags; /* Various flags; see below for
* definitions. */
+ Tcl_Obj *padXPtr; /* Value of -padx option: specifies how many
+ * pixels of extra space to leave on left and
+ * right of child area. */
+ int padX; /* Integer value corresponding to padXPtr. */
+ Tcl_Obj *padYPtr; /* Value of -padx option: specifies how many
+ * pixels of extra space to leave above and
+ * below child area. */
+ int padY; /* Integer value corresponding to padYPtr. */
} Frame;
/*
+ * A data structure of the following type is kept for each labelframe
+ * widget managed by this file:
+ */
+
+typedef struct {
+ Frame frame; /* A pointer to the generic frame structure.
+ * This must be the first element of the
+ * Labelframe. */
+
+ /*
+ * Labelframe specific configuration settings.
+ */
+
+ Tcl_Obj *textPtr; /* Value of -text option: specifies text to
+ * display in button. */
+ Tk_Font tkfont; /* Value of -font option: specifies font
+ * to use for display text. */
+ XColor *textColorPtr; /* Value of -fg option: specifies foreground
+ * color in normal mode. */
+ int labelAnchor; /* Value of -labelanchor option: specifies
+ * where to place the label. */
+ Tk_Window labelWin; /* Value of -labelwidget option: Window to
+ * use as label for the frame. */
+
+ /*
+ * Labelframe specific fields for use with configuration settings above.
+ */
+
+ GC textGC; /* GC for drawing text in normal mode. */
+ Tk_TextLayout textLayout; /* Stored text layout information. */
+ XRectangle labelBox; /* The label's actual size and position. */
+ int labelReqWidth; /* The label's requested width. */
+ int labelReqHeight; /* The label's requested height. */
+ int labelTextX, labelTextY; /* Position of the text to be drawn. */
+
+} Labelframe;
+
+/*
+ * The following macros define how many extra pixels to leave
+ * around a label's text.
+ */
+
+#define LABELSPACING 1
+#define LABELMARGIN 4
+
+/*
* Flag bits for frames:
*
* REDRAW_PENDING: Non-zero means a DoWhenIdle handler
@@ -98,129 +160,264 @@ typedef struct {
#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.
+ * The following enum is used to define a type for the -labelanchor option
+ * of the Labelframe widget. These values are used as indices into the
+ * string table below.
*/
-#define FRAME TK_CONFIG_USER_BIT
-#define TOPLEVEL (TK_CONFIG_USER_BIT << 1)
-#define BOTH (FRAME | TOPLEVEL)
-
-static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_BORDER, "-background", "background", "Background",
- DEF_FRAME_BG_COLOR, Tk_Offset(Frame, border),
- BOTH|TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK},
- {TK_CONFIG_BORDER, "-background", "background", "Background",
- DEF_FRAME_BG_MONO, Tk_Offset(Frame, border),
- BOTH|TK_CONFIG_MONO_ONLY|TK_CONFIG_NULL_OK},
- {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL,
- (char *) NULL, 0, BOTH},
- {TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL,
- (char *) NULL, 0, BOTH},
- {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_FRAME_BORDER_WIDTH, Tk_Offset(Frame, borderWidth), BOTH},
- {TK_CONFIG_STRING, "-class", "class", "Class",
- DEF_FRAME_CLASS, Tk_Offset(Frame, className), FRAME},
- {TK_CONFIG_STRING, "-class", "class", "Class",
- DEF_TOPLEVEL_CLASS, Tk_Offset(Frame, className), TOPLEVEL},
- {TK_CONFIG_STRING, "-colormap", "colormap", "Colormap",
- DEF_FRAME_COLORMAP, Tk_Offset(Frame, colormapName),
- BOTH|TK_CONFIG_NULL_OK},
- {TK_CONFIG_BOOLEAN, "-container", "container", "Container",
- DEF_FRAME_CONTAINER, Tk_Offset(Frame, isContainer), BOTH},
- {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_FRAME_CURSOR, Tk_Offset(Frame, cursor), BOTH|TK_CONFIG_NULL_OK},
- {TK_CONFIG_PIXELS, "-height", "height", "Height",
- DEF_FRAME_HEIGHT, Tk_Offset(Frame, height), BOTH},
- {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG,
- Tk_Offset(Frame, highlightBgColorPtr), BOTH},
- {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_FRAME_HIGHLIGHT, Tk_Offset(Frame, highlightColorPtr), BOTH},
- {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness",
- DEF_FRAME_HIGHLIGHT_WIDTH, Tk_Offset(Frame, highlightWidth), BOTH},
- {TK_CONFIG_STRING, "-menu", "menu", "Menu",
- DEF_TOPLEVEL_MENU, Tk_Offset(Frame, menuName),
- TOPLEVEL|TK_CONFIG_NULL_OK},
- {TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_FRAME_RELIEF, Tk_Offset(Frame, relief), BOTH},
- {TK_CONFIG_STRING, "-screen", "screen", "Screen",
- DEF_TOPLEVEL_SCREEN, Tk_Offset(Frame, screenName),
- TOPLEVEL|TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_FRAME_TAKE_FOCUS, Tk_Offset(Frame, takeFocus),
- BOTH|TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-use", "use", "Use",
- DEF_FRAME_USE, Tk_Offset(Frame, useThis), TOPLEVEL|TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-visual", "visual", "Visual",
- DEF_FRAME_VISUAL, Tk_Offset(Frame, visualName),
- BOTH|TK_CONFIG_NULL_OK},
- {TK_CONFIG_PIXELS, "-width", "width", "Width",
- DEF_FRAME_WIDTH, Tk_Offset(Frame, width), BOTH},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+enum labelanchor {
+ LABELANCHOR_E, LABELANCHOR_EN, LABELANCHOR_ES,
+ LABELANCHOR_N, LABELANCHOR_NE, LABELANCHOR_NW,
+ LABELANCHOR_S, LABELANCHOR_SE, LABELANCHOR_SW,
+ LABELANCHOR_W, LABELANCHOR_WN, LABELANCHOR_WS
+};
+
+static char *labelAnchorStrings[] = {
+ "e", "en", "es", "n", "ne", "nw", "s", "se", "sw", "w", "wn", "ws",
+ (char *) NULL
+};
+
+/*
+ * Information used for parsing configuration options. There are
+ * one common table used by all and one table for each widget class.
+ */
+
+static Tk_OptionSpec commonOptSpec[] = {
+ {TK_OPTION_BORDER, "-background", "background", "Background",
+ DEF_FRAME_BG_COLOR, -1, Tk_Offset(Frame, border),
+ TK_OPTION_NULL_OK, (ClientData) DEF_FRAME_BG_MONO, 0},
+ {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_STRING, "-colormap", "colormap", "Colormap",
+ DEF_FRAME_COLORMAP, -1, Tk_Offset(Frame, colormapName),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_BOOLEAN, "-container", "container", "Container",
+ DEF_FRAME_CONTAINER, -1, Tk_Offset(Frame, isContainer),
+ 0, 0, 0},
+ {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
+ DEF_FRAME_CURSOR, -1, Tk_Offset(Frame, cursor),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-height", "height", "Height",
+ DEF_FRAME_HEIGHT, -1, Tk_Offset(Frame, height),
+ 0, 0, 0},
+ {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
+ "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG, -1,
+ Tk_Offset(Frame, highlightBgColorPtr), 0, 0, 0},
+ {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
+ DEF_FRAME_HIGHLIGHT, -1, Tk_Offset(Frame, highlightColorPtr),
+ 0, 0, 0},
+ {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
+ "HighlightThickness", DEF_FRAME_HIGHLIGHT_WIDTH, -1,
+ Tk_Offset(Frame, highlightWidth), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-padx", "padX", "Pad",
+ DEF_FRAME_PADX, Tk_Offset(Frame, padXPtr),
+ Tk_Offset(Frame, padX), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-pady", "padY", "Pad",
+ DEF_FRAME_PADY, Tk_Offset(Frame, padYPtr),
+ Tk_Offset(Frame, padY), 0, 0, 0},
+ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
+ DEF_FRAME_TAKE_FOCUS, -1, Tk_Offset(Frame, takeFocus),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-visual", "visual", "Visual",
+ DEF_FRAME_VISUAL, -1, Tk_Offset(Frame, visualName),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-width", "width", "Width",
+ DEF_FRAME_WIDTH, -1, Tk_Offset(Frame, width),
+ 0, 0, 0},
+ {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, 0, 0, 0, 0}
+};
+
+static Tk_OptionSpec frameOptSpec[] = {
+ {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
+ DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-class", "class", "Class",
+ DEF_FRAME_CLASS, -1, Tk_Offset(Frame, className),
+ 0, 0, 0},
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
+ DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief),
+ 0, 0, 0},
+ {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
+};
+
+static Tk_OptionSpec toplevelOptSpec[] = {
+ {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
+ DEF_FRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-class", "class", "Class",
+ DEF_TOPLEVEL_CLASS, -1, Tk_Offset(Frame, className),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-menu", "menu", "Menu",
+ DEF_TOPLEVEL_MENU, -1, Tk_Offset(Frame, menuName),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
+ DEF_FRAME_RELIEF, -1, Tk_Offset(Frame, relief),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-screen", "screen", "Screen",
+ DEF_TOPLEVEL_SCREEN, -1, Tk_Offset(Frame, screenName),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-use", "use", "Use",
+ DEF_TOPLEVEL_USE, -1, Tk_Offset(Frame, useThis),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
+};
+
+static Tk_OptionSpec labelframeOptSpec[] = {
+ {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
+ DEF_LABELFRAME_BORDER_WIDTH, -1, Tk_Offset(Frame, borderWidth),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-class", "class", "Class",
+ DEF_LABELFRAME_CLASS, -1, Tk_Offset(Frame, className),
+ 0, 0, 0},
+ {TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_FONT, "-font", "font", "Font",
+ DEF_LABELFRAME_FONT, -1, Tk_Offset(Labelframe, tkfont), 0, 0, 0},
+ {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
+ DEF_LABELFRAME_FG, -1, Tk_Offset(Labelframe, textColorPtr), 0, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-labelanchor", "labelAnchor", "LabelAnchor",
+ DEF_LABELFRAME_LABELANCHOR, -1, Tk_Offset(Labelframe, labelAnchor),
+ 0, (ClientData) labelAnchorStrings, 0},
+ {TK_OPTION_WINDOW, "-labelwidget", "labelWidget", "LabelWidget",
+ (char *) NULL, -1, Tk_Offset(Labelframe, labelWin),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
+ DEF_LABELFRAME_RELIEF, -1, Tk_Offset(Frame, relief),
+ 0, 0, 0},
+ {TK_OPTION_STRING, "-text", "text", "Text",
+ DEF_LABELFRAME_TEXT, Tk_Offset(Labelframe, textPtr), -1,
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, 0, 0, (ClientData) commonOptSpec, 0}
+};
+
+/*
+ * Class names for widgets, indexed by FrameType.
+ */
+
+static char *classNames[] = {"Frame", "Toplevel", "Labelframe"};
+
+/*
+ * The following table maps from FrameType to the option template for
+ * that class of widgets.
+ */
+
+static Tk_OptionSpec *optionSpecs[] = {
+ frameOptSpec,
+ toplevelOptSpec,
+ labelframeOptSpec,
};
/*
* Forward declarations for procedures defined later in this file:
*/
+static void ComputeFrameGeometry _ANSI_ARGS_((Frame *framePtr));
static int ConfigureFrame _ANSI_ARGS_((Tcl_Interp *interp,
- Frame *framePtr, int objc, Tcl_Obj *CONST objv[],
- int flags));
+ Frame *framePtr, int objc, Tcl_Obj *CONST objv[]));
static int CreateFrame _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc, Tcl_Obj *CONST argv[],
- int toplevel, char *appName));
+ enum FrameType type, char *appName));
static void DestroyFrame _ANSI_ARGS_((char *memPtr));
+static void DestroyFramePartly _ANSI_ARGS_((Frame *framePtr));
static void DisplayFrame _ANSI_ARGS_((ClientData clientData));
static void FrameCmdDeletedProc _ANSI_ARGS_((
ClientData clientData));
static void FrameEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
+static void FrameLostSlaveProc _ANSI_ARGS_((
+ ClientData clientData, Tk_Window tkwin));
+static void FrameRequestProc _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin));
+static void FrameStructureProc _ANSI_ARGS_((
+ ClientData clientData, XEvent *eventPtr));
static int FrameWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static void FrameWorldChanged _ANSI_ARGS_((
+ ClientData instanceData));
static void MapFrame _ANSI_ARGS_((ClientData clientData));
+
+/*
+ * The structure below defines frame class behavior by means of procedures
+ * that can be invoked from generic window code.
+ */
+
+static Tk_ClassProcs frameClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ FrameWorldChanged /* worldChangedProc */
+};
+
+/*
+ * The structure below defines the official type record for the
+ * labelframe's geometry manager:
+ */
+
+static Tk_GeomMgr frameGeomType = {
+ "labelframe", /* name */
+ FrameRequestProc, /* requestProc */
+ FrameLostSlaveProc /* lostSlaveProc */
+};
+
/*
*--------------------------------------------------------------
*
- * Tk_FrameObjCmd, Tk_ToplevelObjCmd --
+ * Tk_FrameObjCmd, Tk_ToplevelObjCmd, Tk_LabelframeObjCmd --
*
- * These procedures are invoked to process the "frame" and
- * "toplevel" Tcl commands. See the user documentation for
- * details on what they do.
+ * These procedures are invoked to process the "frame",
+ * "toplevel" and "labelframe" 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.
+ * they call CreateFrame to do all of the real work.
*
*--------------------------------------------------------------
*/
int
Tk_FrameObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
+ ClientData clientData; /* Either NULL or pointer to option table. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- return CreateFrame(clientData, interp, objc, objv, 0, (char *) NULL);
+ return CreateFrame(clientData, interp, objc, objv, TYPE_FRAME,
+ (char *) NULL);
}
int
Tk_ToplevelObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
+ ClientData clientData; /* Either NULL or pointer to option table. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ return CreateFrame(clientData, interp, objc, objv, TYPE_TOPLEVEL,
+ (char *) NULL);
+}
+
+int
+Tk_LabelframeObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* Either NULL or pointer to option table. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- return CreateFrame(clientData, interp, objc, objv, 1, (char *) NULL);
+ return CreateFrame(clientData, interp, objc, objv, TYPE_LABELFRAME,
+ (char *) NULL);
}
/*
@@ -228,10 +425,10 @@ Tk_ToplevelObjCmd(clientData, interp, objc, objv)
*
* TkCreateFrame --
*
- * 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.
+ * This procedure is the old command procedure for the "frame"
+ * and "toplevel" commands. Now it is used 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.
@@ -244,16 +441,15 @@ Tk_ToplevelObjCmd(clientData, interp, objc, objv)
int
TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
- ClientData clientData; /* Main window associated with interpreter.
- * If we're called by Tk_Init to create a
- * new application, then this is NULL. */
+ ClientData clientData; /* Either NULL or pointer to option table. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
char **argv; /* 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
+ char *appName; /* Should only be non-NULL if there is no main
+ * window associated with the interpreter.
+ * Gives the base name to use for the
* new application. */
{
int result, i;
@@ -263,7 +459,8 @@ TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
Tcl_IncrRefCount(objv[i]);
}
objv[argc] = NULL;
- result = CreateFrame(clientData, interp, argc, objv, toplevel, appName);
+ result = CreateFrame(clientData, interp, argc, objv,
+ toplevel ? TYPE_TOPLEVEL : TYPE_FRAME, appName);
for (i=0; i<argc; i++) {
Tcl_DecrRefCount(objv[i]);
}
@@ -272,23 +469,22 @@ TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
}
static int
-CreateFrame(clientData, interp, objc, objv, toplevel, appName)
- ClientData clientData; /* Main window associated with interpreter.
- * If we're called by Tk_Init to create a
- * new application, then this is NULL. */
+CreateFrame(clientData, interp, objc, objv, type, appName)
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
- 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
+ enum FrameType type; /* What widget type to create. */
+ char *appName; /* Should only be non-NULL if there are no
+ * Main window associated with the interpreter.
+ * Gives the base name to use for the
* new application. */
{
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_Window tkwin;
Frame *framePtr;
+ Tk_OptionTable optionTable;
Tk_Window new;
- char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
+ CONST char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
int i, c, depth;
size_t length;
unsigned int mask;
@@ -301,6 +497,13 @@ CreateFrame(clientData, interp, objc, objv, toplevel, appName)
}
/*
+ * Create the option table for this widget class. If it has already
+ * been created, the cached pointer will be returned.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, optionSpecs[type]);
+
+ /*
* 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
@@ -321,10 +524,10 @@ CreateFrame(clientData, interp, objc, objv, toplevel, appName)
} else if ((c == 'c')
&& (strncmp(arg, "-colormap", length) == 0)) {
colormapName = Tcl_GetString(objv[i+1]);
- } else if ((c == 's') && toplevel
+ } else if ((c == 's') && (type == TYPE_TOPLEVEL)
&& (strncmp(arg, "-screen", length) == 0)) {
screenName = Tcl_GetString(objv[i+1]);
- } else if ((c == 'u') && toplevel
+ } else if ((c == 'u') && (type == TYPE_TOPLEVEL)
&& (strncmp(arg, "-use", length) == 0)) {
useOption = Tcl_GetString(objv[i+1]);
} else if ((c == 'v')
@@ -349,8 +552,16 @@ CreateFrame(clientData, interp, objc, objv, toplevel, appName)
*/
if (screenName == NULL) {
- screenName = (toplevel) ? "" : NULL;
+ screenName = (type == TYPE_TOPLEVEL) ? "" : NULL;
}
+
+ /*
+ * Main window associated with interpreter.
+ * If we're called by Tk_Init to create a
+ * new application, then this is NULL.
+ */
+
+ tkwin = Tk_MainWindow(interp);
if (tkwin != NULL) {
new = Tk_CreateWindowFromPath(interp, tkwin, Tcl_GetString(objv[1]),
screenName);
@@ -370,7 +581,7 @@ CreateFrame(clientData, interp, objc, objv, toplevel, appName)
if (className == NULL) {
className = Tk_GetOption(new, "class", "Class");
if (className == NULL) {
- className = (toplevel) ? "Toplevel" : "Frame";
+ className = classNames[type];
}
}
Tk_SetClass(new, className);
@@ -410,7 +621,7 @@ CreateFrame(clientData, interp, objc, objv, toplevel, appName)
* doesn't request a size for itself.
*/
- if (toplevel) {
+ if (type == TYPE_TOPLEVEL) {
Tk_GeometryRequest(new, 200, 200);
}
@@ -420,57 +631,56 @@ CreateFrame(clientData, interp, objc, objv, toplevel, appName)
* in the widget record from the special options.
*/
- framePtr = (Frame *) ckalloc(sizeof(Frame));
- framePtr->tkwin = new;
- framePtr->display = Tk_Display(new);
- framePtr->interp = interp;
- framePtr->widgetCmd = Tcl_CreateObjCommand(interp,
+ if (type == TYPE_LABELFRAME) {
+ framePtr = (Frame *) ckalloc(sizeof(Labelframe));
+ memset((void *) framePtr, 0, (sizeof(Labelframe)));
+ } else {
+ framePtr = (Frame *) ckalloc(sizeof(Frame));
+ memset((void *) framePtr, 0, (sizeof(Frame)));
+ }
+ framePtr->tkwin = new;
+ framePtr->display = Tk_Display(new);
+ framePtr->interp = interp;
+ framePtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(new), FrameWidgetObjCmd,
(ClientData) framePtr, FrameCmdDeletedProc);
- framePtr->className = NULL;
- framePtr->mask = (toplevel) ? TOPLEVEL : FRAME;
- framePtr->screenName = NULL;
- framePtr->visualName = NULL;
- framePtr->colormapName = NULL;
+ framePtr->optionTable = optionTable;
+ framePtr->type = type;
framePtr->colormap = colormap;
- framePtr->border = NULL;
- framePtr->borderWidth = 0;
framePtr->relief = TK_RELIEF_FLAT;
- framePtr->highlightWidth = 0;
- framePtr->highlightBgColorPtr = NULL;
- framePtr->highlightColorPtr = NULL;
- framePtr->width = 0;
- framePtr->height = 0;
framePtr->cursor = None;
- framePtr->takeFocus = NULL;
- framePtr->isContainer = 0;
- framePtr->useThis = NULL;
- framePtr->flags = 0;
- framePtr->menuName = NULL;
+
+ if (framePtr->type == TYPE_LABELFRAME) {
+ Labelframe *labelframePtr = (Labelframe *) framePtr;
+ labelframePtr->labelAnchor = LABELANCHOR_NW;
+ labelframePtr->textGC = None;
+ }
/*
* Store backreference to frame widget in window structure.
*/
- TkSetClassProcs(new, NULL, (ClientData) framePtr);
+ Tk_SetClassProcs(new, &frameClass, (ClientData) framePtr);
mask = ExposureMask | StructureNotifyMask | FocusChangeMask;
- if (toplevel) {
+ if (type == TYPE_TOPLEVEL) {
mask |= ActivateMask;
}
Tk_CreateEventHandler(new, mask, FrameEventProc, (ClientData) framePtr);
- if (ConfigureFrame(interp, framePtr, objc-2, objv+2, 0) != TCL_OK) {
+ if ((Tk_InitOptions(interp, (char *) framePtr, optionTable, new)
+ != TCL_OK) ||
+ (ConfigureFrame(interp, framePtr, objc-2, objv+2) != 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.");
- return TCL_ERROR;
+ Tcl_AppendResult(interp, "A window cannot have both the -use ",
+ "and the -container option set.", (char *) NULL);
+ goto error;
}
}
- if (toplevel) {
+ if (type == TYPE_TOPLEVEL) {
Tcl_DoWhenIdle(MapFrame, (ClientData) framePtr);
}
Tcl_SetResult(interp, Tk_PathName(new), TCL_STATIC);
@@ -508,7 +718,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *frameOptions[] = {
+ static CONST char *frameOptions[] = {
"cget", "configure", (char *) NULL
};
enum options {
@@ -518,6 +728,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
int result = TCL_OK, index;
size_t length;
int c, i;
+ Tcl_Obj *objPtr;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
@@ -535,17 +746,28 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
result = TCL_ERROR;
goto done;
}
- result = Tk_ConfigureValue(interp, framePtr->tkwin, configSpecs,
- (char *) framePtr, Tcl_GetString(objv[2]), framePtr->mask);
+ objPtr = Tk_GetOptionValue(interp, (char *) framePtr,
+ framePtr->optionTable, objv[2], framePtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ goto done;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
break;
}
case FRAME_CONFIGURE: {
- if (objc == 2) {
- result = Tk_ConfigureInfo(interp, framePtr->tkwin, configSpecs,
- (char *) framePtr, (char *) NULL, framePtr->mask);
- } else if (objc == 3) {
- result = Tk_ConfigureInfo(interp, framePtr->tkwin, configSpecs,
- (char *) framePtr, Tcl_GetString(objv[2]), framePtr->mask);
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) framePtr,
+ framePtr->optionTable,
+ (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
+ framePtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ goto done;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ }
} else {
/*
* Don't allow the options -class, -colormap, -container,
@@ -560,17 +782,17 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
c = arg[1];
if (((c == 'c') && (strncmp(arg, "-class", length) == 0)
&& (length >= 2))
- || ((c == 'c') && (framePtr->mask == TOPLEVEL)
+ || ((c == 'c')
&& (strncmp(arg, "-colormap", length) == 0)
&& (length >= 3))
|| ((c == 'c')
&& (strncmp(arg, "-container", length) == 0)
&& (length >= 3))
- || ((c == 's') && (framePtr->mask == TOPLEVEL)
+ || ((c == 's') && (framePtr->type == TYPE_TOPLEVEL)
&& (strncmp(arg, "-screen", length) == 0))
- || ((c == 'u') && (framePtr->mask == TOPLEVEL)
+ || ((c == 'u') && (framePtr->type == TYPE_TOPLEVEL)
&& (strncmp(arg, "-use", length) == 0))
- || ((c == 'v') && (framePtr->mask == TOPLEVEL)
+ || ((c == 'v')
&& (strncmp(arg, "-visual", length) == 0))) {
Tcl_AppendResult(interp, "can't modify ", arg,
" option after widget is created", (char *) NULL);
@@ -578,8 +800,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
goto done;
}
}
- result = ConfigureFrame(interp, framePtr, objc-2, objv+2,
- TK_CONFIG_ARGV_ONLY);
+ result = ConfigureFrame(interp, framePtr, objc-2, objv+2);
}
break;
}
@@ -613,9 +834,14 @@ DestroyFrame(memPtr)
char *memPtr; /* Info about frame widget. */
{
register Frame *framePtr = (Frame *) memPtr;
+ register Labelframe *labelframePtr = (Labelframe *) memPtr;
- Tk_FreeOptions(configSpecs, (char *) framePtr, framePtr->display,
- framePtr->mask);
+ if (framePtr->type == TYPE_LABELFRAME) {
+ Tk_FreeTextLayout(labelframePtr->textLayout);
+ if (labelframePtr->textGC != None) {
+ Tk_FreeGC(framePtr->display, labelframePtr->textGC);
+ }
+ }
if (framePtr->colormap != None) {
Tk_FreeColormap(framePtr->display, framePtr->colormap);
}
@@ -625,6 +851,47 @@ DestroyFrame(memPtr)
/*
*----------------------------------------------------------------------
*
+ * DestroyFramePartly --
+ *
+ * This procedure is invoked to clean up everything that needs
+ * tkwin to be defined when deleted. During the destruction
+ * process tkwin is always set to NULL and this procedure must
+ * be called before that happens.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Some things associated with the frame are freed up.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DestroyFramePartly(framePtr)
+ Frame *framePtr; /* Info about frame widget. */
+{
+ register Labelframe *labelframePtr = (Labelframe *) framePtr;
+
+ if (framePtr->type == TYPE_LABELFRAME && labelframePtr->labelWin != NULL) {
+ Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask,
+ FrameStructureProc, (ClientData) framePtr);
+ Tk_ManageGeometry(labelframePtr->labelWin, (Tk_GeomMgr *) NULL,
+ (ClientData) NULL);
+ if (framePtr->tkwin != Tk_Parent(labelframePtr->labelWin)) {
+ Tk_UnmaintainGeometry(labelframePtr->labelWin, framePtr->tkwin);
+ }
+ Tk_UnmapWindow(labelframePtr->labelWin);
+ labelframePtr->labelWin = NULL;
+ }
+
+ Tk_FreeConfigOptions((char *) framePtr, framePtr->optionTable,
+ framePtr->tkwin);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* ConfigureFrame --
*
* This procedure is called to process an objv/objc list, plus
@@ -644,16 +911,18 @@ DestroyFrame(memPtr)
*/
static int
-ConfigureFrame(interp, framePtr, objc, objv, flags)
+ConfigureFrame(interp, framePtr, objc, objv)
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 Tk_ConfigureWidget. */
{
+ Tk_SavedOptions savedOptions;
char *oldMenuName;
-
+ Tk_Window oldWindow = NULL;
+ Labelframe *labelframePtr = (Labelframe *) framePtr;
+
/*
* Need the old menubar name for the menu code to delete it.
*/
@@ -664,13 +933,25 @@ ConfigureFrame(interp, framePtr, objc, objv, flags)
oldMenuName = ckalloc(strlen(framePtr->menuName) + 1);
strcpy(oldMenuName, framePtr->menuName);
}
-
- if (Tk_ConfigureWidget(interp, framePtr->tkwin, configSpecs,
- objc, (char **) objv, (char *) framePtr,
- flags | framePtr->mask | TK_CONFIG_OBJS) != TCL_OK) {
+
+ if (framePtr->type == TYPE_LABELFRAME) {
+ oldWindow = labelframePtr->labelWin;
+ }
+ if (Tk_SetOptions(interp, (char *) framePtr,
+ framePtr->optionTable, objc, objv,
+ framePtr->tkwin, &savedOptions, (int *) NULL) != TCL_OK) {
+ if (oldMenuName != NULL) {
+ ckfree(oldMenuName);
+ }
return TCL_ERROR;
+ } else {
+ Tk_FreeSavedOptions(&savedOptions);
}
+ /*
+ * A few of the options require additional processing.
+ */
+
if (((oldMenuName == NULL) && (framePtr->menuName != NULL))
|| ((oldMenuName != NULL) && (framePtr->menuName == NULL))
|| ((oldMenuName != NULL) && (framePtr->menuName != NULL)
@@ -678,7 +959,11 @@ ConfigureFrame(interp, framePtr, objc, objv, flags)
TkSetWindowMenuBar(interp, framePtr->tkwin, oldMenuName,
framePtr->menuName);
}
-
+
+ if (oldMenuName != NULL) {
+ ckfree(oldMenuName);
+ }
+
if (framePtr->border != NULL) {
Tk_SetBackgroundFromBorder(framePtr->tkwin, framePtr->border);
} else {
@@ -688,24 +973,391 @@ ConfigureFrame(interp, framePtr, objc, objv, flags)
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 (framePtr->padX < 0) {
+ framePtr->padX = 0;
+ }
+ if (framePtr->padY < 0) {
+ framePtr->padY = 0;
}
- if (oldMenuName != NULL) {
- ckfree(oldMenuName);
+ /*
+ * If a -labelwidget is specified, check that it is valid and set
+ * up geometry management for it.
+ */
+
+ if (framePtr->type == TYPE_LABELFRAME) {
+ if (oldWindow != labelframePtr->labelWin) {
+ if (oldWindow != NULL) {
+ Tk_DeleteEventHandler(oldWindow, StructureNotifyMask,
+ FrameStructureProc, (ClientData) framePtr);
+ Tk_ManageGeometry(oldWindow, (Tk_GeomMgr *) NULL,
+ (ClientData) NULL);
+ Tk_UnmaintainGeometry(oldWindow, framePtr->tkwin);
+ Tk_UnmapWindow(oldWindow);
+ }
+ if (labelframePtr->labelWin != NULL) {
+ Tk_Window ancestor, parent, sibling = NULL;
+
+ /*
+ * Make sure that the frame is either the parent of the
+ * window used as label or a descendant of that
+ * parent. Also, don't allow a top-level window to be
+ * managed inside the frame.
+ */
+
+ parent = Tk_Parent(labelframePtr->labelWin);
+ for (ancestor = framePtr->tkwin; ;
+ ancestor = Tk_Parent(ancestor)) {
+ if (ancestor == parent) {
+ break;
+ }
+ sibling = ancestor;
+ if (Tk_IsTopLevel(ancestor)) {
+ badWindow:
+ Tcl_AppendResult(interp, "can't use ",
+ Tk_PathName(labelframePtr->labelWin),
+ " as label in this frame", (char *) NULL);
+ labelframePtr->labelWin = NULL;
+ return TCL_ERROR;
+ }
+ }
+ if (Tk_IsTopLevel(labelframePtr->labelWin)) {
+ goto badWindow;
+ }
+ if (labelframePtr->labelWin == framePtr->tkwin) {
+ goto badWindow;
+ }
+ Tk_CreateEventHandler(labelframePtr->labelWin,
+ StructureNotifyMask, FrameStructureProc,
+ (ClientData) framePtr);
+ Tk_ManageGeometry(labelframePtr->labelWin, &frameGeomType,
+ (ClientData) framePtr);
+
+ /*
+ * If the frame is not parent to the label, make
+ * sure the label is above its sibling in the stacking
+ * order.
+ */
+
+ if (sibling != NULL) {
+ Tk_RestackWindow(labelframePtr->labelWin, Above, sibling);
+ }
+ }
+ }
+ }
+
+ FrameWorldChanged((ClientData) framePtr);
+
+ return TCL_OK;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FrameWorldChanged --
+ *
+ * This procedure is called when the world has changed in some
+ * way and the widget needs to recompute all its graphics contexts
+ * and determine its new geometry.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Frame will be relayed out and redisplayed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+FrameWorldChanged(instanceData)
+ ClientData instanceData; /* Information about widget. */
+{
+ Frame *framePtr = (Frame *) instanceData;
+ Labelframe *labelframePtr = (Labelframe *) framePtr;
+ Tk_Window tkwin = framePtr->tkwin;
+ XGCValues gcValues;
+ GC gc;
+ int anyTextLabel, anyWindowLabel;
+ int bWidthLeft, bWidthRight, bWidthTop, bWidthBottom;
+ char *labelText;
+
+ anyTextLabel = (framePtr->type == TYPE_LABELFRAME) &&
+ (labelframePtr->textPtr != NULL) &&
+ (labelframePtr->labelWin == NULL);
+ anyWindowLabel = (framePtr->type == TYPE_LABELFRAME) &&
+ (labelframePtr->labelWin != NULL);
+
+ if (framePtr->type == TYPE_LABELFRAME) {
+ /*
+ * The textGC is needed even in the labelWin case, so it's
+ * always created for a labelframe.
+ */
+
+ gcValues.font = Tk_FontId(labelframePtr->tkfont);
+ gcValues.foreground = labelframePtr->textColorPtr->pixel;
+ gcValues.graphics_exposures = False;
+ gc = Tk_GetGC(tkwin, GCForeground | GCFont | GCGraphicsExposures,
+ &gcValues);
+ if (labelframePtr->textGC != None) {
+ Tk_FreeGC(framePtr->display, labelframePtr->textGC);
+ }
+ labelframePtr->textGC = gc;
+
+ /*
+ * Calculate label size.
+ */
+
+ labelframePtr->labelReqWidth = labelframePtr->labelReqHeight = 0;
+
+ if (anyTextLabel) {
+ labelText = Tcl_GetString(labelframePtr->textPtr);
+ Tk_FreeTextLayout(labelframePtr->textLayout);
+ labelframePtr->textLayout = Tk_ComputeTextLayout(labelframePtr->tkfont,
+ labelText, -1, 0, TK_JUSTIFY_CENTER, 0,
+ &labelframePtr->labelReqWidth, &labelframePtr->labelReqHeight);
+ labelframePtr->labelReqWidth += 2 * LABELSPACING;
+ labelframePtr->labelReqHeight += 2 * LABELSPACING;
+ } else if (anyWindowLabel) {
+ labelframePtr->labelReqWidth = Tk_ReqWidth(labelframePtr->labelWin);
+ labelframePtr->labelReqHeight = Tk_ReqHeight(labelframePtr->labelWin);
+ }
+
+ /*
+ * Make sure label size is at least as big as the border.
+ * This simplifies later calculations and gives a better
+ * appearance with thick borders.
+ */
+
+ if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
+ (labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
+ if (labelframePtr->labelReqHeight < framePtr->borderWidth) {
+ labelframePtr->labelReqHeight = framePtr->borderWidth;
+ }
+ } else {
+ if (labelframePtr->labelReqWidth < framePtr->borderWidth) {
+ labelframePtr->labelReqWidth = framePtr->borderWidth;
+ }
+ }
+ }
+
+ /*
+ * Calculate individual border widths.
+ */
+
+ bWidthBottom = bWidthTop = bWidthRight = bWidthLeft =
+ framePtr->borderWidth + framePtr->highlightWidth;
+
+ bWidthLeft += framePtr->padX;
+ bWidthRight += framePtr->padX;
+ bWidthTop += framePtr->padY;
+ bWidthBottom += framePtr->padY;
+
+ if (anyTextLabel || anyWindowLabel) {
+ switch (labelframePtr->labelAnchor) {
+ case LABELANCHOR_E:
+ case LABELANCHOR_EN:
+ case LABELANCHOR_ES:
+ bWidthRight += labelframePtr->labelReqWidth -
+ framePtr->borderWidth;
+ break;
+ case LABELANCHOR_N:
+ case LABELANCHOR_NE:
+ case LABELANCHOR_NW:
+ bWidthTop += labelframePtr->labelReqHeight - framePtr->borderWidth;
+ break;
+ case LABELANCHOR_S:
+ case LABELANCHOR_SE:
+ case LABELANCHOR_SW:
+ bWidthBottom += labelframePtr->labelReqHeight -
+ framePtr->borderWidth;
+ break;
+ default:
+ bWidthLeft += labelframePtr->labelReqWidth - framePtr->borderWidth;
+ break;
+ }
+ }
+
+ Tk_SetInternalBorderEx(tkwin, bWidthLeft, bWidthRight, bWidthTop,
+ bWidthBottom);
+
+ ComputeFrameGeometry(framePtr);
+
+ /*
+ * A labelframe should request size for its label.
+ */
+
+ if (framePtr->type == TYPE_LABELFRAME) {
+ int minwidth = labelframePtr->labelReqWidth;
+ int minheight = labelframePtr->labelReqHeight;
+ int padding = framePtr->highlightWidth;
+ if (framePtr->borderWidth > 0) {
+ padding += framePtr->borderWidth + LABELMARGIN;
+ }
+ padding *= 2;
+ if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
+ (labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
+ minwidth += padding;
+ minheight += framePtr->borderWidth + framePtr->highlightWidth;
+ } else {
+ minheight += padding;
+ minwidth += framePtr->borderWidth + framePtr->highlightWidth;
+ }
+ Tk_SetMinimumRequestSize(tkwin, minwidth, minheight);
+ }
+
+ if ((framePtr->width > 0) || (framePtr->height > 0)) {
+ Tk_GeometryRequest(tkwin, framePtr->width, framePtr->height);
}
- if (Tk_IsMapped(framePtr->tkwin)) {
+ if (Tk_IsMapped(tkwin)) {
if (!(framePtr->flags & REDRAW_PENDING)) {
Tcl_DoWhenIdle(DisplayFrame, (ClientData) framePtr);
}
framePtr->flags |= REDRAW_PENDING;
}
- return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ComputeFrameGeometry --
+ *
+ * This procedure is called to compute various geometrical
+ * information for a frame, such as where various things get
+ * displayed. It's called when the window is reconfigured.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Display-related numbers get changed in *framePtr.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ComputeFrameGeometry(framePtr)
+ register Frame *framePtr; /* Information about widget. */
+{
+ int otherWidth, otherHeight, otherWidthT, otherHeightT, padding;
+ int maxWidth, maxHeight;
+ Tk_Window tkwin;
+ Labelframe *labelframePtr = (Labelframe *) framePtr;
+
+ /*
+ * We have nothing to do here unless there is a label.
+ */
+
+ if (framePtr->type != TYPE_LABELFRAME) return;
+ if ((labelframePtr->textPtr == NULL) &&
+ (labelframePtr->labelWin == NULL)) return;
+
+ tkwin = framePtr->tkwin;
+
+ /*
+ * Calculate the available size for the label
+ */
+
+ labelframePtr->labelBox.width = labelframePtr->labelReqWidth;
+ labelframePtr->labelBox.height = labelframePtr->labelReqHeight;
+
+ padding = framePtr->highlightWidth;
+ if (framePtr->borderWidth > 0) {
+ padding += framePtr->borderWidth + LABELMARGIN;
+ }
+ padding *= 2;
+
+ maxHeight = Tk_Height(tkwin);
+ maxWidth = Tk_Width(tkwin);
+
+ if ((labelframePtr->labelAnchor >= LABELANCHOR_N) &&
+ (labelframePtr->labelAnchor <= LABELANCHOR_SW)) {
+ maxWidth -= padding;
+ if (maxWidth < 1) maxWidth = 1;
+ } else {
+ maxHeight -= padding;
+ if (maxHeight < 1) maxHeight = 1;
+ }
+ if (labelframePtr->labelBox.width > maxWidth) {
+ labelframePtr->labelBox.width = maxWidth;
+ }
+ if (labelframePtr->labelBox.height > maxHeight) {
+ labelframePtr->labelBox.height = maxHeight;
+ }
+
+ /*
+ * Calculate label and text position.
+ * The text's position is based on the requested size (= the text's
+ * real size) to get proper alignment if the text does not fit.
+ */
+
+ otherWidth = Tk_Width(tkwin) - labelframePtr->labelBox.width;
+ otherHeight = Tk_Height(tkwin) - labelframePtr->labelBox.height;
+ otherWidthT = Tk_Width(tkwin) - labelframePtr->labelReqWidth;
+ otherHeightT = Tk_Height(tkwin) - labelframePtr->labelReqHeight;
+ padding = framePtr->highlightWidth;
+
+ switch (labelframePtr->labelAnchor) {
+ case LABELANCHOR_E:
+ case LABELANCHOR_EN:
+ case LABELANCHOR_ES:
+ labelframePtr->labelTextX = otherWidthT - padding;
+ labelframePtr->labelBox.x = otherWidth - padding;
+ break;
+ case LABELANCHOR_N:
+ case LABELANCHOR_NE:
+ case LABELANCHOR_NW:
+ labelframePtr->labelTextY = padding;
+ labelframePtr->labelBox.y = padding;
+ break;
+ case LABELANCHOR_S:
+ case LABELANCHOR_SE:
+ case LABELANCHOR_SW:
+ labelframePtr->labelTextY = otherHeightT - padding;
+ labelframePtr->labelBox.y = otherHeight - padding;
+ break;
+ default:
+ labelframePtr->labelTextX = padding;
+ labelframePtr->labelBox.x = padding;
+ break;
+ }
+
+ if (framePtr->borderWidth > 0) {
+ padding += framePtr->borderWidth + LABELMARGIN;
+ }
+
+ switch (labelframePtr->labelAnchor) {
+ case LABELANCHOR_NW:
+ case LABELANCHOR_SW:
+ labelframePtr->labelTextX = padding;
+ labelframePtr->labelBox.x = padding;
+ break;
+ case LABELANCHOR_N:
+ case LABELANCHOR_S:
+ labelframePtr->labelTextX = otherWidthT / 2;
+ labelframePtr->labelBox.x = otherWidth / 2;
+ break;
+ case LABELANCHOR_NE:
+ case LABELANCHOR_SE:
+ labelframePtr->labelTextX = otherWidthT - padding;
+ labelframePtr->labelBox.x = otherWidth - padding;
+ break;
+ case LABELANCHOR_EN:
+ case LABELANCHOR_WN:
+ labelframePtr->labelTextY = padding;
+ labelframePtr->labelBox.y = padding;
+ break;
+ case LABELANCHOR_E:
+ case LABELANCHOR_W:
+ labelframePtr->labelTextY = otherHeightT / 2;
+ labelframePtr->labelBox.y = otherHeight / 2;
+ break;
+ default:
+ labelframePtr->labelTextY = otherHeightT - padding;
+ labelframePtr->labelBox.y = otherHeight - padding;
+ break;
+ }
}
/*
@@ -731,8 +1383,9 @@ DisplayFrame(clientData)
{
register Frame *framePtr = (Frame *) clientData;
register Tk_Window tkwin = framePtr->tkwin;
- void (* drawFunction) _ANSI_ARGS_((Tk_Window, Drawable, Tk_3DBorder,
- int, int, int, int, int, int)) = Tk_Fill3DRectangle;
+ int bdX1, bdY1, bdX2, bdY2, hlWidth;
+ Pixmap pixmap;
+ TkRegion clipRegion = NULL;
framePtr->flags &= ~REDRAW_PENDING;
if ((framePtr->tkwin == NULL) || !Tk_IsMapped(tkwin)
@@ -740,15 +1393,13 @@ DisplayFrame(clientData)
return;
}
- if (framePtr->border != NULL) {
- drawFunction(tkwin, Tk_WindowId(tkwin),
- framePtr->border, framePtr->highlightWidth,
- framePtr->highlightWidth,
- Tk_Width(tkwin) - 2*framePtr->highlightWidth,
- Tk_Height(tkwin) - 2*framePtr->highlightWidth,
- framePtr->borderWidth, framePtr->relief);
- }
- if (framePtr->highlightWidth != 0) {
+ /*
+ * Highlight shall always be drawn if it exists, so do that first.
+ */
+
+ hlWidth = framePtr->highlightWidth;
+
+ if (hlWidth != 0) {
GC fgGC, bgGC;
bgGC = Tk_GCForColor(framePtr->highlightBgColorPtr,
@@ -756,13 +1407,179 @@ DisplayFrame(clientData)
if (framePtr->flags & GOT_FOCUS) {
fgGC = Tk_GCForColor(framePtr->highlightColorPtr,
Tk_WindowId(tkwin));
- TkpDrawHighlightBorder(tkwin, fgGC, bgGC, framePtr->highlightWidth,
+ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, hlWidth,
Tk_WindowId(tkwin));
} else {
- TkpDrawHighlightBorder(tkwin, bgGC, bgGC, framePtr->highlightWidth,
+ TkpDrawHighlightBorder(tkwin, bgGC, bgGC, hlWidth,
Tk_WindowId(tkwin));
}
}
+
+ /*
+ * If -background is set to "", no interior is drawn.
+ */
+
+ if (framePtr->border == NULL) return;
+
+ if (framePtr->type != TYPE_LABELFRAME) {
+ /*
+ * There is no label so there is just a simple rectangle to draw.
+ */
+
+ noLabel:
+ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin),
+ framePtr->border, hlWidth, hlWidth,
+ Tk_Width(tkwin) - 2 * hlWidth,
+ Tk_Height(tkwin) - 2 * hlWidth,
+ framePtr->borderWidth, framePtr->relief);
+ } else {
+ Labelframe *labelframePtr = (Labelframe *) framePtr;
+
+ if ((labelframePtr->textPtr == NULL) &&
+ (labelframePtr->labelWin == NULL)) {
+ goto noLabel;
+ }
+
+ /*
+ * In order to avoid screen flashes, this procedure redraws the
+ * frame into off-screen memory, then copies it back on-screen
+ * in a single operation. This means there's no point in time
+ * where the on-screen image has been cleared.
+ */
+
+ pixmap = Tk_GetPixmap(framePtr->display, Tk_WindowId(tkwin),
+ Tk_Width(tkwin), Tk_Height(tkwin), Tk_Depth(tkwin));
+
+ /*
+ * Clear the pixmap.
+ */
+
+ Tk_Fill3DRectangle(tkwin, pixmap, framePtr->border, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+
+ /*
+ * Calculate how the label affects the border's position.
+ */
+
+ bdX1 = bdY1 = hlWidth;
+ bdX2 = Tk_Width(tkwin) - hlWidth;
+ bdY2 = Tk_Height(tkwin) - hlWidth;
+
+ switch (labelframePtr->labelAnchor) {
+ case LABELANCHOR_E:
+ case LABELANCHOR_EN:
+ case LABELANCHOR_ES:
+ bdX2 -= (labelframePtr->labelBox.width - framePtr->borderWidth)
+ / 2;
+ break;
+ case LABELANCHOR_N:
+ case LABELANCHOR_NE:
+ case LABELANCHOR_NW:
+ /*
+ * Since the glyphs of the text tend to be in the lower part
+ * we favor a lower border position by rounding up.
+ */
+
+ bdY1 += (labelframePtr->labelBox.height - framePtr->borderWidth +1)
+ / 2;
+ break;
+ case LABELANCHOR_S:
+ case LABELANCHOR_SE:
+ case LABELANCHOR_SW:
+ bdY2 -= (labelframePtr->labelBox.height - framePtr->borderWidth)
+ / 2;
+ break;
+ default:
+ bdX1 += (labelframePtr->labelBox.width - framePtr->borderWidth)
+ / 2;
+ break;
+ }
+
+ /*
+ * Draw border
+ */
+
+ Tk_Draw3DRectangle(tkwin, pixmap, framePtr->border, bdX1, bdY1,
+ bdX2 - bdX1, bdY2 - bdY1, framePtr->borderWidth,
+ framePtr->relief);
+
+ if (labelframePtr->labelWin == NULL) {
+ /*
+ * Clear behind the label
+ */
+
+ Tk_Fill3DRectangle(tkwin, pixmap,
+ framePtr->border, labelframePtr->labelBox.x,
+ labelframePtr->labelBox.y, labelframePtr->labelBox.width,
+ labelframePtr->labelBox.height, 0, TK_RELIEF_FLAT);
+
+ /*
+ * Draw label.
+ * If there is not room for the entire label, use clipping to
+ * get a nice appearance.
+ */
+
+ if ((labelframePtr->labelBox.width < labelframePtr->labelReqWidth)
+ || (labelframePtr->labelBox.height <
+ labelframePtr->labelReqHeight)) {
+ clipRegion = TkCreateRegion();
+ TkUnionRectWithRegion(&labelframePtr->labelBox, clipRegion,
+ clipRegion);
+ TkSetRegion(framePtr->display, labelframePtr->textGC,
+ clipRegion);
+ }
+
+ Tk_DrawTextLayout(framePtr->display, pixmap,
+ labelframePtr->textGC, labelframePtr->textLayout,
+ labelframePtr->labelTextX + LABELSPACING,
+ labelframePtr->labelTextY + LABELSPACING, 0, -1);
+
+ if (clipRegion != NULL) {
+ XSetClipMask(framePtr->display, labelframePtr->textGC, None);
+ TkDestroyRegion(clipRegion);
+ }
+ } else {
+ /*
+ * Reposition and map the window (but in different ways depending
+ * on whether the frame is the window's parent).
+ */
+
+ if (framePtr->tkwin == Tk_Parent(labelframePtr->labelWin)) {
+ if ((labelframePtr->labelBox.x != Tk_X(labelframePtr->labelWin))
+ || (labelframePtr->labelBox.y !=
+ Tk_Y(labelframePtr->labelWin))
+ || (labelframePtr->labelBox.width !=
+ Tk_Width(labelframePtr->labelWin))
+ || (labelframePtr->labelBox.height !=
+ Tk_Height(labelframePtr->labelWin))) {
+ Tk_MoveResizeWindow(labelframePtr->labelWin,
+ labelframePtr->labelBox.x, labelframePtr->labelBox.y,
+ labelframePtr->labelBox.width,
+ labelframePtr->labelBox.height);
+ }
+ Tk_MapWindow(labelframePtr->labelWin);
+ } else {
+ Tk_MaintainGeometry(labelframePtr->labelWin, framePtr->tkwin,
+ labelframePtr->labelBox.x, labelframePtr->labelBox.y,
+ labelframePtr->labelBox.width,
+ labelframePtr->labelBox.height);
+ }
+ }
+
+
+ /*
+ * Everything's been redisplayed; now copy the pixmap onto the screen
+ * and free up the pixmap.
+ */
+
+ XCopyArea(framePtr->display, pixmap, Tk_WindowId(tkwin),
+ labelframePtr->textGC, hlWidth, hlWidth,
+ (unsigned) (Tk_Width(tkwin) - 2 * hlWidth),
+ (unsigned) (Tk_Height(tkwin) - 2 * hlWidth),
+ hlWidth, hlWidth);
+ Tk_FreePixmap(framePtr->display, pixmap);
+ }
+
}
/*
@@ -791,8 +1608,10 @@ FrameEventProc(clientData, eventPtr)
{
register Frame *framePtr = (Frame *) clientData;
- if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0))
- || (eventPtr->type == ConfigureNotify)) {
+ if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
+ goto redraw;
+ } else if (eventPtr->type == ConfigureNotify) {
+ ComputeFrameGeometry(framePtr);
goto redraw;
} else if (eventPtr->type == DestroyNotify) {
if (framePtr->menuName != NULL) {
@@ -812,7 +1631,14 @@ FrameEventProc(clientData, eventPtr)
* could be gone by then. To do so, delete the event handler
* explicitly (normally it's done implicitly by Tk_DestroyWindow).
*/
-
+
+ /*
+ * Since the tkwin pointer will be gone when we reach
+ * DestroyFrame, we must free all options now.
+ */
+
+ DestroyFramePartly(framePtr);
+
Tk_DeleteEventHandler(framePtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
FrameEventProc, (ClientData) framePtr);
@@ -891,6 +1717,13 @@ FrameCmdDeletedProc(clientData)
*/
if (tkwin != NULL) {
+ /*
+ * Some options need tkwin to be freed, so we free them here,
+ * before setting tkwin to NULL.
+ */
+
+ DestroyFramePartly(framePtr);
+
framePtr->tkwin = NULL;
Tk_DestroyWindow(tkwin);
}
@@ -982,4 +1815,115 @@ TkInstallFrameMenu(tkwin)
framePtr->menuName);
}
}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * FrameStructureProc --
+ *
+ * This procedure is invoked whenever StructureNotify events
+ * occur for a window that's managed as label for the frame.
+ * This procudure's only purpose is to clean up when windows
+ * are deleted.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The window is disassociated from the frame when it is
+ * deleted.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+FrameStructureProc(clientData, eventPtr)
+ ClientData clientData; /* Pointer to record describing frame. */
+ XEvent *eventPtr; /* Describes what just happened. */
+{
+ Labelframe *labelframePtr = (Labelframe *) clientData;
+
+ if (eventPtr->type == DestroyNotify) {
+ /*
+ * This should only happen in a labelframe but it doesn't
+ * hurt to be careful.
+ */
+
+ if (labelframePtr->frame.type == TYPE_LABELFRAME) {
+ labelframePtr->labelWin = NULL;
+ FrameWorldChanged((ClientData) labelframePtr);
+ }
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * FrameRequestProc --
+ *
+ * This procedure is invoked whenever a window that's associated
+ * with a frame changes its requested dimensions.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The size and location on the screen of the window may change.
+ * depending on the options specified for the frame.
+ *
+ *--------------------------------------------------------------
+ */
+static void
+FrameRequestProc(clientData, tkwin)
+ ClientData clientData; /* Pointer to record for frame. */
+ Tk_Window tkwin; /* Window that changed its desired
+ * size. */
+{
+ Frame *framePtr = (Frame *) clientData;
+
+ FrameWorldChanged((ClientData) framePtr);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * FrameLostSlaveProc --
+ *
+ * This procedure is invoked by Tk whenever some other geometry
+ * claims control over a slave that used to be managed by us.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Forgets all frame-related information about the slave.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+FrameLostSlaveProc(clientData, tkwin)
+ ClientData clientData; /* Frame structure for slave window that
+ * was stolen away. */
+ Tk_Window tkwin; /* Tk's handle for the slave window. */
+{
+ Frame *framePtr = (Frame *) clientData;
+ Labelframe *labelframePtr = (Labelframe *) clientData;
+
+ /*
+ * This should only happen in a labelframe but it doesn't
+ * hurt to be careful.
+ */
+
+ if (labelframePtr->frame.type == TYPE_LABELFRAME) {
+ Tk_DeleteEventHandler(labelframePtr->labelWin, StructureNotifyMask,
+ FrameStructureProc, (ClientData) labelframePtr);
+ if (framePtr->tkwin != Tk_Parent(labelframePtr->labelWin)) {
+ Tk_UnmaintainGeometry(labelframePtr->labelWin, framePtr->tkwin);
+ }
+ Tk_UnmapWindow(labelframePtr->labelWin);
+ labelframePtr->labelWin = NULL;
+ }
+ FrameWorldChanged((ClientData) framePtr);
+}
diff --git a/tk/generic/tkGC.c b/tk/generic/tkGC.c
index 8ddcd391e4c..8096d39e7d1 100644
--- a/tk/generic/tkGC.c
+++ b/tk/generic/tkGC.c
@@ -84,7 +84,7 @@ Tk_GetGC(tkwin, valueMask, valuePtr)
Drawable d, freeDrawable;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (!dispPtr->gcInit) {
+ if (dispPtr->gcInit <= 0) {
GCInit(dispPtr);
}
@@ -300,6 +300,14 @@ Tk_FreeGC(display, gc)
if (!dispPtr->gcInit) {
panic("Tk_FreeGC called before Tk_GetGC");
}
+ if (dispPtr->gcInit < 0) {
+ /*
+ * The GCCleanup has been called, and remaining GCs have been
+ * freed. This may still get called by other things shutting
+ * down, but the GCs should no longer be in use.
+ */
+ return;
+ }
idHashPtr = Tcl_FindHashEntry(&dispPtr->gcIdTable, (char *) gc);
if (idHashPtr == NULL) {
@@ -319,6 +327,51 @@ Tk_FreeGC(display, gc)
/*
*----------------------------------------------------------------------
*
+ * TkGCCleanup --
+ *
+ * Frees the structures used for GC management.
+ * We need to have it called near the end, when other cleanup that
+ * calls Tk_FreeGC is all done.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * GC resources are freed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkGCCleanup(dispPtr)
+ TkDisplay *dispPtr; /* display to clean up resources in */
+{
+ Tcl_HashEntry *entryPtr;
+ Tcl_HashSearch search;
+ TkGC *gcPtr;
+
+ for (entryPtr = Tcl_FirstHashEntry(&dispPtr->gcIdTable, &search);
+ entryPtr != NULL;
+ entryPtr = Tcl_NextHashEntry(&search)) {
+ gcPtr = (TkGC *) Tcl_GetHashValue(entryPtr);
+ /*
+ * This call is not needed, as it is only used on Unix to restore
+ * the Id to the stack pool, and we don't want to use them anymore.
+ * Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc));
+ */
+ XFreeGC(gcPtr->display, gcPtr->gc);
+ Tcl_DeleteHashEntry(gcPtr->valueHashPtr);
+ Tcl_DeleteHashEntry(entryPtr);
+ ckfree((char *) gcPtr);
+ }
+ Tcl_DeleteHashTable(&dispPtr->gcValueTable);
+ Tcl_DeleteHashTable(&dispPtr->gcIdTable);
+ dispPtr->gcInit = -1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* GCInit --
*
* Initialize the structures used for GC management.
@@ -336,6 +389,9 @@ static void
GCInit(dispPtr)
TkDisplay *dispPtr;
{
+ if (dispPtr->gcInit < 0) {
+ panic("called GCInit after GCCleanup");
+ }
dispPtr->gcInit = 1;
Tcl_InitHashTable(&dispPtr->gcValueTable, sizeof(ValueKey)/sizeof(int));
Tcl_InitHashTable(&dispPtr->gcIdTable, TCL_ONE_WORD_KEYS);
diff --git a/tk/generic/tkGeometry.c b/tk/generic/tkGeometry.c
index fcc33e33d55..fed10c9a6fe 100644
--- a/tk/generic/tkGeometry.c
+++ b/tk/generic/tkGeometry.c
@@ -165,6 +165,79 @@ Tk_GeometryRequest(tkwin, reqWidth, reqHeight)
/*
*----------------------------------------------------------------------
*
+ * Tk_SetInternalBorderEx --
+ *
+ * Notify relevant geometry managers that a window has an internal
+ * border of a given width and that child windows should not be
+ * placed on that border.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The border widths are recorded for the window, and all geometry
+ * managers of all children are notified so that can re-layout, if
+ * necessary.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_SetInternalBorderEx(tkwin, left, right, top, bottom)
+ Tk_Window tkwin; /* Window that will have internal border. */
+ int left, right; /* Width of internal border, in pixels. */
+ int top, bottom;
+{
+ register TkWindow *winPtr = (TkWindow *) tkwin;
+ register int changed = 0;
+
+ if (left < 0) {
+ left = 0;
+ }
+ if (left != winPtr->internalBorderLeft) {
+ winPtr->internalBorderLeft = left;
+ changed = 1;
+ }
+
+ if (right < 0) {
+ right = 0;
+ }
+ if (right != winPtr->internalBorderRight) {
+ winPtr->internalBorderRight = right;
+ changed = 1;
+ }
+
+ if (top < 0) {
+ top = 0;
+ }
+ if (top != winPtr->internalBorderTop) {
+ winPtr->internalBorderTop = top;
+ changed = 1;
+ }
+
+ if (bottom < 0) {
+ bottom = 0;
+ }
+ if (bottom != winPtr->internalBorderBottom) {
+ winPtr->internalBorderBottom = bottom;
+ changed = 1;
+ }
+
+ /*
+ * All the slaves for which this is the master window must now be
+ * repositioned to take account of the new internal border width.
+ * To signal all the geometry managers to do this, just resize the
+ * window to its current size. The ConfigureNotify event will
+ * cause geometry managers to recompute everything.
+ */
+
+ if (changed) {
+ Tk_ResizeWindow(tkwin, Tk_Width(tkwin), Tk_Height(tkwin));
+ }
+}
+/*
+ *----------------------------------------------------------------------
+ *
* Tk_SetInternalBorder --
*
* Notify relevant geometry managers that a window has an internal
@@ -187,19 +260,45 @@ Tk_SetInternalBorder(tkwin, width)
Tk_Window tkwin; /* Window that will have internal border. */
int width; /* Width of internal border, in pixels. */
{
+ Tk_SetInternalBorderEx(tkwin, width, width, width, width);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_SetMinimumRequestSize --
+ *
+ * Notify relevant geometry managers that a window has a minimum
+ * request size.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The minimum request size is recorded for the window, and
+ * a new size is requested for the window, if necessary.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_SetMinimumRequestSize(tkwin, minWidth, minHeight)
+ Tk_Window tkwin; /* Window that will have internal border. */
+ int minWidth, minHeight; /* Minimum requested size, in pixels. */
+{
register TkWindow *winPtr = (TkWindow *) tkwin;
- if (width == winPtr->internalBorderWidth) {
+ if ((winPtr->minReqWidth == minWidth) &&
+ (winPtr->minReqHeight == minHeight)) {
return;
}
- if (width < 0) {
- width = 0;
- }
- winPtr->internalBorderWidth = width;
+
+ winPtr->minReqWidth = minWidth;
+ winPtr->minReqHeight = minHeight;
/*
- * All the slaves for which this is the master window must now be
- * repositioned to take account of the new internal border width.
+ * The changed min size may cause geometry managers to get a
+ * different result, so make them recompute.
* To signal all the geometry managers to do this, just resize the
* window to its current size. The ConfigureNotify event will
* cause geometry managers to recompute everything.
@@ -250,6 +349,26 @@ Tk_MaintainGeometry(slave, master, x, y, width, height)
Tk_Window ancestor, parent;
TkDisplay *dispPtr = ((TkWindow *) master)->dispPtr;
+ if (master == Tk_Parent(slave)) {
+ /*
+ * If the slave is a direct descendant of the master, don't bother
+ * setting up the extra infrastructure for management, just make a
+ * call to Tk_MoveResizeWindow; the parent/child relationship will
+ * take care of the rest.
+ */
+ Tk_MoveResizeWindow(slave, x, y, width, height);
+
+ /*
+ * Map the slave if the master is already mapped; otherwise, wait
+ * until the master is mapped later (in which case mapping the slave
+ * is taken care of elsewhere).
+ */
+ if (Tk_IsMapped(master)) {
+ Tk_MapWindow(slave);
+ }
+ return;
+ }
+
if (!dispPtr->geomInit) {
dispPtr->geomInit = 1;
Tcl_InitHashTable(&dispPtr->maintainHashTable, TCL_ONE_WORD_KEYS);
@@ -374,6 +493,15 @@ Tk_UnmaintainGeometry(slave, master)
Tk_Window ancestor;
TkDisplay *dispPtr = ((TkWindow *) slave)->dispPtr;
+ if (master == Tk_Parent(slave)) {
+ /*
+ * If the slave is a direct descendant of the master,
+ * Tk_MaintainGeometry will not have set up any of the extra
+ * infrastructure. Don't even bother to look for it, just return.
+ */
+ return;
+ }
+
if (!dispPtr->geomInit) {
dispPtr->geomInit = 1;
Tcl_InitHashTable(&dispPtr->maintainHashTable, TCL_ONE_WORD_KEYS);
@@ -570,4 +698,3 @@ MaintainCheckProc(clientData)
}
}
}
-
diff --git a/tk/generic/tkGet.c b/tk/generic/tkGet.c
index f9df1acb1a2..f102fac9b74 100644
--- a/tk/generic/tkGet.c
+++ b/tk/generic/tkGet.c
@@ -32,14 +32,19 @@ typedef struct ThreadSpecificData {
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
+static void FreeUidThreadExitProc _ANSI_ARGS_((ClientData clientData));
+
/*
* The following tables defines the string values for reliefs, which are
* used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj.
*/
-static char *anchorStrings[] = {"n", "ne", "e", "se", "s", "sw", "w", "nw",
- "center", (char *) NULL};
-static char *justifyStrings[] = {"left", "right", "center", (char *) NULL};
+static CONST char *anchorStrings[] = {
+ "n", "ne", "e", "se", "s", "sw", "w", "nw", "center", (char *) NULL
+};
+static CONST char *justifyStrings[] = {
+ "left", "right", "center", (char *) NULL
+};
/*
@@ -102,7 +107,7 @@ Tk_GetAnchorFromObj(interp, objPtr, anchorPtr)
int
Tk_GetAnchor(interp, string, anchorPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a direction. */
+ CONST char *string; /* String describing a direction. */
Tk_Anchor *anchorPtr; /* Where to store Tk_Anchor corresponding
* to string. */
{
@@ -176,7 +181,7 @@ Tk_GetAnchor(interp, string, anchorPtr)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfAnchor(anchor)
Tk_Anchor anchor; /* Anchor for which identifying string
* is desired. */
@@ -218,7 +223,7 @@ Tk_NameOfAnchor(anchor)
int
Tk_GetJoinStyle(interp, string, joinPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a justification style. */
+ CONST char *string; /* String describing a justification style. */
int *joinPtr; /* Where to store join style corresponding
* to string. */
{
@@ -264,7 +269,7 @@ Tk_GetJoinStyle(interp, string, joinPtr)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfJoinStyle(join)
int join; /* Join style for which identifying string
* is desired. */
@@ -300,7 +305,7 @@ Tk_NameOfJoinStyle(join)
int
Tk_GetCapStyle(interp, string, capPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a justification style. */
+ CONST char *string; /* String describing a justification style. */
int *capPtr; /* Where to store cap style corresponding
* to string. */
{
@@ -346,7 +351,7 @@ Tk_GetCapStyle(interp, string, capPtr)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfCapStyle(cap)
int cap; /* Cap style for which identifying string
* is desired. */
@@ -419,7 +424,7 @@ Tk_GetJustifyFromObj(interp, objPtr, justifyPtr)
int
Tk_GetJustify(interp, string, justifyPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
- char *string; /* String describing a justification style. */
+ CONST char *string; /* String describing a justification style. */
Tk_Justify *justifyPtr; /* Where to store Tk_Justify corresponding
* to string. */
{
@@ -465,7 +470,7 @@ Tk_GetJustify(interp, string, justifyPtr)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfJustify(justify)
Tk_Justify justify; /* Justification style for which
* identifying string is desired. */
@@ -481,6 +486,32 @@ Tk_NameOfJustify(justify)
/*
*----------------------------------------------------------------------
*
+ * FreeUidThreadExitProc --
+ *
+ * Cleans up memory used for Tk_Uids in the thread.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * All information in the identifier table is deleted.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+FreeUidThreadExitProc(clientData)
+ ClientData clientData; /* Not used. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_DeleteHashTable(&tsdPtr->uidTable);
+ tsdPtr->initialized = 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tk_GetUid --
*
* Given a string, this procedure returns a unique identifier
@@ -512,6 +543,7 @@ Tk_GetUid(string)
if (!tsdPtr->initialized) {
Tcl_InitHashTable(tablePtr, TCL_STRING_KEYS);
+ Tcl_CreateThreadExitHandler(FreeUidThreadExitProc, NULL);
tsdPtr->initialized = 1;
}
return (Tk_Uid) Tcl_GetHashKey(tablePtr,
@@ -545,7 +577,7 @@ Tk_GetScreenMM(interp, tkwin, string, doublePtr)
Tk_Window tkwin; /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- char *string; /* String describing a screen distance. */
+ CONST char *string; /* String describing a screen distance. */
double *doublePtr; /* Place to store converted result. */
{
char *end;
@@ -621,7 +653,7 @@ Tk_GetPixels(interp, tkwin, string, intPtr)
Tk_Window tkwin; /* Window whose screen determines conversion
* from centimeters and other absolute
* units. */
- char *string; /* String describing a number of pixels. */
+ CONST char *string; /* String describing a number of pixels. */
int *intPtr; /* Place to store converted result. */
{
double d;
@@ -717,4 +749,3 @@ TkGetDoublePixels(interp, tkwin, string, doublePtr)
}
-
diff --git a/tk/generic/tkGrab.c b/tk/generic/tkGrab.c
index 1ff6b8e1bcf..b5493a997cd 100644
--- a/tk/generic/tkGrab.c
+++ b/tk/generic/tkGrab.c
@@ -15,7 +15,7 @@
#include "tkPort.h"
#include "tkInt.h"
-#if !defined(__WIN32__) && !defined(MAC_TCL)
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
#include "tkUnixInt.h"
#endif
@@ -173,7 +173,7 @@ static void ReleaseButtonGrab _ANSI_ARGS_((TkDisplay *dispPtr));
/*
*----------------------------------------------------------------------
*
- * Tk_GrabCmd --
+ * Tk_GrabObjCmd --
*
* This procedure is invoked to process the "grab" Tcl command.
* See the user documentation for details on what it does.
@@ -189,137 +189,192 @@ static void ReleaseButtonGrab _ANSI_ARGS_((TkDisplay *dispPtr));
/* ARGSUSED */
int
-Tk_GrabCmd(clientData, interp, argc, argv)
+Tk_GrabObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- int globalGrab, c;
+ int globalGrab;
Tk_Window tkwin;
TkDisplay *dispPtr;
- size_t length;
-
- if (argc < 2) {
- badArgs:
+ char *arg;
+ int index;
+ int len;
+ static CONST char *optionStrings[] = { "current", "release",
+ "set", "status", (char *) NULL };
+
+ static CONST char *flagStrings[] = { "-global", (char *) NULL };
+
+ enum options { GRABCMD_CURRENT, GRABCMD_RELEASE,
+ GRABCMD_SET, GRABCMD_STATUS };
+
+ if (objc < 2) {
+ /*
+ * Can't use Tcl_WrongNumArgs here because we want the message to
+ * read:
+ * wrong # args: should be "cmd ?-global window" or "cmd option
+ * ?arg arg ...?"
+ * We can fake it with Tcl_WrongNumArgs if we assume the command name
+ * is "grab", but if it has been aliased, the message will be
+ * incorrect.
+ */
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " ?-global? window\" or \"", argv[0],
- " option ?arg arg ...?\"", (char *) NULL);
+ Tcl_GetString(objv[0]), " ?-global? window\" or \"",
+ Tcl_GetString(objv[0]), " option ?arg arg ...?\"",
+ (char *) NULL);
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if (c == '.') {
- if (argc != 2) {
- goto badArgs;
+
+ /*
+ * First check for a window name or "-global" as the first argument.
+ */
+
+ arg = Tcl_GetStringFromObj(objv[1], &len);
+ if (arg[0] == '.') {
+ /* [grab window] */
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?-global? window");
+ return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, argv[1], (Tk_Window) clientData);
+ tkwin = Tk_NameToWindow(interp, arg, (Tk_Window) clientData);
if (tkwin == NULL) {
return TCL_ERROR;
}
return Tk_Grab(interp, tkwin, 0);
- } else if ((c == '-') && (strncmp(argv[1], "-global", length) == 0)
- && (length >= 2)) {
- if (argc != 3) {
- goto badArgs;
+ } else if (arg[0] == '-' && len > 1) {
+ if (Tcl_GetIndexFromObj(interp, objv[1], flagStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, argv[2], (Tk_Window) clientData);
- if (tkwin == NULL) {
+
+ /* [grab -global window] */
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "?-global? window");
return TCL_ERROR;
}
- return Tk_Grab(interp, tkwin, 1);
- } else if ((c == 'c') && (strncmp(argv[1], "current", length) == 0)) {
- if (argc > 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " current ?window?\"", (char *) NULL);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ (Tk_Window) clientData);
+ if (tkwin == NULL) {
return TCL_ERROR;
}
- if (argc == 3) {
- tkwin = Tk_NameToWindow(interp, argv[2], (Tk_Window) clientData);
- if (tkwin == NULL) {
+ return Tk_Grab(interp, tkwin, 1);
+ }
+
+ /*
+ * First argument is not a window name and not "-global", find out
+ * which option it is.
+ */
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum options) index) {
+ case GRABCMD_CURRENT: {
+ /* [grab current ?window?] */
+ if (objc > 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "current ?window?");
return TCL_ERROR;
}
- dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (dispPtr->eventualGrabWinPtr != NULL) {
- Tcl_SetResult(interp, dispPtr->eventualGrabWinPtr->pathName,
- TCL_STATIC);
- }
- } else {
- for (dispPtr = TkGetDisplayList(); dispPtr != NULL;
- dispPtr = dispPtr->nextPtr) {
+ if (objc == 3) {
+ tkwin = Tk_NameToWindow(interp,
+ Tcl_GetString(objv[2]), (Tk_Window) clientData);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ dispPtr = ((TkWindow *) tkwin)->dispPtr;
if (dispPtr->eventualGrabWinPtr != NULL) {
- Tcl_AppendElement(interp,
- dispPtr->eventualGrabWinPtr->pathName);
+ Tcl_SetResult(interp,
+ dispPtr->eventualGrabWinPtr->pathName, TCL_STATIC);
+ }
+ } else {
+ for (dispPtr = TkGetDisplayList(); dispPtr != NULL;
+ dispPtr = dispPtr->nextPtr) {
+ if (dispPtr->eventualGrabWinPtr != NULL) {
+ Tcl_AppendElement(interp,
+ dispPtr->eventualGrabWinPtr->pathName);
+ }
}
}
+ return TCL_OK;
}
- return TCL_OK;
- } else if ((c == 'r') && (strncmp(argv[1], "release", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " release window\"", (char *) NULL);
- return TCL_ERROR;
- }
- tkwin = Tk_NameToWindow(interp, argv[2], (Tk_Window) clientData);
- if (tkwin == NULL) {
- Tcl_ResetResult(interp);
- } else {
- Tk_Ungrab(tkwin);
- }
- } else if ((c == 's') && (strncmp(argv[1], "set", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " set ?-global? window\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- globalGrab = 0;
- tkwin = Tk_NameToWindow(interp, argv[2], (Tk_Window) clientData);
- } else {
- globalGrab = 1;
- length = strlen(argv[2]);
- if ((strncmp(argv[2], "-global", length) != 0) || (length < 2)) {
- Tcl_AppendResult(interp, "bad argument \"", argv[2],
- "\": must be \"", argv[0], " set ?-global? window\"",
- (char *) NULL);
+
+ case GRABCMD_RELEASE: {
+ /* [grab release window] */
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "release window");
return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, argv[3], (Tk_Window) clientData);
- }
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- return Tk_Grab(interp, tkwin, globalGrab);
- } else if ((c == 's') && (strncmp(argv[1], "status", length) == 0)
- && (length >= 2)) {
- TkWindow *winPtr;
-
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " status window\"", (char *) NULL);
- return TCL_ERROR;
+ tkwin = Tk_NameToWindow(interp,
+ Tcl_GetString(objv[2]), (Tk_Window) clientData);
+ if (tkwin == NULL) {
+ Tcl_ResetResult(interp);
+ } else {
+ Tk_Ungrab(tkwin);
+ }
+ break;
}
- winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[2],
- (Tk_Window) clientData);
- if (winPtr == NULL) {
- return TCL_ERROR;
+
+ case GRABCMD_SET: {
+ /* [grab set ?-global? window] */
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "set ?-global? window");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ globalGrab = 0;
+ tkwin = Tk_NameToWindow(interp,
+ Tcl_GetString(objv[2]), (Tk_Window) clientData);
+ } else {
+ globalGrab = 1;
+ /*
+ * We could just test the argument by hand instead of using
+ * Tcl_GetIndexFromObj; the benefit of using the function is
+ * that it sets up the error message for us, so we are
+ * certain to be consistant with the rest of Tcl.
+ */
+ if (Tcl_GetIndexFromObj(interp, objv[2], flagStrings, "option",
+ 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ tkwin = Tk_NameToWindow(interp,
+ Tcl_GetString(objv[3]), (Tk_Window) clientData);
+ }
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ return Tk_Grab(interp, tkwin, globalGrab);
}
- dispPtr = winPtr->dispPtr;
- if (dispPtr->eventualGrabWinPtr != winPtr) {
- Tcl_SetResult(interp, "none", TCL_STATIC);
- } else if (dispPtr->grabFlags & GRAB_GLOBAL) {
- Tcl_SetResult(interp, "global", TCL_STATIC);
- } else {
- Tcl_SetResult(interp, "local", TCL_STATIC);
+
+ case GRABCMD_STATUS: {
+ /* [grab status window] */
+ TkWindow *winPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "status window");
+ return TCL_ERROR;
+ }
+ winPtr = (TkWindow *) Tk_NameToWindow(interp,
+ Tcl_GetString(objv[2]), (Tk_Window) clientData);
+ if (winPtr == NULL) {
+ return TCL_ERROR;
+ }
+ dispPtr = winPtr->dispPtr;
+ if (dispPtr->eventualGrabWinPtr != winPtr) {
+ Tcl_SetResult(interp, "none", TCL_STATIC);
+ } else if (dispPtr->grabFlags & GRAB_GLOBAL) {
+ Tcl_SetResult(interp, "global", TCL_STATIC);
+ } else {
+ Tcl_SetResult(interp, "local", TCL_STATIC);
+ }
+ break;
}
- } else {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
- "\": must be current, release, set, or status",
- (char *) NULL);
- return TCL_ERROR;
}
+
return TCL_OK;
}
@@ -687,7 +742,7 @@ TkPointerEvent(eventPtr, winPtr)
if (eventPtr->xcrossing.send_event != GENERATED_EVENT_MAGIC) {
if ((eventPtr->type == LeaveNotify) &&
- (winPtr->flags & TK_TOP_LEVEL)) {
+ (winPtr->flags & TK_TOP_HIERARCHY)) {
dispPtr->serverWinPtr = NULL;
} else {
dispPtr->serverWinPtr = winPtr;
@@ -886,7 +941,7 @@ TkChangeEventWindow(eventPtr, winPtr)
eventPtr->xmotion.subwindow = None;
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
- if (childPtr->flags & TK_TOP_LEVEL) {
+ if (childPtr->flags & TK_TOP_HIERARCHY) {
continue;
}
x = eventPtr->xmotion.x - childPtr->changes.x;
@@ -1171,7 +1226,7 @@ TkGrabDeadWindow(winPtr)
ReleaseButtonGrab(dispPtr);
}
if (dispPtr->serverWinPtr == winPtr) {
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
dispPtr->serverWinPtr = NULL;
} else {
dispPtr->serverWinPtr = winPtr->parentPtr;
@@ -1396,7 +1451,7 @@ FindCommonAncestor(winPtr1, winPtr2, countPtr1, countPtr2)
if (winPtr1 != NULL) {
for (winPtr = winPtr1; winPtr != NULL; winPtr = winPtr->parentPtr) {
winPtr->flags |= TK_GRAB_FLAG;
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
@@ -1416,7 +1471,7 @@ FindCommonAncestor(winPtr1, winPtr2, countPtr1, countPtr2)
ancestorPtr = winPtr;
break;
}
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
count2++;
break;
}
@@ -1438,7 +1493,7 @@ FindCommonAncestor(winPtr1, winPtr2, countPtr1, countPtr2)
if (winPtr == ancestorPtr) {
count1 = i;
}
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
if (count1 == -1) {
count1 = i+1;
}
@@ -1488,7 +1543,7 @@ TkPositionInTree(winPtr, treePtr)
if (winPtr2 == winPtr) {
return TK_GRAB_ANCESTOR;
}
- if (winPtr2->flags & TK_TOP_LEVEL) {
+ if (winPtr2->flags & TK_TOP_HIERARCHY) {
break;
}
}
@@ -1542,4 +1597,3 @@ TkGrabState(winPtr)
return TkPositionInTree(winPtr, grabWinPtr);
}
-
diff --git a/tk/generic/tkGrid.c b/tk/generic/tkGrid.c
index def4a434d49..9a94970dcba 100644
--- a/tk/generic/tkGrid.c
+++ b/tk/generic/tkGrid.c
@@ -42,6 +42,12 @@
#define TYPICAL_SIZE 25 /* (arbitrary guess) */
#define PREALLOC 10 /* extra slots to allocate */
+/*
+ * Pre-allocate room for uniform groups during layout.
+ */
+
+#define UNIFORM_PREALLOC 10
+
/*
* Data structures are allocated dynamically to support arbitrary sized tables.
* However, the space is proportional to the highest numbered slot with
@@ -75,6 +81,9 @@ typedef struct SlotInfo {
int pad; /* Extra padding, in pixels, required for
* this slot. This amount is "added" to the
* largest slave in the slot. */
+ Tk_Uid uniform; /* Value of -uniform option. It is used to
+ * group slots that should have the same
+ * size. */
int offset; /* This is a cached value used for
* introspection. It is the pixel
* offset of the right or bottom edge
@@ -103,6 +112,9 @@ typedef struct GridLayout {
* constrants, such as size or padding. */
int pad; /* Padding needed for this slot */
int weight; /* Slot weight, controls resizing. */
+ Tk_Uid uniform; /* Value of -uniform option. It is used to
+ * group slots that should have the same
+ * size. */
int minOffset; /* The minimum offset, in pixels, from
* the beginning of the layout to the
* right/bottom edge of the slot calculated
@@ -161,10 +173,13 @@ typedef struct Gridder {
int numCols, numRows; /* Number of columns or rows this slave spans.
* Should be at least 1. */
int padX, padY; /* Total additional pixels to leave around the
- * window (half of this space is left on each
- * side). This is space *outside* the window:
+ * window. Some is of this space is on each
+ * side. This is space *outside* the window:
* we'll allocate extra space in frame but
* won't enlarge window). */
+ int padLeft, padTop; /* The part of padX or padY to use on the
+ * left or top of the widget, respectively.
+ * By default, this is half of padX or padY. */
int iPadX, iPadY; /* Total extra pixels to allocate inside the
* window (half this amount will appear on
* each side). */
@@ -205,6 +220,16 @@ typedef struct Gridder {
#define STICK_SOUTH 4
#define STICK_WEST 8
+
+/*
+ * Structure to gather information about uniform groups during layout.
+ */
+
+typedef struct UniformGroup {
+ Tk_Uid group;
+ int minSize;
+} UniformGroup;
+
/*
* Flag values for Grid structures:
*
@@ -233,9 +258,25 @@ static void ArrangeGrid _ANSI_ARGS_((ClientData clientData));
static int CheckSlotData _ANSI_ARGS_((Gridder *masterPtr, int slot,
int slotType, int checkOnly));
static int ConfigureSlaves _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, int argc, char *argv[]));
+ Tk_Window tkwin, int objc, Tcl_Obj *CONST objv[]));
static void DestroyGrid _ANSI_ARGS_((char *memPtr));
static Gridder *GetGrid _ANSI_ARGS_((Tk_Window tkwin));
+static int GridBboxCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static int GridForgetRemoveCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static int GridInfoCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static int GridLocationCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static int GridPropagateCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static int GridRowColumnConfigureCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static int GridSizeCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+static int GridSlavesCommand _ANSI_ARGS_((Tk_Window tkwin,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
static void GridStructureProc _ANSI_ARGS_((
ClientData clientData, XEvent *eventPtr));
static void GridLostSlaveProc _ANSI_ARGS_((ClientData clientData,
@@ -243,6 +284,8 @@ static void GridLostSlaveProc _ANSI_ARGS_((ClientData clientData,
static void GridReqProc _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin));
static void InitMasterData _ANSI_ARGS_((Gridder *masterPtr));
+static Tcl_Obj *NewPairObj _ANSI_ARGS_((Tcl_Interp*, int, int));
+static Tcl_Obj *NewQuadObj _ANSI_ARGS_((Tcl_Interp*, int, int, int, int));
static int ResolveConstraints _ANSI_ARGS_((Gridder *gridPtr,
int rowOrColumn, int maxOffset));
static void SetGridSize _ANSI_ARGS_((Gridder *gridPtr));
@@ -250,6 +293,14 @@ static void StickyToString _ANSI_ARGS_((int flags, char *result));
static int StringToSticky _ANSI_ARGS_((char *string));
static void Unlink _ANSI_ARGS_((Gridder *gridPtr));
+/*
+ * Prototypes for procedures contained in other files but not exported
+ * using tkIntDecls.h
+ */
+
+void TkPrintPadAmount _ANSI_ARGS_((Tcl_Interp*, char*, int, int));
+int TkParsePadAmount _ANSI_ARGS_((Tcl_Interp*, Tk_Window, Tcl_Obj*, int*, int*));
+
static Tk_GeomMgr gridMgrType = {
"grid", /* name */
GridReqProc, /* requestProc */
@@ -274,632 +325,851 @@ static Tk_GeomMgr gridMgrType = {
*/
int
-Tk_GridCmd(clientData, interp, argc, argv)
+Tk_GridObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- Gridder *masterPtr; /* master grid record */
- GridMaster *gridPtr; /* pointer to grid data */
- size_t length; /* streing length of argument */
- char c; /* 1st character of argument */
+ static CONST char *optionStrings[] = {
+ "bbox", "columnconfigure", "configure", "forget",
+ "info", "location", "propagate", "remove",
+ "rowconfigure", "size", "slaves", (char *) NULL };
+ enum options {
+ GRID_BBOX, GRID_COLUMNCONFIGURE, GRID_CONFIGURE, GRID_FORGET,
+ GRID_INFO, GRID_LOCATION, GRID_PROPAGATE, GRID_REMOVE,
+ GRID_ROWCONFIGURE, GRID_SIZE, GRID_SLAVES };
+ int index;
+
- if ((argc >= 2) && ((argv[1][0] == '.') || (argv[1][0] == REL_SKIP) ||
- (argv[1][0] == REL_VERT))) {
- return ConfigureSlaves(interp, tkwin, argc-1, argv+1);
+ if (objc >= 2) {
+ char *argv1 = Tcl_GetString(objv[1]);
+ if ((argv1[0] == '.') || (argv1[0] == REL_SKIP) ||
+ (argv1[0] == REL_VERT)) {
+ return ConfigureSlaves(interp, tkwin, objc-1, objv+1);
+ }
}
- if (argc < 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " option arg ?arg ...?\"", (char *) NULL);
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
-
- if ((c == 'b') && (strncmp(argv[1], "bbox", length) == 0)) {
- Tk_Window master;
- int row, column; /* origin for bounding box */
- int row2, column2; /* end of bounding box */
- int endX, endY; /* last column/row in the layout */
- int x=0, y=0; /* starting pixels for this bounding box */
- int width, height; /* size of the bounding box */
- char buf[TCL_INTEGER_SPACE * 4];
-
- if (argc!=3 && argc != 5 && argc != 7) {
- Tcl_AppendResult(interp, "wrong number of arguments: ",
- "must be \"",argv[0],
- " bbox master ?column row ?column row??\"",
- (char *) NULL);
- return TCL_ERROR;
- }
-
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
- return TCL_ERROR;
- }
- masterPtr = GetGrid(master);
-
- if (argc >= 5) {
- if (Tcl_GetInt(interp, argv[3], &column) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetInt(interp, argv[4], &row) != TCL_OK) {
- return TCL_ERROR;
- }
- column2 = column;
- row2 = row;
- }
-
- if (argc == 7) {
- if (Tcl_GetInt(interp, argv[5], &column2) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_GetInt(interp, argv[6], &row2) != TCL_OK) {
- return TCL_ERROR;
- }
- }
-
- gridPtr = masterPtr->masterDataPtr;
- if (gridPtr == NULL) {
- Tcl_SetResult(interp, "0 0 0 0", TCL_STATIC);
- return(TCL_OK);
- }
- SetGridSize(masterPtr);
- endX = MAX(gridPtr->columnEnd, gridPtr->columnMax);
- endY = MAX(gridPtr->rowEnd, gridPtr->rowMax);
-
- if ((endX == 0) || (endY == 0)) {
- Tcl_SetResult(interp, "0 0 0 0", TCL_STATIC);
- return(TCL_OK);
- }
- if (argc == 3) {
- row = column = 0;
- row2 = endY;
- column2 = endX;
- }
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
- if (column > column2) {
- int temp = column;
- column = column2, column2 = temp;
- }
- if (row > row2) {
- int temp = row;
- row = row2, row2 = temp;
- }
+ switch ((enum options) index) {
+ case GRID_BBOX:
+ return GridBboxCommand(tkwin, interp, objc, objv);
+ case GRID_CONFIGURE:
+ return ConfigureSlaves(interp, tkwin, objc-2, objv+2);
+ case GRID_FORGET:
+ case GRID_REMOVE:
+ return GridForgetRemoveCommand(tkwin, interp, objc, objv);
+ case GRID_INFO:
+ return GridInfoCommand(tkwin, interp, objc, objv);
+ case GRID_LOCATION:
+ return GridLocationCommand(tkwin, interp, objc, objv);
+ case GRID_PROPAGATE:
+ return GridPropagateCommand(tkwin, interp, objc, objv);
+ case GRID_SIZE:
+ return GridSizeCommand(tkwin, interp, objc, objv);
+ case GRID_SLAVES:
+ return GridSlavesCommand(tkwin, interp, objc, objv);
- if (column > 0 && column < endX) {
- x = gridPtr->columnPtr[column-1].offset;
- } else if (column > 0) {
- x = gridPtr->columnPtr[endX-1].offset;
- }
+ /*
+ * Sample argument combinations:
+ * grid columnconfigure <master> <index> -option
+ * grid columnconfigure <master> <index> -option value -option value
+ * grid rowconfigure <master> <index>
+ * grid rowconfigure <master> <index> -option
+ * grid rowconfigure <master> <index> -option value -option value.
+ */
- if (row > 0 && row < endY) {
- y = gridPtr->rowPtr[row-1].offset;
- } else if (row > 0) {
- y = gridPtr->rowPtr[endY-1].offset;
- }
+ case GRID_COLUMNCONFIGURE:
+ case GRID_ROWCONFIGURE:
+ return GridRowColumnConfigureCommand(tkwin, interp, objc, objv);
+ }
- if (column2 < 0) {
- width = 0;
- } else if (column2 >= endX) {
- width = gridPtr->columnPtr[endX-1].offset - x;
- } else {
- width = gridPtr->columnPtr[column2].offset - x;
- }
+ /* This should not happen */
+ Tcl_SetResult(interp, "Internal error in grid.", TCL_STATIC);
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridBboxCommand --
+ *
+ * Implementation of the [grid bbox] subcommand.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Places bounding box information in the interp's result field.
+ *
+ *----------------------------------------------------------------------
+ */
- if (row2 < 0) {
- height = 0;
- } else if (row2 >= endY) {
- height = gridPtr->rowPtr[endY-1].offset - y;
- } else {
- height = gridPtr->rowPtr[row2].offset - y;
- }
-
- sprintf(buf, "%d %d %d %d", x + gridPtr->startX, y + gridPtr->startY,
- width, height);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)) {
- if (argv[2][0] != '.') {
- Tcl_AppendResult(interp, "bad argument \"", argv[2],
- "\": must be name of window", (char *) NULL);
- return TCL_ERROR;
- }
- return ConfigureSlaves(interp, tkwin, argc-2, argv+2);
- } else if (((c == 'f') && (strncmp(argv[1], "forget", length) == 0)) ||
- ((c == 'r') && (strncmp(argv[1], "remove", length) == 0))) {
- Tk_Window slave;
- Gridder *slavePtr;
- int i;
+static int
+GridBboxCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Tk_Window master;
+ Gridder *masterPtr; /* master grid record */
+ GridMaster *gridPtr; /* pointer to grid data */
+ int row, column; /* origin for bounding box */
+ int row2, column2; /* end of bounding box */
+ int endX, endY; /* last column/row in the layout */
+ int x=0, y=0; /* starting pixels for this bounding box */
+ int width, height; /* size of the bounding box */
- for (i = 2; i < argc; i++) {
- slave = Tk_NameToWindow(interp, argv[i], tkwin);
- if (slave == NULL) {
- return TCL_ERROR;
- }
- slavePtr = GetGrid(slave);
- if (slavePtr->masterPtr != NULL) {
-
- /*
- * For "forget", reset all the settings to their defaults
- */
-
- if (c == 'f') {
- slavePtr->column = slavePtr->row = -1;
- slavePtr->numCols = 1;
- slavePtr->numRows = 1;
- slavePtr->padX = slavePtr->padY = 0;
- slavePtr->iPadX = slavePtr->iPadY = 0;
- slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
- if (slavePtr->flags & REQUESTED_RELAYOUT) {
- Tcl_CancelIdleCall(ArrangeGrid, (ClientData) slavePtr);
- }
- slavePtr->flags = 0;
- slavePtr->sticky = 0;
- }
- Tk_ManageGeometry(slave, (Tk_GeomMgr *) NULL,
- (ClientData) NULL);
- if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
- Tk_UnmaintainGeometry(slavePtr->tkwin,
- slavePtr->masterPtr->tkwin);
- }
- Unlink(slavePtr);
- Tk_UnmapWindow(slavePtr->tkwin);
- }
- }
- } else if ((c == 'i') && (strncmp(argv[1], "info", length) == 0)) {
- register Gridder *slavePtr;
- Tk_Window slave;
- char buffer[64 + TCL_INTEGER_SPACE * 4];
+ if (objc!=3 && objc != 5 && objc != 7) {
+ Tcl_WrongNumArgs(interp, 2, objv, "master ?column row ?column row??");
+ return TCL_ERROR;
+ }
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr = GetGrid(master);
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " info window\"", (char *) NULL);
+ if (objc >= 5) {
+ if (Tcl_GetIntFromObj(interp, objv[3], &column) != TCL_OK) {
return TCL_ERROR;
}
- slave = Tk_NameToWindow(interp, argv[2], tkwin);
- if (slave == NULL) {
+ if (Tcl_GetIntFromObj(interp, objv[4], &row) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr = GetGrid(slave);
- if (slavePtr->masterPtr == NULL) {
- Tcl_ResetResult(interp);
- return TCL_OK;
- }
+ column2 = column;
+ row2 = row;
+ }
- Tcl_AppendElement(interp, "-in");
- Tcl_AppendElement(interp, Tk_PathName(slavePtr->masterPtr->tkwin));
- sprintf(buffer, " -column %d -row %d -columnspan %d -rowspan %d",
- slavePtr->column, slavePtr->row,
- slavePtr->numCols, slavePtr->numRows);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- sprintf(buffer, " -ipadx %d -ipady %d -padx %d -pady %d",
- slavePtr->iPadX/2, slavePtr->iPadY/2, slavePtr->padX/2,
- slavePtr->padY/2);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- StickyToString(slavePtr->sticky,buffer);
- Tcl_AppendResult(interp, " -sticky ", buffer, (char *) NULL);
- } else if((c == 'l') && (strncmp(argv[1], "location", length) == 0)) {
- Tk_Window master;
- register SlotInfo *slotPtr;
- int x, y; /* Offset in pixels, from edge of parent. */
- int i, j; /* Corresponding column and row indeces. */
- int endX, endY; /* end of grid */
- char buf[TCL_INTEGER_SPACE * 2];
-
- if (argc != 5) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " location master x y\"", (char *)NULL);
+ if (objc == 7) {
+ if (Tcl_GetIntFromObj(interp, objv[5], &column2) != TCL_OK) {
return TCL_ERROR;
}
-
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
+ if (Tcl_GetIntFromObj(interp, objv[6], &row2) != TCL_OK) {
return TCL_ERROR;
}
+ }
+
+ gridPtr = masterPtr->masterDataPtr;
+ if (gridPtr == NULL) {
+ Tcl_SetObjResult(interp, NewQuadObj(interp, 0, 0, 0, 0));
+ return TCL_OK;
+ }
+
+ SetGridSize(masterPtr);
+ endX = MAX(gridPtr->columnEnd, gridPtr->columnMax);
+ endY = MAX(gridPtr->rowEnd, gridPtr->rowMax);
+
+ if ((endX == 0) || (endY == 0)) {
+ Tcl_SetObjResult(interp, NewQuadObj(interp, 0, 0, 0, 0));
+ return TCL_OK;
+ }
+ if (objc == 3) {
+ row = column = 0;
+ row2 = endY;
+ column2 = endX;
+ }
+
+ if (column > column2) {
+ int temp = column;
+ column = column2, column2 = temp;
+ }
+ if (row > row2) {
+ int temp = row;
+ row = row2, row2 = temp;
+ }
+
+ if (column > 0 && column < endX) {
+ x = gridPtr->columnPtr[column-1].offset;
+ } else if (column > 0) {
+ x = gridPtr->columnPtr[endX-1].offset;
+ }
+
+ if (row > 0 && row < endY) {
+ y = gridPtr->rowPtr[row-1].offset;
+ } else if (row > 0) {
+ y = gridPtr->rowPtr[endY-1].offset;
+ }
+
+ if (column2 < 0) {
+ width = 0;
+ } else if (column2 >= endX) {
+ width = gridPtr->columnPtr[endX-1].offset - x;
+ } else {
+ width = gridPtr->columnPtr[column2].offset - x;
+ }
+
+ if (row2 < 0) {
+ height = 0;
+ } else if (row2 >= endY) {
+ height = gridPtr->rowPtr[endY-1].offset - y;
+ } else {
+ height = gridPtr->rowPtr[row2].offset - y;
+ }
+
+ Tcl_SetObjResult(interp, NewQuadObj(interp,
+ x + gridPtr->startX, y + gridPtr->startY, width, height));
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridForgetRemoveCommand --
+ *
+ * Implementation of the [grid forget]/[grid remove] subcommands.
+ * See the user documentation for details on what these do.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Removes a window from a grid layout.
+ *
+ *----------------------------------------------------------------------
+ */
- if (Tk_GetPixels(interp, master, argv[3], &x) != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tk_GetPixels(interp, master, argv[4], &y) != TCL_OK) {
+static int
+GridForgetRemoveCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Tk_Window slave;
+ Gridder *slavePtr;
+ int i;
+ char *string = Tcl_GetString(objv[1]);
+ char c = string[0];
+
+ for (i = 2; i < objc; i++) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i], &slave) != TCL_OK) {
return TCL_ERROR;
}
- masterPtr = GetGrid(master);
- if (masterPtr->masterDataPtr == NULL) {
- Tcl_SetResult(interp, "-1 -1", TCL_STATIC);
- return TCL_OK;
+ slavePtr = GetGrid(slave);
+ if (slavePtr->masterPtr != NULL) {
+
+ /*
+ * For "forget", reset all the settings to their defaults
+ */
+
+ if (c == 'f') {
+ slavePtr->column = slavePtr->row = -1;
+ slavePtr->numCols = 1;
+ slavePtr->numRows = 1;
+ slavePtr->padX = slavePtr->padY = 0;
+ slavePtr->padLeft = slavePtr->padTop = 0;
+ slavePtr->iPadX = slavePtr->iPadY = 0;
+ slavePtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
+ if (slavePtr->flags & REQUESTED_RELAYOUT) {
+ Tcl_CancelIdleCall(ArrangeGrid, (ClientData) slavePtr);
+ }
+ slavePtr->flags = 0;
+ slavePtr->sticky = 0;
+ }
+ Tk_ManageGeometry(slave, (Tk_GeomMgr *) NULL,
+ (ClientData) NULL);
+ if (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
+ Tk_UnmaintainGeometry(slavePtr->tkwin,
+ slavePtr->masterPtr->tkwin);
+ }
+ Unlink(slavePtr);
+ Tk_UnmapWindow(slavePtr->tkwin);
}
- gridPtr = masterPtr->masterDataPtr;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridInfoCommand --
+ *
+ * Implementation of the [grid info] subcommand. See the user
+ * documentation for details on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Puts gridding information in the interpreter's result.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * Update any pending requests. This is not always the
- * steady state value, as more configure events could be in
- * the pipeline, but its as close as its easy to get.
- */
+static int
+GridInfoCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register Gridder *slavePtr;
+ Tk_Window slave;
+ char buffer[64 + TCL_INTEGER_SPACE * 4];
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &slave) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ slavePtr = GetGrid(slave);
+ if (slavePtr->masterPtr == NULL) {
+ Tcl_ResetResult(interp);
+ return TCL_OK;
+ }
+
+ Tcl_AppendElement(interp, "-in");
+ Tcl_AppendElement(interp, Tk_PathName(slavePtr->masterPtr->tkwin));
+ sprintf(buffer, " -column %d -row %d -columnspan %d -rowspan %d",
+ slavePtr->column, slavePtr->row,
+ slavePtr->numCols, slavePtr->numRows);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ TkPrintPadAmount(interp, "ipadx", slavePtr->iPadX/2, slavePtr->iPadX);
+ TkPrintPadAmount(interp, "ipady", slavePtr->iPadY/2, slavePtr->iPadY);
+ TkPrintPadAmount(interp, "padx", slavePtr->padLeft, slavePtr->padX);
+ TkPrintPadAmount(interp, "pady", slavePtr->padTop, slavePtr->padY);
+ StickyToString(slavePtr->sticky, buffer);
+ Tcl_AppendResult(interp, " -sticky ", buffer, (char *) NULL);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridLocationCommand --
+ *
+ * Implementation of the [grid location] subcommand. See the user
+ * documentation for details on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Puts location information in the interpreter's result field.
+ *
+ *----------------------------------------------------------------------
+ */
- while (masterPtr->flags & REQUESTED_RELAYOUT) {
- Tcl_CancelIdleCall(ArrangeGrid, (ClientData) masterPtr);
- ArrangeGrid ((ClientData) masterPtr);
+static int
+GridLocationCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Tk_Window master;
+ Gridder *masterPtr; /* master grid record */
+ GridMaster *gridPtr; /* pointer to grid data */
+ register SlotInfo *slotPtr;
+ int x, y; /* Offset in pixels, from edge of parent. */
+ int i, j; /* Corresponding column and row indeces. */
+ int endX, endY; /* end of grid */
+
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "master x y");
+ return TCL_ERROR;
+ }
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (Tk_GetPixelsFromObj(interp, master, objv[3], &x) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (Tk_GetPixelsFromObj(interp, master, objv[4], &y) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ masterPtr = GetGrid(master);
+ if (masterPtr->masterDataPtr == NULL) {
+ Tcl_SetObjResult(interp, NewPairObj(interp, -1, -1));
+ return TCL_OK;
+ }
+ gridPtr = masterPtr->masterDataPtr;
+
+ /*
+ * Update any pending requests. This is not always the
+ * steady state value, as more configure events could be in
+ * the pipeline, but its as close as its easy to get.
+ */
+
+ while (masterPtr->flags & REQUESTED_RELAYOUT) {
+ Tcl_CancelIdleCall(ArrangeGrid, (ClientData) masterPtr);
+ ArrangeGrid ((ClientData) masterPtr);
+ }
+ SetGridSize(masterPtr);
+ endX = MAX(gridPtr->columnEnd, gridPtr->columnMax);
+ endY = MAX(gridPtr->rowEnd, gridPtr->rowMax);
+
+ slotPtr = masterPtr->masterDataPtr->columnPtr;
+ if (x < masterPtr->masterDataPtr->startX) {
+ i = -1;
+ } else {
+ x -= masterPtr->masterDataPtr->startX;
+ for (i = 0; slotPtr[i].offset < x && i < endX; i++) {
+ /* null body */
}
- SetGridSize(masterPtr);
- endX = MAX(gridPtr->columnEnd, gridPtr->columnMax);
- endY = MAX(gridPtr->rowEnd, gridPtr->rowMax);
-
- slotPtr = masterPtr->masterDataPtr->columnPtr;
- if (x < masterPtr->masterDataPtr->startX) {
- i = -1;
- } else {
- x -= masterPtr->masterDataPtr->startX;
- for (i=0;slotPtr[i].offset < x && i < endX; i++) {
- /* null body */
- }
+ }
+
+ slotPtr = masterPtr->masterDataPtr->rowPtr;
+ if (y < masterPtr->masterDataPtr->startY) {
+ j = -1;
+ } else {
+ y -= masterPtr->masterDataPtr->startY;
+ for (j = 0; slotPtr[j].offset < y && j < endY; j++) {
+ /* null body */
}
+ }
+
+ Tcl_SetObjResult(interp, NewPairObj(interp, i, j));
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridPropagateCommand --
+ *
+ * Implementation of the [grid propagate] subcommand. See the user
+ * documentation for details on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * May alter geometry propagation for a widget.
+ *
+ *----------------------------------------------------------------------
+ */
- slotPtr = masterPtr->masterDataPtr->rowPtr;
- if (y < masterPtr->masterDataPtr->startY) {
- j = -1;
+static int
+GridPropagateCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Tk_Window master;
+ Gridder *masterPtr;
+ int propagate, old;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
+ return TCL_ERROR;
+ }
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr = GetGrid(master);
+ if (objc == 3) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj(!(masterPtr->flags & DONT_PROPAGATE)));
+ return TCL_OK;
+ }
+ if (Tcl_GetBooleanFromObj(interp, objv[3], &propagate) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ /* Only request a relayout if the propagation bit changes */
+
+ old = !(masterPtr->flags & DONT_PROPAGATE);
+ if (propagate != old) {
+ if (propagate) {
+ masterPtr->flags &= ~DONT_PROPAGATE;
} else {
- y -= masterPtr->masterDataPtr->startY;
- for (j=0;slotPtr[j].offset < y && j < endY; j++) {
- /* null body */
- }
+ masterPtr->flags |= DONT_PROPAGATE;
+ }
+
+ /*
+ * Re-arrange the master to allow new geometry information to
+ * propagate upwards to the master's master.
+ */
+
+ if (masterPtr->abortPtr != NULL) {
+ *masterPtr->abortPtr = 1;
+ }
+ if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
+ masterPtr->flags |= REQUESTED_RELAYOUT;
+ Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
}
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridRowColumnConfigureCommand --
+ *
+ * Implementation of the [grid rowconfigure] and [grid columnconfigure]
+ * subcommands. See the user documentation for details on what these
+ * do.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Depends on arguments; see user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- sprintf(buf, "%d %d", i, j);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if ((c == 'p') && (strncmp(argv[1], "propagate", length) == 0)) {
- Tk_Window master;
- int propagate;
+static int
+GridRowColumnConfigureCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Tk_Window master;
+ Gridder *masterPtr;
+ SlotInfo *slotPtr = NULL;
+ int slot; /* the column or row number */
+ int slotType; /* COLUMN or ROW */
+ int size; /* the configuration value */
+ int checkOnly; /* check the size only */
+ int lObjc; /* Number of items in index list */
+ Tcl_Obj **lObjv; /* array of indices */
+ int ok; /* temporary TCL result code */
+ int i, j;
+ char *string;
+ static CONST char *optionStrings[] = {
+ "-minsize", "-pad", "-uniform", "-weight", (char *) NULL };
+ enum options { ROWCOL_MINSIZE, ROWCOL_PAD, ROWCOL_UNIFORM, ROWCOL_WEIGHT };
+ int index;
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " propagate window ?boolean?\"",
- (char *) NULL);
+ if (((objc % 2 != 0) && (objc > 6)) || (objc < 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "master index ?-option value...?");
+ return TCL_ERROR;
+ }
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (Tcl_ListObjGetElements(interp, objv[3], &lObjc, &lObjv) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ string = Tcl_GetString(objv[1]);
+ checkOnly = ((objc == 4) || (objc == 5));
+ masterPtr = GetGrid(master);
+ slotType = (*string == 'c') ? COLUMN : ROW;
+ if (checkOnly && lObjc > 1) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[3]),
+ " must be a single element.", (char *) NULL);
+ return TCL_ERROR;
+ }
+ for (j = 0; j < lObjc; j++) {
+ if (Tcl_GetIntFromObj(interp, lObjv[j], &slot) != TCL_OK) {
return TCL_ERROR;
}
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
+ ok = CheckSlotData(masterPtr, slot, slotType, checkOnly);
+ if ((ok != TCL_OK) && ((objc < 4) || (objc > 5))) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[0]), " ",
+ Tcl_GetString(objv[1]), ": \"", Tcl_GetString(lObjv[j]),
+ "\" is out of range", (char *) NULL);
return TCL_ERROR;
+ } else if (ok == TCL_OK) {
+ slotPtr = (slotType == COLUMN) ?
+ masterPtr->masterDataPtr->columnPtr :
+ masterPtr->masterDataPtr->rowPtr;
}
- masterPtr = GetGrid(master);
- if (argc == 3) {
- Tcl_SetResult(interp,
- ((masterPtr->flags & DONT_PROPAGATE) ? "0" : "1"),
- TCL_STATIC);
+
+ /*
+ * Return all of the options for this row or column. If the
+ * request is out of range, return all 0's.
+ */
+
+ if (objc == 4) {
+ int minsize = 0, pad = 0, weight = 0;
+ Tk_Uid uniform = NULL;
+ Tcl_Obj *res = Tcl_NewListObj(0, NULL);
+
+ if (ok == TCL_OK) {
+ minsize = slotPtr[slot].minSize;
+ pad = slotPtr[slot].pad;
+ weight = slotPtr[slot].weight;
+ uniform = slotPtr[slot].uniform;
+ }
+
+ Tcl_ListObjAppendElement(interp, res,
+ Tcl_NewStringObj("-minsize", -1));
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(minsize));
+ Tcl_ListObjAppendElement(interp, res,
+ Tcl_NewStringObj("-pad", -1));
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(pad));
+ Tcl_ListObjAppendElement(interp, res,
+ Tcl_NewStringObj("-uniform", -1));
+ Tcl_ListObjAppendElement(interp, res,
+ Tcl_NewStringObj(uniform == NULL ? "" : uniform, -1));
+ Tcl_ListObjAppendElement(interp, res,
+ Tcl_NewStringObj("-weight", -1));
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(weight));
+ Tcl_SetObjResult(interp, res);
return TCL_OK;
}
- if (Tcl_GetBoolean(interp, argv[3], &propagate) != TCL_OK) {
- return TCL_ERROR;
- }
- /* Only request a relayout if the propagation bit changes */
+ /*
+ * Loop through each option value pair, setting the values as
+ * required. If only one option is given, with no value, the
+ * current value is returned.
+ */
- if ((!propagate) ^ (masterPtr->flags&DONT_PROPAGATE)) {
- if (propagate) {
- masterPtr->flags &= ~DONT_PROPAGATE;
- } else {
- masterPtr->flags |= DONT_PROPAGATE;
+ for (i = 4; i < objc; i += 2) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
}
-
- /*
- * Re-arrange the master to allow new geometry information to
- * propagate upwards to the master's master.
- */
-
- if (masterPtr->abortPtr != NULL) {
- *masterPtr->abortPtr = 1;
+ if (index == ROWCOL_MINSIZE) {
+ if (objc == 5) {
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(
+ (ok == TCL_OK) ? slotPtr[slot].minSize : 0));
+ } else if (Tk_GetPixelsFromObj(interp, master, objv[i+1], &size)
+ != TCL_OK) {
+ return TCL_ERROR;
+ } else {
+ slotPtr[slot].minSize = size;
+ }
}
- if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
- masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
+ else if (index == ROWCOL_WEIGHT) {
+ int wt;
+ if (objc == 5) {
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(
+ (ok == TCL_OK) ? slotPtr[slot].weight : 0));
+ } else if (Tcl_GetIntFromObj(interp, objv[i+1], &wt)
+ != TCL_OK) {
+ return TCL_ERROR;
+ } else if (wt < 0) {
+ Tcl_AppendResult(interp, "invalid arg \"",
+ Tcl_GetString(objv[i]),
+ "\": should be non-negative", (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ slotPtr[slot].weight = wt;
+ }
}
- }
- } else if ((c == 's') && (strncmp(argv[1], "size", length) == 0)
- && (length > 1)) {
- Tk_Window master;
-
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " size window\"", (char *) NULL);
- return TCL_ERROR;
- }
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
- return TCL_ERROR;
- }
- masterPtr = GetGrid(master);
-
- if (masterPtr->masterDataPtr != NULL) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- SetGridSize(masterPtr);
- gridPtr = masterPtr->masterDataPtr;
- sprintf(buf, "%d %d",
- MAX(gridPtr->columnEnd, gridPtr->columnMax),
- MAX(gridPtr->rowEnd, gridPtr->rowMax));
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else {
- Tcl_SetResult(interp, "0 0", TCL_STATIC);
- }
- } else if ((c == 's') && (strncmp(argv[1], "slaves", length) == 0)
- && (length > 1)) {
- Tk_Window master;
- Gridder *slavePtr;
- int i, value;
- int row = -1, column = -1;
-
- if ((argc < 3) || ((argc%2) == 0)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " slaves window ?-option value...?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
-
- for (i=3; i<argc; i+=2) {
- length = strlen(argv[i]);
- if ((*argv[i] != '-') || (length < 2)) {
- Tcl_AppendResult(interp, "invalid args: should be \"",
- argv[0], " slaves window ?-option value...?\"",
- (char *) NULL);
- return TCL_ERROR;
+ else if (index == ROWCOL_UNIFORM) {
+ if (objc == 5) {
+ Tk_Uid value;
+ value = (ok == TCL_OK) ? slotPtr[slot].uniform : "";
+ if (value == NULL) {
+ value = "";
+ }
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(value, -1));
+ } else {
+ slotPtr[slot].uniform = Tk_GetUid(Tcl_GetString(objv[i+1]));
+ if (slotPtr[slot].uniform != NULL &&
+ slotPtr[slot].uniform[0] == 0) {
+ slotPtr[slot].uniform = NULL;
+ }
+ }
}
- if (Tcl_GetInt(interp, argv[i+1], &value) != TCL_OK) {
- return TCL_ERROR;
+ else if (index == ROWCOL_PAD) {
+ if (objc == 5) {
+ Tcl_SetObjResult(interp, Tcl_NewIntObj(
+ (ok == TCL_OK) ? slotPtr[slot].pad : 0));
+ } else if (Tk_GetPixelsFromObj(interp, master, objv[i+1], &size)
+ != TCL_OK) {
+ return TCL_ERROR;
+ } else if (size < 0) {
+ Tcl_AppendResult(interp, "invalid arg \"",
+ Tcl_GetString(objv[i]),
+ "\": should be non-negative", (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ slotPtr[slot].pad = size;
+ }
}
- if (value < 0) {
- Tcl_AppendResult(interp, argv[i],
- " is an invalid value: should NOT be < 0",
- (char *) NULL);
- return TCL_ERROR;
+ }
+ }
+
+ /*
+ * If we changed a property, re-arrange the table,
+ * and check for constraint shrinkage.
+ */
+
+ if (objc != 5) {
+ if (slotType == ROW) {
+ int last = masterPtr->masterDataPtr->rowMax - 1;
+ while ((last >= 0) && (slotPtr[last].weight == 0)
+ && (slotPtr[last].pad == 0)
+ && (slotPtr[last].minSize == 0)
+ && (slotPtr[last].uniform == NULL)) {
+ last--;
}
- if (strncmp(argv[i], "-column", length) == 0) {
- column = value;
- } else if (strncmp(argv[i], "-row", length) == 0) {
- row = value;
- } else {
- Tcl_AppendResult(interp, argv[i],
- " is an invalid option: should be \"",
- "-row, -column\"",
- (char *) NULL);
- return TCL_ERROR;
+ masterPtr->masterDataPtr->rowMax = last+1;
+ } else {
+ int last = masterPtr->masterDataPtr->columnMax - 1;
+ while ((last >= 0) && (slotPtr[last].weight == 0)
+ && (slotPtr[last].pad == 0)
+ && (slotPtr[last].minSize == 0)
+ && (slotPtr[last].uniform == NULL)) {
+ last--;
}
+ masterPtr->masterDataPtr->columnMax = last + 1;
}
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
- return TCL_ERROR;
+
+ if (masterPtr->abortPtr != NULL) {
+ *masterPtr->abortPtr = 1;
}
- masterPtr = GetGrid(master);
-
- for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- if (column>=0 && (slavePtr->column > column
- || slavePtr->column+slavePtr->numCols-1 < column)) {
- continue;
- }
- if (row>=0 && (slavePtr->row > row ||
- slavePtr->row+slavePtr->numRows-1 < row)) {
- continue;
- }
- Tcl_AppendElement(interp, Tk_PathName(slavePtr->tkwin));
+ if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
+ masterPtr->flags |= REQUESTED_RELAYOUT;
+ Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
}
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridSizeCommand --
+ *
+ * Implementation of the [grid size] subcommand. See the user
+ * documentation for details on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Puts grid size information in the interpreter's result.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * Sample argument combinations:
- * grid columnconfigure <master> <index> -option
- * grid columnconfigure <master> <index> -option value -option value
- * grid rowconfigure <master> <index>
- * grid rowconfigure <master> <index> -option
- * grid rowconfigure <master> <index> -option value -option value.
- */
-
- } else if(((c == 'c') && (strncmp(argv[1], "columnconfigure", length) == 0)
- && (length >= 3)) ||
- ((c == 'r') && (strncmp(argv[1], "rowconfigure", length) == 0)
- && (length >=2))) {
- Tk_Window master;
- SlotInfo *slotPtr = NULL;
- int slot; /* the column or row number */
- size_t length; /* the # of chars in the "-option" string */
- int slotType; /* COLUMN or ROW */
- int size; /* the configuration value */
- int checkOnly; /* check the size only */
- int argcPtr; /* Number of items in index list */
- char **argvPtr; /* array of indeces */
- char **indexP; /* String value of current index list item. */
- int ok; /* temporary TCL result code */
- int i;
-
- if (((argc%2 != 0) && (argc>6)) || (argc < 4)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " ", argv[1], " master index ?-option value...?\"",
- (char *)NULL);
- return TCL_ERROR;
- }
+static int
+GridSizeCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Tk_Window master;
+ Gridder *masterPtr;
+ GridMaster *gridPtr; /* pointer to grid data */
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr = GetGrid(master);
+
+ if (masterPtr->masterDataPtr != NULL) {
+ SetGridSize(masterPtr);
+ gridPtr = masterPtr->masterDataPtr;
+ Tcl_SetObjResult(interp, NewPairObj(interp,
+ MAX(gridPtr->columnEnd, gridPtr->columnMax),
+ MAX(gridPtr->rowEnd, gridPtr->rowMax)));
+ } else {
+ Tcl_SetObjResult(interp, NewPairObj(interp, 0, 0));
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GridSlavesCommand --
+ *
+ * Implementation of the [grid slaves] subcommand. See the user
+ * documentation for details on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Places a list of slaves of the specified window in the
+ * interpreter's result field.
+ *
+ *----------------------------------------------------------------------
+ */
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
+static int
+GridSlavesCommand(tkwin, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ Tk_Window master;
+ Gridder *masterPtr; /* master grid record */
+ Gridder *slavePtr;
+ int i, value;
+ int row = -1, column = -1;
+ static CONST char *optionStrings[] = {
+ "-column", "-row", (char *) NULL };
+ enum options { SLAVES_COLUMN, SLAVES_ROW };
+ int index;
+ Tcl_Obj *res;
+
+ if ((objc < 3) || ((objc % 2) == 0)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?-option value...?");
+ return TCL_ERROR;
+ }
+
+ for (i = 3; i < objc; i += 2) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
-
- if (Tcl_SplitList(interp, argv[3], &argcPtr, &argvPtr) != TCL_OK) {
+ if (Tcl_GetIntFromObj(interp, objv[i+1], &value) != TCL_OK) {
return TCL_ERROR;
}
-
- checkOnly = ((argc == 4) || (argc == 5));
- masterPtr = GetGrid(master);
- slotType = (c == 'c') ? COLUMN : ROW;
- if (checkOnly && argcPtr > 1) {
- Tcl_AppendResult(interp, argv[3],
- " must be a single element.", (char *) NULL);
- Tcl_Free((char *)argvPtr);
+ if (value < 0) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[i]),
+ " is an invalid value: should NOT be < 0",
+ (char *) NULL);
return TCL_ERROR;
}
- for (indexP=argvPtr; *indexP != NULL; indexP++) {
- if (Tcl_GetInt(interp, *indexP, &slot) != TCL_OK) {
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- }
- ok = CheckSlotData(masterPtr, slot, slotType, checkOnly);
- if ((ok!=TCL_OK) && ((argc<4) || (argc>5))) {
- Tcl_AppendResult(interp, argv[0],
- " ", argv[1], ": \"", *argvPtr,"\" is out of range",
- (char *) NULL);
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- } else if (ok == TCL_OK) {
- slotPtr = (slotType == COLUMN) ?
- masterPtr->masterDataPtr->columnPtr :
- masterPtr->masterDataPtr->rowPtr;
- }
-
- /*
- * Return all of the options for this row or column. If the
- * request is out of range, return all 0's.
- */
-
- if (argc == 4) {
- Tcl_Free((char *)argvPtr);
- }
- if ((argc == 4) && (ok == TCL_OK)) {
- char buf[64 + TCL_INTEGER_SPACE * 3];
-
- sprintf(buf, "-minsize %d -pad %d -weight %d",
- slotPtr[slot].minSize,slotPtr[slot].pad,
- slotPtr[slot].weight);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return (TCL_OK);
- } else if (argc == 4) {
- Tcl_SetResult(interp, "-minsize 0 -pad 0 -weight 0",
- TCL_STATIC);
- return (TCL_OK);
- }
-
- /*
- * Loop through each option value pair, setting the values as required.
- * If only one option is given, with no value, the current value is
- * returned.
- */
-
- for (i=4; i<argc; i+=2) {
- length = strlen(argv[i]);
- if ((*argv[i] != '-') || length < 2) {
- Tcl_AppendResult(interp, "invalid arg \"",
- argv[i], "\" :expecting -minsize, -pad, or -weight.",
- (char *) NULL);
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- }
- if (strncmp(argv[i], "-minsize", length) == 0) {
- if (argc == 5) {
- char buf[TCL_INTEGER_SPACE];
- int value;
-
- value = (ok == TCL_OK) ? slotPtr[slot].minSize : 0;
- sprintf(buf, "%d", value);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if (Tk_GetPixels(interp, master, argv[i+1], &size)
- != TCL_OK) {
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- } else {
- slotPtr[slot].minSize = size;
- }
- }
- else if (strncmp(argv[i], "-weight", length) == 0) {
- int wt;
- if (argc == 5) {
- char buf[TCL_INTEGER_SPACE];
- int value;
-
- value = (ok == TCL_OK) ? slotPtr[slot].weight : 0;
- sprintf(buf, "%d", value);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if (Tcl_GetInt(interp, argv[i+1], &wt) != TCL_OK) {
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- } else if (wt < 0) {
- Tcl_AppendResult(interp, "invalid arg \"", argv[i],
- "\": should be non-negative", (char *) NULL);
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- } else {
- slotPtr[slot].weight = wt;
- }
- }
- else if (strncmp(argv[i], "-pad", length) == 0) {
- if (argc == 5) {
- char buf[TCL_INTEGER_SPACE];
- int value;
-
- value = (ok == TCL_OK) ? slotPtr[slot].pad : 0;
- sprintf(buf, "%d", value);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if (Tk_GetPixels(interp, master, argv[i+1], &size)
- != TCL_OK) {
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- } else if (size < 0) {
- Tcl_AppendResult(interp, "invalid arg \"", argv[i],
- "\": should be non-negative", (char *) NULL);
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- } else {
- slotPtr[slot].pad = size;
- }
- } else {
- Tcl_AppendResult(interp, "invalid arg \"",
- argv[i], "\": expecting -minsize, -pad, or -weight.",
- (char *) NULL);
- Tcl_Free((char *)argvPtr);
- return TCL_ERROR;
- }
- }
+ if (index == SLAVES_COLUMN) {
+ column = value;
+ } else {
+ row = value;
}
- Tcl_Free((char *)argvPtr);
-
- /*
- * If we changed a property, re-arrange the table,
- * and check for constraint shrinkage.
- */
+ }
- if (argc != 5) {
- if (slotType == ROW) {
- int last = masterPtr->masterDataPtr->rowMax - 1;
- while ((last >= 0) && (slotPtr[last].weight == 0)
- && (slotPtr[last].pad == 0)
- && (slotPtr[last].minSize == 0)) {
- last--;
- }
- masterPtr->masterDataPtr->rowMax = last+1;
- } else {
- int last = masterPtr->masterDataPtr->columnMax - 1;
- while ((last >= 0) && (slotPtr[last].weight == 0)
- && (slotPtr[last].pad == 0)
- && (slotPtr[last].minSize == 0)) {
- last--;
- }
- masterPtr->masterDataPtr->columnMax = last + 1;
- }
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ masterPtr = GetGrid(master);
- if (masterPtr->abortPtr != NULL) {
- *masterPtr->abortPtr = 1;
- }
- if (!(masterPtr->flags & REQUESTED_RELAYOUT)) {
- masterPtr->flags |= REQUESTED_RELAYOUT;
- Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
- }
+ res = Tcl_NewListObj(0, NULL);
+ for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
+ slavePtr = slavePtr->nextPtr) {
+ if (column>=0 && (slavePtr->column > column
+ || slavePtr->column+slavePtr->numCols-1 < column)) {
+ continue;
}
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be bbox, columnconfigure, configure, forget, info, ",
- "location, propagate, remove, rowconfigure, size, or slaves.",
- (char *) NULL);
- return TCL_ERROR;
+ if (row>=0 && (slavePtr->row > row ||
+ slavePtr->row+slavePtr->numRows-1 < row)) {
+ continue;
+ }
+ Tcl_ListObjAppendElement(interp, res,
+ Tcl_NewStringObj(Tk_PathName(slavePtr->tkwin), -1));
}
+ Tcl_SetObjResult(interp, res);
return TCL_OK;
}
@@ -932,7 +1202,7 @@ GridReqProc(clientData, tkwin)
register Gridder *gridPtr = (Gridder *) clientData;
gridPtr = gridPtr->masterPtr;
- if (!(gridPtr->flags & REQUESTED_RELAYOUT)) {
+ if (gridPtr && !(gridPtr->flags & REQUESTED_RELAYOUT)) {
gridPtr->flags |= REQUESTED_RELAYOUT;
Tcl_DoWhenIdle(ArrangeGrid, (ClientData) gridPtr);
}
@@ -1166,9 +1436,9 @@ AdjustForSticky(slavePtr, xPtr, yPtr, widthPtr, heightPtr)
int diffy=0; /* Cavity hight - slave height. */
int sticky = slavePtr->sticky;
- *xPtr += slavePtr->padX/2;
+ *xPtr += slavePtr->padLeft;
*widthPtr -= slavePtr->padX;
- *yPtr += slavePtr->padY/2;
+ *yPtr += slavePtr->padTop;
*heightPtr -= slavePtr->padY;
if (*widthPtr > (Tk_ReqWidth(slavePtr->tkwin) + slavePtr->iPadX)) {
@@ -1264,13 +1534,22 @@ ArrangeGrid(clientData)
SetGridSize(masterPtr);
width = ResolveConstraints(masterPtr, COLUMN, 0);
height = ResolveConstraints(masterPtr, ROW, 0);
- width += 2*Tk_InternalBorderWidth(masterPtr->tkwin);
- height += 2*Tk_InternalBorderWidth(masterPtr->tkwin);
+ width += Tk_InternalBorderLeft(masterPtr->tkwin) +
+ Tk_InternalBorderRight(masterPtr->tkwin);
+ height += Tk_InternalBorderTop(masterPtr->tkwin) +
+ Tk_InternalBorderBottom(masterPtr->tkwin);
+
+ if (width < Tk_MinReqWidth(masterPtr->tkwin)) {
+ width = Tk_MinReqWidth(masterPtr->tkwin);
+ }
+ if (height < Tk_MinReqHeight(masterPtr->tkwin)) {
+ height = Tk_MinReqHeight(masterPtr->tkwin);
+ }
if (((width != Tk_ReqWidth(masterPtr->tkwin))
- || (height != Tk_ReqHeight(masterPtr->tkwin)))
- && !(masterPtr->flags & DONT_PROPAGATE)) {
- Tk_GeometryRequest(masterPtr->tkwin, width, height);
+ || (height != Tk_ReqHeight(masterPtr->tkwin)))
+ && !(masterPtr->flags & DONT_PROPAGATE)) {
+ Tk_GeometryRequest(masterPtr->tkwin, width, height);
if (width>1 && height>1) {
masterPtr->flags |= REQUESTED_RELAYOUT;
Tcl_DoWhenIdle(ArrangeGrid, (ClientData) masterPtr);
@@ -1289,15 +1568,17 @@ ArrangeGrid(clientData)
*/
realWidth = Tk_Width(masterPtr->tkwin) -
- 2*Tk_InternalBorderWidth(masterPtr->tkwin);
+ Tk_InternalBorderLeft(masterPtr->tkwin) -
+ Tk_InternalBorderRight(masterPtr->tkwin);
realHeight = Tk_Height(masterPtr->tkwin) -
- 2*Tk_InternalBorderWidth(masterPtr->tkwin);
+ Tk_InternalBorderTop(masterPtr->tkwin) -
+ Tk_InternalBorderBottom(masterPtr->tkwin);
slotPtr->startX = AdjustOffsets(realWidth,
MAX(slotPtr->columnEnd,slotPtr->columnMax), slotPtr->columnPtr);
slotPtr->startY = AdjustOffsets(realHeight,
MAX(slotPtr->rowEnd,slotPtr->rowMax), slotPtr->rowPtr);
- slotPtr->startX += Tk_InternalBorderWidth(masterPtr->tkwin);
- slotPtr->startY += Tk_InternalBorderWidth(masterPtr->tkwin);
+ slotPtr->startX += Tk_InternalBorderLeft(masterPtr->tkwin);
+ slotPtr->startY += Tk_InternalBorderTop(masterPtr->tkwin);
/*
* Now adjust the actual size of the slave to its cavity by
@@ -1414,6 +1695,14 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
* constraints are not yet fully resolved. */
int end; /* The Last slot of a contiguous set whose
* constraints are not yet fully resolved. */
+ UniformGroup uniformPre[UNIFORM_PREALLOC];
+ /* Pre-allocated space for uniform groups. */
+ UniformGroup *uniformGroupPtr;
+ /* Uniform groups data. */
+ int uniformGroups; /* Number of currently used uniform groups. */
+ int uniformGroupsAlloced; /* Size of allocated space for uniform groups.
+ */
+ int weight, minSize;
/*
* For typical sized tables, we'll use stack space for the layout data
@@ -1463,13 +1752,15 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
for (slot=0; slot < constraintCount; slot++) {
layoutPtr[slot].minSize = slotPtr[slot].minSize;
- layoutPtr[slot].weight = slotPtr[slot].weight;
+ layoutPtr[slot].weight = slotPtr[slot].weight;
+ layoutPtr[slot].uniform = slotPtr[slot].uniform;
layoutPtr[slot].pad = slotPtr[slot].pad;
layoutPtr[slot].binNextPtr = NULL;
}
for(;slot<gridCount;slot++) {
layoutPtr[slot].minSize = 0;
layoutPtr[slot].weight = 0;
+ layoutPtr[slot].uniform = NULL;
layoutPtr[slot].pad = 0;
layoutPtr[slot].binNextPtr = NULL;
}
@@ -1525,6 +1816,83 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
}
/*
+ * Step 2b.
+ * Consider demands on uniform sizes.
+ */
+
+ uniformGroupPtr = uniformPre;
+ uniformGroupsAlloced = UNIFORM_PREALLOC;
+ uniformGroups = 0;
+
+ for (slot = 0; slot < gridCount; slot++) {
+ if (layoutPtr[slot].uniform != NULL) {
+ for (start = 0; start < uniformGroups; start++) {
+ if (uniformGroupPtr[start].group == layoutPtr[slot].uniform) {
+ break;
+ }
+ }
+ if (start >= uniformGroups) {
+ /*
+ * Have not seen that group before, set up data for it.
+ */
+
+ if (uniformGroups >= uniformGroupsAlloced) {
+ /*
+ * We need to allocate more space.
+ */
+
+ size_t oldSize = uniformGroupsAlloced
+ * sizeof(UniformGroup);
+ size_t newSize = (uniformGroupsAlloced + UNIFORM_PREALLOC)
+ * sizeof(UniformGroup);
+ UniformGroup *new = (UniformGroup *) ckalloc(newSize);
+ UniformGroup *old = uniformGroupPtr;
+ memcpy((VOID *) new, (VOID *) old, oldSize);
+ if (old != uniformPre) {
+ ckfree((char *) old);
+ }
+ uniformGroupPtr = new;
+ uniformGroupsAlloced += UNIFORM_PREALLOC;
+ }
+ uniformGroups++;
+ uniformGroupPtr[start].group = layoutPtr[slot].uniform;
+ uniformGroupPtr[start].minSize = 0;
+ }
+ weight = layoutPtr[slot].weight;
+ weight = weight > 0 ? weight : 1;
+ minSize = (layoutPtr[slot].minSize + weight - 1) / weight;
+ if (minSize > uniformGroupPtr[start].minSize) {
+ uniformGroupPtr[start].minSize = minSize;
+ }
+ }
+ }
+
+ /*
+ * Data has been gathered about uniform groups. Now relayout accordingly.
+ */
+
+ if (uniformGroups > 0) {
+ for (slot = 0; slot < gridCount; slot++) {
+ if (layoutPtr[slot].uniform != NULL) {
+ for (start = 0; start < uniformGroups; start++) {
+ if (uniformGroupPtr[start].group ==
+ layoutPtr[slot].uniform) {
+ weight = layoutPtr[slot].weight;
+ weight = weight > 0 ? weight : 1;
+ layoutPtr[slot].minSize =
+ uniformGroupPtr[start].minSize * weight;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (uniformGroupPtr != uniformPre) {
+ ckfree((char *) uniformGroupPtr);
+ }
+
+ /*
* Step 3.
* Determine the minimum slot offsets going from left to right
* that would fit all of the slaves. This determines the minimum
@@ -1707,7 +2075,7 @@ ResolveConstraints(masterPtr, slotType, maxOffset)
--layoutPtr;
if (layoutPtr != layoutData) {
- Tcl_Free((char *)layoutPtr);
+ ckfree((char *)layoutPtr);
}
return requiredSize;
}
@@ -1770,6 +2138,7 @@ GetGrid(tkwin)
gridPtr->numRows = 1;
gridPtr->padX = gridPtr->padY = 0;
+ gridPtr->padLeft = gridPtr->padTop = 0;
gridPtr->iPadX = gridPtr->iPadY = 0;
gridPtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
gridPtr->abortPtr = NULL;
@@ -1886,7 +2255,7 @@ CheckSlotData(masterPtr, slot, slotType, checkOnly)
masterPtr->masterDataPtr->columnPtr;
memcpy((VOID *) new, (VOID *) old, oldSize );
memset((VOID *) (new+numSlot), 0, newSize - oldSize );
- Tcl_Free((char *) old);
+ ckfree((char *) old);
if (slotType == ROW) {
masterPtr->masterDataPtr->rowPtr = new ;
masterPtr->masterDataPtr->rowSpace = newNumSlot ;
@@ -2037,14 +2406,14 @@ DestroyGrid(memPtr)
if (gridPtr->masterDataPtr != NULL) {
if (gridPtr->masterDataPtr->rowPtr != NULL) {
- Tcl_Free((char *) gridPtr->masterDataPtr -> rowPtr);
+ ckfree((char *) gridPtr->masterDataPtr -> rowPtr);
}
if (gridPtr->masterDataPtr->columnPtr != NULL) {
- Tcl_Free((char *) gridPtr->masterDataPtr -> columnPtr);
+ ckfree((char *) gridPtr->masterDataPtr -> columnPtr);
}
- Tcl_Free((char *) gridPtr->masterDataPtr);
+ ckfree((char *) gridPtr->masterDataPtr);
}
- Tcl_Free((char *) gridPtr);
+ ckfree((char *) gridPtr);
}
/*
@@ -2145,12 +2514,12 @@ GridStructureProc(clientData, eventPtr)
*/
static int
-ConfigureSlaves(interp, tkwin, argc, argv)
+ConfigureSlaves(interp, tkwin, objc, objv)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Tk_Window tkwin; /* Any window in application containing
* slaves. Used to look up slave names. */
- int argc; /* Number of elements in argv. */
- char *argv[]; /* Argument strings: contains one or more
+ int objc; /* Number of elements in argv. */
+ Tcl_Obj *CONST objv[]; /* Argument objects: contains one or more
* window names followed by any number
* of "option value" pairs. Caller must
* make sure that there is at least one
@@ -2159,38 +2528,57 @@ ConfigureSlaves(interp, tkwin, argc, argv)
Gridder *masterPtr;
Gridder *slavePtr;
Tk_Window other, slave, parent, ancestor;
- int i, j, c, tmp;
- size_t length;
+ int i, j, tmp;
+ int length;
int numWindows;
int width;
int defaultColumn = 0; /* default column number */
int defaultColumnSpan = 1; /* default number of columns */
char *lastWindow; /* use this window to base current
* Row/col on */
+ int numSkip; /* number of 'x' found */
+ static CONST char *optionStrings[] = {
+ "-column", "-columnspan", "-in", "-ipadx", "-ipady",
+ "-padx", "-pady", "-row", "-rowspan", "-sticky",
+ (char *) NULL };
+ enum options {
+ CONF_COLUMN, CONF_COLUMNSPAN, CONF_IN, CONF_IPADX, CONF_IPADY,
+ CONF_PADX, CONF_PADY, CONF_ROW, CONF_ROWSPAN, CONF_STICKY };
+ int index;
+ char *string;
+ char firstChar, prevChar;
/*
* Count the number of windows, or window short-cuts.
*/
- for(numWindows=i=0;i<argc;i++) {
- char firstChar = *argv[i];
+ firstChar = 0;
+ for (numWindows = i = 0; i < objc; i++) {
+ prevChar = firstChar;
+ string = Tcl_GetStringFromObj(objv[i], (int *) &length);
+ firstChar = string[0];
+
if (firstChar == '.') {
numWindows++;
continue;
}
- length = strlen(argv[i]);
+ if (length > 1 && i == 0) {
+ Tcl_AppendResult(interp, "bad argument \"", string,
+ "\": must be name of window", (char *) NULL);
+ return TCL_ERROR;
+ }
if (length > 1 && firstChar == '-') {
break;
}
if (length > 1) {
Tcl_AppendResult(interp, "unexpected parameter, \"",
- argv[i], "\", in configure list. ",
+ string, "\", in configure list. ",
"Should be window name or option", (char *) NULL);
return TCL_ERROR;
}
if ((firstChar == REL_HORIZ) && ((numWindows == 0) ||
- (*argv[i-1] == REL_SKIP) || (*argv[i-1] == REL_VERT))) {
+ (prevChar == REL_SKIP) || (prevChar == REL_VERT))) {
Tcl_AppendResult(interp,
"Must specify window before shortcut '-'.",
(char *) NULL);
@@ -2203,12 +2591,12 @@ ConfigureSlaves(interp, tkwin, argc, argv)
}
Tcl_AppendResult(interp, "invalid window shortcut, \"",
- argv[i], "\" should be '-', 'x', or '^'", (char *) NULL);
+ string, "\" should be '-', 'x', or '^'", (char *) NULL);
return TCL_ERROR;
}
numWindows = i;
- if ((argc-numWindows)&1) {
+ if ((objc - numWindows) & 1) {
Tcl_AppendResult(interp, "extra option or",
" option with no value", (char *) NULL);
return TCL_ERROR;
@@ -2227,7 +2615,8 @@ ConfigureSlaves(interp, tkwin, argc, argv)
masterPtr = NULL;
for (j = 0; j < numWindows; j++) {
- char firstChar = *argv[j];
+ string = Tcl_GetString(objv[j]);
+ firstChar = string[0];
/*
* '^' and 'x' cause us to skip a column. '-' is processed
@@ -2242,19 +2631,20 @@ ConfigureSlaves(interp, tkwin, argc, argv)
continue;
}
- for (defaultColumnSpan=1;
- j + defaultColumnSpan < numWindows &&
- (*argv[j+defaultColumnSpan] == REL_HORIZ);
+ for (defaultColumnSpan = 1; j + defaultColumnSpan < numWindows;
defaultColumnSpan++) {
- /* null body */
+ char *string = Tcl_GetString(objv[j + defaultColumnSpan]);
+ if (*string != REL_HORIZ) {
+ break;
+ }
}
- slave = Tk_NameToWindow(interp, argv[j], tkwin);
- if (slave == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[j], &slave) != TCL_OK) {
return TCL_ERROR;
}
- if (Tk_IsTopLevel(slave)) {
- Tcl_AppendResult(interp, "can't manage \"", argv[j],
+
+ if (Tk_TopWinHierarchy(slave)) {
+ Tcl_AppendResult(interp, "can't manage \"", Tcl_GetString(objv[j]),
"\": it's a top-level window", (char *) NULL);
return TCL_ERROR;
}
@@ -2275,38 +2665,34 @@ ConfigureSlaves(interp, tkwin, argc, argv)
* about keeping track of the old state.
*/
- for (i = numWindows; i < argc; i+=2) {
- length = strlen(argv[i]);
- c = argv[i][1];
-
- if (length < 2) {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"",
- argv[i], "\": must be ",
- "-column, -columnspan, -in, -ipadx, -ipady, ",
- "-padx, -pady, -row, -rowspan, or -sticky",
- (char *) NULL);
+ for (i = numWindows; i < objc; i += 2) {
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- if ((c == 'c') && (strncmp(argv[i], "-column", length) == 0)) {
- if (Tcl_GetInt(interp, argv[i+1], &tmp) != TCL_OK || tmp<0) {
+ if (index == CONF_COLUMN) {
+ if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK ||
+ tmp < 0) {
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad column value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad column value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be a non-negative integer", (char *)NULL);
return TCL_ERROR;
}
slavePtr->column = tmp;
- } else if ((c == 'c')
- && (strncmp(argv[i], "-columnspan", length) == 0)) {
- if (Tcl_GetInt(interp, argv[i+1], &tmp) != TCL_OK || tmp <= 0) {
+ } else if (index == CONF_COLUMNSPAN) {
+ if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK ||
+ tmp <= 0) {
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad columnspan value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad columnspan value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be a positive integer", (char *)NULL);
return TCL_ERROR;
}
slavePtr->numCols = tmp;
- } else if ((c == 'i') && (strncmp(argv[i], "-in", length) == 0)) {
- other = Tk_NameToWindow(interp, argv[i+1], tkwin);
- if (other == NULL) {
+ } else if (index == CONF_IN) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i+1], &other) !=
+ TCL_OK) {
return TCL_ERROR;
}
if (other == slave) {
@@ -2316,84 +2702,70 @@ ConfigureSlaves(interp, tkwin, argc, argv)
}
masterPtr = GetGrid(other);
InitMasterData(masterPtr);
- } else if ((c == 'i')
- && (strncmp(argv[i], "-ipadx", length) == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
+ } else if (index == CONF_IPADX) {
+ if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ != TCL_OK)
|| (tmp < 0)) {
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad ipadx value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad ipadx value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be positive screen distance",
(char *) NULL);
return TCL_ERROR;
}
slavePtr->iPadX = tmp*2;
- } else if ((c == 'i')
- && (strncmp(argv[i], "-ipady", length) == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
- || (tmp< 0)) {
+ } else if (index == CONF_IPADY) {
+ if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ != TCL_OK)
+ || (tmp < 0)) {
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad ipady value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad ipady value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be positive screen distance",
(char *) NULL);
return TCL_ERROR;
}
slavePtr->iPadY = tmp*2;
- } else if ((c == 'p')
- && (strncmp(argv[i], "-padx", length) == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
- || (tmp< 0)) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad padx value \"", argv[i+1],
- "\": must be positive screen distance",
- (char *) NULL);
+ } else if (index == CONF_PADX) {
+ if (TkParsePadAmount(interp, tkwin, objv[i+1],
+ &slavePtr->padLeft, &slavePtr->padX) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr->padX = tmp*2;
- } else if ((c == 'p')
- && (strncmp(argv[i], "-pady", length) == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
- || (tmp< 0)) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad pady value \"", argv[i+1],
- "\": must be positive screen distance",
- (char *) NULL);
+ } else if (index == CONF_PADY) {
+ if (TkParsePadAmount(interp, tkwin, objv[i+1],
+ &slavePtr->padTop, &slavePtr->padY) != TCL_OK) {
return TCL_ERROR;
}
- slavePtr->padY = tmp*2;
- } else if ((c == 'r') && (strncmp(argv[i], "-row", length) == 0)) {
- if (Tcl_GetInt(interp, argv[i+1], &tmp) != TCL_OK || tmp<0) {
+ } else if (index == CONF_ROW) {
+ if (Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK
+ || tmp < 0) {
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad grid value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad grid value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be a non-negative integer", (char *)NULL);
return TCL_ERROR;
}
slavePtr->row = tmp;
- } else if ((c == 'r')
- && (strncmp(argv[i], "-rowspan", length) == 0)) {
- if ((Tcl_GetInt(interp, argv[i+1], &tmp) != TCL_OK) || tmp<=0) {
+ } else if (index == CONF_ROWSPAN) {
+ if ((Tcl_GetIntFromObj(interp, objv[i+1], &tmp) != TCL_OK)
+ || tmp <= 0) {
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad rowspan value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad rowspan value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be a positive integer", (char *)NULL);
return TCL_ERROR;
}
slavePtr->numRows = tmp;
- } else if ((c == 's')
- && strncmp(argv[i], "-sticky", length) == 0) {
- int sticky = StringToSticky(argv[i+1]);
+ } else if (index == CONF_STICKY) {
+ int sticky = StringToSticky(Tcl_GetString(objv[i+1]));
if (sticky == -1) {
- Tcl_AppendResult(interp, "bad stickyness value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad stickyness value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be a string containing n, e, s, and/or w",
(char *)NULL);
return TCL_ERROR;
}
slavePtr->sticky = sticky;
- } else {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"",
- argv[i], "\": must be ",
- "-column, -columnspan, -in, -ipadx, -ipady, ",
- "-padx, -pady, -row, -rowspan, or -sticky",
- (char *) NULL);
- return TCL_ERROR;
}
}
@@ -2435,8 +2807,8 @@ ConfigureSlaves(interp, tkwin, argc, argv)
if (ancestor == parent) {
break;
}
- if (Tk_IsTopLevel(ancestor)) {
- Tcl_AppendResult(interp, "can't put ", argv[j],
+ if (Tk_TopWinHierarchy(ancestor)) {
+ Tcl_AppendResult(interp, "can't put ", Tcl_GetString(objv[j]),
" inside ", Tk_PathName(masterPtr->tkwin),
(char *) NULL);
Unlink(slavePtr);
@@ -2449,7 +2821,7 @@ ConfigureSlaves(interp, tkwin, argc, argv)
*/
if (masterPtr->masterPtr == slavePtr) {
- Tcl_AppendResult(interp, "can't put ", argv[j],
+ Tcl_AppendResult(interp, "can't put ", Tcl_GetString(objv[j]),
" inside ", Tk_PathName(masterPtr->tkwin),
", would cause management loop.",
(char *) NULL);
@@ -2494,15 +2866,23 @@ ConfigureSlaves(interp, tkwin, argc, argv)
/* Now look for all the "^"'s. */
lastWindow = NULL;
+ numSkip = 0;
for (j = 0; j < numWindows; j++) {
struct Gridder *otherPtr;
int match; /* found a match for the ^ */
- int lastRow, lastColumn; /* implied end of table */
+ int lastRow, lastColumn; /* implied end of table */
+
+ string = Tcl_GetString(objv[j]);
+ firstChar = string[0];
- if (*argv[j] == '.') {
- lastWindow = argv[j];
+ if (firstChar == '.') {
+ lastWindow = string;
+ numSkip = 0;
}
- if (*argv[j] != REL_VERT) {
+ if (firstChar == REL_SKIP) {
+ numSkip++;
+ }
+ if (firstChar != REL_VERT) {
continue;
}
@@ -2513,9 +2893,9 @@ ConfigureSlaves(interp, tkwin, argc, argv)
}
/* Count the number of consecutive ^'s starting from this position */
- for (width=1; width+j < numWindows && *argv[j+width] == REL_VERT;
- width++) {
- /* Null Body */
+ for (width = 1; width + j < numWindows; width++) {
+ char *string = Tcl_GetString(objv[j+width]);
+ if (*string != REL_VERT) break;
}
/*
@@ -2537,6 +2917,8 @@ ConfigureSlaves(interp, tkwin, argc, argv)
lastColumn = otherPtr->column + otherPtr->numCols;
}
+ lastColumn += numSkip;
+
for (match=0, slavePtr = masterPtr->slavePtr; slavePtr != NULL;
slavePtr = slavePtr->nextPtr) {
@@ -2547,6 +2929,7 @@ ConfigureSlaves(interp, tkwin, argc, argv)
match++;
j += slavePtr->numCols - 1;
lastWindow = Tk_PathName(slavePtr->tkwin);
+ numSkip = 0;
break;
}
}
@@ -2556,7 +2939,6 @@ ConfigureSlaves(interp, tkwin, argc, argv)
(char *) NULL);
return TCL_ERROR;
}
-/* j += width - 1; */
}
if (masterPtr == NULL) {
@@ -2646,6 +3028,60 @@ StringToSticky(string)
}
}
return sticky;
-}
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * NewPairObj --
+ *
+ * Creates a new list object and fills it with two integer objects.
+ *
+ * Results:
+ * The newly created list object is returned.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+static Tcl_Obj *
+NewPairObj(interp, val1, val2)
+ Tcl_Interp *interp; /* Current interpreter. */
+ int val1, val2;
+{
+ Tcl_Obj *res = Tcl_NewListObj(0, NULL);
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val1));
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val2));
+ return res;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * NewQuadObj --
+ *
+ * Creates a new list object and fills it with four integer objects.
+ *
+ * Results:
+ * The newly created list object is returned.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+static Tcl_Obj *
+NewQuadObj(interp, val1, val2, val3, val4)
+ Tcl_Interp *interp; /* Current interpreter. */
+ int val1, val2, val3, val4;
+{
+ Tcl_Obj *res = Tcl_NewListObj(0, NULL);
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val1));
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val2));
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val3));
+ Tcl_ListObjAppendElement(interp, res, Tcl_NewIntObj(val4));
+ return res;
+}
diff --git a/tk/generic/tkImage.c b/tk/generic/tkImage.c
index 778081002a9..98e5dcbee53 100644
--- a/tk/generic/tkImage.c
+++ b/tk/generic/tkImage.c
@@ -69,6 +69,9 @@ typedef struct ImageMaster {
* entry). */
Image *instancePtr; /* Pointer to first in list of instances
* derived from this name. */
+ int deleted; /* Flag set when image is being deleted. */
+ TkWindow *winPtr; /* Main window of interpreter (used to
+ * detect when the world is falling apart.) */
} ImageMaster;
typedef struct ThreadSpecificData {
@@ -83,7 +86,8 @@ static Tcl_ThreadDataKey dataKey;
* Prototypes for local procedures:
*/
-static void DeleteImage _ANSI_ARGS_((ImageMaster *masterPtr));
+static void DeleteImage _ANSI_ARGS_((ImageMaster *masterPtr));
+static void EventuallyDeleteImage _ANSI_ARGS_((ImageMaster *masterPtr));
/*
*----------------------------------------------------------------------
@@ -156,12 +160,12 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument strings. */
{
- static char *imageOptions[] = {
- "create", "delete", "height", "names", "type", "types", "width",
- (char *) NULL
+ static CONST char *imageOptions[] = {
+ "create", "delete", "height", "inuse", "names", "type", "types",
+ "width", (char *) NULL
};
enum options {
- IMAGE_CREATE, IMAGE_DELETE, IMAGE_HEIGHT, IMAGE_NAMES,
+ IMAGE_CREATE, IMAGE_DELETE, IMAGE_HEIGHT, IMAGE_INUSE, IMAGE_NAMES,
IMAGE_TYPE, IMAGE_TYPES, IMAGE_WIDTH
};
TkWindow *winPtr = (TkWindow *) clientData;
@@ -251,6 +255,9 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
masterPtr->tablePtr = &winPtr->mainPtr->imageTable;
masterPtr->hPtr = hPtr;
masterPtr->instancePtr = NULL;
+ masterPtr->deleted = 0;
+ masterPtr->winPtr = winPtr->mainPtr->winPtr;
+ Tcl_Preserve((ClientData) masterPtr->winPtr);
Tcl_SetHashValue(hPtr, masterPtr);
} else {
/*
@@ -290,15 +297,18 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
}
args[objc] = NULL;
}
+ Tcl_Preserve((ClientData) masterPtr);
if ((*typePtr->createProc)(interp, name, objc,
args, typePtr, (Tk_ImageMaster) masterPtr,
&masterPtr->masterData) != TCL_OK) {
- DeleteImage(masterPtr);
+ EventuallyDeleteImage(masterPtr);
+ Tcl_Release((ClientData) masterPtr);
if (oldimage) {
ckfree((char *) args);
}
return TCL_ERROR;
}
+ Tcl_Release((ClientData) masterPtr);
if (oldimage) {
ckfree((char *) args);
}
@@ -322,8 +332,7 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
"\" doesn't exist", (char *) NULL);
return TCL_ERROR;
}
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
- DeleteImage(masterPtr);
+ DeleteImage((ImageMaster *) Tcl_GetHashValue(hPtr));
}
break;
}
@@ -344,18 +353,42 @@ Tk_ImageObjCmd(clientData, interp, objc, objv)
Tcl_SetIntObj(Tcl_GetObjResult(interp), masterPtr->height);
break;
}
+
+ case IMAGE_INUSE: {
+ int count = 0;
+ char *arg;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "name");
+ return TCL_ERROR;
+ }
+ arg = Tcl_GetString(objv[2]);
+ hPtr = Tcl_FindHashEntry(&winPtr->mainPtr->imageTable, arg);
+ if (hPtr == NULL) {
+ Tcl_AppendResult(interp, "image \"", arg,
+ "\" doesn't exist", (char *) NULL);
+ return TCL_ERROR;
+ }
+ masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
+ if (masterPtr->typePtr != NULL && masterPtr->instancePtr != NULL) {
+ count = 1;
+ }
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), count);
+ break;
+ }
+
case IMAGE_NAMES: {
if (objc != 2) {
Tcl_WrongNumArgs(interp, 2, objv, NULL);
return TCL_ERROR;
}
- for (hPtr = Tcl_FirstHashEntry(&winPtr->mainPtr->imageTable, &search);
- hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
+ hPtr = Tcl_FirstHashEntry(&winPtr->mainPtr->imageTable, &search);
+ for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
Tcl_AppendElement(interp, Tcl_GetHashKey(
&winPtr->mainPtr->imageTable, hPtr));
}
break;
}
+
case IMAGE_TYPE: {
char *arg;
if (objc != 3) {
@@ -473,7 +506,7 @@ Tk_ImageChanged(imageMaster, x, y, width, height, imageWidth,
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tk_NameOfImage(imageMaster)
Tk_ImageMaster imageMaster; /* Token for image. */
{
@@ -511,7 +544,7 @@ Tk_GetImage(interp, tkwin, name, changeProc, clientData)
* can't be found. */
Tk_Window tkwin; /* Token for window in which image will
* be used. */
- char *name; /* Name of desired image. */
+ CONST char *name; /* Name of desired image. */
Tk_ImageChangedProc *changeProc;
/* Procedure to invoke when redisplay is
* needed because image's pixels or size
@@ -820,7 +853,7 @@ void
Tk_DeleteImage(interp, name)
Tcl_Interp *interp; /* Interpreter in which the image was
* created. */
- char *name; /* Name of image. */
+ CONST char *name; /* Name of image. */
{
Tcl_HashEntry *hPtr;
TkWindow *winPtr;
@@ -833,7 +866,7 @@ Tk_DeleteImage(interp, name)
if (hPtr == NULL) {
return;
}
- DeleteImage((ImageMaster *) Tcl_GetHashValue(hPtr));
+ DeleteImage((ImageMaster *)Tcl_GetHashValue(hPtr));
}
/*
@@ -875,7 +908,10 @@ DeleteImage(masterPtr)
(*typePtr->deleteProc)(masterPtr->masterData);
}
if (masterPtr->instancePtr == NULL) {
- Tcl_DeleteHashEntry(masterPtr->hPtr);
+ if ((masterPtr->winPtr->flags & TK_ALREADY_DEAD) == 0) {
+ Tcl_DeleteHashEntry(masterPtr->hPtr);
+ }
+ Tcl_Release((ClientData) masterPtr->winPtr);
ckfree((char *) masterPtr);
}
}
@@ -883,6 +919,35 @@ DeleteImage(masterPtr)
/*
*----------------------------------------------------------------------
*
+ * EventuallyDeleteImage --
+ *
+ * Arrange for an image to be deleted when it is safe to do so.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Image will get freed, though not until it is no longer
+ * Tcl_Preserve()d by anything. May be called multiple times on
+ * the same image without ill effects.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EventuallyDeleteImage(masterPtr)
+ ImageMaster *masterPtr; /* Pointer to main data structure for image. */
+{
+ if (!masterPtr->deleted) {
+ masterPtr->deleted = 1;
+ Tcl_EventuallyFree((ClientData) masterPtr,
+ (Tcl_FreeProc *)DeleteImage);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkDeleteAllImages --
*
* This procedure is called when an application is deleted. It
@@ -906,12 +971,10 @@ TkDeleteAllImages(mainPtr)
{
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
- ImageMaster *masterPtr;
for (hPtr = Tcl_FirstHashEntry(&mainPtr->imageTable, &search);
hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) {
- masterPtr = (ImageMaster *) Tcl_GetHashValue(hPtr);
- DeleteImage(masterPtr);
+ EventuallyDeleteImage((ImageMaster *) Tcl_GetHashValue(hPtr));
}
Tcl_DeleteHashTable(&mainPtr->imageTable);
}
@@ -941,7 +1004,7 @@ ClientData
Tk_GetImageMasterData(interp, name, typePtrPtr)
Tcl_Interp *interp; /* Interpreter in which the image was
* created. */
- char *name; /* Name of image. */
+ CONST char *name; /* Name of image. */
Tk_ImageType **typePtrPtr; /* Points to location to fill in with
* pointer to type information for image. */
{
@@ -987,7 +1050,7 @@ Tk_SetTSOrigin(tkwin, gc, x, y)
GC gc;
int x, y;
{
- while (!Tk_IsTopLevel(tkwin)) {
+ while (!Tk_TopWinHierarchy(tkwin)) {
x -= Tk_X(tkwin) + Tk_Changes(tkwin)->border_width;
y -= Tk_Y(tkwin) + Tk_Changes(tkwin)->border_width;
tkwin = Tk_Parent(tkwin);
@@ -995,5 +1058,3 @@ Tk_SetTSOrigin(tkwin, gc, x, y)
XSetTSOrigin(Tk_Display(tkwin), gc, x, y);
}
-
-
diff --git a/tk/generic/tkImgBmap.c b/tk/generic/tkImgBmap.c
index 47eacf2f560..9eaa8db6b5f 100644
--- a/tk/generic/tkImgBmap.c
+++ b/tk/generic/tkImgBmap.c
@@ -214,7 +214,6 @@ ImgBmapCreate(interp, name, argc, argv, typePtr, master, clientDataPtr)
masterPtr->maskFileString = NULL;
masterPtr->maskDataString = NULL;
masterPtr->instancePtr = NULL;
-
if (ImgBmapConfigureMaster(masterPtr, argc, argv, 0) != TCL_OK) {
ImgBmapDelete((ClientData) masterPtr);
return TCL_ERROR;
@@ -255,7 +254,7 @@ ImgBmapConfigureMaster(masterPtr, objc, objv, flags)
BitmapInstance *instancePtr;
int maskWidth, maskHeight, dummy1, dummy2;
- char **argv = (char **) ckalloc((objc+1) * sizeof(char *));
+ CONST char **argv = (CONST char **) ckalloc((objc+1) * sizeof(char *));
for (dummy1 = 0; dummy1 < objc; dummy1++) {
argv[dummy1]=Tcl_GetString(objv[dummy1]);
}
@@ -499,7 +498,8 @@ TkGetBitmapData(interp, string, fileName, widthPtr, heightPtr,
int *hotXPtr, *hotYPtr; /* Position of hot spot or -1,-1. */
{
int width, height, numBytes, hotX, hotY;
- char *p, *end, *expandedFileName;
+ CONST char *expandedFileName;
+ char *p, *end;
ParseInfo pi;
char *data = NULL;
Tcl_DString buffer;
@@ -762,7 +762,7 @@ ImgBmapCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *bmapOptions[] = {"cget", "configure", (char *) NULL};
+ static CONST char *bmapOptions[] = {"cget", "configure", (char *) NULL};
BitmapMaster *masterPtr = (BitmapMaster *) clientData;
int code, index;
@@ -1106,13 +1106,106 @@ GetByte(chan)
/*
*----------------------------------------------------------------------
*
+ * ImgBmapPsImagemask --
+ *
+ * This procedure generates postscript suitable for rendering a
+ * single bitmap of an image. A single bitmap image might contain both
+ * a foreground and a background bitmap. This routine is called once
+ * for each such bitmap in a bitmap image.
+ *
+ * Prior to invoking this routine, the following setup has occurred:
+ *
+ * 1. The postscript foreground color has been set to the color
+ * used to render the bitmap.
+ *
+ * 2. The origin of the postscript coordinate system is set to
+ * the lower left corner of the bitmap.
+ *
+ * 3. The postscript coordinate system has been scaled so that
+ * the entire bitmap is one unit squared.
+ *
+ * Some postscript implementations cannot handle bitmap strings
+ * longer than about 60k characters. If the bitmap data is that big
+ * or bigger, then we render it by splitting it into several smaller
+ * bitmaps.
+ *
+ * Results:
+ * Returns TCL_OK on success. Returns TCL_ERROR and leaves and error
+ * message in interp->result if there is a problem.
+ *
+ * Side effects:
+ * Postscript code is appended to interp->result.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ImgBmapPsImagemask(interp, width, height, data)
+ Tcl_Interp *interp; /* Append postscript to this interpreter */
+ int width, height; /* Width and height of the bitmap in pixels */
+ char *data; /* Data for the bitmap */
+{
+ int i, j, nBytePerRow;
+ char buffer[200];
+
+ /*
+ * The bit order of bitmaps in Tk is the opposite of the bit order that
+ * postscript uses. (In Tk, the least significant bit is on the right
+ * side of the bitmap and in postscript the least significant bit is shown
+ * on the left.) The following array is used to reverse the order of bits
+ * within a byte so that the bits will be in the order postscript expects.
+ */
+ static unsigned char bit_reverse[] = {
+ 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240,
+ 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248,
+ 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244,
+ 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252,
+ 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242,
+ 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250,
+ 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246,
+ 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254,
+ 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241,
+ 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249,
+ 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245,
+ 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253,
+ 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243,
+ 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251,
+ 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247,
+ 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255,
+ };
+
+ if (width*height > 60000) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "unable to generate postscript for bitmaps "
+ "larger than 60000 pixels", 0);
+ return TCL_ERROR;
+ }
+ sprintf(buffer, "0 0 moveto %d %d true [%d 0 0 %d 0 %d] {<\n",
+ width, height, width, -height, height);
+ Tcl_AppendResult(interp, buffer, 0);
+ nBytePerRow = (width+7)/8;
+ for(i=0; i<height; i++){
+ for(j=0; j<nBytePerRow; j++){
+ sprintf(buffer, " %02x", bit_reverse[0xff & data[i*nBytePerRow + j]]);
+ Tcl_AppendResult(interp, buffer, 0);
+ }
+ Tcl_AppendResult(interp, "\n", 0);
+ }
+ Tcl_AppendResult(interp, ">} imagemask \n", 0);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* ImgBmapPostscript --
*
- * This procedure is called by the image code to create
- * postscript output for an image.
+ * This procedure generates postscript for rendering a bitmap image.
*
* Results:
- * None.
+ * On success, this routine writes postscript code into interp->result
+ * and returns TCL_OK TCL_ERROR is returned and an error
+ * message is left in interp->result if anything goes wrong.
*
* Side effects:
* None.
@@ -1130,75 +1223,75 @@ ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height,
int x, y, width, height, prepass;
{
BitmapMaster *masterPtr = (BitmapMaster *) clientData;
- int rowsAtOnce, rowsThisTime;
- int curRow, yy;
char buffer[200];
if (prepass) {
return TCL_OK;
}
+
/*
- * Color the background, if there is one.
+ * There is nothing to do for bitmaps with zero width or height
*/
+ if( width<=0 || height<=0 || masterPtr->width<=0 || masterPtr->height<=0 ){
+ return TCL_OK;
+ }
- if (masterPtr->bgUid != NULL) {
+ /*
+ * Translate the origin of the coordinate system to be the lower-left
+ * corner of the bitmap and adjust the scale of the coordinate system
+ * so that entire bitmap covers one square unit of the page.
+ * The calling function put a "gsave" into the postscript and
+ * will add a "grestore" at after this routine returns, so it is safe
+ * to make whatever changes are necessary here.
+ */
+ if( x!=0 || y!=0 ){
+ sprintf(buffer, "%d %d moveto\n", x, y);
+ Tcl_AppendResult(interp, buffer, 0);
+ }
+ if( width!=1 || height!=1 ){
+ sprintf(buffer, "%d %d scale\n", width, height);
+ Tcl_AppendResult(interp, buffer, 0);
+ }
+
+ /*
+ * Color the background, if there is one. This step is skipped if the
+ * background is transparent. If the background is not transparent and
+ * there is no background mask, then color the complete rectangle that
+ * encloses the bitmap. If there is a background mask, then only apply
+ * color to the bits specified by the mask.
+ */
+ if ((masterPtr->bgUid != NULL) && (masterPtr->bgUid[0] != '\000')) {
XColor color;
XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->bgUid,
&color);
- sprintf(buffer,
- "%d %d moveto %d 0 rlineto 0 %d rlineto %d %s\n",
- x, y, width, height, -width,"0 rlineto closepath");
- Tcl_AppendResult(interp, buffer, (char *) NULL);
if (Tk_PostscriptColor(interp, psinfo, &color) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_AppendResult(interp, "fill\n", (char *) NULL);
+ if (masterPtr->maskData == NULL) {
+ Tcl_AppendResult(interp,
+ "0 0 moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto "
+ "closepath fill\n", 0
+ );
+ } else if (ImgBmapPsImagemask(interp, masterPtr->width,
+ masterPtr->height, masterPtr->maskData) != TCL_OK) {
+ return TCL_ERROR;
+ }
}
/*
- * Draw the bitmap, if there is a foreground color. If the bitmap
- * is very large, then chop it up into multiple bitmaps, each
- * consisting of one or more rows. This is needed because Postscript
- * can't handle single strings longer than 64 KBytes long.
+ * Draw the bitmap foreground, assuming there is one.
*/
-
- if (masterPtr->fgUid != NULL) {
+ if ( (masterPtr->fgUid != NULL) && (masterPtr->data != NULL) ) {
XColor color;
XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin), masterPtr->fgUid,
&color);
if (Tk_PostscriptColor(interp, psinfo, &color) != TCL_OK) {
return TCL_ERROR;
}
- if (width > 60000) {
- Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "can't generate Postscript",
- " for bitmaps more than 60000 pixels wide",
- (char *) NULL);
+ if (ImgBmapPsImagemask(interp, masterPtr->width, masterPtr->height,
+ masterPtr->data) != TCL_OK) {
return TCL_ERROR;
}
- rowsAtOnce = 60000/width;
- if (rowsAtOnce < 1) {
- rowsAtOnce = 1;
- }
- sprintf(buffer, "%d %d translate\n", x, y);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- for (curRow = y+height-1; curRow >= y; curRow -= rowsAtOnce) {
- rowsThisTime = rowsAtOnce;
- if (rowsThisTime > (curRow + 1 - y)) {
- rowsThisTime = curRow + 1 - y;
- }
- sprintf(buffer, "%d %d", width, rowsThisTime);
- Tcl_AppendResult(interp, buffer, " true matrix {\n<",
- (char *) NULL);
- for (yy = curRow; yy >= (curRow - rowsThisTime + 1); yy--) {
- sprintf(buffer, "row %d\n", yy);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- }
- sprintf(buffer, "0 %.15g", (double) rowsThisTime);
- Tcl_AppendResult(interp, ">\n} imagemask\n", buffer,
- " translate\n", (char *) NULL);
- }
}
return TCL_OK;
}
-
diff --git a/tk/generic/tkImgGIF.c b/tk/generic/tkImgGIF.c
index f9588892b4a..632f900165f 100644
--- a/tk/generic/tkImgGIF.c
+++ b/tk/generic/tkImgGIF.c
@@ -19,14 +19,14 @@
* This file also contains code from the giftoppm program, which is
* copyrighted as follows:
*
- * +-------------------------------------------------------------------+
- * | Copyright 1990, David Koblas. |
- * | 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. |
+ * +--------------------------------------------------------------------+
+ * | Copyright 1990, David Koblas. |
+ * | 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. |
* +-------------------------------------------------------------------+
*
* RCS: @(#) $Id$
@@ -41,7 +41,7 @@
* Any other invalid character is treated as an EOF
*/
-#define GIF_SPECIAL (256)
+#define GIF_SPECIAL (256)
#define GIF_PAD (GIF_SPECIAL+1)
#define GIF_SPACE (GIF_SPECIAL+2)
#define GIF_BAD (GIF_SPECIAL+3)
@@ -72,13 +72,15 @@ typedef struct mFile {
* encoding independant.
*/
-static CONST char GIF87a[] =
- { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x00 }; /* ASCII GIF87a */
-static CONST char GIF89a[] =
- { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x00 }; /* ASCII GIF89a */
-# define GIF_TERMINATOR 0x3b /* ASCII ; */
-# define GIF_EXTENSION 0x21 /* ASCII ! */
-# define GIF_START 0x2c /* ASCII , */
+static CONST char GIF87a[] = { /* ASCII GIF87a */
+ 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x00
+};
+static CONST char GIF89a[] = { /* ASCII GIF89a */
+ 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x00
+};
+# define GIF_TERMINATOR 0x3b /* ASCII ; */
+# define GIF_EXTENSION 0x21 /* ASCII ! */
+# define GIF_START 0x2c /* ASCII , */
/*
* HACK ALERT!! HACK ALERT!! HACK ALERT!!
@@ -96,10 +98,10 @@ static Tcl_ThreadDataKey dataKey;
* The format record for the GIF file format:
*/
-static int FileMatchGIF _ANSI_ARGS_((Tcl_Channel chan, CONST char *fileName,
+static int FileMatchGIF _ANSI_ARGS_((Tcl_Channel chan, CONST char *fileName,
Tcl_Obj *format, int *widthPtr, int *heightPtr,
Tcl_Interp *interp));
-static int FileReadGIF _ANSI_ARGS_((Tcl_Interp *interp,
+static int FileReadGIF _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Channel chan, CONST char *fileName, Tcl_Obj *format,
Tk_PhotoHandle imageHandle, int destX, int destY,
int width, int height, int srcX, int srcY));
@@ -118,13 +120,13 @@ static int CommonWriteGIF _ANSI_ARGS_((Tcl_Interp *interp,
Tk_PhotoImageBlock *blockPtr));
Tk_PhotoImageFormat tkImgFmtGIF = {
- "gif", /* name */
- FileMatchGIF, /* fileMatchProc */
- StringMatchGIF, /* stringMatchProc */
- FileReadGIF, /* fileReadProc */
- StringReadGIF, /* stringReadProc */
- FileWriteGIF, /* fileWriteProc */
- NULL, /* stringWriteProc */
+ "gif", /* name */
+ FileMatchGIF, /* fileMatchProc */
+ StringMatchGIF, /* stringMatchProc */
+ FileReadGIF, /* fileReadProc */
+ StringReadGIF, /* stringReadProc */
+ FileWriteGIF, /* fileWriteProc */
+ NULL, /* stringWriteProc */
};
#define INTERLACE 0x40
@@ -136,7 +138,7 @@ Tk_PhotoImageFormat tkImgFmtGIF = {
#define CM_BLUE 2
#define CM_ALPHA 3
#define MAX_LWZ_BITS 12
-#define LM_to_uint(a,b) (((b)<<8)|(a))
+#define LM_to_uint(a,b) (((b)<<8)|(a))
#define ReadOK(file,buffer,len) (Fread(buffer, len, 1, file) != 0)
/*
@@ -216,7 +218,7 @@ FileMatchGIF(chan, fileName, format, widthPtr, heightPtr, interp)
*
* Results:
* A standard TCL completion code. If TCL_ERROR is returned
- * then an error message is left in interp->result.
+ * then an error message is left in the interp's result.
*
* Side effects:
* The access position in file f is changed, and new data is
@@ -249,7 +251,7 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
int bitPixel;
unsigned char colorMap[MAXCOLORMAPSIZE][4];
int transparent = -1;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-index", NULL
};
@@ -288,7 +290,7 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
}
bitPixel = 2<<(buf[0]&0x07);
- if (BitSet(buf[0], LOCALCOLORMAP)) { /* Global Colormap */
+ if (BitSet(buf[0], LOCALCOLORMAP)) { /* Global Colormap */
if (!ReadColorMap(chan, bitPixel, colorMap)) {
Tcl_AppendResult(interp, "error reading color map",
(char *) NULL);
@@ -345,12 +347,14 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
*/
if (Fread(buf, 1, 1, chan) != 1) {
- interp->result =
- "error reading extension function code in GIF image";
+ Tcl_SetResult(interp,
+ "error reading extension function code in GIF image",
+ TCL_STATIC);
goto error;
}
if (DoExtension(chan, buf[0], &transparent) < 0) {
- interp->result = "error reading extension in GIF image";
+ Tcl_SetResult(interp, "error reading extension in GIF image",
+ TCL_STATIC);
goto error;
}
continue;
@@ -364,7 +368,9 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
}
if (Fread(buf, 1, 9, chan) != 9) {
- interp->result = "couldn't read left/top/width/height in GIF image";
+ Tcl_SetResult(interp,
+ "couldn't read left/top/width/height in GIF image",
+ TCL_STATIC);
goto error;
}
@@ -374,7 +380,9 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
bitPixel = 1<<((buf[8]&0x07)+1);
if (index--) {
- /* this is not the image we want to read: skip it. */
+ /*
+ * This is not the image we want to read: skip it.
+ */
if (BitSet(buf[8], LOCALCOLORMAP)) {
if (!ReadColorMap(chan, bitPixel, colorMap)) {
Tcl_AppendResult(interp,
@@ -383,7 +391,9 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
}
}
- /* If we've not yet allocated a trash buffer, do so now */
+ /*
+ * If we've not yet allocated a trash buffer, do so now.
+ */
if (trashBuffer == NULL) {
nBytes = fileWidth * fileHeight * 3;
trashBuffer =
@@ -391,28 +401,32 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
}
/*
- * Slurp! Process the data for this image and stuff it in a
- * trash buffer.
+ * Slurp! Process the data for this image and stuff it in
+ * a trash buffer.
*
- * Yes, it might be more efficient here to *not* store the data
- * (we're just going to throw it away later). However, I elected
- * to implement it this way for good reasons. First, I wanted to
- * avoid duplicating the (fairly complex) LWZ decoder in ReadImage.
- * Fine, you say, why didn't you just modify it to allow the use of
- * a NULL specifier for the output buffer? I tried that, but it
- * negatively impacted the performance of what I think will be the
- * common case: reading the first image in the file. Rather than
- * marginally improve the speed of the less frequent case, I chose
- * to maintain high performance for the common case.
+ * Yes, it might be more efficient here to *not* store the
+ * data (we're just going to throw it away later).
+ * However, I elected to implement it this way for good
+ * reasons. First, I wanted to avoid duplicating the
+ * (fairly complex) LWZ decoder in ReadImage. Fine, you
+ * say, why didn't you just modify it to allow the use of
+ * a NULL specifier for the output buffer? I tried that,
+ * but it negatively impacted the performance of what I
+ * think will be the common case: reading the first image
+ * in the file. Rather than marginally improve the speed
+ * of the less frequent case, I chose to maintain high
+ * performance for the common case.
*/
if (ReadImage(interp, (char *) trashBuffer, chan, fileWidth,
- fileHeight, colorMap, 0, 0, 0, 0, 0, -1) != TCL_OK) {
- goto error;
+ fileHeight, colorMap, 0, 0, 0, 0, 0, -1) != TCL_OK) {
+ goto error;
}
continue;
}
- /* If a trash buffer has been allocated, free it now */
+ /*
+ * If a trash buffer has been allocated, free it now.
+ */
if (trashBuffer != NULL) {
ckfree((char *)trashBuffer);
trashBuffer = NULL;
@@ -455,19 +469,20 @@ FileReadGIF(interp, chan, fileName, format, imageHandle, destX, destY,
block.height = height;
block.pixelSize = (transparent>=0) ? 4 : 3;
block.offset[3] = (transparent>=0) ? 3 : 0;
- block.pitch = block.pixelSize * width;
- nBytes = block.pitch * height;
+ block.pitch = block.pixelSize * fileWidth;
+ nBytes = block.pitch * fileHeight;
block.pixelPtr = (unsigned char *) ckalloc((unsigned) nBytes);
- if (ReadImage(interp, (char *) block.pixelPtr, chan, width,
- height, colorMap, fileWidth, fileHeight, srcX, srcY,
+ if (ReadImage(interp, (char *) block.pixelPtr, chan, fileWidth,
+ fileHeight, colorMap, fileWidth, fileHeight, srcX, srcY,
BitSet(buf[8], INTERLACE), transparent) != TCL_OK) {
goto error;
}
break;
}
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height,
+ TK_PHOTO_COMPOSITE_SET);
noerror:
if (block.pixelPtr) {
@@ -516,25 +531,31 @@ StringMatchGIF(dataObj, format, widthPtr, heightPtr, interp)
data = Tcl_GetByteArrayFromObj(dataObj, &length);
- /* Header is a minimum of 10 bytes */
+ /*
+ * Header is a minimum of 10 bytes.
+ */
if (length < 10) {
- return 0;
+ return 0;
}
- /* Check whether the data is Base64 encoded */
+ /*
+ * Check whether the data is Base64 encoded.
+ */
if ((strncmp(GIF87a, (char *) data, 6) != 0) &&
- (strncmp(GIF89a, (char *) data, 6) != 0)) {
- /* Try interpreting the data as Base64 encoded */
- mInit((unsigned char *) data, &handle);
- got = Mread(header, 10, 1, &handle);
- if (got != 10
- || ((strncmp(GIF87a, (char *) header, 6) != 0)
- && (strncmp(GIF89a, (char *) header, 6) != 0))) {
- return 0;
- }
+ (strncmp(GIF89a, (char *) data, 6) != 0)) {
+ /*
+ * Try interpreting the data as Base64 encoded
+ */
+ mInit((unsigned char *) data, &handle);
+ got = Mread(header, 10, 1, &handle);
+ if (got != 10
+ || ((strncmp(GIF87a, (char *) header, 6) != 0)
+ && (strncmp(GIF89a, (char *) header, 6) != 0))) {
+ return 0;
+ }
} else {
- memcpy((VOID *) header, (VOID *) data, 10);
+ memcpy((VOID *) header, (VOID *) data, 10);
}
*widthPtr = LM_to_uint(header[6],header[7]);
*heightPtr = LM_to_uint(header[8],header[9]);
@@ -552,7 +573,7 @@ StringMatchGIF(dataObj, format, widthPtr, heightPtr, interp)
*
* Results:
* A standard TCL completion code. If TCL_ERROR is returned
- * then an error message is left in interp->result.
+ * then an error message is left in the interp's result.
*
* Side effects:
* new data is added to the image given by imageHandle. This
@@ -570,13 +591,13 @@ StringReadGIF(interp, dataObj, format, imageHandle,
Tcl_Obj *format; /* format object, or NULL */
Tk_PhotoHandle imageHandle; /* the image to write this data into */
int destX, destY; /* The rectangular region of the */
- int width, height; /* image to copy */
+ int width, height; /* image to copy */
int srcX, srcY;
{
int result;
MFile handle;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Channel dataSrc;
char *data;
@@ -584,8 +605,7 @@ StringReadGIF(interp, dataObj, format, imageHandle,
* Check whether the data is Base64 encoded
*/
data = (char *) Tcl_GetByteArrayFromObj(dataObj, NULL);
- if ((strncmp(GIF87a, data, 6) != 0) &&
- (strncmp(GIF89a, data, 6) != 0)) {
+ if ((strncmp(GIF87a, data, 6) != 0) && (strncmp(GIF89a, data, 6) != 0)) {
mInit((unsigned char *)data, &handle);
tsdPtr->fromData = 1;
dataSrc = (Tcl_Channel) &handle;
@@ -597,7 +617,7 @@ StringReadGIF(interp, dataObj, format, imageHandle,
result = FileReadGIF(interp, dataSrc, "inline data",
format, imageHandle, destX, destY, width, height, srcX, srcY);
tsdPtr->fromData = 0;
- return(result);
+ return result;
}
/*
@@ -652,65 +672,65 @@ ReadGIFHeader(chan, widthPtr, heightPtr)
static int
ReadColorMap(chan, number, buffer)
- Tcl_Channel chan;
- int number;
- unsigned char buffer[MAXCOLORMAPSIZE][4];
+ Tcl_Channel chan;
+ int number;
+ unsigned char buffer[MAXCOLORMAPSIZE][4];
{
- int i;
- unsigned char rgb[3];
+ int i;
+ unsigned char rgb[3];
- for (i = 0; i < number; ++i) {
- if (! ReadOK(chan, rgb, sizeof(rgb))) {
- return 0;
- }
-
- if (buffer) {
- buffer[i][CM_RED] = rgb[0] ;
- buffer[i][CM_GREEN] = rgb[1] ;
- buffer[i][CM_BLUE] = rgb[2] ;
- buffer[i][CM_ALPHA] = 255 ;
- }
+ for (i = 0; i < number; ++i) {
+ if (! ReadOK(chan, rgb, sizeof(rgb))) {
+ return 0;
}
- return 1;
+
+ if (buffer) {
+ buffer[i][CM_RED] = rgb[0] ;
+ buffer[i][CM_GREEN] = rgb[1] ;
+ buffer[i][CM_BLUE] = rgb[2] ;
+ buffer[i][CM_ALPHA] = 255 ;
+ }
+ }
+ return 1;
}
static int
DoExtension(chan, label, transparent)
- Tcl_Channel chan;
- int label;
- int *transparent;
+ Tcl_Channel chan;
+ int label;
+ int *transparent;
{
static unsigned char buf[256];
int count;
switch (label) {
- case 0x01: /* Plain Text Extension */
- break;
-
- case 0xff: /* Application Extension */
- break;
+ case 0x01: /* Plain Text Extension */
+ break;
- case 0xfe: /* Comment Extension */
- do {
- count = GetDataBlock(chan, (unsigned char*) buf);
- } while (count > 0);
- return count;
+ case 0xff: /* Application Extension */
+ break;
- case 0xf9: /* Graphic Control Extension */
+ case 0xfe: /* Comment Extension */
+ do {
count = GetDataBlock(chan, (unsigned char*) buf);
- if (count < 0) {
- return 1;
- }
- if ((buf[0] & 0x1) != 0) {
- *transparent = buf[3];
- }
+ } while (count > 0);
+ return count;
+
+ case 0xf9: /* Graphic Control Extension */
+ count = GetDataBlock(chan, (unsigned char*) buf);
+ if (count < 0) {
+ return 1;
+ }
+ if ((buf[0] & 0x1) != 0) {
+ *transparent = buf[3];
+ }
- do {
- count = GetDataBlock(chan, (unsigned char*) buf);
- } while (count > 0);
- return count;
+ do {
+ count = GetDataBlock(chan, (unsigned char*) buf);
+ } while (count > 0);
+ return count;
}
do {
@@ -723,8 +743,8 @@ static int ZeroDataBlock = 0;
static int
GetDataBlock(chan, buf)
- Tcl_Channel chan;
- unsigned char *buf;
+ Tcl_Channel chan;
+ unsigned char *buf;
{
unsigned char count;
@@ -749,17 +769,17 @@ GetDataBlock(chan, buf)
* ReadImage --
*
* Process a GIF image from a given source, with a given height,
- * width, transparency, etc.
+ * width, transparency, etc.
*
- * This code is based on the code found in the ImageMagick GIF decoder,
- * which is (c) 2000 ImageMagick Studio.
+ * This code is based on the code found in the ImageMagick GIF decoder,
+ * which is (c) 2000 ImageMagick Studio.
*
- * Some thoughts on our implementation:
- * It sure would be nice if ReadImage didn't take 11 parameters! I think
- * that if we were smarter, we could avoid doing that.
+ * Some thoughts on our implementation:
+ * It sure would be nice if ReadImage didn't take 11 parameters! I think
+ * that if we were smarter, we could avoid doing that.
*
- * Possible further optimizations: we could pull the GetCode function
- * directly into ReadImage, which would improve our speed.
+ * Possible further optimizations: we could pull the GetCode function
+ * directly into ReadImage, which would improve our speed.
*
* Results:
* Processes a GIF image and loads the pixel data into a memory array.
@@ -773,15 +793,15 @@ GetDataBlock(chan, buf)
static int
ReadImage(interp, imagePtr, chan, len, rows, cmap,
width, height, srcX, srcY, interlace, transparent)
- Tcl_Interp *interp;
- char *imagePtr;
- Tcl_Channel chan;
- int len, rows;
- unsigned char cmap[MAXCOLORMAPSIZE][4];
- int width, height;
- int srcX, srcY;
- int interlace;
- int transparent;
+ Tcl_Interp *interp;
+ char *imagePtr;
+ Tcl_Channel chan;
+ int len, rows;
+ unsigned char cmap[MAXCOLORMAPSIZE][4];
+ int width, height;
+ int srcX, srcY;
+ int interlace;
+ int transparent;
{
unsigned char initialCodeSize;
int v;
@@ -793,9 +813,9 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
unsigned char append[(1 << MAX_LWZ_BITS)];
unsigned char stack[(1 << MAX_LWZ_BITS)*2];
register unsigned char *top;
- int codeSize, clearCode, inCode, endCode, oldCode, maxCode,
- code, firstCode;
-
+ int codeSize, clearCode, inCode, endCode, oldCode, maxCode;
+ int code, firstCode;
+
/*
* Initialize the decoder
*/
@@ -804,7 +824,7 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
Tcl_PosixError(interp), (char *) NULL);
return TCL_ERROR;
}
- if (transparent!=-1) {
+ if (transparent != -1) {
cmap[transparent][CM_RED] = 0;
cmap[transparent][CM_GREEN] = 0;
cmap[transparent][CM_BLUE] = 0;
@@ -813,19 +833,21 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
pixelPtr = imagePtr;
- /* Initialize the decoder */
- /* Set values for "special" numbers:
+ /*
+ * Initialize the decoder.
+ *
+ * Set values for "special" numbers:
* clear code reset the decoder
* end code stop decoding
* code size size of the next code to retrieve
* max code next available table position
*/
- clearCode = 1 << (int) initialCodeSize;
- endCode = clearCode + 1;
- codeSize = (int) initialCodeSize + 1;
- maxCode = clearCode + 2;
- oldCode = -1;
- firstCode = -1;
+ clearCode = 1 << (int) initialCodeSize;
+ endCode = clearCode + 1;
+ codeSize = (int) initialCodeSize + 1;
+ maxCode = clearCode + 2;
+ oldCode = -1;
+ firstCode = -1;
memset((void *)prefix, 0, (1 << MAX_LWZ_BITS) * sizeof(short));
memset((void *)append, 0, (1 << MAX_LWZ_BITS) * sizeof(char));
@@ -836,12 +858,16 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
GetCode(chan, 0, 1);
- /* Read until we finish the image */
+ /*
+ * Read until we finish the image
+ */
for (i = 0, ypos = 0; i < rows; i++) {
for (xpos = 0; xpos < len; ) {
if (top == stack) {
- /* Bummer -- our stack is empty. Now we have to work! */
+ /*
+ * Bummer -- our stack is empty. Now we have to work!
+ */
code = GetCode(chan, codeSize, 0);
if (code < 0) {
return TCL_OK;
@@ -860,10 +886,12 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
}
if (code == clearCode) {
- /* Reset the decoder */
- codeSize = initialCodeSize + 1;
- maxCode = clearCode + 2;
- oldCode = -1;
+ /*
+ * Reset the decoder.
+ */
+ codeSize = initialCodeSize + 1;
+ maxCode = clearCode + 2;
+ oldCode = -1;
continue;
}
@@ -876,7 +904,7 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
* roll this into the clearCode test above, because
* at that point we have not yet read the next code.
*/
- *top++=append[code];
+ *top++ = append[code];
oldCode = code;
firstCode = code;
continue;
@@ -912,15 +940,20 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
return TCL_OK;
}
- /* Push the head of the string onto the stack */
+ /*
+ * Push the head of the string onto the stack.
+ */
*top++ = firstCode;
- /* Add a new string to the string table */
+ /*
+ * Add a new string to the string table
+ */
prefix[maxCode] = oldCode;
append[maxCode] = firstCode;
maxCode++;
- /* maxCode tells us the maximum code value we can accept.
+ /*
+ * maxCode tells us the maximum code value we can accept.
* If we see that we need more bits to represent it than
* we are requesting from the unpacker, we need to increase
* the number we ask for.
@@ -932,7 +965,9 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
oldCode = inCode;
}
- /* Pop the next color index off the stack */
+ /*
+ * Pop the next color index off the stack.
+ */
v = *(--top);
if (v < 0) {
return TCL_OK;
@@ -953,7 +988,9 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
}
- /* If interlacing, the next ypos is not just +1 */
+ /*
+ * If interlacing, the next ypos is not just +1
+ */
if (interlace) {
ypos += interlaceStep[pass];
while (ypos >= height) {
@@ -977,23 +1014,23 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
*
* GetCode --
*
- * Extract the next compression code from the file. In GIF's, the
- * compression codes are between 3 and 12 bits long and are then
- * packed into 8 bit bytes, left to right, for example:
- * bbbaaaaa
- * dcccccbb
- * eeeedddd
- * ...
- * We use a byte buffer read from the file and a sliding window
- * to unpack the bytes. Thanks to ImageMagick for the sliding window
- * idea.
- * args: chan the channel to read from
- * code_size size of the code to extract
- * flag boolean indicating whether the extractor
- * should be reset or not
+ * Extract the next compression code from the file. In GIF's, the
+ * compression codes are between 3 and 12 bits long and are then
+ * packed into 8 bit bytes, left to right, for example:
+ * bbbaaaaa
+ * dcccccbb
+ * eeeedddd
+ * ...
+ * We use a byte buffer read from the file and a sliding window
+ * to unpack the bytes. Thanks to ImageMagick for the sliding window
+ * idea.
+ * args: chan the channel to read from
+ * code_size size of the code to extract
+ * flag boolean indicating whether the extractor
+ * should be reset or not
*
* Results:
- * code the next compression code
+ * code the next compression code
*
* Side effects:
* May consume more input from chan.
@@ -1003,9 +1040,9 @@ ReadImage(interp, imagePtr, chan, len, rows, cmap,
static int
GetCode(chan, code_size, flag)
- Tcl_Channel chan;
- int code_size;
- int flag;
+ Tcl_Channel chan;
+ int code_size;
+ int flag;
{
static unsigned char buf[280];
static int bytes = 0, done;
@@ -1016,7 +1053,9 @@ GetCode(chan, code_size, flag)
int ret;
if (flag) {
- /* Initialize the decoder */
+ /*
+ * Initialize the decoder.
+ */
bitsInWindow = 0;
bytes = 0;
window = 0;
@@ -1026,12 +1065,16 @@ GetCode(chan, code_size, flag)
}
while (bitsInWindow < code_size) {
- /* Not enough bits in our window to cover the request */
+ /*
+ * Not enough bits in our window to cover the request.
+ */
if (done) {
return -1;
}
if (bytes == 0) {
- /* Not enough bytes in our buffer to add to the window */
+ /*
+ * Not enough bytes in our buffer to add to the window.
+ */
bytes = GetDataBlock(chan, buf);
c = buf;
if (bytes <= 0) {
@@ -1039,17 +1082,24 @@ GetCode(chan, code_size, flag)
break;
}
}
- /* Tack another byte onto the window, see if that's enough */
+ /*
+ * Tack another byte onto the window, see if that's enough.
+ */
window += (*c) << bitsInWindow;
c++;
bitsInWindow += 8;
bytes--;
}
- /* The next code will always be the last code_size bits of the window */
+
+ /*
+ * The next code will always be the last code_size bits of the window.
+ */
ret = window & ((1 << code_size) - 1);
- /* Shift data in the window to put the next code at the end */
+ /*
+ * Shift data in the window to put the next code at the end.
+ */
window >>= code_size;
bitsInWindow -= code_size;
return ret;
@@ -1139,45 +1189,45 @@ Mread(dst, chunkSize, numChunks, handle)
static int
Mgetc(handle)
- MFile *handle; /* Handle containing decoder data and state. */
+ MFile *handle; /* Handle containing decoder data and state */
{
int c;
int result = 0; /* Initialization needed only to prevent
* gcc compiler warning. */
-
+
if (handle->state == GIF_DONE) {
- return(GIF_DONE);
+ return GIF_DONE;
}
do {
c = char64(*handle->data);
handle->data++;
- } while (c==GIF_SPACE);
+ } while (c == GIF_SPACE);
if (c>GIF_SPECIAL) {
handle->state = GIF_DONE;
- return(handle->state ? handle->c : GIF_DONE);
+ return handle->c;
}
switch (handle->state++) {
- case 0:
- handle->c = c<<2;
- result = Mgetc(handle);
- break;
- case 1:
- result = handle->c | (c>>4);
- handle->c = (c&0xF)<<4;
- break;
- case 2:
- result = handle->c | (c>>2);
- handle->c = (c&0x3) << 6;
- break;
- case 3:
- result = handle->c | c;
- handle->state = 0;
- break;
- }
- return(result);
+ case 0:
+ handle->c = c<<2;
+ result = Mgetc(handle);
+ break;
+ case 1:
+ result = handle->c | (c>>4);
+ handle->c = (c&0xF)<<4;
+ break;
+ case 2:
+ result = handle->c | (c>>2);
+ handle->c = (c&0x3) << 6;
+ break;
+ case 3:
+ result = handle->c | c;
+ handle->state = 0;
+ break;
+ }
+ return result;
}
/*
@@ -1202,33 +1252,37 @@ char64(c)
int c;
{
switch(c) {
- case 'A': return(0); case 'B': return(1); case 'C': return(2);
- case 'D': return(3); case 'E': return(4); case 'F': return(5);
- case 'G': return(6); case 'H': return(7); case 'I': return(8);
- case 'J': return(9); case 'K': return(10); case 'L': return(11);
- case 'M': return(12); case 'N': return(13); case 'O': return(14);
- case 'P': return(15); case 'Q': return(16); case 'R': return(17);
- case 'S': return(18); case 'T': return(19); case 'U': return(20);
- case 'V': return(21); case 'W': return(22); case 'X': return(23);
- case 'Y': return(24); case 'Z': return(25); case 'a': return(26);
- case 'b': return(27); case 'c': return(28); case 'd': return(29);
- case 'e': return(30); case 'f': return(31); case 'g': return(32);
- case 'h': return(33); case 'i': return(34); case 'j': return(35);
- case 'k': return(36); case 'l': return(37); case 'm': return(38);
- case 'n': return(39); case 'o': return(40); case 'p': return(41);
- case 'q': return(42); case 'r': return(43); case 's': return(44);
- case 't': return(45); case 'u': return(46); case 'v': return(47);
- case 'w': return(48); case 'x': return(49); case 'y': return(50);
- case 'z': return(51); case '0': return(52); case '1': return(53);
- case '2': return(54); case '3': return(55); case '4': return(56);
- case '5': return(57); case '6': return(58); case '7': return(59);
- case '8': return(60); case '9': return(61); case '+': return(62);
- case '/': return(63);
-
- case ' ': case '\t': case '\n': case '\r': case '\f': return(GIF_SPACE);
- case '=': return(GIF_PAD);
- case '\0': return(GIF_DONE);
- default: return(GIF_BAD);
+ case 'A': return 0; case 'B': return 1; case 'C': return 2;
+ case 'D': return 3; case 'E': return 4; case 'F': return 5;
+ case 'G': return 6; case 'H': return 7; case 'I': return 8;
+ case 'J': return 9; case 'K': return 10; case 'L': return 11;
+ case 'M': return 12; case 'N': return 13; case 'O': return 14;
+ case 'P': return 15; case 'Q': return 16; case 'R': return 17;
+ case 'S': return 18; case 'T': return 19; case 'U': return 20;
+ case 'V': return 21; case 'W': return 22; case 'X': return 23;
+ case 'Y': return 24; case 'Z': return 25; case 'a': return 26;
+ case 'b': return 27; case 'c': return 28; case 'd': return 29;
+ case 'e': return 30; case 'f': return 31; case 'g': return 32;
+ case 'h': return 33; case 'i': return 34; case 'j': return 35;
+ case 'k': return 36; case 'l': return 37; case 'm': return 38;
+ case 'n': return 39; case 'o': return 40; case 'p': return 41;
+ case 'q': return 42; case 'r': return 43; case 's': return 44;
+ case 't': return 45; case 'u': return 46; case 'v': return 47;
+ case 'w': return 48; case 'x': return 49; case 'y': return 50;
+ case 'z': return 51; case '0': return 52; case '1': return 53;
+ case '2': return 54; case '3': return 55; case '4': return 56;
+ case '5': return 57; case '6': return 58; case '7': return 59;
+ case '8': return 60; case '9': return 61; case '+': return 62;
+ case '/': return 63;
+
+ case ' ': case '\t': case '\n': case '\r': case '\f':
+ return GIF_SPACE;
+ case '=':
+ return GIF_PAD;
+ case '\0':
+ return GIF_DONE;
+ default:
+ return GIF_BAD;
}
}
@@ -1252,18 +1306,18 @@ Fread(dst, hunk, count, chan)
Tcl_Channel chan;
{
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
MFile *handle;
switch (tsdPtr->fromData) {
- case 1:
- return(Mread(dst, hunk, count, (MFile *) chan));
- case 2:
+ case 1:
+ return Mread(dst, hunk, count, (MFile *) chan);
+ case 2:
handle = (MFile *) chan;
memcpy((VOID *)dst, (VOID *) handle->data, (size_t) (hunk * count));
handle->data += hunk * count;
- return((int) (hunk * count));
- default:
+ return (int)(hunk * count);
+ default:
return Tcl_Read(chan, (char *) dst, (int) (hunk * count));
}
}
@@ -1272,13 +1326,13 @@ Fread(dst, hunk, count, chan)
/*
* ChanWriteGIF - writes a image in GIF format.
*-------------------------------------------------------------------------
- * Author: Lolo
- * Engeneering Projects Area
- * Department of Mining
- * University of Oviedo
+ * Author: Lolo
+ * Engeneering Projects Area
+ * Department of Mining
+ * University of Oviedo
* e-mail zz11425958@zeus.etsimo.uniovi.es
- * lolo@pcsig22.etsimo.uniovi.es
- * Date: Fri September 20 1996
+ * lolo@pcsig22.etsimo.uniovi.es
+ * Date: Fri September 20 1996
*
* Modified for transparency handling (gif89a) and miGIF compression
* by Jan Nijtmans <j.nijtmans@chello.nl>
@@ -1302,11 +1356,11 @@ Fread(dst, hunk, count, chan)
typedef int (* ifunptr) _ANSI_ARGS_((void));
-#define LSB(a) ((unsigned char) (((short)(a)) & 0x00FF))
-#define MSB(a) ((unsigned char) (((short)(a)) >> 8))
+#define LSB(a) ((unsigned char) (((short)(a)) & 0x00FF))
+#define MSB(a) ((unsigned char) (((short)(a)) >> 8))
#define GIFBITS 12
-#define HSIZE 5003 /* 80% occupancy */
+#define HSIZE 5003 /* 80% occupancy */
static int ssize;
static int csize;
@@ -1335,7 +1389,7 @@ static void savemap _ANSI_ARGS_((Tk_PhotoImageBlock *blockPtr,
static int ReadValue _ANSI_ARGS_((void));
static int
-FileWriteGIF (interp, filename, format, blockPtr)
+FileWriteGIF(interp, filename, format, blockPtr)
Tcl_Interp *interp; /* Interpreter to use for reporting errors. */
CONST char *filename;
Tcl_Obj *format;
@@ -1349,6 +1403,7 @@ FileWriteGIF (interp, filename, format, blockPtr)
return TCL_ERROR;
}
if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) {
+ Tcl_Close(NULL, chan);
return TCL_ERROR;
}
@@ -1377,9 +1432,9 @@ CommonWriteGIF(interp, handle, format, blockPtr)
top = 0;
left = 0;
- pixelSize=blockPtr->pixelSize;
- greenOffset=blockPtr->offset[1]-blockPtr->offset[0];
- blueOffset=blockPtr->offset[2]-blockPtr->offset[0];
+ pixelSize = blockPtr->pixelSize;
+ greenOffset = blockPtr->offset[1]-blockPtr->offset[0];
+ blueOffset = blockPtr->offset[2]-blockPtr->offset[0];
alphaOffset = blockPtr->offset[0];
if (alphaOffset < blockPtr->offset[2]) {
alphaOffset = blockPtr->offset[2];
@@ -1392,30 +1447,32 @@ CommonWriteGIF(interp, handle, format, blockPtr)
Tcl_Write(handle, (char *) (alphaOffset ? GIF89a : GIF87a), 6);
- for (x=0;x<MAXCOLORMAPSIZE;x++) {
+ for (x=0 ; x<MAXCOLORMAPSIZE ; x++) {
mapa[x][CM_RED] = 255;
mapa[x][CM_GREEN] = 255;
mapa[x][CM_BLUE] = 255;
}
- width=blockPtr->width;
- height=blockPtr->height;
- pixelo=blockPtr->pixelPtr + blockPtr->offset[0];
- pixelPitch=blockPtr->pitch;
+ width = blockPtr->width;
+ height = blockPtr->height;
+ pixelo = blockPtr->pixelPtr + blockPtr->offset[0];
+ pixelPitch = blockPtr->pitch;
savemap(blockPtr,mapa);
- if (num>=MAXCOLORMAPSIZE) {
+ if (num >= MAXCOLORMAPSIZE) {
Tcl_AppendResult(interp, "too many colors", (char *) NULL);
return TCL_ERROR;
}
- if (num<2) num=2;
- c=LSB(width);
+ if (num<2) {
+ num = 2;
+ }
+ c = LSB(width);
Mputc(c,handle);
- c=MSB(width);
+ c = MSB(width);
Mputc(c,handle);
- c=LSB(height);
+ c = LSB(height);
Mputc(c,handle);
- c=MSB(height);
+ c = MSB(height);
Mputc(c,handle);
resolution = 0;
@@ -1427,16 +1484,20 @@ CommonWriteGIF(interp, handle, format, blockPtr)
num = 1 << resolution;
- /* background color */
+ /*
+ * background color
+ */
c = 0;
Mputc(c,handle);
- /* zero for future expansion */
+ /*
+ * zero for future expansion.
+ */
Mputc(c,handle);
- for (x=0; x<num ;x++) {
+ for (x=0 ; x<num ; x++) {
c = mapa[x][CM_RED];
Mputc(c,handle);
c = mapa[x][CM_GREEN];
@@ -1457,28 +1518,28 @@ CommonWriteGIF(interp, handle, format, blockPtr)
c = GIF_START;
Mputc(c,handle);
- c=LSB(top);
+ c = LSB(top);
Mputc(c,handle);
- c=MSB(top);
+ c = MSB(top);
Mputc(c,handle);
- c=LSB(left);
+ c = LSB(left);
Mputc(c,handle);
- c=MSB(left);
+ c = MSB(left);
Mputc(c,handle);
- c=LSB(width);
+ c = LSB(width);
Mputc(c,handle);
- c=MSB(width);
+ c = MSB(width);
Mputc(c,handle);
- c=LSB(height);
+ c = LSB(height);
Mputc(c,handle);
- c=MSB(height);
+ c = MSB(height);
Mputc(c,handle);
- c=0;
+ c = 0;
Mputc(c,handle);
- c=resolution;
+ c = resolution;
Mputc(c,handle);
ssize = rsize = blockPtr->width;
@@ -1501,9 +1562,9 @@ color(red, green, blue, mapa)
unsigned char mapa[MAXCOLORMAPSIZE][3];
{
int x;
- for (x=(alphaOffset != 0);x<=MAXCOLORMAPSIZE;x++) {
- if ((mapa[x][CM_RED]==red) && (mapa[x][CM_GREEN]==green) &&
- (mapa[x][CM_BLUE]==blue)) {
+ for (x=(alphaOffset != 0) ; x<=MAXCOLORMAPSIZE ; x++) {
+ if ((mapa[x][CM_RED] == red) && (mapa[x][CM_GREEN] == green) &&
+ (mapa[x][CM_BLUE] == blue)) {
return x;
}
}
@@ -1516,10 +1577,10 @@ nuevo(red, green, blue, mapa)
int red,green,blue;
unsigned char mapa[MAXCOLORMAPSIZE][3];
{
- int x;
- for (x=(alphaOffset != 0);x<=num;x++) {
- if ((mapa[x][CM_RED]==red) && (mapa[x][CM_GREEN]==green) &&
- (mapa[x][CM_BLUE]==blue)) {
+ int x = (alphaOffset != 0);
+ for (; x<=num ; x++) {
+ if ((mapa[x][CM_RED] == red) && (mapa[x][CM_GREEN] == green) &&
+ (mapa[x][CM_BLUE] == blue)) {
return 0;
}
}
@@ -1531,9 +1592,9 @@ savemap(blockPtr,mapa)
Tk_PhotoImageBlock *blockPtr;
unsigned char mapa[MAXCOLORMAPSIZE][3];
{
- unsigned char *colores;
+ unsigned char *colores;
int x,y;
- unsigned char red,green,blue;
+ unsigned char red,green,blue;
if (alphaOffset) {
num = 0;
@@ -1544,22 +1605,22 @@ savemap(blockPtr,mapa)
num = -1;
}
- for(y=0;y<blockPtr->height;y++) {
- colores=blockPtr->pixelPtr + blockPtr->offset[0]
+ for(y=0 ; y<blockPtr->height ; y++) {
+ colores = blockPtr->pixelPtr + blockPtr->offset[0]
+ y * blockPtr->pitch;
- for(x=0;x<blockPtr->width;x++) {
+ for(x=0 ; x<blockPtr->width ; x++) {
if (!alphaOffset || (colores[alphaOffset] != 0)) {
red = colores[0];
green = colores[greenOffset];
blue = colores[blueOffset];
if (nuevo(red,green,blue,mapa)) {
num++;
- if (num>=MAXCOLORMAPSIZE) {
+ if (num >= MAXCOLORMAPSIZE) {
return;
}
- mapa[num][CM_RED]=red;
- mapa[num][CM_GREEN]=green;
- mapa[num][CM_BLUE]=blue;
+ mapa[num][CM_RED] = red;
+ mapa[num][CM_GREEN] = green;
+ mapa[num][CM_BLUE] = blue;
}
}
colores += pixelSize;
@@ -1576,10 +1637,10 @@ ReadValue()
if (csize == 0) {
return EOF;
}
- if (alphaOffset && (pixelo[alphaOffset]==0)) {
+ if (alphaOffset && (pixelo[alphaOffset] == 0)) {
col = 0;
} else {
- col = color(pixelo[0],pixelo[greenOffset],pixelo[blueOffset], mapa);
+ col = color(pixelo[0], pixelo[greenOffset], pixelo[blueOffset], mapa);
}
pixelo += pixelSize;
if (--ssize <= 0) {
@@ -1593,48 +1654,53 @@ ReadValue()
-/*-----------------------------------------------------------------------
+/*
+ *-----------------------------------------------------------------------
*
* miGIF Compression - mouse and ivo's GIF-compatible compression
*
- * -run length encoding compression routines-
+ * -run length encoding compression routines-
*
* Copyright (C) 1998 Hutchison Avenue Software Corporation
- * http://www.hasc.com
- * info@hasc.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." The Hutchison Avenue
- * Software Corporation disclaims all warranties, either express or implied,
- * including but not limited to implied warranties of merchantability and
- * fitness for a particular purpose, with respect to this code and accompanying
- * documentation.
+ * http://www.hasc.com
+ * info@hasc.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." The Hutchison Avenue Software Corporation
+ * disclaims all warranties, either express or implied, including but
+ * not limited to implied warranties of merchantability and fitness
+ * for a particular purpose, with respect to this code and
+ * accompanying documentation.
*
- * The miGIF compression routines do not, strictly speaking, generate files
- * conforming to the GIF spec, since the image data is not LZW-compressed
- * (this is the point: in order to avoid transgression of the Unisys patent
- * on the LZW algorithm.) However, miGIF generates data streams that any
- * reasonably sane LZW decompresser will decompress to what we want.
- *
- * miGIF compression uses run length encoding. It compresses horizontal runs
- * of pixels of the same color. This type of compression gives good results
- * on images with many runs, for example images with lines, text and solid
- * shapes on a solid-colored background. It gives little or no compression
- * on images with few runs, for example digital or scanned photos.
- *
- * der Mouse
- * mouse@rodents.montreal.qc.ca
- * 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
- *
- * ivo@hasc.com
+ * The miGIF compression routines do not, strictly speaking, generate
+ * files conforming to the GIF spec, since the image data is not
+ * LZW-compressed (this is the point: in order to avoid transgression
+ * of the Unisys patent on the LZW algorithm.) However, miGIF
+ * generates data streams that any reasonably sane LZW decompresser
+ * will decompress to what we want.
+ *
+ * miGIF compression uses run length encoding. It compresses
+ * horizontal runs of pixels of the same color. This type of
+ * compression gives good results on images with many runs, for
+ * example images with lines, text and solid shapes on a solid-colored
+ * background. It gives little or no compression on images with few
+ * runs, for example digital or scanned photos.
+ *
+ * der Mouse
+ * mouse@rodents.montreal.qc.ca
+ * 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
+ *
+ * ivo@hasc.com
*
* The Graphics Interchange Format(c) is the Copyright property of
* CompuServe Incorporated. GIF(sm) is a Service Mark property of
* CompuServe Incorporated.
*
+ *-----------------------------------------------------------------------
*/
static int rl_pixel;
@@ -1659,145 +1725,172 @@ static Tcl_Channel ofile;
static unsigned char oblock[256];
static int oblen;
-/* Used only when debugging GIF compression code */
-/* #define DEBUGGING_ENVARS */
+/*
+ * Used only when debugging GIF compression code
+ */
+/* #define MIGIF_DEBUGGING_ENVARS */
-#ifdef DEBUGGING_ENVARS
+#ifdef MIGIF_DEBUGGING_ENVARS
static int verbose_set = 0;
static int verbose;
-#define VERBOSE (verbose_set?verbose:set_verbose())
+#define MIGIF_VERBOSE (verbose_set?verbose:set_verbose())
+#define DEBUGMSG(printf_args) if (MIGIF_VERBOSE) { printf printf_args; }
-static int set_verbose(void)
+static int
+set_verbose(void)
{
- verbose = !!getenv("GIF_VERBOSE");
- verbose_set = 1;
- return(verbose);
+ verbose = !!getenv("MIGIF_VERBOSE");
+ verbose_set = 1;
+ return verbose;
}
-#else
-
-#define VERBOSE 0
-
-#endif
-
-
static CONST char *
binformat(v, nbits)
unsigned int v;
int nbits;
{
- static char bufs[8][64];
- static int bhand = 0;
- unsigned int bit;
- int bno;
- char *bp;
-
- bhand --;
- if (bhand < 0) bhand = (sizeof(bufs)/sizeof(bufs[0]))-1;
- bp = &bufs[bhand][0];
- for (bno=nbits-1,bit=((unsigned int)1)<<bno;bno>=0;bno--,bit>>=1)
- { *bp++ = (v & bit) ? '1' : '0';
- if (((bno&3) == 0) && (bno != 0)) *bp++ = '.';
- }
- *bp = '\0';
- return(&bufs[bhand][0]);
+ static char bufs[8][64];
+ static int bhand = 0;
+ unsigned int bit;
+ int bno;
+ char *bp;
+
+ bhand--;
+ if (bhand < 0) {
+ bhand = (sizeof(bufs) / sizeof(bufs[0])) - 1;
+ }
+ bp = &bufs[bhand][0];
+ for (bno=nbits-1,bit=((unsigned int)1)<<bno ; bno>=0 ; bno--,bit>>=1) {
+ *bp++ = (v & bit) ? '1' : '0';
+ if (((bno&3) == 0) && (bno != 0)) {
+ *bp++ = '.';
+ }
+ }
+ *bp = '\0';
+ return &bufs[bhand][0];
}
-static void write_block()
+#else
+
+#define MIGIF_VERBOSE 0
+#define DEBUGMSG(printf_args) /* do nothing */
+
+#endif
+
+static void
+write_block()
{
- int i;
- unsigned char c;
-
- if (VERBOSE)
- { printf("write_block %d:",oblen);
- for (i=0;i<oblen;i++) printf(" %02x",oblock[i]);
- printf("\n");
- }
- c = oblen;
- Tcl_Write(ofile, (char *) &c, 1);
- Tcl_Write(ofile, (char *) &oblock[0], oblen);
- oblen = 0;
+ int i;
+ unsigned char c;
+
+ if (MIGIF_VERBOSE) {
+ printf("write_block %d:", oblen);
+ for (i=0 ; i<oblen ; i++) {
+ printf(" %02x", oblock[i]);
+ }
+ printf("\n");
+ }
+ c = oblen;
+ Tcl_Write(ofile, (char *) &c, 1);
+ Tcl_Write(ofile, (char *) &oblock[0], oblen);
+ oblen = 0;
}
static void
block_out(c)
unsigned char c;
{
- if (VERBOSE) printf("block_out %s\n",binformat(c,8));
- oblock[oblen++] = c;
- if (oblen >= 255) write_block();
+ DEBUGMSG(("block_out %s\n", binformat(c, 8)));
+ oblock[oblen++] = c;
+ if (oblen >= 255) {
+ write_block();
+ }
}
-static void block_flush()
+static void
+block_flush()
{
- if (VERBOSE) printf("block_flush\n");
- if (oblen > 0) write_block();
+ DEBUGMSG(("block_flush\n"));
+ if (oblen > 0) {
+ write_block();
+ }
}
-static void output(val)
+static void
+output(val)
int val;
{
- if (VERBOSE) printf("output %s [%s %d %d]\n",binformat(val,out_bits),binformat(obuf,obits),obits,out_bits);
- obuf |= val << obits;
- obits += out_bits;
- while (obits >= 8)
- { block_out(obuf&0xff);
- obuf >>= 8;
- obits -= 8;
- }
- if (VERBOSE) printf("output leaving [%s %d]\n",binformat(obuf,obits),obits);
+ DEBUGMSG(("output %s [%s %d %d]\n", binformat(val, out_bits),
+ binformat(obuf, obits), obits, out_bits));
+ obuf |= val << obits;
+ obits += out_bits;
+ while (obits >= 8) {
+ block_out(obuf&0xff);
+ obuf >>= 8;
+ obits -= 8;
+ }
+ DEBUGMSG(("output leaving [%s %d]\n", binformat(obuf, obits), obits));
}
-static void output_flush()
+static void
+output_flush()
{
- if (VERBOSE) printf("output_flush\n");
- if (obits > 0) block_out(obuf);
- block_flush();
+ DEBUGMSG(("output_flush\n"));
+ if (obits > 0) {
+ block_out(obuf);
+ }
+ block_flush();
}
-static void did_clear()
+static void
+did_clear()
{
- if (VERBOSE) printf("did_clear\n");
- out_bits = out_bits_init;
- out_bump = out_bump_init;
- out_clear = out_clear_init;
- out_count = 0;
- rl_table_max = 0;
- just_cleared = 1;
+ DEBUGMSG(("did_clear\n"));
+ out_bits = out_bits_init;
+ out_bump = out_bump_init;
+ out_clear = out_clear_init;
+ out_count = 0;
+ rl_table_max = 0;
+ just_cleared = 1;
}
static void
output_plain(c)
int c;
{
- if (VERBOSE) printf("output_plain %s\n",binformat(c,out_bits));
- just_cleared = 0;
- output(c);
- out_count ++;
- if (out_count >= out_bump)
- { out_bits ++;
- out_bump += 1 << (out_bits - 1);
- }
- if (out_count >= out_clear)
- { output(code_clear);
- did_clear();
- }
+ DEBUGMSG(("output_plain %s\n", binformat(c, out_bits)));
+ just_cleared = 0;
+ output(c);
+ out_count++;
+ if (out_count >= out_bump) {
+ out_bits++;
+ out_bump += 1 << (out_bits - 1);
+ }
+ if (out_count >= out_clear) {
+ output(code_clear);
+ did_clear();
+ }
}
-static unsigned int isqrt(x)
+static unsigned int
+isqrt(x)
unsigned int x;
{
- unsigned int r;
- unsigned int v;
-
- if (x < 2) return(x);
- for (v=x,r=1;v;v>>=2,r<<=1) ;
- while (1)
- { v = ((x / r) + r) / 2;
- if ((v == r) || (v == r+1)) return(r);
- r = v;
- }
+ unsigned int r;
+ unsigned int v;
+
+ if (x < 2) {
+ return x;
+ }
+ for (v=x,r=1 ; v ; v>>=2,r<<=1);
+ while (1) {
+ v = ((x / r) + r) / 2;
+ if (v==r || v==r+1) {
+ return r;
+ }
+ r = v;
+ }
}
static unsigned int
@@ -1805,207 +1898,224 @@ compute_triangle_count(count, nrepcodes)
unsigned int count;
unsigned int nrepcodes;
{
- unsigned int perrep;
- unsigned int cost;
-
- cost = 0;
- perrep = (nrepcodes * (nrepcodes+1)) / 2;
- while (count >= perrep)
- { cost += nrepcodes;
- count -= perrep;
- }
- if (count > 0)
- { unsigned int n;
- n = isqrt(count);
- while ((n*(n+1)) >= 2*count) n --;
- while ((n*(n+1)) < 2*count) n ++;
- cost += n;
- }
- return(cost);
+ unsigned int perrep;
+ unsigned int cost;
+
+ cost = 0;
+ perrep = (nrepcodes * (nrepcodes+1)) / 2;
+ while (count >= perrep) {
+ cost += nrepcodes;
+ count -= perrep;
+ }
+ if (count > 0) {
+ unsigned int n;
+ n = isqrt(count);
+ while (n*(n+1) >= 2*count) {
+ n--;
+ }
+ while (n*(n+1) < 2*count) {
+ n++;
+ }
+ cost += n;
+ }
+ return cost;
}
-static void max_out_clear()
+static void
+max_out_clear()
{
- out_clear = max_ocodes;
+ out_clear = max_ocodes;
}
-static void reset_out_clear()
+static void
+reset_out_clear()
{
- out_clear = out_clear_init;
- if (out_count >= out_clear)
- { output(code_clear);
- did_clear();
- }
+ out_clear = out_clear_init;
+ if (out_count >= out_clear) {
+ output(code_clear);
+ did_clear();
+ }
}
static void
rl_flush_fromclear(count)
int count;
{
- int n;
-
- if (VERBOSE) printf("rl_flush_fromclear %d\n",count);
- max_out_clear();
- rl_table_pixel = rl_pixel;
- n = 1;
- while (count > 0)
- { if (n == 1)
- { rl_table_max = 1;
- output_plain(rl_pixel);
- count --;
- }
- else if (count >= n)
- { rl_table_max = n;
- output_plain(rl_basecode+n-2);
- count -= n;
- }
- else if (count == 1)
- { rl_table_max ++;
- output_plain(rl_pixel);
- count = 0;
- }
- else
- { rl_table_max ++;
- output_plain(rl_basecode+count-2);
- count = 0;
- }
- if (out_count == 0) n = 1; else n ++;
- }
- reset_out_clear();
- if (VERBOSE) printf("rl_flush_fromclear leaving table_max=%d\n",rl_table_max);
+ int n;
+
+ DEBUGMSG(("rl_flush_fromclear %d\n", count));
+ max_out_clear();
+ rl_table_pixel = rl_pixel;
+ n = 1;
+ while (count > 0) {
+ if (n == 1) {
+ rl_table_max = 1;
+ output_plain(rl_pixel);
+ count--;
+ } else if (count >= n) {
+ rl_table_max = n;
+ output_plain(rl_basecode+n-2);
+ count -= n;
+ } else if (count == 1) {
+ rl_table_max++;
+ output_plain(rl_pixel);
+ count = 0;
+ } else {
+ rl_table_max++;
+ output_plain(rl_basecode+count-2);
+ count = 0;
+ }
+ if (out_count == 0) {
+ n = 1;
+ } else {
+ n++;
+ }
+ }
+ reset_out_clear();
+ DEBUGMSG(("rl_flush_fromclear leaving table_max=%d\n", rl_table_max));
}
-static void rl_flush_clearorrep(count)
+static void
+rl_flush_clearorrep(count)
int count;
{
- int withclr;
-
- if (VERBOSE) printf("rl_flush_clearorrep %d\n",count);
- withclr = 1 + compute_triangle_count(count,max_ocodes);
- if (withclr < count)
- { output(code_clear);
- did_clear();
- rl_flush_fromclear(count);
- }
- else
- { for (;count>0;count--) output_plain(rl_pixel);
- }
+ int withclr;
+
+ DEBUGMSG(("rl_flush_clearorrep %d\n", count));
+ withclr = 1 + compute_triangle_count(count, max_ocodes);
+ if (withclr < count) {
+ output(code_clear);
+ did_clear();
+ rl_flush_fromclear(count);
+ } else {
+ for (; count>0 ; count--) {
+ output_plain(rl_pixel);
+ }
+ }
}
-static void rl_flush_withtable(count)
+static void
+rl_flush_withtable(count)
int count;
{
- int repmax;
- int repleft;
- int leftover;
-
- if (VERBOSE) printf("rl_flush_withtable %d\n",count);
- repmax = count / rl_table_max;
- leftover = count % rl_table_max;
- repleft = (leftover ? 1 : 0);
- if (out_count+repmax+repleft > max_ocodes)
- { repmax = max_ocodes - out_count;
- leftover = count - (repmax * rl_table_max);
- repleft = 1 + compute_triangle_count(leftover,max_ocodes);
- }
- if (VERBOSE) printf("rl_flush_withtable repmax=%d leftover=%d repleft=%d\n",repmax,leftover,repleft);
- if (1+(int)compute_triangle_count(count,max_ocodes) < repmax+repleft)
- { output(code_clear);
- did_clear();
- rl_flush_fromclear(count);
- return;
- }
- max_out_clear();
- for (;repmax>0;repmax--) output_plain(rl_basecode+rl_table_max-2);
- if (leftover)
- { if (just_cleared)
- { rl_flush_fromclear(leftover);
- }
- else if (leftover == 1)
- { output_plain(rl_pixel);
- }
- else
- { output_plain(rl_basecode+leftover-2);
- }
- }
- reset_out_clear();
+ int repmax;
+ int repleft;
+ int leftover;
+
+ DEBUGMSG(("rl_flush_withtable %d\n", count));
+ repmax = count / rl_table_max;
+ leftover = count % rl_table_max;
+ repleft = (leftover ? 1 : 0);
+ if (out_count+repmax+repleft > max_ocodes) {
+ repmax = max_ocodes - out_count;
+ leftover = count - (repmax * rl_table_max);
+ repleft = 1 + compute_triangle_count(leftover, max_ocodes);
+ }
+ DEBUGMSG(("rl_flush_withtable repmax=%d leftover=%d repleft=%d\n",
+ repmax, leftover, repleft));
+ if (1+(int)compute_triangle_count(count, max_ocodes) < repmax+repleft) {
+ output(code_clear);
+ did_clear();
+ rl_flush_fromclear(count);
+ return;
+ }
+ max_out_clear();
+ for (; repmax>0 ; repmax--) {
+ output_plain(rl_basecode + rl_table_max - 2);
+ }
+ if (leftover) {
+ if (just_cleared) {
+ rl_flush_fromclear(leftover);
+ } else if (leftover == 1) {
+ output_plain(rl_pixel);
+ } else {
+ output_plain(rl_basecode + leftover - 2);
+ }
+ }
+ reset_out_clear();
}
-static void rl_flush()
+static void
+rl_flush()
{
- if (VERBOSE) printf("rl_flush [ %d %d\n",rl_count,rl_pixel);
- if (rl_count == 1)
- { output_plain(rl_pixel);
+ DEBUGMSG(("rl_flush [ %d %d\n", rl_count, rl_pixel));
+ if (rl_count == 1) {
+ output_plain(rl_pixel);
+ rl_count = 0;
+ DEBUGMSG(("rl_flush ]\n"));
+ return;
+ }
+ if (just_cleared) {
+ rl_flush_fromclear(rl_count);
+ } else if ((rl_table_max < 2) || (rl_table_pixel != rl_pixel)) {
+ rl_flush_clearorrep(rl_count);
+ } else {
+ rl_flush_withtable(rl_count);
+ }
+ DEBUGMSG(("rl_flush ]\n"));
rl_count = 0;
- if (VERBOSE) printf("rl_flush ]\n");
- return;
- }
- if (just_cleared)
- { rl_flush_fromclear(rl_count);
- }
- else if ((rl_table_max < 2) || (rl_table_pixel != rl_pixel))
- { rl_flush_clearorrep(rl_count);
- }
- else
- { rl_flush_withtable(rl_count);
- }
- if (VERBOSE) printf("rl_flush ]\n");
- rl_count = 0;
}
-static void compress( init_bits, handle, readValue )
+static void
+compress(init_bits, handle, readValue)
int init_bits;
Tcl_Channel handle;
ifunptr readValue;
{
- int c;
-
- ofile = handle;
- obuf = 0;
- obits = 0;
- oblen = 0;
- code_clear = 1 << (init_bits - 1);
- code_eof = code_clear + 1;
- rl_basecode = code_eof + 1;
- out_bump_init = (1 << (init_bits - 1)) - 1;
- /* for images with a lot of runs, making out_clear_init larger will
- give better compression. */
- out_clear_init = (init_bits <= 3) ? 9 : (out_bump_init-1);
-#ifdef DEBUGGING_ENVARS
- { const char *ocienv;
- ocienv = getenv("GIF_OUT_CLEAR_INIT");
- if (ocienv)
- { out_clear_init = atoi(ocienv);
- if (VERBOSE) printf("[overriding out_clear_init to %d]\n",out_clear_init);
- }
- }
+ int c;
+
+ ofile = handle;
+ obuf = 0;
+ obits = 0;
+ oblen = 0;
+ code_clear = 1 << (init_bits - 1);
+ code_eof = code_clear + 1;
+ rl_basecode = code_eof + 1;
+ out_bump_init = (1 << (init_bits - 1)) - 1;
+ /*
+ * For images with a lot of runs, making out_clear_init larger
+ * will give better compression.
+ */
+ out_clear_init = (init_bits <= 3) ? 9 : (out_bump_init-1);
+#ifdef MIGIF_DEBUGGING_ENVARS
+ {
+ const char *ocienv;
+ ocienv = getenv("MIGIF_OUT_CLEAR_INIT");
+ if (ocienv) {
+ out_clear_init = atoi(ocienv);
+ DEBUGMSG(("[overriding out_clear_init to %d]\n", out_clear_init));
+ }
+ }
#endif
- out_bits_init = init_bits;
- max_ocodes = (1 << GIFBITS) - ((1 << (out_bits_init - 1)) + 3);
- did_clear();
- output(code_clear);
- rl_count = 0;
- while (1)
- { c = readValue();
- if ((rl_count > 0) && (c != rl_pixel)) rl_flush();
- if (c == EOF) break;
- if (rl_pixel == c)
- { rl_count ++;
- }
- else
- { rl_pixel = c;
- rl_count = 1;
- }
- }
- output(code_eof);
- output_flush();
+ out_bits_init = init_bits;
+ max_ocodes = (1 << GIFBITS) - ((1 << (out_bits_init - 1)) + 3);
+ did_clear();
+ output(code_clear);
+ rl_count = 0;
+ while (1) {
+ c = readValue();
+ if ((rl_count > 0) && (c != rl_pixel)) {
+ rl_flush();
+ }
+ if (c == EOF) {
+ break;
+ }
+ if (rl_pixel == c) {
+ rl_count++;
+ } else {
+ rl_pixel = c;
+ rl_count = 1;
+ }
+ }
+ output(code_eof);
+ output_flush();
}
-/*-----------------------------------------------------------------------
+/*
+ *-----------------------------------------------------------------------
*
* End of miGIF section - See copyright notice at start of section.
*
- *-----------------------------------------------------------------------*/
-
-
+ *-----------------------------------------------------------------------
+ */
diff --git a/tk/generic/tkImgPPM.c b/tk/generic/tkImgPPM.c
index 8e5d17aee2b..c509648cb1c 100644
--- a/tk/generic/tkImgPPM.c
+++ b/tk/generic/tkImgPPM.c
@@ -192,7 +192,7 @@ FileReadPPM(interp, chan, fileName, formatString, imageHandle, destX, destY,
Tk_PhotoExpand(imageHandle, destX + width, destY + height);
if (srcY > 0) {
- Tcl_Seek(chan, (srcY * block.pitch), SEEK_CUR);
+ Tcl_Seek(chan, (Tcl_WideInt)(srcY * block.pitch), SEEK_CUR);
}
nLines = (MAX_MEMORY + block.pitch - 1) / block.pitch;
@@ -228,7 +228,8 @@ FileReadPPM(interp, chan, fileName, formatString, imageHandle, destX, destY,
}
}
block.height = nLines;
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, nLines);
+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, nLines,
+ TK_PHOTO_COMPOSITE_SET);
destY += nLines;
}
@@ -274,10 +275,12 @@ FileWritePPM(interp, fileName, formatString, blockPtr)
if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
!= TCL_OK) {
+ Tcl_Close(NULL, chan);
return TCL_ERROR;
}
if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
!= TCL_OK) {
+ Tcl_Close(NULL, chan);
return TCL_ERROR;
}
@@ -427,4 +430,3 @@ ReadPPMFileHeader(chan, widthPtr, heightPtr, maxIntensityPtr)
}
return type;
}
-
diff --git a/tk/generic/tkImgPhoto.c b/tk/generic/tkImgPhoto.c
index 7416771041b..d2b0cb02711 100644
--- a/tk/generic/tkImgPhoto.c
+++ b/tk/generic/tkImgPhoto.c
@@ -7,6 +7,7 @@
*
* Copyright (c) 1994 The Australian National University.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 2002 Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -231,6 +232,7 @@ struct SubcommandOptions {
int subsampleX, subsampleY; /* Values specified for -subsample option. */
Tcl_Obj *format; /* Value specified for -format option. */
XColor *background; /* Value specified for -background option. */
+ int compositingRule; /* Value specified for -compositingrule opt */
};
/*
@@ -241,6 +243,7 @@ struct SubcommandOptions {
* field of the SubcommandOptions structure if that option was specified.
*
* OPT_BACKGROUND: Set if -format option allowed/specified.
+ * OPT_COMPOSITE: Set if -compositingrule option allowed/spec'd.
* OPT_FORMAT: Set if -format option allowed/specified.
* OPT_FROM: Set if -from option allowed/specified.
* OPT_GRAYSCALE: Set if -grayscale option allowed/specified.
@@ -251,13 +254,14 @@ struct SubcommandOptions {
*/
#define OPT_BACKGROUND 1
-#define OPT_FORMAT 2
-#define OPT_FROM 4
-#define OPT_GRAYSCALE 8
-#define OPT_SHRINK 0x10
-#define OPT_SUBSAMPLE 0x20
-#define OPT_TO 0x40
-#define OPT_ZOOM 0x80
+#define OPT_COMPOSITE 2
+#define OPT_FORMAT 4
+#define OPT_FROM 8
+#define OPT_GRAYSCALE 0x10
+#define OPT_SHRINK 0x20
+#define OPT_SUBSAMPLE 0x40
+#define OPT_TO 0x80
+#define OPT_ZOOM 0x100
/*
* List of option names. The order here must match the order of
@@ -266,6 +270,7 @@ struct SubcommandOptions {
static char *optionNames[] = {
"-background",
+ "-compositingrule",
"-format",
"-from",
"-grayscale",
@@ -277,7 +282,14 @@ static char *optionNames[] = {
};
/*
- * The type record for photo images:
+ * Message to generate when an attempt to resize an image fails due
+ * to memory problems.
+ */
+#define TK_PHOTO_ALLOC_FAILURE_MESSAGE \
+ "not enough free memory for image buffer"
+
+/*
+ * Functions used in the type record for photo images.
*/
static int ImgPhotoCreate _ANSI_ARGS_((Tcl_Interp *interp,
@@ -298,6 +310,10 @@ static int ImgPhotoPostscript _ANSI_ARGS_((ClientData clientData,
Tk_PostscriptInfo psInfo, int x, int y, int width,
int height, int prepass));
+/*
+ * The type record itself for photo images:
+ */
+
Tk_ImageType tkPhotoImageType = {
"photo", /* name */
ImgPhotoCreate, /* createProc */
@@ -314,6 +330,7 @@ typedef struct ThreadSpecificData {
* list of known photo image formats.*/
Tk_PhotoImageFormat *oldFormatList; /* Pointer to the first in the
* list of known photo image formats.*/
+ int initialized; /* set to 1 if we've initialized the strucuture */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -357,6 +374,8 @@ static int imgPhotoColorHashInitialized;
* Forward declarations
*/
+static void PhotoFormatThreadExitProc _ANSI_ARGS_((
+ ClientData clientData));
static int ImgPhotoCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
static int ParseSubcommandOptions _ANSI_ARGS_((
@@ -370,7 +389,7 @@ static int ImgPhotoConfigureMaster _ANSI_ARGS_((
int objc, Tcl_Obj *CONST objv[], int flags));
static void ImgPhotoConfigureInstance _ANSI_ARGS_((
PhotoInstance *instancePtr));
-static void ImgPhotoSetSize _ANSI_ARGS_((PhotoMaster *masterPtr,
+static int ImgPhotoSetSize _ANSI_ARGS_((PhotoMaster *masterPtr,
int width, int height));
static void ImgPhotoInstanceSetSize _ANSI_ARGS_((
PhotoInstance *instancePtr));
@@ -381,7 +400,7 @@ static char * ImgGetPhoto _ANSI_ARGS_((PhotoMaster *masterPtr,
Tk_PhotoImageBlock *blockPtr,
struct SubcommandOptions *optPtr));
static int IsValidPalette _ANSI_ARGS_((PhotoInstance *instancePtr,
- char *palette));
+ CONST char *palette));
static int CountBits _ANSI_ARGS_((pixel mask));
static void GetColorTable _ANSI_ARGS_((PhotoInstance *instancePtr));
static void FreeColorTable _ANSI_ARGS_((ColorTable *colorPtr,
@@ -430,6 +449,48 @@ static void PhotoOptionCleanupProc _ANSI_ARGS_((
*
*----------------------------------------------------------------------
*/
+
+static void
+PhotoFormatThreadExitProc(clientData)
+ ClientData clientData; /* not used */
+{
+ Tk_PhotoImageFormat *freePtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ while (tsdPtr->oldFormatList != NULL) {
+ freePtr = tsdPtr->oldFormatList;
+ tsdPtr->oldFormatList = tsdPtr->oldFormatList->nextPtr;
+ ckfree((char *) freePtr->name);
+ ckfree((char *) freePtr);
+ }
+ while (tsdPtr->formatList != NULL) {
+ freePtr = tsdPtr->formatList;
+ tsdPtr->formatList = tsdPtr->formatList->nextPtr;
+ ckfree((char *) freePtr->name);
+ ckfree((char *) freePtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_CreateOldPhotoImageFormat, Tk_CreatePhotoImageFormat --
+ *
+ * This procedure is invoked by an image file handler to register
+ * a new photo image format and the procedures that handle the
+ * new format. The procedure is typically invoked during
+ * Tcl_AppInit.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The new image file format is entered into a table used in the
+ * photo image "read" and "write" subcommands.
+ *
+ *----------------------------------------------------------------------
+ */
void
Tk_CreateOldPhotoImageFormat(formatPtr)
Tk_PhotoImageFormat *formatPtr;
@@ -442,6 +503,10 @@ Tk_CreateOldPhotoImageFormat(formatPtr)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ if (!tsdPtr->initialized) {
+ tsdPtr->initialized = 1;
+ Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL);
+ }
copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
copyPtr->name = (char *) ckalloc((unsigned) (strlen(formatPtr->name) + 1));
@@ -462,6 +527,10 @@ Tk_CreatePhotoImageFormat(formatPtr)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ if (!tsdPtr->initialized) {
+ tsdPtr->initialized = 1;
+ Tcl_CreateThreadExitHandler(PhotoFormatThreadExitProc, NULL);
+ }
copyPtr = (Tk_PhotoImageFormat *) ckalloc(sizeof(Tk_PhotoImageFormat));
*copyPtr = *formatPtr;
copyPtr->name = (char *) ckalloc((unsigned) (strlen(formatPtr->name) + 1));
@@ -563,13 +632,14 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
int oldformat = 0;
- static char *photoOptions[] = {
+ static CONST char *photoOptions[] = {
"blank", "cget", "configure", "copy", "data", "get", "put",
- "read", "redither", "write", (char *) NULL
+ "read", "redither", "transparency", "write", (char *) NULL
};
enum options {
PHOTO_BLANK, PHOTO_CGET, PHOTO_CONFIGURE, PHOTO_COPY, PHOTO_DATA,
- PHOTO_GET, PHOTO_PUT, PHOTO_READ, PHOTO_REDITHER, PHOTO_WRITE
+ PHOTO_GET, PHOTO_PUT, PHOTO_READ, PHOTO_REDITHER, PHOTO_TRANS,
+ PHOTO_WRITE
};
PhotoMaster *masterPtr = (PhotoMaster *) clientData;
@@ -578,8 +648,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
int dataWidth, dataHeight;
struct SubcommandOptions options;
int listArgc;
- char **listArgv;
- char **srcArgv;
+ CONST char **listArgv;
+ CONST char **srcArgv;
unsigned char *pixelPtr;
Tk_PhotoImageBlock block;
Tk_Window tkwin;
@@ -607,8 +677,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
return proc(clientData, interp, objc, objv);
}
+
switch ((enum options) index) {
- case PHOTO_BLANK: {
+ case PHOTO_BLANK:
/*
* photo blank command - just call Tk_PhotoBlank.
*/
@@ -620,9 +691,10 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
break;
- }
- case PHOTO_CGET: {
+
+ case PHOTO_CGET: {
char *arg;
+
if (objc != 3) {
Tcl_WrongNumArgs(interp, 2, objv, "option");
return TCL_ERROR;
@@ -643,12 +715,12 @@ ImgPhotoCmd(clientData, interp, objc, objv)
Tk_ConfigureValue(interp, Tk_MainWindow(interp), configSpecs,
(char *) masterPtr, Tcl_GetString(objv[2]), 0);
break;
- }
- case PHOTO_CONFIGURE: {
+ }
+
+ case PHOTO_CONFIGURE:
/*
* photo configure command - handle this in the standard way.
*/
- char *opt, *arg;
if (objc == 2) {
Tcl_Obj *obj, *subobj;
@@ -677,39 +749,38 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_OK;
}
if (objc == 3) {
- char *arg = Tcl_GetStringFromObj(objv[2], (int *) &length);
- if (!strncmp(arg, "-data", length)) {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- "-data {} {} {}", (char *) NULL);
- if (masterPtr->dataString) {
- Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
- masterPtr->dataString);
- } else {
+ char *arg = Tcl_GetStringFromObj(objv[2], (int *) &length);
+ if (!strncmp(arg, "-data", length)) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- " {}", (char *) NULL);
- }
- return TCL_OK;
- } else if (!strncmp(arg, "-format", length)) {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- "-format {} {} {}", (char *) NULL);
- if (masterPtr->format) {
- Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
- masterPtr->format);
- } else {
+ "-data {} {} {}", (char *) NULL);
+ if (masterPtr->dataString) {
+ Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
+ masterPtr->dataString);
+ } else {
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ " {}", (char *) NULL);
+ }
+ return TCL_OK;
+ } else if (!strncmp(arg, "-format", length)) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- " {}", (char *) NULL);
+ "-format {} {} {}", (char *) NULL);
+ if (masterPtr->format) {
+ Tcl_ListObjAppendElement(interp, Tcl_GetObjResult(interp),
+ masterPtr->format);
+ } else {
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ " {}", (char *) NULL);
+ }
+ return TCL_OK;
+ } else {
+ return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
+ configSpecs, (char *) masterPtr, arg, 0);
}
- return TCL_OK;
- } else {
- return Tk_ConfigureInfo(interp, Tk_MainWindow(interp),
- configSpecs, (char *) masterPtr, arg, 0);
- }
}
return ImgPhotoConfigureMaster(interp, masterPtr, objc-2, objv+2,
TK_CONFIG_ARGV_ONLY);
- break;
- }
- case PHOTO_COPY: {
+
+ case PHOTO_COPY:
/*
* photo copy command - first parse options.
*/
@@ -719,14 +790,15 @@ ImgPhotoCmd(clientData, interp, objc, objv)
options.zoomX = options.zoomY = 1;
options.subsampleX = options.subsampleY = 1;
options.name = NULL;
+ options.compositingRule = TK_PHOTO_COMPOSITE_OVERLAY;
if (ParseSubcommandOptions(&options, interp,
- OPT_FROM | OPT_TO | OPT_ZOOM | OPT_SUBSAMPLE | OPT_SHRINK,
- &index, objc, objv) != TCL_OK) {
+ OPT_FROM | OPT_TO | OPT_ZOOM | OPT_SUBSAMPLE | OPT_SHRINK |
+ OPT_COMPOSITE, &index, objc, objv) != TCL_OK) {
return TCL_ERROR;
}
if (options.name == NULL || index < objc) {
Tcl_WrongNumArgs(interp, 2, objv,
- "source-image ?-from x1 y1 x2 y2? ?-to x1 y1 x2 y2? ?-zoom x y? ?-subsample x y?");
+ "source-image ?-compositingrule rule? ?-from x1 y1 x2 y2? ?-to x1 y1 x2 y2? ?-zoom x y? ?-subsample x y?");
return TCL_ERROR;
}
@@ -735,7 +807,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
* Check the values given for the -from option.
*/
- if ((srcHandle = Tk_FindPhoto(interp, Tcl_GetString(options.name))) == NULL) {
+ srcHandle = Tk_FindPhoto(interp, Tcl_GetString(options.name));
+ if (srcHandle == NULL) {
Tcl_AppendResult(interp, "image \"",
Tcl_GetString(options.name), "\" doesn't",
" exist or is not a photo image", (char *) NULL);
@@ -754,11 +827,11 @@ ImgPhotoCmd(clientData, interp, objc, objv)
* Fill in default values for unspecified parameters.
*/
- if (((options.options & OPT_FROM) == 0) || (options.fromX2 < 0)) {
+ if (!(options.options & OPT_FROM) || (options.fromX2 < 0)) {
options.fromX2 = block.width;
options.fromY2 = block.height;
}
- if (((options.options & OPT_TO) == 0) || (options.toX2 < 0)) {
+ if (!(options.options & OPT_TO) || (options.toX2 < 0)) {
width = options.fromX2 - options.fromX;
if (options.subsampleX > 0) {
width = (width + options.subsampleX - 1) / options.subsampleX;
@@ -787,7 +860,13 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*/
if (options.options & OPT_SHRINK) {
- ImgPhotoSetSize(masterPtr, options.toX2, options.toY2);
+ if (ImgPhotoSetSize(masterPtr, options.toX2,
+ options.toY2) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ return TCL_ERROR;
+ }
}
/*
@@ -795,17 +874,18 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*/
block.pixelPtr += options.fromX * block.pixelSize
- + options.fromY * block.pitch;
+ + options.fromY * block.pitch;
block.width = options.fromX2 - options.fromX;
block.height = options.fromY2 - options.fromY;
Tk_PhotoPutZoomedBlock((Tk_PhotoHandle) masterPtr, &block,
options.toX, options.toY, options.toX2 - options.toX,
options.toY2 - options.toY, options.zoomX, options.zoomY,
- options.subsampleX, options.subsampleY);
+ options.subsampleX, options.subsampleY,
+ options.compositingRule);
break;
- }
- case PHOTO_DATA: {
+
+ case PHOTO_DATA: {
char *data;
/*
@@ -878,7 +958,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
data = ImgGetPhoto(masterPtr, &block, &options);
- result = ((int (*) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *formatString,
+ result = ((int (*) _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *formatString,
Tk_PhotoImageBlock *blockPtr, VOID *dummy))) stringWriteProc)
(interp, options.format, &block, (VOID *) NULL);
if (options.background) {
@@ -889,8 +969,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
return result;
break;
- }
- case PHOTO_GET: {
+ }
+
+ case PHOTO_GET: {
/*
* photo get command - first parse and check parameters.
*/
@@ -921,8 +1002,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
pixelPtr[2]);
Tcl_AppendResult(interp, string, (char *) NULL);
break;
- }
- case PHOTO_PUT: {
+ }
+
+ case PHOTO_PUT:
/*
* photo put command - first parse the options and colors specified.
*/
@@ -931,7 +1013,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
memset((VOID *) &options, 0, sizeof(options));
options.name = NULL;
if (ParseSubcommandOptions(&options, interp, OPT_TO|OPT_FORMAT,
- &index, objc, objv) != TCL_OK) {
+ &index, objc, objv) != TCL_OK) {
return TCL_ERROR;
}
if ((options.name == NULL) || (index < objc)) {
@@ -942,8 +1024,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (MatchStringFormat(interp, options.name ? objv[2]:NULL,
options.format, &imageFormat, &imageWidth,
&imageHeight, &oldformat) == TCL_OK) {
- Tcl_Obj *format;
- Tcl_Obj *data;
+ Tcl_Obj *format, *data;
+
if (((options.options & OPT_TO) == 0) || (options.toX2 < 0)) {
options.toX2 = options.toX + imageWidth;
options.toY2 = options.toY + imageHeight;
@@ -964,8 +1046,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
if ((*imageFormat->stringReadProc)(interp, data,
format, (Tk_PhotoHandle) masterPtr,
- 0, 0, imageWidth, imageHeight, options.toX, options.toY)
- != TCL_OK) {
+ options.toX, options.toY, imageWidth, imageHeight,
+ 0, 0) != TCL_OK) {
return TCL_ERROR;
}
masterPtr->flags |= IMAGE_CHANGED;
@@ -976,8 +1058,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
Tcl_ResetResult(interp);
if (Tcl_SplitList(interp, Tcl_GetString(options.name),
- &dataHeight, &srcArgv)
- != TCL_OK) {
+ &dataHeight, &srcArgv) != TCL_OK) {
return TCL_ERROR;
}
tkwin = Tk_MainWindow(interp);
@@ -991,17 +1072,14 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
if (y == 0) {
dataWidth = listArgc;
- pixelPtr = (unsigned char *) ckalloc((unsigned)
- dataWidth * dataHeight * 3);
+ pixelPtr = (unsigned char *)
+ ckalloc((unsigned) dataWidth * dataHeight * 3);
block.pixelPtr = pixelPtr;
- } else {
- if (listArgc != dataWidth) {
- Tcl_AppendResult(interp, "all elements of color list must",
- " have the same number of elements",
- (char *) NULL);
- ckfree((char *) listArgv);
- break;
- }
+ } else if (listArgc != dataWidth) {
+ Tcl_AppendResult(interp, "all elements of color list must",
+ " have the same number of elements", (char *) NULL);
+ ckfree((char *) listArgv);
+ break;
}
for (x = 0; x < dataWidth; ++x) {
if (!XParseColor(Tk_Display(tkwin), Tk_Colormap(tkwin),
@@ -1015,8 +1093,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*pixelPtr++ = color.blue >> 8;
}
ckfree((char *) listArgv);
- if (x < dataWidth)
+ if (x < dataWidth) {
break;
+ }
}
ckfree((char *) srcArgv);
if (y < dataHeight || dataHeight == 0 || dataWidth == 0) {
@@ -1034,7 +1113,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
* copy the block in using Tk_PhotoPutBlock.
*/
- if (((options.options & OPT_TO) == 0) || (options.toX2 < 0)) {
+ if (!(options.options & OPT_TO) || (options.toX2 < 0)) {
options.toX2 = options.toX + dataWidth;
options.toY2 = options.toY + dataHeight;
}
@@ -1048,16 +1127,17 @@ ImgPhotoCmd(clientData, interp, objc, objv)
block.offset[3] = 0;
Tk_PhotoPutBlock((ClientData)masterPtr, &block,
options.toX, options.toY, options.toX2 - options.toX,
- options.toY2 - options.toY);
+ options.toY2 - options.toY, TK_PHOTO_COMPOSITE_SET);
ckfree((char *) block.pixelPtr);
break;
- }
- case PHOTO_READ: {
+
+ case PHOTO_READ: {
+ Tcl_Obj *format;
+
/*
* photo read command - first parse the options specified.
*/
- Tcl_Obj *format;
index = 2;
memset((VOID *) &options, 0, sizeof(options));
options.name = NULL;
@@ -1068,8 +1148,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
if ((options.name == NULL) || (index < objc)) {
- Tcl_WrongNumArgs(interp, 2, objv,
- "fileName ?options?");
+ Tcl_WrongNumArgs(interp, 2, objv, "fileName ?options?");
return TCL_ERROR;
}
@@ -1079,7 +1158,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (Tcl_IsSafe(interp)) {
Tcl_AppendResult(interp, "can't get image from a file in a",
- " safe interpreter", (char *) NULL);
+ " safe interpreter", (char *) NULL);
return TCL_ERROR;
}
@@ -1094,16 +1173,18 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
!= TCL_OK) {
+ Tcl_Close(NULL, chan);
return TCL_ERROR;
}
if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
!= TCL_OK) {
+ Tcl_Close(NULL, chan);
return TCL_ERROR;
}
if (MatchFileFormat(interp, chan,
- Tcl_GetString(options.name), options.format,
- &imageFormat, &imageWidth, &imageHeight, &oldformat) != TCL_OK) {
+ Tcl_GetString(options.name), options.format, &imageFormat,
+ &imageWidth, &imageHeight, &oldformat) != TCL_OK) {
Tcl_Close(NULL, chan);
return TCL_ERROR;
}
@@ -1133,8 +1214,13 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*/
if (options.options & OPT_SHRINK) {
- ImgPhotoSetSize(masterPtr, options.toX + width,
- options.toY + height);
+ if (ImgPhotoSetSize(masterPtr, options.toX + width,
+ options.toY + height) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ return TCL_ERROR;
+ }
}
/*
@@ -1155,42 +1241,163 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
return result;
break;
- }
- case PHOTO_REDITHER: {
- if (objc == 2) {
+ }
+
+ case PHOTO_REDITHER:
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Call Dither if any part of the image is not correctly
+ * dithered at present.
+ */
+
+ x = masterPtr->ditherX;
+ y = masterPtr->ditherY;
+ if (masterPtr->ditherX != 0) {
+ Tk_DitherPhoto((Tk_PhotoHandle) masterPtr, x, y,
+ masterPtr->width - x, 1);
+ }
+ if (masterPtr->ditherY < masterPtr->height) {
+ x = 0;
+ Tk_DitherPhoto((Tk_PhotoHandle)masterPtr, 0,
+ masterPtr->ditherY, masterPtr->width,
+ masterPtr->height - masterPtr->ditherY);
+ }
+
+ if (y < masterPtr->height) {
/*
- * Call Dither if any part of the image is not correctly
- * dithered at present.
+ * Tell the core image code that part of the image has changed.
*/
- x = masterPtr->ditherX;
- y = masterPtr->ditherY;
- if (masterPtr->ditherX != 0) {
- Tk_DitherPhoto((Tk_PhotoHandle) masterPtr, x, y, masterPtr->width - x, 1);
+ Tk_ImageChanged(masterPtr->tkMaster, x, y,
+ (masterPtr->width - x), (masterPtr->height - y),
+ masterPtr->width, masterPtr->height);
+ }
+ break;
+
+ case PHOTO_TRANS: {
+ static CONST char *photoTransOptions[] = {
+ "get", "set", (char *) NULL
+ };
+ enum transOptions {
+ PHOTO_TRANS_GET, PHOTO_TRANS_SET
+ };
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg arg ...?");
+ return TCL_ERROR;
+ }
+ if (Tcl_GetIndexFromObj(interp, objv[2], photoTransOptions, "option",
+ 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum transOptions) index) {
+ case PHOTO_TRANS_GET: {
+ XRectangle testBox;
+ TkRegion testRegion;
+
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 3, objv, "x y");
+ return TCL_ERROR;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if ((x < 0) || (x >= masterPtr->width)
+ || (y < 0) || (y >= masterPtr->height)) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[0]),
+ " transparency get: coordinates out of range",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ testBox.x = x;
+ testBox.y = y;
+ testBox.width = 1;
+ testBox.height = 1;
+ /* What a way to do a test! */
+ testRegion = TkCreateRegion();
+ TkUnionRectWithRegion(&testBox, testRegion, testRegion);
+ TkIntersectRegion(testRegion, masterPtr->validRegion, testRegion);
+ TkClipBox(testRegion, &testBox);
+ TkDestroyRegion(testRegion);
+
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
+ (testBox.width==0 && testBox.height==0));
+ return TCL_OK;
+ }
+
+ case PHOTO_TRANS_SET: {
+ int transFlag;
+ XRectangle setBox;
+
+ if (objc != 6) {
+ Tcl_WrongNumArgs(interp, 3, objv, "x y boolean");
+ return TCL_ERROR;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)
+ || (Tcl_GetBooleanFromObj(interp, objv[5],
+ &transFlag) != TCL_OK)) {
+ return TCL_ERROR;
}
- if (masterPtr->ditherY < masterPtr->height) {
- x = 0;
- Tk_DitherPhoto((Tk_PhotoHandle)masterPtr, 0, masterPtr->ditherY, masterPtr->width,
- masterPtr->height - masterPtr->ditherY);
+ if ((x < 0) || (x >= masterPtr->width)
+ || (y < 0) || (y >= masterPtr->height)) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[0]),
+ " transparency set: coordinates out of range",
+ (char *) NULL);
+ return TCL_ERROR;
}
- if (y < masterPtr->height) {
+ setBox.x = x;
+ setBox.y = y;
+ setBox.width = 1;
+ setBox.height = 1;
+ pixelPtr = masterPtr->pix24 + (y * masterPtr->width + x) * 4;
+
+ if (transFlag) {
/*
- * Tell the core image code that part of the image has changed.
+ * Make pixel transparent.
*/
+ TkRegion clearRegion = TkCreateRegion();
- Tk_ImageChanged(masterPtr->tkMaster, x, y,
- (masterPtr->width - x), (masterPtr->height - y),
- masterPtr->width, masterPtr->height);
+ TkUnionRectWithRegion(&setBox, clearRegion, clearRegion);
+ TkSubtractRegion(masterPtr->validRegion, clearRegion,
+ masterPtr->validRegion);
+ TkDestroyRegion(clearRegion);
+ /*
+ * Set the alpha value correctly.
+ */
+ pixelPtr[3] = 0;
+ } else {
+ /*
+ * Make pixel opaque.
+ */
+ TkUnionRectWithRegion(&setBox, masterPtr->validRegion,
+ masterPtr->validRegion);
+ pixelPtr[3] = 255;
}
- } else {
- Tcl_WrongNumArgs(interp, 2, objv, (char *) NULL);
- return TCL_ERROR;
+ /*
+ * Inform the generic image code that the image
+ * has (potentially) changed.
+ */
+
+ Tk_ImageChanged(masterPtr->tkMaster, x, y, 1, 1,
+ masterPtr->width, masterPtr->height);
+ masterPtr->flags &= ~IMAGE_CHANGED;
}
- break;
- }
- case PHOTO_WRITE: {
+
+ }
+ return TCL_OK;
+ }
+
+ case PHOTO_WRITE: {
char *data;
Tcl_Obj *format;
@@ -1200,7 +1407,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
if (Tcl_IsSafe(interp)) {
Tcl_AppendResult(interp, "can't write image to a file in a",
- " safe interpreter", (char *) NULL);
+ " safe interpreter", (char *) NULL);
return TCL_ERROR;
}
@@ -1234,7 +1441,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
* Fill in default values for unspecified parameters.
*/
- if (((options.options & OPT_FROM) == 0) || (options.fromX2 < 0)) {
+ if (!(options.options & OPT_FROM) || (options.fromX2 < 0)) {
options.fromX2 = masterPtr->width;
options.fromY2 = masterPtr->height;
}
@@ -1246,7 +1453,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
matched = 0;
for (imageFormat = tsdPtr->formatList; imageFormat != NULL;
- imageFormat = imageFormat->nextPtr) {
+ imageFormat = imageFormat->nextPtr) {
if ((options.format == NULL)
|| (strncasecmp(Tcl_GetString(options.format),
imageFormat->name, strlen(imageFormat->name)) == 0)) {
@@ -1257,18 +1464,18 @@ ImgPhotoCmd(clientData, interp, objc, objv)
}
}
if (imageFormat == NULL) {
- oldformat = 1;
- for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL;
- imageFormat = imageFormat->nextPtr) {
- if ((options.format == NULL)
- || (strncasecmp(Tcl_GetString(options.format),
- imageFormat->name, strlen(imageFormat->name)) == 0)) {
- matched = 1;
- if (imageFormat->fileWriteProc != NULL) {
- break;
+ oldformat = 1;
+ for (imageFormat = tsdPtr->oldFormatList; imageFormat != NULL;
+ imageFormat = imageFormat->nextPtr) {
+ if ((options.format == NULL)
+ || (strncasecmp(Tcl_GetString(options.format),
+ imageFormat->name, strlen(imageFormat->name)) == 0)) {
+ matched = 1;
+ if (imageFormat->fileWriteProc != NULL) {
+ break;
+ }
}
}
- }
}
if (imageFormat == NULL) {
if (options.format == NULL) {
@@ -1298,8 +1505,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
format = (Tcl_Obj *) Tcl_GetString(options.format);
}
result = (*imageFormat->fileWriteProc)(interp,
- Tcl_GetString(options.name),
- format, &block);
+ Tcl_GetString(options.name), format, &block);
if (options.background) {
Tk_FreeColor(options.background);
}
@@ -1307,10 +1513,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
ckfree(data);
}
return result;
- break;
- }
}
+ }
return TCL_OK;
}
@@ -1321,7 +1526,8 @@ ImgPhotoCmd(clientData, interp, objc, objv)
*
* This procedure is invoked to process one of the options
* which may be specified for the photo image subcommands,
- * namely, -from, -to, -zoom, -subsample, -format, and -shrink.
+ * namely, -from, -to, -zoom, -subsample, -format, -shrink,
+ * and -compositingrule.
*
* Results:
* A standard Tcl result.
@@ -1436,7 +1642,9 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
}
} else if (bit == OPT_FORMAT) {
/*
- * The -format option takes a single string value.
+ * The -format option takes a single string value. Note
+ * that parsing this is outside the scope of this
+ * function.
*/
if (index + 1 < objc) {
@@ -1447,6 +1655,34 @@ ParseSubcommandOptions(optPtr, interp, allowedOptions, optIndexPtr, objc, objv)
"requires a value", (char *) NULL);
return TCL_ERROR;
}
+ } else if (bit == OPT_COMPOSITE) {
+ /*
+ * The -compositingrule option takes a single value from
+ * a well-known set.
+ */
+
+ if (index + 1 < objc) {
+ /*
+ * Note that these must match the TK_PHOTO_COMPOSITE_*
+ * constants.
+ */
+ static CONST char *compositingRules[] = {
+ "overlay", "set",
+ NULL
+ };
+
+ index++;
+ if (Tcl_GetIndexFromObj(interp, objv[index], compositingRules,
+ "compositing rule", 0, &optPtr->compositingRule)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ *optIndexPtr = index;
+ } else {
+ Tcl_AppendResult(interp, "the \"-compositingrule\" option ",
+ "requires a value", (char *) NULL);
+ return TCL_ERROR;
+ }
} else if ((bit != OPT_SHRINK) && (bit != OPT_GRAYSCALE)) {
char *val;
maxValues = ((bit == OPT_FROM) || (bit == OPT_TO))? 4: 2;
@@ -1588,7 +1824,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
* such as TK_CONFIG_ARGV_ONLY. */
{
PhotoInstance *instancePtr;
- char *oldFileString, *oldPaletteString;
+ CONST char *oldFileString, *oldPaletteString;
Tcl_Obj *oldData, *data = NULL, *oldFormat, *format = NULL;
int length, i, j;
double oldGamma;
@@ -1596,11 +1832,11 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
Tcl_Channel chan;
Tk_PhotoImageFormat *imageFormat;
int imageWidth, imageHeight;
- char **args;
+ CONST char **args;
int oldformat;
Tcl_Obj *tempdata, *tempformat;
- args = (char **) ckalloc((objc + 1) * sizeof(char *));
+ args = (CONST char **) ckalloc((objc + 1) * sizeof(char *));
for (i = 0, j = 0; i < objc; i++,j++) {
args[j] = Tcl_GetStringFromObj(objv[i], &length);
if ((length > 1) && (args[j][0] == '-')) {
@@ -1630,8 +1866,18 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
*/
oldFileString = masterPtr->fileString;
- oldData = (oldFileString == NULL) ? masterPtr->dataString: NULL;
+ if (oldFileString == NULL) {
+ oldData = masterPtr->dataString;
+ if (oldData != NULL) {
+ Tcl_IncrRefCount(oldData);
+ }
+ } else {
+ oldData = NULL;
+ }
oldFormat = masterPtr->format;
+ if (oldFormat != NULL) {
+ Tcl_IncrRefCount(oldFormat);
+ }
oldPaletteString = masterPtr->palette;
oldGamma = masterPtr->gamma;
@@ -1642,7 +1888,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs,
j, args, (char *) masterPtr, flags) != TCL_OK) {
ckfree((char *) args);
- return TCL_ERROR;
+ goto errorExit;
}
ckfree((char *) args);
@@ -1684,7 +1930,13 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
* and make sure storage is correctly allocated for this image.
*/
- ImgPhotoSetSize(masterPtr, masterPtr->width, masterPtr->height);
+ if (ImgPhotoSetSize(masterPtr, masterPtr->width,
+ masterPtr->height) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ goto errorExit;
+ }
/*
* Read in the image from the file or string if the user has
@@ -1700,30 +1952,36 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
*/
if (Tcl_IsSafe(interp)) {
- Tcl_AppendResult(interp, "can't get image from a file in a",
- " safe interpreter", (char *) NULL);
- return TCL_ERROR;
+ Tcl_ResetResult(interp);
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ "can't get image from a file in a safe interpreter",
+ (char *) NULL);
+ goto errorExit;
}
chan = Tcl_OpenFileChannel(interp, masterPtr->fileString, "r", 0);
if (chan == NULL) {
- return TCL_ERROR;
+ goto errorExit;
}
- if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (MatchFileFormat(interp, chan, masterPtr->fileString,
- masterPtr->format, &imageFormat, &imageWidth,
- &imageHeight, &oldformat) != TCL_OK) {
+ /*
+ * -translation binary also sets -encoding binary
+ */
+ if ((Tcl_SetChannelOption(interp, chan,
+ "-translation", "binary") != TCL_OK) ||
+ (MatchFileFormat(interp, chan, masterPtr->fileString,
+ masterPtr->format, &imageFormat, &imageWidth,
+ &imageHeight, &oldformat) != TCL_OK)) {
Tcl_Close(NULL, chan);
- return TCL_ERROR;
+ goto errorExit;
+ }
+ result = ImgPhotoSetSize(masterPtr, imageWidth, imageHeight);
+ if (result != TCL_OK) {
+ Tcl_Close(NULL, chan);
+ Tcl_ResetResult(interp);
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ goto errorExit;
}
- ImgPhotoSetSize(masterPtr, imageWidth, imageHeight);
tempformat = masterPtr->format;
if (oldformat && tempformat) {
tempformat = (Tcl_Obj *) Tcl_GetString(tempformat);
@@ -1734,7 +1992,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
imageWidth, imageHeight, 0, 0);
Tcl_Close(NULL, chan);
if (result != TCL_OK) {
- return TCL_ERROR;
+ goto errorExit;
}
Tcl_ResetResult(interp);
@@ -1743,14 +2001,19 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
if ((masterPtr->fileString == NULL) && (masterPtr->dataString != NULL)
&& ((masterPtr->dataString != oldData)
- || (masterPtr->format != oldFormat))) {
+ || (masterPtr->format != oldFormat))) {
- if (MatchStringFormat(interp, masterPtr->dataString,
+ if (MatchStringFormat(interp, masterPtr->dataString,
masterPtr->format, &imageFormat, &imageWidth,
&imageHeight, &oldformat) != TCL_OK) {
- return TCL_ERROR;
+ goto errorExit;
+ }
+ if (ImgPhotoSetSize(masterPtr, imageWidth, imageHeight) != TCL_OK) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
+ TK_PHOTO_ALLOC_FAILURE_MESSAGE, (char *) NULL);
+ goto errorExit;
}
- ImgPhotoSetSize(masterPtr, imageWidth, imageHeight);
tempformat = masterPtr->format;
tempdata = masterPtr->dataString;
if (oldformat) {
@@ -1762,7 +2025,7 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
if ((*imageFormat->stringReadProc)(interp, tempdata,
tempformat, (Tk_PhotoHandle) masterPtr,
0, 0, imageWidth, imageHeight, 0, 0) != TCL_OK) {
- return TCL_ERROR;
+ goto errorExit;
}
Tcl_ResetResult(interp);
@@ -1802,7 +2065,22 @@ ImgPhotoConfigureMaster(interp, masterPtr, objc, objv, flags)
masterPtr->height, masterPtr->width, masterPtr->height);
masterPtr->flags &= ~IMAGE_CHANGED;
+ if (oldData != NULL) {
+ Tcl_DecrRefCount(oldData);
+ }
+ if (oldFormat != NULL) {
+ Tcl_DecrRefCount(oldFormat);
+ }
return TCL_OK;
+
+ errorExit:
+ if (oldData != NULL) {
+ Tcl_DecrRefCount(oldData);
+ }
+ if (oldFormat != NULL) {
+ Tcl_DecrRefCount(oldFormat);
+ }
+ return TCL_ERROR;
}
/*
@@ -1900,6 +2178,8 @@ ImgPhotoConfigureInstance(instancePtr)
* to byte-swap any 16 or 32 bit values that we store in the
* image in those situations where the server's endianness
* is different from ours.
+ *
+ * Can't we use autoconf to figure this out?
*/
if (imagePtr != NULL) {
@@ -1977,7 +2257,6 @@ ImgPhotoGet(tkwin, masterData)
Colormap colormap;
int mono, nRed, nGreen, nBlue;
XVisualInfo visualInfo, *visInfoPtr;
- XRectangle validBox;
char buf[TCL_INTEGER_SPACE * 3];
int numVisuals;
XColor *white, *black;
@@ -2121,8 +2400,10 @@ ImgPhotoGet(tkwin, masterData)
gcValues.graphics_exposures = False;
instancePtr->gc = Tk_GetGC(tkwin,
GCForeground|GCBackground|GCGraphicsExposures, &gcValues);
+
/*
* Set configuration options and finish the initialization of the instance.
+ * This will also dither the image if necessary.
*/
ImgPhotoConfigureInstance(instancePtr);
@@ -2136,16 +2417,6 @@ ImgPhotoGet(tkwin, masterData)
masterPtr->width, masterPtr->height);
}
- /*
- * Dither the image to fill in this instance's pixmap.
- */
-
- TkClipBox(masterPtr->validRegion, &validBox);
- if ((validBox.width > 0) && (validBox.height > 0)) {
- DitherInstance(instancePtr, validBox.x, validBox.y, validBox.width,
- validBox.height);
- }
-
return (ClientData) instancePtr;
}
@@ -2346,7 +2617,8 @@ ImgPhotoCmdDeletedProc(clientData)
* image's size to `width' x `height' pixels.
*
* Results:
- * None.
+ * TCL_OK if successful, TCL_ERROR if failure occurred (currently
+ * just with memory allocation.)
*
* Side effects:
* Storage gets reallocated, for the master and all its instances.
@@ -2354,12 +2626,12 @@ ImgPhotoCmdDeletedProc(clientData)
*----------------------------------------------------------------------
*/
-static void
+static int
ImgPhotoSetSize(masterPtr, width, height)
PhotoMaster *masterPtr;
int width, height;
{
- unsigned char *newPix24;
+ unsigned char *newPix24 = NULL;
int h, offset, pitch;
unsigned char *srcPtr, *destPtr;
XRectangle validBox, clipBox;
@@ -2373,6 +2645,21 @@ ImgPhotoSetSize(masterPtr, width, height)
height = masterPtr->userHeight;
}
+ pitch = width * 4;
+
+ /*
+ * Test if we're going to (re)allocate the main buffer now, so
+ * that any failures will leave the photo unchanged.
+ */
+ if ((width != masterPtr->width) || (height != masterPtr->height)
+ || (masterPtr->pix24 == NULL)) {
+ newPix24 = (unsigned char *)
+ attemptckalloc((unsigned) (height * pitch));
+ if (newPix24 == NULL) {
+ return TCL_ERROR;
+ }
+ }
+
/*
* We have to trim the valid region if it is currently
* larger than the new image size.
@@ -2393,17 +2680,12 @@ ImgPhotoSetSize(masterPtr, width, height)
TkClipBox(masterPtr->validRegion, &validBox);
}
- if ((width != masterPtr->width) || (height != masterPtr->height)
- || (masterPtr->pix24 == NULL)) {
-
- /*
- * Reallocate storage for the 24-bit image and copy
- * over valid regions.
- */
-
- pitch = width * 4;
- newPix24 = (unsigned char *) ckalloc((unsigned) (height * pitch));
-
+ /*
+ * Use the reallocated storage (allocation above) for the 24-bit
+ * image and copy over valid regions. Note that this test is true
+ * precisely when the allocation has already been done.
+ */
+ if (newPix24 != NULL) {
/*
* Zero the new array. The dithering code shouldn't read the
* areas outside validBox, but they might be copied to another
@@ -2479,12 +2761,10 @@ ImgPhotoSetSize(masterPtr, width, height)
masterPtr->ditherX = 0;
masterPtr->ditherY = validBox.height;
}
- } else {
- if ((masterPtr->ditherY > 0)
- || ((int) validBox.width < masterPtr->ditherX)) {
- masterPtr->ditherX = validBox.width;
- masterPtr->ditherY = 0;
- }
+ } else if ((masterPtr->ditherY > 0)
+ || ((int) validBox.width < masterPtr->ditherX)) {
+ masterPtr->ditherX = validBox.width;
+ masterPtr->ditherY = 0;
}
}
@@ -2496,6 +2776,8 @@ ImgPhotoSetSize(masterPtr, width, height)
instancePtr = instancePtr->nextPtr) {
ImgPhotoInstanceSetSize(instancePtr);
}
+
+ return TCL_OK;
}
/*
@@ -2540,6 +2822,10 @@ ImgPhotoInstanceSetSize(instancePtr)
(masterPtr->width > 0) ? masterPtr->width: 1,
(masterPtr->height > 0) ? masterPtr->height: 1,
instancePtr->visualInfo.depth);
+ if (!newPixmap) {
+ panic("Fail to create pixmap with Tk_GetPixmap in ImgPhotoInstanceSetSize.\n");
+ return;
+ }
/*
* The following is a gross hack needed to properly support colormaps
@@ -2654,7 +2940,7 @@ static int
IsValidPalette(instancePtr, palette)
PhotoInstance *instancePtr; /* Instance to which the palette
* specification is to be applied. */
- char *palette; /* Palette specification string. */
+ CONST char *palette; /* Palette specification string. */
{
int nRed, nGreen, nBlue, mono, numColors;
char *endp;
@@ -2932,7 +3218,6 @@ AllocateColors(colorPtr)
* shades of each primary.
*/
- nRed = nGreen = nBlue = 0;
mono = sscanf(colorPtr->id.palette, "%d/%d/%d", &nRed, &nGreen, &nBlue)
<= 1;
igam = 1.0 / colorPtr->id.gamma;
@@ -3436,7 +3721,7 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
}
}
if (formatPtr->fileMatchProc != NULL) {
- (void) Tcl_Seek(chan, 0L, SEEK_SET);
+ (void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET);
if ((*formatPtr->fileMatchProc)(chan, fileName, formatObj,
widthPtr, heightPtr, interp)) {
@@ -3451,35 +3736,35 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
}
}
if (formatPtr == NULL) {
- useoldformat = 1;
- for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
- formatPtr = formatPtr->nextPtr) {
- if (formatString != NULL) {
- if (strncasecmp(formatString,
- formatPtr->name, strlen(formatPtr->name)) != 0) {
- continue;
- }
- matched = 1;
- if (formatPtr->fileMatchProc == NULL) {
- Tcl_AppendResult(interp, "-file option isn't supported for ",
- formatString, " images", (char *) NULL);
- return TCL_ERROR;
- }
- }
- if (formatPtr->fileMatchProc != NULL) {
- (void) Tcl_Seek(chan, 0L, SEEK_SET);
- if ((*formatPtr->fileMatchProc)(chan, fileName, (Tcl_Obj *) formatString,
- widthPtr, heightPtr, interp)) {
- if (*widthPtr < 1) {
- *widthPtr = 1;
+ useoldformat = 1;
+ for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
+ formatPtr = formatPtr->nextPtr) {
+ if (formatString != NULL) {
+ if (strncasecmp(formatString,
+ formatPtr->name, strlen(formatPtr->name)) != 0) {
+ continue;
}
- if (*heightPtr < 1) {
- *heightPtr = 1;
+ matched = 1;
+ if (formatPtr->fileMatchProc == NULL) {
+ Tcl_AppendResult(interp, "-file option isn't supported",
+ " for ", formatString, " images", (char *) NULL);
+ return TCL_ERROR;
+ }
+ }
+ if (formatPtr->fileMatchProc != NULL) {
+ (void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET);
+ if ((*formatPtr->fileMatchProc)(chan, fileName, (Tcl_Obj *)
+ formatString, widthPtr, heightPtr, interp)) {
+ if (*widthPtr < 1) {
+ *widthPtr = 1;
+ }
+ if (*heightPtr < 1) {
+ *heightPtr = 1;
+ }
+ break;
}
- break;
}
}
- }
}
if (formatPtr == NULL) {
@@ -3497,7 +3782,7 @@ MatchFileFormat(interp, chan, fileName, formatObj, imageFormatPtr,
*imageFormatPtr = formatPtr;
*oldformat = useoldformat;
- (void) Tcl_Seek(chan, 0L, SEEK_SET);
+ (void) Tcl_Seek(chan, Tcl_LongAsWide(0L), SEEK_SET);
return TCL_OK;
}
@@ -3576,34 +3861,34 @@ MatchStringFormat(interp, data, formatObj, imageFormatPtr,
}
if (formatPtr == NULL) {
- useoldformat = 1;
- for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
- formatPtr = formatPtr->nextPtr) {
- if (formatObj != NULL) {
- if (strncasecmp(formatString,
- formatPtr->name, strlen(formatPtr->name)) != 0) {
- continue;
+ useoldformat = 1;
+ for (formatPtr = tsdPtr->oldFormatList; formatPtr != NULL;
+ formatPtr = formatPtr->nextPtr) {
+ if (formatObj != NULL) {
+ if (strncasecmp(formatString,
+ formatPtr->name, strlen(formatPtr->name)) != 0) {
+ continue;
+ }
+ matched = 1;
+ if (formatPtr->stringMatchProc == NULL) {
+ Tcl_AppendResult(interp, "-data option isn't supported",
+ " for ", formatString, " images", (char *) NULL);
+ return TCL_ERROR;
+ }
}
- matched = 1;
- if (formatPtr->stringMatchProc == NULL) {
- Tcl_AppendResult(interp, "-data option isn't supported for ",
- formatString, " images", (char *) NULL);
- return TCL_ERROR;
+ if ((formatPtr->stringMatchProc != NULL)
+ && (formatPtr->stringReadProc != NULL)
+ && (*formatPtr->stringMatchProc)(
+ (Tcl_Obj *) Tcl_GetString(data),
+ (Tcl_Obj *) formatString,
+ widthPtr, heightPtr, interp)) {
+ break;
}
}
- if ((formatPtr->stringMatchProc != NULL)
- && (formatPtr->stringReadProc != NULL)
- && (*formatPtr->stringMatchProc)((Tcl_Obj *) Tcl_GetString(data),
- (Tcl_Obj *) formatString,
- widthPtr, heightPtr, interp)) {
- break;
- }
- }
}
if (formatPtr == NULL) {
if ((formatObj != NULL) && !matched) {
- Tcl_AppendResult(interp, "image format \"",
- formatString,
+ Tcl_AppendResult(interp, "image format \"", formatString,
"\" is not supported", (char *) NULL);
} else {
Tcl_AppendResult(interp, "couldn't recognize image data",
@@ -3641,7 +3926,7 @@ Tk_PhotoHandle
Tk_FindPhoto(interp, imageName)
Tcl_Interp *interp; /* Interpreter (application) in which image
* exists. */
- char *imageName; /* Name of the desired photo image. */
+ CONST char *imageName; /* Name of the desired photo image. */
{
ClientData clientData;
Tk_ImageType *typePtr;
@@ -3670,7 +3955,7 @@ Tk_FindPhoto(interp, imageName)
*---------------------------------------------------------------------- */
void
-Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height)
+Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule)
Tk_PhotoHandle handle; /* Opaque handle for the photo image
* to be updated. */
register Tk_PhotoImageBlock *blockPtr;
@@ -3680,6 +3965,8 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height)
* be updated in the image. */
int width, height; /* Dimensions of the area of the image
* to be updated. */
+ int compRule; /* Compositing rule to use when processing
+ * transparent pixels. */
{
register PhotoMaster *masterPtr;
int xEnd, yEnd;
@@ -3700,14 +3987,17 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height)
&& ((y + height) > masterPtr->userHeight)) {
height = masterPtr->userHeight - y;
}
- if ((width <= 0) || (height <= 0))
+ if ((width <= 0) || (height <= 0)) {
return;
+ }
xEnd = x + width;
yEnd = y + height;
if ((xEnd > masterPtr->width) || (yEnd > masterPtr->height)) {
- ImgPhotoSetSize(masterPtr, MAX(xEnd, masterPtr->width),
- MAX(yEnd, masterPtr->height));
+ if (ImgPhotoSetSize(masterPtr, MAX(xEnd, masterPtr->width),
+ MAX(yEnd, masterPtr->height)) == TCL_ERROR) {
+ panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
}
if ((y < masterPtr->ditherY) || ((y == masterPtr->ditherY)
@@ -3753,40 +4043,82 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height)
&& (greenOffset == 1) && (blueOffset == 2) && (alphaOffset == 3)
&& (width <= blockPtr->width) && (height <= blockPtr->height)
&& ((height == 1) || ((x == 0) && (width == masterPtr->width)
- && (blockPtr->pitch == pitch)))) {
+ && (blockPtr->pitch == pitch)))
+ && (compRule == TK_PHOTO_COMPOSITE_SET)) {
memcpy((VOID *) destLinePtr,
(VOID *) (blockPtr->pixelPtr + blockPtr->offset[0]),
(size_t) (height * width * 4));
} else {
+ int alpha;
for (hLeft = height; hLeft > 0;) {
srcLinePtr = blockPtr->pixelPtr + blockPtr->offset[0];
hCopy = MIN(hLeft, blockPtr->height);
hLeft -= hCopy;
for (; hCopy > 0; --hCopy) {
- destPtr = destLinePtr;
- for (wLeft = width; wLeft > 0;) {
- wCopy = MIN(wLeft, blockPtr->width);
- wLeft -= wCopy;
- srcPtr = srcLinePtr;
- for (; wCopy > 0; --wCopy) {
- if (!destPtr[3]) {
- destPtr[0] = destPtr[1] = destPtr[2] = 0xd9;
- }
- if (!alphaOffset || (srcPtr[alphaOffset] == 255)) {
- *destPtr++ = srcPtr[0];
- *destPtr++ = srcPtr[greenOffset];
- *destPtr++ = srcPtr[blueOffset];
- *destPtr++ = 255;
- } else {
- if (srcPtr[alphaOffset]) {
- destPtr[0] += (srcPtr[0] - destPtr[0]) * srcPtr[alphaOffset] / 255;
- destPtr[1] += (srcPtr[greenOffset] - destPtr[1]) * srcPtr[alphaOffset] / 255;
- destPtr[2] += (srcPtr[blueOffset] - destPtr[2]) * srcPtr[alphaOffset] / 255;
- destPtr[3] += (255 - destPtr[3]) * srcPtr[alphaOffset] / 255;
- }
- destPtr+=4;
- }
- srcPtr += blockPtr->pixelSize;
+ if ((blockPtr->pixelSize == 4) && (greenOffset == 1)
+ && (blueOffset == 2) && (alphaOffset == 3)
+ && (width <= blockPtr->width)
+ && (compRule == TK_PHOTO_COMPOSITE_SET)) {
+ memcpy((VOID *) destLinePtr, (VOID *) srcLinePtr,
+ (size_t) (width * 4));
+ } else {
+ destPtr = destLinePtr;
+ for (wLeft = width; wLeft > 0;) {
+ wCopy = MIN(wLeft, blockPtr->width);
+ wLeft -= wCopy;
+ srcPtr = srcLinePtr;
+ for (; wCopy > 0; --wCopy) {
+ alpha = srcPtr[alphaOffset];
+ /*
+ * In the easy case, we can just copy.
+ */
+ if (!alphaOffset || (alpha == 255)) {
+ /* new solid part of the image */
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = 255;
+ srcPtr += blockPtr->pixelSize;
+ continue;
+ }
+
+ /*
+ * Combine according to the compositing rule.
+ */
+ switch (compRule) {
+ case TK_PHOTO_COMPOSITE_SET:
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = alpha;
+ break;
+
+ case TK_PHOTO_COMPOSITE_OVERLAY:
+ if (!destPtr[3]) {
+ /*
+ * There must be a better way to select a
+ * background colour!
+ */
+ destPtr[0] = destPtr[1] = destPtr[2] = 0xd9;
+ }
+
+ if (alpha) {
+ destPtr[0] += (srcPtr[0] - destPtr[0]) * alpha / 255;
+ destPtr[1] += (srcPtr[greenOffset] - destPtr[1]) * alpha / 255;
+ destPtr[2] += (srcPtr[blueOffset] - destPtr[2]) * alpha / 255;
+ destPtr[3] += (255 - destPtr[3]) * alpha / 255;
+ }
+ /*
+ * else should be empty space
+ */
+ destPtr += 4;
+ break;
+
+ default:
+ panic("unknown compositing rule: %d", compRule);
+ }
+ srcPtr += blockPtr->pixelSize;
+ }
}
}
srcLinePtr += blockPtr->pitch;
@@ -3799,61 +4131,81 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height)
* Add this new block to the region which specifies which data is valid.
*/
- if (alphaOffset) {
- int x1, y1, end;
-
- /*
- * This block is grossly inefficient. For each row in the image, it
- * finds each continguous string of transparent pixels, then marks those
- * areas as invalid in the validRegion mask. This makes drawing very
- * efficient, because of the way we use X: we just say, here's your
- * mask, and here's your data. We need not worry about the current
- * background color, etc. But this costs us a lot on the image setup.
- * Still, image setup only happens once, whereas the drawing happens
- * many times, so this might be the best way to go.
- *
- * An alternative might be to not set up this mask, and instead, at
- * drawing time, for each transparent pixel, set its color to the
- * color of the background behind that pixel. This is what I suspect
- * most of programs do. However, they don't have to deal with the canvas,
- * which could have many different background colors. Determining the
- * correct bg color for a given pixel might be expensive.
- */
-
- destLinePtr = masterPtr->pix24 + (y * masterPtr->width + x) * 4 + 3;
- for (y1 = 0; y1 < height; y1++) {
- x1 = 0;
- destPtr = destLinePtr;
- while (x1 < width) {
- /* search for first non-transparent pixel */
- while ((x1 < width) && !*destPtr) {
- x1++; destPtr += 4;
- }
- end = x1;
- /* search for first transparent pixel */
- while ((end < width) && *destPtr) {
- end++; destPtr += 4;
- }
- if (end > x1) {
- rect.x = x + x1;
- rect.y = y + y1;
- rect.width = end - x1;
- rect.height = 1;
- TkUnionRectWithRegion(&rect, masterPtr->validRegion,
- masterPtr->validRegion);
+ if (alphaOffset) {
+ int x1, y1, end;
+
+ /*
+ * This block is grossly inefficient. For each row in the image, it
+ * finds each continguous string of nontransparent pixels, then marks
+ * those areas as valid in the validRegion mask. This makes drawing
+ * very efficient, because of the way we use X: we just say, here's
+ * your mask, and here's your data. We need not worry about the
+ * current background color, etc. But this costs us a lot on the
+ * image setup. Still, image setup only happens once, whereas the
+ * drawing happens many times, so this might be the best way to go.
+ *
+ * An alternative might be to not set up this mask, and instead, at
+ * drawing time, for each transparent pixel, set its color to the
+ * color of the background behind that pixel. This is what I suspect
+ * most of programs do. However, they don't have to deal with the
+ * canvas, which could have many different background colors.
+ * Determining the correct bg color for a given pixel might be
+ * expensive.
+ */
+
+ if (compRule != TK_PHOTO_COMPOSITE_OVERLAY) {
+ /*
+ * Don't need this when using the OVERLAY compositing rule,
+ * which always strictly increases the valid region.
+ */
+ TkRegion workRgn = TkCreateRegion();
+
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ TkUnionRectWithRegion(&rect, workRgn, workRgn);
+ TkSubtractRegion(masterPtr->validRegion, workRgn,
+ masterPtr->validRegion);
+ TkDestroyRegion(workRgn);
+ }
+
+ destLinePtr = masterPtr->pix24 + (y * masterPtr->width + x) * 4 + 3;
+ for (y1 = 0; y1 < height; y1++) {
+ x1 = 0;
+ destPtr = destLinePtr;
+ while (x1 < width) {
+ /* search for first non-transparent pixel */
+ while ((x1 < width) && !*destPtr) {
+ x1++;
+ destPtr += 4;
+ }
+ end = x1;
+ /* search for first transparent pixel */
+ while ((end < width) && *destPtr) {
+ end++;
+ destPtr += 4;
+ }
+ if (end > x1) {
+ rect.x = x + x1;
+ rect.y = y + y1;
+ rect.width = end - x1;
+ rect.height = 1;
+ TkUnionRectWithRegion(&rect, masterPtr->validRegion,
+ masterPtr->validRegion);
+ }
+ x1 = end;
}
- x1 = end;
+ destLinePtr += masterPtr->width * 4;
}
- destLinePtr += masterPtr->width * 4;
+ } else {
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ TkUnionRectWithRegion(&rect, masterPtr->validRegion,
+ masterPtr->validRegion);
}
- } else {
- rect.x = x;
- rect.y = y;
- rect.width = width;
- rect.height = height;
- TkUnionRectWithRegion(&rect, masterPtr->validRegion,
- masterPtr->validRegion);
- }
/*
* Update each instance.
@@ -3889,7 +4241,7 @@ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height)
void
Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
- subsampleX, subsampleY)
+ subsampleX, subsampleY, compRule)
Tk_PhotoHandle handle; /* Opaque handle for the photo image
* to be updated. */
register Tk_PhotoImageBlock *blockPtr;
@@ -3901,6 +4253,8 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
* to be updated. */
int zoomX, zoomY; /* Zoom factors for the X and Y axes. */
int subsampleX, subsampleY; /* Subsampling factors for the X and Y axes. */
+ int compRule; /* Compositing rule to use when processing
+ * transparent pixels. */
{
register PhotoMaster *masterPtr;
int xEnd, yEnd;
@@ -3915,16 +4269,16 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
int blockXSkip, blockYSkip;
XRectangle rect;
- if ((zoomX == 1) && (zoomY == 1) && (subsampleX == 1)
- && (subsampleY == 1)) {
- Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height);
+ if (zoomX==1 && zoomY==1 && subsampleX==1 && subsampleY==1) {
+ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height, compRule);
return;
}
masterPtr = (PhotoMaster *) handle;
- if ((zoomX <= 0) || (zoomY <= 0))
+ if (zoomX <= 0 || zoomY <= 0) {
return;
+ }
if ((masterPtr->userWidth != 0) && ((x + width) > masterPtr->userWidth)) {
width = masterPtr->userWidth - x;
}
@@ -3932,15 +4286,18 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
&& ((y + height) > masterPtr->userHeight)) {
height = masterPtr->userHeight - y;
}
- if ((width <= 0) || (height <= 0))
+ if (width <= 0 || height <= 0) {
return;
+ }
xEnd = x + width;
yEnd = y + height;
if ((xEnd > masterPtr->width) || (yEnd > masterPtr->height)) {
int sameSrc = (blockPtr->pixelPtr == masterPtr->pix24);
- ImgPhotoSetSize(masterPtr, MAX(xEnd, masterPtr->width),
- MAX(yEnd, masterPtr->height));
+ if (ImgPhotoSetSize(masterPtr, MAX(xEnd, masterPtr->width),
+ MAX(yEnd, masterPtr->height)) == TCL_ERROR) {
+ panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
if (sameSrc) {
blockPtr->pixelPtr = masterPtr->pix24;
}
@@ -3980,18 +4337,20 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
blockXSkip = subsampleX * blockPtr->pixelSize;
blockYSkip = subsampleY * blockPtr->pitch;
- if (subsampleX > 0)
+ if (subsampleX > 0) {
blockWid = ((blockPtr->width + subsampleX - 1) / subsampleX) * zoomX;
- else if (subsampleX == 0)
+ } else if (subsampleX == 0) {
blockWid = width;
- else
+ } else {
blockWid = ((blockPtr->width - subsampleX - 1) / -subsampleX) * zoomX;
- if (subsampleY > 0)
+ }
+ if (subsampleY > 0) {
blockHt = ((blockPtr->height + subsampleY - 1) / subsampleY) * zoomY;
- else if (subsampleY == 0)
+ } else if (subsampleY == 0) {
blockHt = height;
- else
+ } else {
blockHt = ((blockPtr->height - subsampleY - 1) / -subsampleY) * zoomY;
+ }
/*
* Copy the data into our local 24-bit/pixel array.
@@ -4020,23 +4379,43 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
srcPtr = srcLinePtr;
for (; wCopy > 0; wCopy -= zoomX) {
for (xRepeat = MIN(wCopy, zoomX); xRepeat > 0; xRepeat--) {
- if (!destPtr[3]) {
- destPtr[0] = destPtr[1] = destPtr[2] = 0xd9;
- }
- if (!alphaOffset || (srcPtr[alphaOffset] == 255)) {
- *destPtr++ = srcPtr[0];
- *destPtr++ = srcPtr[greenOffset];
- *destPtr++ = srcPtr[blueOffset];
- *destPtr++ = 255;
- } else {
- if (srcPtr[alphaOffset]) {
- destPtr[0] += (srcPtr[0] - destPtr[0]) * srcPtr[alphaOffset] / 255;
- destPtr[1] += (srcPtr[greenOffset] - destPtr[1]) * srcPtr[alphaOffset] / 255;
- destPtr[2] += (srcPtr[blueOffset] - destPtr[2]) * srcPtr[alphaOffset] / 255;
- destPtr[3] += (255 - destPtr[3]) * srcPtr[alphaOffset] / 255;
- }
- destPtr+=4;
- }
+ /*
+ * Common case (solid pixels) first
+ */
+ if (!alphaOffset || (srcPtr[alphaOffset] == 255)) {
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = 255;
+ continue;
+ }
+
+ switch (compRule) {
+ case TK_PHOTO_COMPOSITE_SET:
+ *destPtr++ = srcPtr[0];
+ *destPtr++ = srcPtr[greenOffset];
+ *destPtr++ = srcPtr[blueOffset];
+ *destPtr++ = srcPtr[alphaOffset];
+ break;
+ case TK_PHOTO_COMPOSITE_OVERLAY:
+ if (!destPtr[3]) {
+ /*
+ * There must be a better way to select a
+ * background colour!
+ */
+ destPtr[0] = destPtr[1] = destPtr[2] = 0xd9;
+ }
+ if (srcPtr[alphaOffset]) {
+ destPtr[0] += (srcPtr[0] - destPtr[0]) * srcPtr[alphaOffset] / 255;
+ destPtr[1] += (srcPtr[greenOffset] - destPtr[1]) * srcPtr[alphaOffset] / 255;
+ destPtr[2] += (srcPtr[blueOffset] - destPtr[2]) * srcPtr[alphaOffset] / 255;
+ destPtr[3] += (255 - destPtr[3]) * srcPtr[alphaOffset] / 255;
+ }
+ destPtr += 4;
+ break;
+ default:
+ panic("unknown compositing rule: %d", compRule);
+ }
}
srcPtr += blockXSkip;
}
@@ -4051,46 +4430,65 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
}
/*
- * Add this new block to the region that specifies which data is valid.
+ * Recompute the region of data for which we have valid pixels to plot.
*/
- if (alphaOffset) {
- int x1, y1, end;
-
- destLinePtr = masterPtr->pix24 + (y * masterPtr->width + x) * 4 + 3;
- for (y1 = 0; y1 < height; y1++) {
- x1 = 0;
- destPtr = destLinePtr;
- while (x1 < width) {
- /* search for first non-transparent pixel */
- while ((x1 < width) && !*destPtr) {
- x1++; destPtr += 4;
- }
- end = x1;
- /* search for first transparent pixel */
- while ((end < width) && *destPtr) {
- end++; destPtr += 4;
- }
- if (end > x1) {
- rect.x = x + x1;
- rect.y = y + y1;
- rect.width = end - x1;
- rect.height = 1;
- TkUnionRectWithRegion(&rect, masterPtr->validRegion,
- masterPtr->validRegion);
+ if (alphaOffset) {
+ int x1, y1, end;
+
+ if (compRule != TK_PHOTO_COMPOSITE_OVERLAY) {
+ /*
+ * Don't need this when using the OVERLAY compositing rule, which
+ * always strictly increases the valid region.
+ */
+ TkRegion workRgn = TkCreateRegion();
+
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = 1;
+ TkUnionRectWithRegion(&rect, workRgn, workRgn);
+ TkSubtractRegion(masterPtr->validRegion, workRgn,
+ masterPtr->validRegion);
+ TkDestroyRegion(workRgn);
+ }
+
+ destLinePtr = masterPtr->pix24 + (y * masterPtr->width + x) * 4 + 3;
+ for (y1 = 0; y1 < height; y1++) {
+ x1 = 0;
+ destPtr = destLinePtr;
+ while (x1 < width) {
+ /* search for first non-transparent pixel */
+ while ((x1 < width) && !*destPtr) {
+ x1++;
+ destPtr += 4;
+ }
+ end = x1;
+ /* search for first transparent pixel */
+ while ((end < width) && *destPtr) {
+ end++;
+ destPtr += 4;
+ }
+ if (end > x1) {
+ rect.x = x + x1;
+ rect.y = y + y1;
+ rect.width = end - x1;
+ rect.height = 1;
+ TkUnionRectWithRegion(&rect, masterPtr->validRegion,
+ masterPtr->validRegion);
+ }
+ x1 = end;
}
- x1 = end;
+ destLinePtr += masterPtr->width * 4;
}
- destLinePtr += masterPtr->width * 4;
+ } else {
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ TkUnionRectWithRegion(&rect, masterPtr->validRegion,
+ masterPtr->validRegion);
}
- } else {
- rect.x = x;
- rect.y = y;
- rect.width = width;
- rect.height = height;
- TkUnionRectWithRegion(&rect, masterPtr->validRegion,
- masterPtr->validRegion);
- }
/*
* Update each instance.
@@ -4626,8 +5024,10 @@ Tk_PhotoExpand(handle, width, height)
height = masterPtr->height;
}
if ((width != masterPtr->width) || (height != masterPtr->height)) {
- ImgPhotoSetSize(masterPtr, MAX(width, masterPtr->width),
- MAX(height, masterPtr->height));
+ if (ImgPhotoSetSize(masterPtr, MAX(width, masterPtr->width),
+ MAX(height, masterPtr->height)) == TCL_ERROR) {
+ panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
Tk_ImageChanged(masterPtr->tkMaster, 0, 0, 0, 0, masterPtr->width,
masterPtr->height);
}
@@ -4696,8 +5096,10 @@ Tk_PhotoSetSize(handle, width, height)
masterPtr->userWidth = width;
masterPtr->userHeight = height;
- ImgPhotoSetSize(masterPtr, ((width > 0) ? width: masterPtr->width),
- ((height > 0) ? height: masterPtr->height));
+ if (ImgPhotoSetSize(masterPtr, ((width > 0) ? width: masterPtr->width),
+ ((height > 0) ? height: masterPtr->height)) == TCL_ERROR) {
+ panic(TK_PHOTO_ALLOC_FAILURE_MESSAGE);
+ }
Tk_ImageChanged(masterPtr->tkMaster, 0, 0, 0, 0,
masterPtr->width, masterPtr->height);
}
@@ -4705,6 +5107,37 @@ Tk_PhotoSetSize(handle, width, height)
/*
*----------------------------------------------------------------------
*
+ * TkGetPhotoValidRegion --
+ *
+ * This procedure is called to get the part of the photo where
+ * there is valid data. Or, conversely, the part of the photo
+ * which is transparent.
+ *
+ * Results:
+ * A TkRegion value that indicates the current area of the photo
+ * that is valid. This value should not be used after any
+ * modification to the photo image.
+ *
+ * Side Effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkRegion
+TkPhotoGetValidRegion(handle)
+ Tk_PhotoHandle handle; /* Handle for the image whose valid region
+ * is to obtained. */
+{
+ PhotoMaster *masterPtr;
+
+ masterPtr = (PhotoMaster *) handle;
+ return masterPtr->validRegion;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* ImgGetPhoto --
*
* This procedure is called to obtain image data from a photo
@@ -4754,11 +5187,14 @@ ImgGetPhoto(masterPtr, blockPtr, optPtr)
+ blockPtr->pixelSize - 1;
for (x = 0; x < blockPtr->width; x++) {
if (*pixelPtr != 255) {
- alphaOffset = 3; break;
+ alphaOffset = 3;
+ break;
}
pixelPtr += blockPtr->pixelSize;
}
- if (alphaOffset) break;
+ if (alphaOffset) {
+ break;
+ }
}
if (!alphaOffset) {
blockPtr->pixelPtr--;
@@ -5138,13 +5574,13 @@ Tk_CreatePhotoOption(interp, name, proc)
static int
ImgPhotoPostscript(clientData, interp, tkwin, psInfo,
x, y, width, height, prepass)
- ClientData clientData;
- Tcl_Interp *interp;
- Tk_Window tkwin;
- Tk_PostscriptInfo psInfo; /* postscript info */
- int x, y; /* First pixel to output */
- int width, height; /* Width and height of area */
- int prepass;
+ ClientData clientData; /* Handle for the photo image */
+ Tcl_Interp *interp; /* Interpreter */
+ Tk_Window tkwin; /* (unused) */
+ Tk_PostscriptInfo psInfo; /* postscript info */
+ int x, y; /* First pixel to output */
+ int width, height; /* Width and height of area */
+ int prepass; /* (unused) */
{
Tk_PhotoImageBlock block;
@@ -5153,4 +5589,35 @@ ImgPhotoPostscript(clientData, interp, tkwin, psInfo,
return Tk_PostscriptPhoto(interp, &block, psInfo, width, height);
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_PhotoPutBlock_NoComposite, Tk_PhotoPutZoomedBlock_NoComposite --
+ *
+ * These backward-compatability functions just exist to fill slots in
+ * stubs table. For the behaviour of *_NoComposite, refer to the
+ * corresponding function without the extra suffix.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+Tk_PhotoPutBlock_NoComposite(handle, blockPtr, x, y, width, height)
+ Tk_PhotoHandle handle;
+ Tk_PhotoImageBlock *blockPtr;
+ int x, y, width, height;
+{
+ Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height,
+ TK_PHOTO_COMPOSITE_OVERLAY);
+}
+void
+Tk_PhotoPutZoomedBlock_NoComposite(handle, blockPtr, x, y, width, height,
+ zoomX, zoomY, subsampleX, subsampleY)
+ Tk_PhotoHandle handle;
+ Tk_PhotoImageBlock *blockPtr;
+ int x, y, width, height, zoomX, zoomY, subsampleX, subsampleY;
+{
+ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height,
+ zoomX, zoomY, subsampleX, subsampleY, TK_PHOTO_COMPOSITE_OVERLAY);
+}
diff --git a/tk/generic/tkImgUtil.c b/tk/generic/tkImgUtil.c
index 810611ddded..b865c9ca18f 100644
--- a/tk/generic/tkImgUtil.c
+++ b/tk/generic/tkImgUtil.c
@@ -76,4 +76,3 @@ TkAlignImageData(image, alignment, bitOrder)
}
return data;
}
-
diff --git a/tk/generic/tkInitScript.h b/tk/generic/tkInitScript.h
index 0ff30077918..e64c1436be3 100644
--- a/tk/generic/tkInitScript.h
+++ b/tk/generic/tkInitScript.h
@@ -48,12 +48,11 @@
*/
static char initScript[] = "if {[info proc tkInit]==\"\"} {\n\
- proc tkInit {} {\n\
- global tk_library tk_version tk_patchLevel\n\
- rename tkInit {}\n\
- tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\
-}\n\
+ proc tkInit {} {\n\
+ global tk_library tk_version tk_patchLevel\n\
+ rename tkInit {}\n\
+ tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\
+ }\n\
}\n\
tkInit";
-
diff --git a/tk/generic/tkInt.decls b/tk/generic/tkInt.decls
index b4d3d470477..9046efd34b8 100644
--- a/tk/generic/tkInt.decls
+++ b/tk/generic/tkInt.decls
@@ -73,14 +73,14 @@ declare 10 generic {
declare 11 generic {
unsigned long TkCreateBindingProcedure (Tcl_Interp *interp, \
Tk_BindingTable bindingTable, \
- ClientData object, char *eventString, \
+ ClientData object, CONST char *eventString, \
TkBindEvalProc *evalProc, TkBindFreeProc *freeProc, \
ClientData clientData)
}
declare 12 generic {
TkCursor * TkCreateCursorFromData (Tk_Window tkwin, \
- char *source, char *mask, int width, int height, \
+ CONST char *source, CONST char *mask, int width, int height, \
int xHot, int yHot, XColor fg, XColor bg)
}
@@ -92,7 +92,7 @@ declare 13 generic {
declare 14 generic {
Tk_Window TkCreateMainWindow (Tcl_Interp *interp, \
- char *screenName, char *baseName)
+ CONST char *screenName, char *baseName)
}
declare 15 generic {
@@ -178,7 +178,8 @@ declare 32 generic {
}
declare 33 generic {
- char * TkGetDefaultScreenName (Tcl_Interp *interp, char *screenName)
+ CONST84_RETURN char * TkGetDefaultScreenName (Tcl_Interp *interp, \
+ CONST char *screenName)
}
declare 34 generic {
@@ -287,7 +288,7 @@ declare 57 generic {
}
declare 58 generic {
- void TkpDisplayWarning (char *msg, char *title)
+ void TkpDisplayWarning (CONST char *msg, CONST char *title)
}
declare 59 generic {
@@ -328,7 +329,7 @@ declare 67 generic {
}
declare 68 generic {
- TkDisplay * TkpOpenDisplay (char *display_name)
+ TkDisplay * TkpOpenDisplay (CONST char *display_name)
}
declare 69 generic {
@@ -357,7 +358,7 @@ declare 74 generic {
}
declare 75 generic {
- int TkpUseWindow (Tcl_Interp *interp, Tk_Window tkwin, char *string)
+ int TkpUseWindow (Tcl_Interp *interp, Tk_Window tkwin, CONST char *string)
}
declare 76 generic {
@@ -396,10 +397,11 @@ declare 83 generic {
void TkSelPropProc (XEvent *eventPtr)
}
-declare 84 generic {
- void TkSetClassProcs (Tk_Window tkwin, \
- TkClassProcs *procs, ClientData instanceData)
-}
+# Exported publically as Tk_SetClassProcs in 8.4a2
+#declare 84 generic {
+# void TkSetClassProcs (Tk_Window tkwin, \
+# TkClassProcs *procs, ClientData instanceData)
+#}
declare 85 generic {
void TkSetWindowMenuBar (Tcl_Interp *interp, \
@@ -518,91 +520,101 @@ declare 110 generic {
declare 111 generic {
Tcl_Obj * TkpGetSystemDefault (Tk_Window tkwin, \
- char *dbName, char *className)
+ CONST char *dbName, CONST char *className)
}
declare 112 generic {
void TkpMenuThreadInit (void)
}
-declare 113 win {
+declare 113 {mac aqua win} {
void TkClipBox (TkRegion rgn, XRectangle* rect_return)
}
-declare 113 mac {
- void TkClipBox (TkRegion rgn, XRectangle* rect_return)
-}
-
-declare 114 win {
- TkRegion TkCreateRegion (void)
-}
-
-declare 114 mac {
+declare 114 {mac aqua win} {
TkRegion TkCreateRegion (void)
}
-declare 115 win {
- void TkDestroyRegion (TkRegion rgn)
-}
-
-declare 115 mac {
+declare 115 {mac aqua win} {
void TkDestroyRegion (TkRegion rgn)
}
-declare 116 win {
+declare 116 {mac aqua win} {
void TkIntersectRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return)
}
-declare 116 mac {
- void TkIntersectRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return)
-}
-
-declare 117 win {
+declare 117 {mac aqua win} {
int TkRectInRegion (TkRegion rgn, int x, int y, unsigned int width, \
unsigned int height)
}
-declare 117 mac {
- int TkRectInRegion (TkRegion rgn, int x, int y, unsigned int width, \
- unsigned int height)
-}
-
-declare 118 win {
+declare 118 {mac aqua win} {
void TkSetRegion (Display* display, GC gc, TkRegion rgn)
}
-declare 118 mac {
- void TkSetRegion (Display* display, GC gc, TkRegion rgn)
-}
-
-declare 119 win {
+declare 119 {mac aqua win} {
void TkUnionRectWithRegion (XRectangle* rect, \
TkRegion src, TkRegion dr_return)
}
-declare 119 mac {
- void TkUnionRectWithRegion (XRectangle* rect, \
- TkRegion src, TkRegion dr_return)
-}
+# removed duplicate from tkIntPlat table
+#declare 120 mac {
+# void TkGenerateActivateEvents (TkWindow *winPtr, int active)
+#}
-declare 130 mac {
- Window TkGetTransientMaster (TkWindow *winPtr)
+declare 121 {mac aqua} {
+ Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source)
}
-declare 131 mac {
- int TkGenerateButtonEvent (int x, int y, \
- Window window, unsigned int state)
+declare 122 {mac aqua} {
+ void TkpDefineNativeBitmaps (void)
}
-declare 133 mac {
- void TkGenWMDestroyEvent (Tk_Window tkwin)
-}
+# removed duplicate from tkIntPlat table
+#declare 123 mac {
+# unsigned long TkpGetMS (void)
+#}
-declare 134 mac {
- void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
- int width, int height, int flags)
+declare 124 {mac aqua} {
+ Pixmap TkpGetNativeAppBitmap (Display *display, \
+ CONST char *name, int *width, int *height)
}
+# removed duplicates from tkIntPlat table
+#declare 125 mac {
+# void TkPointerDeadWindow (TkWindow *winPtr)
+#}
+#
+#declare 126 mac {
+# void TkpSetCapture (TkWindow *winPtr)
+#}
+#
+#declare 127 mac {
+# void TkpSetCursor (TkpCursor cursor)
+#}
+#
+#declare 128 mac {
+# void TkpWmSetState (TkWindow *winPtr, int state)
+#}
+#
+#declare 130 mac {
+# Window TkGetTransientMaster (TkWindow *winPtr)
+#}
+#
+#declare 131 mac {
+# int TkGenerateButtonEvent (int x, int y, \
+# Window window, unsigned int state)
+#}
+#
+#declare 133 mac {
+# void TkGenWMDestroyEvent (Tk_Window tkwin)
+#}
+#
+#declare 134 mac {
+# void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
+# int width, int height, int flags)
+#}
+
declare 135 generic {
void TkpDrawHighlightBorder (Tk_Window tkwin, GC fgGC, GC bgGC, \
int highlightWidth, Drawable drawable)
@@ -625,6 +637,37 @@ declare 139 generic {
void TkpInitKeymapInfo (TkDisplay *dispPtr)
}
+declare 140 generic {
+ TkRegion TkPhotoGetValidRegion (Tk_PhotoHandle handle)
+}
+
+declare 141 generic {
+ TkWindow ** TkWmStackorderToplevel(TkWindow *parentPtr)
+}
+
+declare 142 generic {
+ void TkFocusFree(TkMainInfo *mainPtr)
+}
+
+declare 143 generic {
+ void TkClipCleanup(TkDisplay *dispPtr)
+}
+
+declare 144 generic {
+ void TkGCCleanup(TkDisplay *dispPtr)
+}
+
+declare 145 {mac win aqua} {
+ void TkSubtractRegion (TkRegion sra, TkRegion srcb, TkRegion dr_return)
+}
+
+declare 146 generic {
+ void TkStylePkgInit (TkMainInfo *mainPtr)
+}
+declare 147 generic {
+ void TkStylePkgFree (TkMainInfo *mainPtr)
+}
+
##############################################################################
# Define the platform specific internal Tcl interface. These functions are
@@ -635,39 +678,57 @@ interface tkIntPlat
#########################
# Unix specific functions
-declare 0 unix {
+declare 0 x11 {
void TkCreateXEventSource (void)
}
-declare 1 unix {
+declare 1 x11 {
void TkFreeWindowId (TkDisplay *dispPtr, Window w)
}
-declare 2 unix {
+declare 2 x11 {
void TkInitXId (TkDisplay *dispPtr)
}
-declare 3 unix {
+declare 3 x11 {
int TkpCmapStressed (Tk_Window tkwin, Colormap colormap)
}
-declare 4 unix {
+declare 4 x11 {
void TkpSync (Display *display)
}
-declare 5 unix {
+declare 5 x11 {
Window TkUnixContainerId (TkWindow *winPtr)
}
-declare 6 unix {
+declare 6 x11 {
int TkUnixDoOneXEvent (Tcl_Time *timePtr)
}
-declare 7 unix {
+declare 7 x11 {
void TkUnixSetMenubar (Tk_Window tkwin, Tk_Window menubar)
}
-
+declare 8 x11 {
+ int TkpScanWindowId (Tcl_Interp *interp, CONST char *string, Window *idPtr)
+}
+
+declare 9 x11 {
+ void TkWmCleanup (TkDisplay *dispPtr)
+}
+
+declare 10 x11 {
+ void TkSendCleanup (TkDisplay *dispPtr)
+}
+
+declare 11 x11 {
+ void TkFreeXId (TkDisplay *dispPtr)
+}
+
+declare 12 x11 {
+ int TkpWmSetState (TkWindow *winPtr, int state)
+}
############################
# Windows specific functions
@@ -693,7 +754,7 @@ declare 5 win {
}
declare 6 win {
- int TkpScanWindowId (Tcl_Interp *interp, char *string, int *idPtr)
+ int TkpScanWindowId (Tcl_Interp *interp, CONST char *string, Window *idPtr)
}
declare 7 win {
@@ -805,7 +866,7 @@ declare 31 win {
declare 32 win {
Tcl_Obj * TkWinGetMenuSystemDefault (Tk_Window tkwin, \
- char *dbName, char *className)
+ CONST char *dbName, CONST char *className)
}
declare 33 win {
@@ -819,23 +880,19 @@ declare 0 mac {
void TkGenerateActivateEvents (TkWindow *winPtr, int active)
}
-declare 1 mac {
- Pixmap TkpCreateNativeBitmap (Display *display, char * source)
-}
-
-declare 2 mac {
- void TkpDefineNativeBitmaps (void)
-}
+# removed duplicates from tkInt table
+#declare 1 mac {
+# Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source)
+#}
+#
+#declare 2 mac {
+# void TkpDefineNativeBitmaps (void)
+#}
declare 3 mac {
unsigned long TkpGetMS (void)
}
-declare 4 mac {
- Pixmap TkpGetNativeAppBitmap (Display *display, \
- char *name, int *width, int *height)
-}
-
declare 5 mac {
void TkPointerDeadWindow (TkWindow *winPtr)
}
@@ -852,22 +909,10 @@ declare 8 mac {
void TkpWmSetState (TkWindow *winPtr, int state)
}
-declare 9 mac {
- int HandleWMEvent (EventRecord *theEvent)
-}
-
declare 10 mac {
void TkAboutDlg (void)
}
-declare 11 mac {
- void TkCreateMacEventSource (void)
-}
-
-declare 12 mac {
- void TkFontList (Tcl_Interp *interp, Display *display)
-}
-
declare 13 mac {
Window TkGetTransientMaster (TkWindow *winPtr)
}
@@ -877,19 +922,15 @@ declare 14 mac {
Window window, unsigned int state)
}
-declare 15 mac {
- int TkGetCharPositions (XFontStruct *font_struct, char *string, \
- int count, short *buffer)
-}
-
declare 16 mac {
void TkGenWMDestroyEvent (Tk_Window tkwin)
}
-declare 17 mac {
- void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
- int width, int height, int flags)
-}
+# removed duplicate from tkPlat table (tk.decls)
+#declare 17 mac {
+# void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
+# int width, int height, int flags)
+#}
declare 18 mac {
unsigned int TkMacButtonKeyState (void)
@@ -899,9 +940,10 @@ declare 19 mac {
void TkMacClearMenubarActive (void)
}
-declare 20 mac {
- int TkMacConvertEvent (EventRecord *eventPtr)
-}
+# removed duplicate from tkPlat table (tk.decls)
+#declare 20 mac {
+# int TkMacConvertEvent (EventRecord *eventPtr)
+#}
declare 21 mac {
int TkMacDispatchMenuEvent (int menuID, int index)
@@ -911,38 +953,32 @@ declare 22 mac {
void TkMacInstallCursor (int resizeOverride)
}
-declare 23 mac {
- int TkMacConvertTkEvent (EventRecord *eventPtr, Window window)
-}
+# removed duplicate from tkPlat table (tk.decls)
+#declare 23 mac {
+# int TkMacConvertTkEvent (EventRecord *eventPtr, Window window)
+#}
declare 24 mac {
void TkMacHandleTearoffMenu (void)
}
-declare 25 mac {
- void tkMacInstallMWConsole (Tcl_Interp *interp)
-}
-
-declare 26 mac {
- void TkMacInvalClipRgns (TkWindow *winPtr)
-}
+# removed duplicate from tkPlat table (tk.decls)
+#declare 26 mac {
+# void TkMacInvalClipRgns (TkWindow *winPtr)
+#}
declare 27 mac {
void TkMacDoHLEvent (EventRecord *theEvent)
}
-declare 28 mac {
- void TkMacFontInfo (Font fontId, short *family, \
- short *style, short *size)
-}
-
declare 29 mac {
Time TkMacGenerateTime (void)
}
-declare 30 mac {
- GWorldPtr TkMacGetDrawablePort (Drawable drawable)
-}
+# removed duplicate from tkPlat table (tk.decls)
+#declare 30 mac {
+# GWorldPtr TkMacGetDrawablePort (Drawable drawable)
+#}
declare 31 mac {
TkWindow * TkMacGetScrollbarGrowWindow (TkWindow *winPtr)
@@ -960,17 +996,18 @@ declare 34 mac {
void TkMacHandleMenuSelect (long mResult, int optionKeyPressed)
}
-declare 35 mac {
- int TkMacHaveAppearance (void)
-}
-
-declare 36 mac {
- void TkMacInitAppleEvents (Tcl_Interp *interp)
-}
-
-declare 37 mac {
- void TkMacInitMenus (Tcl_Interp *interp)
-}
+# removed duplicates from tkPlat table (tk.decls)
+#declare 35 mac {
+# int TkMacHaveAppearance (void)
+#}
+#
+#declare 36 mac {
+# void TkMacInitAppleEvents (Tcl_Interp *interp)
+#}
+#
+#declare 37 mac {
+# void TkMacInitMenus (Tcl_Interp *interp)
+#}
declare 38 mac {
void TkMacInvalidateWindow (MacDrawable *macWin, int flag)
@@ -1000,10 +1037,6 @@ declare 44 mac {
int TkMacResizable (TkWindow *winPtr)
}
-declare 45 mac {
- void TkMacSetEmbedRgn (TkWindow *winPtr, RgnHandle rgn)
-}
-
declare 46 mac {
void TkMacSetHelpMenuItemCount (void)
}
@@ -1044,10 +1077,6 @@ declare 55 mac {
void TkMacWindowOffset (WindowRef wRef, int *xOffset, int *yOffset)
}
-declare 56 mac {
- void TkResumeClipboard (void)
-}
-
declare 57 mac {
int TkSetMacColor (unsigned long pixel, RGBColor *macColor)
}
@@ -1060,10 +1089,6 @@ declare 59 mac {
void TkSuspendClipboard (void)
}
-declare 60 mac {
- int TkWMGrowToplevel (WindowRef whichWindow, Point start)
-}
-
declare 61 mac {
int TkMacZoomToplevel (WindowPtr whichWindow, Point where, short zoomPart)
}
@@ -1081,6 +1106,236 @@ declare 64 mac {
MacDrawable * TkMacGetHostToplevel (TkWindow *winPtr)
}
+declare 65 mac {
+ void TkMacPreprocessMenu (void)
+}
+
+declare 66 mac {
+ int TkpIsWindowFloating (WindowRef window)
+}
+
+########################
+# Mac OS X specific functions
+
+declare 0 aqua {
+ void TkGenerateActivateEvents (TkWindow *winPtr, int active)
+}
+
+# removed duplicates from tkInt table
+#declare 1 aqua {
+# Pixmap TkpCreateNativeBitmap (Display *display, CONST char * source)
+#}
+#
+#declare 2 aqua {
+# void TkpDefineNativeBitmaps (void)
+#}
+
+declare 3 aqua {
+ void TkPointerDeadWindow (TkWindow *winPtr)
+}
+
+declare 4 aqua {
+ void TkpSetCapture (TkWindow *winPtr)
+}
+
+declare 5 aqua {
+ void TkpSetCursor (TkpCursor cursor)
+}
+
+declare 6 aqua {
+ void TkpWmSetState (TkWindow *winPtr, int state)
+}
+
+declare 7 aqua {
+ void TkAboutDlg (void)
+}
+
+declare 8 aqua {
+ unsigned int TkMacOSXButtonKeyState (void)
+}
+
+declare 9 aqua {
+ void TkMacOSXClearMenubarActive (void)
+}
+
+declare 10 aqua {
+ int TkMacOSXDispatchMenuEvent (int menuID, int index)
+}
+
+declare 11 aqua {
+ void TkMacOSXInstallCursor (int resizeOverride)
+}
+
+declare 12 aqua {
+ void TkMacOSXHandleTearoffMenu (void)
+}
+
+# removed duplicate from tkPlat table (tk.decls)
+#declare 13 aqua {
+# void TkMacOSXInvalClipRgns (TkWindow *winPtr)
+#}
+
+declare 14 aqua {
+ int TkMacOSXDoHLEvent (EventRecord *theEvent)
+}
+
+# removed duplicate from tkPlat table (tk.decls)
+#declare 15 aqua {
+# GWorldPtr TkMacOSXGetDrawablePort (Drawable drawable)
+#}
+
+declare 16 aqua {
+ Window TkMacOSXGetXWindow (WindowRef macWinPtr)
+}
+
+declare 17 aqua {
+ int TkMacOSXGrowToplevel (WindowRef whichWindow, Point start)
+}
+
+declare 18 aqua {
+ void TkMacOSXHandleMenuSelect (long mResult, int optionKeyPressed)
+}
+
+# removed duplicates from tkPlat table (tk.decls)
+#declare 19 aqua {
+# void TkMacOSXInitAppleEvents (Tcl_Interp *interp)
+#}
+#
+#declare 20 aqua {
+# void TkMacOSXInitMenus (Tcl_Interp *interp)
+#}
+
+declare 21 aqua {
+ void TkMacOSXInvalidateWindow (MacDrawable *macWin, int flag)
+}
+
+declare 22 aqua {
+ int TkMacOSXIsCharacterMissing (Tk_Font tkfont, unsigned int searchChar)
+}
+
+declare 23 aqua {
+ void TkMacOSXMakeRealWindowExist (TkWindow *winPtr)
+}
+
+declare 24 aqua {
+ BitMapPtr TkMacOSXMakeStippleMap(Drawable d1, Drawable d2)
+}
+
+declare 25 aqua {
+ void TkMacOSXMenuClick (void)
+}
+
+declare 26 aqua {
+ void TkMacOSXRegisterOffScreenWindow (Window window, GWorldPtr portPtr)
+}
+
+declare 27 aqua {
+ int TkMacOSXResizable (TkWindow *winPtr)
+}
+
+declare 28 aqua {
+ void TkMacOSXSetHelpMenuItemCount (void)
+}
+
+declare 29 aqua {
+ void TkMacOSXSetScrollbarGrow (TkWindow *winPtr, int flag)
+}
+
+declare 30 aqua {
+ void TkMacOSXSetUpClippingRgn (Drawable drawable)
+}
+
+declare 31 aqua {
+ void TkMacOSXSetUpGraphicsPort (GC gc, GWorldPtr destPort)
+}
+
+declare 32 aqua {
+ void TkMacOSXUpdateClipRgn (TkWindow *winPtr)
+}
+
+declare 33 aqua {
+ void TkMacOSXUnregisterMacWindow (WindowRef portPtr)
+}
+
+declare 34 aqua {
+ int TkMacOSXUseMenuID (short macID)
+}
+
+declare 35 aqua {
+ RgnHandle TkMacOSXVisableClipRgn (TkWindow *winPtr)
+}
+
+declare 36 aqua {
+ void TkMacOSXWinBounds (TkWindow *winPtr, Rect *geometry)
+}
+
+declare 37 aqua {
+ void TkMacOSXWindowOffset (WindowRef wRef, int *xOffset, int *yOffset)
+}
+
+declare 38 aqua {
+ int TkSetMacColor (unsigned long pixel, RGBColor *macColor)
+}
+
+declare 39 aqua {
+ void TkSetWMName (TkWindow *winPtr, Tk_Uid titleUid)
+}
+
+declare 40 aqua {
+ void TkSuspendClipboard (void)
+}
+
+declare 41 aqua {
+ int TkMacOSXZoomToplevel (WindowPtr whichWindow, Point where, short zoomPart)
+}
+
+declare 42 aqua {
+ Tk_Window Tk_TopCoordsToWindow (Tk_Window tkwin, \
+ int rootX, int rootY, int *newX, int *newY)
+}
+
+declare 43 aqua {
+ MacDrawable * TkMacOSXContainerId (TkWindow *winPtr)
+}
+
+declare 44 aqua {
+ MacDrawable * TkMacOSXGetHostToplevel (TkWindow *winPtr)
+}
+
+declare 45 aqua {
+ void TkMacOSXPreprocessMenu (void)
+}
+
+declare 46 aqua {
+ int TkpIsWindowFloating (WindowRef window)
+}
+
+declare 47 aqua {
+ Tk_Window TkMacOSXGetCapture (void)
+}
+
+declare 49 aqua {
+ Window TkGetTransientMaster (TkWindow *winPtr)
+}
+
+declare 50 aqua {
+ int TkGenerateButtonEvent (int x, int y, \
+ Window window, unsigned int state)
+}
+
+declare 51 aqua {
+ void TkGenWMDestroyEvent (Tk_Window tkwin)
+}
+
+# removed duplicate from tkPlat table (tk.decls)
+#declare 52 aqua {
+# void TkGenWMConfigureEvent (Tk_Window tkwin, int x, int y, \
+# int width, int height, int flags)
+#}
+
+declare 53 aqua {
+ unsigned long TkpGetMS (void)
+}
##############################################################################
@@ -1091,10 +1346,11 @@ interface tkIntXlib
# X functions for Windows
-# This slot is reserved for use by the dash patch:
-# declare 0 win {
-# XSetDashes
-# }
+declare 0 win {
+ void XSetDashes (Display* display, GC gc, int dash_offset,
+ _Xconst char* dash_list, int n)
+}
+
declare 1 win {
XModifierKeymap* XGetModifierMapping (Display* d)
}
@@ -1373,7 +1629,7 @@ declare 61 win {
}
declare 62 win {
- void XSetCommand (Display* d, Window w, char** c, int i)
+ void XSetCommand (Display* d, Window w, CONST char** c, int i)
}
declare 63 win {
@@ -1557,376 +1813,422 @@ declare 103 win {
Status XStringListToTextProperty(char** list, int count, \
XTextProperty* text_prop_return)
}
+declare 104 win {
+ void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \
+ int x2, int y2)
+}
+declare 106 win {
+ void XFillRectangle (Display* display, Drawable d, GC gc, \
+ int x, int y, unsigned int width, unsigned int height)
+}
+declare 105 win {
+ void XWarpPointer (Display* d, Window s, Window dw, int sx, int sy, \
+ unsigned int sw, unsigned int sh, int dx, int dy)
+}
-# X functions for Mac
+# X functions for Mac and Aqua
-# This slot is reserved for use by the dash patch:
-# declare 0 win {
-# XSetDashes
-# }
+declare 0 {mac aqua} {
+ void XSetDashes (Display* display, GC gc, int dash_offset,
+ _Xconst char* dash_list, int n)
+}
-declare 1 mac {
+declare 1 {mac aqua} {
XModifierKeymap* XGetModifierMapping (Display* d)
}
-declare 2 mac {
+declare 2 {mac aqua} {
XImage * XCreateImage (Display* d, Visual* v, unsigned int ui1, int i1, \
int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, \
int i4)
}
-declare 3 mac {
+declare 3 {mac aqua} {
XImage *XGetImage (Display* d, Drawable dr, int i1, int i2, \
unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)
}
-declare 4 mac {
+declare 4 {mac aqua} {
char *XGetAtomName (Display* d,Atom a)
}
-declare 5 mac {
+declare 5 {mac aqua} {
char *XKeysymToString (KeySym k)
}
-declare 6 mac {
+declare 6 {mac aqua} {
Colormap XCreateColormap (Display* d, Window w, Visual* v, int i)
}
-declare 7 mac {
+declare 7 {mac aqua} {
GContext XGContextFromGC (GC g)
}
-declare 8 mac {
+declare 8 {mac aqua} {
KeySym XKeycodeToKeysym (Display* d, KeyCode k, int i)
}
-declare 9 mac {
+declare 9 {mac aqua} {
KeySym XStringToKeysym (_Xconst char* c)
}
-declare 10 mac {
+declare 10 {mac aqua} {
Window XRootWindow (Display* d, int i)
}
-declare 11 mac {
+declare 11 {mac aqua} {
XErrorHandler XSetErrorHandler (XErrorHandler x)
}
-declare 12 mac {
+declare 12 {mac aqua} {
Status XAllocColor (Display* d, Colormap c, XColor* xp)
}
-declare 13 mac {
+declare 13 {mac aqua} {
void XBell (Display* d, int i)
}
-declare 14 mac {
- void XChangeProperty (Display* d, Window w, Atom a, Atom a, int i1, \
+declare 14 {mac aqua} {
+ void XChangeProperty (Display* d, Window w, Atom a1, Atom a2, int i1, \
int i2, _Xconst unsigned char* c, int i3)
}
-declare 15 mac {
+declare 15 {mac aqua} {
void XChangeWindowAttributes (Display* d, Window w, unsigned long ul, \
XSetWindowAttributes* x)
}
-declare 16 mac {
+declare 16 {mac aqua} {
void XConfigureWindow (Display* d, Window w, unsigned int i, \
XWindowChanges* x)
}
-declare 17 mac {
+declare 17 {mac aqua} {
void XCopyArea (Display* d, Drawable dr1, Drawable dr2, GC g, int i1, \
int i2, unsigned int ui1, \
unsigned int ui2, int i3, int i4)
}
-declare 18 mac {
+declare 18 {mac aqua} {
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)
}
-declare 19 mac {
+declare 19 {mac aqua} {
Pixmap XCreateBitmapFromData(Display* display, Drawable d, \
_Xconst char* data, unsigned int width,unsigned int height)
}
-declare 20 mac {
+declare 20 {mac aqua} {
void XDefineCursor (Display* d, Window w, Cursor c)
}
-declare 21 mac {
+declare 21 {mac aqua} {
void XDestroyWindow (Display* d, Window w)
}
-declare 22 mac {
+declare 22 {mac aqua} {
void XDrawArc (Display* d, Drawable dr, GC g, int i1, int i2, \
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-declare 23 mac {
+declare 23 {mac aqua} {
void XDrawLines (Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)
}
-declare 24 mac {
+declare 24 {mac aqua} {
void XDrawRectangle (Display* d, Drawable dr, GC g, int i1, int i2,\
unsigned int ui1, unsigned int ui2)
}
-declare 25 mac {
+declare 25 {mac aqua} {
void XFillArc (Display* d, Drawable dr, GC g, int i1, int i2, \
unsigned int ui1, unsigned int ui2, int i3, int i4)
}
-declare 26 mac {
+declare 26 {mac aqua} {
void XFillPolygon (Display* d, Drawable dr, GC g, XPoint* x, \
int i1, int i2, int i3)
}
-declare 27 mac {
+declare 27 {mac aqua} {
void XFillRectangles (Display* d, Drawable dr, GC g, XRectangle* x, int i)
}
-declare 28 mac {
+declare 28 {mac aqua} {
void XFreeColormap (Display* d, Colormap c)
}
-declare 29 mac {
+declare 29 {mac aqua} {
void XFreeColors (Display* d, Colormap c, \
unsigned long* ulp, int i, unsigned long ul)
}
-declare 30 mac {
+declare 30 {mac aqua} {
void XFreeModifiermap (XModifierKeymap* x)
}
-declare 31 mac {
+declare 31 {mac aqua} {
Status XGetGeometry (Display* d, Drawable dr, Window* w, int* i1, \
int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, \
unsigned int* ui4)
}
-declare 32 mac {
+declare 32 {mac aqua} {
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)
}
-declare 33 mac {
+declare 33 {mac aqua} {
int XGrabKeyboard (Display* d, Window w, Bool b, int i1, int i2, Time t)
}
-declare 34 mac {
+declare 34 {mac aqua} {
int XGrabPointer (Display* d, Window w1, Bool b, unsigned int ui, \
int i1, int i2, Window w2, Cursor c, Time t)
}
-declare 35 mac {
+declare 35 {mac aqua} {
KeyCode XKeysymToKeycode (Display* d, KeySym k)
}
-declare 36 mac {
+declare 36 {mac aqua} {
void XMapWindow (Display* d, Window w)
}
-declare 37 mac {
+declare 37 {mac aqua} {
void XMoveResizeWindow (Display* d, Window w, int i1, int i2, \
unsigned int ui1, unsigned int ui2)
}
-declare 38 mac {
+declare 38 {mac aqua} {
void XMoveWindow (Display* d, Window w, int i1, int i2)
}
-declare 39 mac {
+declare 39 {mac aqua} {
Bool XQueryPointer (Display* d, Window w1, Window* w2, Window* w3, \
int* i1, int* i2, int* i3, int* i4, unsigned int* ui)
}
-declare 40 mac {
+declare 40 {mac aqua} {
void XRaiseWindow (Display* d, Window w)
}
-declare 41 mac {
+declare 41 {mac aqua} {
void XRefreshKeyboardMapping (XMappingEvent* x)
}
-declare 42 mac {
+declare 42 {mac aqua} {
void XResizeWindow (Display* d, Window w, unsigned int ui1, \
unsigned int ui2)
}
-declare 43 mac {
+declare 43 {mac aqua} {
void XSelectInput (Display* d, Window w, long l)
}
-declare 44 mac {
+declare 44 {mac aqua} {
Status XSendEvent (Display* d, Window w, Bool b, long l, XEvent* x)
}
-declare 45 mac {
+declare 45 {mac aqua} {
void XSetIconName (Display* d, Window w, _Xconst char* c)
}
-declare 46 mac {
+declare 46 {mac aqua} {
void XSetInputFocus (Display* d, Window w, int i, Time t)
}
-declare 47 mac {
+declare 47 {mac aqua} {
void XSetSelectionOwner (Display* d, Atom a, Window w, Time t)
}
-declare 48 mac {
+declare 48 {mac aqua} {
void XSetWindowBackground (Display* d, Window w, unsigned long ul)
}
-declare 49 mac {
+declare 49 {mac aqua} {
void XSetWindowBackgroundPixmap (Display* d, Window w, Pixmap p)
}
-declare 50 mac {
+declare 50 {mac aqua} {
void XSetWindowBorder (Display* d, Window w, unsigned long ul)
}
-declare 51 mac {
+declare 51 {mac aqua} {
void XSetWindowBorderPixmap (Display* d, Window w, Pixmap p)
}
-declare 52 mac {
+declare 52 {mac aqua} {
void XSetWindowBorderWidth (Display* d, Window w, unsigned int ui)
}
-declare 53 mac {
+declare 53 {mac aqua} {
void XSetWindowColormap (Display* d, Window w, Colormap c)
}
-declare 54 mac {
+declare 54 {mac aqua} {
void XUngrabKeyboard (Display* d, Time t)
}
-declare 55 mac {
+declare 55 {mac aqua} {
void XUngrabPointer (Display* d, Time t)
}
-declare 56 mac {
+declare 56 {mac aqua} {
void XUnmapWindow (Display* d, Window w)
}
-declare 57 mac {
+declare 57 {mac aqua} {
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)
}
-declare 58 mac {
+declare 58 {mac aqua} {
Status XParseColor (Display *display, Colormap map, \
_Xconst char* spec, XColor *colorPtr)
}
-declare 59 mac {
+declare 59 {mac aqua} {
GC XCreateGC(Display* display, Drawable d, \
unsigned long valuemask, XGCValues* values)
}
-declare 60 mac {
+declare 60 {mac aqua} {
void XFreeGC(Display* display, GC gc)
}
-declare 61 mac {
+declare 61 {mac aqua} {
Atom XInternAtom(Display* display,_Xconst char* atom_name, \
Bool only_if_exists)
}
-declare 62 mac {
+declare 62 {mac aqua} {
void XSetBackground(Display* display, GC gc, \
unsigned long foreground)
}
-declare 63 mac {
+declare 63 {mac aqua} {
void XSetForeground(Display* display, GC gc, \
unsigned long foreground)
}
-declare 64 mac {
+declare 64 {mac aqua} {
void XSetClipMask(Display* display, GC gc, Pixmap pixmap)
}
-declare 65 mac {
+declare 65 {mac aqua} {
void XSetClipOrigin(Display* display, GC gc, \
int clip_x_origin, int clip_y_origin)
}
-declare 66 mac {
+declare 66 {mac aqua} {
void XSetTSOrigin(Display* display, GC gc, \
int ts_x_origin, int ts_y_origin)
}
-declare 67 mac {
+declare 67 {mac aqua} {
void XChangeGC(Display * d, GC gc, unsigned long mask, XGCValues *values)
}
-declare 68 mac {
+declare 68 {mac aqua} {
void XSetFont(Display *display, GC gc, Font font)
}
-declare 69 mac {
+declare 69 {mac aqua} {
void XSetArcMode(Display *display, GC gc, int arc_mode)
}
-declare 70 mac {
+declare 70 {mac aqua} {
void XSetStipple(Display *display, GC gc, Pixmap stipple)
}
-declare 71 mac {
+declare 71 {mac aqua} {
void XSetFillRule(Display *display, GC gc, int fill_rule)
}
-declare 72 mac {
+declare 72 {mac aqua} {
void XSetFillStyle(Display *display, GC gc, int fill_style)
}
-declare 73 mac {
+declare 73 {mac aqua} {
void XSetFunction(Display *display, GC gc, int function)
}
-declare 74 mac {
+declare 74 {mac aqua} {
void XSetLineAttributes(Display *display, GC gc, \
unsigned int line_width, int line_style, \
int cap_style, int join_style)
}
-declare 75 mac {
+declare 75 {mac aqua} {
int _XInitImageFuncPtrs(XImage *image)
}
-declare 76 mac {
+declare 76 {mac aqua} {
XIC XCreateIC(void)
}
-declare 77 mac {
+declare 77 {mac aqua} {
XVisualInfo *XGetVisualInfo(Display* display, long vinfo_mask, \
XVisualInfo* vinfo_template, int* nitems_return)
}
-declare 78 mac {
+declare 78 {mac aqua} {
void XSetWMClientMachine(Display* display, Window w, \
XTextProperty* text_prop)
}
-declare 79 mac {
+declare 79 {mac aqua} {
Status XStringListToTextProperty(char** list, int count, \
XTextProperty* text_prop_return)
}
-declare 80 mac {
+declare 80 {mac aqua} {
void XDrawSegments(Display *display, Drawable d, GC gc, \
XSegment *segments, int nsegments)
}
-declare 81 mac {
+declare 81 {mac aqua} {
void XForceScreenSaver(Display* display, int mode)
}
+declare 82 {mac aqua} {
+ void XDrawLine (Display* d, Drawable dr, GC g, int x1, int y1, \
+ int x2, int y2)
+}
+declare 83 {mac aqua} {
+ void XFillRectangle (Display* display, Drawable d, GC gc, \
+ int x, int y, unsigned int width, unsigned int height)
+}
+declare 84 {mac aqua} {
+ void XClearWindow (Display* d, Window w)
+}
+declare 85 {mac aqua} {
+ void XDrawPoint (Display* display, Drawable d, GC gc, int x, int y)
+}
+
+declare 86 {mac aqua} {
+ void XDrawPoints (Display* display, Drawable d, GC gc, XPoint *points, \
+ int npoints, int mode)
+}
+
+declare 87 {mac aqua} {
+ void XWarpPointer (Display* display, Window src_w, Window dest_w, \
+ int src_x, int src_y, unsigned int src_width, \
+ unsigned int src_height, int dest_x, int dest_y)
+}
+
+declare 88 {mac aqua} {
+ void XQueryColor (Display *display, Colormap colormap, XColor *def_in_out)
+}
+
+declare 89 {mac aqua} {
+ void XQueryColors (Display *display, Colormap colormap, \
+ XColor *defs_in_out, int ncolors)
+}
diff --git a/tk/generic/tkInt.h b/tk/generic/tkInt.h
index 1164edd4b1c..f51496483ec 100644
--- a/tk/generic/tkInt.h
+++ b/tk/generic/tkInt.h
@@ -46,32 +46,6 @@ typedef int (TkBindEvalProc) _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, XEvent *eventPtr, Tk_Window tkwin,
KeySym keySym));
typedef void (TkBindFreeProc) _ANSI_ARGS_((ClientData clientData));
-typedef Window (TkClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin,
- Window parent, ClientData instanceData));
-typedef void (TkClassGeometryProc) _ANSI_ARGS_((ClientData instanceData));
-typedef void (TkClassModalProc) _ANSI_ARGS_((Tk_Window tkwin,
- XEvent *eventPtr));
-
-
-/*
- * Widget class procedures used to implement platform specific widget
- * behavior.
- */
-
-typedef struct TkClassProcs {
- TkClassCreateProc *createProc;
- /* Procedure to invoke when the
- platform-dependent window needs to be
- created. */
- TkClassGeometryProc *geometryProc;
- /* Procedure to invoke when the geometry of a
- window needs to be recalculated as a result
- of some change in the system. */
- TkClassModalProc *modalProc;
- /* Procedure to invoke after all bindings on a
- widget have been triggered in order to
- handle a modal loop. */
-} TkClassProcs;
/*
* One of the following structures is maintained for each cursor in
@@ -108,6 +82,31 @@ typedef struct TkCursor {
} TkCursor;
/*
+ * 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
+
+/*
+ * The following structure is kept one-per-TkDisplay to maintain information
+ * about the caret (cursor location) on this display. This is used to
+ * dictate global focus location (Windows Accessibility guidelines) and to
+ * position the IME or XIM over-the-spot window.
+ */
+
+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
@@ -395,6 +394,7 @@ typedef struct TkDisplay {
Atom applicationAtom; /* Atom for TK_APPLICATION. */
Atom windowAtom; /* Atom for TK_WINDOW. */
Atom clipboardAtom; /* Atom for CLIPBOARD. */
+ Atom utf8Atom; /* Atom for UTF8_STRING. */
Tk_Window clipWindow; /* Window used for clipboard ownership and to
* retrieve selections between processes. NULL
@@ -438,19 +438,15 @@ typedef struct TkDisplay {
/* 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
+ Tcl_TimerToken idCleanupScheduled;
+ /* If set, it means a call to WindowIdCleanup
+ * has already been scheduled, 0 means it
* hasn't. */
/*
* Information used by tkUnixWm.c and tkWinWm.c only:
*/
- 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. */
struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */
struct TkWmInfo *foregroundWmPtr;
/* Points to the foreground window. */
@@ -481,6 +477,9 @@ typedef struct TkDisplay {
#ifdef TK_USE_INPUT_METHODS
XIM inputMethod; /* Input method for this display */
+#if TK_XIM_SPOT
+ XFontSet inputXfs; /* XFontSet cached for over-the-spot XIM. */
+#endif
#endif /* TK_USE_INPUT_METHODS */
Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
@@ -494,14 +493,41 @@ typedef struct TkDisplay {
*/
int mouseButtonState; /* current mouse button state for this
* display */
- int warpInProgress;
Window warpWindow;
int warpX;
int warpY;
- int useInputMethods; /* Whether to use input methods */
+
+ /*
+ * The following field(s) were all added for Tk8.4
+ */
+ long deletionEpoch; /* Incremented by window deletions */
+ 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. */
} TkDisplay;
/*
+ * Flag values for TkDisplay flags.
+ * TK_DISPLAY_COLLAPSE_MOTION_EVENTS: (default on)
+ * Indicates that we should collapse motion events on this display
+ * TK_DISPLAY_USE_IM: (default on, set via tk.tcl)
+ * Whether to use input methods for this display
+ * TK_DISPLAY_XIM_SPOT: (default off)
+ * Indicates that we should use over-the-spot XIM on this display
+ * TK_DISPLAY_WM_TRACING: (default off)
+ * Whether we should do wm tracing on this display.
+ * TK_DISPLAY_IN_WARP: (default off)
+ * Indicates that we are in a pointer warp
+ */
+
+#define TK_DISPLAY_COLLAPSE_MOTION_EVENTS (1 << 0)
+#define TK_DISPLAY_USE_IM (1 << 1)
+#define TK_DISPLAY_XIM_SPOT (1 << 2)
+#define TK_DISPLAY_WM_TRACING (1 << 3)
+#define TK_DISPLAY_IN_WARP (1 << 4)
+
+/*
* One of the following structures exists for each error handler
* created by a call to Tk_CreateErrorHandler. The structure
* is managed by tkError.c.
@@ -537,8 +563,6 @@ typedef struct TkErrorHandler {
} TkErrorHandler;
-
-
/*
* One of the following structures exists for each event handler
* created by calling Tk_CreateEventHandler. This information
@@ -619,7 +643,7 @@ typedef struct TkMainInfo {
*/
typedef struct {
- char *source; /* Bits for bitmap. */
+ CONST char *source; /* Bits for bitmap. */
int width, height; /* Dimensions of bitmap. */
int native; /* 0 means generic (X style) bitmap,
* 1 means native style bitmap. */
@@ -720,7 +744,7 @@ typedef struct TkWindow {
* declared for this window, or
* NULL if none. */
#ifdef TK_USE_INPUT_METHODS
- XIC inputContext; /* Input context (for input methods). */
+ XIC inputContext; /* XIM input context. */
#endif /* TK_USE_INPUT_METHODS */
/*
@@ -763,10 +787,12 @@ typedef struct TkWindow {
* Tk_GeometryRequest, or 0's if
* Tk_GeometryRequest hasn't been
* called. */
- int internalBorderWidth; /* Width of internal border of window
+ int internalBorderLeft; /* Width of internal border of window
* (0 means no internal border). Geometry
* managers should not normally place children
- * on top of the border. */
+ * on top of the border.
+ * Fields for the other three sides are found
+ * below. */
/*
* Information maintained by tkWm.c for window manager communication.
@@ -782,7 +808,7 @@ typedef struct TkWindow {
* Information used by widget classes.
*/
- TkClassProcs *classProcsPtr;
+ Tk_ClassProcs *classProcsPtr;
ClientData instanceData;
/*
@@ -790,6 +816,18 @@ typedef struct TkWindow {
*/
struct TkWindowPrivate *privatePtr;
+
+ /*
+ * More information used by tkGeometry.c for geometry management.
+ */
+
+ /* The remaining fields of internal border. */
+ int internalBorderRight;
+ int internalBorderTop;
+ int internalBorderBottom;
+
+ int minReqWidth; /* Minimum requested width. */
+ int minReqHeight; /* Minimum requested height. */
} TkWindow;
/*
@@ -860,6 +898,19 @@ extern TkDisplay *tkDisplayList;
#define ALT_MASK (AnyModifier<<2)
/*
+ * Object types not declared in tkObj.c need to be mentioned here so
+ * they can be properly registered with Tcl:
+ */
+
+extern Tcl_ObjType tkBorderObjType;
+extern Tcl_ObjType tkBitmapObjType;
+extern Tcl_ObjType tkColorObjType;
+extern Tcl_ObjType tkCursorObjType;
+extern Tcl_ObjType tkFontObjType;
+extern Tcl_ObjType tkOptionObjType;
+extern Tcl_ObjType tkStateKeyObjType;
+
+/*
* Miscellaneous variables shared among Tk modules but not exported
* to the outside world:
*/
@@ -887,25 +938,28 @@ extern int tkSendSerial;
* to the outside world:
*/
-EXTERN int Tk_AfterCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
EXTERN int Tk_BellObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_BindCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_BindtagsCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_BindObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+EXTERN int Tk_BindtagsObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_ButtonObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
EXTERN int Tk_CanvasObjCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, Tcl_Obj *CONST objv[]));
-EXTERN int Tk_CheckbuttonObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int argc,
+ Tcl_Obj *CONST objv[]));
+EXTERN int Tk_CheckbuttonObjCmd _ANSI_ARGS_((
+ ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_ClipboardCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_ClipboardObjCmd _ANSI_ARGS_((
+ ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[]));
EXTERN int Tk_ChooseColorObjCmd _ANSI_ARGS_((
ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[]));
@@ -935,22 +989,29 @@ EXTERN int Tk_FocusObjCmd _ANSI_ARGS_((ClientData clientData,
EXTERN int Tk_FontObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_GetOpenFileObjCmd _ANSI_ARGS_((ClientData clientData,
+EXTERN int Tk_GetOpenFileObjCmd _ANSI_ARGS_((
+ ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_GetSaveFileObjCmd _ANSI_ARGS_((ClientData clientData,
+EXTERN int Tk_GetSaveFileObjCmd _ANSI_ARGS_((
+ ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_GrabCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_GridCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_GrabObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+EXTERN int Tk_GridObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_ImageObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
EXTERN int Tk_LabelObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
+EXTERN int Tk_LabelframeObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_ListboxObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
@@ -963,16 +1024,24 @@ EXTERN int Tk_MenubuttonObjCmd _ANSI_ARGS_((ClientData clientData,
EXTERN int Tk_MessageBoxObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_MessageCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_MessageObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+EXTERN int Tk_PanedWindowObjCmd _ANSI_ARGS_((
+ ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_OptionObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_PackCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_PlaceCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_RadiobuttonObjCmd _ANSI_ARGS_((ClientData clientData,
+EXTERN int Tk_PackObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+EXTERN int Tk_PlaceObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+EXTERN int Tk_RadiobuttonObjCmd _ANSI_ARGS_((
+ ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
EXTERN int Tk_RaiseObjCmd _ANSI_ARGS_((ClientData clientData,
@@ -982,21 +1051,26 @@ EXTERN int Tk_ScaleObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
EXTERN int Tk_ScrollbarCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-EXTERN int Tk_SelectionCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
+EXTERN int Tk_SelectionObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_SendCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int Tk_SendObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
+EXTERN int Tk_SpinboxObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_TextCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int Tk_TkObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_TkwaitCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_TkwaitObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_ToplevelObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
@@ -1006,20 +1080,23 @@ EXTERN int Tk_UpdateObjCmd _ANSI_ARGS_((ClientData clientData,
EXTERN int Tk_WinfoObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_WmCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_WmObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
-void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
- int devId, char *buffer, long size));
+EXTERN void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
+ int devId, CONST char *buffer, long size));
EXTERN void TkEventInit _ANSI_ARGS_((void));
+EXTERN void TkRegisterObjTypes _ANSI_ARGS_((void));
+
EXTERN int TkCreateMenuCmd _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int TkDeadAppCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkpTestembedCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkCanvasGetCoordObj _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, Tcl_Obj *obj,
double *doublePtr));
@@ -1034,6 +1111,9 @@ EXTERN char * TkCanvasDashPrintProc _ANSI_ARGS_((
EXTERN int TkGetDoublePixels _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Window tkwin, CONST char *string,
double *doublePtr));
+EXTERN CONST Tk_OptionSpec *
+ TkGetOptionSpec _ANSI_ARGS_((CONST char *name,
+ Tk_OptionTable optionTable));
EXTERN int TkOffsetParseProc _ANSI_ARGS_((
ClientData clientData, Tcl_Interp *interp,
Tk_Window tkwin, CONST char *value, char *widgRec,
@@ -1089,17 +1169,9 @@ EXTERN char * TkTilePrintProc _ANSI_ARGS_((
* Unsupported commands.
*/
EXTERN int TkUnsupported1Cmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
-
-/* CYGNUS LOCAL. */
-EXTERN void TkRegisterColorGC _ANSI_ARGS_((XColor *, Display *,
- GC, unsigned long));
-EXTERN void TkDeregisterColorGC _ANSI_ARGS_((XColor *, GC,
- unsigned long));
+ Tcl_Interp *interp, int argc, CONST char **argv));
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKINT */
-
-
diff --git a/tk/generic/tkIntDecls.h b/tk/generic/tkIntDecls.h
index 0e37d59f8b1..51c14910512 100644
--- a/tk/generic/tkIntDecls.h
+++ b/tk/generic/tkIntDecls.h
@@ -71,22 +71,22 @@ EXTERN int TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp * interp,
EXTERN unsigned long TkCreateBindingProcedure _ANSI_ARGS_((
Tcl_Interp * interp,
Tk_BindingTable bindingTable,
- ClientData object, char * eventString,
+ ClientData object, CONST char * eventString,
TkBindEvalProc * evalProc,
TkBindFreeProc * freeProc,
ClientData clientData));
/* 12 */
EXTERN TkCursor * TkCreateCursorFromData _ANSI_ARGS_((Tk_Window tkwin,
- char * source, char * mask, int width,
- int height, int xHot, int yHot, XColor fg,
- XColor bg));
+ CONST char * source, CONST char * mask,
+ int width, int height, int xHot, int yHot,
+ XColor fg, XColor bg));
/* 13 */
EXTERN int TkCreateFrame _ANSI_ARGS_((ClientData clientData,
Tcl_Interp * interp, int argc, char ** argv,
int toplevel, char * appName));
/* 14 */
EXTERN Tk_Window TkCreateMainWindow _ANSI_ARGS_((Tcl_Interp * interp,
- char * screenName, char * baseName));
+ CONST char * screenName, char * baseName));
/* 15 */
EXTERN Time TkCurrentTime _ANSI_ARGS_((TkDisplay * dispPtr));
/* 16 */
@@ -141,8 +141,8 @@ EXTERN void TkGetButtPoints _ANSI_ARGS_((double p1[],
EXTERN TkCursor * TkGetCursorByName _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, Tk_Uid string));
/* 33 */
-EXTERN char * TkGetDefaultScreenName _ANSI_ARGS_((
- Tcl_Interp * interp, char * screenName));
+EXTERN CONST84_RETURN char * TkGetDefaultScreenName _ANSI_ARGS_((
+ Tcl_Interp * interp, CONST char * screenName));
/* 34 */
EXTERN TkDisplay * TkGetDisplay _ANSI_ARGS_((Display * display));
/* 35 */
@@ -214,8 +214,8 @@ EXTERN void TkpCloseDisplay _ANSI_ARGS_((TkDisplay * dispPtr));
EXTERN void TkpClaimFocus _ANSI_ARGS_((TkWindow * topLevelPtr,
int force));
/* 58 */
-EXTERN void TkpDisplayWarning _ANSI_ARGS_((char * msg,
- char * title));
+EXTERN void TkpDisplayWarning _ANSI_ARGS_((CONST char * msg,
+ CONST char * title));
/* 59 */
EXTERN void TkpGetAppName _ANSI_ARGS_((Tcl_Interp * interp,
Tcl_DString * name));
@@ -241,7 +241,8 @@ EXTERN Window TkpMakeWindow _ANSI_ARGS_((TkWindow * winPtr,
EXTERN void TkpMenuNotifyToplevelCreate _ANSI_ARGS_((
Tcl_Interp * interp1, char * menuName));
/* 68 */
-EXTERN TkDisplay * TkpOpenDisplay _ANSI_ARGS_((char * display_name));
+EXTERN TkDisplay * TkpOpenDisplay _ANSI_ARGS_((
+ CONST char * display_name));
/* 69 */
EXTERN int TkPointerEvent _ANSI_ARGS_((XEvent * eventPtr,
TkWindow * winPtr));
@@ -262,7 +263,7 @@ EXTERN void TkpSetMainMenubar _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, char * menuName));
/* 75 */
EXTERN int TkpUseWindow _ANSI_ARGS_((Tcl_Interp * interp,
- Tk_Window tkwin, char * string));
+ Tk_Window tkwin, CONST char * string));
/* 76 */
EXTERN int TkpWindowWasRecentlyDeleted _ANSI_ARGS_((Window win,
TkDisplay * dispPtr));
@@ -289,10 +290,7 @@ EXTERN void TkSelEventProc _ANSI_ARGS_((Tk_Window tkwin,
EXTERN void TkSelInit _ANSI_ARGS_((Tk_Window tkwin));
/* 83 */
EXTERN void TkSelPropProc _ANSI_ARGS_((XEvent * eventPtr));
-/* 84 */
-EXTERN void TkSetClassProcs _ANSI_ARGS_((Tk_Window tkwin,
- TkClassProcs * procs,
- ClientData instanceData));
+/* Slot 84 is reserved */
/* 85 */
EXTERN void TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Window tkwin, char * oldMenuName,
@@ -367,7 +365,7 @@ EXTERN void TkpGetSubFonts _ANSI_ARGS_((Tcl_Interp * interp,
Tk_Font tkfont));
/* 111 */
EXTERN Tcl_Obj * TkpGetSystemDefault _ANSI_ARGS_((Tk_Window tkwin,
- char * dbName, char * className));
+ CONST char * dbName, CONST char * className));
/* 112 */
EXTERN void TkpMenuThreadInit _ANSI_ARGS_((void));
#ifdef __WIN32__
@@ -380,6 +378,11 @@ EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
XRectangle* rect_return));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 113 */
+EXTERN void TkClipBox _ANSI_ARGS_((TkRegion rgn,
+ XRectangle* rect_return));
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
/* 114 */
EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
@@ -388,6 +391,10 @@ EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
/* 114 */
EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 114 */
+EXTERN TkRegion TkCreateRegion _ANSI_ARGS_((void));
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
/* 115 */
EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
@@ -396,6 +403,10 @@ EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
/* 115 */
EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 115 */
+EXTERN void TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
/* 116 */
EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
@@ -406,6 +417,11 @@ EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
TkRegion srcb, TkRegion dr_return));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 116 */
+EXTERN void TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
+ TkRegion srcb, TkRegion dr_return));
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
/* 117 */
EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x,
@@ -418,6 +434,12 @@ EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x,
int y, unsigned int width,
unsigned int height));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 117 */
+EXTERN int TkRectInRegion _ANSI_ARGS_((TkRegion rgn, int x,
+ int y, unsigned int width,
+ unsigned int height));
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
/* 118 */
EXTERN void TkSetRegion _ANSI_ARGS_((Display* display, GC gc,
@@ -428,6 +450,11 @@ EXTERN void TkSetRegion _ANSI_ARGS_((Display* display, GC gc,
EXTERN void TkSetRegion _ANSI_ARGS_((Display* display, GC gc,
TkRegion rgn));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 118 */
+EXTERN void TkSetRegion _ANSI_ARGS_((Display* display, GC gc,
+ TkRegion rgn));
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
/* 119 */
EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle* rect,
@@ -438,67 +465,51 @@ EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle* rect,
EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle* rect,
TkRegion src, TkRegion dr_return));
#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 120 */
-EXTERN void TkGenerateActivateEvents _ANSI_ARGS_((
- TkWindow * winPtr, int active));
-#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 119 */
+EXTERN void TkUnionRectWithRegion _ANSI_ARGS_((XRectangle* rect,
+ TkRegion src, TkRegion dr_return));
+#endif /* MAC_OSX_TK */
+/* Slot 120 is reserved */
#ifdef MAC_TCL
/* 121 */
EXTERN Pixmap TkpCreateNativeBitmap _ANSI_ARGS_((Display * display,
- char * source));
+ CONST char * source));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 121 */
+EXTERN Pixmap TkpCreateNativeBitmap _ANSI_ARGS_((Display * display,
+ CONST char * source));
+#endif /* MAC_OSX_TK */
#ifdef MAC_TCL
/* 122 */
EXTERN void TkpDefineNativeBitmaps _ANSI_ARGS_((void));
#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 123 */
-EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void));
-#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 122 */
+EXTERN void TkpDefineNativeBitmaps _ANSI_ARGS_((void));
+#endif /* MAC_OSX_TK */
+/* Slot 123 is reserved */
#ifdef MAC_TCL
/* 124 */
EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((Display * display,
CONST char * name, int * width, int * height));
#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 125 */
-EXTERN void TkPointerDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 126 */
-EXTERN void TkpSetCapture _ANSI_ARGS_((TkWindow * winPtr));
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 127 */
-EXTERN void TkpSetCursor _ANSI_ARGS_((TkpCursor cursor));
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 128 */
-EXTERN void TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
- int state));
-#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 124 */
+EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((Display * display,
+ CONST char * name, int * width, int * height));
+#endif /* MAC_OSX_TK */
+/* Slot 125 is reserved */
+/* Slot 126 is reserved */
+/* Slot 127 is reserved */
+/* Slot 128 is reserved */
/* Slot 129 is reserved */
-#ifdef MAC_TCL
-/* 130 */
-EXTERN Window TkGetTransientMaster _ANSI_ARGS_((TkWindow * winPtr));
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 131 */
-EXTERN int TkGenerateButtonEvent _ANSI_ARGS_((int x, int y,
- Window window, unsigned int state));
-#endif /* MAC_TCL */
+/* Slot 130 is reserved */
+/* Slot 131 is reserved */
/* Slot 132 is reserved */
-#ifdef MAC_TCL
-/* 133 */
-EXTERN void TkGenWMDestroyEvent _ANSI_ARGS_((Tk_Window tkwin));
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-/* 134 */
-EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin,
- int x, int y, int width, int height,
- int flags));
-#endif /* MAC_TCL */
+/* Slot 133 is reserved */
+/* Slot 134 is reserved */
/* 135 */
EXTERN void TkpDrawHighlightBorder _ANSI_ARGS_((Tk_Window tkwin,
GC fgGC, GC bgGC, int highlightWidth,
@@ -514,6 +525,37 @@ EXTERN KeySym TkpGetKeySym _ANSI_ARGS_((TkDisplay * dispPtr,
XEvent * eventPtr));
/* 139 */
EXTERN void TkpInitKeymapInfo _ANSI_ARGS_((TkDisplay * dispPtr));
+/* 140 */
+EXTERN TkRegion TkPhotoGetValidRegion _ANSI_ARGS_((
+ Tk_PhotoHandle handle));
+/* 141 */
+EXTERN TkWindow ** TkWmStackorderToplevel _ANSI_ARGS_((
+ TkWindow * parentPtr));
+/* 142 */
+EXTERN void TkFocusFree _ANSI_ARGS_((TkMainInfo * mainPtr));
+/* 143 */
+EXTERN void TkClipCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
+/* 144 */
+EXTERN void TkGCCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
+#ifdef __WIN32__
+/* 145 */
+EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
+ TkRegion srcb, TkRegion dr_return));
+#endif /* __WIN32__ */
+#ifdef MAC_TCL
+/* 145 */
+EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
+ TkRegion srcb, TkRegion dr_return));
+#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 145 */
+EXTERN void TkSubtractRegion _ANSI_ARGS_((TkRegion sra,
+ TkRegion srcb, TkRegion dr_return));
+#endif /* MAC_OSX_TK */
+/* 146 */
+EXTERN void TkStylePkgInit _ANSI_ARGS_((TkMainInfo * mainPtr));
+/* 147 */
+EXTERN void TkStylePkgFree _ANSI_ARGS_((TkMainInfo * mainPtr));
typedef struct TkIntStubs {
int magic;
@@ -530,10 +572,10 @@ typedef struct TkIntStubs {
int (*tkClipInit) _ANSI_ARGS_((Tcl_Interp * interp, TkDisplay * dispPtr)); /* 8 */
void (*tkComputeAnchor) _ANSI_ARGS_((Tk_Anchor anchor, Tk_Window tkwin, int padX, int padY, int innerWidth, int innerHeight, int * xPtr, int * yPtr)); /* 9 */
int (*tkCopyAndGlobalEval) _ANSI_ARGS_((Tcl_Interp * interp, char * script)); /* 10 */
- unsigned long (*tkCreateBindingProcedure) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, char * eventString, TkBindEvalProc * evalProc, TkBindFreeProc * freeProc, ClientData clientData)); /* 11 */
- TkCursor * (*tkCreateCursorFromData) _ANSI_ARGS_((Tk_Window tkwin, char * source, char * mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg)); /* 12 */
+ unsigned long (*tkCreateBindingProcedure) _ANSI_ARGS_((Tcl_Interp * interp, Tk_BindingTable bindingTable, ClientData object, CONST char * eventString, TkBindEvalProc * evalProc, TkBindFreeProc * freeProc, ClientData clientData)); /* 11 */
+ TkCursor * (*tkCreateCursorFromData) _ANSI_ARGS_((Tk_Window tkwin, CONST char * source, CONST char * mask, int width, int height, int xHot, int yHot, XColor fg, XColor bg)); /* 12 */
int (*tkCreateFrame) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int argc, char ** argv, int toplevel, char * appName)); /* 13 */
- Tk_Window (*tkCreateMainWindow) _ANSI_ARGS_((Tcl_Interp * interp, char * screenName, char * baseName)); /* 14 */
+ Tk_Window (*tkCreateMainWindow) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * screenName, char * baseName)); /* 14 */
Time (*tkCurrentTime) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 15 */
void (*tkDeleteAllImages) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 16 */
void (*tkDoConfigureNotify) _ANSI_ARGS_((TkWindow * winPtr)); /* 17 */
@@ -552,7 +594,7 @@ typedef struct TkIntStubs {
char * (*tkGetBitmapData) _ANSI_ARGS_((Tcl_Interp * interp, char * string, char * fileName, int * widthPtr, int * heightPtr, int * hotXPtr, int * hotYPtr)); /* 30 */
void (*tkGetButtPoints) _ANSI_ARGS_((double p1[], double p2[], double width, int project, double m1[], double m2[])); /* 31 */
TkCursor * (*tkGetCursorByName) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tk_Uid string)); /* 32 */
- char * (*tkGetDefaultScreenName) _ANSI_ARGS_((Tcl_Interp * interp, char * screenName)); /* 33 */
+ CONST84_RETURN char * (*tkGetDefaultScreenName) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * screenName)); /* 33 */
TkDisplay * (*tkGetDisplay) _ANSI_ARGS_((Display * display)); /* 34 */
int (*tkGetDisplayOf) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], Tk_Window * tkwinPtr)); /* 35 */
TkWindow * (*tkGetFocusWin) _ANSI_ARGS_((TkWindow * winPtr)); /* 36 */
@@ -577,7 +619,7 @@ typedef struct TkIntStubs {
int (*tkpChangeFocus) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 55 */
void (*tkpCloseDisplay) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 56 */
void (*tkpClaimFocus) _ANSI_ARGS_((TkWindow * topLevelPtr, int force)); /* 57 */
- void (*tkpDisplayWarning) _ANSI_ARGS_((char * msg, char * title)); /* 58 */
+ void (*tkpDisplayWarning) _ANSI_ARGS_((CONST char * msg, CONST char * title)); /* 58 */
void (*tkpGetAppName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * name)); /* 59 */
TkWindow * (*tkpGetOtherWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 60 */
TkWindow * (*tkpGetWrapperWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 61 */
@@ -587,14 +629,14 @@ typedef struct TkIntStubs {
void (*tkpMakeMenuWindow) _ANSI_ARGS_((Tk_Window tkwin, int transient)); /* 65 */
Window (*tkpMakeWindow) _ANSI_ARGS_((TkWindow * winPtr, Window parent)); /* 66 */
void (*tkpMenuNotifyToplevelCreate) _ANSI_ARGS_((Tcl_Interp * interp1, char * menuName)); /* 67 */
- TkDisplay * (*tkpOpenDisplay) _ANSI_ARGS_((char * display_name)); /* 68 */
+ TkDisplay * (*tkpOpenDisplay) _ANSI_ARGS_((CONST char * display_name)); /* 68 */
int (*tkPointerEvent) _ANSI_ARGS_((XEvent * eventPtr, TkWindow * winPtr)); /* 69 */
int (*tkPolygonToArea) _ANSI_ARGS_((double * polyPtr, int numPoints, double * rectPtr)); /* 70 */
double (*tkPolygonToPoint) _ANSI_ARGS_((double * polyPtr, int numPoints, double * pointPtr)); /* 71 */
int (*tkPositionInTree) _ANSI_ARGS_((TkWindow * winPtr, TkWindow * treePtr)); /* 72 */
void (*tkpRedirectKeyEvent) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr)); /* 73 */
void (*tkpSetMainMenubar) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * menuName)); /* 74 */
- int (*tkpUseWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * string)); /* 75 */
+ int (*tkpUseWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, CONST char * string)); /* 75 */
int (*tkpWindowWasRecentlyDeleted) _ANSI_ARGS_((Window win, TkDisplay * dispPtr)); /* 76 */
void (*tkQueueEventForAllChildren) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr)); /* 77 */
int (*tkReadBitmapFile) _ANSI_ARGS_((Display* display, Drawable d, CONST char* filename, unsigned int* width_return, unsigned int* height_return, Pixmap* bitmap_return, int* x_hot_return, int* y_hot_return)); /* 78 */
@@ -603,7 +645,7 @@ typedef struct TkIntStubs {
void (*tkSelEventProc) _ANSI_ARGS_((Tk_Window tkwin, XEvent * eventPtr)); /* 81 */
void (*tkSelInit) _ANSI_ARGS_((Tk_Window tkwin)); /* 82 */
void (*tkSelPropProc) _ANSI_ARGS_((XEvent * eventPtr)); /* 83 */
- void (*tkSetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, TkClassProcs * procs, ClientData instanceData)); /* 84 */
+ void *reserved84;
void (*tkSetWindowMenuBar) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * oldMenuName, char * menuName)); /* 85 */
KeySym (*tkStringToKeysym) _ANSI_ARGS_((char * name)); /* 86 */
int (*tkThickPolyLineToArea) _ANSI_ARGS_((double * coordPtr, int numPoints, double width, int capStyle, int joinStyle, double * rectPtr)); /* 87 */
@@ -630,7 +672,7 @@ typedef struct TkIntStubs {
int (*tkGetWindowFromObj) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, Tcl_Obj * objPtr, Tk_Window * windowPtr)); /* 108 */
char * (*tkpGetString) _ANSI_ARGS_((TkWindow * winPtr, XEvent * eventPtr, Tcl_DString * dsPtr)); /* 109 */
void (*tkpGetSubFonts) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Font tkfont)); /* 110 */
- Tcl_Obj * (*tkpGetSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, char * dbName, char * className)); /* 111 */
+ Tcl_Obj * (*tkpGetSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, CONST char * dbName, CONST char * className)); /* 111 */
void (*tkpMenuThreadInit) _ANSI_ARGS_((void)); /* 112 */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved113;
@@ -641,6 +683,9 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle* rect_return)); /* 113 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*tkClipBox) _ANSI_ARGS_((TkRegion rgn, XRectangle* rect_return)); /* 113 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved114;
#endif /* UNIX */
@@ -650,6 +695,9 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkRegion (*tkCreateRegion) _ANSI_ARGS_((void)); /* 114 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved115;
#endif /* UNIX */
@@ -659,6 +707,9 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*tkDestroyRegion) _ANSI_ARGS_((TkRegion rgn)); /* 115 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved116;
#endif /* UNIX */
@@ -668,6 +719,9 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*tkIntersectRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 116 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved117;
#endif /* UNIX */
@@ -677,6 +731,9 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ int (*tkRectInRegion) _ANSI_ARGS_((TkRegion rgn, int x, int y, unsigned int width, unsigned int height)); /* 117 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved118;
#endif /* UNIX */
@@ -686,6 +743,9 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
void (*tkSetRegion) _ANSI_ARGS_((Display* display, GC gc, TkRegion rgn)); /* 118 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*tkSetRegion) _ANSI_ARGS_((Display* display, GC gc, TkRegion rgn)); /* 118 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved119;
#endif /* UNIX */
@@ -695,15 +755,10 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle* rect, TkRegion src, TkRegion dr_return)); /* 119 */
#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved120;
-#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef MAC_OSX_TK
+ void (*tkUnionRectWithRegion) _ANSI_ARGS_((XRectangle* rect, TkRegion src, TkRegion dr_return)); /* 119 */
+#endif /* MAC_OSX_TK */
void *reserved120;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow * winPtr, int active)); /* 120 */
-#endif /* MAC_TCL */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved121;
#endif /* UNIX */
@@ -711,8 +766,11 @@ typedef struct TkIntStubs {
void *reserved121;
#endif /* __WIN32__ */
#ifdef MAC_TCL
- Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display * display, char * source)); /* 121 */
+ Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display * display, CONST char * source)); /* 121 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display * display, CONST char * source)); /* 121 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved122;
#endif /* UNIX */
@@ -722,15 +780,10 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
void (*tkpDefineNativeBitmaps) _ANSI_ARGS_((void)); /* 122 */
#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved123;
-#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef MAC_OSX_TK
+ void (*tkpDefineNativeBitmaps) _ANSI_ARGS_((void)); /* 122 */
+#endif /* MAC_OSX_TK */
void *reserved123;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 123 */
-#endif /* MAC_TCL */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved124;
#endif /* UNIX */
@@ -740,85 +793,43 @@ typedef struct TkIntStubs {
#ifdef MAC_TCL
Pixmap (*tkpGetNativeAppBitmap) _ANSI_ARGS_((Display * display, CONST char * name, int * width, int * height)); /* 124 */
#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved125;
-#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef MAC_OSX_TK
+ Pixmap (*tkpGetNativeAppBitmap) _ANSI_ARGS_((Display * display, CONST char * name, int * width, int * height)); /* 124 */
+#endif /* MAC_OSX_TK */
void *reserved125;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkPointerDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 125 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved126;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved126;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkpSetCapture) _ANSI_ARGS_((TkWindow * winPtr)); /* 126 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved127;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved127;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 127 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved128;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved128;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 128 */
-#endif /* MAC_TCL */
void *reserved129;
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void *reserved130;
-#endif /* UNIX */
-#ifdef __WIN32__
void *reserved130;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- Window (*tkGetTransientMaster) _ANSI_ARGS_((TkWindow * winPtr)); /* 130 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved131;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved131;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- int (*tkGenerateButtonEvent) _ANSI_ARGS_((int x, int y, Window window, unsigned int state)); /* 131 */
-#endif /* MAC_TCL */
void *reserved132;
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved133;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved133;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkGenWMDestroyEvent) _ANSI_ARGS_((Tk_Window tkwin)); /* 133 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
void *reserved134;
-#endif /* UNIX */
-#ifdef __WIN32__
- void *reserved134;
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- void (*tkGenWMConfigureEvent) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height, int flags)); /* 134 */
-#endif /* MAC_TCL */
void (*tkpDrawHighlightBorder) _ANSI_ARGS_((Tk_Window tkwin, GC fgGC, GC bgGC, int highlightWidth, Drawable drawable)); /* 135 */
void (*tkSetFocusWin) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 136 */
void (*tkpSetKeycodeAndState) _ANSI_ARGS_((Tk_Window tkwin, KeySym keySym, XEvent * eventPtr)); /* 137 */
KeySym (*tkpGetKeySym) _ANSI_ARGS_((TkDisplay * dispPtr, XEvent * eventPtr)); /* 138 */
void (*tkpInitKeymapInfo) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 139 */
+ TkRegion (*tkPhotoGetValidRegion) _ANSI_ARGS_((Tk_PhotoHandle handle)); /* 140 */
+ TkWindow ** (*tkWmStackorderToplevel) _ANSI_ARGS_((TkWindow * parentPtr)); /* 141 */
+ void (*tkFocusFree) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 142 */
+ void (*tkClipCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 143 */
+ void (*tkGCCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 144 */
+#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+ void *reserved145;
+#endif /* UNIX */
+#ifdef __WIN32__
+ void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
+#endif /* __WIN32__ */
+#ifdef MAC_TCL
+ void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
+#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*tkSubtractRegion) _ANSI_ARGS_((TkRegion sra, TkRegion srcb, TkRegion dr_return)); /* 145 */
+#endif /* MAC_OSX_TK */
+ void (*tkStylePkgInit) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 146 */
+ void (*tkStylePkgFree) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 147 */
} TkIntStubs;
#ifdef __cplusplus
@@ -1171,10 +1182,7 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkSelPropProc \
(tkIntStubsPtr->tkSelPropProc) /* 83 */
#endif
-#ifndef TkSetClassProcs
-#define TkSetClassProcs \
- (tkIntStubsPtr->tkSetClassProcs) /* 84 */
-#endif
+/* Slot 84 is reserved */
#ifndef TkSetWindowMenuBar
#define TkSetWindowMenuBar \
(tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */
@@ -1299,6 +1307,12 @@ extern TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkClipBox) /* 113 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkClipBox
+#define TkClipBox \
+ (tkIntStubsPtr->tkClipBox) /* 113 */
+#endif
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
#ifndef TkCreateRegion
#define TkCreateRegion \
@@ -1311,6 +1325,12 @@ extern TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkCreateRegion) /* 114 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkCreateRegion
+#define TkCreateRegion \
+ (tkIntStubsPtr->tkCreateRegion) /* 114 */
+#endif
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
#ifndef TkDestroyRegion
#define TkDestroyRegion \
@@ -1323,6 +1343,12 @@ extern TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkDestroyRegion) /* 115 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkDestroyRegion
+#define TkDestroyRegion \
+ (tkIntStubsPtr->tkDestroyRegion) /* 115 */
+#endif
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
#ifndef TkIntersectRegion
#define TkIntersectRegion \
@@ -1335,6 +1361,12 @@ extern TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkIntersectRegion) /* 116 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkIntersectRegion
+#define TkIntersectRegion \
+ (tkIntStubsPtr->tkIntersectRegion) /* 116 */
+#endif
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
#ifndef TkRectInRegion
#define TkRectInRegion \
@@ -1347,6 +1379,12 @@ extern TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkRectInRegion) /* 117 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkRectInRegion
+#define TkRectInRegion \
+ (tkIntStubsPtr->tkRectInRegion) /* 117 */
+#endif
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
#ifndef TkSetRegion
#define TkSetRegion \
@@ -1359,6 +1397,12 @@ extern TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkSetRegion) /* 118 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkSetRegion
+#define TkSetRegion \
+ (tkIntStubsPtr->tkSetRegion) /* 118 */
+#endif
+#endif /* MAC_OSX_TK */
#ifdef __WIN32__
#ifndef TkUnionRectWithRegion
#define TkUnionRectWithRegion \
@@ -1371,87 +1415,60 @@ extern TkIntStubs *tkIntStubsPtr;
(tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
#endif
#endif /* MAC_TCL */
-
-#ifdef MAC_TCL
-#ifndef TkGenerateActivateEvents
-#define TkGenerateActivateEvents \
- (tkIntStubsPtr->tkGenerateActivateEvents) /* 120 */
+#ifdef MAC_OSX_TK
+#ifndef TkUnionRectWithRegion
+#define TkUnionRectWithRegion \
+ (tkIntStubsPtr->tkUnionRectWithRegion) /* 119 */
#endif
-#endif /* MAC_TCL */
+#endif /* MAC_OSX_TK */
+/* Slot 120 is reserved */
#ifdef MAC_TCL
#ifndef TkpCreateNativeBitmap
#define TkpCreateNativeBitmap \
(tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkpCreateNativeBitmap
+#define TkpCreateNativeBitmap \
+ (tkIntStubsPtr->tkpCreateNativeBitmap) /* 121 */
+#endif
+#endif /* MAC_OSX_TK */
#ifdef MAC_TCL
#ifndef TkpDefineNativeBitmaps
#define TkpDefineNativeBitmaps \
(tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */
#endif
#endif /* MAC_TCL */
-#ifdef MAC_TCL
-#ifndef TkpGetMS
-#define TkpGetMS \
- (tkIntStubsPtr->tkpGetMS) /* 123 */
+#ifdef MAC_OSX_TK
+#ifndef TkpDefineNativeBitmaps
+#define TkpDefineNativeBitmaps \
+ (tkIntStubsPtr->tkpDefineNativeBitmaps) /* 122 */
#endif
-#endif /* MAC_TCL */
+#endif /* MAC_OSX_TK */
+/* Slot 123 is reserved */
#ifdef MAC_TCL
#ifndef TkpGetNativeAppBitmap
#define TkpGetNativeAppBitmap \
(tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */
#endif
#endif /* MAC_TCL */
-#ifdef MAC_TCL
-#ifndef TkPointerDeadWindow
-#define TkPointerDeadWindow \
- (tkIntStubsPtr->tkPointerDeadWindow) /* 125 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-#ifndef TkpSetCapture
-#define TkpSetCapture \
- (tkIntStubsPtr->tkpSetCapture) /* 126 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-#ifndef TkpSetCursor
-#define TkpSetCursor \
- (tkIntStubsPtr->tkpSetCursor) /* 127 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-#ifndef TkpWmSetState
-#define TkpWmSetState \
- (tkIntStubsPtr->tkpWmSetState) /* 128 */
+#ifdef MAC_OSX_TK
+#ifndef TkpGetNativeAppBitmap
+#define TkpGetNativeAppBitmap \
+ (tkIntStubsPtr->tkpGetNativeAppBitmap) /* 124 */
#endif
-#endif /* MAC_TCL */
+#endif /* MAC_OSX_TK */
+/* Slot 125 is reserved */
+/* Slot 126 is reserved */
+/* Slot 127 is reserved */
+/* Slot 128 is reserved */
/* Slot 129 is reserved */
-#ifdef MAC_TCL
-#ifndef TkGetTransientMaster
-#define TkGetTransientMaster \
- (tkIntStubsPtr->tkGetTransientMaster) /* 130 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-#ifndef TkGenerateButtonEvent
-#define TkGenerateButtonEvent \
- (tkIntStubsPtr->tkGenerateButtonEvent) /* 131 */
-#endif
-#endif /* MAC_TCL */
+/* Slot 130 is reserved */
+/* Slot 131 is reserved */
/* Slot 132 is reserved */
-#ifdef MAC_TCL
-#ifndef TkGenWMDestroyEvent
-#define TkGenWMDestroyEvent \
- (tkIntStubsPtr->tkGenWMDestroyEvent) /* 133 */
-#endif
-#endif /* MAC_TCL */
-#ifdef MAC_TCL
-#ifndef TkGenWMConfigureEvent
-#define TkGenWMConfigureEvent \
- (tkIntStubsPtr->tkGenWMConfigureEvent) /* 134 */
-#endif
-#endif /* MAC_TCL */
+/* Slot 133 is reserved */
+/* Slot 134 is reserved */
#ifndef TkpDrawHighlightBorder
#define TkpDrawHighlightBorder \
(tkIntStubsPtr->tkpDrawHighlightBorder) /* 135 */
@@ -1472,6 +1489,52 @@ extern TkIntStubs *tkIntStubsPtr;
#define TkpInitKeymapInfo \
(tkIntStubsPtr->tkpInitKeymapInfo) /* 139 */
#endif
+#ifndef TkPhotoGetValidRegion
+#define TkPhotoGetValidRegion \
+ (tkIntStubsPtr->tkPhotoGetValidRegion) /* 140 */
+#endif
+#ifndef TkWmStackorderToplevel
+#define TkWmStackorderToplevel \
+ (tkIntStubsPtr->tkWmStackorderToplevel) /* 141 */
+#endif
+#ifndef TkFocusFree
+#define TkFocusFree \
+ (tkIntStubsPtr->tkFocusFree) /* 142 */
+#endif
+#ifndef TkClipCleanup
+#define TkClipCleanup \
+ (tkIntStubsPtr->tkClipCleanup) /* 143 */
+#endif
+#ifndef TkGCCleanup
+#define TkGCCleanup \
+ (tkIntStubsPtr->tkGCCleanup) /* 144 */
+#endif
+#ifdef __WIN32__
+#ifndef TkSubtractRegion
+#define TkSubtractRegion \
+ (tkIntStubsPtr->tkSubtractRegion) /* 145 */
+#endif
+#endif /* __WIN32__ */
+#ifdef MAC_TCL
+#ifndef TkSubtractRegion
+#define TkSubtractRegion \
+ (tkIntStubsPtr->tkSubtractRegion) /* 145 */
+#endif
+#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkSubtractRegion
+#define TkSubtractRegion \
+ (tkIntStubsPtr->tkSubtractRegion) /* 145 */
+#endif
+#endif /* MAC_OSX_TK */
+#ifndef TkStylePkgInit
+#define TkStylePkgInit \
+ (tkIntStubsPtr->tkStylePkgInit) /* 146 */
+#endif
+#ifndef TkStylePkgFree
+#define TkStylePkgFree \
+ (tkIntStubsPtr->tkStylePkgFree) /* 147 */
+#endif
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
@@ -1482,4 +1545,3 @@ extern TkIntStubs *tkIntStubsPtr;
#endif /* _TKINTDECLS */
-
diff --git a/tk/generic/tkIntPlatDecls.h b/tk/generic/tkIntPlatDecls.h
index d3240233fe8..0dbb21c8b8e 100644
--- a/tk/generic/tkIntPlatDecls.h
+++ b/tk/generic/tkIntPlatDecls.h
@@ -32,27 +32,6 @@
* Exported function declarations:
*/
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-/* 0 */
-EXTERN void TkCreateXEventSource _ANSI_ARGS_((void));
-/* 1 */
-EXTERN void TkFreeWindowId _ANSI_ARGS_((TkDisplay * dispPtr,
- Window w));
-/* 2 */
-EXTERN void TkInitXId _ANSI_ARGS_((TkDisplay * dispPtr));
-/* 3 */
-EXTERN int TkpCmapStressed _ANSI_ARGS_((Tk_Window tkwin,
- Colormap colormap));
-/* 4 */
-EXTERN void TkpSync _ANSI_ARGS_((Display * display));
-/* 5 */
-EXTERN Window TkUnixContainerId _ANSI_ARGS_((TkWindow * winPtr));
-/* 6 */
-EXTERN int TkUnixDoOneXEvent _ANSI_ARGS_((Tcl_Time * timePtr));
-/* 7 */
-EXTERN void TkUnixSetMenubar _ANSI_ARGS_((Tk_Window tkwin,
- Tk_Window menubar));
-#endif /* UNIX */
#ifdef __WIN32__
/* 0 */
EXTERN char * TkAlignImageData _ANSI_ARGS_((XImage * image,
@@ -70,7 +49,7 @@ EXTERN void TkpPrintWindowId _ANSI_ARGS_((char * buf,
Window window));
/* 6 */
EXTERN int TkpScanWindowId _ANSI_ARGS_((Tcl_Interp * interp,
- char * string, int * idPtr));
+ CONST char * string, Window * idPtr));
/* 7 */
EXTERN void TkpSetCapture _ANSI_ARGS_((TkWindow * winPtr));
/* 8 */
@@ -138,8 +117,8 @@ EXTERN void TkWinSetForegroundWindow _ANSI_ARGS_((
EXTERN void TkWinDialogDebug _ANSI_ARGS_((int debug));
/* 32 */
EXTERN Tcl_Obj * TkWinGetMenuSystemDefault _ANSI_ARGS_((
- Tk_Window tkwin, char * dbName,
- char * className));
+ Tk_Window tkwin, CONST char * dbName,
+ CONST char * className));
/* 33 */
EXTERN int TkWinGetPlatformId _ANSI_ARGS_((void));
#endif /* __WIN32__ */
@@ -147,16 +126,11 @@ EXTERN int TkWinGetPlatformId _ANSI_ARGS_((void));
/* 0 */
EXTERN void TkGenerateActivateEvents _ANSI_ARGS_((
TkWindow * winPtr, int active));
-/* 1 */
-EXTERN Pixmap TkpCreateNativeBitmap _ANSI_ARGS_((Display * display,
- char * source));
-/* 2 */
-EXTERN void TkpDefineNativeBitmaps _ANSI_ARGS_((void));
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
/* 3 */
EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void));
-/* 4 */
-EXTERN Pixmap TkpGetNativeAppBitmap _ANSI_ARGS_((Display * display,
- char * name, int * width, int * height));
+/* Slot 4 is reserved */
/* 5 */
EXTERN void TkPointerDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
/* 6 */
@@ -166,61 +140,41 @@ EXTERN void TkpSetCursor _ANSI_ARGS_((TkpCursor cursor));
/* 8 */
EXTERN void TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
int state));
-/* 9 */
-EXTERN int HandleWMEvent _ANSI_ARGS_((EventRecord * theEvent));
+/* Slot 9 is reserved */
/* 10 */
EXTERN void TkAboutDlg _ANSI_ARGS_((void));
-/* 11 */
-EXTERN void TkCreateMacEventSource _ANSI_ARGS_((void));
-/* 12 */
-EXTERN void TkFontList _ANSI_ARGS_((Tcl_Interp * interp,
- Display * display));
+/* Slot 11 is reserved */
+/* Slot 12 is reserved */
/* 13 */
EXTERN Window TkGetTransientMaster _ANSI_ARGS_((TkWindow * winPtr));
/* 14 */
EXTERN int TkGenerateButtonEvent _ANSI_ARGS_((int x, int y,
Window window, unsigned int state));
-/* 15 */
-EXTERN int TkGetCharPositions _ANSI_ARGS_((
- XFontStruct * font_struct, char * string,
- int count, short * buffer));
+/* Slot 15 is reserved */
/* 16 */
EXTERN void TkGenWMDestroyEvent _ANSI_ARGS_((Tk_Window tkwin));
-/* 17 */
-EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin,
- int x, int y, int width, int height,
- int flags));
+/* Slot 17 is reserved */
/* 18 */
EXTERN unsigned int TkMacButtonKeyState _ANSI_ARGS_((void));
/* 19 */
EXTERN void TkMacClearMenubarActive _ANSI_ARGS_((void));
-/* 20 */
-EXTERN int TkMacConvertEvent _ANSI_ARGS_((
- EventRecord * eventPtr));
+/* Slot 20 is reserved */
/* 21 */
EXTERN int TkMacDispatchMenuEvent _ANSI_ARGS_((int menuID,
int index));
/* 22 */
EXTERN void TkMacInstallCursor _ANSI_ARGS_((int resizeOverride));
-/* 23 */
-EXTERN int TkMacConvertTkEvent _ANSI_ARGS_((
- EventRecord * eventPtr, Window window));
+/* Slot 23 is reserved */
/* 24 */
EXTERN void TkMacHandleTearoffMenu _ANSI_ARGS_((void));
-/* 25 */
-EXTERN void tkMacInstallMWConsole _ANSI_ARGS_((
- Tcl_Interp * interp));
-/* 26 */
-EXTERN void TkMacInvalClipRgns _ANSI_ARGS_((TkWindow * winPtr));
+/* Slot 25 is reserved */
+/* Slot 26 is reserved */
/* 27 */
EXTERN void TkMacDoHLEvent _ANSI_ARGS_((EventRecord * theEvent));
-/* 28 */
-EXTERN void TkMacFontInfo _ANSI_ARGS_((Font fontId,
- short * family, short * style, short * size));
+/* Slot 28 is reserved */
/* 29 */
EXTERN Time TkMacGenerateTime _ANSI_ARGS_((void));
-/* 30 */
-EXTERN GWorldPtr TkMacGetDrawablePort _ANSI_ARGS_((Drawable drawable));
+/* Slot 30 is reserved */
/* 31 */
EXTERN TkWindow * TkMacGetScrollbarGrowWindow _ANSI_ARGS_((
TkWindow * winPtr));
@@ -232,13 +186,9 @@ EXTERN int TkMacGrowToplevel _ANSI_ARGS_((WindowRef whichWindow,
/* 34 */
EXTERN void TkMacHandleMenuSelect _ANSI_ARGS_((long mResult,
int optionKeyPressed));
-/* 35 */
-EXTERN int TkMacHaveAppearance _ANSI_ARGS_((void));
-/* 36 */
-EXTERN void TkMacInitAppleEvents _ANSI_ARGS_((
- Tcl_Interp * interp));
-/* 37 */
-EXTERN void TkMacInitMenus _ANSI_ARGS_((Tcl_Interp * interp));
+/* Slot 35 is reserved */
+/* Slot 36 is reserved */
+/* Slot 37 is reserved */
/* 38 */
EXTERN void TkMacInvalidateWindow _ANSI_ARGS_((
MacDrawable * macWin, int flag));
@@ -258,9 +208,7 @@ EXTERN void TkMacRegisterOffScreenWindow _ANSI_ARGS_((
Window window, GWorldPtr portPtr));
/* 44 */
EXTERN int TkMacResizable _ANSI_ARGS_((TkWindow * winPtr));
-/* 45 */
-EXTERN void TkMacSetEmbedRgn _ANSI_ARGS_((TkWindow * winPtr,
- RgnHandle rgn));
+/* Slot 45 is reserved */
/* 46 */
EXTERN void TkMacSetHelpMenuItemCount _ANSI_ARGS_((void));
/* 47 */
@@ -285,8 +233,7 @@ EXTERN void TkMacWinBounds _ANSI_ARGS_((TkWindow * winPtr,
/* 55 */
EXTERN void TkMacWindowOffset _ANSI_ARGS_((WindowRef wRef,
int * xOffset, int * yOffset));
-/* 56 */
-EXTERN void TkResumeClipboard _ANSI_ARGS_((void));
+/* Slot 56 is reserved */
/* 57 */
EXTERN int TkSetMacColor _ANSI_ARGS_((unsigned long pixel,
RGBColor * macColor));
@@ -295,9 +242,7 @@ EXTERN void TkSetWMName _ANSI_ARGS_((TkWindow * winPtr,
Tk_Uid titleUid));
/* 59 */
EXTERN void TkSuspendClipboard _ANSI_ARGS_((void));
-/* 60 */
-EXTERN int TkWMGrowToplevel _ANSI_ARGS_((WindowRef whichWindow,
- Point start));
+/* Slot 60 is reserved */
/* 61 */
EXTERN int TkMacZoomToplevel _ANSI_ARGS_((WindowPtr whichWindow,
Point where, short zoomPart));
@@ -308,22 +253,177 @@ EXTERN Tk_Window Tk_TopCoordsToWindow _ANSI_ARGS_((Tk_Window tkwin,
EXTERN MacDrawable * TkMacContainerId _ANSI_ARGS_((TkWindow * winPtr));
/* 64 */
EXTERN MacDrawable * TkMacGetHostToplevel _ANSI_ARGS_((TkWindow * winPtr));
+/* 65 */
+EXTERN void TkMacPreprocessMenu _ANSI_ARGS_((void));
+/* 66 */
+EXTERN int TkpIsWindowFloating _ANSI_ARGS_((WindowRef window));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 0 */
+EXTERN void TkGenerateActivateEvents _ANSI_ARGS_((
+ TkWindow * winPtr, int active));
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
+/* 3 */
+EXTERN void TkPointerDeadWindow _ANSI_ARGS_((TkWindow * winPtr));
+/* 4 */
+EXTERN void TkpSetCapture _ANSI_ARGS_((TkWindow * winPtr));
+/* 5 */
+EXTERN void TkpSetCursor _ANSI_ARGS_((TkpCursor cursor));
+/* 6 */
+EXTERN void TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
+ int state));
+/* 7 */
+EXTERN void TkAboutDlg _ANSI_ARGS_((void));
+/* 8 */
+EXTERN unsigned int TkMacOSXButtonKeyState _ANSI_ARGS_((void));
+/* 9 */
+EXTERN void TkMacOSXClearMenubarActive _ANSI_ARGS_((void));
+/* 10 */
+EXTERN int TkMacOSXDispatchMenuEvent _ANSI_ARGS_((int menuID,
+ int index));
+/* 11 */
+EXTERN void TkMacOSXInstallCursor _ANSI_ARGS_((
+ int resizeOverride));
+/* 12 */
+EXTERN void TkMacOSXHandleTearoffMenu _ANSI_ARGS_((void));
+/* Slot 13 is reserved */
+/* 14 */
+EXTERN int TkMacOSXDoHLEvent _ANSI_ARGS_((
+ EventRecord * theEvent));
+/* Slot 15 is reserved */
+/* 16 */
+EXTERN Window TkMacOSXGetXWindow _ANSI_ARGS_((WindowRef macWinPtr));
+/* 17 */
+EXTERN int TkMacOSXGrowToplevel _ANSI_ARGS_((
+ WindowRef whichWindow, Point start));
+/* 18 */
+EXTERN void TkMacOSXHandleMenuSelect _ANSI_ARGS_((long mResult,
+ int optionKeyPressed));
+/* Slot 19 is reserved */
+/* Slot 20 is reserved */
+/* 21 */
+EXTERN void TkMacOSXInvalidateWindow _ANSI_ARGS_((
+ MacDrawable * macWin, int flag));
+/* 22 */
+EXTERN int TkMacOSXIsCharacterMissing _ANSI_ARGS_((
+ Tk_Font tkfont, unsigned int searchChar));
+/* 23 */
+EXTERN void TkMacOSXMakeRealWindowExist _ANSI_ARGS_((
+ TkWindow * winPtr));
+/* 24 */
+EXTERN BitMapPtr TkMacOSXMakeStippleMap _ANSI_ARGS_((Drawable d1,
+ Drawable d2));
+/* 25 */
+EXTERN void TkMacOSXMenuClick _ANSI_ARGS_((void));
+/* 26 */
+EXTERN void TkMacOSXRegisterOffScreenWindow _ANSI_ARGS_((
+ Window window, GWorldPtr portPtr));
+/* 27 */
+EXTERN int TkMacOSXResizable _ANSI_ARGS_((TkWindow * winPtr));
+/* 28 */
+EXTERN void TkMacOSXSetHelpMenuItemCount _ANSI_ARGS_((void));
+/* 29 */
+EXTERN void TkMacOSXSetScrollbarGrow _ANSI_ARGS_((
+ TkWindow * winPtr, int flag));
+/* 30 */
+EXTERN void TkMacOSXSetUpClippingRgn _ANSI_ARGS_((
+ Drawable drawable));
+/* 31 */
+EXTERN void TkMacOSXSetUpGraphicsPort _ANSI_ARGS_((GC gc,
+ GWorldPtr destPort));
+/* 32 */
+EXTERN void TkMacOSXUpdateClipRgn _ANSI_ARGS_((TkWindow * winPtr));
+/* 33 */
+EXTERN void TkMacOSXUnregisterMacWindow _ANSI_ARGS_((
+ WindowRef portPtr));
+/* 34 */
+EXTERN int TkMacOSXUseMenuID _ANSI_ARGS_((short macID));
+/* 35 */
+EXTERN RgnHandle TkMacOSXVisableClipRgn _ANSI_ARGS_((
+ TkWindow * winPtr));
+/* 36 */
+EXTERN void TkMacOSXWinBounds _ANSI_ARGS_((TkWindow * winPtr,
+ Rect * geometry));
+/* 37 */
+EXTERN void TkMacOSXWindowOffset _ANSI_ARGS_((WindowRef wRef,
+ int * xOffset, int * yOffset));
+/* 38 */
+EXTERN int TkSetMacColor _ANSI_ARGS_((unsigned long pixel,
+ RGBColor * macColor));
+/* 39 */
+EXTERN void TkSetWMName _ANSI_ARGS_((TkWindow * winPtr,
+ Tk_Uid titleUid));
+/* 40 */
+EXTERN void TkSuspendClipboard _ANSI_ARGS_((void));
+/* 41 */
+EXTERN int TkMacOSXZoomToplevel _ANSI_ARGS_((
+ WindowPtr whichWindow, Point where,
+ short zoomPart));
+/* 42 */
+EXTERN Tk_Window Tk_TopCoordsToWindow _ANSI_ARGS_((Tk_Window tkwin,
+ int rootX, int rootY, int * newX, int * newY));
+/* 43 */
+EXTERN MacDrawable * TkMacOSXContainerId _ANSI_ARGS_((TkWindow * winPtr));
+/* 44 */
+EXTERN MacDrawable * TkMacOSXGetHostToplevel _ANSI_ARGS_((
+ TkWindow * winPtr));
+/* 45 */
+EXTERN void TkMacOSXPreprocessMenu _ANSI_ARGS_((void));
+/* 46 */
+EXTERN int TkpIsWindowFloating _ANSI_ARGS_((WindowRef window));
+/* 47 */
+EXTERN Tk_Window TkMacOSXGetCapture _ANSI_ARGS_((void));
+/* Slot 48 is reserved */
+/* 49 */
+EXTERN Window TkGetTransientMaster _ANSI_ARGS_((TkWindow * winPtr));
+/* 50 */
+EXTERN int TkGenerateButtonEvent _ANSI_ARGS_((int x, int y,
+ Window window, unsigned int state));
+/* 51 */
+EXTERN void TkGenWMDestroyEvent _ANSI_ARGS_((Tk_Window tkwin));
+/* Slot 52 is reserved */
+/* 53 */
+EXTERN unsigned long TkpGetMS _ANSI_ARGS_((void));
+#endif /* MAC_OSX_TK */
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */
+/* 0 */
+EXTERN void TkCreateXEventSource _ANSI_ARGS_((void));
+/* 1 */
+EXTERN void TkFreeWindowId _ANSI_ARGS_((TkDisplay * dispPtr,
+ Window w));
+/* 2 */
+EXTERN void TkInitXId _ANSI_ARGS_((TkDisplay * dispPtr));
+/* 3 */
+EXTERN int TkpCmapStressed _ANSI_ARGS_((Tk_Window tkwin,
+ Colormap colormap));
+/* 4 */
+EXTERN void TkpSync _ANSI_ARGS_((Display * display));
+/* 5 */
+EXTERN Window TkUnixContainerId _ANSI_ARGS_((TkWindow * winPtr));
+/* 6 */
+EXTERN int TkUnixDoOneXEvent _ANSI_ARGS_((Tcl_Time * timePtr));
+/* 7 */
+EXTERN void TkUnixSetMenubar _ANSI_ARGS_((Tk_Window tkwin,
+ Tk_Window menubar));
+/* 8 */
+EXTERN int TkpScanWindowId _ANSI_ARGS_((Tcl_Interp * interp,
+ CONST char * string, Window * idPtr));
+/* 9 */
+EXTERN void TkWmCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
+/* 10 */
+EXTERN void TkSendCleanup _ANSI_ARGS_((TkDisplay * dispPtr));
+/* 11 */
+EXTERN void TkFreeXId _ANSI_ARGS_((TkDisplay * dispPtr));
+/* 12 */
+EXTERN int TkpWmSetState _ANSI_ARGS_((TkWindow * winPtr,
+ int state));
+#endif /* X11 */
typedef struct TkIntPlatStubs {
int magic;
struct TkIntPlatStubHooks *hooks;
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 0 */
- void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay * dispPtr, Window w)); /* 1 */
- void (*tkInitXId) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 2 */
- int (*tkpCmapStressed) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 3 */
- void (*tkpSync) _ANSI_ARGS_((Display * display)); /* 4 */
- Window (*tkUnixContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 5 */
- int (*tkUnixDoOneXEvent) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 6 */
- void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 7 */
-#endif /* UNIX */
#ifdef __WIN32__
char * (*tkAlignImageData) _ANSI_ARGS_((XImage * image, int alignment, int bitOrder)); /* 0 */
void *reserved1;
@@ -331,7 +431,7 @@ typedef struct TkIntPlatStubs {
unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 3 */
void (*tkPointerDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 4 */
void (*tkpPrintWindowId) _ANSI_ARGS_((char * buf, Window window)); /* 5 */
- int (*tkpScanWindowId) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int * idPtr)); /* 6 */
+ int (*tkpScanWindowId) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, Window * idPtr)); /* 6 */
void (*tkpSetCapture) _ANSI_ARGS_((TkWindow * winPtr)); /* 7 */
void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 8 */
void (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 9 */
@@ -357,48 +457,48 @@ typedef struct TkIntPlatStubs {
void (*tkWinXInit) _ANSI_ARGS_((HINSTANCE hInstance)); /* 29 */
void (*tkWinSetForegroundWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 30 */
void (*tkWinDialogDebug) _ANSI_ARGS_((int debug)); /* 31 */
- Tcl_Obj * (*tkWinGetMenuSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, char * dbName, char * className)); /* 32 */
+ Tcl_Obj * (*tkWinGetMenuSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, CONST char * dbName, CONST char * className)); /* 32 */
int (*tkWinGetPlatformId) _ANSI_ARGS_((void)); /* 33 */
#endif /* __WIN32__ */
#ifdef MAC_TCL
void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow * winPtr, int active)); /* 0 */
- Pixmap (*tkpCreateNativeBitmap) _ANSI_ARGS_((Display * display, char * source)); /* 1 */
- void (*tkpDefineNativeBitmaps) _ANSI_ARGS_((void)); /* 2 */
+ void *reserved1;
+ void *reserved2;
unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 3 */
- Pixmap (*tkpGetNativeAppBitmap) _ANSI_ARGS_((Display * display, char * name, int * width, int * height)); /* 4 */
+ void *reserved4;
void (*tkPointerDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 5 */
void (*tkpSetCapture) _ANSI_ARGS_((TkWindow * winPtr)); /* 6 */
void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 7 */
void (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 8 */
- int (*handleWMEvent) _ANSI_ARGS_((EventRecord * theEvent)); /* 9 */
+ void *reserved9;
void (*tkAboutDlg) _ANSI_ARGS_((void)); /* 10 */
- void (*tkCreateMacEventSource) _ANSI_ARGS_((void)); /* 11 */
- void (*tkFontList) _ANSI_ARGS_((Tcl_Interp * interp, Display * display)); /* 12 */
+ void *reserved11;
+ void *reserved12;
Window (*tkGetTransientMaster) _ANSI_ARGS_((TkWindow * winPtr)); /* 13 */
int (*tkGenerateButtonEvent) _ANSI_ARGS_((int x, int y, Window window, unsigned int state)); /* 14 */
- int (*tkGetCharPositions) _ANSI_ARGS_((XFontStruct * font_struct, char * string, int count, short * buffer)); /* 15 */
+ void *reserved15;
void (*tkGenWMDestroyEvent) _ANSI_ARGS_((Tk_Window tkwin)); /* 16 */
- void (*tkGenWMConfigureEvent) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height, int flags)); /* 17 */
+ void *reserved17;
unsigned int (*tkMacButtonKeyState) _ANSI_ARGS_((void)); /* 18 */
void (*tkMacClearMenubarActive) _ANSI_ARGS_((void)); /* 19 */
- int (*tkMacConvertEvent) _ANSI_ARGS_((EventRecord * eventPtr)); /* 20 */
+ void *reserved20;
int (*tkMacDispatchMenuEvent) _ANSI_ARGS_((int menuID, int index)); /* 21 */
void (*tkMacInstallCursor) _ANSI_ARGS_((int resizeOverride)); /* 22 */
- int (*tkMacConvertTkEvent) _ANSI_ARGS_((EventRecord * eventPtr, Window window)); /* 23 */
+ void *reserved23;
void (*tkMacHandleTearoffMenu) _ANSI_ARGS_((void)); /* 24 */
- void (*tkMacInstallMWConsole) _ANSI_ARGS_((Tcl_Interp * interp)); /* 25 */
- void (*tkMacInvalClipRgns) _ANSI_ARGS_((TkWindow * winPtr)); /* 26 */
+ void *reserved25;
+ void *reserved26;
void (*tkMacDoHLEvent) _ANSI_ARGS_((EventRecord * theEvent)); /* 27 */
- void (*tkMacFontInfo) _ANSI_ARGS_((Font fontId, short * family, short * style, short * size)); /* 28 */
+ void *reserved28;
Time (*tkMacGenerateTime) _ANSI_ARGS_((void)); /* 29 */
- GWorldPtr (*tkMacGetDrawablePort) _ANSI_ARGS_((Drawable drawable)); /* 30 */
+ void *reserved30;
TkWindow * (*tkMacGetScrollbarGrowWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 31 */
Window (*tkMacGetXWindow) _ANSI_ARGS_((WindowRef macWinPtr)); /* 32 */
int (*tkMacGrowToplevel) _ANSI_ARGS_((WindowRef whichWindow, Point start)); /* 33 */
void (*tkMacHandleMenuSelect) _ANSI_ARGS_((long mResult, int optionKeyPressed)); /* 34 */
- int (*tkMacHaveAppearance) _ANSI_ARGS_((void)); /* 35 */
- void (*tkMacInitAppleEvents) _ANSI_ARGS_((Tcl_Interp * interp)); /* 36 */
- void (*tkMacInitMenus) _ANSI_ARGS_((Tcl_Interp * interp)); /* 37 */
+ void *reserved35;
+ void *reserved36;
+ void *reserved37;
void (*tkMacInvalidateWindow) _ANSI_ARGS_((MacDrawable * macWin, int flag)); /* 38 */
int (*tkMacIsCharacterMissing) _ANSI_ARGS_((Tk_Font tkfont, unsigned int searchChar)); /* 39 */
void (*tkMacMakeRealWindowExist) _ANSI_ARGS_((TkWindow * winPtr)); /* 40 */
@@ -406,7 +506,7 @@ typedef struct TkIntPlatStubs {
void (*tkMacMenuClick) _ANSI_ARGS_((void)); /* 42 */
void (*tkMacRegisterOffScreenWindow) _ANSI_ARGS_((Window window, GWorldPtr portPtr)); /* 43 */
int (*tkMacResizable) _ANSI_ARGS_((TkWindow * winPtr)); /* 44 */
- void (*tkMacSetEmbedRgn) _ANSI_ARGS_((TkWindow * winPtr, RgnHandle rgn)); /* 45 */
+ void *reserved45;
void (*tkMacSetHelpMenuItemCount) _ANSI_ARGS_((void)); /* 46 */
void (*tkMacSetScrollbarGrow) _ANSI_ARGS_((TkWindow * winPtr, int flag)); /* 47 */
void (*tkMacSetUpClippingRgn) _ANSI_ARGS_((Drawable drawable)); /* 48 */
@@ -417,16 +517,89 @@ typedef struct TkIntPlatStubs {
RgnHandle (*tkMacVisableClipRgn) _ANSI_ARGS_((TkWindow * winPtr)); /* 53 */
void (*tkMacWinBounds) _ANSI_ARGS_((TkWindow * winPtr, Rect * geometry)); /* 54 */
void (*tkMacWindowOffset) _ANSI_ARGS_((WindowRef wRef, int * xOffset, int * yOffset)); /* 55 */
- void (*tkResumeClipboard) _ANSI_ARGS_((void)); /* 56 */
+ void *reserved56;
int (*tkSetMacColor) _ANSI_ARGS_((unsigned long pixel, RGBColor * macColor)); /* 57 */
void (*tkSetWMName) _ANSI_ARGS_((TkWindow * winPtr, Tk_Uid titleUid)); /* 58 */
void (*tkSuspendClipboard) _ANSI_ARGS_((void)); /* 59 */
- int (*tkWMGrowToplevel) _ANSI_ARGS_((WindowRef whichWindow, Point start)); /* 60 */
+ void *reserved60;
int (*tkMacZoomToplevel) _ANSI_ARGS_((WindowPtr whichWindow, Point where, short zoomPart)); /* 61 */
Tk_Window (*tk_TopCoordsToWindow) _ANSI_ARGS_((Tk_Window tkwin, int rootX, int rootY, int * newX, int * newY)); /* 62 */
MacDrawable * (*tkMacContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 63 */
MacDrawable * (*tkMacGetHostToplevel) _ANSI_ARGS_((TkWindow * winPtr)); /* 64 */
+ void (*tkMacPreprocessMenu) _ANSI_ARGS_((void)); /* 65 */
+ int (*tkpIsWindowFloating) _ANSI_ARGS_((WindowRef window)); /* 66 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow * winPtr, int active)); /* 0 */
+ void *reserved1;
+ void *reserved2;
+ void (*tkPointerDeadWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 3 */
+ void (*tkpSetCapture) _ANSI_ARGS_((TkWindow * winPtr)); /* 4 */
+ void (*tkpSetCursor) _ANSI_ARGS_((TkpCursor cursor)); /* 5 */
+ void (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 6 */
+ void (*tkAboutDlg) _ANSI_ARGS_((void)); /* 7 */
+ unsigned int (*tkMacOSXButtonKeyState) _ANSI_ARGS_((void)); /* 8 */
+ void (*tkMacOSXClearMenubarActive) _ANSI_ARGS_((void)); /* 9 */
+ int (*tkMacOSXDispatchMenuEvent) _ANSI_ARGS_((int menuID, int index)); /* 10 */
+ void (*tkMacOSXInstallCursor) _ANSI_ARGS_((int resizeOverride)); /* 11 */
+ void (*tkMacOSXHandleTearoffMenu) _ANSI_ARGS_((void)); /* 12 */
+ void *reserved13;
+ int (*tkMacOSXDoHLEvent) _ANSI_ARGS_((EventRecord * theEvent)); /* 14 */
+ void *reserved15;
+ Window (*tkMacOSXGetXWindow) _ANSI_ARGS_((WindowRef macWinPtr)); /* 16 */
+ int (*tkMacOSXGrowToplevel) _ANSI_ARGS_((WindowRef whichWindow, Point start)); /* 17 */
+ void (*tkMacOSXHandleMenuSelect) _ANSI_ARGS_((long mResult, int optionKeyPressed)); /* 18 */
+ void *reserved19;
+ void *reserved20;
+ void (*tkMacOSXInvalidateWindow) _ANSI_ARGS_((MacDrawable * macWin, int flag)); /* 21 */
+ int (*tkMacOSXIsCharacterMissing) _ANSI_ARGS_((Tk_Font tkfont, unsigned int searchChar)); /* 22 */
+ void (*tkMacOSXMakeRealWindowExist) _ANSI_ARGS_((TkWindow * winPtr)); /* 23 */
+ BitMapPtr (*tkMacOSXMakeStippleMap) _ANSI_ARGS_((Drawable d1, Drawable d2)); /* 24 */
+ void (*tkMacOSXMenuClick) _ANSI_ARGS_((void)); /* 25 */
+ void (*tkMacOSXRegisterOffScreenWindow) _ANSI_ARGS_((Window window, GWorldPtr portPtr)); /* 26 */
+ int (*tkMacOSXResizable) _ANSI_ARGS_((TkWindow * winPtr)); /* 27 */
+ void (*tkMacOSXSetHelpMenuItemCount) _ANSI_ARGS_((void)); /* 28 */
+ void (*tkMacOSXSetScrollbarGrow) _ANSI_ARGS_((TkWindow * winPtr, int flag)); /* 29 */
+ void (*tkMacOSXSetUpClippingRgn) _ANSI_ARGS_((Drawable drawable)); /* 30 */
+ void (*tkMacOSXSetUpGraphicsPort) _ANSI_ARGS_((GC gc, GWorldPtr destPort)); /* 31 */
+ void (*tkMacOSXUpdateClipRgn) _ANSI_ARGS_((TkWindow * winPtr)); /* 32 */
+ void (*tkMacOSXUnregisterMacWindow) _ANSI_ARGS_((WindowRef portPtr)); /* 33 */
+ int (*tkMacOSXUseMenuID) _ANSI_ARGS_((short macID)); /* 34 */
+ RgnHandle (*tkMacOSXVisableClipRgn) _ANSI_ARGS_((TkWindow * winPtr)); /* 35 */
+ void (*tkMacOSXWinBounds) _ANSI_ARGS_((TkWindow * winPtr, Rect * geometry)); /* 36 */
+ void (*tkMacOSXWindowOffset) _ANSI_ARGS_((WindowRef wRef, int * xOffset, int * yOffset)); /* 37 */
+ int (*tkSetMacColor) _ANSI_ARGS_((unsigned long pixel, RGBColor * macColor)); /* 38 */
+ void (*tkSetWMName) _ANSI_ARGS_((TkWindow * winPtr, Tk_Uid titleUid)); /* 39 */
+ void (*tkSuspendClipboard) _ANSI_ARGS_((void)); /* 40 */
+ int (*tkMacOSXZoomToplevel) _ANSI_ARGS_((WindowPtr whichWindow, Point where, short zoomPart)); /* 41 */
+ Tk_Window (*tk_TopCoordsToWindow) _ANSI_ARGS_((Tk_Window tkwin, int rootX, int rootY, int * newX, int * newY)); /* 42 */
+ MacDrawable * (*tkMacOSXContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 43 */
+ MacDrawable * (*tkMacOSXGetHostToplevel) _ANSI_ARGS_((TkWindow * winPtr)); /* 44 */
+ void (*tkMacOSXPreprocessMenu) _ANSI_ARGS_((void)); /* 45 */
+ int (*tkpIsWindowFloating) _ANSI_ARGS_((WindowRef window)); /* 46 */
+ Tk_Window (*tkMacOSXGetCapture) _ANSI_ARGS_((void)); /* 47 */
+ void *reserved48;
+ Window (*tkGetTransientMaster) _ANSI_ARGS_((TkWindow * winPtr)); /* 49 */
+ int (*tkGenerateButtonEvent) _ANSI_ARGS_((int x, int y, Window window, unsigned int state)); /* 50 */
+ void (*tkGenWMDestroyEvent) _ANSI_ARGS_((Tk_Window tkwin)); /* 51 */
+ void *reserved52;
+ unsigned long (*tkpGetMS) _ANSI_ARGS_((void)); /* 53 */
+#endif /* MAC_OSX_TK */
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */
+ void (*tkCreateXEventSource) _ANSI_ARGS_((void)); /* 0 */
+ void (*tkFreeWindowId) _ANSI_ARGS_((TkDisplay * dispPtr, Window w)); /* 1 */
+ void (*tkInitXId) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 2 */
+ int (*tkpCmapStressed) _ANSI_ARGS_((Tk_Window tkwin, Colormap colormap)); /* 3 */
+ void (*tkpSync) _ANSI_ARGS_((Display * display)); /* 4 */
+ Window (*tkUnixContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 5 */
+ int (*tkUnixDoOneXEvent) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 6 */
+ void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 7 */
+ int (*tkpScanWindowId) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * string, Window * idPtr)); /* 8 */
+ void (*tkWmCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 9 */
+ void (*tkSendCleanup) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 10 */
+ void (*tkFreeXId) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 11 */
+ int (*tkpWmSetState) _ANSI_ARGS_((TkWindow * winPtr, int state)); /* 12 */
+#endif /* X11 */
} TkIntPlatStubs;
#ifdef __cplusplus
@@ -443,40 +616,6 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
* Inline function declarations:
*/
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
-#ifndef TkCreateXEventSource
-#define TkCreateXEventSource \
- (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */
-#endif
-#ifndef TkFreeWindowId
-#define TkFreeWindowId \
- (tkIntPlatStubsPtr->tkFreeWindowId) /* 1 */
-#endif
-#ifndef TkInitXId
-#define TkInitXId \
- (tkIntPlatStubsPtr->tkInitXId) /* 2 */
-#endif
-#ifndef TkpCmapStressed
-#define TkpCmapStressed \
- (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */
-#endif
-#ifndef TkpSync
-#define TkpSync \
- (tkIntPlatStubsPtr->tkpSync) /* 4 */
-#endif
-#ifndef TkUnixContainerId
-#define TkUnixContainerId \
- (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */
-#endif
-#ifndef TkUnixDoOneXEvent
-#define TkUnixDoOneXEvent \
- (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */
-#endif
-#ifndef TkUnixSetMenubar
-#define TkUnixSetMenubar \
- (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */
-#endif
-#endif /* UNIX */
#ifdef __WIN32__
#ifndef TkAlignImageData
#define TkAlignImageData \
@@ -617,22 +756,13 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkGenerateActivateEvents \
(tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */
#endif
-#ifndef TkpCreateNativeBitmap
-#define TkpCreateNativeBitmap \
- (tkIntPlatStubsPtr->tkpCreateNativeBitmap) /* 1 */
-#endif
-#ifndef TkpDefineNativeBitmaps
-#define TkpDefineNativeBitmaps \
- (tkIntPlatStubsPtr->tkpDefineNativeBitmaps) /* 2 */
-#endif
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
#ifndef TkpGetMS
#define TkpGetMS \
(tkIntPlatStubsPtr->tkpGetMS) /* 3 */
#endif
-#ifndef TkpGetNativeAppBitmap
-#define TkpGetNativeAppBitmap \
- (tkIntPlatStubsPtr->tkpGetNativeAppBitmap) /* 4 */
-#endif
+/* Slot 4 is reserved */
#ifndef TkPointerDeadWindow
#define TkPointerDeadWindow \
(tkIntPlatStubsPtr->tkPointerDeadWindow) /* 5 */
@@ -649,22 +779,13 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkpWmSetState \
(tkIntPlatStubsPtr->tkpWmSetState) /* 8 */
#endif
-#ifndef HandleWMEvent
-#define HandleWMEvent \
- (tkIntPlatStubsPtr->handleWMEvent) /* 9 */
-#endif
+/* Slot 9 is reserved */
#ifndef TkAboutDlg
#define TkAboutDlg \
(tkIntPlatStubsPtr->tkAboutDlg) /* 10 */
#endif
-#ifndef TkCreateMacEventSource
-#define TkCreateMacEventSource \
- (tkIntPlatStubsPtr->tkCreateMacEventSource) /* 11 */
-#endif
-#ifndef TkFontList
-#define TkFontList \
- (tkIntPlatStubsPtr->tkFontList) /* 12 */
-#endif
+/* Slot 11 is reserved */
+/* Slot 12 is reserved */
#ifndef TkGetTransientMaster
#define TkGetTransientMaster \
(tkIntPlatStubsPtr->tkGetTransientMaster) /* 13 */
@@ -673,18 +794,12 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkGenerateButtonEvent \
(tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 14 */
#endif
-#ifndef TkGetCharPositions
-#define TkGetCharPositions \
- (tkIntPlatStubsPtr->tkGetCharPositions) /* 15 */
-#endif
+/* Slot 15 is reserved */
#ifndef TkGenWMDestroyEvent
#define TkGenWMDestroyEvent \
(tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 16 */
#endif
-#ifndef TkGenWMConfigureEvent
-#define TkGenWMConfigureEvent \
- (tkIntPlatStubsPtr->tkGenWMConfigureEvent) /* 17 */
-#endif
+/* Slot 17 is reserved */
#ifndef TkMacButtonKeyState
#define TkMacButtonKeyState \
(tkIntPlatStubsPtr->tkMacButtonKeyState) /* 18 */
@@ -693,10 +808,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkMacClearMenubarActive \
(tkIntPlatStubsPtr->tkMacClearMenubarActive) /* 19 */
#endif
-#ifndef TkMacConvertEvent
-#define TkMacConvertEvent \
- (tkIntPlatStubsPtr->tkMacConvertEvent) /* 20 */
-#endif
+/* Slot 20 is reserved */
#ifndef TkMacDispatchMenuEvent
#define TkMacDispatchMenuEvent \
(tkIntPlatStubsPtr->tkMacDispatchMenuEvent) /* 21 */
@@ -705,38 +817,23 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkMacInstallCursor \
(tkIntPlatStubsPtr->tkMacInstallCursor) /* 22 */
#endif
-#ifndef TkMacConvertTkEvent
-#define TkMacConvertTkEvent \
- (tkIntPlatStubsPtr->tkMacConvertTkEvent) /* 23 */
-#endif
+/* Slot 23 is reserved */
#ifndef TkMacHandleTearoffMenu
#define TkMacHandleTearoffMenu \
(tkIntPlatStubsPtr->tkMacHandleTearoffMenu) /* 24 */
#endif
-#ifndef tkMacInstallMWConsole
-#define tkMacInstallMWConsole \
- (tkIntPlatStubsPtr->tkMacInstallMWConsole) /* 25 */
-#endif
-#ifndef TkMacInvalClipRgns
-#define TkMacInvalClipRgns \
- (tkIntPlatStubsPtr->tkMacInvalClipRgns) /* 26 */
-#endif
+/* Slot 25 is reserved */
+/* Slot 26 is reserved */
#ifndef TkMacDoHLEvent
#define TkMacDoHLEvent \
(tkIntPlatStubsPtr->tkMacDoHLEvent) /* 27 */
#endif
-#ifndef TkMacFontInfo
-#define TkMacFontInfo \
- (tkIntPlatStubsPtr->tkMacFontInfo) /* 28 */
-#endif
+/* Slot 28 is reserved */
#ifndef TkMacGenerateTime
#define TkMacGenerateTime \
(tkIntPlatStubsPtr->tkMacGenerateTime) /* 29 */
#endif
-#ifndef TkMacGetDrawablePort
-#define TkMacGetDrawablePort \
- (tkIntPlatStubsPtr->tkMacGetDrawablePort) /* 30 */
-#endif
+/* Slot 30 is reserved */
#ifndef TkMacGetScrollbarGrowWindow
#define TkMacGetScrollbarGrowWindow \
(tkIntPlatStubsPtr->tkMacGetScrollbarGrowWindow) /* 31 */
@@ -753,18 +850,9 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkMacHandleMenuSelect \
(tkIntPlatStubsPtr->tkMacHandleMenuSelect) /* 34 */
#endif
-#ifndef TkMacHaveAppearance
-#define TkMacHaveAppearance \
- (tkIntPlatStubsPtr->tkMacHaveAppearance) /* 35 */
-#endif
-#ifndef TkMacInitAppleEvents
-#define TkMacInitAppleEvents \
- (tkIntPlatStubsPtr->tkMacInitAppleEvents) /* 36 */
-#endif
-#ifndef TkMacInitMenus
-#define TkMacInitMenus \
- (tkIntPlatStubsPtr->tkMacInitMenus) /* 37 */
-#endif
+/* Slot 35 is reserved */
+/* Slot 36 is reserved */
+/* Slot 37 is reserved */
#ifndef TkMacInvalidateWindow
#define TkMacInvalidateWindow \
(tkIntPlatStubsPtr->tkMacInvalidateWindow) /* 38 */
@@ -793,10 +881,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkMacResizable \
(tkIntPlatStubsPtr->tkMacResizable) /* 44 */
#endif
-#ifndef TkMacSetEmbedRgn
-#define TkMacSetEmbedRgn \
- (tkIntPlatStubsPtr->tkMacSetEmbedRgn) /* 45 */
-#endif
+/* Slot 45 is reserved */
#ifndef TkMacSetHelpMenuItemCount
#define TkMacSetHelpMenuItemCount \
(tkIntPlatStubsPtr->tkMacSetHelpMenuItemCount) /* 46 */
@@ -837,10 +922,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkMacWindowOffset \
(tkIntPlatStubsPtr->tkMacWindowOffset) /* 55 */
#endif
-#ifndef TkResumeClipboard
-#define TkResumeClipboard \
- (tkIntPlatStubsPtr->tkResumeClipboard) /* 56 */
-#endif
+/* Slot 56 is reserved */
#ifndef TkSetMacColor
#define TkSetMacColor \
(tkIntPlatStubsPtr->tkSetMacColor) /* 57 */
@@ -853,10 +935,7 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkSuspendClipboard \
(tkIntPlatStubsPtr->tkSuspendClipboard) /* 59 */
#endif
-#ifndef TkWMGrowToplevel
-#define TkWMGrowToplevel \
- (tkIntPlatStubsPtr->tkWMGrowToplevel) /* 60 */
-#endif
+/* Slot 60 is reserved */
#ifndef TkMacZoomToplevel
#define TkMacZoomToplevel \
(tkIntPlatStubsPtr->tkMacZoomToplevel) /* 61 */
@@ -873,7 +952,263 @@ extern TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkMacGetHostToplevel \
(tkIntPlatStubsPtr->tkMacGetHostToplevel) /* 64 */
#endif
+#ifndef TkMacPreprocessMenu
+#define TkMacPreprocessMenu \
+ (tkIntPlatStubsPtr->tkMacPreprocessMenu) /* 65 */
+#endif
+#ifndef TkpIsWindowFloating
+#define TkpIsWindowFloating \
+ (tkIntPlatStubsPtr->tkpIsWindowFloating) /* 66 */
+#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef TkGenerateActivateEvents
+#define TkGenerateActivateEvents \
+ (tkIntPlatStubsPtr->tkGenerateActivateEvents) /* 0 */
+#endif
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
+#ifndef TkPointerDeadWindow
+#define TkPointerDeadWindow \
+ (tkIntPlatStubsPtr->tkPointerDeadWindow) /* 3 */
+#endif
+#ifndef TkpSetCapture
+#define TkpSetCapture \
+ (tkIntPlatStubsPtr->tkpSetCapture) /* 4 */
+#endif
+#ifndef TkpSetCursor
+#define TkpSetCursor \
+ (tkIntPlatStubsPtr->tkpSetCursor) /* 5 */
+#endif
+#ifndef TkpWmSetState
+#define TkpWmSetState \
+ (tkIntPlatStubsPtr->tkpWmSetState) /* 6 */
+#endif
+#ifndef TkAboutDlg
+#define TkAboutDlg \
+ (tkIntPlatStubsPtr->tkAboutDlg) /* 7 */
+#endif
+#ifndef TkMacOSXButtonKeyState
+#define TkMacOSXButtonKeyState \
+ (tkIntPlatStubsPtr->tkMacOSXButtonKeyState) /* 8 */
+#endif
+#ifndef TkMacOSXClearMenubarActive
+#define TkMacOSXClearMenubarActive \
+ (tkIntPlatStubsPtr->tkMacOSXClearMenubarActive) /* 9 */
+#endif
+#ifndef TkMacOSXDispatchMenuEvent
+#define TkMacOSXDispatchMenuEvent \
+ (tkIntPlatStubsPtr->tkMacOSXDispatchMenuEvent) /* 10 */
+#endif
+#ifndef TkMacOSXInstallCursor
+#define TkMacOSXInstallCursor \
+ (tkIntPlatStubsPtr->tkMacOSXInstallCursor) /* 11 */
+#endif
+#ifndef TkMacOSXHandleTearoffMenu
+#define TkMacOSXHandleTearoffMenu \
+ (tkIntPlatStubsPtr->tkMacOSXHandleTearoffMenu) /* 12 */
+#endif
+/* Slot 13 is reserved */
+#ifndef TkMacOSXDoHLEvent
+#define TkMacOSXDoHLEvent \
+ (tkIntPlatStubsPtr->tkMacOSXDoHLEvent) /* 14 */
+#endif
+/* Slot 15 is reserved */
+#ifndef TkMacOSXGetXWindow
+#define TkMacOSXGetXWindow \
+ (tkIntPlatStubsPtr->tkMacOSXGetXWindow) /* 16 */
+#endif
+#ifndef TkMacOSXGrowToplevel
+#define TkMacOSXGrowToplevel \
+ (tkIntPlatStubsPtr->tkMacOSXGrowToplevel) /* 17 */
+#endif
+#ifndef TkMacOSXHandleMenuSelect
+#define TkMacOSXHandleMenuSelect \
+ (tkIntPlatStubsPtr->tkMacOSXHandleMenuSelect) /* 18 */
+#endif
+/* Slot 19 is reserved */
+/* Slot 20 is reserved */
+#ifndef TkMacOSXInvalidateWindow
+#define TkMacOSXInvalidateWindow \
+ (tkIntPlatStubsPtr->tkMacOSXInvalidateWindow) /* 21 */
+#endif
+#ifndef TkMacOSXIsCharacterMissing
+#define TkMacOSXIsCharacterMissing \
+ (tkIntPlatStubsPtr->tkMacOSXIsCharacterMissing) /* 22 */
+#endif
+#ifndef TkMacOSXMakeRealWindowExist
+#define TkMacOSXMakeRealWindowExist \
+ (tkIntPlatStubsPtr->tkMacOSXMakeRealWindowExist) /* 23 */
+#endif
+#ifndef TkMacOSXMakeStippleMap
+#define TkMacOSXMakeStippleMap \
+ (tkIntPlatStubsPtr->tkMacOSXMakeStippleMap) /* 24 */
+#endif
+#ifndef TkMacOSXMenuClick
+#define TkMacOSXMenuClick \
+ (tkIntPlatStubsPtr->tkMacOSXMenuClick) /* 25 */
+#endif
+#ifndef TkMacOSXRegisterOffScreenWindow
+#define TkMacOSXRegisterOffScreenWindow \
+ (tkIntPlatStubsPtr->tkMacOSXRegisterOffScreenWindow) /* 26 */
+#endif
+#ifndef TkMacOSXResizable
+#define TkMacOSXResizable \
+ (tkIntPlatStubsPtr->tkMacOSXResizable) /* 27 */
+#endif
+#ifndef TkMacOSXSetHelpMenuItemCount
+#define TkMacOSXSetHelpMenuItemCount \
+ (tkIntPlatStubsPtr->tkMacOSXSetHelpMenuItemCount) /* 28 */
+#endif
+#ifndef TkMacOSXSetScrollbarGrow
+#define TkMacOSXSetScrollbarGrow \
+ (tkIntPlatStubsPtr->tkMacOSXSetScrollbarGrow) /* 29 */
+#endif
+#ifndef TkMacOSXSetUpClippingRgn
+#define TkMacOSXSetUpClippingRgn \
+ (tkIntPlatStubsPtr->tkMacOSXSetUpClippingRgn) /* 30 */
+#endif
+#ifndef TkMacOSXSetUpGraphicsPort
+#define TkMacOSXSetUpGraphicsPort \
+ (tkIntPlatStubsPtr->tkMacOSXSetUpGraphicsPort) /* 31 */
+#endif
+#ifndef TkMacOSXUpdateClipRgn
+#define TkMacOSXUpdateClipRgn \
+ (tkIntPlatStubsPtr->tkMacOSXUpdateClipRgn) /* 32 */
+#endif
+#ifndef TkMacOSXUnregisterMacWindow
+#define TkMacOSXUnregisterMacWindow \
+ (tkIntPlatStubsPtr->tkMacOSXUnregisterMacWindow) /* 33 */
+#endif
+#ifndef TkMacOSXUseMenuID
+#define TkMacOSXUseMenuID \
+ (tkIntPlatStubsPtr->tkMacOSXUseMenuID) /* 34 */
+#endif
+#ifndef TkMacOSXVisableClipRgn
+#define TkMacOSXVisableClipRgn \
+ (tkIntPlatStubsPtr->tkMacOSXVisableClipRgn) /* 35 */
+#endif
+#ifndef TkMacOSXWinBounds
+#define TkMacOSXWinBounds \
+ (tkIntPlatStubsPtr->tkMacOSXWinBounds) /* 36 */
+#endif
+#ifndef TkMacOSXWindowOffset
+#define TkMacOSXWindowOffset \
+ (tkIntPlatStubsPtr->tkMacOSXWindowOffset) /* 37 */
+#endif
+#ifndef TkSetMacColor
+#define TkSetMacColor \
+ (tkIntPlatStubsPtr->tkSetMacColor) /* 38 */
+#endif
+#ifndef TkSetWMName
+#define TkSetWMName \
+ (tkIntPlatStubsPtr->tkSetWMName) /* 39 */
+#endif
+#ifndef TkSuspendClipboard
+#define TkSuspendClipboard \
+ (tkIntPlatStubsPtr->tkSuspendClipboard) /* 40 */
+#endif
+#ifndef TkMacOSXZoomToplevel
+#define TkMacOSXZoomToplevel \
+ (tkIntPlatStubsPtr->tkMacOSXZoomToplevel) /* 41 */
+#endif
+#ifndef Tk_TopCoordsToWindow
+#define Tk_TopCoordsToWindow \
+ (tkIntPlatStubsPtr->tk_TopCoordsToWindow) /* 42 */
+#endif
+#ifndef TkMacOSXContainerId
+#define TkMacOSXContainerId \
+ (tkIntPlatStubsPtr->tkMacOSXContainerId) /* 43 */
+#endif
+#ifndef TkMacOSXGetHostToplevel
+#define TkMacOSXGetHostToplevel \
+ (tkIntPlatStubsPtr->tkMacOSXGetHostToplevel) /* 44 */
+#endif
+#ifndef TkMacOSXPreprocessMenu
+#define TkMacOSXPreprocessMenu \
+ (tkIntPlatStubsPtr->tkMacOSXPreprocessMenu) /* 45 */
+#endif
+#ifndef TkpIsWindowFloating
+#define TkpIsWindowFloating \
+ (tkIntPlatStubsPtr->tkpIsWindowFloating) /* 46 */
+#endif
+#ifndef TkMacOSXGetCapture
+#define TkMacOSXGetCapture \
+ (tkIntPlatStubsPtr->tkMacOSXGetCapture) /* 47 */
+#endif
+/* Slot 48 is reserved */
+#ifndef TkGetTransientMaster
+#define TkGetTransientMaster \
+ (tkIntPlatStubsPtr->tkGetTransientMaster) /* 49 */
+#endif
+#ifndef TkGenerateButtonEvent
+#define TkGenerateButtonEvent \
+ (tkIntPlatStubsPtr->tkGenerateButtonEvent) /* 50 */
+#endif
+#ifndef TkGenWMDestroyEvent
+#define TkGenWMDestroyEvent \
+ (tkIntPlatStubsPtr->tkGenWMDestroyEvent) /* 51 */
+#endif
+/* Slot 52 is reserved */
+#ifndef TkpGetMS
+#define TkpGetMS \
+ (tkIntPlatStubsPtr->tkpGetMS) /* 53 */
+#endif
+#endif /* MAC_OSX_TK */
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */
+#ifndef TkCreateXEventSource
+#define TkCreateXEventSource \
+ (tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */
+#endif
+#ifndef TkFreeWindowId
+#define TkFreeWindowId \
+ (tkIntPlatStubsPtr->tkFreeWindowId) /* 1 */
+#endif
+#ifndef TkInitXId
+#define TkInitXId \
+ (tkIntPlatStubsPtr->tkInitXId) /* 2 */
+#endif
+#ifndef TkpCmapStressed
+#define TkpCmapStressed \
+ (tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */
+#endif
+#ifndef TkpSync
+#define TkpSync \
+ (tkIntPlatStubsPtr->tkpSync) /* 4 */
+#endif
+#ifndef TkUnixContainerId
+#define TkUnixContainerId \
+ (tkIntPlatStubsPtr->tkUnixContainerId) /* 5 */
+#endif
+#ifndef TkUnixDoOneXEvent
+#define TkUnixDoOneXEvent \
+ (tkIntPlatStubsPtr->tkUnixDoOneXEvent) /* 6 */
+#endif
+#ifndef TkUnixSetMenubar
+#define TkUnixSetMenubar \
+ (tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */
+#endif
+#ifndef TkpScanWindowId
+#define TkpScanWindowId \
+ (tkIntPlatStubsPtr->tkpScanWindowId) /* 8 */
+#endif
+#ifndef TkWmCleanup
+#define TkWmCleanup \
+ (tkIntPlatStubsPtr->tkWmCleanup) /* 9 */
+#endif
+#ifndef TkSendCleanup
+#define TkSendCleanup \
+ (tkIntPlatStubsPtr->tkSendCleanup) /* 10 */
+#endif
+#ifndef TkFreeXId
+#define TkFreeXId \
+ (tkIntPlatStubsPtr->tkFreeXId) /* 11 */
+#endif
+#ifndef TkpWmSetState
+#define TkpWmSetState \
+ (tkIntPlatStubsPtr->tkpWmSetState) /* 12 */
+#endif
+#endif /* X11 */
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
diff --git a/tk/generic/tkIntXlibDecls.h b/tk/generic/tkIntXlibDecls.h
index 7126dd6bcc6..9f9e00e7e89 100644
--- a/tk/generic/tkIntXlibDecls.h
+++ b/tk/generic/tkIntXlibDecls.h
@@ -231,7 +231,7 @@ EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b,
long l, XEvent* x));
/* 62 */
EXTERN void XSetCommand _ANSI_ARGS_((Display* d, Window w,
- char** c, int i));
+ CONST char** c, int i));
/* 63 */
EXTERN void XSetIconName _ANSI_ARGS_((Display* d, Window w,
_Xconst char* c));
@@ -652,6 +652,292 @@ EXTERN void XQueryColors _ANSI_ARGS_((Display * display,
Colormap colormap, XColor * defs_in_out,
int ncolors));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 0 */
+EXTERN void XSetDashes _ANSI_ARGS_((Display* display, GC gc,
+ int dash_offset, _Xconst char* dash_list,
+ int n));
+/* 1 */
+EXTERN XModifierKeymap* XGetModifierMapping _ANSI_ARGS_((Display* d));
+/* 2 */
+EXTERN XImage * XCreateImage _ANSI_ARGS_((Display* d, Visual* v,
+ unsigned int ui1, int i1, int i2, char* cp,
+ unsigned int ui2, unsigned int ui3, int i3,
+ int i4));
+/* 3 */
+EXTERN XImage * XGetImage _ANSI_ARGS_((Display* d, Drawable dr,
+ int i1, int i2, unsigned int ui1,
+ unsigned int ui2, unsigned long ul, int i3));
+/* 4 */
+EXTERN char * XGetAtomName _ANSI_ARGS_((Display* d, Atom a));
+/* 5 */
+EXTERN char * XKeysymToString _ANSI_ARGS_((KeySym k));
+/* 6 */
+EXTERN Colormap XCreateColormap _ANSI_ARGS_((Display* d, Window w,
+ Visual* v, int i));
+/* 7 */
+EXTERN GContext XGContextFromGC _ANSI_ARGS_((GC g));
+/* 8 */
+EXTERN KeySym XKeycodeToKeysym _ANSI_ARGS_((Display* d, KeyCode k,
+ int i));
+/* 9 */
+EXTERN KeySym XStringToKeysym _ANSI_ARGS_((_Xconst char* c));
+/* 10 */
+EXTERN Window XRootWindow _ANSI_ARGS_((Display* d, int i));
+/* 11 */
+EXTERN XErrorHandler XSetErrorHandler _ANSI_ARGS_((XErrorHandler x));
+/* 12 */
+EXTERN Status XAllocColor _ANSI_ARGS_((Display* d, Colormap c,
+ XColor* xp));
+/* 13 */
+EXTERN void XBell _ANSI_ARGS_((Display* d, int i));
+/* 14 */
+EXTERN void XChangeProperty _ANSI_ARGS_((Display* d, Window w,
+ Atom a1, Atom a2, int i1, int i2,
+ _Xconst unsigned char* c, int i3));
+/* 15 */
+EXTERN void XChangeWindowAttributes _ANSI_ARGS_((Display* d,
+ Window w, unsigned long ul,
+ XSetWindowAttributes* x));
+/* 16 */
+EXTERN void XConfigureWindow _ANSI_ARGS_((Display* d, Window w,
+ unsigned int i, XWindowChanges* x));
+/* 17 */
+EXTERN void XCopyArea _ANSI_ARGS_((Display* d, Drawable dr1,
+ Drawable dr2, GC g, int i1, int i2,
+ unsigned int ui1, unsigned int ui2, int i3,
+ int i4));
+/* 18 */
+EXTERN void XCopyPlane _ANSI_ARGS_((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));
+/* 19 */
+EXTERN Pixmap XCreateBitmapFromData _ANSI_ARGS_((Display* display,
+ Drawable d, _Xconst char* data,
+ unsigned int width, unsigned int height));
+/* 20 */
+EXTERN void XDefineCursor _ANSI_ARGS_((Display* d, Window w,
+ Cursor c));
+/* 21 */
+EXTERN void XDestroyWindow _ANSI_ARGS_((Display* d, Window w));
+/* 22 */
+EXTERN void XDrawArc _ANSI_ARGS_((Display* d, Drawable dr, GC g,
+ int i1, int i2, unsigned int ui1,
+ unsigned int ui2, int i3, int i4));
+/* 23 */
+EXTERN void XDrawLines _ANSI_ARGS_((Display* d, Drawable dr,
+ GC g, XPoint* x, int i1, int i2));
+/* 24 */
+EXTERN void XDrawRectangle _ANSI_ARGS_((Display* d, Drawable dr,
+ GC g, int i1, int i2, unsigned int ui1,
+ unsigned int ui2));
+/* 25 */
+EXTERN void XFillArc _ANSI_ARGS_((Display* d, Drawable dr, GC g,
+ int i1, int i2, unsigned int ui1,
+ unsigned int ui2, int i3, int i4));
+/* 26 */
+EXTERN void XFillPolygon _ANSI_ARGS_((Display* d, Drawable dr,
+ GC g, XPoint* x, int i1, int i2, int i3));
+/* 27 */
+EXTERN void XFillRectangles _ANSI_ARGS_((Display* d, Drawable dr,
+ GC g, XRectangle* x, int i));
+/* 28 */
+EXTERN void XFreeColormap _ANSI_ARGS_((Display* d, Colormap c));
+/* 29 */
+EXTERN void XFreeColors _ANSI_ARGS_((Display* d, Colormap c,
+ unsigned long* ulp, int i, unsigned long ul));
+/* 30 */
+EXTERN void XFreeModifiermap _ANSI_ARGS_((XModifierKeymap* x));
+/* 31 */
+EXTERN Status XGetGeometry _ANSI_ARGS_((Display* d, Drawable dr,
+ Window* w, int* i1, int* i2,
+ unsigned int* ui1, unsigned int* ui2,
+ unsigned int* ui3, unsigned int* ui4));
+/* 32 */
+EXTERN int XGetWindowProperty _ANSI_ARGS_((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));
+/* 33 */
+EXTERN int XGrabKeyboard _ANSI_ARGS_((Display* d, Window w,
+ Bool b, int i1, int i2, Time t));
+/* 34 */
+EXTERN int XGrabPointer _ANSI_ARGS_((Display* d, Window w1,
+ Bool b, unsigned int ui, int i1, int i2,
+ Window w2, Cursor c, Time t));
+/* 35 */
+EXTERN KeyCode XKeysymToKeycode _ANSI_ARGS_((Display* d, KeySym k));
+/* 36 */
+EXTERN void XMapWindow _ANSI_ARGS_((Display* d, Window w));
+/* 37 */
+EXTERN void XMoveResizeWindow _ANSI_ARGS_((Display* d, Window w,
+ int i1, int i2, unsigned int ui1,
+ unsigned int ui2));
+/* 38 */
+EXTERN void XMoveWindow _ANSI_ARGS_((Display* d, Window w,
+ int i1, int i2));
+/* 39 */
+EXTERN Bool XQueryPointer _ANSI_ARGS_((Display* d, Window w1,
+ Window* w2, Window* w3, int* i1, int* i2,
+ int* i3, int* i4, unsigned int* ui));
+/* 40 */
+EXTERN void XRaiseWindow _ANSI_ARGS_((Display* d, Window w));
+/* 41 */
+EXTERN void XRefreshKeyboardMapping _ANSI_ARGS_((
+ XMappingEvent* x));
+/* 42 */
+EXTERN void XResizeWindow _ANSI_ARGS_((Display* d, Window w,
+ unsigned int ui1, unsigned int ui2));
+/* 43 */
+EXTERN void XSelectInput _ANSI_ARGS_((Display* d, Window w,
+ long l));
+/* 44 */
+EXTERN Status XSendEvent _ANSI_ARGS_((Display* d, Window w, Bool b,
+ long l, XEvent* x));
+/* 45 */
+EXTERN void XSetIconName _ANSI_ARGS_((Display* d, Window w,
+ _Xconst char* c));
+/* 46 */
+EXTERN void XSetInputFocus _ANSI_ARGS_((Display* d, Window w,
+ int i, Time t));
+/* 47 */
+EXTERN void XSetSelectionOwner _ANSI_ARGS_((Display* d, Atom a,
+ Window w, Time t));
+/* 48 */
+EXTERN void XSetWindowBackground _ANSI_ARGS_((Display* d,
+ Window w, unsigned long ul));
+/* 49 */
+EXTERN void XSetWindowBackgroundPixmap _ANSI_ARGS_((Display* d,
+ Window w, Pixmap p));
+/* 50 */
+EXTERN void XSetWindowBorder _ANSI_ARGS_((Display* d, Window w,
+ unsigned long ul));
+/* 51 */
+EXTERN void XSetWindowBorderPixmap _ANSI_ARGS_((Display* d,
+ Window w, Pixmap p));
+/* 52 */
+EXTERN void XSetWindowBorderWidth _ANSI_ARGS_((Display* d,
+ Window w, unsigned int ui));
+/* 53 */
+EXTERN void XSetWindowColormap _ANSI_ARGS_((Display* d, Window w,
+ Colormap c));
+/* 54 */
+EXTERN void XUngrabKeyboard _ANSI_ARGS_((Display* d, Time t));
+/* 55 */
+EXTERN void XUngrabPointer _ANSI_ARGS_((Display* d, Time t));
+/* 56 */
+EXTERN void XUnmapWindow _ANSI_ARGS_((Display* d, Window w));
+/* 57 */
+EXTERN void TkPutImage _ANSI_ARGS_((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));
+/* 58 */
+EXTERN Status XParseColor _ANSI_ARGS_((Display * display,
+ Colormap map, _Xconst char* spec,
+ XColor * colorPtr));
+/* 59 */
+EXTERN GC XCreateGC _ANSI_ARGS_((Display* display, Drawable d,
+ unsigned long valuemask, XGCValues* values));
+/* 60 */
+EXTERN void XFreeGC _ANSI_ARGS_((Display* display, GC gc));
+/* 61 */
+EXTERN Atom XInternAtom _ANSI_ARGS_((Display* display,
+ _Xconst char* atom_name, Bool only_if_exists));
+/* 62 */
+EXTERN void XSetBackground _ANSI_ARGS_((Display* display, GC gc,
+ unsigned long foreground));
+/* 63 */
+EXTERN void XSetForeground _ANSI_ARGS_((Display* display, GC gc,
+ unsigned long foreground));
+/* 64 */
+EXTERN void XSetClipMask _ANSI_ARGS_((Display* display, GC gc,
+ Pixmap pixmap));
+/* 65 */
+EXTERN void XSetClipOrigin _ANSI_ARGS_((Display* display, GC gc,
+ int clip_x_origin, int clip_y_origin));
+/* 66 */
+EXTERN void XSetTSOrigin _ANSI_ARGS_((Display* display, GC gc,
+ int ts_x_origin, int ts_y_origin));
+/* 67 */
+EXTERN void XChangeGC _ANSI_ARGS_((Display * d, GC gc,
+ unsigned long mask, XGCValues * values));
+/* 68 */
+EXTERN void XSetFont _ANSI_ARGS_((Display * display, GC gc,
+ Font font));
+/* 69 */
+EXTERN void XSetArcMode _ANSI_ARGS_((Display * display, GC gc,
+ int arc_mode));
+/* 70 */
+EXTERN void XSetStipple _ANSI_ARGS_((Display * display, GC gc,
+ Pixmap stipple));
+/* 71 */
+EXTERN void XSetFillRule _ANSI_ARGS_((Display * display, GC gc,
+ int fill_rule));
+/* 72 */
+EXTERN void XSetFillStyle _ANSI_ARGS_((Display * display, GC gc,
+ int fill_style));
+/* 73 */
+EXTERN void XSetFunction _ANSI_ARGS_((Display * display, GC gc,
+ int function));
+/* 74 */
+EXTERN void XSetLineAttributes _ANSI_ARGS_((Display * display,
+ GC gc, unsigned int line_width,
+ int line_style, int cap_style,
+ int join_style));
+/* 75 */
+EXTERN int _XInitImageFuncPtrs _ANSI_ARGS_((XImage * image));
+/* 76 */
+EXTERN XIC XCreateIC _ANSI_ARGS_((void));
+/* 77 */
+EXTERN XVisualInfo * XGetVisualInfo _ANSI_ARGS_((Display* display,
+ long vinfo_mask, XVisualInfo* vinfo_template,
+ int* nitems_return));
+/* 78 */
+EXTERN void XSetWMClientMachine _ANSI_ARGS_((Display* display,
+ Window w, XTextProperty* text_prop));
+/* 79 */
+EXTERN Status XStringListToTextProperty _ANSI_ARGS_((char** list,
+ int count, XTextProperty* text_prop_return));
+/* 80 */
+EXTERN void XDrawSegments _ANSI_ARGS_((Display * display,
+ Drawable d, GC gc, XSegment * segments,
+ int nsegments));
+/* 81 */
+EXTERN void XForceScreenSaver _ANSI_ARGS_((Display* display,
+ int mode));
+/* 82 */
+EXTERN void XDrawLine _ANSI_ARGS_((Display* d, Drawable dr, GC g,
+ int x1, int y1, int x2, int y2));
+/* 83 */
+EXTERN void XFillRectangle _ANSI_ARGS_((Display* display,
+ Drawable d, GC gc, int x, int y,
+ unsigned int width, unsigned int height));
+/* 84 */
+EXTERN void XClearWindow _ANSI_ARGS_((Display* d, Window w));
+/* 85 */
+EXTERN void XDrawPoint _ANSI_ARGS_((Display* display, Drawable d,
+ GC gc, int x, int y));
+/* 86 */
+EXTERN void XDrawPoints _ANSI_ARGS_((Display* display,
+ Drawable d, GC gc, XPoint * points,
+ int npoints, int mode));
+/* 87 */
+EXTERN void XWarpPointer _ANSI_ARGS_((Display* display,
+ Window src_w, Window dest_w, int src_x,
+ int src_y, unsigned int src_width,
+ unsigned int src_height, int dest_x,
+ int dest_y));
+/* 88 */
+EXTERN void XQueryColor _ANSI_ARGS_((Display * display,
+ Colormap colormap, XColor * def_in_out));
+/* 89 */
+EXTERN void XQueryColors _ANSI_ARGS_((Display * display,
+ Colormap colormap, XColor * defs_in_out,
+ int ncolors));
+#endif /* MAC_OSX_TK */
typedef struct TkIntXlibStubs {
int magic;
@@ -720,7 +1006,7 @@ typedef struct TkIntXlibStubs {
void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 59 */
void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 60 */
Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 61 */
- void (*xSetCommand) _ANSI_ARGS_((Display* d, Window w, char** c, int i)); /* 62 */
+ void (*xSetCommand) _ANSI_ARGS_((Display* d, Window w, CONST char** c, int i)); /* 62 */
void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 63 */
void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 64 */
void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 65 */
@@ -858,6 +1144,98 @@ typedef struct TkIntXlibStubs {
void (*xQueryColor) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * def_in_out)); /* 88 */
void (*xQueryColors) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * defs_in_out, int ncolors)); /* 89 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*xSetDashes) _ANSI_ARGS_((Display* display, GC gc, int dash_offset, _Xconst char* dash_list, int n)); /* 0 */
+ XModifierKeymap* (*xGetModifierMapping) _ANSI_ARGS_((Display* d)); /* 1 */
+ XImage * (*xCreateImage) _ANSI_ARGS_((Display* d, Visual* v, unsigned int ui1, int i1, int i2, char* cp, unsigned int ui2, unsigned int ui3, int i3, int i4)); /* 2 */
+ XImage * (*xGetImage) _ANSI_ARGS_((Display* d, Drawable dr, int i1, int i2, unsigned int ui1, unsigned int ui2, unsigned long ul, int i3)); /* 3 */
+ char * (*xGetAtomName) _ANSI_ARGS_((Display* d, Atom a)); /* 4 */
+ char * (*xKeysymToString) _ANSI_ARGS_((KeySym k)); /* 5 */
+ Colormap (*xCreateColormap) _ANSI_ARGS_((Display* d, Window w, Visual* v, int i)); /* 6 */
+ GContext (*xGContextFromGC) _ANSI_ARGS_((GC g)); /* 7 */
+ KeySym (*xKeycodeToKeysym) _ANSI_ARGS_((Display* d, KeyCode k, int i)); /* 8 */
+ KeySym (*xStringToKeysym) _ANSI_ARGS_((_Xconst char* c)); /* 9 */
+ Window (*xRootWindow) _ANSI_ARGS_((Display* d, int i)); /* 10 */
+ XErrorHandler (*xSetErrorHandler) _ANSI_ARGS_((XErrorHandler x)); /* 11 */
+ Status (*xAllocColor) _ANSI_ARGS_((Display* d, Colormap c, XColor* xp)); /* 12 */
+ void (*xBell) _ANSI_ARGS_((Display* d, int i)); /* 13 */
+ void (*xChangeProperty) _ANSI_ARGS_((Display* d, Window w, Atom a1, Atom a2, int i1, int i2, _Xconst unsigned char* c, int i3)); /* 14 */
+ void (*xChangeWindowAttributes) _ANSI_ARGS_((Display* d, Window w, unsigned long ul, XSetWindowAttributes* x)); /* 15 */
+ void (*xConfigureWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int i, XWindowChanges* x)); /* 16 */
+ void (*xCopyArea) _ANSI_ARGS_((Display* d, Drawable dr1, Drawable dr2, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 17 */
+ void (*xCopyPlane) _ANSI_ARGS_((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)); /* 18 */
+ Pixmap (*xCreateBitmapFromData) _ANSI_ARGS_((Display* display, Drawable d, _Xconst char* data, unsigned int width, unsigned int height)); /* 19 */
+ void (*xDefineCursor) _ANSI_ARGS_((Display* d, Window w, Cursor c)); /* 20 */
+ void (*xDestroyWindow) _ANSI_ARGS_((Display* d, Window w)); /* 21 */
+ void (*xDrawArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 22 */
+ void (*xDrawLines) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2)); /* 23 */
+ void (*xDrawRectangle) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 24 */
+ void (*xFillArc) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int i1, int i2, unsigned int ui1, unsigned int ui2, int i3, int i4)); /* 25 */
+ void (*xFillPolygon) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XPoint* x, int i1, int i2, int i3)); /* 26 */
+ void (*xFillRectangles) _ANSI_ARGS_((Display* d, Drawable dr, GC g, XRectangle* x, int i)); /* 27 */
+ void (*xFreeColormap) _ANSI_ARGS_((Display* d, Colormap c)); /* 28 */
+ void (*xFreeColors) _ANSI_ARGS_((Display* d, Colormap c, unsigned long* ulp, int i, unsigned long ul)); /* 29 */
+ void (*xFreeModifiermap) _ANSI_ARGS_((XModifierKeymap* x)); /* 30 */
+ Status (*xGetGeometry) _ANSI_ARGS_((Display* d, Drawable dr, Window* w, int* i1, int* i2, unsigned int* ui1, unsigned int* ui2, unsigned int* ui3, unsigned int* ui4)); /* 31 */
+ int (*xGetWindowProperty) _ANSI_ARGS_((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)); /* 32 */
+ int (*xGrabKeyboard) _ANSI_ARGS_((Display* d, Window w, Bool b, int i1, int i2, Time t)); /* 33 */
+ int (*xGrabPointer) _ANSI_ARGS_((Display* d, Window w1, Bool b, unsigned int ui, int i1, int i2, Window w2, Cursor c, Time t)); /* 34 */
+ KeyCode (*xKeysymToKeycode) _ANSI_ARGS_((Display* d, KeySym k)); /* 35 */
+ void (*xMapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 36 */
+ void (*xMoveResizeWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2, unsigned int ui1, unsigned int ui2)); /* 37 */
+ void (*xMoveWindow) _ANSI_ARGS_((Display* d, Window w, int i1, int i2)); /* 38 */
+ Bool (*xQueryPointer) _ANSI_ARGS_((Display* d, Window w1, Window* w2, Window* w3, int* i1, int* i2, int* i3, int* i4, unsigned int* ui)); /* 39 */
+ void (*xRaiseWindow) _ANSI_ARGS_((Display* d, Window w)); /* 40 */
+ void (*xRefreshKeyboardMapping) _ANSI_ARGS_((XMappingEvent* x)); /* 41 */
+ void (*xResizeWindow) _ANSI_ARGS_((Display* d, Window w, unsigned int ui1, unsigned int ui2)); /* 42 */
+ void (*xSelectInput) _ANSI_ARGS_((Display* d, Window w, long l)); /* 43 */
+ Status (*xSendEvent) _ANSI_ARGS_((Display* d, Window w, Bool b, long l, XEvent* x)); /* 44 */
+ void (*xSetIconName) _ANSI_ARGS_((Display* d, Window w, _Xconst char* c)); /* 45 */
+ void (*xSetInputFocus) _ANSI_ARGS_((Display* d, Window w, int i, Time t)); /* 46 */
+ void (*xSetSelectionOwner) _ANSI_ARGS_((Display* d, Atom a, Window w, Time t)); /* 47 */
+ void (*xSetWindowBackground) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 48 */
+ void (*xSetWindowBackgroundPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 49 */
+ void (*xSetWindowBorder) _ANSI_ARGS_((Display* d, Window w, unsigned long ul)); /* 50 */
+ void (*xSetWindowBorderPixmap) _ANSI_ARGS_((Display* d, Window w, Pixmap p)); /* 51 */
+ void (*xSetWindowBorderWidth) _ANSI_ARGS_((Display* d, Window w, unsigned int ui)); /* 52 */
+ void (*xSetWindowColormap) _ANSI_ARGS_((Display* d, Window w, Colormap c)); /* 53 */
+ void (*xUngrabKeyboard) _ANSI_ARGS_((Display* d, Time t)); /* 54 */
+ void (*xUngrabPointer) _ANSI_ARGS_((Display* d, Time t)); /* 55 */
+ void (*xUnmapWindow) _ANSI_ARGS_((Display* d, Window w)); /* 56 */
+ void (*tkPutImage) _ANSI_ARGS_((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)); /* 57 */
+ Status (*xParseColor) _ANSI_ARGS_((Display * display, Colormap map, _Xconst char* spec, XColor * colorPtr)); /* 58 */
+ GC (*xCreateGC) _ANSI_ARGS_((Display* display, Drawable d, unsigned long valuemask, XGCValues* values)); /* 59 */
+ void (*xFreeGC) _ANSI_ARGS_((Display* display, GC gc)); /* 60 */
+ Atom (*xInternAtom) _ANSI_ARGS_((Display* display, _Xconst char* atom_name, Bool only_if_exists)); /* 61 */
+ void (*xSetBackground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 62 */
+ void (*xSetForeground) _ANSI_ARGS_((Display* display, GC gc, unsigned long foreground)); /* 63 */
+ void (*xSetClipMask) _ANSI_ARGS_((Display* display, GC gc, Pixmap pixmap)); /* 64 */
+ void (*xSetClipOrigin) _ANSI_ARGS_((Display* display, GC gc, int clip_x_origin, int clip_y_origin)); /* 65 */
+ void (*xSetTSOrigin) _ANSI_ARGS_((Display* display, GC gc, int ts_x_origin, int ts_y_origin)); /* 66 */
+ void (*xChangeGC) _ANSI_ARGS_((Display * d, GC gc, unsigned long mask, XGCValues * values)); /* 67 */
+ void (*xSetFont) _ANSI_ARGS_((Display * display, GC gc, Font font)); /* 68 */
+ void (*xSetArcMode) _ANSI_ARGS_((Display * display, GC gc, int arc_mode)); /* 69 */
+ void (*xSetStipple) _ANSI_ARGS_((Display * display, GC gc, Pixmap stipple)); /* 70 */
+ void (*xSetFillRule) _ANSI_ARGS_((Display * display, GC gc, int fill_rule)); /* 71 */
+ void (*xSetFillStyle) _ANSI_ARGS_((Display * display, GC gc, int fill_style)); /* 72 */
+ void (*xSetFunction) _ANSI_ARGS_((Display * display, GC gc, int function)); /* 73 */
+ void (*xSetLineAttributes) _ANSI_ARGS_((Display * display, GC gc, unsigned int line_width, int line_style, int cap_style, int join_style)); /* 74 */
+ int (*_XInitImageFuncPtrs) _ANSI_ARGS_((XImage * image)); /* 75 */
+ XIC (*xCreateIC) _ANSI_ARGS_((void)); /* 76 */
+ XVisualInfo * (*xGetVisualInfo) _ANSI_ARGS_((Display* display, long vinfo_mask, XVisualInfo* vinfo_template, int* nitems_return)); /* 77 */
+ void (*xSetWMClientMachine) _ANSI_ARGS_((Display* display, Window w, XTextProperty* text_prop)); /* 78 */
+ Status (*xStringListToTextProperty) _ANSI_ARGS_((char** list, int count, XTextProperty* text_prop_return)); /* 79 */
+ void (*xDrawSegments) _ANSI_ARGS_((Display * display, Drawable d, GC gc, XSegment * segments, int nsegments)); /* 80 */
+ void (*xForceScreenSaver) _ANSI_ARGS_((Display* display, int mode)); /* 81 */
+ void (*xDrawLine) _ANSI_ARGS_((Display* d, Drawable dr, GC g, int x1, int y1, int x2, int y2)); /* 82 */
+ void (*xFillRectangle) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y, unsigned int width, unsigned int height)); /* 83 */
+ void (*xClearWindow) _ANSI_ARGS_((Display* d, Window w)); /* 84 */
+ void (*xDrawPoint) _ANSI_ARGS_((Display* display, Drawable d, GC gc, int x, int y)); /* 85 */
+ void (*xDrawPoints) _ANSI_ARGS_((Display* display, Drawable d, GC gc, XPoint * points, int npoints, int mode)); /* 86 */
+ void (*xWarpPointer) _ANSI_ARGS_((Display* display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y)); /* 87 */
+ void (*xQueryColor) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * def_in_out)); /* 88 */
+ void (*xQueryColors) _ANSI_ARGS_((Display * display, Colormap colormap, XColor * defs_in_out, int ncolors)); /* 89 */
+#endif /* MAC_OSX_TK */
} TkIntXlibStubs;
#ifdef __cplusplus
@@ -1663,6 +2041,368 @@ extern TkIntXlibStubs *tkIntXlibStubsPtr;
(tkIntXlibStubsPtr->xQueryColors) /* 89 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef XSetDashes
+#define XSetDashes \
+ (tkIntXlibStubsPtr->xSetDashes) /* 0 */
+#endif
+#ifndef XGetModifierMapping
+#define XGetModifierMapping \
+ (tkIntXlibStubsPtr->xGetModifierMapping) /* 1 */
+#endif
+#ifndef XCreateImage
+#define XCreateImage \
+ (tkIntXlibStubsPtr->xCreateImage) /* 2 */
+#endif
+#ifndef XGetImage
+#define XGetImage \
+ (tkIntXlibStubsPtr->xGetImage) /* 3 */
+#endif
+#ifndef XGetAtomName
+#define XGetAtomName \
+ (tkIntXlibStubsPtr->xGetAtomName) /* 4 */
+#endif
+#ifndef XKeysymToString
+#define XKeysymToString \
+ (tkIntXlibStubsPtr->xKeysymToString) /* 5 */
+#endif
+#ifndef XCreateColormap
+#define XCreateColormap \
+ (tkIntXlibStubsPtr->xCreateColormap) /* 6 */
+#endif
+#ifndef XGContextFromGC
+#define XGContextFromGC \
+ (tkIntXlibStubsPtr->xGContextFromGC) /* 7 */
+#endif
+#ifndef XKeycodeToKeysym
+#define XKeycodeToKeysym \
+ (tkIntXlibStubsPtr->xKeycodeToKeysym) /* 8 */
+#endif
+#ifndef XStringToKeysym
+#define XStringToKeysym \
+ (tkIntXlibStubsPtr->xStringToKeysym) /* 9 */
+#endif
+#ifndef XRootWindow
+#define XRootWindow \
+ (tkIntXlibStubsPtr->xRootWindow) /* 10 */
+#endif
+#ifndef XSetErrorHandler
+#define XSetErrorHandler \
+ (tkIntXlibStubsPtr->xSetErrorHandler) /* 11 */
+#endif
+#ifndef XAllocColor
+#define XAllocColor \
+ (tkIntXlibStubsPtr->xAllocColor) /* 12 */
+#endif
+#ifndef XBell
+#define XBell \
+ (tkIntXlibStubsPtr->xBell) /* 13 */
+#endif
+#ifndef XChangeProperty
+#define XChangeProperty \
+ (tkIntXlibStubsPtr->xChangeProperty) /* 14 */
+#endif
+#ifndef XChangeWindowAttributes
+#define XChangeWindowAttributes \
+ (tkIntXlibStubsPtr->xChangeWindowAttributes) /* 15 */
+#endif
+#ifndef XConfigureWindow
+#define XConfigureWindow \
+ (tkIntXlibStubsPtr->xConfigureWindow) /* 16 */
+#endif
+#ifndef XCopyArea
+#define XCopyArea \
+ (tkIntXlibStubsPtr->xCopyArea) /* 17 */
+#endif
+#ifndef XCopyPlane
+#define XCopyPlane \
+ (tkIntXlibStubsPtr->xCopyPlane) /* 18 */
+#endif
+#ifndef XCreateBitmapFromData
+#define XCreateBitmapFromData \
+ (tkIntXlibStubsPtr->xCreateBitmapFromData) /* 19 */
+#endif
+#ifndef XDefineCursor
+#define XDefineCursor \
+ (tkIntXlibStubsPtr->xDefineCursor) /* 20 */
+#endif
+#ifndef XDestroyWindow
+#define XDestroyWindow \
+ (tkIntXlibStubsPtr->xDestroyWindow) /* 21 */
+#endif
+#ifndef XDrawArc
+#define XDrawArc \
+ (tkIntXlibStubsPtr->xDrawArc) /* 22 */
+#endif
+#ifndef XDrawLines
+#define XDrawLines \
+ (tkIntXlibStubsPtr->xDrawLines) /* 23 */
+#endif
+#ifndef XDrawRectangle
+#define XDrawRectangle \
+ (tkIntXlibStubsPtr->xDrawRectangle) /* 24 */
+#endif
+#ifndef XFillArc
+#define XFillArc \
+ (tkIntXlibStubsPtr->xFillArc) /* 25 */
+#endif
+#ifndef XFillPolygon
+#define XFillPolygon \
+ (tkIntXlibStubsPtr->xFillPolygon) /* 26 */
+#endif
+#ifndef XFillRectangles
+#define XFillRectangles \
+ (tkIntXlibStubsPtr->xFillRectangles) /* 27 */
+#endif
+#ifndef XFreeColormap
+#define XFreeColormap \
+ (tkIntXlibStubsPtr->xFreeColormap) /* 28 */
+#endif
+#ifndef XFreeColors
+#define XFreeColors \
+ (tkIntXlibStubsPtr->xFreeColors) /* 29 */
+#endif
+#ifndef XFreeModifiermap
+#define XFreeModifiermap \
+ (tkIntXlibStubsPtr->xFreeModifiermap) /* 30 */
+#endif
+#ifndef XGetGeometry
+#define XGetGeometry \
+ (tkIntXlibStubsPtr->xGetGeometry) /* 31 */
+#endif
+#ifndef XGetWindowProperty
+#define XGetWindowProperty \
+ (tkIntXlibStubsPtr->xGetWindowProperty) /* 32 */
+#endif
+#ifndef XGrabKeyboard
+#define XGrabKeyboard \
+ (tkIntXlibStubsPtr->xGrabKeyboard) /* 33 */
+#endif
+#ifndef XGrabPointer
+#define XGrabPointer \
+ (tkIntXlibStubsPtr->xGrabPointer) /* 34 */
+#endif
+#ifndef XKeysymToKeycode
+#define XKeysymToKeycode \
+ (tkIntXlibStubsPtr->xKeysymToKeycode) /* 35 */
+#endif
+#ifndef XMapWindow
+#define XMapWindow \
+ (tkIntXlibStubsPtr->xMapWindow) /* 36 */
+#endif
+#ifndef XMoveResizeWindow
+#define XMoveResizeWindow \
+ (tkIntXlibStubsPtr->xMoveResizeWindow) /* 37 */
+#endif
+#ifndef XMoveWindow
+#define XMoveWindow \
+ (tkIntXlibStubsPtr->xMoveWindow) /* 38 */
+#endif
+#ifndef XQueryPointer
+#define XQueryPointer \
+ (tkIntXlibStubsPtr->xQueryPointer) /* 39 */
+#endif
+#ifndef XRaiseWindow
+#define XRaiseWindow \
+ (tkIntXlibStubsPtr->xRaiseWindow) /* 40 */
+#endif
+#ifndef XRefreshKeyboardMapping
+#define XRefreshKeyboardMapping \
+ (tkIntXlibStubsPtr->xRefreshKeyboardMapping) /* 41 */
+#endif
+#ifndef XResizeWindow
+#define XResizeWindow \
+ (tkIntXlibStubsPtr->xResizeWindow) /* 42 */
+#endif
+#ifndef XSelectInput
+#define XSelectInput \
+ (tkIntXlibStubsPtr->xSelectInput) /* 43 */
+#endif
+#ifndef XSendEvent
+#define XSendEvent \
+ (tkIntXlibStubsPtr->xSendEvent) /* 44 */
+#endif
+#ifndef XSetIconName
+#define XSetIconName \
+ (tkIntXlibStubsPtr->xSetIconName) /* 45 */
+#endif
+#ifndef XSetInputFocus
+#define XSetInputFocus \
+ (tkIntXlibStubsPtr->xSetInputFocus) /* 46 */
+#endif
+#ifndef XSetSelectionOwner
+#define XSetSelectionOwner \
+ (tkIntXlibStubsPtr->xSetSelectionOwner) /* 47 */
+#endif
+#ifndef XSetWindowBackground
+#define XSetWindowBackground \
+ (tkIntXlibStubsPtr->xSetWindowBackground) /* 48 */
+#endif
+#ifndef XSetWindowBackgroundPixmap
+#define XSetWindowBackgroundPixmap \
+ (tkIntXlibStubsPtr->xSetWindowBackgroundPixmap) /* 49 */
+#endif
+#ifndef XSetWindowBorder
+#define XSetWindowBorder \
+ (tkIntXlibStubsPtr->xSetWindowBorder) /* 50 */
+#endif
+#ifndef XSetWindowBorderPixmap
+#define XSetWindowBorderPixmap \
+ (tkIntXlibStubsPtr->xSetWindowBorderPixmap) /* 51 */
+#endif
+#ifndef XSetWindowBorderWidth
+#define XSetWindowBorderWidth \
+ (tkIntXlibStubsPtr->xSetWindowBorderWidth) /* 52 */
+#endif
+#ifndef XSetWindowColormap
+#define XSetWindowColormap \
+ (tkIntXlibStubsPtr->xSetWindowColormap) /* 53 */
+#endif
+#ifndef XUngrabKeyboard
+#define XUngrabKeyboard \
+ (tkIntXlibStubsPtr->xUngrabKeyboard) /* 54 */
+#endif
+#ifndef XUngrabPointer
+#define XUngrabPointer \
+ (tkIntXlibStubsPtr->xUngrabPointer) /* 55 */
+#endif
+#ifndef XUnmapWindow
+#define XUnmapWindow \
+ (tkIntXlibStubsPtr->xUnmapWindow) /* 56 */
+#endif
+#ifndef TkPutImage
+#define TkPutImage \
+ (tkIntXlibStubsPtr->tkPutImage) /* 57 */
+#endif
+#ifndef XParseColor
+#define XParseColor \
+ (tkIntXlibStubsPtr->xParseColor) /* 58 */
+#endif
+#ifndef XCreateGC
+#define XCreateGC \
+ (tkIntXlibStubsPtr->xCreateGC) /* 59 */
+#endif
+#ifndef XFreeGC
+#define XFreeGC \
+ (tkIntXlibStubsPtr->xFreeGC) /* 60 */
+#endif
+#ifndef XInternAtom
+#define XInternAtom \
+ (tkIntXlibStubsPtr->xInternAtom) /* 61 */
+#endif
+#ifndef XSetBackground
+#define XSetBackground \
+ (tkIntXlibStubsPtr->xSetBackground) /* 62 */
+#endif
+#ifndef XSetForeground
+#define XSetForeground \
+ (tkIntXlibStubsPtr->xSetForeground) /* 63 */
+#endif
+#ifndef XSetClipMask
+#define XSetClipMask \
+ (tkIntXlibStubsPtr->xSetClipMask) /* 64 */
+#endif
+#ifndef XSetClipOrigin
+#define XSetClipOrigin \
+ (tkIntXlibStubsPtr->xSetClipOrigin) /* 65 */
+#endif
+#ifndef XSetTSOrigin
+#define XSetTSOrigin \
+ (tkIntXlibStubsPtr->xSetTSOrigin) /* 66 */
+#endif
+#ifndef XChangeGC
+#define XChangeGC \
+ (tkIntXlibStubsPtr->xChangeGC) /* 67 */
+#endif
+#ifndef XSetFont
+#define XSetFont \
+ (tkIntXlibStubsPtr->xSetFont) /* 68 */
+#endif
+#ifndef XSetArcMode
+#define XSetArcMode \
+ (tkIntXlibStubsPtr->xSetArcMode) /* 69 */
+#endif
+#ifndef XSetStipple
+#define XSetStipple \
+ (tkIntXlibStubsPtr->xSetStipple) /* 70 */
+#endif
+#ifndef XSetFillRule
+#define XSetFillRule \
+ (tkIntXlibStubsPtr->xSetFillRule) /* 71 */
+#endif
+#ifndef XSetFillStyle
+#define XSetFillStyle \
+ (tkIntXlibStubsPtr->xSetFillStyle) /* 72 */
+#endif
+#ifndef XSetFunction
+#define XSetFunction \
+ (tkIntXlibStubsPtr->xSetFunction) /* 73 */
+#endif
+#ifndef XSetLineAttributes
+#define XSetLineAttributes \
+ (tkIntXlibStubsPtr->xSetLineAttributes) /* 74 */
+#endif
+#ifndef _XInitImageFuncPtrs
+#define _XInitImageFuncPtrs \
+ (tkIntXlibStubsPtr->_XInitImageFuncPtrs) /* 75 */
+#endif
+#ifndef XCreateIC
+#define XCreateIC \
+ (tkIntXlibStubsPtr->xCreateIC) /* 76 */
+#endif
+#ifndef XGetVisualInfo
+#define XGetVisualInfo \
+ (tkIntXlibStubsPtr->xGetVisualInfo) /* 77 */
+#endif
+#ifndef XSetWMClientMachine
+#define XSetWMClientMachine \
+ (tkIntXlibStubsPtr->xSetWMClientMachine) /* 78 */
+#endif
+#ifndef XStringListToTextProperty
+#define XStringListToTextProperty \
+ (tkIntXlibStubsPtr->xStringListToTextProperty) /* 79 */
+#endif
+#ifndef XDrawSegments
+#define XDrawSegments \
+ (tkIntXlibStubsPtr->xDrawSegments) /* 80 */
+#endif
+#ifndef XForceScreenSaver
+#define XForceScreenSaver \
+ (tkIntXlibStubsPtr->xForceScreenSaver) /* 81 */
+#endif
+#ifndef XDrawLine
+#define XDrawLine \
+ (tkIntXlibStubsPtr->xDrawLine) /* 82 */
+#endif
+#ifndef XFillRectangle
+#define XFillRectangle \
+ (tkIntXlibStubsPtr->xFillRectangle) /* 83 */
+#endif
+#ifndef XClearWindow
+#define XClearWindow \
+ (tkIntXlibStubsPtr->xClearWindow) /* 84 */
+#endif
+#ifndef XDrawPoint
+#define XDrawPoint \
+ (tkIntXlibStubsPtr->xDrawPoint) /* 85 */
+#endif
+#ifndef XDrawPoints
+#define XDrawPoints \
+ (tkIntXlibStubsPtr->xDrawPoints) /* 86 */
+#endif
+#ifndef XWarpPointer
+#define XWarpPointer \
+ (tkIntXlibStubsPtr->xWarpPointer) /* 87 */
+#endif
+#ifndef XQueryColor
+#define XQueryColor \
+ (tkIntXlibStubsPtr->xQueryColor) /* 88 */
+#endif
+#ifndef XQueryColors
+#define XQueryColors \
+ (tkIntXlibStubsPtr->xQueryColors) /* 89 */
+#endif
+#endif /* MAC_OSX_TK */
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
diff --git a/tk/generic/tkListbox.c b/tk/generic/tkListbox.c
index f6b0f75f6ca..7cfc23bed7f 100644
--- a/tk/generic/tkListbox.c
+++ b/tk/generic/tkListbox.c
@@ -18,6 +18,10 @@
#include "default.h"
#include "tkInt.h"
+#ifdef WIN32
+#include "tkWinInt.h"
+#endif
+
typedef struct {
Tk_OptionTable listboxOptionTable; /* Table defining configuration options
* available for the listbox */
@@ -74,6 +78,7 @@ typedef struct {
* room for borders. */
Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *fgColorPtr; /* Text color in normal mode. */
+ XColor *dfgColorPtr; /* Text color in disabled mode. */
GC textGC; /* For drawing normal text. */
Tk_3DBorder selBorder; /* Borders and backgrounds for selected
* elements. */
@@ -127,6 +132,8 @@ typedef struct {
int active; /* Index of "active" element (the one that
* has been selected by keyboard traversal).
* -1 means none. */
+ int activeStyle; /* style in which to draw the active element.
+ * One of: underline, none, dotbox */
/*
* Information for scanning:
@@ -155,6 +162,8 @@ typedef struct {
char *xScrollCmd; /* Command prefix for communicating with
* horizontal scrollbar. NULL means no command
* to issue. Malloc'ed. */
+ int state; /* Listbox state. */
+ Pixmap gray; /* Pixmap for displaying disabled text. */
int flags; /* Various flag bits: see below for
* definitions. */
} Listbox;
@@ -194,10 +203,35 @@ typedef struct {
#define LISTBOX_DELETED 32
/*
+ * The following enum is used to define a type for the -state option
+ * of the Entry widget. These values are used as indices into the
+ * string table below.
+ */
+
+enum state {
+ STATE_DISABLED, STATE_NORMAL
+};
+
+static char *stateStrings[] = {
+ "disabled", "normal", (char *) NULL
+};
+
+enum activeStyle {
+ ACTIVE_STYLE_DOTBOX, ACTIVE_STYLE_NONE, ACTIVE_STYLE_UNDERLINE
+};
+
+static char *activeStyleStrings[] = {
+ "dotbox", "none", "underline", (char *) NULL
+};
+
+/*
* The optionSpecs table defines the valid configuration options for the
* listbox widget
*/
static Tk_OptionSpec optionSpecs[] = {
+ {TK_OPTION_STRING_TABLE, "-activestyle", "activeStyle", "ActiveStyle",
+ DEF_LISTBOX_ACTIVE_STYLE, -1, Tk_Offset(Listbox, activeStyle),
+ 0, (ClientData) activeStyleStrings, 0},
{TK_OPTION_BORDER, "-background", "background", "Background",
DEF_LISTBOX_BG_COLOR, -1, Tk_Offset(Listbox, normalBorder),
0, (ClientData) DEF_LISTBOX_BG_MONO, 0},
@@ -211,6 +245,9 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
DEF_LISTBOX_CURSOR, -1, Tk_Offset(Listbox, cursor),
TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground",
+ "DisabledForeground", DEF_LISTBOX_DISABLED_FG, -1,
+ Tk_Offset(Listbox, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-exportselection", "exportSelection",
"ExportSelection", DEF_LISTBOX_EXPORT_SELECTION, -1,
Tk_Offset(Listbox, exportSelection), 0, 0, 0},
@@ -247,6 +284,9 @@ static Tk_OptionSpec optionSpecs[] = {
TK_OPTION_NULL_OK, 0, 0},
{TK_OPTION_BOOLEAN, "-setgrid", "setGrid", "SetGrid",
DEF_LISTBOX_SET_GRID, -1, Tk_Offset(Listbox, setGrid), 0, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-state", "state", "State",
+ DEF_LISTBOX_STATE, -1, Tk_Offset(Listbox, state),
+ 0, (ClientData) stateStrings, 0},
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_LISTBOX_TAKE_FOCUS, -1, Tk_Offset(Listbox, takeFocus),
TK_OPTION_NULL_OK, 0, 0},
@@ -271,26 +311,26 @@ static Tk_OptionSpec optionSpecs[] = {
*/
static Tk_OptionSpec itemAttrOptionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
- (char *)NULL, -1, Tk_Offset(ItemAttr, border),
- TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
+ (char *)NULL, -1, Tk_Offset(ItemAttr, border),
+ TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
(ClientData) DEF_LISTBOX_BG_MONO, 0},
{TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
+ (char *) NULL, 0, -1, 0, (ClientData) "-background", 0},
{TK_OPTION_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
+ (char *) NULL, 0, -1, 0, (ClientData) "-foreground", 0},
{TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
- (char *) NULL, -1, Tk_Offset(ItemAttr, fgColor),
- TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0},
+ (char *) NULL, -1, Tk_Offset(ItemAttr, fgColor),
+ TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0},
{TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground",
- (char *) NULL, -1, Tk_Offset(ItemAttr, selBorder),
- TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
+ (char *) NULL, -1, Tk_Offset(ItemAttr, selBorder),
+ TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
(ClientData) DEF_LISTBOX_SELECT_MONO, 0},
{TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background",
- (char *) NULL, -1, Tk_Offset(ItemAttr, selFgColor),
- TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
+ (char *) NULL, -1, Tk_Offset(ItemAttr, selFgColor),
+ TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT,
(ClientData) DEF_LISTBOX_SELECT_FG_MONO, 0},
{TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, -1, 0, 0, 0}
+ (char *) NULL, 0, -1, 0, 0, 0}
};
/*
@@ -298,22 +338,22 @@ static Tk_OptionSpec itemAttrOptionSpecs[] = {
* commands) and map the indexes into the string tables into
* enumerated types used to dispatch the listbox widget command.
*/
-static char *commandNames[] = {
+static CONST char *commandNames[] = {
"activate", "bbox", "cget", "configure", "curselection", "delete", "get",
- "index", "insert", "itemcget", "itemconfigure", "nearest", "scan",
- "see", "selection", "size", "xview", "yview",
+ "index", "insert", "itemcget", "itemconfigure", "nearest", "scan",
+ "see", "selection", "size", "xview", "yview",
(char *) NULL
};
enum command {
COMMAND_ACTIVATE, COMMAND_BBOX, COMMAND_CGET, COMMAND_CONFIGURE,
- COMMAND_CURSELECTION, COMMAND_DELETE, COMMAND_GET, COMMAND_INDEX,
- COMMAND_INSERT, COMMAND_ITEMCGET, COMMAND_ITEMCONFIGURE,
- COMMAND_NEAREST, COMMAND_SCAN, COMMAND_SEE, COMMAND_SELECTION,
- COMMAND_SIZE, COMMAND_XVIEW, COMMAND_YVIEW
+ COMMAND_CURSELECTION, COMMAND_DELETE, COMMAND_GET, COMMAND_INDEX,
+ COMMAND_INSERT, COMMAND_ITEMCGET, COMMAND_ITEMCONFIGURE,
+ COMMAND_NEAREST, COMMAND_SCAN, COMMAND_SEE, COMMAND_SELECTION,
+ COMMAND_SIZE, COMMAND_XVIEW, COMMAND_YVIEW
};
-static char *selCommandNames[] = {
+static CONST char *selCommandNames[] = {
"anchor", "clear", "includes", "set", (char *) NULL
};
@@ -321,7 +361,7 @@ enum selcommand {
SELECTION_ANCHOR, SELECTION_CLEAR, SELECTION_INCLUDES, SELECTION_SET
};
-static char *scanCommandNames[] = {
+static CONST char *scanCommandNames[] = {
"mark", "dragto", (char *) NULL
};
@@ -329,7 +369,7 @@ enum scancommand {
SCAN_MARK, SCAN_DRAGTO
};
-static char *indexNames[] = {
+static CONST char *indexNames[] = {
"active", "anchor", "end", (char *)NULL
};
@@ -402,8 +442,8 @@ static void ListboxWorldChanged _ANSI_ARGS_((
static int NearestListboxElement _ANSI_ARGS_((Listbox *listPtr,
int y));
static char * ListboxListVarProc _ANSI_ARGS_ ((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
static void MigrateHashEntries _ANSI_ARGS_ ((Tcl_HashTable *table,
int first, int last, int offset));
/*
@@ -411,10 +451,9 @@ static void MigrateHashEntries _ANSI_ARGS_ ((Tcl_HashTable *table,
* that can be invoked from generic window code.
*/
-static TkClassProcs listboxClass = {
- NULL, /* createProc. */
- ListboxWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+static Tk_ClassProcs listboxClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ ListboxWorldChanged, /* worldChangedProc */
};
@@ -438,7 +477,7 @@ static TkClassProcs listboxClass = {
int
Tk_ListboxObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table */
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
@@ -447,18 +486,28 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
Tk_Window tkwin;
ListboxOptionTables *optionTables;
- optionTables = (ListboxOptionTables *)clientData;
- if (optionTables == NULL) {
- Tcl_CmdInfo info;
- char *name;
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ return TCL_ERROR;
+ }
+
+ tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
+ Tcl_GetString(objv[1]), (char *) NULL);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ optionTables = (ListboxOptionTables *)
+ Tcl_GetAssocData(interp, "ListboxOptionTables", NULL);
+ if (optionTables == NULL) {
/*
* We haven't created the option tables for this widget class yet.
* Do it now and save the a pointer to them as the ClientData for
* the command, so future invocations will have access to it.
*/
- optionTables =
- (ListboxOptionTables *) ckalloc(sizeof(ListboxOptionTables));
+
+ optionTables = (ListboxOptionTables *)
+ ckalloc(sizeof(ListboxOptionTables));
/* Set up an exit handler to free the optionTables struct */
Tcl_SetAssocData(interp, "ListboxOptionTables",
DestroyListboxOptionTables, (ClientData) optionTables);
@@ -468,23 +517,6 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
Tk_CreateOptionTable(interp, optionSpecs);
optionTables->itemAttrOptionTable =
Tk_CreateOptionTable(interp, itemAttrOptionSpecs);
-
- /* Store a pointer to the tables as the ClientData for the command */
- name = Tcl_GetString(objv[0]);
- Tcl_GetCommandInfo(interp, name, &info);
- info.objClientData = (ClientData) optionTables;
- Tcl_SetCommandInfo(interp, name, &info);
- }
-
- if (objc < 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
- return TCL_ERROR;
- }
-
- tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
- Tcl_GetString(objv[1]), (char *) NULL);
- if (tkwin == NULL) {
- return TCL_ERROR;
}
/*
@@ -493,6 +525,8 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
* initialized already (e.g. resource pointers).
*/
listPtr = (Listbox *) ckalloc(sizeof(Listbox));
+ memset((void *) listPtr, 0, (sizeof(Listbox)));
+
listPtr->tkwin = tkwin;
listPtr->display = Tk_Display(tkwin);
listPtr->interp = interp;
@@ -501,56 +535,32 @@ Tk_ListboxObjCmd(clientData, interp, objc, objv)
(ClientData) listPtr, ListboxCmdDeletedProc);
listPtr->optionTable = optionTables->listboxOptionTable;
listPtr->itemAttrOptionTable = optionTables->itemAttrOptionTable;
- listPtr->listVarName = NULL;
- listPtr->listObj = NULL;
listPtr->selection =
(Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(listPtr->selection, TCL_ONE_WORD_KEYS);
listPtr->itemAttrTable =
(Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(listPtr->itemAttrTable, TCL_ONE_WORD_KEYS);
- listPtr->nElements = 0;
- listPtr->normalBorder = NULL;
- listPtr->borderWidth = 0;
listPtr->relief = TK_RELIEF_RAISED;
- listPtr->highlightWidth = 0;
- listPtr->highlightBgColorPtr = NULL;
- listPtr->highlightColorPtr = NULL;
- listPtr->inset = 0;
- listPtr->tkfont = NULL;
- listPtr->fgColorPtr = NULL;
listPtr->textGC = None;
- listPtr->selBorder = NULL;
- listPtr->selBorderWidth = 0;
listPtr->selFgColorPtr = None;
listPtr->selTextGC = None;
- listPtr->width = 0;
- listPtr->height = 0;
- listPtr->lineHeight = 0;
- listPtr->topIndex = 0;
listPtr->fullLines = 1;
- listPtr->partialLine = 0;
- listPtr->setGrid = 0;
- listPtr->maxWidth = 0;
listPtr->xScrollUnit = 1;
- listPtr->xOffset = 0;
- listPtr->selectMode = NULL;
- listPtr->numSelected = 0;
- listPtr->selectAnchor = 0;
listPtr->exportSelection = 1;
- listPtr->active = 0;
- listPtr->scanMarkX = 0;
- listPtr->scanMarkY = 0;
- listPtr->scanMarkXOffset = 0;
- listPtr->scanMarkYIndex = 0;
listPtr->cursor = None;
- listPtr->takeFocus = NULL;
- listPtr->xScrollCmd = NULL;
- listPtr->yScrollCmd = NULL;
- listPtr->flags = 0;
+ listPtr->state = STATE_NORMAL;
+ listPtr->gray = None;
+
+ /*
+ * Keep a hold of the associated tkwin until we destroy the listbox,
+ * otherwise Tk might free it while we still need it.
+ */
+
+ Tcl_Preserve((ClientData) listPtr->tkwin);
Tk_SetClass(listPtr->tkwin, "Listbox");
- TkSetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr);
+ Tk_SetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr);
Tk_CreateEventHandler(listPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
ListboxEventProc, (ClientData) listPtr);
@@ -604,7 +614,6 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
return TCL_ERROR;
}
- Tcl_Preserve((ClientData)listPtr);
/*
* Parse the command by looking up the second argument in the list
@@ -613,10 +622,10 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
result = Tcl_GetIndexFromObj(interp, objv[1], commandNames,
"option", 0, &cmdIndex);
if (result != TCL_OK) {
- Tcl_Release((ClientData)listPtr);
return result;
}
+ Tcl_Preserve((ClientData)listPtr);
/* The subcommand was valid, so continue processing */
switch (cmdIndex) {
case COMMAND_ACTIVATE: {
@@ -629,6 +638,11 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
if (result != TCL_OK) {
break;
}
+
+ if (!(listPtr->state & STATE_NORMAL)) {
+ break;
+ }
+
if (index >= listPtr->nElements) {
index = listPtr->nElements-1;
}
@@ -733,6 +747,11 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
if (result != TCL_OK) {
break;
}
+
+ if (!(listPtr->state & STATE_NORMAL)) {
+ break;
+ }
+
if (first < listPtr->nElements) {
/*
* if a "last index" was given, get it now; otherwise, use the
@@ -838,6 +857,11 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
if (result != TCL_OK) {
break;
}
+
+ if (!(listPtr->state & STATE_NORMAL)) {
+ break;
+ }
+
result = ListboxInsertSubCmd(listPtr, index, objc-3, objv+3);
break;
}
@@ -1018,6 +1042,10 @@ ListboxWidgetObjCmd(clientData, interp, objc, objv)
}
case COMMAND_SELECTION: {
+ if (!(listPtr->state & STATE_NORMAL)) {
+ break;
+ }
+
result = ListboxSelectionSubCmd(interp, listPtr, objc, objv);
break;
}
@@ -1412,16 +1440,6 @@ DestroyListbox(memPtr)
Tcl_HashEntry *entry;
Tcl_HashSearch search;
- listPtr->flags |= LISTBOX_DELETED;
-
- Tcl_DeleteCommandFromToken(listPtr->interp, listPtr->widgetCmd);
- if (listPtr->setGrid) {
- Tk_UnsetGrid(listPtr->tkwin);
- }
- if (listPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayListbox, (ClientData) listPtr);
- }
-
/* If we have an internal list object, free it */
if (listPtr->listObj != NULL) {
Tcl_DecrRefCount(listPtr->listObj);
@@ -1458,8 +1476,13 @@ DestroyListbox(memPtr)
if (listPtr->selTextGC != None) {
Tk_FreeGC(listPtr->display, listPtr->selTextGC);
}
+ if (listPtr->gray != None) {
+ Tk_FreeBitmap(Tk_Display(listPtr->tkwin), listPtr->gray);
+ }
+
Tk_FreeConfigOptions((char *)listPtr, listPtr->optionTable,
listPtr->tkwin);
+ Tcl_Release((ClientData) listPtr->tkwin);
listPtr->tkwin = NULL;
ckfree((char *) listPtr);
}
@@ -1523,7 +1546,8 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
{
Tk_SavedOptions savedOptions;
Tcl_Obj *oldListObj = NULL;
- int oldExport;
+ Tcl_Obj *errorResult = NULL;
+ int oldExport, error;
oldExport = listPtr->exportSelection;
if (listPtr->listVarName != NULL) {
@@ -1531,99 +1555,118 @@ ConfigureListbox(interp, listPtr, objc, objv, flags)
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
ListboxListVarProc, (ClientData) listPtr);
}
-
- if (Tk_SetOptions(interp, (char *)listPtr,
- listPtr->optionTable, objc, objv, listPtr->tkwin,
- &savedOptions, (int *)NULL) != TCL_OK) {
- Tk_RestoreSavedOptions(&savedOptions);
- return TCL_ERROR;
- }
-
- /*
- * A few options need special processing, such as setting the
- * background from a 3-D border.
- */
- Tk_SetBackgroundFromBorder(listPtr->tkwin, listPtr->normalBorder);
+ for (error = 0; error <= 1; error++) {
+ if (!error) {
+ /*
+ * First pass: set options to new values.
+ */
- if (listPtr->highlightWidth < 0) {
- listPtr->highlightWidth = 0;
- }
- listPtr->inset = listPtr->highlightWidth + listPtr->borderWidth;
+ if (Tk_SetOptions(interp, (char *) listPtr,
+ listPtr->optionTable, objc, objv,
+ listPtr->tkwin, &savedOptions, (int *) NULL) != TCL_OK) {
+ continue;
+ }
+ } else {
+ /*
+ * Second pass: restore options to old values.
+ */
- /*
- * Claim the selection if we've suddenly started exporting it and
- * there is a selection to export.
- */
+ errorResult = Tcl_GetObjResult(interp);
+ Tcl_IncrRefCount(errorResult);
+ Tk_RestoreSavedOptions(&savedOptions);
+ }
- if (listPtr->exportSelection && !oldExport
- && (listPtr->numSelected != 0)) {
- Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, ListboxLostSelection,
- (ClientData) listPtr);
- }
+ /*
+ * A few options need special processing, such as setting the
+ * background from a 3-D border.
+ */
-
- /* Verify the current status of the list var.
- * PREVIOUS STATE | NEW STATE | ACTION
- * ------------------+---------------+----------------------------------
- * no listvar | listvar | If listvar does not exist, create
- * it and copy the internal list obj's
- * content to the new var. If it does
- * exist, toss the internal list obj.
- *
- * listvar | no listvar | Copy old listvar content to the
- * internal list obj
- *
- * listvar | listvar | no special action
- *
- * no listvar | no listvar | no special action
- */
- oldListObj = listPtr->listObj;
- if (listPtr->listVarName != NULL) {
- Tcl_Obj *listVarObj = Tcl_GetVar2Ex(interp, listPtr->listVarName,
- (char *)NULL, TCL_GLOBAL_ONLY);
- int dummy;
- if (listVarObj == NULL) {
- if (listPtr->listObj != NULL) {
- listVarObj = listPtr->listObj;
- } else {
- listVarObj = Tcl_NewObj();
+ Tk_SetBackgroundFromBorder(listPtr->tkwin, listPtr->normalBorder);
+
+ if (listPtr->highlightWidth < 0) {
+ listPtr->highlightWidth = 0;
+ }
+ listPtr->inset = listPtr->highlightWidth + listPtr->borderWidth;
+
+ /*
+ * Claim the selection if we've suddenly started exporting it and
+ * there is a selection to export.
+ */
+
+ if (listPtr->exportSelection && !oldExport
+ && (listPtr->numSelected != 0)) {
+ Tk_OwnSelection(listPtr->tkwin, XA_PRIMARY, ListboxLostSelection,
+ (ClientData) listPtr);
+ }
+
+ /* Verify the current status of the list var.
+ * PREVIOUS STATE | NEW STATE | ACTION
+ * ---------------+------------+----------------------------------
+ * no listvar | listvar | If listvar does not exist, create
+ * it and copy the internal list obj's
+ * content to the new var. If it does
+ * exist, toss the internal list obj.
+ *
+ * listvar | no listvar | Copy old listvar content to the
+ * internal list obj
+ *
+ * listvar | listvar | no special action
+ *
+ * no listvar | no listvar | no special action
+ */
+ oldListObj = listPtr->listObj;
+ if (listPtr->listVarName != NULL) {
+ Tcl_Obj *listVarObj = Tcl_GetVar2Ex(interp, listPtr->listVarName,
+ (char *) NULL, TCL_GLOBAL_ONLY);
+ int dummy;
+ if (listVarObj == NULL) {
+ listVarObj = (oldListObj ? oldListObj : Tcl_NewObj());
+ if (Tcl_SetVar2Ex(interp, listPtr->listVarName, (char *) NULL,
+ listVarObj, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG)
+ == NULL) {
+ if (oldListObj == NULL) {
+ Tcl_DecrRefCount(listVarObj);
+ }
+ continue;
+ }
}
- if (Tcl_SetVar2Ex(interp, listPtr->listVarName, (char *)NULL,
- listVarObj, TCL_GLOBAL_ONLY) == NULL) {
- Tcl_DecrRefCount(listVarObj);
- Tk_RestoreSavedOptions(&savedOptions);
- return TCL_ERROR;
+ /* Make sure the object is a good list object */
+ if (Tcl_ListObjLength(listPtr->interp, listVarObj, &dummy)
+ != TCL_OK) {
+ Tcl_AppendResult(listPtr->interp,
+ ": invalid -listvariable value", (char *) NULL);
+ continue;
}
- }
- /* Make sure the object is a good list object */
- if (Tcl_ListObjLength(listPtr->interp, listVarObj, &dummy) != TCL_OK) {
- Tk_RestoreSavedOptions(&savedOptions);
- Tcl_AppendResult(listPtr->interp, ": invalid listvar value",
- (char *)NULL);
- return TCL_ERROR;
- }
-
- listPtr->listObj = listVarObj;
- Tcl_TraceVar(listPtr->interp, listPtr->listVarName,
- TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
- ListboxListVarProc, (ClientData) listPtr);
- } else {
- if (listPtr->listObj == NULL) {
+
+ listPtr->listObj = listVarObj;
+ Tcl_TraceVar(listPtr->interp, listPtr->listVarName,
+ TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
+ ListboxListVarProc, (ClientData) listPtr);
+ } else if (listPtr->listObj == NULL) {
listPtr->listObj = Tcl_NewObj();
}
+ Tcl_IncrRefCount(listPtr->listObj);
+ if (oldListObj != NULL) {
+ Tcl_DecrRefCount(oldListObj);
+ }
+ break;
}
- Tcl_IncrRefCount(listPtr->listObj);
- if (oldListObj != NULL) {
- Tcl_DecrRefCount(oldListObj);
+ if (!error) {
+ Tk_FreeSavedOptions(&savedOptions);
}
/* Make sure that the list length is correct */
Tcl_ListObjLength(listPtr->interp, listPtr->listObj, &listPtr->nElements);
- Tk_FreeSavedOptions(&savedOptions);
- ListboxWorldChanged((ClientData) listPtr);
- return TCL_OK;
+ if (error) {
+ Tcl_SetObjResult(interp, errorResult);
+ Tcl_DecrRefCount(errorResult);
+ return TCL_ERROR;
+ } else {
+ ListboxWorldChanged((ClientData) listPtr);
+ return TCL_OK;
+ }
}
/*
@@ -1698,10 +1741,30 @@ ListboxWorldChanged(instanceData)
listPtr = (Listbox *) instanceData;
- gcValues.foreground = listPtr->fgColorPtr->pixel;
+ if (listPtr->state & STATE_NORMAL) {
+ gcValues.foreground = listPtr->fgColorPtr->pixel;
+ gcValues.graphics_exposures = False;
+ mask = GCForeground | GCFont | GCGraphicsExposures;
+ } else {
+ if (listPtr->dfgColorPtr != NULL) {
+ gcValues.foreground = listPtr->dfgColorPtr->pixel;
+ gcValues.graphics_exposures = False;
+ mask = GCForeground | GCFont | GCGraphicsExposures;
+ } else {
+ gcValues.foreground = listPtr->fgColorPtr->pixel;
+ mask = GCForeground | GCFont;
+ if (listPtr->gray == None) {
+ listPtr->gray = Tk_GetBitmap(NULL, listPtr->tkwin, "gray50");
+ }
+ if (listPtr->gray != None) {
+ gcValues.fill_style = FillStippled;
+ gcValues.stipple = listPtr->gray;
+ mask |= GCFillStyle | GCStipple;
+ }
+ }
+ }
+
gcValues.font = Tk_FontId(listPtr->tkfont);
- gcValues.graphics_exposures = False;
- mask = GCForeground | GCFont | GCGraphicsExposures;
gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues);
if (listPtr->textGC != None) {
Tk_FreeGC(listPtr->display, listPtr->textGC);
@@ -1750,7 +1813,7 @@ DisplayListbox(clientData)
register Listbox *listPtr = (Listbox *) clientData;
register Tk_Window tkwin = listPtr->tkwin;
GC gc;
- int i, limit, x, y, width, prevSelected;
+ int i, limit, x, y, width, prevSelected, freeGC;
Tk_FontMetrics fm;
Tcl_Obj *curElement;
Tcl_HashEntry *entry;
@@ -1766,6 +1829,9 @@ DisplayListbox(clientData)
Pixmap pixmap;
listPtr->flags &= ~REDRAW_PENDING;
+ if (listPtr->flags & LISTBOX_DELETED) {
+ return;
+ }
if (listPtr->flags & MAXWIDTH_IS_STALE) {
ListboxComputeGeometry(listPtr, 0, 1, 0);
@@ -1773,16 +1839,23 @@ DisplayListbox(clientData)
listPtr->flags |= UPDATE_H_SCROLLBAR;
}
+ Tcl_Preserve((ClientData) listPtr);
if (listPtr->flags & UPDATE_V_SCROLLBAR) {
ListboxUpdateVScrollbar(listPtr);
+ if ((listPtr->flags & LISTBOX_DELETED) || !Tk_IsMapped(tkwin)) {
+ Tcl_Release((ClientData) listPtr);
+ return;
+ }
}
if (listPtr->flags & UPDATE_H_SCROLLBAR) {
ListboxUpdateHScrollbar(listPtr);
+ if ((listPtr->flags & LISTBOX_DELETED) || !Tk_IsMapped(tkwin)) {
+ Tcl_Release((ClientData) listPtr);
+ return;
+ }
}
listPtr->flags &= ~(REDRAW_PENDING|UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR);
- if ((listPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
- return;
- }
+ Tcl_Release((ClientData) listPtr);
/*
* Redrawing is done in a temporary pixmap that is allocated
@@ -1817,106 +1890,131 @@ DisplayListbox(clientData)
y = ((i - listPtr->topIndex) * listPtr->lineHeight)
+ listPtr->inset;
gc = listPtr->textGC;
+ freeGC = 0;
/*
* Lookup this item in the item attributes table, to see if it has
* special foreground/background colors
*/
entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *)i);
- /* If the item is selected, it is drawn differently */
- if (Tcl_FindHashEntry(listPtr->selection, (char *)i) != NULL) {
- gc = listPtr->selTextGC;
- width = Tk_Width(tkwin) - 2*listPtr->inset;
- selectedBg = listPtr->selBorder;
-
- /* If there is attribute information for this item,
- * adjust the drawing accordingly */
- if (entry != NULL) {
- attrs = (ItemAttr *)Tcl_GetHashValue(entry);
- /* The default GC has the settings from the widget at large */
- gcValues.foreground = listPtr->selFgColorPtr->pixel;
- gcValues.font = Tk_FontId(listPtr->tkfont);
- gcValues.graphics_exposures = False;
- mask = GCForeground | GCFont | GCGraphicsExposures;
-
- if (attrs->selBorder != NULL) {
- selectedBg = attrs->selBorder;
- }
-
- if (attrs->selFgColor != NULL) {
- gcValues.foreground = attrs->selFgColor->pixel;
- gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues);
+ /*
+ * If the listbox is enabled, items may be drawn differently;
+ * they may be drawn selected, or they may have special foreground
+ * or background colors.
+ */
+ if (listPtr->state & STATE_NORMAL) {
+ if (Tcl_FindHashEntry(listPtr->selection, (char *)i) != NULL) {
+ /* Selected items are drawn differently. */
+ gc = listPtr->selTextGC;
+ width = Tk_Width(tkwin) - 2*listPtr->inset;
+ selectedBg = listPtr->selBorder;
+
+ /* If there is attribute information for this item,
+ * adjust the drawing accordingly */
+ if (entry != NULL) {
+ attrs = (ItemAttr *)Tcl_GetHashValue(entry);
+ /* Default GC has the values from the widget at large */
+ gcValues.foreground = listPtr->selFgColorPtr->pixel;
+ gcValues.font = Tk_FontId(listPtr->tkfont);
+ gcValues.graphics_exposures = False;
+ mask = GCForeground | GCFont | GCGraphicsExposures;
+
+ if (attrs->selBorder != NULL) {
+ selectedBg = attrs->selBorder;
+ }
+
+ if (attrs->selFgColor != NULL) {
+ gcValues.foreground = attrs->selFgColor->pixel;
+ gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues);
+ freeGC = 1;
+ }
}
- }
- Tk_Fill3DRectangle(tkwin, pixmap, selectedBg, x, y,
- width, listPtr->lineHeight, 0, TK_RELIEF_FLAT);
+ Tk_Fill3DRectangle(tkwin, pixmap, selectedBg, x, y,
+ width, listPtr->lineHeight, 0, TK_RELIEF_FLAT);
- /*
- * Draw beveled edges around the selection, if there are visible
- * edges next to this element. Special considerations:
- * 1. The left and right bevels may not be visible if horizontal
- * scrolling is enabled (the "left" and "right" variables
- * are zero to indicate that the corresponding bevel is
- * visible).
- * 2. Top and bottom bevels are only drawn if this is the
- * first or last seleted item.
- * 3. If the left or right bevel isn't visible, then the "left"
- * and "right" variables, computed above, have non-zero values
- * that extend the top and bottom bevels so that the mitered
- * corners are off-screen.
- */
+ /*
+ * Draw beveled edges around the selection, if there are
+ * visible edges next to this element. Special considerations:
+ *
+ * 1. The left and right bevels may not be visible if
+ * horizontal scrolling is enabled (the "left" & "right"
+ * variables are zero to indicate that the corresponding
+ * bevel is visible).
+ * 2. Top and bottom bevels are only drawn if this is the
+ * first or last seleted item.
+ * 3. If the left or right bevel isn't visible, then the
+ * "left" & "right" vars, computed above, have non-zero
+ * values that extend the top and bottom bevels so that
+ * the mitered corners are off-screen.
+ */
- /* Draw left bevel */
- if (left == 0) {
- Tk_3DVerticalBevel(tkwin, pixmap, selectedBg,
- x, y, listPtr->selBorderWidth, listPtr->lineHeight,
- 1, TK_RELIEF_RAISED);
- }
- /* Draw right bevel */
- if (right == 0) {
- Tk_3DVerticalBevel(tkwin, pixmap, selectedBg,
- x + width - listPtr->selBorderWidth, y,
- listPtr->selBorderWidth, listPtr->lineHeight,
- 0, TK_RELIEF_RAISED);
- }
- /* Draw top bevel */
- if (!prevSelected) {
- Tk_3DHorizontalBevel(tkwin, pixmap, selectedBg,
- x-left, y, width+left+right, listPtr->selBorderWidth,
- 1, 1, 1, TK_RELIEF_RAISED);
- }
- /* Draw bottom bevel */
- if (i + 1 == listPtr->nElements ||
- Tcl_FindHashEntry(listPtr->selection,
- (char *)(i + 1)) == NULL ) {
- Tk_3DHorizontalBevel(tkwin, pixmap, selectedBg, x-left,
- y + listPtr->lineHeight - listPtr->selBorderWidth,
- width+left+right, listPtr->selBorderWidth, 0, 0, 0,
- TK_RELIEF_RAISED);
- }
- prevSelected = 1;
- } else {
- /* If there is an item attributes record for this item,
- * draw the background box and set the foreground color
- * accordingly */
- if (entry != NULL) {
- attrs = (ItemAttr *)Tcl_GetHashValue(entry);
- gcValues.foreground = listPtr->fgColorPtr->pixel;
- gcValues.font = Tk_FontId(listPtr->tkfont);
- gcValues.graphics_exposures = False;
- mask = GCForeground | GCFont | GCGraphicsExposures;
- if (attrs->border != NULL) {
- width = Tk_Width(tkwin) - 2*listPtr->inset;
- Tk_Fill3DRectangle(tkwin, pixmap, attrs->border, x, y,
- width, listPtr->lineHeight, 0, TK_RELIEF_FLAT);
+ /* Draw left bevel */
+ if (left == 0) {
+ Tk_3DVerticalBevel(tkwin, pixmap, selectedBg,
+ x, y, listPtr->selBorderWidth, listPtr->lineHeight,
+ 1, TK_RELIEF_RAISED);
+ }
+ /* Draw right bevel */
+ if (right == 0) {
+ Tk_3DVerticalBevel(tkwin, pixmap, selectedBg,
+ x + width - listPtr->selBorderWidth, y,
+ listPtr->selBorderWidth, listPtr->lineHeight,
+ 0, TK_RELIEF_RAISED);
}
- if (attrs->fgColor != NULL) {
- gcValues.foreground = attrs->fgColor->pixel;
- gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues);
+ /* Draw top bevel */
+ if (!prevSelected) {
+ Tk_3DHorizontalBevel(tkwin, pixmap, selectedBg,
+ x-left, y, width+left+right,
+ listPtr->selBorderWidth,
+ 1, 1, 1, TK_RELIEF_RAISED);
}
+ /* Draw bottom bevel */
+ if (i + 1 == listPtr->nElements ||
+ Tcl_FindHashEntry(listPtr->selection,
+ (char *)(i + 1)) == NULL ) {
+ Tk_3DHorizontalBevel(tkwin, pixmap, selectedBg, x-left,
+ y + listPtr->lineHeight - listPtr->selBorderWidth,
+ width+left+right, listPtr->selBorderWidth, 0, 0, 0,
+ TK_RELIEF_RAISED);
+ }
+ prevSelected = 1;
+ } else {
+ /*
+ * If there is an item attributes record for this item, draw
+ * the background box and set the foreground color accordingly
+ */
+ if (entry != NULL) {
+ attrs = (ItemAttr *)Tcl_GetHashValue(entry);
+ gcValues.foreground = listPtr->fgColorPtr->pixel;
+ gcValues.font = Tk_FontId(listPtr->tkfont);
+ gcValues.graphics_exposures = False;
+ mask = GCForeground | GCFont | GCGraphicsExposures;
+
+ /*
+ * If the item has its own background color, draw it now.
+ */
+
+ if (attrs->border != NULL) {
+ width = Tk_Width(tkwin) - 2*listPtr->inset;
+ Tk_Fill3DRectangle(tkwin, pixmap, attrs->border, x, y,
+ width, listPtr->lineHeight, 0, TK_RELIEF_FLAT);
+ }
+
+ /*
+ * If the item has its own foreground, use it to override
+ * the value in the gcValues structure.
+ */
+
+ if ((listPtr->state & STATE_NORMAL)
+ && attrs->fgColor != NULL) {
+ gcValues.foreground = attrs->fgColor->pixel;
+ gc = Tk_GetGC(listPtr->tkwin, mask, &gcValues);
+ freeGC = 1;
+ }
+ }
+ prevSelected = 0;
}
- prevSelected = 0;
}
/* Draw the actual text of this item */
@@ -1928,10 +2026,68 @@ DisplayListbox(clientData)
Tk_DrawChars(listPtr->display, pixmap, gc, listPtr->tkfont,
stringRep, stringLen, x, y);
- /* If this is the active element, underline it. */
+ /* If this is the active element, apply the activestyle to it. */
if ((i == listPtr->active) && (listPtr->flags & GOT_FOCUS)) {
- Tk_UnderlineChars(listPtr->display, pixmap, gc, listPtr->tkfont,
- stringRep, x, y, 0, stringLen);
+ if (listPtr->activeStyle == ACTIVE_STYLE_UNDERLINE) {
+ /* Underline the text. */
+ Tk_UnderlineChars(listPtr->display, pixmap, gc,
+ listPtr->tkfont, stringRep, x, y, 0, stringLen);
+ } else if (listPtr->activeStyle == ACTIVE_STYLE_DOTBOX) {
+#ifdef WIN32
+ /*
+ * This provides for exact default look and feel on Windows.
+ */
+ TkWinDCState state;
+ HDC dc;
+ RECT rect;
+
+ dc = TkWinGetDrawableDC(listPtr->display, pixmap, &state);
+ rect.left = listPtr->inset;
+ rect.top = ((i - listPtr->topIndex) * listPtr->lineHeight)
+ + listPtr->inset;
+ rect.right = rect.left + width;
+ rect.bottom = rect.top + listPtr->lineHeight;
+ DrawFocusRect(dc, &rect);
+ TkWinReleaseDrawableDC(pixmap, dc, &state);
+#else
+ /*
+ * Draw a dotted box around the text.
+ */
+ x = listPtr->inset;
+ y = ((i - listPtr->topIndex) * listPtr->lineHeight)
+ + listPtr->inset;
+ width = Tk_Width(tkwin) - 2*listPtr->inset - 1;
+
+ gcValues.line_style = LineOnOffDash;
+ gcValues.line_width = listPtr->selBorderWidth;
+ if (gcValues.line_width <= 0) {
+ gcValues.line_width = 1;
+ }
+ gcValues.dash_offset = 0;
+ gcValues.dashes = 1;
+ /*
+ * You would think the XSetDashes was necessary, but it
+ * appears that the default dotting for just saying we
+ * want dashes appears to work correctly.
+ static char dashList[] = { 1 };
+ static int dashLen = sizeof(dashList);
+ XSetDashes(listPtr->display, gc, 0, dashList, dashLen);
+ */
+ mask = GCLineWidth | GCLineStyle | GCDashList | GCDashOffset;
+ XChangeGC(listPtr->display, gc, mask, &gcValues);
+ XDrawRectangle(listPtr->display, pixmap, gc, x, y,
+ (unsigned) width, (unsigned) listPtr->lineHeight - 1);
+ if (!freeGC) {
+ /* Don't bother changing if it is about to be freed. */
+ gcValues.line_style = LineSolid;
+ XChangeGC(listPtr->display, gc, GCLineStyle, &gcValues);
+ }
+#endif
+ }
+ }
+
+ if (freeGC) {
+ Tk_FreeGC(listPtr->display, gc);
}
}
@@ -2365,7 +2521,17 @@ ListboxEventProc(clientData, eventPtr)
NearestListboxElement(listPtr, eventPtr->xexpose.y
+ eventPtr->xexpose.height));
} else if (eventPtr->type == DestroyNotify) {
- DestroyListbox((char *) clientData);
+ if (!(listPtr->flags & LISTBOX_DELETED)) {
+ listPtr->flags |= LISTBOX_DELETED;
+ Tcl_DeleteCommandFromToken(listPtr->interp, listPtr->widgetCmd);
+ if (listPtr->setGrid) {
+ Tk_UnsetGrid(listPtr->tkwin);
+ }
+ if (listPtr->flags & REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DisplayListbox, clientData);
+ }
+ Tcl_EventuallyFree(clientData, DestroyListbox);
+ }
} else if (eventPtr->type == ConfigureNotify) {
int vertSpace;
@@ -2607,8 +2773,12 @@ ChangeListboxOffset(listPtr, offset)
/*
* Make sure that the new offset is within the allowable range, and
* round it off to an even multiple of xScrollUnit.
+ *
+ * Add half a scroll unit to do entry/text-like synchronization.
+ * [Bug #225025]
*/
+ offset += listPtr->xScrollUnit / 2;
maxOffset = listPtr->maxWidth - (Tk_Width(listPtr->tkwin) -
2*listPtr->inset - 2*listPtr->selBorderWidth)
+ listPtr->xScrollUnit - 1;
@@ -2979,7 +3149,7 @@ EventuallyRedrawRange(listPtr, first, last)
/* We don't have to register a redraw callback if one is already pending,
* or if the window doesn't exist, or if the window isn't mapped */
if ((listPtr->flags & REDRAW_PENDING)
- || (listPtr->tkwin == NULL)
+ || (listPtr->flags & LISTBOX_DELETED)
|| !Tk_IsMapped(listPtr->tkwin)) {
return;
}
@@ -3133,8 +3303,8 @@ static char *
ListboxListVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about button. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Not used. */
- char *name2; /* Not used. */
+ CONST char *name1; /* Not used. */
+ CONST char *name2; /* Not used. */
int flags; /* Information about what happened. */
{
Listbox *listPtr = (Listbox *)clientData;
@@ -3281,5 +3451,3 @@ MigrateHashEntries(table, first, last, offset)
return;
}
-
-
diff --git a/tk/generic/tkMacWinMenu.c b/tk/generic/tkMacWinMenu.c
index 066b96eedce..a0bf8026a11 100644
--- a/tk/generic/tkMacWinMenu.c
+++ b/tk/generic/tkMacWinMenu.c
@@ -141,4 +141,3 @@ TkPreprocessMenu(menuPtr)
menuPtr->postCommandGeneration = tsdPtr->postCommandGeneration;
return PreprocessMenu(menuPtr);
}
-
diff --git a/tk/generic/tkMain.c b/tk/generic/tkMain.c
index 9f31a9860a2..3fb23290274 100644
--- a/tk/generic/tkMain.c
+++ b/tk/generic/tkMain.c
@@ -8,7 +8,7 @@
* for Tk applications.
*
* Copyright (c) 1990-1994 The Regents of the University of California.
- * Copyright (c) 1994-1996 Sun Microsystems, Inc.
+ * 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.
@@ -16,9 +16,6 @@
* RCS: @(#) $Id$
*/
-#ifdef _WIN32
-# include <windows.h>
-#endif
#include <ctype.h>
#include <stdio.h>
#include <string.h>
@@ -46,7 +43,7 @@ typedef struct ThreadSpecificData {
* terminal-like device. Zero means it's
* a file. */
} ThreadSpecificData;
-Tcl_ThreadDataKey dataKey;
+static Tcl_ThreadDataKey dataKey;
/*
* Declarations for various library procedures and variables (don't want
@@ -58,11 +55,13 @@ Tcl_ThreadDataKey dataKey;
*/
#if !defined(__WIN32__) && !defined(_WIN32)
+#if !defined(MAC_TCL)
extern int isatty _ANSI_ARGS_((int fd));
+#else
+#include <unistd.h>
+#endif
extern char * strrchr _ANSI_ARGS_((CONST char *string, int c));
#endif
-extern void TkpDisplayWarning _ANSI_ARGS_((char *msg,
- char *title));
/*
* Forward declarations for procedures defined later in this file.
@@ -100,7 +99,8 @@ Tk_MainEx(argc, argv, appInitProc, interp)
* to execute commands. */
Tcl_Interp *interp;
{
- char *args, *fileName;
+ char *args;
+ CONST char *fileName;
char buf[TCL_INTEGER_SPACE];
int code;
size_t length;
@@ -163,18 +163,18 @@ Tk_MainEx(argc, argv, appInitProc, interp)
* and "argv".
*/
- args = Tcl_Merge(argc-1, argv+1);
+ args = Tcl_Merge(argc-1, (CONST char **)argv+1);
Tcl_ExternalToUtfDString(NULL, args, -1, &argString);
Tcl_SetVar(interp, "argv", Tcl_DStringValue(&argString), TCL_GLOBAL_ONLY);
Tcl_DStringFree(&argString);
ckfree(args);
sprintf(buf, "%d", argc-1);
+
if (fileName == NULL) {
- Tcl_ExternalToUtfDString(NULL, argv[0], -1, &argString);
+ Tcl_ExternalToUtfDString(NULL, argv[0], -1, &argString);
} else {
- fileName = Tcl_ExternalToUtfDString(NULL, fileName, -1, &argString);
+ fileName = Tcl_ExternalToUtfDString(NULL, fileName, -1, &argString);
}
-
Tcl_SetVar(interp, "argc", buf, TCL_GLOBAL_ONLY);
Tcl_SetVar(interp, "argv0", Tcl_DStringValue(&argString), TCL_GLOBAL_ONLY);
@@ -221,7 +221,8 @@ Tk_MainEx(argc, argv, appInitProc, interp)
*/
if ((*appInitProc)(interp) != TCL_OK) {
- TkpDisplayWarning(interp->result, "Application initialization failed");
+ TkpDisplayWarning(Tcl_GetStringResult(interp),
+ "Application initialization failed");
}
/*
@@ -405,12 +406,12 @@ Prompt(interp, partial)
* exists a partial command, so use
* the secondary prompt. */
{
- char *promptCmd;
+ Tcl_Obj *promptCmd;
int code;
Tcl_Channel outChannel, errChannel;
- promptCmd = Tcl_GetVar(interp,
- partial ? "tcl_prompt2" : "tcl_prompt1", TCL_GLOBAL_ONLY);
+ promptCmd = Tcl_GetVar2Ex(interp,
+ partial ? "tcl_prompt2" : "tcl_prompt1", NULL, TCL_GLOBAL_ONLY);
if (promptCmd == NULL) {
defaultPrompt:
if (!partial) {
@@ -427,7 +428,7 @@ defaultPrompt:
}
}
} else {
- code = Tcl_Eval(interp, promptCmd);
+ code = Tcl_EvalObjEx(interp, promptCmd, TCL_EVAL_GLOBAL);
if (code != TCL_OK) {
Tcl_AddErrorInfo(interp,
"\n (script that generates prompt)");
@@ -450,5 +451,3 @@ defaultPrompt:
Tcl_Flush(outChannel);
}
}
-
-
diff --git a/tk/generic/tkMenu.c b/tk/generic/tkMenu.c
index 2e84ebb59eb..1d5218ac8dd 100644
--- a/tk/generic/tkMenu.c
+++ b/tk/generic/tkMenu.c
@@ -105,8 +105,19 @@ TCL_DECLARE_MUTEX(menuMutex)
char *tkMenuStateStrings[] = {"active", "normal", "disabled", (char *) NULL};
-static char *menuEntryTypeStrings[] = {"cascade", "checkbutton", "command",
- "radiobutton", "separator", (char *) NULL};
+static CONST char *menuEntryTypeStrings[] = {
+ "cascade", "checkbutton", "command", "radiobutton", "separator",
+ (char *) NULL
+};
+
+/*
+ * The following table defines the legal values for the -compound option.
+ * It is used with the "enum compound" declaration in tkMenu.h
+ */
+
+static char *compoundStrings[] = {
+ "bottom", "center", "left", "none", "right", "top", (char *) NULL
+};
Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = {
{TK_OPTION_BORDER, "-activebackground", (char *) NULL, (char *) NULL,
@@ -130,6 +141,9 @@ Tk_OptionSpec tkBasicMenuEntryConfigSpecs[] = {
{TK_OPTION_STRING, "-command", (char *) NULL, (char *) NULL,
DEF_MENU_ENTRY_COMMAND,
Tk_Offset(TkMenuEntry, commandPtr), -1, TK_OPTION_NULL_OK},
+ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
+ DEF_MENU_ENTRY_COMPOUND, -1, Tk_Offset(TkMenuEntry, compound), 0,
+ (ClientData) compoundStrings, 0},
{TK_OPTION_FONT, "-font", (char *) NULL, (char *) NULL,
DEF_MENU_ENTRY_FONT,
Tk_Offset(TkMenuEntry, fontPtr), -1, TK_OPTION_NULL_OK},
@@ -231,7 +245,7 @@ static Tk_OptionSpec *specsArray[] = {
* Menu type strings for use with Tcl_GetIndexFromObj.
*/
-static char *menuTypeStrings[] = {"normal", "tearoff", "menubar",
+static CONST char *menuTypeStrings[] = {"normal", "tearoff", "menubar",
(char *) NULL};
Tk_OptionSpec tkMenuConfigSpecs[] = {
@@ -299,7 +313,7 @@ Tk_OptionSpec tkMenuConfigSpecs[] = {
* along with MenuWidgetObjCmd.
*/
-static char *menuOptions[] = {
+static CONST char *menuOptions[] = {
"activate", "add", "cget", "clone", "configure", "delete", "entrycget",
"entryconfigure", "index", "insert", "invoke", "post", "postcascade",
"type", "unpost", "yposition", (char *) NULL
@@ -346,8 +360,8 @@ static void MenuCmdDeletedProc _ANSI_ARGS_((
static TkMenuEntry * MenuNewEntry _ANSI_ARGS_((TkMenu *menuPtr, int index,
int type));
static char * MenuVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
static int MenuWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
@@ -363,15 +377,15 @@ static void UnhookCascadeEntry _ANSI_ARGS_((TkMenuEntry *mePtr));
* the geometry proc to be called.
*/
-static TkClassProcs menuClass = {
- NULL, /* createProc. */
- MenuWorldChanged /* geometryProc. */
+static Tk_ClassProcs menuClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ MenuWorldChanged /* worldChangedProc */
};
/*
*--------------------------------------------------------------
*
- * Tk_CreateMenuCmd --
+ * TkCreateMenuCmd --
*
* Called by Tk at initialization time to create the menu
* command.
@@ -451,7 +465,7 @@ MenuCmd(clientData, interp, objc, objv)
int i, index;
int toplevel;
char *windowName;
- static char *typeStringList[] = {"-type", (char *) NULL};
+ static CONST char *typeStringList[] = {"-type", (char *) NULL};
TkMenuOptionTables *optionTablesPtr = (TkMenuOptionTables *) clientData;
if (objc < 2) {
@@ -523,7 +537,7 @@ MenuCmd(clientData, interp, objc, objv)
TkMenuInitializeDrawingFields(menuPtr);
Tk_SetClass(menuPtr->tkwin, "Menu");
- TkSetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr);
+ Tk_SetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr);
if (Tk_InitOptions(interp, (char *) menuPtr,
menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin)
!= TCL_OK) {
@@ -700,8 +714,6 @@ MenuWidgetObjCmd(clientData, interp, objc, objv)
switch ((enum options) option) {
case MENU_ACTIVATE: {
int index;
- /* patch for menu selection */
- int state;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "activate index");
@@ -1002,9 +1014,9 @@ MenuWidgetObjCmd(clientData, interp, objc, objv)
if (menuPtr->entries[index]->type == TEAROFF_ENTRY) {
Tcl_SetResult(interp, "tearoff", TCL_STATIC);
} else {
- Tcl_SetResult(interp,
+ Tcl_SetStringObj(Tcl_GetObjResult(interp),
menuEntryTypeStrings[menuPtr->entries[index]->type],
- TCL_STATIC);
+ -1);
}
break;
}
@@ -1072,7 +1084,7 @@ TkInvokeMenu(interp, menuPtr, index)
if (mePtr->type == TEAROFF_ENTRY) {
Tcl_DString ds;
Tcl_DStringInit(&ds);
- Tcl_DStringAppend(&ds, "tkTearOffMenu ", -1);
+ Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1);
Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1);
result = Tcl_Eval(interp, Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
@@ -1108,7 +1120,13 @@ TkInvokeMenu(interp, menuPtr, index)
}
Tcl_DecrRefCount(valuePtr);
}
- if ((result == TCL_OK) && (mePtr->commandPtr != NULL)) {
+ /*
+ * We check numEntries in addition to whether the menu entry
+ * has a command because that goes to zero if the menu gets
+ * deleted (e.g., during command evaluation).
+ */
+ if ((menuPtr->numEntries != 0) && (result == TCL_OK)
+ && (mePtr->commandPtr != NULL)) {
Tcl_Obj *commandPtr = mePtr->commandPtr;
Tcl_IncrRefCount(commandPtr);
@@ -1117,7 +1135,7 @@ TkInvokeMenu(interp, menuPtr, index)
}
Tcl_Release((ClientData) mePtr);
done:
- return result;
+ return result;
}
/*
@@ -1265,14 +1283,14 @@ TkDestroyMenu(menuPtr)
if (menuPtr->menuFlags & MENU_DELETION_PENDING) {
return;
}
-
+
/*
* Now destroy all non-tearoff instances of this menu if this is a
* parent menu. Is this loop safe enough? Are there going to be
* destroy bindings on child menus which kill the parent? If not,
* we have to do a slightly more complex scheme.
*/
-
+
if (menuPtr->masterMenuPtr == menuPtr) {
menuPtr->menuFlags |= MENU_DELETION_PENDING;
while (menuPtr->nextInstancePtr != NULL) {
@@ -1289,13 +1307,13 @@ TkDestroyMenu(menuPtr)
* If any toplevel widgets have this menu as their menubar,
* the geometry of the window may have to be recalculated.
*/
-
+
topLevelListPtr = menuPtr->menuRefPtr->topLevelListPtr;
while (topLevelListPtr != NULL) {
nextTopLevelPtr = topLevelListPtr->nextPtr;
TkpSetWindowMenuBar(topLevelListPtr->tkwin, NULL);
topLevelListPtr = nextTopLevelPtr;
- }
+ }
DestroyMenuInstance(menuPtr);
}
@@ -1518,6 +1536,11 @@ ConfigureMenu(interp, menuPtr, objc, objv)
ckfree((char *) cleanupPtr->errorStructPtr);
cleanupPtr->errorStructPtr = NULL;
}
+ if (menuListPtr->errorStructPtr != NULL) {
+ Tk_RestoreSavedOptions(menuListPtr->errorStructPtr);
+ ckfree((char *) menuListPtr->errorStructPtr);
+ menuListPtr->errorStructPtr = NULL;
+ }
return TCL_ERROR;
}
@@ -1558,18 +1581,18 @@ ConfigureMenu(interp, menuPtr, objc, objv)
if ((menuListPtr->numEntries == 0)
|| (menuListPtr->entries[0]->type != TEAROFF_ENTRY)) {
if (MenuNewEntry(menuListPtr, 0, TEAROFF_ENTRY) == NULL) {
- if (menuListPtr->errorStructPtr != NULL) {
- for (cleanupPtr = menuPtr->masterMenuPtr;
- cleanupPtr != menuListPtr;
- cleanupPtr = cleanupPtr->nextInstancePtr) {
- Tk_RestoreSavedOptions(cleanupPtr->errorStructPtr);
- ckfree((char *) cleanupPtr->errorStructPtr);
- cleanupPtr->errorStructPtr = NULL;
- }
+ for (cleanupPtr = menuPtr->masterMenuPtr;
+ cleanupPtr != menuListPtr;
+ cleanupPtr = cleanupPtr->nextInstancePtr) {
Tk_RestoreSavedOptions(cleanupPtr->errorStructPtr);
ckfree((char *) cleanupPtr->errorStructPtr);
cleanupPtr->errorStructPtr = NULL;
}
+ if (menuListPtr->errorStructPtr != NULL) {
+ Tk_RestoreSavedOptions(menuListPtr->errorStructPtr);
+ ckfree((char *) menuListPtr->errorStructPtr);
+ menuListPtr->errorStructPtr = NULL;
+ }
return TCL_ERROR;
}
}
@@ -1980,7 +2003,7 @@ ConfigureMenuCloneEntries(interp, menuPtr, index, objc, objv)
oldCascadeName = Tcl_GetStringFromObj(oldCascadePtr,
NULL);
cascadeEntryChanged = (strcmp(oldCascadeName, newCascadeName)
- == 0);
+ != 0);
}
if (oldCascadePtr != NULL) {
Tcl_DecrRefCount(oldCascadePtr);
@@ -2445,13 +2468,13 @@ static char *
MenuVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about menu entry. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* First part of variable's name. */
- char *name2; /* Second part of variable's name. */
+ CONST char *name1; /* First part of variable's name. */
+ CONST char *name2; /* Second part of variable's name. */
int flags; /* Describes what just happened. */
{
TkMenuEntry *mePtr = (TkMenuEntry *) clientData;
TkMenu *menuPtr;
- char *value;
+ CONST char *value;
char *name = Tcl_GetStringFromObj(mePtr->namePtr, NULL);
char *onValue;
@@ -2640,7 +2663,7 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
}
}
- menuDupCommandArray[0] = Tcl_NewStringObj("tkMenuDup", -1);
+ menuDupCommandArray[0] = Tcl_NewStringObj("tk::MenuDup", -1);
menuDupCommandArray[1] = Tcl_NewStringObj(Tk_PathName(menuPtr->tkwin), -1);
menuDupCommandArray[2] = newMenuNamePtr;
if (newMenuTypePtr == NULL) {
@@ -2667,7 +2690,6 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
&& (menuPtr->numEntries == menuRefPtr->menuPtr->numEntries)) {
TkMenu *newMenuPtr = menuRefPtr->menuPtr;
Tcl_Obj *newObjv[3];
- char *newArgv[3];
int i, numElements;
/*
@@ -2694,15 +2716,18 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
* clone structure.
*/
- newArgv[0] = "bindtags";
- newArgv[1] = Tk_PathName(newMenuPtr->tkwin);
- if (Tk_BindtagsCmd((ClientData)newMenuPtr->tkwin,
- newMenuPtr->interp, 2, newArgv) == TCL_OK) {
+ newObjv[0] = Tcl_NewStringObj("bindtags", -1);
+ newObjv[1] = Tcl_NewStringObj(Tk_PathName(newMenuPtr->tkwin), -1);
+ Tcl_IncrRefCount(newObjv[0]);
+ Tcl_IncrRefCount(newObjv[1]);
+ if (Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
+ newMenuPtr->interp, 2, newObjv) == TCL_OK) {
char *windowName;
Tcl_Obj *bindingsPtr =
Tcl_DuplicateObj(Tcl_GetObjResult(newMenuPtr->interp));
Tcl_Obj *elementPtr;
+ Tcl_IncrRefCount(bindingsPtr);
Tcl_ListObjLength(newMenuPtr->interp, bindingsPtr, &numElements);
for (i = 0; i < numElements; i++) {
Tcl_ListObjIndex(newMenuPtr->interp, bindingsPtr, i,
@@ -2712,17 +2737,22 @@ CloneMenu(menuPtr, newMenuNamePtr, newMenuTypePtr)
== 0) {
Tcl_Obj *newElementPtr = Tcl_NewStringObj(
Tk_PathName(newMenuPtr->masterMenuPtr->tkwin), -1);
- Tcl_IncrRefCount(newElementPtr);
+ /*
+ * The newElementPtr will have its refCount incremented
+ * here, so we don't need to worry about it any more.
+ */
Tcl_ListObjReplace(menuPtr->interp, bindingsPtr,
i + 1, 0, 1, &newElementPtr);
- newArgv[2] = Tcl_GetStringFromObj(bindingsPtr, NULL);
- Tk_BindtagsCmd((ClientData)newMenuPtr->tkwin,
- menuPtr->interp, 3, newArgv);
+ newObjv[2] = bindingsPtr;
+ Tk_BindtagsObjCmd((ClientData)newMenuPtr->tkwin,
+ menuPtr->interp, 3, newObjv);
break;
}
}
Tcl_DecrRefCount(bindingsPtr);
}
+ Tcl_DecrRefCount(newObjv[0]);
+ Tcl_DecrRefCount(newObjv[1]);
Tcl_ResetResult(menuPtr->interp);
/*
@@ -3458,5 +3488,3 @@ TkMenuInit()
tsdPtr->menusInitialized = 1;
}
}
-
-
diff --git a/tk/generic/tkMenu.h b/tk/generic/tkMenu.h
index d1b8e39dd3a..93dfe1e00a7 100644
--- a/tk/generic/tkMenu.h
+++ b/tk/generic/tkMenu.h
@@ -39,6 +39,15 @@ typedef struct TkMenuPlatformData_ *TkMenuPlatformData;
typedef struct TkMenuPlatformEntryData_ *TkMenuPlatformEntryData;
/*
+ * Legal values for the "compound" field of TkMenuEntry and TkMenuButton records.
+ */
+
+enum compound {
+ COMPOUND_BOTTOM, COMPOUND_CENTER, COMPOUND_LEFT, COMPOUND_NONE,
+ COMPOUND_RIGHT, COMPOUND_TOP
+};
+
+/*
* One of the following data structures is kept for each entry of each
* menu managed by this file:
*/
@@ -115,6 +124,9 @@ typedef struct TkMenuEntry {
* entry. */
int labelWidth; /* Number of pixels to allow for displaying
* labels in menu entries. */
+ int compound; /* Value of -compound option; specifies whether
+ * the entry should show both an image and
+ * text, and, if so, how. */
/*
* Information used to implement this entry's action:
@@ -570,4 +582,3 @@ EXTERN void TkpSetWindowMenuBar _ANSI_ARGS_((Tk_Window tkwin,
#endif /* _TKMENU */
-
diff --git a/tk/generic/tkMenuDraw.c b/tk/generic/tkMenuDraw.c
index 123795c4801..20b99095597 100644
--- a/tk/generic/tkMenuDraw.c
+++ b/tk/generic/tkMenuDraw.c
@@ -191,7 +191,6 @@ TkMenuConfigureDrawOptions(menuPtr)
Tk_3DBorder border, activeBorder;
Tk_Font tkfont;
XColor *fg, *activeFg, *indicatorFg;
- XColor *foreground, *background;
/*
* A few options need special processing, such as setting the
@@ -215,19 +214,15 @@ TkMenuConfigureDrawOptions(menuPtr)
menuPtr->textGC = newGC;
gcValues.font = Tk_FontId(tkfont);
- background = Tk_3DBorderColor(border);
- gcValues.background = background->pixel;
+ gcValues.background = Tk_3DBorderColor(border)->pixel;
if (menuPtr->disabledFgPtr != NULL) {
XColor *disabledFg;
disabledFg = Tk_GetColorFromObj(menuPtr->tkwin,
menuPtr->disabledFgPtr);
- foreground = disabledFg;
- gcValues.foreground = foreground->pixel;
+ gcValues.foreground = disabledFg->pixel;
mask = GCForeground|GCBackground|GCFont;
} else {
- foreground = background;
- background = NULL;
gcValues.foreground = gcValues.background;
mask = GCForeground;
if (menuPtr->gray == None) {
@@ -335,18 +330,16 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
|| (mePtr->activeBorderPtr != NULL)
|| (mePtr->activeFgPtr != NULL)
|| (mePtr->indicatorFgPtr != NULL)) {
- XColor *fg, *bg, *indicatorFg, *activeFg;
+ XColor *fg, *indicatorFg, *activeFg;
Tk_3DBorder border, activeBorder;
fg = Tk_GetColorFromObj(menuPtr->tkwin, (mePtr->fgPtr != NULL)
? mePtr->fgPtr : menuPtr->fgPtr);
-
gcValues.foreground = fg->pixel;
border = Tk_Get3DBorderFromObj(menuPtr->tkwin,
(mePtr->borderPtr != NULL) ? mePtr->borderPtr
: menuPtr->borderPtr);
- bg = Tk_3DBorderColor(border);
- gcValues.background = bg->pixel;
+ gcValues.background = Tk_3DBorderColor(border)->pixel;
gcValues.font = Tk_FontId(tkfont);
@@ -360,6 +353,7 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
newGC = Tk_GetGC(menuPtr->tkwin,
GCForeground|GCBackground|GCFont|GCGraphicsExposures,
&gcValues);
+
indicatorFg = Tk_GetColorFromObj(menuPtr->tkwin,
(mePtr->indicatorFgPtr != NULL) ? mePtr->indicatorFgPtr
: menuPtr->indicatorFgPtr);
@@ -367,13 +361,15 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
newIndicatorGC = Tk_GetGC(menuPtr->tkwin,
GCForeground|GCBackground|GCGraphicsExposures,
&gcValues);
+
if ((menuPtr->disabledFgPtr != NULL) || (mePtr->image != NULL)) {
- fg = Tk_GetColorFromObj(menuPtr->tkwin,
+ XColor *disabledFg;
+
+ disabledFg = Tk_GetColorFromObj(menuPtr->tkwin,
menuPtr->disabledFgPtr);
- gcValues.foreground = fg->pixel;
+ gcValues.foreground = disabledFg->pixel;
mask = GCForeground|GCBackground|GCFont|GCGraphicsExposures;
} else {
- fg = bg;
gcValues.foreground = gcValues.background;
gcValues.fill_style = FillStippled;
gcValues.stipple = menuPtr->gray;
@@ -389,8 +385,7 @@ TkMenuConfigureEntryDrawOptions(mePtr, index)
: menuPtr->activeBorderPtr);
gcValues.foreground = activeFg->pixel;
- bg = Tk_3DBorderColor(activeBorder);
- gcValues.background = bg->pixel;
+ gcValues.background = Tk_3DBorderColor(activeBorder)->pixel;
newActiveGC = Tk_GetGC(menuPtr->tkwin,
GCForeground|GCBackground|GCFont|GCGraphicsExposures,
&gcValues);
@@ -1054,4 +1049,3 @@ AdjustMenuCoords(menuPtr, mePtr, xPtr, yPtr, string)
}
sprintf(string, "%d %d", *xPtr, *yPtr);
}
-
diff --git a/tk/generic/tkMenubutton.c b/tk/generic/tkMenubutton.c
index 059499a7d24..eb222428431 100644
--- a/tk/generic/tkMenubutton.c
+++ b/tk/generic/tkMenubutton.c
@@ -37,6 +37,15 @@ static char *stateStrings[] = {
};
/*
+ * The following table defines the legal values for the -compound option.
+ * It is used with the "enum compound" declaration in tkMenuButton.h
+ */
+
+static char *compoundStrings[] = {
+ "bottom", "center", "left", "none", "right", "top", (char *) NULL
+};
+
+/*
* Information used for parsing configuration specs:
*/
@@ -113,6 +122,9 @@ static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_RELIEF, "-relief", "relief", "Relief",
DEF_MENUBUTTON_RELIEF, -1, Tk_Offset(TkMenuButton, relief),
0, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-compound", "compound", "Compound",
+ DEF_BUTTON_COMPOUND, -1, Tk_Offset(TkMenuButton, compound), 0,
+ (ClientData) compoundStrings, 0},
{TK_OPTION_STRING_TABLE, "-state", "state", "State",
DEF_MENUBUTTON_STATE, -1, Tk_Offset(TkMenuButton, state),
0, (ClientData) stateStrings, 0},
@@ -143,7 +155,7 @@ static Tk_OptionSpec optionSpecs[] = {
* to dispatch the scale widget command.
*/
-static char *commandNames[] = {
+static CONST char *commandNames[] = {
"cget", "configure", (char *) NULL
};
@@ -164,7 +176,7 @@ static void MenuButtonImageProc _ANSI_ARGS_((ClientData clientData,
int imgHeight));
static char * MenuButtonTextVarProc _ANSI_ARGS_((
ClientData clientData, Tcl_Interp *interp,
- char *name1, char *name2, int flags));
+ CONST char *name1, CONST char *name2, int flags));
static int MenuButtonWidgetObjCmd _ANSI_ARGS_((
ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[]));
@@ -193,8 +205,7 @@ static void DestroyMenuButton _ANSI_ARGS_((char *memPtr));
int
Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to
- * option table. */
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
@@ -203,25 +214,6 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
Tk_OptionTable optionTable;
Tk_Window tkwin;
- optionTable = (Tk_OptionTable) clientData;
- if (optionTable == NULL) {
- Tcl_CmdInfo info;
- char *name;
-
- /*
- * We haven't created the option table for this widget class
- * yet. Do it now and save the table as the clientData for
- * the command, so we'll have access to it in future
- * invocations of the command.
- */
-
- optionTable = Tk_CreateOptionTable(interp, optionSpecs);
- name = Tcl_GetString(objv[0]);
- Tcl_GetCommandInfo(interp, name, &info);
- info.objClientData = (ClientData) optionTable;
- Tcl_SetCommandInfo(interp, name, &info);
- }
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
return TCL_ERROR;
@@ -231,16 +223,23 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
* Create the new window.
*/
- tkwin = Tk_CreateWindowFromPath(interp,
- Tk_MainWindow(interp), Tcl_GetString(objv[1]), (char *) NULL);
+ tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
+ Tcl_GetString(objv[1]), (char *) NULL);
if (tkwin == NULL) {
return TCL_ERROR;
}
+ /*
+ * Create the option table for this widget class. If it has already
+ * been created, the cached pointer will be returned.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, optionSpecs);
+
Tk_SetClass(tkwin, "Menubutton");
mbPtr = TkpCreateMenuButton(tkwin);
- TkSetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr);
+ Tk_SetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr);
/*
* Initialize the data structure for the button.
@@ -301,8 +300,7 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
ExposureMask|StructureNotifyMask|FocusChangeMask,
MenuButtonEventProc, (ClientData) mbPtr);
- if (Tk_InitOptions(interp, (char *) mbPtr, optionTable, tkwin)
- != TCL_OK) {
+ if (Tk_InitOptions(interp, (char *) mbPtr, optionTable, tkwin) != TCL_OK) {
Tk_DestroyWindow(mbPtr->tkwin);
return TCL_ERROR;
}
@@ -312,8 +310,7 @@ Tk_MenubuttonObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
- Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(mbPtr->tkwin),
- -1);
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(mbPtr->tkwin), -1);
return TCL_OK;
}
@@ -630,7 +627,7 @@ ConfigureMenuButton(interp, mbPtr, objc, objv)
* current value.
*/
- char *value;
+ CONST char *value;
value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY);
if (value == NULL) {
@@ -684,7 +681,6 @@ TkMenuButtonWorldChanged(instanceData)
GC gc;
unsigned long mask;
TkMenuButton *mbPtr;
- XColor *foreground, *background;
mbPtr = (TkMenuButton *) instanceData;
@@ -717,15 +713,11 @@ TkMenuButtonWorldChanged(instanceData)
mbPtr->activeTextGC = gc;
gcValues.font = Tk_FontId(mbPtr->tkfont);
- background = Tk_3DBorderColor(mbPtr->normalBorder);
- gcValues.background = background->pixel;
+ gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel;
if ((mbPtr->disabledFg != NULL) && (mbPtr->imageString == NULL)) {
- foreground = mbPtr->disabledFg;
- gcValues.foreground = foreground->pixel;
+ gcValues.foreground = mbPtr->disabledFg->pixel;
mask = GCForeground | GCBackground | GCFont;
} else {
- foreground = background;
- background = NULL;
gcValues.foreground = gcValues.background;
mask = GCForeground;
if (mbPtr->gray == None) {
@@ -875,12 +867,12 @@ static char *
MenuButtonTextVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about button. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Name of variable. */
- char *name2; /* Second part of variable name. */
+ CONST char *name1; /* Name of variable. */
+ CONST char *name2; /* Second part of variable name. */
int flags; /* Information about what happened. */
{
register TkMenuButton *mbPtr = (TkMenuButton *) clientData;
- char *value;
+ CONST char *value;
/*
* If the variable is unset, then immediately recreate it unless
@@ -954,4 +946,3 @@ MenuButtonImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
}
}
}
-
diff --git a/tk/generic/tkMenubutton.h b/tk/generic/tkMenubutton.h
index 2bca6431e73..b3e4b2c34f0 100644
--- a/tk/generic/tkMenubutton.h
+++ b/tk/generic/tkMenubutton.h
@@ -19,6 +19,10 @@
#include "tkInt.h"
#endif
+#ifndef _TKMENU
+#include "tkMenu.h"
+#endif
+
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
@@ -162,6 +166,10 @@ typedef struct {
* Miscellaneous information:
*/
+ int compound; /* Value of -compound option; specifies whether
+ * the menubutton should show both an image and
+ * text, and, if so, how. */
+
enum direction direction; /* Direction for where to pop the menu.
* Valid directions are "above", "below",
* "left", "right", and "flush". "flush"
@@ -211,7 +219,7 @@ typedef struct {
* Declaration of variables shared between the files in the button module.
*/
-extern TkClassProcs tkpMenubuttonClass;
+extern Tk_ClassProcs tkpMenubuttonClass;
/*
* Declaration of procedures used in the implementation of the button
@@ -232,4 +240,3 @@ EXTERN void TkMenuButtonWorldChanged _ANSI_ARGS_((
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKMENUBUTTON */
-
diff --git a/tk/generic/tkMessage.c b/tk/generic/tkMessage.c
index eabffe0197c..1bcb4a87af9 100644
--- a/tk/generic/tkMessage.c
+++ b/tk/generic/tkMessage.c
@@ -7,6 +7,7 @@
*
* Copyright (c) 1990-1994 The Regents of the University of California.
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright (c) 1998-2000 by Ajuba Solutions.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -28,6 +29,8 @@ typedef struct {
* means that the window has been destroyed
* but the data structures haven't yet been
* cleaned up.*/
+ Tk_OptionTable optionTable; /* Table that defines options available for
+ * this widget. */
Display *display; /* Display containing widget. Used, among
* other things, so that resources can be
* freed even after tkwin has gone away. */
@@ -58,6 +61,7 @@ typedef struct {
XColor *highlightColorPtr; /* Color for drawing traversal highlight. */
Tk_Font tkfont; /* Information about text font, or NULL. */
XColor *fgColorPtr; /* Foreground color in normal mode. */
+ Tcl_Obj *padXPtr, *padYPtr; /* Tcl_Obj rep's of padX, padY values. */
int padX, padY; /* User-requested extra space around text. */
int width; /* User-requested width, in pixels. 0 means
* compute width using aspect ratio below. */
@@ -95,68 +99,72 @@ typedef struct {
* this window.
* GOT_FOCUS: Non-zero means this button currently
* has the input focus.
+ * MESSAGE_DELETED: The message has been effectively deleted.
*/
#define REDRAW_PENDING 1
#define GOT_FOCUS 4
+#define MESSAGE_DELETED 8
/*
* Information used for argv parsing.
*/
-static Tk_ConfigSpec configSpecs[] = {
- {TK_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor",
- DEF_MESSAGE_ANCHOR, Tk_Offset(Message, anchor), 0},
- {TK_CONFIG_INT, "-aspect", "aspect", "Aspect",
- DEF_MESSAGE_ASPECT, Tk_Offset(Message, aspect), 0},
- {TK_CONFIG_BORDER, "-background", "background", "Background",
- DEF_MESSAGE_BG_COLOR, Tk_Offset(Message, border),
- TK_CONFIG_COLOR_ONLY},
- {TK_CONFIG_BORDER, "-background", "background", "Background",
- DEF_MESSAGE_BG_MONO, Tk_Offset(Message, border),
- TK_CONFIG_MONO_ONLY},
- {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL,
- (char *) NULL, 0, 0},
- {TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL,
- (char *) NULL, 0, 0},
- {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
- DEF_MESSAGE_BORDER_WIDTH, Tk_Offset(Message, borderWidth), 0},
- {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
- DEF_MESSAGE_CURSOR, Tk_Offset(Message, cursor), TK_CONFIG_NULL_OK},
- {TK_CONFIG_SYNONYM, "-fg", "foreground", (char *) NULL,
- (char *) NULL, 0, 0},
- {TK_CONFIG_FONT, "-font", "font", "Font",
- DEF_MESSAGE_FONT, Tk_Offset(Message, tkfont), 0},
- {TK_CONFIG_COLOR, "-foreground", "foreground", "Foreground",
- DEF_MESSAGE_FG, Tk_Offset(Message, fgColorPtr), 0},
- {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG,
- Tk_Offset(Message, highlightBgColorPtr), 0},
- {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
- DEF_MESSAGE_HIGHLIGHT, Tk_Offset(Message, highlightColorPtr), 0},
- {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness",
- DEF_MESSAGE_HIGHLIGHT_WIDTH, Tk_Offset(Message, highlightWidth), 0},
- {TK_CONFIG_JUSTIFY, "-justify", "justify", "Justify",
- DEF_MESSAGE_JUSTIFY, Tk_Offset(Message, justify), 0},
- {TK_CONFIG_PIXELS, "-padx", "padX", "Pad",
- DEF_MESSAGE_PADX, Tk_Offset(Message, padX), 0},
- {TK_CONFIG_PIXELS, "-pady", "padY", "Pad",
- DEF_MESSAGE_PADY, Tk_Offset(Message, padY), 0},
- {TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
- DEF_MESSAGE_RELIEF, Tk_Offset(Message, relief), 0},
- {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
- DEF_MESSAGE_TAKE_FOCUS, Tk_Offset(Message, takeFocus),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-text", "text", "Text",
- DEF_MESSAGE_TEXT, Tk_Offset(Message, string), 0},
- {TK_CONFIG_STRING, "-textvariable", "textVariable", "Variable",
- DEF_MESSAGE_TEXT_VARIABLE, Tk_Offset(Message, textVarName),
- TK_CONFIG_NULL_OK},
- {TK_CONFIG_PIXELS, "-width", "width", "Width",
- DEF_MESSAGE_WIDTH, Tk_Offset(Message, width), 0},
- {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
- (char *) NULL, 0, 0}
+static Tk_OptionSpec optionSpecs[] = {
+ {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MESSAGE_ANCHOR,
+ -1, Tk_Offset(Message, anchor), 0, 0, 0},
+ {TK_OPTION_INT, "-aspect", "aspect", "Aspect", DEF_MESSAGE_ASPECT,
+ -1, Tk_Offset(Message, aspect), 0, 0, 0},
+ {TK_OPTION_BORDER, "-background", "background", "Background",
+ DEF_MESSAGE_BG_COLOR, -1, Tk_Offset(Message, border), 0,
+ (ClientData) DEF_MESSAGE_BG_MONO, 0},
+ {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL, (char *) NULL,
+ 0, -1, 0, (ClientData) "-borderwidth", 0},
+ {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL, (char *) NULL,
+ 0, -1, 0, (ClientData) "-background", 0},
+ {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
+ DEF_MESSAGE_BORDER_WIDTH, -1,
+ Tk_Offset(Message, borderWidth), 0, 0, 0},
+ {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
+ DEF_MESSAGE_CURSOR, -1, Tk_Offset(Message, cursor),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_SYNONYM, "-fg", (char *) NULL, (char *) NULL, (char *) NULL,
+ 0, -1, 0, (ClientData) "-foreground", 0},
+ {TK_OPTION_FONT, "-font", "font", "Font",
+ DEF_MESSAGE_FONT, -1, Tk_Offset(Message, tkfont), 0, 0, 0},
+ {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground",
+ DEF_MESSAGE_FG, -1, Tk_Offset(Message, fgColorPtr), 0, 0, 0},
+ {TK_OPTION_COLOR, "-highlightbackground", "highlightBackground",
+ "HighlightBackground", DEF_MESSAGE_HIGHLIGHT_BG, -1,
+ Tk_Offset(Message, highlightBgColorPtr), 0, 0},
+ {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
+ DEF_MESSAGE_HIGHLIGHT, -1, Tk_Offset(Message, highlightColorPtr),
+ 0, 0, 0},
+ {TK_OPTION_PIXELS, "-highlightthickness", "highlightThickness",
+ "HighlightThickness", DEF_MESSAGE_HIGHLIGHT_WIDTH, -1,
+ Tk_Offset(Message, highlightWidth), 0, 0, 0},
+ {TK_OPTION_JUSTIFY, "-justify", "justify", "Justify",
+ DEF_MESSAGE_JUSTIFY, -1, Tk_Offset(Message, justify), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-padx", "padX", "Pad",
+ DEF_MESSAGE_PADX, Tk_Offset(Message, padXPtr),
+ Tk_Offset(Message, padX), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-pady", "padY", "Pad",
+ DEF_MESSAGE_PADY, Tk_Offset(Message, padYPtr),
+ Tk_Offset(Message, padY), 0, 0, 0},
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
+ DEF_MESSAGE_RELIEF, -1, Tk_Offset(Message, relief), 0, 0, 0},
+ {TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
+ DEF_MESSAGE_TAKE_FOCUS, -1, Tk_Offset(Message, takeFocus),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_STRING, "-text", "text", "Text",
+ DEF_MESSAGE_TEXT, -1, Tk_Offset(Message, string), 0, 0, 0},
+ {TK_OPTION_STRING, "-textvariable", "textVariable", "Variable",
+ DEF_MESSAGE_TEXT_VARIABLE, -1, Tk_Offset(Message, textVarName),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-width", "width", "Width",
+ DEF_MESSAGE_WIDTH, -1, Tk_Offset(Message, width), 0, 0 ,0},
+ {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, 0, 0, 0}
};
/*
@@ -168,15 +176,16 @@ static void MessageCmdDeletedProc _ANSI_ARGS_((
static void MessageEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
static char * MessageTextVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
-static int MessageWidgetCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
+static int MessageWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
static void MessageWorldChanged _ANSI_ARGS_((
ClientData instanceData));
static void ComputeMessageGeometry _ANSI_ARGS_((Message *msgPtr));
static int ConfigureMessage _ANSI_ARGS_((Tcl_Interp *interp,
- Message *msgPtr, int argc, char **argv,
+ Message *msgPtr, int objc, Tcl_Obj *CONST objv[],
int flags));
static void DestroyMessage _ANSI_ARGS_((char *memPtr));
static void DisplayMessage _ANSI_ARGS_((ClientData clientData));
@@ -186,17 +195,16 @@ static void DisplayMessage _ANSI_ARGS_((ClientData clientData));
* that can be invoked from generic window code.
*/
-static TkClassProcs messageClass = {
- NULL, /* createProc. */
- MessageWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+static Tk_ClassProcs messageClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ MessageWorldChanged, /* worldChangedProc */
};
/*
*--------------------------------------------------------------
*
- * Tk_MessageCmd --
+ * Tk_MessageObjCmd --
*
* This procedure is invoked to process the "message" Tcl
* command. See the user documentation for details on what
@@ -212,80 +220,77 @@ static TkClassProcs messageClass = {
*/
int
-Tk_MessageCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
+Tk_MessageObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument strings. */
{
register Message *msgPtr;
- Tk_Window new;
- Tk_Window tkwin = (Tk_Window) clientData;
+ Tk_OptionTable optionTable;
+ Tk_Window tkwin;
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " pathName ?options?\"", (char *) NULL);
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
return TCL_ERROR;
}
- new = Tk_CreateWindowFromPath(interp, tkwin, argv[1], (char *) NULL);
- if (new == NULL) {
+ tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
+ Tcl_GetString(objv[1]), (char *) NULL);
+ if (tkwin == NULL) {
return TCL_ERROR;
}
+ /*
+ * Create the option table for this widget class. If it has already
+ * been created, the cached pointer will be returned.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, optionSpecs);
+
msgPtr = (Message *) ckalloc(sizeof(Message));
- msgPtr->tkwin = new;
- msgPtr->display = Tk_Display(new);
- msgPtr->interp = interp;
- msgPtr->widgetCmd = Tcl_CreateCommand(interp, Tk_PathName(msgPtr->tkwin),
- MessageWidgetCmd, (ClientData) msgPtr, MessageCmdDeletedProc);
- msgPtr->textLayout = NULL;
- msgPtr->string = NULL;
- msgPtr->numChars = 0;
- msgPtr->textVarName = NULL;
- msgPtr->border = NULL;
- msgPtr->borderWidth = 0;
- msgPtr->relief = TK_RELIEF_FLAT;
- msgPtr->highlightWidth = 0;
- msgPtr->highlightBgColorPtr = NULL;
- msgPtr->highlightColorPtr = NULL;
- msgPtr->tkfont = NULL;
- msgPtr->fgColorPtr = NULL;
- msgPtr->textGC = None;
- msgPtr->padX = 0;
- msgPtr->padY = 0;
- msgPtr->anchor = TK_ANCHOR_CENTER;
- msgPtr->width = 0;
- msgPtr->aspect = 150;
- msgPtr->msgWidth = 0;
- msgPtr->msgHeight = 0;
- msgPtr->justify = TK_JUSTIFY_LEFT;
- msgPtr->cursor = None;
- msgPtr->takeFocus = NULL;
- msgPtr->flags = 0;
+ memset(msgPtr, 0, (size_t) sizeof(Message));
+
+ /*
+ * Set values for those fields that don't take a 0 or NULL value.
+ */
+ msgPtr->tkwin = tkwin;
+ msgPtr->display = Tk_Display(tkwin);
+ msgPtr->interp = interp;
+ msgPtr->widgetCmd = Tcl_CreateObjCommand(interp,
+ Tk_PathName(msgPtr->tkwin), MessageWidgetObjCmd,
+ (ClientData) msgPtr, MessageCmdDeletedProc);
+ msgPtr->optionTable = optionTable;
+ msgPtr->relief = TK_RELIEF_FLAT;
+ msgPtr->textGC = None;
+ msgPtr->anchor = TK_ANCHOR_CENTER;
+ msgPtr->aspect = 150;
+ msgPtr->justify = TK_JUSTIFY_LEFT;
+ msgPtr->cursor = None;
Tk_SetClass(msgPtr->tkwin, "Message");
- TkSetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr);
+ Tk_SetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr);
Tk_CreateEventHandler(msgPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
MessageEventProc, (ClientData) msgPtr);
- if (ConfigureMessage(interp, msgPtr, argc-2, argv+2, 0) != TCL_OK) {
- goto error;
+ if (Tk_InitOptions(interp, (char *)msgPtr, optionTable, tkwin) != TCL_OK) {
+ Tk_DestroyWindow(msgPtr->tkwin);
+ return TCL_ERROR;
+ }
+
+ if (ConfigureMessage(interp, msgPtr, objc-2, objv+2, 0) != TCL_OK) {
+ Tk_DestroyWindow(msgPtr->tkwin);
+ return TCL_ERROR;
}
Tcl_SetResult(interp, Tk_PathName(msgPtr->tkwin), TCL_STATIC);
return TCL_OK;
-
- error:
- Tk_DestroyWindow(msgPtr->tkwin);
- return TCL_ERROR;
}
/*
*--------------------------------------------------------------
*
- * MessageWidgetCmd --
+ * MessageWidgetObjCmd --
*
* This procedure is invoked to process the Tcl command
* that corresponds to a widget managed by this module.
@@ -301,50 +306,68 @@ Tk_MessageCmd(clientData, interp, argc, argv)
*/
static int
-MessageWidgetCmd(clientData, interp, argc, argv)
+MessageWidgetObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Information about message widget. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument strings. */
{
register Message *msgPtr = (Message *) clientData;
- size_t length;
- int c;
+ static CONST char *optionStrings[] = { "cget", "configure", (char *) NULL };
+ enum options { MESSAGE_CGET, MESSAGE_CONFIGURE };
+ int index;
+ int result = TCL_OK;
+ Tcl_Obj *objPtr;
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
+ return TCL_ERROR;
+ }
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " option ?arg arg ...?\"", (char *) NULL);
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 'c') && (strncmp(argv[1], "cget", length) == 0)
- && (length >= 2)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " cget option\"",
- (char *) NULL);
- return TCL_ERROR;
+
+ Tcl_Preserve((ClientData) msgPtr);
+
+ switch ((enum options) index) {
+ case MESSAGE_CGET: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ return TCL_ERROR;
+ }
+ objPtr = Tk_GetOptionValue(interp, (char *) msgPtr,
+ msgPtr->optionTable, objv[2], msgPtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
+ }
+ break;
}
- return Tk_ConfigureValue(interp, msgPtr->tkwin, configSpecs,
- (char *) msgPtr, argv[2], 0);
- } else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)
- && (length >= 2)) {
- if (argc == 2) {
- return Tk_ConfigureInfo(interp, msgPtr->tkwin, configSpecs,
- (char *) msgPtr, (char *) NULL, 0);
- } else if (argc == 3) {
- return Tk_ConfigureInfo(interp, msgPtr->tkwin, configSpecs,
- (char *) msgPtr, argv[2], 0);
- } else {
- return ConfigureMessage(interp, msgPtr, argc-2, argv+2,
- TK_CONFIG_ARGV_ONLY);
+ case MESSAGE_CONFIGURE: {
+ if (objc <= 3) {
+ objPtr = Tk_GetOptionInfo(interp, (char *) msgPtr,
+ msgPtr->optionTable,
+ (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
+ msgPtr->tkwin);
+ if (objPtr == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ result = TCL_OK;
+ }
+ } else {
+ result = ConfigureMessage(interp, msgPtr, objc-2, objv+2, 0);
+ }
+ break;
}
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be cget or configure", (char *) NULL);
- return TCL_ERROR;
}
+
+ Tcl_Release((ClientData) msgPtr);
+ return result;
}
/*
@@ -371,22 +394,32 @@ DestroyMessage(memPtr)
{
register Message *msgPtr = (Message *) memPtr;
+ msgPtr->flags |= MESSAGE_DELETED;
+
+ Tcl_DeleteCommandFromToken(msgPtr->interp, msgPtr->widgetCmd);
+ if (msgPtr->flags & REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DisplayMessage, (ClientData) msgPtr);
+ }
+
/*
* Free up all the stuff that requires special handling, then
- * let Tk_FreeOptions handle all the standard option-related
+ * let Tk_FreeConfigOptions handle all the standard option-related
* stuff.
*/
- Tk_FreeTextLayout(msgPtr->textLayout);
+ if (msgPtr->textGC != None) {
+ Tk_FreeGC(msgPtr->display, msgPtr->textGC);
+ }
+ if (msgPtr->textLayout != NULL) {
+ Tk_FreeTextLayout(msgPtr->textLayout);
+ }
if (msgPtr->textVarName != NULL) {
Tcl_UntraceVar(msgPtr->interp, msgPtr->textVarName,
TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS,
MessageTextVarProc, (ClientData) msgPtr);
}
- if (msgPtr->textGC != None) {
- Tk_FreeGC(msgPtr->display, msgPtr->textGC);
- }
- Tk_FreeOptions(configSpecs, (char *) msgPtr, msgPtr->display, 0);
+ Tk_FreeConfigOptions((char *) msgPtr, msgPtr->optionTable, msgPtr->tkwin);
+ msgPtr->tkwin = NULL;
ckfree((char *) msgPtr);
}
@@ -412,14 +445,16 @@ DestroyMessage(memPtr)
*/
static int
-ConfigureMessage(interp, msgPtr, argc, argv, flags)
+ConfigureMessage(interp, msgPtr, objc, objv, flags)
Tcl_Interp *interp; /* Used for error reporting. */
register Message *msgPtr; /* Information about widget; may or may
* not already have values for some fields. */
- int argc; /* Number of valid entries in argv. */
- char **argv; /* Arguments. */
+ int objc; /* Number of valid entries in argv. */
+ Tcl_Obj *CONST objv[]; /* Arguments. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
+ Tk_SavedOptions savedOptions;
+
/*
* Eliminate any existing trace on a variable monitored by the message.
*/
@@ -430,10 +465,12 @@ ConfigureMessage(interp, msgPtr, argc, argv, flags)
MessageTextVarProc, (ClientData) msgPtr);
}
- if (Tk_ConfigureWidget(interp, msgPtr->tkwin, configSpecs,
- argc, argv, (char *) msgPtr, flags) != TCL_OK) {
+ if (Tk_SetOptions(interp, (char *) msgPtr, msgPtr->optionTable, objc, objv,
+ msgPtr->tkwin, &savedOptions, (int *)NULL) != TCL_OK) {
+ Tk_RestoreSavedOptions(&savedOptions);
return TCL_ERROR;
}
+
/*
* If the message is to display the value of a variable, then set up
@@ -442,7 +479,7 @@ ConfigureMessage(interp, msgPtr, argc, argv, flags)
*/
if (msgPtr->textVarName != NULL) {
- char *value;
+ CONST char *value;
value = Tcl_GetVar(interp, msgPtr->textVarName, TCL_GLOBAL_ONLY);
if (value == NULL) {
@@ -471,6 +508,7 @@ ConfigureMessage(interp, msgPtr, argc, argv, flags)
msgPtr->highlightWidth = 0;
}
+ Tk_FreeSavedOptions(&savedOptions);
MessageWorldChanged((ClientData) msgPtr);
return TCL_OK;
}
@@ -725,14 +763,7 @@ MessageEventProc(clientData, eventPtr)
|| (eventPtr->type == ConfigureNotify)) {
goto redraw;
} else if (eventPtr->type == DestroyNotify) {
- if (msgPtr->tkwin != NULL) {
- msgPtr->tkwin = NULL;
- Tcl_DeleteCommandFromToken(msgPtr->interp, msgPtr->widgetCmd);
- }
- if (msgPtr->flags & REDRAW_PENDING) {
- Tcl_CancelIdleCall(DisplayMessage, (ClientData) msgPtr);
- }
- Tcl_EventuallyFree((ClientData) msgPtr, DestroyMessage);
+ DestroyMessage((char *) clientData);
} else if (eventPtr->type == FocusIn) {
if (eventPtr->xfocus.detail != NotifyInferior) {
msgPtr->flags |= GOT_FOCUS;
@@ -780,7 +811,6 @@ MessageCmdDeletedProc(clientData)
ClientData clientData; /* Pointer to widget record for widget. */
{
Message *msgPtr = (Message *) clientData;
- Tk_Window tkwin = msgPtr->tkwin;
/*
* This procedure could be invoked either because the window was
@@ -789,9 +819,8 @@ MessageCmdDeletedProc(clientData)
* destroys the widget.
*/
- if (tkwin != NULL) {
- msgPtr->tkwin = NULL;
- Tk_DestroyWindow(tkwin);
+ if (!(msgPtr->flags & MESSAGE_DELETED)) {
+ Tk_DestroyWindow(msgPtr->tkwin);
}
}
@@ -818,12 +847,12 @@ static char *
MessageTextVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about message. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Name of variable. */
- char *name2; /* Second part of variable name. */
+ CONST char *name1; /* Name of variable. */
+ CONST char *name2; /* Second part of variable name. */
int flags; /* Information about what happened. */
{
register Message *msgPtr = (Message *) clientData;
- char *value;
+ CONST char *value;
/*
* If the variable is unset, then immediately recreate it unless
@@ -860,4 +889,3 @@ MessageTextVarProc(clientData, interp, name1, name2, flags)
}
return (char *) NULL;
}
-
diff --git a/tk/generic/tkObj.c b/tk/generic/tkObj.c
index 071cb383f43..2b44ba731f6 100644
--- a/tk/generic/tkObj.c
+++ b/tk/generic/tkObj.c
@@ -55,6 +55,16 @@ typedef struct MMRep {
} MMRep;
/*
+ * The following structure is the internal representation for window objects.
+ */
+
+typedef struct WindowRep {
+ Tk_Window tkwin;
+ Tk_Window mainwin;
+ long epoch;
+} WindowRep;
+
+/*
* Prototypes for procedures defined later in this file:
*/
@@ -62,15 +72,19 @@ static void DupMMInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr));
static void DupPixelInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
Tcl_Obj *copyPtr));
+static void DupWindowInternalRep _ANSI_ARGS_((Tcl_Obj *srcPtr,
+ Tcl_Obj *copyPtr));
static void FreeMMInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr));
static void FreePixelInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr));
+static void FreeWindowInternalRep _ANSI_ARGS_((Tcl_Obj *objPtr));
+static void UpdateStringOfMM _ANSI_ARGS_((Tcl_Obj *objPtr));
static int SetMMFromAny _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
static int SetPixelFromAny _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
static int SetWindowFromAny _ANSI_ARGS_((Tcl_Interp *interp,
Tcl_Obj *objPtr));
-
+
/*
* The following structure defines the implementation of the "pixel"
* Tcl object, used for measuring distances. The pixel object remembers
@@ -95,7 +109,7 @@ static Tcl_ObjType mmObjType = {
"mm", /* name */
FreeMMInternalRep, /* freeIntRepProc */
DupMMInternalRep, /* dupIntRepProc */
- NULL, /* updateStringProc */
+ UpdateStringOfMM, /* updateStringProc */
SetMMFromAny /* setFromAnyProc */
};
@@ -106,8 +120,8 @@ static Tcl_ObjType mmObjType = {
static Tcl_ObjType windowObjType = {
"window", /* name */
- (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */
- (Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */
+ FreeWindowInternalRep, /* freeIntRepProc */
+ DupWindowInternalRep, /* dupIntRepProc */
NULL, /* updateStringProc */
SetWindowFromAny /* setFromAnyProc */
};
@@ -473,6 +487,48 @@ DupMMInternalRep(srcPtr, copyPtr)
/*
*----------------------------------------------------------------------
*
+ * UpdateStringOfMM --
+ *
+ * Update the string representation for a pixel Tcl_Obj
+ * this function is only called, if the pixel Tcl_Obj has no unit,
+ * because with units the string representation is created by
+ * SetMMFromAny
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The object's string is set to a valid string that results from
+ * the double-to-string conversion.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+UpdateStringOfMM(objPtr)
+ register Tcl_Obj *objPtr; /* pixel obj with string rep to update. */
+{
+ MMRep *mmPtr;
+ char buffer[TCL_DOUBLE_SPACE];
+ register int len;
+
+ mmPtr = (MMRep *) objPtr->internalRep.otherValuePtr;
+ /* assert( mmPtr->units == -1 && objPtr->bytes == NULL ); */
+ if ((mmPtr->units != -1) || (objPtr->bytes != NULL)) {
+ panic("UpdateStringOfMM: false precondition");
+ }
+
+ Tcl_PrintDouble((Tcl_Interp *) NULL, mmPtr->value, buffer);
+ len = strlen(buffer);
+
+ objPtr->bytes = (char *) ckalloc((unsigned) len + 1);
+ strcpy(objPtr->bytes, buffer);
+ objPtr->length = len;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* SetMMFromAny --
*
* Attempt to generate a mm internal form for the Tcl object
@@ -501,46 +557,79 @@ SetMMFromAny(interp, objPtr)
int units;
MMRep *mmPtr;
- string = Tcl_GetStringFromObj(objPtr, NULL);
+ static Tcl_ObjType *tclDoubleObjType = NULL;
+ static Tcl_ObjType *tclIntObjType = NULL;
- d = strtod(string, &rest);
- if (rest == string) {
+ if (tclDoubleObjType == NULL) {
/*
- * Must copy string before resetting the result in case a caller
- * is trying to convert the interpreter's result to mms.
+ * Cache the object types for comaprison below.
+ * This allows optimized checks for standard cases.
*/
- error:
- Tcl_AppendResult(interp, "bad screen distance \"", string,
- "\"", (char *) NULL);
- return TCL_ERROR;
- }
- while ((*rest != '\0') && isspace(UCHAR(*rest))) {
- rest++;
+ tclDoubleObjType = Tcl_GetObjType("double");
+ tclIntObjType = Tcl_GetObjType("int");
}
- switch (*rest) {
- case '\0':
- units = -1;
- break;
- case 'c':
- units = 0;
- break;
-
- case 'i':
- units = 1;
- break;
+ if (objPtr->typePtr == tclDoubleObjType) {
+ Tcl_GetDoubleFromObj(interp, objPtr, &d);
+ units = -1;
+ } else if (objPtr->typePtr == tclIntObjType) {
+ Tcl_GetIntFromObj(interp, objPtr, &units);
+ d = (double) units;
+ units = -1;
- case 'm':
- units = 2;
- break;
-
- case 'p':
- units = 3;
- break;
+ /*
+ * In the case of ints, we need to ensure that a valid
+ * string exists in order for int-but-not-string objects
+ * to be converted back to ints again from mm obj types.
+ */
+ (void) Tcl_GetStringFromObj(objPtr, NULL);
+ } else {
+ /*
+ * It wasn't a known int or double, so parse it.
+ */
- default:
- goto error;
+ string = Tcl_GetStringFromObj(objPtr, NULL);
+
+ d = strtod(string, &rest);
+ if (rest == string) {
+ /*
+ * Must copy string before resetting the result in case a caller
+ * is trying to convert the interpreter's result to mms.
+ */
+
+ error:
+ Tcl_AppendResult(interp, "bad screen distance \"", string,
+ "\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ while ((*rest != '\0') && isspace(UCHAR(*rest))) {
+ rest++;
+ }
+ switch (*rest) {
+ case '\0':
+ units = -1;
+ break;
+
+ case 'c':
+ units = 0;
+ break;
+
+ case 'i':
+ units = 1;
+ break;
+
+ case 'm':
+ units = 2;
+ break;
+
+ case 'p':
+ units = 3;
+ break;
+
+ default:
+ goto error;
+ }
}
/*
@@ -552,14 +641,16 @@ SetMMFromAny(interp, objPtr)
(*typePtr->freeIntRepProc)(objPtr);
}
- objPtr->typePtr = &mmObjType;
+ objPtr->typePtr = &mmObjType;
+
+ mmPtr = (MMRep *) ckalloc(sizeof(MMRep));
+ mmPtr->value = d;
+ mmPtr->units = units;
+ mmPtr->tkwin = NULL;
+ mmPtr->returnValue = d;
- mmPtr = (MMRep *) ckalloc(sizeof(MMRep));
- mmPtr->value = d;
- mmPtr->units = units;
- mmPtr->tkwin = NULL;
- mmPtr->returnValue = d;
objPtr->internalRep.otherValuePtr = (VOID *) mmPtr;
+
return TCL_OK;
}
@@ -588,31 +679,42 @@ int
TkGetWindowFromObj(interp, tkwin, objPtr, windowPtr)
Tcl_Interp *interp; /* Used for error reporting if not NULL. */
Tk_Window tkwin; /* A token to get the main window from. */
- register Tcl_Obj *objPtr; /* The object from which to get boolean. */
+ Tcl_Obj *objPtr; /* The object from which to get boolean. */
Tk_Window *windowPtr; /* Place to store resulting window. */
{
- register int result;
- Tk_Window lastWindow;
+ register WindowRep *winPtr;
+ TkDisplay *dispPtr = ((TkWindow *)tkwin)->dispPtr;
+ Tk_Window foundWindow;
- result = SetWindowFromAny(interp, objPtr);
- if (result != TCL_OK) {
- return result;
+ if (objPtr->typePtr != &windowObjType) {
+ register int result = SetWindowFromAny(interp, objPtr);
+ if (result != TCL_OK) {
+ return result;
+ }
}
- lastWindow = (Tk_Window) objPtr->internalRep.twoPtrValue.ptr1;
- if (tkwin != lastWindow) {
- Tk_Window foundWindow = Tk_NameToWindow(interp,
- Tcl_GetStringFromObj(objPtr, NULL), tkwin);
+ winPtr = (WindowRep *) objPtr->internalRep.otherValuePtr;
+ if (winPtr == NULL) {
+ winPtr = (WindowRep *) ckalloc(sizeof(WindowRep));
+ objPtr->internalRep.otherValuePtr = (VOID *) winPtr;
+ goto parseWindowString;
+ } else if (tkwin != winPtr->mainwin ||
+ dispPtr->deletionEpoch != winPtr->epoch) {
+ parseWindowString:
+ foundWindow = Tk_NameToWindow(interp,
+ Tcl_GetStringFromObj(objPtr, NULL), tkwin);
if (foundWindow == NULL) {
return TCL_ERROR;
}
- objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) tkwin;
- objPtr->internalRep.twoPtrValue.ptr2 = (VOID *) foundWindow;
+
+ winPtr->tkwin = foundWindow;
+ winPtr->mainwin = tkwin;
+ winPtr->epoch = dispPtr->deletionEpoch;
}
- *windowPtr = (Tk_Window) objPtr->internalRep.twoPtrValue.ptr2;
- return result;
+ *windowPtr = winPtr->tkwin;
+ return TCL_OK;
}
/*
@@ -652,9 +754,105 @@ SetWindowFromAny(interp, objPtr)
(*typePtr->freeIntRepProc)(objPtr);
}
objPtr->typePtr = &windowObjType;
- objPtr->internalRep.twoPtrValue.ptr1 = NULL;
- objPtr->internalRep.twoPtrValue.ptr2 = NULL;
+ objPtr->internalRep.otherValuePtr = NULL;
return TCL_OK;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DupWindowInternalRep --
+ *
+ * Initialize the internal representation of a window Tcl_Obj to a
+ * copy of the internal representation of an existing window object.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * copyPtr's internal rep is set to refer to the same window as
+ * srcPtr's internal rep.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DupWindowInternalRep(srcPtr, copyPtr)
+ register Tcl_Obj *srcPtr;
+ register Tcl_Obj *copyPtr;
+{
+ register WindowRep *oldPtr, *newPtr;
+
+ copyPtr->typePtr = srcPtr->typePtr;
+ oldPtr = srcPtr->internalRep.otherValuePtr;
+ if (oldPtr == NULL) {
+ copyPtr->internalRep.otherValuePtr = NULL;
+ } else {
+ newPtr = (WindowRep *) ckalloc(sizeof(WindowRep));
+ newPtr->tkwin = oldPtr->tkwin;
+ newPtr->mainwin = oldPtr->mainwin;
+ newPtr->epoch = oldPtr->epoch;
+ copyPtr->internalRep.otherValuePtr = (VOID *)newPtr;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FreeWindowInternalRep --
+ *
+ * Deallocate the storage associated with a window object's internal
+ * representation.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Frees objPtr's internal representation and sets objPtr's
+ * internalRep to NULL.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+FreeWindowInternalRep(objPtr)
+ Tcl_Obj *objPtr; /* Window object with internal rep to free. */
+{
+ if (objPtr->internalRep.otherValuePtr != NULL) {
+ ckfree((char *) objPtr->internalRep.otherValuePtr);
+ objPtr->internalRep.otherValuePtr = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkRegisterObjTypes --
+ *
+ * Registers Tk's Tcl_ObjType structures with the Tcl run-time.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * All instances of Tcl_ObjType structues used in Tk are registered
+ * with Tcl.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+TkRegisterObjTypes()
+{
+ Tcl_RegisterObjType(&tkBorderObjType);
+ Tcl_RegisterObjType(&tkBitmapObjType);
+ Tcl_RegisterObjType(&tkColorObjType);
+ Tcl_RegisterObjType(&tkCursorObjType);
+ Tcl_RegisterObjType(&tkFontObjType);
+ Tcl_RegisterObjType(&mmObjType);
+ Tcl_RegisterObjType(&tkOptionObjType);
+ Tcl_RegisterObjType(&pixelObjType);
+ Tcl_RegisterObjType(&tkStateKeyObjType);
+ Tcl_RegisterObjType(&windowObjType);
+}
diff --git a/tk/generic/tkOldConfig.c b/tk/generic/tkOldConfig.c
index 18b22e451ee..e555013000a 100644
--- a/tk/generic/tkOldConfig.c
+++ b/tk/generic/tkOldConfig.c
@@ -36,12 +36,12 @@ static int DoConfig _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Window tkwin, Tk_ConfigSpec *specPtr,
Tk_Uid value, int valueIsUid, char *widgRec));
static Tk_ConfigSpec * FindConfigSpec _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_ConfigSpec *specs, char *argvName,
+ Tk_ConfigSpec *specs, CONST char *argvName,
int needFlags, int hateFlags));
static char * FormatConfigInfo _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Window tkwin, Tk_ConfigSpec *specPtr,
char *widgRec));
-static char * FormatConfigValue _ANSI_ARGS_((Tcl_Interp *interp,
+static CONST char * FormatConfigValue _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Window tkwin, Tk_ConfigSpec *specPtr,
char *widgRec, char *buffer,
Tcl_FreeProc **freeProcPtr));
@@ -74,7 +74,7 @@ Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags)
* set up X resources). */
Tk_ConfigSpec *specs; /* Describes legal options. */
int argc; /* Number of elements in argv. */
- char **argv; /* Command-line options. */
+ CONST char **argv; /* Command-line options. */
char *widgRec; /* Record whose fields are to be
* modified. Values must be properly
* initialized. */
@@ -134,7 +134,7 @@ Tk_ConfigureWidget(interp, tkwin, specs, argc, argv, widgRec, flags)
*/
for ( ; argc > 0; argc -= 2, argv += 2) {
- char *arg;
+ CONST char *arg;
if (flags & TK_CONFIG_OBJS) {
arg = Tcl_GetStringFromObj((Tcl_Obj *) *argv, NULL);
@@ -255,7 +255,7 @@ FindConfigSpec(interp, specs, argvName, needFlags, hateFlags)
Tcl_Interp *interp; /* Used for reporting errors. */
Tk_ConfigSpec *specs; /* Pointer to table of configuration
* specifications for a widget. */
- char *argvName; /* Name (suitable for use in a "config"
+ CONST char *argvName; /* Name (suitable for use in a "config"
* command) identifying particular option. */
int needFlags; /* Flags that must be present in matching
* entry. */
@@ -351,7 +351,7 @@ DoConfig(interp, tkwin, specPtr, value, valueIsUid, widgRec)
Tk_Window tkwin; /* Window containing widget (needed to
* set up X resources). */
Tk_ConfigSpec *specPtr; /* Specifier to apply. */
- char *value; /* Value to use to fill in widgRec. */
+ Tk_Uid value; /* Value to use to fill in widgRec. */
int valueIsUid; /* Non-zero means value is a Tk_Uid;
* zero means it's an ordinary string. */
char *widgRec; /* Record whose fields are to be
@@ -618,7 +618,7 @@ Tk_ConfigureInfo(interp, tkwin, specs, widgRec, argvName, flags)
Tk_ConfigSpec *specs; /* Describes legal options. */
char *widgRec; /* Record whose fields contain current
* values for options. */
- char *argvName; /* If non-NULL, indicates a single option
+ CONST char *argvName; /* 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
@@ -707,7 +707,8 @@ FormatConfigInfo(interp, tkwin, specPtr, widgRec)
char *widgRec; /* Pointer to record holding current
* values of info for widget. */
{
- char *argv[6], *result;
+ CONST char *argv[6];
+ char *result;
char buffer[200];
Tcl_FreeProc *freeProc = (Tcl_FreeProc *) NULL;
@@ -735,9 +736,9 @@ FormatConfigInfo(interp, tkwin, specPtr, widgRec)
result = Tcl_Merge(5, argv);
if (freeProc != NULL) {
if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
- ckfree(argv[4]);
+ ckfree((char *)argv[4]);
} else {
- (*freeProc)(argv[4]);
+ (*freeProc)((char *)argv[4]);
}
}
return result;
@@ -765,7 +766,7 @@ FormatConfigInfo(interp, tkwin, specPtr, widgRec)
*----------------------------------------------------------------------
*/
-static char *
+static CONST char *
FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, freeProcPtr)
Tcl_Interp *interp; /* Interpreter for use in real conversions. */
Tk_Window tkwin; /* Window corresponding to widget. */
@@ -779,7 +780,7 @@ FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, freeProcPtr)
* of procedure to free the result, or NULL
* if result is static. */
{
- char *ptr, *result;
+ CONST char *ptr, *result;
*freeProcPtr = NULL;
ptr = widgRec + specPtr->offset;
@@ -919,7 +920,7 @@ Tk_ConfigureValue(interp, tkwin, specs, widgRec, argvName, flags)
Tk_ConfigSpec *specs; /* Describes legal options. */
char *widgRec; /* Record whose fields contain current
* values for options. */
- char *argvName; /* Gives the command-line name for the
+ CONST char *argvName; /* 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
@@ -927,6 +928,9 @@ Tk_ConfigureValue(interp, tkwin, specs, widgRec, argvName, flags)
{
Tk_ConfigSpec *specPtr;
int needFlags, hateFlags;
+ Tcl_FreeProc *freeProc;
+ CONST char *result;
+ char buffer[200];
needFlags = flags & ~(TK_CONFIG_USER_BIT - 1);
if (Tk_Depth(tkwin) <= 1) {
@@ -938,8 +942,15 @@ Tk_ConfigureValue(interp, tkwin, specs, widgRec, argvName, flags)
if (specPtr == NULL) {
return TCL_ERROR;
}
- interp->result = FormatConfigValue(interp, tkwin, specPtr, widgRec,
- interp->result, &interp->freeProc);
+ result = FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, &freeProc);
+ Tcl_SetResult(interp, (char *) result, TCL_VOLATILE);
+ if (freeProc != NULL) {
+ if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) {
+ ckfree((char *)result);
+ } else {
+ (*freeProc)((char *)result);
+ }
+ }
return TCL_OK;
}
@@ -1019,5 +1030,3 @@ Tk_FreeOptions(specs, widgRec, display, needFlags)
}
}
}
-
-
diff --git a/tk/generic/tkOption.c b/tk/generic/tkOption.c
index 54e1f27d75e..2decd353971 100644
--- a/tk/generic/tkOption.c
+++ b/tk/generic/tkOption.c
@@ -26,6 +26,35 @@
* structures exists for each node or leaf in the option tree. It is
* actually stored as part of the parent node, and describes a particular
* child of the parent.
+ *
+ * The structure of the option db tree is a little confusing. There are
+ * four different kinds of nodes in the tree:
+ * interior class nodes
+ * interior name nodes
+ * leaf class nodes
+ * leaf name nodes
+ *
+ * All interior nodes refer to _window_ classes and names; all leaf nodes
+ * refer to _option_ classes and names. When looking for a particular option,
+ * therefore, you must compare interior node values to corresponding window
+ * values, and compare leaf node values to corresponding option values.
+ *
+ * The tree is actually stored in a collection of arrays; there is one each
+ * combination of WILDCARD/EXACT and CLASS/NAME and NODE/LEAF. The NODE arrays
+ * contain the interior nodes of the tree; each element has a pointer to an
+ * array of elements which are the leaves of the tree. The LEAF arrays, rather
+ * than holding the leaves of the tree, hold a cached subset of the option
+ * database, consisting of the values of all defined options for a single
+ * window, and some additional information about each ancestor of the window
+ * (since some options may be inherited from a parent), all the way back to the
+ * root window.
+ *
+ * Each time a call is made to Tk_GetOption, Tk will attempt to use the cached
+ * information to satisfy the lookup. If the call is for a window other than
+ * that for which options are currently cached, the portion of the cache that
+ * contains information for common ancestors of the two windows is retained and
+ * the remainder is discarded and rebuilt with new information for the new
+ * window.
*/
typedef struct Element {
@@ -206,6 +235,8 @@ static void ExtendStacks _ANSI_ARGS_((ElArray *arrayPtr,
static int GetDefaultOptions _ANSI_ARGS_((Tcl_Interp *interp,
TkWindow *winPtr));
static ElArray * NewArray _ANSI_ARGS_((int numEls));
+static void OptionThreadExitProc _ANSI_ARGS_((
+ ClientData clientData));
static void OptionInit _ANSI_ARGS_((TkMainInfo *mainPtr));
static int ParsePriority _ANSI_ARGS_((Tcl_Interp *interp,
char *string));
@@ -233,8 +264,8 @@ void
Tk_AddOption(tkwin, name, value, priority)
Tk_Window tkwin; /* Window token; option will be associated
* with main window for this window. */
- char *name; /* Multi-element name of option. */
- char *value; /* String value for option. */
+ CONST char *name; /* Multi-element name of option. */
+ CONST char *value; /* String value for option. */
int priority; /* Overall priority level to use for
* this option, such as TK_USER_DEFAULT_PRIO
* or TK_INTERACTIVE_PRIO. Must be between
@@ -244,8 +275,8 @@ Tk_AddOption(tkwin, name, value, priority)
register ElArray **arrayPtrPtr;
register Element *elPtr;
Element newEl;
- register char *p;
- char *field;
+ register CONST char *p;
+ CONST char *field;
int count, firstField, length;
#define TMP_SIZE 100
char tmp[TMP_SIZE+1];
@@ -391,14 +422,17 @@ Tk_Uid
Tk_GetOption(tkwin, name, className)
Tk_Window tkwin; /* Token for window that option is
* associated with. */
- char *name; /* Name of option. */
- char *className; /* Class of option. NULL means there
+ CONST char *name; /* Name of option. */
+ CONST char *className; /* Class of option. NULL means there
* is no class for this option: just
* check for name. */
{
- Tk_Uid nameId, classId;
+ Tk_Uid nameId, classId = NULL;
+ char *masqName;
register Element *elPtr, *bestPtr;
register int count;
+ StackLevel *levelPtr;
+ int stackDepth[NUM_STACKS];
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -411,43 +445,169 @@ Tk_GetOption(tkwin, name, className)
SetupStacks((TkWindow *) tkwin, 1);
}
- nameId = Tk_GetUid(name);
+ /*
+ * Get a default "best" match.
+ */
+
bestPtr = &tsdPtr->defaultMatch;
+
+ /*
+ * For megawidget support, we want to have some widget options masquerade
+ * as options for other widgets. For example, a combobox has a button in
+ * it; this button ought to pick up the *Button.background, etc., options.
+ * But because the class of the widget is Combobox, our normal search
+ * won't get that option.
+ *
+ * To work around this, the option name field syntax was extended to allow
+ * for a "." in the name; if this character occurs in the name, then it
+ * indicates that this name contains a new window class and an option name,
+ * ie, "Button.foreground". If we see this form in the name field, we
+ * query the option database directly (since the option stacks will not
+ * have the information we need).
+ */
+
+ masqName = strchr(name, (int)'.');
+ if (masqName != NULL) {
+ /*
+ * This option is masquerading with a different window class.
+ * Search the stack to the depth it was before the current window's
+ * information was pushed (the value for which is stored in the bases
+ * field).
+ */
+ levelPtr = &tsdPtr->levels[tsdPtr->curLevel];
+ nameId = Tk_GetUid(masqName+1);
+ for (count = 0; count < NUM_STACKS; count++) {
+ stackDepth[count] = levelPtr->bases[count];
+ }
+ } else {
+ /*
+ * No option masquerading here. Just use the current level to get the
+ * stack depths.
+ */
+ nameId = Tk_GetUid(name);
+ for (count = 0; count < NUM_STACKS; count++) {
+ stackDepth[count] = tsdPtr->stacks[count]->numUsed;
+ }
+ }
+
+ /*
+ * Probe the stacks for matches.
+ */
+
for (elPtr = tsdPtr->stacks[EXACT_LEAF_NAME]->els,
- count = tsdPtr->stacks[EXACT_LEAF_NAME]->numUsed; count > 0;
- elPtr++, count--) {
+ count = stackDepth[EXACT_LEAF_NAME]; count > 0;
+ elPtr++, count--) {
if ((elPtr->nameUid == nameId)
&& (elPtr->priority > bestPtr->priority)) {
bestPtr = elPtr;
}
}
for (elPtr = tsdPtr->stacks[WILDCARD_LEAF_NAME]->els,
- count = tsdPtr->stacks[WILDCARD_LEAF_NAME]->numUsed; count > 0;
- elPtr++, count--) {
+ count = stackDepth[WILDCARD_LEAF_NAME]; count > 0;
+ elPtr++, count--) {
if ((elPtr->nameUid == nameId)
&& (elPtr->priority > bestPtr->priority)) {
bestPtr = elPtr;
}
}
+
if (className != NULL) {
classId = Tk_GetUid(className);
for (elPtr = tsdPtr->stacks[EXACT_LEAF_CLASS]->els,
- count = tsdPtr->stacks[EXACT_LEAF_CLASS]->numUsed; count > 0;
- elPtr++, count--) {
+ count = stackDepth[EXACT_LEAF_CLASS]; count > 0;
+ elPtr++, count--) {
if ((elPtr->nameUid == classId)
&& (elPtr->priority > bestPtr->priority)) {
bestPtr = elPtr;
}
}
for (elPtr = tsdPtr->stacks[WILDCARD_LEAF_CLASS]->els,
- count = tsdPtr->stacks[WILDCARD_LEAF_CLASS]->numUsed;
- count > 0; elPtr++, count--) {
+ count = stackDepth[WILDCARD_LEAF_CLASS]; count > 0;
+ elPtr++, count--) {
if ((elPtr->nameUid == classId)
&& (elPtr->priority > bestPtr->priority)) {
bestPtr = elPtr;
}
}
}
+
+ /*
+ * If this option was masquerading with a different window class,
+ * probe the option database now. Note that this will be inefficient
+ * if the option database is densely populated, or if the widget has many
+ * masquerading options.
+ */
+
+ if (masqName != NULL) {
+ char *masqClass;
+ Tk_Uid nodeId, winClassId, winNameId;
+ unsigned int classNameLength;
+ register Element *nodePtr, *leafPtr;
+ static int searchOrder[] = { EXACT_NODE_NAME,
+ WILDCARD_NODE_NAME,
+ EXACT_NODE_CLASS,
+ WILDCARD_NODE_CLASS,
+ -1 };
+ int *currentPtr, currentStack, leafCount;
+
+ /*
+ * Extract the masquerade class name from the name field.
+ */
+
+ classNameLength = (unsigned int)(masqName - name);
+ masqClass = (char *)ckalloc(classNameLength + 1);
+ strncpy(masqClass, name, classNameLength);
+ masqClass[classNameLength] = '\0';
+
+ winClassId = Tk_GetUid(masqClass);
+ ckfree(masqClass);
+ winNameId = ((TkWindow *)tkwin)->nameUid;
+
+ levelPtr = &tsdPtr->levels[tsdPtr->curLevel];
+
+ for (currentPtr = searchOrder; *currentPtr != -1; currentPtr++) {
+ currentStack = *currentPtr;
+ nodePtr = tsdPtr->stacks[currentStack]->els;
+ count = levelPtr->bases[currentStack];
+
+ /*
+ * For wildcard stacks, check all entries; for non-wildcard
+ * stacks, only check things that matched in the parent.
+ */
+
+ if (!(currentStack & WILDCARD)) {
+ nodePtr += levelPtr[-1].bases[currentStack];
+ count -= levelPtr[-1].bases[currentStack];
+ }
+
+ if (currentStack && CLASS) {
+ nodeId = winClassId;
+ } else {
+ nodeId = winNameId;
+ }
+
+ for ( ; count > 0; nodePtr++, count--) {
+ if (nodePtr->nameUid == nodeId) {
+ leafPtr = nodePtr->child.arrayPtr->els;
+ leafCount = nodePtr->child.arrayPtr->numUsed;
+ for ( ; leafCount > 0; leafPtr++, leafCount--) {
+ if (leafPtr->flags & CLASS && className != NULL) {
+ if (leafPtr->nameUid == classId &&
+ leafPtr->priority > bestPtr->priority) {
+ bestPtr = leafPtr;
+ }
+ } else {
+ if (leafPtr->nameUid == nameId &&
+ leafPtr->priority > bestPtr->priority) {
+ bestPtr = leafPtr;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
return bestPtr->child.valueUid;
}
@@ -481,7 +641,7 @@ Tk_OptionObjCmd(clientData, interp, objc, objv)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static char *optionCmds[] = {
+ static CONST char *optionCmds[] = {
"add", "clear", "get", "readfile", NULL
};
@@ -553,7 +713,7 @@ Tk_OptionObjCmd(clientData, interp, objc, objv)
value = Tk_GetOption(window, Tcl_GetString(objv[3]),
Tcl_GetString(objv[4]));
if (value != NULL) {
- Tcl_SetResult(interp, value, TCL_STATIC);
+ Tcl_SetResult(interp, (char *)value, TCL_STATIC);
}
break;
}
@@ -627,7 +787,7 @@ TkOptionDeadWindow(winPtr)
* database.
*/
- if ((winPtr->mainPtr->winPtr == winPtr)
+ if ((winPtr->mainPtr != NULL) && (winPtr->mainPtr->winPtr == winPtr)
&& (winPtr->mainPtr->optionRootPtr != NULL)) {
ClearOptionTree(winPtr->mainPtr->optionRootPtr);
winPtr->mainPtr->optionRootPtr = NULL;
@@ -934,7 +1094,8 @@ ReadOptionFile(interp, tkwin, fileName, priority)
* or TK_INTERACTIVE_PRIO. Must be between
* 0 and TK_MAX_PRIO. */
{
- char *realName, *buffer;
+ CONST char *realName;
+ char *buffer;
int result, bufferSize;
Tcl_Channel chan;
Tcl_DString newName;
@@ -967,8 +1128,8 @@ ReadOptionFile(interp, tkwin, fileName, priority)
* overallocate if we are performing CRLF translation.
*/
- bufferSize = Tcl_Seek(chan, 0L, SEEK_END);
- (void) Tcl_Seek(chan, 0L, SEEK_SET);
+ bufferSize = (int) Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_END);
+ (void) Tcl_Seek(chan, (Tcl_WideInt) 0, SEEK_SET);
if (bufferSize < 0) {
Tcl_AppendResult(interp, "error seeking to end of file \"",
@@ -1195,24 +1356,9 @@ SetupStacks(winPtr, leaf)
arrayPtr = tsdPtr->stacks[EXACT_LEAF_CLASS];
arrayPtr->numUsed = 0;
arrayPtr->nextToUse = arrayPtr->els;
- levelPtr->bases[EXACT_LEAF_NAME] = tsdPtr->stacks[EXACT_LEAF_NAME]
- ->numUsed;
- levelPtr->bases[EXACT_LEAF_CLASS] = tsdPtr->stacks[EXACT_LEAF_CLASS]
- ->numUsed;
- levelPtr->bases[EXACT_NODE_NAME] = tsdPtr->stacks[EXACT_NODE_NAME]
- ->numUsed;
- levelPtr->bases[EXACT_NODE_CLASS] = tsdPtr->stacks[EXACT_NODE_CLASS]
- ->numUsed;
- levelPtr->bases[WILDCARD_LEAF_NAME] = tsdPtr->stacks[WILDCARD_LEAF_NAME]
- ->numUsed;
- levelPtr->bases[WILDCARD_LEAF_CLASS] = tsdPtr->stacks[WILDCARD_LEAF_CLASS]
- ->numUsed;
- levelPtr->bases[WILDCARD_NODE_NAME] = tsdPtr->stacks[WILDCARD_NODE_NAME]
- ->numUsed;
- levelPtr->bases[WILDCARD_NODE_CLASS] = tsdPtr->stacks[WILDCARD_NODE_CLASS]
- ->numUsed;
-
-
+ for (i = 0; i < NUM_STACKS; i++) {
+ levelPtr->bases[i] = tsdPtr->stacks[i]->numUsed;
+ }
/*
* Step 5: scan the current stack level looking for matches to this
* window's name or class; where found, add new information to the
@@ -1294,6 +1440,39 @@ ExtendStacks(arrayPtr, leaf)
/*
*--------------------------------------------------------------
*
+ * OptionThreadExitProc --
+ *
+ * Free data structures for option handling.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Option-related data structures get freed.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+OptionThreadExitProc(clientData)
+ ClientData clientData; /* not used */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ if (tsdPtr->initialized) {
+ int i;
+ for (i = 0; i < NUM_STACKS; i++) {
+ ckfree((char *) tsdPtr->stacks[i]);
+ }
+ ckfree((char *) tsdPtr->levels);
+ tsdPtr->initialized = 0;
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
* OptionInit --
*
* Initialize data structures for option handling.
@@ -1341,6 +1520,7 @@ OptionInit(mainPtr)
defaultMatchPtr->child.valueUid = NULL;
defaultMatchPtr->priority = -1;
defaultMatchPtr->flags = 0;
+ Tcl_CreateThreadExitHandler(OptionThreadExitProc, NULL);
}
/*
diff --git a/tk/generic/tkPack.c b/tk/generic/tkPack.c
index d10d86782b9..ab2157152af 100644
--- a/tk/generic/tkPack.c
+++ b/tk/generic/tkPack.c
@@ -17,6 +17,9 @@
#include "tkInt.h"
typedef enum {TOP, BOTTOM, LEFT, RIGHT} Side;
+static CONST char *sideNames[] = {
+ "top", "bottom", "left", "right", (char *) NULL
+};
/* For each window that the packer cares about (either because
* the window is managed by the packer or because the window
@@ -24,7 +27,7 @@ typedef enum {TOP, BOTTOM, LEFT, RIGHT} Side;
* structure of the following type:
*/
-typedef struct /* Green Bay */ Packer {
+typedef struct Packer {
Tk_Window tkwin; /* Tk token for window. NULL means that
* the window has been deleted, but the
* packet hasn't had a chance to clean up
@@ -45,12 +48,15 @@ typedef struct /* Green Bay */ Packer {
* than window needs, this indicates how
* where to position window in frame. */
int padX, padY; /* Total additional pixels to leave around the
- * window (half of this space is left on each
- * side). This is space *outside* the window:
+ * window. Some is of this space is on each
+ * side. This is space *outside* the window:
* we'll allocate extra space in frame but
* won't enlarge window). */
+ int padLeft, padTop; /* The part of padX or padY to use on the
+ * left or top of the widget, respectively.
+ * By default, this is half of padX or padY. */
int iPadX, iPadY; /* Total extra pixels to allocate inside the
- * window (half this amount will appear on
+ * window (half of this amount will appear on
* each side). */
int doubleBw; /* Twice the window's last known border
* width. If this changes, the window
@@ -117,12 +123,12 @@ static Tk_GeomMgr packerType = {
static void ArrangePacking _ANSI_ARGS_((ClientData clientData));
static int ConfigureSlaves _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window tkwin, int argc, char *argv[]));
+ Tk_Window tkwin, int objc, Tcl_Obj *CONST objv[]));
static void DestroyPacker _ANSI_ARGS_((char *memPtr));
static Packer * GetPacker _ANSI_ARGS_((Tk_Window tkwin));
static int PackAfter _ANSI_ARGS_((Tcl_Interp *interp,
- Packer *prevPtr, Packer *masterPtr, int argc,
- char **argv));
+ Packer *prevPtr, Packer *masterPtr, int objc,
+ Tcl_Obj *CONST objv[]));
static void PackReqProc _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin));
static void PackStructureProc _ANSI_ARGS_((ClientData clientData,
@@ -136,6 +142,43 @@ static int YExpansion _ANSI_ARGS_((Packer *slavePtr,
/*
*--------------------------------------------------------------
*
+ * TkPrintPadAmount --
+ *
+ * This procedure generates a text value that describes one
+ * of the -padx, -pady, -ipadx, or -ipady configuration options.
+ * The text value generated is appended to the interpreter
+ * result.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *--------------------------------------------------------------
+ */
+void
+TkPrintPadAmount(interp, switchName, halfSpace, allSpace)
+ Tcl_Interp *interp; /* The interpreter into which the result
+ * is written. */
+ char *switchName; /* One of "padx", "pady", "ipadx" or "ipady" */
+ int halfSpace; /* The left or top padding amount */
+ int allSpace; /* The total amount of padding */
+{
+ char buffer[60 + 2*TCL_INTEGER_SPACE];
+ if (halfSpace*2 == allSpace) {
+ sprintf(buffer, " -%.10s %d", switchName, halfSpace);
+ } else {
+ sprintf(buffer, " -%.10s {%d %d}", switchName, halfSpace,
+ allSpace - halfSpace);
+ }
+ Tcl_AppendResult(interp, buffer, (char *)NULL);
+}
+
+
+/*
+ *--------------------------------------------------------------
+ *
* Tk_PackCmd --
*
* This procedure is invoked to process the "pack" Tcl command.
@@ -151,51 +194,71 @@ static int YExpansion _ANSI_ARGS_((Packer *slavePtr,
*/
int
-Tk_PackCmd(clientData, interp, argc, argv)
+Tk_PackObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- size_t length;
- int c;
-
- if ((argc >= 2) && (argv[1][0] == '.')) {
- return ConfigureSlaves(interp, tkwin, argc-1, argv+1);
+ char *argv2;
+ static CONST char *optionStrings[] = {
+ /* after, append, before and unpack are deprecated */
+ "after", "append", "before", "unpack",
+ "configure", "forget", "info", "propagate", "slaves", (char *) NULL };
+ enum options {
+ PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK,
+ PACK_CONFIGURE, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES };
+ int index;
+
+ if (objc >= 2) {
+ char *string = Tcl_GetString(objv[1]);
+ if (string[0] == '.') {
+ return ConfigureSlaves(interp, tkwin, objc-1, objv+1);
+ }
}
- if (argc < 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " option arg ?arg ...?\"", (char *) NULL);
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option arg ?arg ...?");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 'a') && (length >= 2)
- && (strncmp(argv[1], "after", length) == 0)) {
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ /*
+ * Call it again without the deprecated ones to get a proper
+ * error message.
+ * This works well since there can't be any ambiguity between
+ * deprecated and new options.
+ */
+
+ Tcl_ResetResult(interp);
+ Tcl_GetIndexFromObj(interp, objv[1], &optionStrings[4], "option", 0,
+ &index);
+ return TCL_ERROR;
+ }
+
+ argv2 = Tcl_GetString(objv[2]);
+ if (index == PACK_AFTER) {
Packer *prevPtr;
Tk_Window tkwin2;
- tkwin2 = Tk_NameToWindow(interp, argv[2], tkwin);
- if (tkwin2 == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
prevPtr = GetPacker(tkwin2);
if (prevPtr->masterPtr == NULL) {
- Tcl_AppendResult(interp, "window \"", argv[2],
+ Tcl_AppendResult(interp, "window \"", argv2,
"\" isn't packed", (char *) NULL);
return TCL_ERROR;
}
- return PackAfter(interp, prevPtr, prevPtr->masterPtr, argc-3, argv+3);
- } else if ((c == 'a') && (length >= 2)
- && (strncmp(argv[1], "append", length) == 0)) {
+ return PackAfter(interp, prevPtr, prevPtr->masterPtr, objc-3, objv+3);
+ } else if (index == PACK_APPEND) {
Packer *masterPtr;
register Packer *prevPtr;
Tk_Window tkwin2;
- tkwin2 = Tk_NameToWindow(interp, argv[2], tkwin);
- if (tkwin2 == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
masterPtr = GetPacker(tkwin2);
@@ -205,19 +268,18 @@ Tk_PackCmd(clientData, interp, argc, argv)
prevPtr = prevPtr->nextPtr;
}
}
- return PackAfter(interp, prevPtr, masterPtr, argc-3, argv+3);
- } else if ((c == 'b') && (strncmp(argv[1], "before", length) == 0)) {
+ return PackAfter(interp, prevPtr, masterPtr, objc-3, objv+3);
+ } else if (index == PACK_BEFORE) {
Packer *packPtr, *masterPtr;
register Packer *prevPtr;
Tk_Window tkwin2;
- tkwin2 = Tk_NameToWindow(interp, argv[2], tkwin);
- if (tkwin2 == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
packPtr = GetPacker(tkwin2);
if (packPtr->masterPtr == NULL) {
- Tcl_AppendResult(interp, "window \"", argv[2],
+ Tcl_AppendResult(interp, "window \"", argv2,
"\" isn't packed", (char *) NULL);
return TCL_ERROR;
}
@@ -235,22 +297,21 @@ Tk_PackCmd(clientData, interp, argc, argv)
}
}
}
- return PackAfter(interp, prevPtr, masterPtr, argc-3, argv+3);
- } else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)) {
- if (argv[2][0] != '.') {
- Tcl_AppendResult(interp, "bad argument \"", argv[2],
+ return PackAfter(interp, prevPtr, masterPtr, objc-3, objv+3);
+ } else if (index == PACK_CONFIGURE) {
+ if (argv2[0] != '.') {
+ Tcl_AppendResult(interp, "bad argument \"", argv2,
"\": must be name of window", (char *) NULL);
return TCL_ERROR;
}
- return ConfigureSlaves(interp, tkwin, argc-2, argv+2);
- } else if ((c == 'f') && (strncmp(argv[1], "forget", length) == 0)) {
+ return ConfigureSlaves(interp, tkwin, objc-2, objv+2);
+ } else if (index == PACK_FORGET) {
Tk_Window slave;
Packer *slavePtr;
int i;
- for (i = 2; i < argc; i++) {
- slave = Tk_NameToWindow(interp, argv[i], tkwin);
- if (slave == NULL) {
+ for (i = 2; i < objc; i++) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i], &slave) != TCL_OK) {
continue;
}
slavePtr = GetPacker(slave);
@@ -265,24 +326,20 @@ Tk_PackCmd(clientData, interp, argc, argv)
Tk_UnmapWindow(slavePtr->tkwin);
}
}
- } else if ((c == 'i') && (strncmp(argv[1], "info", length) == 0)) {
+ } else if (index == PACK_INFO) {
register Packer *slavePtr;
Tk_Window slave;
- char buffer[64 + TCL_INTEGER_SPACE * 4];
- static char *sideNames[] = {"top", "bottom", "left", "right"};
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " info window\"", (char *) NULL);
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- slave = Tk_NameToWindow(interp, argv[2], tkwin);
- if (slave == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &slave) != TCL_OK) {
return TCL_ERROR;
}
slavePtr = GetPacker(slave);
if (slavePtr->masterPtr == NULL) {
- Tcl_AppendResult(interp, "window \"", argv[2],
+ Tcl_AppendResult(interp, "window \"", argv2,
"\" isn't packed", (char *) NULL);
return TCL_ERROR;
}
@@ -307,35 +364,31 @@ Tk_PackCmd(clientData, interp, argc, argv)
Tcl_AppendResult(interp, "both", (char *) NULL);
break;
}
- sprintf(buffer, " -ipadx %d -ipady %d -padx %d -pady %d",
- slavePtr->iPadX/2, slavePtr->iPadY/2, slavePtr->padX/2,
- slavePtr->padY/2);
- Tcl_AppendResult(interp, buffer, " -side ", sideNames[slavePtr->side],
+ TkPrintPadAmount(interp, "ipadx", slavePtr->iPadX/2, slavePtr->iPadX);
+ TkPrintPadAmount(interp, "ipady", slavePtr->iPadY/2, slavePtr->iPadY);
+ TkPrintPadAmount(interp, "padx", slavePtr->padLeft, slavePtr->padX);
+ TkPrintPadAmount(interp, "pady", slavePtr->padTop, slavePtr->padY);
+ Tcl_AppendResult(interp, " -side ", sideNames[slavePtr->side],
(char *) NULL);
- } else if ((c == 'p') && (strncmp(argv[1], "propagate", length) == 0)) {
+ } else if (index == PACK_PROPAGATE) {
Tk_Window master;
Packer *masterPtr;
int propagate;
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " propagate window ?boolean?\"", (char *) NULL);
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
return TCL_ERROR;
}
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
return TCL_ERROR;
}
masterPtr = GetPacker(master);
- if (argc == 3) {
- if (masterPtr->flags & DONT_PROPAGATE) {
- Tcl_SetResult(interp, "0", TCL_STATIC);
- } else {
- Tcl_SetResult(interp, "1", TCL_STATIC);
- }
+ if (objc == 3) {
+ Tcl_SetObjResult(interp,
+ Tcl_NewBooleanObj(!(masterPtr->flags & DONT_PROPAGATE)));
return TCL_OK;
}
- if (Tcl_GetBoolean(interp, argv[3], &propagate) != TCL_OK) {
+ if (Tcl_GetBooleanFromObj(interp, objv[3], &propagate) != TCL_OK) {
return TCL_ERROR;
}
if (propagate) {
@@ -356,17 +409,15 @@ Tk_PackCmd(clientData, interp, argc, argv)
} else {
masterPtr->flags |= DONT_PROPAGATE;
}
- } else if ((c == 's') && (strncmp(argv[1], "slaves", length) == 0)) {
+ } else if (index == PACK_SLAVES) {
Tk_Window master;
Packer *masterPtr, *slavePtr;
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " slaves window\"", (char *) NULL);
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- master = Tk_NameToWindow(interp, argv[2], tkwin);
- if (master == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &master) != TCL_OK) {
return TCL_ERROR;
}
masterPtr = GetPacker(master);
@@ -374,17 +425,15 @@ Tk_PackCmd(clientData, interp, argc, argv)
slavePtr = slavePtr->nextPtr) {
Tcl_AppendElement(interp, Tk_PathName(slavePtr->tkwin));
}
- } else if ((c == 'u') && (strncmp(argv[1], "unpack", length) == 0)) {
+ } else if (index == PACK_UNPACK) {
Tk_Window tkwin2;
Packer *packPtr;
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " unpack window\"", (char *) NULL);
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
return TCL_ERROR;
}
- tkwin2 = Tk_NameToWindow(interp, argv[2], tkwin);
- if (tkwin2 == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
packPtr = GetPacker(tkwin2);
@@ -398,12 +447,8 @@ Tk_PackCmd(clientData, interp, argc, argv)
Unlink(packPtr);
Tk_UnmapWindow(packPtr->tkwin);
}
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be configure, forget, info, ",
- "propagate, or slaves", (char *) NULL);
- return TCL_ERROR;
}
+
return TCL_OK;
}
@@ -513,11 +558,11 @@ ArrangePacking(clientData)
* allocated to the current window. */
int x, y, width, height; /* These variables are used to hold the
* actual geometry of the current window. */
- int intBWidth; /* Width of internal border in parent window,
- * if any. */
int abort; /* May get set to non-zero to abort this
* repacking operation. */
int borderX, borderY;
+ int borderTop, borderBtm;
+ int borderLeft, borderRight;
int maxWidth, maxHeight, tmp;
masterPtr->flags &= ~REQUESTED_REPACK;
@@ -564,8 +609,10 @@ ArrangePacking(clientData)
* maxHeight - Same as maxWidth, except keeps height info.
*/
- intBWidth = Tk_InternalBorderWidth(masterPtr->tkwin);
- width = height = maxWidth = maxHeight = 2*intBWidth;
+ width = maxWidth = Tk_InternalBorderLeft(masterPtr->tkwin) +
+ Tk_InternalBorderRight(masterPtr->tkwin);
+ height = maxHeight = Tk_InternalBorderTop(masterPtr->tkwin) +
+ Tk_InternalBorderBottom(masterPtr->tkwin);
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
slavePtr = slavePtr->nextPtr) {
if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) {
@@ -593,6 +640,13 @@ ArrangePacking(clientData)
maxHeight = height;
}
+ if (maxWidth < Tk_MinReqWidth(masterPtr->tkwin)) {
+ maxWidth = Tk_MinReqWidth(masterPtr->tkwin);
+ }
+ if (maxHeight < Tk_MinReqHeight(masterPtr->tkwin)) {
+ maxHeight = Tk_MinReqHeight(masterPtr->tkwin);
+ }
+
/*
* If the total amount of space needed in the parent window has
* changed, and if we're propagating geometry information, then
@@ -621,9 +675,14 @@ ArrangePacking(clientData)
* frame, depending on anchor.
*/
- cavityX = cavityY = x = y = intBWidth;
- cavityWidth = Tk_Width(masterPtr->tkwin) - 2*intBWidth;
- cavityHeight = Tk_Height(masterPtr->tkwin) - 2*intBWidth;
+ cavityX = x = Tk_InternalBorderLeft(masterPtr->tkwin);
+ cavityY = y = Tk_InternalBorderTop(masterPtr->tkwin);
+ cavityWidth = Tk_Width(masterPtr->tkwin) -
+ Tk_InternalBorderLeft(masterPtr->tkwin) -
+ Tk_InternalBorderRight(masterPtr->tkwin);
+ cavityHeight = Tk_Height(masterPtr->tkwin) -
+ Tk_InternalBorderTop(masterPtr->tkwin) -
+ Tk_InternalBorderBottom(masterPtr->tkwin);
for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
slavePtr = slavePtr->nextPtr) {
if ((slavePtr->side == TOP) || (slavePtr->side == BOTTOM)) {
@@ -678,9 +737,15 @@ ArrangePacking(clientData)
if (slavePtr->flags & OLD_STYLE) {
borderX = borderY = 0;
+ borderTop = borderBtm = 0;
+ borderLeft = borderRight = 0;
} else {
borderX = slavePtr->padX;
borderY = slavePtr->padY;
+ borderLeft = slavePtr->padLeft;
+ borderRight = borderX - borderLeft;
+ borderTop = slavePtr->padTop;
+ borderBtm = borderY - borderTop;
}
width = Tk_ReqWidth(slavePtr->tkwin) + slavePtr->doubleBw
+ slavePtr->iPadX;
@@ -694,44 +759,42 @@ ArrangePacking(clientData)
|| (height > (frameHeight - borderY))) {
height = frameHeight - borderY;
}
- borderX /= 2;
- borderY /= 2;
switch (slavePtr->anchor) {
case TK_ANCHOR_N:
- x = frameX + (frameWidth - width)/2;
- y = frameY + borderY;
+ x = frameX + (borderLeft + frameWidth - width - borderRight)/2;
+ y = frameY + borderTop;
break;
case TK_ANCHOR_NE:
- x = frameX + frameWidth - width - borderX;
- y = frameY + borderY;
+ x = frameX + frameWidth - width - borderRight;
+ y = frameY + borderTop;
break;
case TK_ANCHOR_E:
- x = frameX + frameWidth - width - borderX;
- y = frameY + (frameHeight - height)/2;
+ x = frameX + frameWidth - width - borderRight;
+ y = frameY + (borderTop + frameHeight - height - borderBtm)/2;
break;
case TK_ANCHOR_SE:
- x = frameX + frameWidth - width - borderX;
- y = frameY + frameHeight - height - borderY;
+ x = frameX + frameWidth - width - borderRight;
+ y = frameY + frameHeight - height - borderBtm;
break;
case TK_ANCHOR_S:
- x = frameX + (frameWidth - width)/2;
- y = frameY + frameHeight - height - borderY;
+ x = frameX + (borderLeft + frameWidth - width - borderRight)/2;
+ y = frameY + frameHeight - height - borderBtm;
break;
case TK_ANCHOR_SW:
- x = frameX + borderX;
- y = frameY + frameHeight - height - borderY;
+ x = frameX + borderLeft;
+ y = frameY + frameHeight - height - borderBtm;
break;
case TK_ANCHOR_W:
- x = frameX + borderX;
- y = frameY + (frameHeight - height)/2;
+ x = frameX + borderLeft;
+ y = frameY + (borderTop + frameHeight - height - borderBtm)/2;
break;
case TK_ANCHOR_NW:
- x = frameX + borderX;
- y = frameY + borderY;
+ x = frameX + borderLeft;
+ y = frameY + borderTop;
break;
case TK_ANCHOR_CENTER:
- x = frameX + (frameWidth - width)/2;
- y = frameY + (frameHeight - height)/2;
+ x = frameX + (borderLeft + frameWidth - width - borderRight)/2;
+ y = frameY + (borderTop + frameHeight - height - borderBtm)/2;
break;
default:
panic("bad frame factor in ArrangePacking");
@@ -969,6 +1032,7 @@ GetPacker(tkwin)
packPtr->side = TOP;
packPtr->anchor = TK_ANCHOR_CENTER;
packPtr->padX = packPtr->padY = 0;
+ packPtr->padLeft = packPtr->padTop = 0;
packPtr->iPadX = packPtr->iPadY = 0;
packPtr->doubleBw = 2*Tk_Changes(tkwin)->border_width;
packPtr->abortPtr = NULL;
@@ -982,6 +1046,86 @@ GetPacker(tkwin)
/*
*--------------------------------------------------------------
*
+ * TkParsePadAmount --
+ *
+ * This procedure parses a padding specification and returns
+ * the appropriate padding values. A padding specification can
+ * be either a single pixel width, or a list of two pixel widths.
+ * If a single pixel width, the amount specified is used for
+ * padding on both sides. If two amounts are specified, then
+ * they specify the left/right or top/bottom padding.
+ *
+ * Results:
+ * A standard Tcl return value.
+ *
+ * Side effects:
+ * An error message is written to the interpreter is something
+ * is not right.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+TkParsePadAmount(interp, tkwin, specObj, halfPtr, allPtr)
+ Tcl_Interp *interp; /* Interpreter for error reporting. */
+ Tk_Window tkwin; /* A window. Needed by Tk_GetPixels() */
+ Tcl_Obj *specObj; /* The argument to "-padx", "-pady", "-ipadx",
+ * or "-ipady". The thing to be parsed. */
+ int *halfPtr; /* Write the left/top part of padding here */
+ int *allPtr; /* Write the total padding here */
+{
+ char *secondPart; /* The second pixel amount of the list */
+ char *separator = 0; /* Separator between 1st and 2nd pixel widths */
+ int sepChar = 0; /* Character used as the separator */
+ int firstInt, secondInt; /* The two components of the padding */
+ char *padSpec = Tcl_GetString(specObj);
+
+ for (secondPart=padSpec;
+ (*secondPart != '\0') && !isspace(UCHAR(*secondPart));
+ secondPart++)
+ { /* Do nothing */ }
+ if (*secondPart != '\0') {
+ separator = secondPart;
+ sepChar = *secondPart;
+ *secondPart = '\0';
+ secondPart++;
+ while ( isspace(UCHAR(*secondPart)) ) {
+ secondPart++;
+ }
+ if (*secondPart == '\0'){
+ secondPart = 0;
+ *separator = sepChar;
+ }
+ } else {
+ secondPart = 0;
+ }
+ if ((Tk_GetPixels(interp, tkwin, padSpec, &firstInt) != TCL_OK) ||
+ (firstInt < 0)) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad pad value \"", padSpec,
+ "\": must be positive screen distance", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (secondPart) {
+ if ((Tk_GetPixels(interp, tkwin, secondPart, &secondInt) != TCL_OK) ||
+ (secondInt < 0)) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad 2nd pad value \"", secondPart,
+ "\": must be positive screen distance", (char *) NULL);
+ return TCL_ERROR;
+ }
+ *separator = sepChar;
+ } else {
+ secondInt = firstInt;
+ }
+ if (halfPtr != 0) *halfPtr = firstInt;
+ *allPtr = firstInt + secondInt;
+ return TCL_OK;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
* PackAfter --
*
* This procedure does most of the real work of adding
@@ -998,22 +1142,22 @@ GetPacker(tkwin)
*/
static int
-PackAfter(interp, prevPtr, masterPtr, argc, argv)
+PackAfter(interp, prevPtr, masterPtr, objc, objv)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Packer *prevPtr; /* Pack windows in argv just after this
* window; NULL means pack as first
* child of masterPtr. */
Packer *masterPtr; /* Master in which to pack windows. */
- int argc; /* Number of elements in argv. */
- char **argv; /* Array of lists, each containing 2
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Array of lists, each containing 2
* elements: window name and side
* against which to pack. */
{
register Packer *packPtr;
Tk_Window tkwin, ancestor, parent;
- size_t length;
- char **options;
- int index, tmp, optionCount, c;
+ int length;
+ Tcl_Obj **options;
+ int index, optionCount, c;
/*
* Iterate over all of the window specifiers, each consisting of
@@ -1022,10 +1166,10 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
* "padx 20".
*/
- for ( ; argc > 0; argc -= 2, argv += 2, prevPtr = packPtr) {
- if (argc < 2) {
+ for ( ; objc > 0; objc -= 2, objv += 2, prevPtr = packPtr) {
+ if (objc < 2) {
Tcl_AppendResult(interp, "wrong # args: window \"",
- argv[0], "\" should be followed by options",
+ Tcl_GetString(objv[0]), "\" should be followed by options",
(char *) NULL);
return TCL_ERROR;
}
@@ -1036,8 +1180,8 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
* or a descendant of its parent.
*/
- tkwin = Tk_NameToWindow(interp, argv[0], masterPtr->tkwin);
- if (tkwin == NULL) {
+ if (TkGetWindowFromObj(interp, masterPtr->tkwin, objv[0], &tkwin)
+ != TCL_OK) {
return TCL_ERROR;
}
@@ -1046,15 +1190,15 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
if (ancestor == parent) {
break;
}
- if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_LEVEL) {
+ if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) {
badWindow:
- Tcl_AppendResult(interp, "can't pack ", argv[0],
+ Tcl_AppendResult(interp, "can't pack ", Tcl_GetString(objv[0]),
" inside ", Tk_PathName(masterPtr->tkwin),
(char *) NULL);
return TCL_ERROR;
}
}
- if (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_LEVEL) {
+ if (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) {
goto badWindow;
}
if (tkwin == masterPtr->tkwin) {
@@ -1066,35 +1210,37 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
* Process options for this window.
*/
- if (Tcl_SplitList(interp, argv[1], &optionCount, &options) != TCL_OK) {
+ if (Tcl_ListObjGetElements(interp, objv[1], &optionCount, &options)
+ != TCL_OK) {
return TCL_ERROR;
}
packPtr->side = TOP;
packPtr->anchor = TK_ANCHOR_CENTER;
packPtr->padX = packPtr->padY = 0;
+ packPtr->padLeft = packPtr->padTop = 0;
packPtr->iPadX = packPtr->iPadY = 0;
packPtr->flags &= ~(FILLX|FILLY|EXPAND);
packPtr->flags |= OLD_STYLE;
for (index = 0 ; index < optionCount; index++) {
- char *curOpt = options[index];
+ Tcl_Obj *curOptPtr = options[index];
+ char *curOpt = Tcl_GetStringFromObj(curOptPtr, (int *) &length);
c = curOpt[0];
- length = strlen(curOpt);
if ((c == 't')
- && (strncmp(curOpt, "top", length)) == 0) {
+ && (strncmp(curOpt, "top", (size_t) length)) == 0) {
packPtr->side = TOP;
} else if ((c == 'b')
- && (strncmp(curOpt, "bottom", length)) == 0) {
+ && (strncmp(curOpt, "bottom", (size_t) length)) == 0) {
packPtr->side = BOTTOM;
} else if ((c == 'l')
- && (strncmp(curOpt, "left", length)) == 0) {
+ && (strncmp(curOpt, "left", (size_t) length)) == 0) {
packPtr->side = LEFT;
} else if ((c == 'r')
- && (strncmp(curOpt, "right", length)) == 0) {
+ && (strncmp(curOpt, "right", (size_t) length)) == 0) {
packPtr->side = RIGHT;
} else if ((c == 'e')
- && (strncmp(curOpt, "expand", length)) == 0) {
+ && (strncmp(curOpt, "expand", (size_t) length)) == 0) {
packPtr->flags |= EXPAND;
} else if ((c == 'f')
&& (strcmp(curOpt, "fill")) == 0) {
@@ -1109,42 +1255,39 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
Tcl_AppendResult(interp, "wrong # args: \"", curOpt,
"\" option must be followed by screen distance",
(char *) NULL);
- goto error;
+ return TCL_ERROR;
}
- if ((Tk_GetPixels(interp, tkwin, options[index+1], &tmp)
- != TCL_OK) || (tmp < 0)) {
- badPad:
- Tcl_AppendResult(interp, "bad pad value \"",
- options[index+1],
- "\": must be positive screen distance",
- (char *) NULL);
- goto error;
+ if (TkParsePadAmount(interp, tkwin, options[index+1],
+ &packPtr->padLeft, &packPtr->padX) != TCL_OK) {
+ return TCL_ERROR;
}
- packPtr->padX = tmp;
+ packPtr->padX /= 2;
+ packPtr->padLeft /= 2;
packPtr->iPadX = 0;
index++;
} else if ((c == 'p') && (strcmp(curOpt, "pady")) == 0) {
if (optionCount < (index+2)) {
goto missingPad;
}
- if ((Tk_GetPixels(interp, tkwin, options[index+1], &tmp)
- != TCL_OK) || (tmp < 0)) {
- goto badPad;
+ if (TkParsePadAmount(interp, tkwin, options[index+1],
+ &packPtr->padTop, &packPtr->padY) != TCL_OK) {
+ return TCL_ERROR;
}
- packPtr->padY = tmp;
+ packPtr->padY /= 2;
+ packPtr->padTop /= 2;
packPtr->iPadY = 0;
index++;
} else if ((c == 'f') && (length > 1)
- && (strncmp(curOpt, "frame", length) == 0)) {
+ && (strncmp(curOpt, "frame", (size_t) length) == 0)) {
if (optionCount < (index+2)) {
Tcl_AppendResult(interp, "wrong # args: \"frame\" ",
"option must be followed by anchor point",
(char *) NULL);
- goto error;
+ return TCL_ERROR;
}
- if (Tk_GetAnchor(interp, options[index+1],
+ if (Tk_GetAnchorFromObj(interp, options[index+1],
&packPtr->anchor) != TCL_OK) {
- goto error;
+ return TCL_ERROR;
}
index++;
} else {
@@ -1152,7 +1295,7 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
"\": should be top, bottom, left, right, ",
"expand, fill, fillx, filly, padx, pady, or frame",
(char *) NULL);
- goto error;
+ return TCL_ERROR;
}
}
@@ -1188,7 +1331,6 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
}
Tk_ManageGeometry(tkwin, &packerType, (ClientData) packPtr);
}
- ckfree((char *) options);
}
/*
@@ -1204,10 +1346,6 @@ PackAfter(interp, prevPtr, masterPtr, argc, argv)
Tcl_DoWhenIdle(ArrangePacking, (ClientData) masterPtr);
}
return TCL_OK;
-
- error:
- ckfree((char *) options);
- return TCL_ERROR;
}
/*
@@ -1399,12 +1537,12 @@ PackStructureProc(clientData, eventPtr)
*/
static int
-ConfigureSlaves(interp, tkwin, argc, argv)
+ConfigureSlaves(interp, tkwin, objc, objv)
Tcl_Interp *interp; /* Interpreter for error reporting. */
Tk_Window tkwin; /* Any window in application containing
* slaves. Used to look up slave names. */
- int argc; /* Number of elements in argv. */
- char *argv[]; /* Argument strings: contains one or more
+ int objc; /* Number of elements in argv. */
+ Tcl_Obj *CONST objv[]; /* Argument objects: contains one or more
* window names followed by any number
* of "option value" pairs. Caller must
* make sure that there is at least one
@@ -1412,15 +1550,23 @@ ConfigureSlaves(interp, tkwin, argc, argv)
{
Packer *masterPtr, *slavePtr, *prevPtr, *otherPtr;
Tk_Window other, slave, parent, ancestor;
- int i, j, numWindows, c, tmp, positionGiven;
- size_t length;
+ int i, j, numWindows, tmp, positionGiven;
+ char *string;
+ static CONST char *optionStrings[] = {
+ "-after", "-anchor", "-before", "-expand", "-fill",
+ "-in", "-ipadx", "-ipady", "-padx", "-pady", "-side", (char *) NULL };
+ enum options {
+ CONF_AFTER, CONF_ANCHOR, CONF_BEFORE, CONF_EXPAND, CONF_FILL,
+ CONF_IN, CONF_IPADX, CONF_IPADY, CONF_PADX, CONF_PADY, CONF_SIDE };
+ int index, side;
/*
* Find out how many windows are specified.
*/
- for (numWindows = 0; numWindows < argc; numWindows++) {
- if (argv[numWindows][0] != '.') {
+ for (numWindows = 0; numWindows < objc; numWindows++) {
+ string = Tcl_GetString(objv[numWindows]);
+ if (string[0] != '.') {
break;
}
}
@@ -1440,12 +1586,11 @@ ConfigureSlaves(interp, tkwin, argc, argv)
prevPtr = NULL;
positionGiven = 0;
for (j = 0; j < numWindows; j++) {
- slave = Tk_NameToWindow(interp, argv[j], tkwin);
- if (slave == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[j], &slave) != TCL_OK) {
return TCL_ERROR;
}
- if (Tk_IsTopLevel(slave)) {
- Tcl_AppendResult(interp, "can't pack \"", argv[j],
+ if (Tk_TopWinHierarchy(slave)) {
+ Tcl_AppendResult(interp, "can't pack \"", Tcl_GetString(objv[j]),
"\": it's a top-level window", (char *) NULL);
return TCL_ERROR;
}
@@ -1462,49 +1607,48 @@ ConfigureSlaves(interp, tkwin, argc, argv)
slavePtr->side = TOP;
slavePtr->anchor = TK_ANCHOR_CENTER;
slavePtr->padX = slavePtr->padY = 0;
+ slavePtr->padLeft = slavePtr->padTop = 0;
slavePtr->iPadX = slavePtr->iPadY = 0;
slavePtr->flags &= ~(FILLX|FILLY|EXPAND);
}
- for (i = numWindows; i < argc; i+=2) {
- if ((i+2) > argc) {
- Tcl_AppendResult(interp, "extra option \"", argv[i],
+ for (i = numWindows; i < objc; i+=2) {
+ if ((i+2) > objc) {
+ Tcl_AppendResult(interp, "extra option \"",
+ Tcl_GetString(objv[i]),
"\" (option with no value?)", (char *) NULL);
return TCL_ERROR;
}
- length = strlen(argv[i]);
- if (length < 2) {
- goto badOption;
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option",
+ 0, &index) != TCL_OK) {
+ return TCL_ERROR;
}
- c = argv[i][1];
- if ((c == 'a') && (strncmp(argv[i], "-after", length) == 0)
- && (length >= 2)) {
+ if (index == CONF_AFTER) {
if (j == 0) {
- other = Tk_NameToWindow(interp, argv[i+1], tkwin);
- if (other == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i+1], &other)
+ != TCL_OK) {
return TCL_ERROR;
}
prevPtr = GetPacker(other);
if (prevPtr->masterPtr == NULL) {
notPacked:
- Tcl_AppendResult(interp, "window \"", argv[i+1],
+ Tcl_AppendResult(interp, "window \"",
+ Tcl_GetString(objv[i+1]),
"\" isn't packed", (char *) NULL);
return TCL_ERROR;
}
masterPtr = prevPtr->masterPtr;
positionGiven = 1;
}
- } else if ((c == 'a') && (strncmp(argv[i], "-anchor", length) == 0)
- && (length >= 2)) {
- if (Tk_GetAnchor(interp, argv[i+1], &slavePtr->anchor)
+ } else if (index == CONF_ANCHOR) {
+ if (Tk_GetAnchorFromObj(interp, objv[i+1], &slavePtr->anchor)
!= TCL_OK) {
return TCL_ERROR;
}
- } else if ((c == 'b')
- && (strncmp(argv[i], "-before", length) == 0)) {
+ } else if (index == CONF_BEFORE) {
if (j == 0) {
- other = Tk_NameToWindow(interp, argv[i+1], tkwin);
- if (other == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i+1], &other)
+ != TCL_OK) {
return TCL_ERROR;
}
otherPtr = GetPacker(other);
@@ -1522,33 +1666,33 @@ ConfigureSlaves(interp, tkwin, argc, argv)
}
positionGiven = 1;
}
- } else if ((c == 'e')
- && (strncmp(argv[i], "-expand", length) == 0)) {
- if (Tcl_GetBoolean(interp, argv[i+1], &tmp) != TCL_OK) {
+ } else if (index == CONF_EXPAND) {
+ if (Tcl_GetBooleanFromObj(interp, objv[i+1], &tmp) != TCL_OK) {
return TCL_ERROR;
}
slavePtr->flags &= ~EXPAND;
if (tmp) {
slavePtr->flags |= EXPAND;
}
- } else if ((c == 'f') && (strncmp(argv[i], "-fill", length) == 0)) {
- if (strcmp(argv[i+1], "none") == 0) {
+ } else if (index == CONF_FILL) {
+ string = Tcl_GetString(objv[i+1]);
+ if (strcmp(string, "none") == 0) {
slavePtr->flags &= ~(FILLX|FILLY);
- } else if (strcmp(argv[i+1], "x") == 0) {
+ } else if (strcmp(string, "x") == 0) {
slavePtr->flags = (slavePtr->flags & ~FILLY) | FILLX;
- } else if (strcmp(argv[i+1], "y") == 0) {
+ } else if (strcmp(string, "y") == 0) {
slavePtr->flags = (slavePtr->flags & ~FILLX) | FILLY;
- } else if (strcmp(argv[i+1], "both") == 0) {
+ } else if (strcmp(string, "both") == 0) {
slavePtr->flags |= FILLX|FILLY;
} else {
- Tcl_AppendResult(interp, "bad fill style \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad fill style \"", string,
"\": must be none, x, y, or both", (char *) NULL);
return TCL_ERROR;
}
- } else if ((c == 'i') && (strcmp(argv[i], "-in") == 0)) {
+ } else if (index == CONF_IN) {
if (j == 0) {
- other = Tk_NameToWindow(interp, argv[i+1], tkwin);
- if (other == NULL) {
+ if (TkGetWindowFromObj(interp, tkwin, objv[i+1], &other)
+ != TCL_OK) {
return TCL_ERROR;
}
masterPtr = GetPacker(other);
@@ -1560,58 +1704,46 @@ ConfigureSlaves(interp, tkwin, argc, argv)
}
positionGiven = 1;
}
- } else if ((c == 'i') && (strcmp(argv[i], "-ipadx") == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
+ } else if (index == CONF_IPADX) {
+ if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ != TCL_OK)
|| (tmp < 0)) {
- badPad:
Tcl_ResetResult(interp);
- Tcl_AppendResult(interp, "bad pad value \"", argv[i+1],
+ Tcl_AppendResult(interp, "bad ipadx value \"",
+ Tcl_GetString(objv[i+1]),
"\": must be positive screen distance",
(char *) NULL);
return TCL_ERROR;
}
- slavePtr->iPadX = tmp*2;
- } else if ((c == 'i') && (strcmp(argv[i], "-ipady") == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
- || (tmp< 0)) {
- goto badPad;
+ slavePtr->iPadX = tmp * 2;
+ } else if (index == CONF_IPADY) {
+ if ((Tk_GetPixelsFromObj(interp, slave, objv[i+1], &tmp)
+ != TCL_OK)
+ || (tmp < 0)) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad ipady value \"",
+ Tcl_GetString(objv[i+1]),
+ "\": must be positive screen distance",
+ (char *) NULL);
+ return TCL_ERROR;
}
- slavePtr->iPadY = tmp*2;
- } else if ((c == 'p') && (strcmp(argv[i], "-padx") == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
- || (tmp< 0)) {
- goto badPad;
+ slavePtr->iPadY = tmp * 2;
+ } else if (index == CONF_PADX) {
+ if (TkParsePadAmount(interp, slave, objv[i+1],
+ &slavePtr->padLeft, &slavePtr->padX) != TCL_OK) {
+ return TCL_ERROR;
}
- slavePtr->padX = tmp*2;
- } else if ((c == 'p') && (strcmp(argv[i], "-pady") == 0)) {
- if ((Tk_GetPixels(interp, slave, argv[i+1], &tmp) != TCL_OK)
- || (tmp< 0)) {
- goto badPad;
+ } else if (index == CONF_PADY) {
+ if (TkParsePadAmount(interp, slave, objv[i+1],
+ &slavePtr->padTop, &slavePtr->padY) != TCL_OK) {
+ return TCL_ERROR;
}
- slavePtr->padY = tmp*2;
- } else if ((c == 's') && (strncmp(argv[i], "-side", length) == 0)) {
- c = argv[i+1][0];
- if ((c == 't') && (strcmp(argv[i+1], "top") == 0)) {
- slavePtr->side = TOP;
- } else if ((c == 'b') && (strcmp(argv[i+1], "bottom") == 0)) {
- slavePtr->side = BOTTOM;
- } else if ((c == 'l') && (strcmp(argv[i+1], "left") == 0)) {
- slavePtr->side = LEFT;
- } else if ((c == 'r') && (strcmp(argv[i+1], "right") == 0)) {
- slavePtr->side = RIGHT;
- } else {
- Tcl_AppendResult(interp, "bad side \"", argv[i+1],
- "\": must be top, bottom, left, or right",
- (char *) NULL);
+ } else if (index == CONF_SIDE) {
+ if (Tcl_GetIndexFromObj(interp, objv[i+1], sideNames, "side",
+ TCL_EXACT, &side) != TCL_OK) {
return TCL_ERROR;
}
- } else {
- badOption:
- Tcl_AppendResult(interp, "unknown or ambiguous option \"",
- argv[i], "\": must be -after, -anchor, -before, ",
- "-expand, -fill, -in, -ipadx, -ipady, -padx, ",
- "-pady, or -side", (char *) NULL);
- return TCL_ERROR;
+ slavePtr->side = side;
}
}
@@ -1663,15 +1795,15 @@ ConfigureSlaves(interp, tkwin, argc, argv)
if (ancestor == parent) {
break;
}
- if (Tk_IsTopLevel(ancestor)) {
- Tcl_AppendResult(interp, "can't pack ", argv[j],
+ if (Tk_TopWinHierarchy(ancestor)) {
+ Tcl_AppendResult(interp, "can't pack ", Tcl_GetString(objv[j]),
" inside ", Tk_PathName(masterPtr->tkwin),
(char *) NULL);
return TCL_ERROR;
}
}
if (slave == masterPtr->tkwin) {
- Tcl_AppendResult(interp, "can't pack ", argv[j],
+ Tcl_AppendResult(interp, "can't pack ", Tcl_GetString(objv[j]),
" inside itself", (char *) NULL);
return TCL_ERROR;
}
@@ -1717,5 +1849,3 @@ ConfigureSlaves(interp, tkwin, argc, argv)
}
return TCL_OK;
}
-
-
diff --git a/tk/generic/tkPanedWindow.c b/tk/generic/tkPanedWindow.c
new file mode 100644
index 00000000000..fffe111673e
--- /dev/null
+++ b/tk/generic/tkPanedWindow.c
@@ -0,0 +1,2752 @@
+/*
+ * tkPanedWindow.c --
+ *
+ * This module implements "paned window" widgets that are object
+ * based. A "paned window" is a widget that manages the geometry for
+ * some number of other widgets, placing a movable "sash" between them,
+ * which can be used to alter the relative sizes of adjacent widgets.
+ *
+ * Copyright (c) 1997 Sun Microsystems, Inc.
+ * Copyright (c) 2000 Ajuba Solutions.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkPort.h"
+#include "default.h"
+#include "tkInt.h"
+
+/* Flag values for "sticky"ness The 16 combinations subsume the packer's
+ * notion of anchor and fill.
+ *
+ * STICK_NORTH This window sticks to the top of its cavity.
+ * STICK_EAST This window sticks to the right edge of its cavity.
+ * STICK_SOUTH This window sticks to the bottom of its cavity.
+ * STICK_WEST This window sticks to the left edge of its cavity.
+ */
+
+#define STICK_NORTH 1
+#define STICK_EAST 2
+#define STICK_SOUTH 4
+#define STICK_WEST 8
+/*
+ * The following table defines the legal values for the -orient option.
+ */
+
+static char *orientStrings[] = {
+ "horizontal", "vertical", (char *) NULL
+};
+
+enum orient { ORIENT_HORIZONTAL, ORIENT_VERTICAL };
+
+typedef struct {
+ Tk_OptionTable pwOptions; /* Token for paned window option table. */
+ Tk_OptionTable slaveOpts; /* Token for slave cget option table. */
+} OptionTables;
+
+/*
+ * One structure of the following type is kept for each window
+ * managed by a paned window widget.
+ */
+
+typedef struct Slave {
+ Tk_Window tkwin; /* Window being managed. */
+
+ int minSize; /* Minimum size of this pane, on the
+ * relevant axis, in pixels. */
+ int padx; /* Additional padding requested for
+ * slave, in the x dimension. */
+ int pady; /* Additional padding requested for
+ * slave, in the y dimension. */
+ Tcl_Obj *widthPtr, *heightPtr; /* Tcl_Obj rep's of slave width/height,
+ * to allow for null values. */
+ int width; /* Slave width. */
+ int height; /* Slave height. */
+ int sticky; /* Sticky string. */
+ int x, y; /* Coordinates of the widget. */
+ int paneWidth, paneHeight; /* Pane dimensions (may be different
+ * from slave width/height). */
+ int sashx, sashy; /* Coordinates of the sash of the
+ * right or bottom of this pane. */
+ int markx, marky; /* Coordinates of the last mark set
+ * for the sash. */
+ int handlex, handley; /* Coordinates of the sash handle. */
+ struct PanedWindow *masterPtr; /* Paned window managing the window. */
+ Tk_Window after; /* Placeholder for parsing options. */
+ Tk_Window before; /* Placeholder for parsing options. */
+} Slave;
+
+/*
+ * A data structure of the following type is kept for each paned window
+ * widget managed by this file:
+ */
+
+typedef struct PanedWindow {
+ Tk_Window tkwin; /* Window that embodies the paned window. */
+ Tk_Window proxywin; /* Window for the resizing proxy. */
+ Display *display; /* X's token for the window's display. */
+ Tcl_Interp *interp; /* Interpreter associated with widget. */
+ Tcl_Command widgetCmd; /* Token for square's widget command. */
+ Tk_OptionTable optionTable; /* Token representing the configuration
+ * specifications. */
+ Tk_OptionTable slaveOpts; /* Token for slave cget table. */
+ Tk_3DBorder background; /* Background color. */
+ int borderWidth; /* Value of -borderwidth option. */
+ int relief; /* 3D border effect (TK_RELIEF_RAISED, etc) */
+ Tcl_Obj *widthPtr; /* Tcl_Obj rep for width. */
+ Tcl_Obj *heightPtr; /* Tcl_Obj rep for height. */
+ int width, height; /* Width and height of the widget. */
+ enum orient orient; /* Orientation of the widget. */
+ Tk_Cursor cursor; /* Current cursor for window, or None. */
+ int resizeOpaque; /* Boolean indicating whether resize should be
+ * opaque or rubberband style. */
+
+ int sashRelief; /* Relief used to draw sash. */
+ int sashWidth; /* Width of each sash, in pixels. */
+ Tcl_Obj *sashWidthPtr; /* Tcl_Obj rep for sash width. */
+ int sashPad; /* Additional padding around each sash. */
+ Tcl_Obj *sashPadPtr; /* Tcl_Obj rep for sash padding. */
+ int showHandle; /* Boolean indicating whether sash handles
+ * should be drawn. */
+ int handleSize; /* Size of one side of a sash handle (handles
+ * are square), in pixels. */
+ int handlePad; /* Distance from border to draw handle. */
+ Tcl_Obj *handleSizePtr; /* Tcl_Obj rep for handle size. */
+ Tk_Cursor sashCursor; /* Cursor used when mouse is above a sash. */
+
+ GC gc; /* Graphics context for copying from
+ * off-screen pixmap onto screen. */
+ int proxyx, proxyy; /* Proxy x,y coordinates. */
+ Slave **slaves; /* Pointer to array of Slaves. */
+ int numSlaves; /* Number of slaves. */
+ int sizeofSlaves; /* Number of elements in the slaves array. */
+ int flags; /* Flags for widget; see below. */
+} PanedWindow;
+
+/*
+ * Flags used for paned windows:
+ *
+ * REDRAW_PENDING: Non-zero means a DoWhenIdle handler has
+ * been queued to redraw this window.
+ *
+ * WIDGET_DELETED: Non-zero means that the paned window has
+ * been, or is in the process of being, deleted.
+ *
+ * RESIZE_PENDING: Non-zero means that the window might need to
+ * change its size (or the size of its panes)
+ * because of a change in the size of one of its
+ * children.
+ */
+
+#define REDRAW_PENDING 0x0001
+#define WIDGET_DELETED 0x0002
+#define REQUESTED_RELAYOUT 0x0004
+#define RECOMPUTE_GEOMETRY 0x0008
+#define PROXY_REDRAW_PENDING 0x0010
+#define RESIZE_PENDING 0x0020
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+int Tk_PanedWindowObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]));
+static void PanedWindowCmdDeletedProc _ANSI_ARGS_((ClientData clientData));
+static int ConfigurePanedWindow _ANSI_ARGS_((Tcl_Interp *interp,
+ PanedWindow *pwPtr, int objc, Tcl_Obj *CONST objv[]));
+static void DestroyPanedWindow _ANSI_ARGS_((PanedWindow *pwPtr));
+static void DisplayPanedWindow _ANSI_ARGS_((ClientData clientData));
+static void PanedWindowEventProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static void ProxyWindowEventProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static void DisplayProxyWindow _ANSI_ARGS_((ClientData clientData));
+void PanedWindowWorldChanged _ANSI_ARGS_((ClientData instanceData));
+static int PanedWindowWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]));
+static void PanedWindowLostSlaveProc _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin));
+static void PanedWindowReqProc _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin));
+static void ArrangePanes _ANSI_ARGS_((ClientData clientData));
+static void Unlink _ANSI_ARGS_((Slave *slavePtr));
+static Slave * GetPane _ANSI_ARGS_((PanedWindow *pwPtr, Tk_Window tkwin));
+static void SlaveStructureProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static int PanedWindowSashCommand _ANSI_ARGS_((PanedWindow *pwPtr,
+ Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]));
+static int PanedWindowProxyCommand _ANSI_ARGS_((PanedWindow *pwPtr,
+ Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]));
+static void ComputeGeometry _ANSI_ARGS_((PanedWindow *pwPtr));
+static int ConfigureSlaves _ANSI_ARGS_((PanedWindow *pwPtr,
+ Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]));
+static void DestroyOptionTables _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp));
+static int SetSticky _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, Tk_Window tkwin,
+ Tcl_Obj **value, char *recordPtr, int internalOffset,
+ char *oldInternalPtr, int flags));
+static Tcl_Obj *GetSticky _ANSI_ARGS_((ClientData clientData, Tk_Window tkwin,
+ char *recordPtr, int internalOffset));
+static void RestoreSticky _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin, char *internalPtr,
+ char *oldInternalPtr));
+static void AdjustForSticky _ANSI_ARGS_((int sticky, int cavityWidth,
+ int cavityHeight, int *xPtr, int *yPtr,
+ int *slaveWidthPtr, int *slaveHeightPtr));
+static void MoveSash _ANSI_ARGS_((PanedWindow *pwPtr, int sash, int diff));
+static int ObjectIsEmpty _ANSI_ARGS_((Tcl_Obj *objPtr));
+static char * ComputeSlotAddress _ANSI_ARGS_((char *recordPtr, int offset));
+static int PanedWindowIdentifyCoords _ANSI_ARGS_((PanedWindow *pwPtr,
+ Tcl_Interp *interp, int x, int y));
+
+#define ValidSashIndex(pwPtr, sash) \
+ (((sash) >= 0) && ((sash) < (pwPtr)->numSlaves))
+
+static Tk_GeomMgr panedWindowMgrType = {
+ "panedwindow", /* name */
+ PanedWindowReqProc, /* requestProc */
+ PanedWindowLostSlaveProc, /* lostSlaveProc */
+};
+
+/*
+ * Information used for objv parsing.
+ */
+
+#define GEOMETRY 0x0001
+
+/*
+ * The following structure contains pointers to functions used for processing
+ * the custom "-sticky" option for slave windows.
+ */
+
+static Tk_ObjCustomOption stickyOption = {
+ "sticky", /* name */
+ SetSticky, /* setProc */
+ GetSticky, /* getProc */
+ RestoreSticky, /* restoreProc */
+ (Tk_CustomOptionFreeProc *)NULL, /* freeProc */
+ 0
+};
+
+static Tk_OptionSpec optionSpecs[] = {
+ {TK_OPTION_BORDER, "-background", "background", "Background",
+ DEF_PANEDWINDOW_BG_COLOR, -1, Tk_Offset(PanedWindow, background), 0,
+ (ClientData) DEF_PANEDWINDOW_BG_MONO},
+ {TK_OPTION_SYNONYM, "-bd", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-borderwidth"},
+ {TK_OPTION_SYNONYM, "-bg", (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, (ClientData) "-background"},
+ {TK_OPTION_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
+ DEF_PANEDWINDOW_BORDERWIDTH, -1, Tk_Offset(PanedWindow, borderWidth),
+ 0, 0, GEOMETRY},
+ {TK_OPTION_CURSOR, "-cursor", "cursor", "Cursor",
+ DEF_PANEDWINDOW_CURSOR, -1, Tk_Offset(PanedWindow, cursor),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-handlepad", "handlePad", "HandlePad",
+ DEF_PANEDWINDOW_HANDLEPAD, -1, Tk_Offset(PanedWindow, handlePad),
+ 0, 0},
+ {TK_OPTION_PIXELS, "-handlesize", "handleSize", "HandleSize",
+ DEF_PANEDWINDOW_HANDLESIZE, Tk_Offset(PanedWindow, handleSizePtr),
+ Tk_Offset(PanedWindow, handleSize), 0, 0, GEOMETRY},
+ {TK_OPTION_PIXELS, "-height", "height", "Height",
+ DEF_PANEDWINDOW_HEIGHT, Tk_Offset(PanedWindow, heightPtr),
+ Tk_Offset(PanedWindow, height), TK_OPTION_NULL_OK, 0, GEOMETRY},
+ {TK_OPTION_BOOLEAN, "-opaqueresize", "opaqueResize", "OpaqueResize",
+ DEF_PANEDWINDOW_OPAQUERESIZE, -1,
+ Tk_Offset(PanedWindow, resizeOpaque), 0, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-orient", "orient", "Orient",
+ DEF_PANEDWINDOW_ORIENT, -1, Tk_Offset(PanedWindow, orient),
+ 0, (ClientData) orientStrings, GEOMETRY},
+ {TK_OPTION_RELIEF, "-relief", "relief", "Relief",
+ DEF_PANEDWINDOW_RELIEF, -1, Tk_Offset(PanedWindow, relief), 0, 0, 0},
+ {TK_OPTION_CURSOR, "-sashcursor", "sashCursor", "Cursor",
+ DEF_PANEDWINDOW_SASHCURSOR, -1, Tk_Offset(PanedWindow, sashCursor),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-sashpad", "sashPad", "SashPad",
+ DEF_PANEDWINDOW_SASHPAD, -1, Tk_Offset(PanedWindow, sashPad),
+ 0, 0, GEOMETRY},
+ {TK_OPTION_RELIEF, "-sashrelief", "sashRelief", "Relief",
+ DEF_PANEDWINDOW_SASHRELIEF, -1, Tk_Offset(PanedWindow, sashRelief),
+ 0, 0, 0},
+ {TK_OPTION_PIXELS, "-sashwidth", "sashWidth", "Width",
+ DEF_PANEDWINDOW_SASHWIDTH, Tk_Offset(PanedWindow, sashWidthPtr),
+ Tk_Offset(PanedWindow, sashWidth), 0, 0, GEOMETRY},
+ {TK_OPTION_BOOLEAN, "-showhandle", "showHandle", "ShowHandle",
+ DEF_PANEDWINDOW_SHOWHANDLE, -1, Tk_Offset(PanedWindow, showHandle),
+ 0, 0, GEOMETRY},
+ {TK_OPTION_PIXELS, "-width", "width", "Width",
+ DEF_PANEDWINDOW_WIDTH, Tk_Offset(PanedWindow, widthPtr),
+ Tk_Offset(PanedWindow, width), TK_OPTION_NULL_OK, 0, GEOMETRY},
+ {TK_OPTION_END}
+};
+
+static Tk_OptionSpec slaveOptionSpecs[] = {
+ {TK_OPTION_WINDOW, "-after", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_AFTER, -1, Tk_Offset(Slave, after),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_WINDOW, "-before", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_BEFORE, -1, Tk_Offset(Slave, before),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-height", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_HEIGHT, Tk_Offset(Slave, heightPtr),
+ Tk_Offset(Slave, height), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-minsize", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_MINSIZE, -1, Tk_Offset(Slave, minSize), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-padx", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_PADX, -1, Tk_Offset(Slave, padx), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-pady", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_PADY, -1, Tk_Offset(Slave, pady), 0, 0, 0},
+ {TK_OPTION_CUSTOM, "-sticky", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_STICKY, -1, Tk_Offset(Slave, sticky), 0,
+ (ClientData) &stickyOption, 0},
+ {TK_OPTION_PIXELS, "-width", (char *) NULL, (char *) NULL,
+ DEF_PANEDWINDOW_PANE_WIDTH, Tk_Offset(Slave, widthPtr),
+ Tk_Offset(Slave, width), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_END}
+};
+
+
+/*
+ *--------------------------------------------------------------
+ *
+ * Tk_PanedWindowObjCmd --
+ *
+ * This procedure is invoked to process the "panedwindow" Tcl
+ * command. It creates a new "panedwindow" widget.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * A new widget is created and configured.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+Tk_PanedWindowObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* NULL. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj * CONST objv[]; /* Argument objects. */
+{
+ PanedWindow *pwPtr;
+ Tk_Window tkwin, parent;
+ OptionTables *pwOpts;
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
+ return TCL_ERROR;
+ }
+
+ tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp),
+ Tcl_GetStringFromObj(objv[1], NULL), (char *) NULL);
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+
+ pwOpts = (OptionTables *)
+ Tcl_GetAssocData(interp, "PanedWindowOptionTables", NULL);
+ if (pwOpts == NULL) {
+ /*
+ * The first time this procedure is invoked, the option tables will
+ * be NULL. We then create the option tables from the templates
+ * and store a pointer to the tables as the command's clinical so
+ * we'll have easy access to it in the future.
+ */
+ pwOpts = (OptionTables *) ckalloc(sizeof(OptionTables));
+ /* Set up an exit handler to free the optionTables struct */
+ Tcl_SetAssocData(interp, "PanedWindowOptionTables",
+ DestroyOptionTables, (ClientData) pwOpts);
+
+ /* Create the paned window option tables. */
+ pwOpts->pwOptions = Tk_CreateOptionTable(interp, optionSpecs);
+ pwOpts->slaveOpts = Tk_CreateOptionTable(interp, slaveOptionSpecs);
+ }
+
+ Tk_SetClass(tkwin, "Panedwindow");
+
+ /*
+ * Allocate and initialize the widget record.
+ */
+
+ pwPtr = (PanedWindow *) ckalloc(sizeof(PanedWindow));
+ memset((void *)pwPtr, 0, (sizeof(PanedWindow)));
+ pwPtr->tkwin = tkwin;
+ pwPtr->display = Tk_Display(tkwin);
+ pwPtr->interp = interp;
+ pwPtr->widgetCmd = Tcl_CreateObjCommand(interp,
+ Tk_PathName(pwPtr->tkwin), PanedWindowWidgetObjCmd,
+ (ClientData) pwPtr, PanedWindowCmdDeletedProc);
+ pwPtr->optionTable = pwOpts->pwOptions;
+ pwPtr->slaveOpts = pwOpts->slaveOpts;
+ pwPtr->relief = TK_RELIEF_RAISED;
+ pwPtr->gc = None;
+ pwPtr->cursor = None;
+ pwPtr->sashCursor = None;
+
+ if (Tk_InitOptions(interp, (char *) pwPtr, pwOpts->pwOptions,
+ tkwin) != TCL_OK) {
+ Tk_DestroyWindow(pwPtr->tkwin);
+ ckfree((char *) pwPtr);
+ return TCL_ERROR;
+ }
+
+ Tk_CreateEventHandler(pwPtr->tkwin, ExposureMask|StructureNotifyMask,
+ PanedWindowEventProc, (ClientData) pwPtr);
+
+ /*
+ * Find the toplevel ancestor of the panedwindow, and make a proxy
+ * win as a child of that window; this way the proxy can always float
+ * above slaves in the panedwindow.
+ */
+ parent = Tk_Parent(pwPtr->tkwin);
+ while (!(Tk_IsTopLevel(parent))) {
+ parent = Tk_Parent(parent);
+ if (parent == NULL) {
+ parent = pwPtr->tkwin;
+ break;
+ }
+ }
+
+ pwPtr->proxywin = Tk_CreateAnonymousWindow(interp, parent, (char *) NULL);
+ Tk_CreateEventHandler(pwPtr->proxywin, ExposureMask, ProxyWindowEventProc,
+ (ClientData) pwPtr);
+
+ if (ConfigurePanedWindow(interp, pwPtr, objc - 2, objv + 2) != TCL_OK) {
+ Tk_DestroyWindow(pwPtr->tkwin);
+ Tk_DestroyWindow(pwPtr->proxywin);
+ ckfree((char *) pwPtr);
+ return TCL_ERROR;
+ }
+
+ Tcl_SetStringObj(Tcl_GetObjResult(interp), Tk_PathName(pwPtr->tkwin), -1);
+ return TCL_OK;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * PanedWindowWidgetObjCmd --
+ *
+ * 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
+PanedWindowWidgetObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* Information about square widget. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj * CONST objv[]; /* Argument objects. */
+{
+ PanedWindow *pwPtr = (PanedWindow *) clientData;
+ int result = TCL_OK;
+ static CONST char *optionStrings[] = {"add", "cget", "configure", "forget",
+ "identify", "panecget",
+ "paneconfigure", "panes",
+ "proxy", "sash", (char *) NULL};
+ enum options { PW_ADD, PW_CGET, PW_CONFIGURE, PW_FORGET, PW_IDENTIFY,
+ PW_PANECGET, PW_PANECONFIGURE, PW_PANES, PW_PROXY,
+ PW_SASH };
+ Tcl_Obj *resultObj;
+ int index, count, i, x, y;
+ Tk_Window tkwin;
+ Slave *slavePtr;
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg...?");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "command",
+ 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ Tcl_Preserve((ClientData) pwPtr);
+
+ switch ((enum options) index) {
+ case PW_ADD: {
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "widget ?widget ...?");
+ result = TCL_ERROR;
+ break;
+ }
+
+ result = ConfigureSlaves(pwPtr, interp, objc, objv);
+ break;
+ }
+
+ case PW_CGET: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option");
+ result = TCL_ERROR;
+ break;
+ }
+ resultObj = Tk_GetOptionValue(interp, (char *) pwPtr,
+ pwPtr->optionTable, objv[2], pwPtr->tkwin);
+ if (resultObj == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, resultObj);
+ }
+ break;
+ }
+
+ case PW_CONFIGURE: {
+ resultObj = NULL;
+ if (objc <= 3) {
+ resultObj = Tk_GetOptionInfo(interp, (char *) pwPtr,
+ pwPtr->optionTable,
+ (objc == 3) ? objv[2] : (Tcl_Obj *) NULL,
+ pwPtr->tkwin);
+ if (resultObj == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, resultObj);
+ }
+ } else {
+ result = ConfigurePanedWindow(interp, pwPtr, objc - 2,
+ objv + 2);
+ }
+ break;
+ }
+
+ case PW_FORGET: {
+ Tk_Window slave;
+ int i;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "widget ?widget ...?");
+ result = TCL_ERROR;
+ break;
+ }
+
+ /*
+ * Clean up each window named in the arg list.
+ */
+ for (count = 0, i = 2; i < objc; i++) {
+ slave = Tk_NameToWindow(interp, Tcl_GetString(objv[i]),
+ pwPtr->tkwin);
+ if (slave == NULL) {
+ continue;
+ }
+ slavePtr = GetPane(pwPtr, slave);
+ if ((slavePtr != NULL) && (slavePtr->masterPtr != NULL)) {
+ count++;
+ Tk_ManageGeometry(slave, (Tk_GeomMgr *) NULL,
+ (ClientData) NULL);
+ Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin);
+ Tk_DeleteEventHandler(slavePtr->tkwin, StructureNotifyMask,
+ SlaveStructureProc, (ClientData) slavePtr);
+ Tk_UnmapWindow(slavePtr->tkwin);
+ Unlink(slavePtr);
+ }
+ if (count != 0) {
+ ComputeGeometry(pwPtr);
+ }
+ }
+ break;
+ }
+
+ case PW_IDENTIFY: {
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "x y");
+ result = TCL_ERROR;
+ break;
+ }
+
+ if ((Tcl_GetIntFromObj(interp, objv[2], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[3], &y) != TCL_OK)) {
+ result = TCL_ERROR;
+ break;
+ }
+
+ result = PanedWindowIdentifyCoords(pwPtr, interp, x, y);
+ break;
+ }
+
+ case PW_PANECGET: {
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "pane option");
+ result = TCL_ERROR;
+ break;
+ }
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ pwPtr->tkwin);
+ if (tkwin == NULL) {
+ result = TCL_ERROR;
+ break;
+ }
+ resultObj = NULL;
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ if (pwPtr->slaves[i]->tkwin == tkwin) {
+ resultObj = Tk_GetOptionValue(interp,
+ (char *) pwPtr->slaves[i], pwPtr->slaveOpts,
+ objv[3], tkwin);
+ }
+ }
+ if (i == pwPtr->numSlaves) {
+ Tcl_SetResult(interp, "not managed by this window",
+ TCL_STATIC);
+ }
+ if (resultObj == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, resultObj);
+ }
+ break;
+ }
+
+ case PW_PANECONFIGURE: {
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "pane ?option? ?value option value ...?");
+ result = TCL_ERROR;
+ break;
+ }
+ resultObj = NULL;
+ if (objc <= 4) {
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ pwPtr->tkwin);
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ if (pwPtr->slaves[i]->tkwin == tkwin) {
+ resultObj = Tk_GetOptionInfo(interp,
+ (char *) pwPtr->slaves[i],
+ pwPtr->slaveOpts,
+ (objc == 4) ? objv[3] : (Tcl_Obj *) NULL,
+ pwPtr->tkwin);
+ if (resultObj == NULL) {
+ result = TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, resultObj);
+ }
+ break;
+ }
+ }
+ } else {
+ result = ConfigureSlaves(pwPtr, interp, objc, objv);
+ }
+ break;
+ }
+
+ case PW_PANES: {
+ resultObj = Tcl_NewObj();
+
+ Tcl_IncrRefCount(resultObj);
+
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ Tcl_ListObjAppendElement(interp, resultObj,
+ Tcl_NewStringObj(Tk_PathName(pwPtr->slaves[i]->tkwin),
+ -1));
+ }
+ Tcl_SetObjResult(interp, resultObj);
+ Tcl_DecrRefCount(resultObj);
+ break;
+ }
+
+ case PW_PROXY: {
+ result = PanedWindowProxyCommand(pwPtr, interp, objc, objv);
+ break;
+ }
+
+ case PW_SASH: {
+ result = PanedWindowSashCommand(pwPtr, interp, objc, objv);
+ break;
+ }
+ }
+ Tcl_Release((ClientData) pwPtr);
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ConfigureSlaves --
+ *
+ * Add or alter the configuration options of a slave in a paned
+ * window.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Depends on options; may add a slave to the paned window, may
+ * alter the geometry management options of a slave.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ConfigureSlaves(pwPtr, interp, objc, objv)
+ PanedWindow *pwPtr; /* Information about paned window. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj * CONST objv[]; /* Argument objects. */
+{
+ int i, firstOptionArg, j, found, doubleBw, index, numNewSlaves, haveLoc;
+ int insertIndex;
+ Tk_Window tkwin = NULL, ancestor, parent;
+ Slave *slavePtr, **inserts, **new;
+ Slave options;
+ char *arg;
+
+ /*
+ * Find the non-window name arguments; these are the configure options
+ * for the slaves. Also validate that the window names given are
+ * legitimate (ie, they are real windows, they are not the panedwindow
+ * itself, etc.).
+ */
+ for (i = 2; i < objc; i++) {
+ arg = Tcl_GetString(objv[i]);
+ if (arg[0] == '-') {
+ break;
+ } else {
+ tkwin = Tk_NameToWindow(interp, arg, pwPtr->tkwin);
+ if (tkwin == NULL) {
+ /*
+ * Just a plain old bad window; Tk_NameToWindow filled in an
+ * error message for us.
+ */
+ return TCL_ERROR;
+ } else if (tkwin == pwPtr->tkwin) {
+ /*
+ * A panedwindow cannot manage itself.
+ */
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "can't add ", arg, " to itself",
+ (char *) NULL);
+ return TCL_ERROR;
+ } else if (Tk_IsTopLevel(tkwin)) {
+ /*
+ * A panedwindow cannot manage a toplevel.
+ */
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "can't add toplevel ", arg, " to ",
+ Tk_PathName(pwPtr->tkwin), (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ /*
+ * Make sure the panedwindow is the parent of the slave,
+ * or a descendant of the slave's parent.
+ */
+ parent = Tk_Parent(tkwin);
+ for (ancestor = pwPtr->tkwin;;ancestor = Tk_Parent(ancestor)) {
+ if (ancestor == parent) {
+ break;
+ }
+ if (Tk_IsTopLevel(ancestor)) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "can't add ", arg,
+ " to ", Tk_PathName(pwPtr->tkwin),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ }
+ }
+ }
+ }
+ firstOptionArg = i;
+
+ /*
+ * Pre-parse the configuration options, to get the before/after specifiers
+ * into an easy-to-find location (a local variable). Also, check the
+ * return from Tk_SetOptions once, here, so we can save a little bit of
+ * extra testing in the for loop below.
+ */
+ memset((void *)&options, 0, sizeof(Slave));
+ if (Tk_SetOptions(interp, (char *) &options, pwPtr->slaveOpts,
+ objc - firstOptionArg, objv + firstOptionArg,
+ pwPtr->tkwin, NULL, NULL) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ /*
+ * If either -after or -before was given, find the numerical index that
+ * corresponds to the given window. If both -after and -before are
+ * given, the option precedence is: -after, then -before.
+ */
+ index = -1;
+ haveLoc = 0;
+ if (options.after != None) {
+ tkwin = options.after;
+ haveLoc = 1;
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ if (options.after == pwPtr->slaves[i]->tkwin) {
+ index = i + 1;
+ break;
+ }
+ }
+ } else if (options.before != None) {
+ tkwin = options.before;
+ haveLoc = 1;
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ if (options.before == pwPtr->slaves[i]->tkwin) {
+ index = i;
+ break;
+ }
+ }
+ }
+
+ /*
+ * If a window was given for -after/-before, but it's not a window
+ * managed by the panedwindow, throw an error
+ */
+ if (haveLoc && index == -1) {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "window \"", Tk_PathName(tkwin),
+ "\" is not managed by ", Tk_PathName(pwPtr->tkwin),
+ (char *) NULL);
+ Tk_FreeConfigOptions((char *) &options, pwPtr->slaveOpts,
+ pwPtr->tkwin);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Allocate an array to hold, in order, the pointers to the slave
+ * structures corresponding to the windows specified. Some of those
+ * structures may already have existed, some may be new.
+ */
+ inserts = (Slave **)ckalloc(sizeof(Slave *) * (firstOptionArg - 2));
+ insertIndex = 0;
+
+ /*
+ * Populate the inserts array, creating new slave structures as necessary,
+ * applying the options to each structure as we go, and, if necessary,
+ * marking the spot in the original slaves array as empty (for pre-existing
+ * slave structures).
+ */
+ for (i = 0, numNewSlaves = 0; i < firstOptionArg - 2; i++) {
+ /*
+ * We don't check that tkwin is NULL here, because the pre-pass above
+ * guarantees that the input at this stage is good.
+ */
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[i + 2]),
+ pwPtr->tkwin);
+
+ found = 0;
+ for (j = 0; j < pwPtr->numSlaves; j++) {
+ if (pwPtr->slaves[j] != NULL && pwPtr->slaves[j]->tkwin == tkwin) {
+ Tk_SetOptions(interp, (char *) pwPtr->slaves[j],
+ pwPtr->slaveOpts, objc - firstOptionArg,
+ objv + firstOptionArg, pwPtr->tkwin, NULL, NULL);
+ found = 1;
+
+ /*
+ * If the slave is supposed to move, add it to the inserts
+ * array now; otherwise, leave it where it is.
+ */
+
+ if (index != -1) {
+ inserts[insertIndex++] = pwPtr->slaves[j];
+ pwPtr->slaves[j] = NULL;
+ }
+ break;
+ }
+ }
+
+ if (found) {
+ continue;
+ }
+
+ /*
+ * Make sure this slave wasn't already put into the inserts array,
+ * ie, when the user specifies the same window multiple times in
+ * a single add commaned.
+ */
+ for (j = 0; j < insertIndex; j++) {
+ if (inserts[j]->tkwin == tkwin) {
+ found = 1;
+ break;
+ }
+ }
+ if (found) {
+ continue;
+ }
+
+ /*
+ * Create a new slave structure and initialize it. All slaves
+ * start out with their "natural" dimensions.
+ */
+
+ slavePtr = (Slave *) ckalloc(sizeof(Slave));
+ memset(slavePtr, 0, sizeof(Slave));
+ Tk_InitOptions(interp, (char *)slavePtr, pwPtr->slaveOpts,
+ pwPtr->tkwin);
+ Tk_SetOptions(interp, (char *)slavePtr, pwPtr->slaveOpts,
+ objc - firstOptionArg, objv + firstOptionArg,
+ pwPtr->tkwin, NULL, NULL);
+ slavePtr->tkwin = tkwin;
+ slavePtr->masterPtr = pwPtr;
+ doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width;
+ if (slavePtr->width > 0) {
+ slavePtr->paneWidth = slavePtr->width;
+ } else {
+ slavePtr->paneWidth = Tk_ReqWidth(tkwin) + doubleBw;
+ }
+ if (slavePtr->height > 0) {
+ slavePtr->paneHeight = slavePtr->height;
+ } else {
+ slavePtr->paneHeight = Tk_ReqHeight(tkwin) + doubleBw;
+ }
+
+ /*
+ * Set up the geometry management callbacks for this slave.
+ */
+
+ Tk_CreateEventHandler(slavePtr->tkwin, StructureNotifyMask,
+ SlaveStructureProc, (ClientData) slavePtr);
+ Tk_ManageGeometry(slavePtr->tkwin, &panedWindowMgrType,
+ (ClientData) slavePtr);
+ inserts[insertIndex++] = slavePtr;
+ numNewSlaves++;
+ }
+
+ /*
+ * Allocate the new slaves array, then copy the slaves into it, in
+ * order.
+ */
+ i = sizeof(Slave *) * (pwPtr->numSlaves+numNewSlaves);
+ new = (Slave **)ckalloc((unsigned) i);
+ memset(new, 0, (size_t) i);
+ if (index == -1) {
+ /*
+ * If none of the existing slaves have to be moved, just copy the old
+ * and append the new.
+ */
+ memcpy((void *)&(new[0]), pwPtr->slaves,
+ sizeof(Slave *) * pwPtr->numSlaves);
+ memcpy((void *)&(new[pwPtr->numSlaves]), inserts,
+ sizeof(Slave *) * numNewSlaves);
+ } else {
+ /*
+ * If some of the existing slaves were moved, the old slaves array
+ * will be partially populated, with some valid and some invalid
+ * entries. Walk through it, copying valid entries to the new slaves
+ * array as we go; when we get to the insert location for the new
+ * slaves, copy the inserts array over, then finish off the old slaves
+ * array.
+ */
+ for (i = 0, j = 0; i < index; i++) {
+ if (pwPtr->slaves[i] != NULL) {
+ new[j] = pwPtr->slaves[i];
+ j++;
+ }
+ }
+
+ memcpy((void *)&(new[j]), inserts, sizeof(Slave *) * (insertIndex));
+ j += firstOptionArg - 2;
+
+ for (i = index; i < pwPtr->numSlaves; i++) {
+ if (pwPtr->slaves[i] != NULL) {
+ new[j] = pwPtr->slaves[i];
+ j++;
+ }
+ }
+ }
+
+ /*
+ * Make the new slaves array the paned window's slave array, and clean up.
+ */
+ ckfree((void *)pwPtr->slaves);
+ ckfree((void *)inserts);
+ pwPtr->slaves = new;
+
+ /*
+ * Set the paned window's slave count to the new value.
+ */
+ pwPtr->numSlaves += numNewSlaves;
+
+ Tk_FreeConfigOptions((char *) &options, pwPtr->slaveOpts, pwPtr->tkwin);
+
+ ComputeGeometry(pwPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PanedWindowSashCommand --
+ *
+ * Implementation of the panedwindow sash subcommand. See the user
+ * documentation for details on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Depends on the arguments.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+PanedWindowSashCommand(pwPtr, interp, objc, objv)
+ PanedWindow *pwPtr; /* Pointer to paned window information. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj * CONST objv[]; /* Argument objects. */
+{
+ static CONST char *sashOptionStrings[] = { "coord", "dragto", "mark",
+ "place", (char *) NULL };
+ enum sashOptions { SASH_COORD, SASH_DRAGTO, SASH_MARK, SASH_PLACE };
+ int index, sash, x, y, diff;
+ Tcl_Obj *coords[2];
+ Slave *slavePtr;
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[2], sashOptionStrings,
+ "option", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ Tcl_ResetResult(interp);
+ switch ((enum sashOptions) index) {
+ case SASH_COORD: {
+ if (objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (!ValidSashIndex(pwPtr, sash)) {
+ Tcl_ResetResult(interp);
+ Tcl_SetResult(interp, "invalid sash index", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ slavePtr = pwPtr->slaves[sash];
+
+ coords[0] = Tcl_NewIntObj(slavePtr->sashx);
+ coords[1] = Tcl_NewIntObj(slavePtr->sashy);
+ Tcl_SetListObj(Tcl_GetObjResult(interp), 2, coords);
+ break;
+ }
+
+ case SASH_MARK: {
+ if (objc != 6 && objc != 4) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index ?x y?");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (!ValidSashIndex(pwPtr, sash)) {
+ Tcl_ResetResult(interp);
+ Tcl_SetResult(interp, "invalid sash index", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (objc == 6) {
+ if (Tcl_GetIntFromObj(interp, objv[4], &x) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[5], &y) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ pwPtr->slaves[sash]->markx = x;
+ pwPtr->slaves[sash]->marky = y;
+ } else {
+ coords[0] = Tcl_NewIntObj(pwPtr->slaves[sash]->markx);
+ coords[1] = Tcl_NewIntObj(pwPtr->slaves[sash]->marky);
+ Tcl_SetListObj(Tcl_GetObjResult(interp), 2, coords);
+ }
+
+ break;
+ }
+
+ case SASH_DRAGTO:
+ case SASH_PLACE: {
+ if (objc != 6) {
+ Tcl_WrongNumArgs(interp, 3, objv, "index x y");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[3], &sash) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (!ValidSashIndex(pwPtr, sash)) {
+ Tcl_ResetResult(interp);
+ Tcl_SetResult(interp, "invalid sash index", TCL_STATIC);
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[4], &x) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[5], &y) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ slavePtr = pwPtr->slaves[sash];
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ if (index == SASH_PLACE) {
+ diff = x - pwPtr->slaves[sash]->sashx;
+ } else {
+ diff = x - pwPtr->slaves[sash]->markx;
+ }
+ } else {
+ if (index == SASH_PLACE) {
+ diff = y - pwPtr->slaves[sash]->sashy;
+ } else {
+ diff = y - pwPtr->slaves[sash]->marky;
+ }
+ }
+
+ MoveSash(pwPtr, sash, diff);
+ ComputeGeometry(pwPtr);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ConfigurePanedWindow --
+ *
+ * This procedure is called to process an argv/argc list in
+ * conjunction with the Tk option database to configure (or
+ * reconfigure) a paned window widget.
+ *
+ * Results:
+ * The return value is a standard Tcl result. If TCL_ERROR is
+ * returned, then the interp's result contains an error message.
+ *
+ * Side effects:
+ * Configuration information, such as colors, border width,
+ * etc. get set for pwPtr; old resources get freed,
+ * if there were any.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ConfigurePanedWindow(interp, pwPtr, objc, objv)
+ Tcl_Interp *interp; /* Used for error reporting. */
+ PanedWindow *pwPtr; /* Information about widget. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument values. */
+{
+ Tk_SavedOptions savedOptions;
+ int typemask = 0;
+
+ if (Tk_SetOptions(interp, (char *) pwPtr, pwPtr->optionTable, objc, objv,
+ pwPtr->tkwin, &savedOptions, &typemask) != TCL_OK) {
+ Tk_RestoreSavedOptions(&savedOptions);
+ return TCL_ERROR;
+ }
+
+ Tk_FreeSavedOptions(&savedOptions);
+
+ PanedWindowWorldChanged((ClientData) pwPtr);
+
+ /*
+ * If an option that affects geometry has changed, make a relayout
+ * request.
+ */
+
+ if (typemask & GEOMETRY) {
+ ComputeGeometry(pwPtr);
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PanedWindowWorldChanged --
+ *
+ * This procedure is invoked anytime a paned window's world has
+ * changed in some way that causes the widget to have to recompute
+ * graphics contexts and geometry.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Paned window will be relayed out and redisplayed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+PanedWindowWorldChanged(instanceData)
+ ClientData instanceData; /* Information about the paned window. */
+{
+ XGCValues gcValues;
+ GC newGC;
+ PanedWindow *pwPtr = (PanedWindow *) instanceData;
+
+ /*
+ * Allocated a graphics context for drawing the paned window widget
+ * elements (background, sashes, etc.).
+ */
+
+ gcValues.background = Tk_3DBorderColor(pwPtr->background)->pixel;
+ newGC = Tk_GetGC(pwPtr->tkwin, GCBackground, &gcValues);
+ if (pwPtr->gc != None) {
+ Tk_FreeGC(pwPtr->display, pwPtr->gc);
+ }
+ pwPtr->gc = newGC;
+
+ /*
+ * Issue geometry size requests to Tk.
+ */
+
+ Tk_SetInternalBorder(pwPtr->tkwin, pwPtr->borderWidth);
+ if (pwPtr->width > 0 || pwPtr->height > 0) {
+ Tk_GeometryRequest(pwPtr->tkwin, pwPtr->width, pwPtr->height);
+ }
+
+ /*
+ * Arrange for the window to be redrawn, if neccessary.
+ */
+
+ if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr);
+ pwPtr->flags |= REDRAW_PENDING;
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * PanedWindowEventProc --
+ *
+ * This procedure is invoked by the Tk dispatcher for various
+ * events on paned windows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * When the window gets deleted, internal structures get
+ * cleaned up. When it gets exposed, it is redisplayed.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+PanedWindowEventProc(clientData, eventPtr)
+ ClientData clientData; /* Information about window. */
+ XEvent *eventPtr; /* Information about event. */
+{
+ PanedWindow *pwPtr = (PanedWindow *) clientData;
+
+ if (eventPtr->type == Expose) {
+ if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr);
+ pwPtr->flags |= REDRAW_PENDING;
+ }
+ } else if (eventPtr->type == ConfigureNotify) {
+ pwPtr->flags |= REQUESTED_RELAYOUT;
+ if (pwPtr->tkwin != NULL && !(pwPtr->flags & REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr);
+ pwPtr->flags |= REDRAW_PENDING;
+ }
+ } else if (eventPtr->type == DestroyNotify) {
+ DestroyPanedWindow(pwPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PanedWindowCmdDeletedProc --
+ *
+ * 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
+PanedWindowCmdDeletedProc(clientData)
+ ClientData clientData; /* Pointer to widget record for widget. */
+{
+ PanedWindow *pwPtr = (PanedWindow *) clientData;
+
+ /*
+ * This procedure could be invoked either because the window was
+ * destroyed and the command was then deleted or because the command was
+ * deleted, and then this procedure destroys the widget. The
+ * WIDGET_DELETED flag distinguishes these cases.
+ */
+
+ if (!(pwPtr->flags & WIDGET_DELETED)) {
+ Tk_DestroyWindow(pwPtr->tkwin);
+ Tk_DestroyWindow(pwPtr->proxywin);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * DisplayPanedWindow --
+ *
+ * This procedure redraws the contents of a paned window widget.
+ * 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
+DisplayPanedWindow(clientData)
+ ClientData clientData; /* Information about window. */
+{
+ PanedWindow *pwPtr = (PanedWindow *) clientData;
+ Pixmap pixmap;
+ Tk_Window tkwin = pwPtr->tkwin;
+ int i, sashWidth, sashHeight;
+
+ pwPtr->flags &= ~REDRAW_PENDING;
+ if ((pwPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ return;
+ }
+
+ if (pwPtr->flags & REQUESTED_RELAYOUT) {
+ ArrangePanes(clientData);
+ }
+
+ /*
+ * Create a pixmap for double-buffering, if necessary.
+ */
+
+ pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin),
+ Tk_Width(tkwin), Tk_Height(tkwin),
+ DefaultDepthOfScreen(Tk_Screen(tkwin)));
+
+ /*
+ * Redraw the widget's background and border.
+ */
+ Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin), pwPtr->borderWidth,
+ pwPtr->relief);
+
+ /*
+ * Set up boilerplate geometry values for sashes (width, height, common
+ * coordinates).
+ */
+
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ sashHeight = Tk_Height(tkwin) - (2 * Tk_InternalBorderWidth(tkwin));
+ sashWidth = pwPtr->sashWidth;
+ } else {
+ sashWidth = Tk_Width(tkwin) - (2 * Tk_InternalBorderWidth(tkwin));
+ sashHeight = pwPtr->sashWidth;
+ }
+
+ /*
+ * Draw the sashes.
+ */
+ for (i = 0; i < pwPtr->numSlaves - 1; i++) {
+ Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background,
+ pwPtr->slaves[i]->sashx, pwPtr->slaves[i]->sashy,
+ sashWidth, sashHeight, 1, pwPtr->sashRelief);
+
+ if (pwPtr->showHandle) {
+ Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background,
+ pwPtr->slaves[i]->handlex, pwPtr->slaves[i]->handley,
+ pwPtr->handleSize, pwPtr->handleSize, 1,
+ TK_RELIEF_RAISED);
+ }
+ }
+
+ /*
+ * Copy the information from the off-screen pixmap onto the screen,
+ * then delete the pixmap.
+ */
+
+ XCopyArea(Tk_Display(tkwin), pixmap, Tk_WindowId(tkwin), pwPtr->gc,
+ 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin),
+ 0, 0);
+ Tk_FreePixmap(Tk_Display(tkwin), pixmap);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DestroyPanedWindow --
+ *
+ * This procedure is invoked by PanedWindowEventProc to free the
+ * internal structure of a paned window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Everything associated with the paned window is freed up.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DestroyPanedWindow(pwPtr)
+ PanedWindow *pwPtr; /* Info about paned window widget. */
+{
+ int i;
+
+ /*
+ * First mark the widget as in the process of being deleted,
+ * so that any code that causes calls to other paned window procedures
+ * will abort.
+ */
+
+ pwPtr->flags |= WIDGET_DELETED;
+
+ /*
+ * Cancel idle callbacks for redrawing the widget and for rearranging
+ * the panes.
+ */
+ if (pwPtr->flags & REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DisplayPanedWindow, (ClientData) pwPtr);
+ }
+ if (pwPtr->flags & RESIZE_PENDING) {
+ Tcl_CancelIdleCall(ArrangePanes, (ClientData) pwPtr);
+ }
+
+ /*
+ * Clean up the slave list; foreach slave:
+ * o Cancel the slave's structure notification callback
+ * o Cancel geometry management for the slave.
+ * o Free memory for the slave
+ */
+
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ Tk_DeleteEventHandler(pwPtr->slaves[i]->tkwin, StructureNotifyMask,
+ SlaveStructureProc, (ClientData) pwPtr->slaves[i]);
+ Tk_ManageGeometry(pwPtr->slaves[i]->tkwin, NULL, NULL);
+ Tk_FreeConfigOptions((char *)pwPtr->slaves[i], pwPtr->slaveOpts,
+ pwPtr->tkwin);
+ ckfree((void *)pwPtr->slaves[i]);
+ pwPtr->slaves[i] = NULL;
+ }
+ if (pwPtr->slaves) {
+ ckfree((char *) pwPtr->slaves);
+ }
+
+ /*
+ * Remove the widget command from the interpreter.
+ */
+
+ Tcl_DeleteCommandFromToken(pwPtr->interp, pwPtr->widgetCmd);
+
+ /*
+ * Let Tk_FreeConfigOptions clean up the rest.
+ */
+
+ Tk_FreeConfigOptions((char *) pwPtr, pwPtr->optionTable, pwPtr->tkwin);
+ pwPtr->tkwin = NULL;
+
+ Tcl_EventuallyFree((ClientData) pwPtr, TCL_DYNAMIC);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * PanedWindowReqProc --
+ *
+ * This procedure is invoked by Tk_GeometryRequest for
+ * windows managed by a paned window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Arranges for tkwin, and all its managed siblings, to
+ * be re-arranged at the next idle point.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+PanedWindowReqProc(clientData, tkwin)
+ ClientData clientData; /* Paned window's information about
+ * window that got new preferred
+ * geometry. */
+ Tk_Window tkwin; /* Other Tk-related information
+ * about the window. */
+{
+ Slave *panePtr = (Slave *) clientData;
+ PanedWindow *pwPtr = (PanedWindow *) (panePtr->masterPtr);
+ if (Tk_IsMapped(pwPtr->tkwin)) {
+ if (!(pwPtr->flags & RESIZE_PENDING)) {
+ pwPtr->flags |= RESIZE_PENDING;
+ Tcl_DoWhenIdle(ArrangePanes, (ClientData) pwPtr);
+ }
+ } else {
+ ComputeGeometry(pwPtr);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * PanedWindowLostSlaveProc --
+ *
+ * This procedure is invoked by Tk whenever some other geometry
+ * claims control over a slave that used to be managed by us.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Forgets all information about the slave. Causes geometry to
+ * be recomputed for the panedwindow.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+PanedWindowLostSlaveProc(clientData, tkwin)
+ ClientData clientData; /* Grid structure for slave window that
+ * was stolen away. */
+ Tk_Window tkwin; /* Tk's handle for the slave window. */
+{
+ register Slave *slavePtr = (Slave *) clientData;
+ PanedWindow *pwPtr = (PanedWindow *) (slavePtr->masterPtr);
+ if (pwPtr->tkwin != Tk_Parent(slavePtr->tkwin)) {
+ Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin);
+ }
+ Unlink(slavePtr);
+ Tk_DeleteEventHandler(slavePtr->tkwin, StructureNotifyMask,
+ SlaveStructureProc, (ClientData) slavePtr);
+ Tk_UnmapWindow(slavePtr->tkwin);
+ slavePtr->tkwin = NULL;
+ ckfree((void *)slavePtr);
+ ComputeGeometry(pwPtr);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ArrangePanes --
+ *
+ * This procedure is invoked (using the Tcl_DoWhenIdle
+ * mechanism) to re-layout a set of windows managed by
+ * a paned window. It is invoked at idle time so that a
+ * series of pane requests can be merged into a single
+ * layout operation.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The slaves of masterPtr may get resized or moved.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+ArrangePanes(clientData)
+ ClientData clientData; /* Structure describing parent whose slaves
+ * are to be re-layed out. */
+{
+ register PanedWindow *pwPtr = (PanedWindow *) clientData;
+ register Slave *slavePtr;
+ int i, slaveWidth, slaveHeight, slaveX, slaveY, paneWidth, paneHeight;
+ int doubleBw;
+
+ pwPtr->flags &= ~(REQUESTED_RELAYOUT|RESIZE_PENDING);
+
+ /*
+ * If the parent has no slaves anymore, then don't do anything
+ * at all: just leave the parent's size as-is. Otherwise there is
+ * no way to "relinquish" control over the parent so another geometry
+ * manager can take over.
+ */
+
+ if (pwPtr->numSlaves == 0) {
+ return;
+ }
+
+ Tcl_Preserve((ClientData) pwPtr);
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ slavePtr = pwPtr->slaves[i];
+
+ /*
+ * Compute the size of this slave. The algorithm (assuming a
+ * horizontal paned window) is:
+ *
+ * 1. Get "base" dimensions. If a width or height is specified
+ * for this slave, use those values; else use the
+ * ReqWidth/ReqHeight.
+ * 2. Using base dimensions, pane dimensions, and sticky values,
+ * determine the x and y, and actual width and height of the
+ * widget.
+ */
+
+ doubleBw = 2 * Tk_Changes(slavePtr->tkwin)->border_width;
+ slaveWidth = (slavePtr->width > 0 ? slavePtr->width :
+ Tk_ReqWidth(slavePtr->tkwin) + doubleBw);
+ slaveHeight = (slavePtr->height > 0 ? slavePtr->height :
+ Tk_ReqHeight(slavePtr->tkwin) + doubleBw);
+
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ paneWidth = slavePtr->paneWidth;
+ if (i == pwPtr->numSlaves - 1 && Tk_IsMapped(pwPtr->tkwin)) {
+ if (Tk_Width(pwPtr->tkwin) > Tk_ReqWidth(pwPtr->tkwin)) {
+ paneWidth += Tk_Width(pwPtr->tkwin) -
+ Tk_ReqWidth(pwPtr->tkwin) -
+ Tk_InternalBorderWidth(pwPtr->tkwin);
+ }
+ }
+ paneHeight = Tk_Height(pwPtr->tkwin) - (2 * slavePtr->pady) -
+ (2 * Tk_InternalBorderWidth(pwPtr->tkwin));
+ } else {
+ paneHeight = slavePtr->paneHeight;
+ if (i == pwPtr->numSlaves - 1 && Tk_IsMapped(pwPtr->tkwin)) {
+ if (Tk_Height(pwPtr->tkwin) > Tk_ReqHeight(pwPtr->tkwin)) {
+ paneHeight += Tk_Height(pwPtr->tkwin) -
+ Tk_ReqHeight(pwPtr->tkwin) -
+ Tk_InternalBorderWidth(pwPtr->tkwin);
+ }
+ }
+ paneWidth = Tk_Width(pwPtr->tkwin) - (2 * slavePtr->padx) -
+ (2 * Tk_InternalBorderWidth(pwPtr->tkwin));
+ }
+
+ if (slaveWidth > paneWidth) {
+ slaveWidth = paneWidth;
+ }
+ if (slaveHeight > paneHeight) {
+ slaveHeight = paneHeight;
+ }
+
+ slaveX = slavePtr->x;
+ slaveY = slavePtr->y;
+ AdjustForSticky(slavePtr->sticky, paneWidth, paneHeight,
+ &slaveX, &slaveY, &slaveWidth, &slaveHeight);
+
+ slaveX += slavePtr->padx;
+ slaveY += slavePtr->pady;
+
+ /*
+ * Now put the window in the proper spot.
+ */
+ if ((slaveWidth <= 0) || (slaveHeight <= 0)) {
+ Tk_UnmaintainGeometry(slavePtr->tkwin, pwPtr->tkwin);
+ Tk_UnmapWindow(slavePtr->tkwin);
+ } else {
+ Tk_MaintainGeometry(slavePtr->tkwin, pwPtr->tkwin,
+ slaveX, slaveY, slaveWidth, slaveHeight);
+ }
+ }
+ Tcl_Release((ClientData) pwPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Unlink --
+ *
+ * Remove a slave from a paned window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The paned window will be scheduled for re-arranging and redrawing.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+Unlink(slavePtr)
+ register Slave *slavePtr; /* Window to unlink. */
+{
+ register PanedWindow *masterPtr;
+ int i, j;
+
+ masterPtr = slavePtr->masterPtr;
+ if (masterPtr == NULL) {
+ return;
+ }
+
+ /*
+ * Find the specified slave in the panedwindow's list of slaves, then
+ * remove it from that list.
+ */
+
+ for (i = 0; i < masterPtr->numSlaves; i++) {
+ if (masterPtr->slaves[i] == slavePtr) {
+ for (j = i; j < masterPtr->numSlaves - 1; j++) {
+ masterPtr->slaves[j] = masterPtr->slaves[j + 1];
+ }
+ break;
+ }
+ }
+
+ masterPtr->flags |= REQUESTED_RELAYOUT;
+ if (!(masterPtr->flags & REDRAW_PENDING)) {
+ masterPtr->flags |= REDRAW_PENDING;
+ Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) masterPtr);
+ }
+
+ /*
+ * Set the slave's masterPtr to NULL, so that we can tell that the
+ * slave is no longer attached to any panedwindow.
+ */
+ slavePtr->masterPtr = NULL;
+
+ masterPtr->numSlaves--;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetPane --
+ *
+ * Given a token to a Tk window, find the pane that corresponds to
+ * that token in a given paned window.
+ *
+ * Results:
+ * Pointer to the slave structure, or NULL if the window is not
+ * managed by this paned window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Slave *
+GetPane(pwPtr, tkwin)
+ PanedWindow *pwPtr; /* Pointer to the paned window info. */
+ Tk_Window tkwin; /* Window to search for. */
+{
+ int i;
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ if (pwPtr->slaves[i]->tkwin == tkwin) {
+ return pwPtr->slaves[i];
+ }
+ }
+ return NULL;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SlaveStructureProc --
+ *
+ * This procedure is invoked whenever StructureNotify events
+ * occur for a window that's managed by a paned window. This
+ * procedure's only purpose is to clean up when windows are
+ * deleted.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The paned window slave structure associated with the window
+ * is freed, and the slave is disassociated from the paned
+ * window which managed it.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+SlaveStructureProc(clientData, eventPtr)
+ ClientData clientData; /* Pointer to record describing window item. */
+ XEvent *eventPtr; /* Describes what just happened. */
+{
+ Slave *slavePtr = (Slave *) clientData;
+ PanedWindow *pwPtr = slavePtr->masterPtr;
+
+ if (eventPtr->type == DestroyNotify) {
+ Unlink(slavePtr);
+ slavePtr->tkwin = NULL;
+ ckfree((void *)slavePtr);
+ ComputeGeometry(pwPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ComputeGeometry --
+ *
+ * Compute geometry for the paned window, including coordinates of
+ * all slave windows and each sash.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Recomputes geometry information for a paned window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ComputeGeometry(pwPtr)
+ PanedWindow *pwPtr; /* Pointer to the Paned Window structure. */
+{
+ int i, x, y, doubleBw, internalBw;
+ int reqWidth, reqHeight, sashWidth, sxOff, syOff, hxOff, hyOff, dim;
+ Slave *slavePtr;
+
+ pwPtr->flags |= REQUESTED_RELAYOUT;
+
+ x = y = internalBw = Tk_InternalBorderWidth(pwPtr->tkwin);
+ reqWidth = reqHeight = 0;
+
+ /*
+ * Sashes and handles share space on the display. To simplify
+ * processing below, precompute the x and y offsets of the handles and
+ * sashes within the space occupied by their combination; later, just add
+ * those offsets blindly (avoiding the extra showHandle, etc, checks).
+ */
+ sxOff = syOff = hxOff = hyOff = 0;
+ if (pwPtr->showHandle && pwPtr->handleSize > pwPtr->sashWidth) {
+ sashWidth = pwPtr->handleSize;
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ sxOff = (pwPtr->handleSize - pwPtr->sashWidth) / 2;
+ hyOff = pwPtr->handlePad;
+ } else {
+ syOff = (pwPtr->handleSize - pwPtr->sashWidth) / 2;
+ hxOff = pwPtr->handlePad;
+ }
+ } else {
+ sashWidth = pwPtr->sashWidth;
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ hxOff = (pwPtr->handleSize - pwPtr->sashWidth) / 2;
+ hyOff = pwPtr->handlePad;
+ } else {
+ hyOff = (pwPtr->handleSize - pwPtr->sashWidth) / 2;
+ hxOff = pwPtr->handlePad;
+ }
+ }
+
+ for (i = 0; i < pwPtr->numSlaves; i++) {
+ slavePtr = pwPtr->slaves[i];
+ /*
+ * First set the coordinates for the top left corner of the slave's
+ * parcel.
+ */
+ slavePtr->x = x;
+ slavePtr->y = y;
+
+ /*
+ * Make sure the pane's paned dimension is at least minsize.
+ * This check may be redundant, since the only way to change a pane's
+ * size is by moving a sash, and that code checks the minsize.
+ */
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ if (slavePtr->paneWidth < slavePtr->minSize) {
+ slavePtr->paneWidth = slavePtr->minSize;
+ }
+ } else {
+ if (slavePtr->paneHeight < slavePtr->minSize) {
+ slavePtr->paneHeight = slavePtr->minSize;
+ }
+ }
+
+ /*
+ * Compute the location of the sash at the right or bottom of the
+ * parcel.
+ */
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ x += slavePtr->paneWidth + (2 * slavePtr->padx) + pwPtr->sashPad;
+ } else {
+ y += slavePtr->paneHeight + (2 * slavePtr->pady) + pwPtr->sashPad;
+ }
+ slavePtr->sashx = x + sxOff;
+ slavePtr->sashy = y + syOff;
+ slavePtr->handlex = x + hxOff;
+ slavePtr->handley = y + hyOff;
+
+ /*
+ * Compute the location of the next parcel.
+ */
+
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ x += sashWidth + pwPtr->sashPad;
+ } else {
+ y += sashWidth + pwPtr->sashPad;
+ }
+
+ /*
+ * Find the maximum height/width of the slaves, for computing the
+ * requested height/width of the paned window.
+ */
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ /*
+ * If the slave has an explicit height set, use that; otherwise,
+ * use the slave's requested height.
+ */
+ if (slavePtr->height > 0) {
+ dim = slavePtr->height;
+ } else {
+ doubleBw = (2 * Tk_Changes(slavePtr->tkwin)->border_width);
+ dim = Tk_ReqHeight(slavePtr->tkwin) + doubleBw;
+ }
+ dim += (2 * slavePtr->pady);
+ if (dim > reqHeight) {
+ reqHeight = dim;
+ }
+ } else {
+ /*
+ * If the slave has an explicit width set use that; otherwise,
+ * use the slave's requested width.
+ */
+ if (slavePtr->width > 0) {
+ dim = slavePtr->width;
+ } else {
+ doubleBw = (2 * Tk_Changes(slavePtr->tkwin)->border_width);
+ dim = Tk_ReqWidth(slavePtr->tkwin) + doubleBw;
+ }
+ dim += (2 * slavePtr->padx);
+ if (dim > reqWidth) {
+ reqWidth = dim;
+ }
+ }
+ }
+
+ /*
+ * The loop above should have left x (or y) equal to the sum of the
+ * widths (or heights) of the widgets, plus the size of one sash and
+ * the sash padding for each widget, plus the width of the left (or top)
+ * border of the paned window.
+ *
+ * The requested width (or height) is therefore x (or y) minus the size of
+ * one sash and padding, plus the width of the right (or bottom) border
+ * of the paned window.
+ *
+ * The height (or width) is equal to the maximum height (or width) of
+ * the slaves, plus the width of the border of the top and bottom (or left
+ * and right) of the paned window.
+ */
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ reqWidth = x - (sashWidth + (2 * pwPtr->sashPad)) + internalBw;
+ reqHeight += 2 * internalBw;
+ } else {
+ reqHeight = y - (sashWidth + (2 * pwPtr->sashPad)) + internalBw;
+ reqWidth += 2 * internalBw;
+ }
+ if (pwPtr->width <= 0 && pwPtr->height <= 0) {
+ Tk_GeometryRequest(pwPtr->tkwin, reqWidth, reqHeight);
+ }
+ if (Tk_IsMapped(pwPtr->tkwin) && !(pwPtr->flags & REDRAW_PENDING)) {
+ pwPtr->flags |= REDRAW_PENDING;
+ Tcl_DoWhenIdle(DisplayPanedWindow, (ClientData) pwPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DestroyOptionTables --
+ *
+ * This procedure is registered as an exit callback when the paned window
+ * command is first called. It cleans up the OptionTables structure
+ * allocated by that command.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Frees memory.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DestroyOptionTables(clientData, interp)
+ ClientData clientData; /* Pointer to the OptionTables struct */
+ Tcl_Interp *interp; /* Pointer to the calling interp */
+{
+ ckfree((char *)clientData);
+ return;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetSticky -
+ *
+ * Converts an internal boolean combination of "sticky" bits into a
+ * a Tcl string obj containing zero or mor of n, s, e, or w.
+ *
+ * Results:
+ * Tcl_Obj containing the string representation of the sticky value.
+ *
+ * Side effects:
+ * Creates a new Tcl_Obj.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Tcl_Obj *
+GetSticky(clientData, tkwin, recordPtr, internalOffset)
+ ClientData clientData;
+ Tk_Window tkwin;
+ char *recordPtr; /* Pointer to widget record. */
+ int internalOffset; /* Offset within *recordPtr containing the
+ * sticky value. */
+{
+ int sticky = *(int *)(recordPtr + internalOffset);
+ static char buffer[5];
+ int count = 0;
+
+ if (sticky & STICK_NORTH) {
+ buffer[count++] = 'n';
+ }
+ if (sticky & STICK_EAST) {
+ buffer[count++] = 'e';
+ }
+ if (sticky & STICK_SOUTH) {
+ buffer[count++] = 's';
+ }
+ if (sticky & STICK_WEST) {
+ buffer[count++] = 'w';
+ }
+ buffer[count] = '\0';
+
+ return Tcl_NewStringObj(buffer, -1);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetSticky --
+ *
+ * Converts a Tcl_Obj representing a widgets stickyness into an
+ * integer value.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * May store the integer value into the internal representation
+ * pointer. May change the pointer to the Tcl_Obj to NULL to indicate
+ * that the specified string was empty and that is acceptable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+SetSticky(clientData, interp, tkwin, value, recordPtr, internalOffset,
+ oldInternalPtr, flags)
+ ClientData clientData;
+ Tcl_Interp *interp; /* Current interp; may be used for errors. */
+ Tk_Window tkwin; /* Window for which option is being set. */
+ Tcl_Obj **value; /* Pointer to the pointer to the value object.
+ * We use a pointer to the pointer because
+ * we may need to return a value (NULL). */
+ char *recordPtr; /* Pointer to storage for the widget record. */
+ int internalOffset; /* Offset within *recordPtr at which the
+ internal value is to be stored. */
+ char *oldInternalPtr; /* Pointer to storage for the old value. */
+ int flags; /* Flags for the option, set Tk_SetOptions. */
+{
+ int sticky = 0;
+ char c, *string, *internalPtr;
+
+ internalPtr = ComputeSlotAddress(recordPtr, internalOffset);
+
+ if (flags & TK_OPTION_NULL_OK && ObjectIsEmpty(*value)) {
+ *value = NULL;
+ } else {
+ /*
+ * Convert the sticky specifier into an integer value.
+ */
+
+ string = Tcl_GetString(*value);
+
+ while ((c = *string++) != '\0') {
+ switch (c) {
+ case 'n': case 'N': sticky |= STICK_NORTH; break;
+ case 'e': case 'E': sticky |= STICK_EAST; break;
+ case 's': case 'S': sticky |= STICK_SOUTH; break;
+ case 'w': case 'W': sticky |= STICK_WEST; break;
+ case ' ': case ',': case '\t': case '\r': case '\n': break;
+ default: {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "bad stickyness value \"",
+ Tcl_GetString(*value), "\": must be a string ",
+ "containing zero or more of n, e, s, and w",
+ (char *)NULL);
+ return TCL_ERROR;
+ }
+ }
+ }
+ }
+
+ if (internalPtr != NULL) {
+ *((int *) oldInternalPtr) = *((int *) internalPtr);
+ *((int *) internalPtr) = sticky;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RestoreSticky --
+ *
+ * Restore a sticky option value from a saved value.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Restores the old value.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+RestoreSticky(clientData, tkwin, internalPtr, oldInternalPtr)
+ ClientData clientData;
+ Tk_Window tkwin;
+ char *internalPtr; /* Pointer to storage for value. */
+ char *oldInternalPtr; /* Pointer to old value. */
+{
+ *(int *)internalPtr = *(int *)oldInternalPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * AdjustForSticky --
+ *
+ * Given the x,y coords of the top-left corner of a pane, the
+ * dimensions of that pane, and the dimensions of a slave, compute
+ * the x,y coords and actual dimensions of the slave based on the slave's
+ * sticky value.
+ *
+ * Results:
+ * No direct return; sets the x, y, slaveWidth and slaveHeight to
+ * correct values.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+AdjustForSticky(sticky, cavityWidth, cavityHeight, xPtr, yPtr,
+ slaveWidthPtr, slaveHeightPtr)
+ int sticky; /* Sticky value; see top of file for definition. */
+ int cavityWidth; /* Width of the cavity. */
+ int cavityHeight; /* Height of the cavity. */
+ int *xPtr, *yPtr; /* Initially, coordinates of the top-left
+ * corner of cavity; also return values for
+ * actual x, y coords of slave. */
+ int *slaveWidthPtr; /* Slave width. */
+ int *slaveHeightPtr; /* Slave height. */
+{
+ int diffx=0; /* Cavity width - slave width. */
+ int diffy=0; /* Cavity hight - slave height. */
+
+ if (cavityWidth > *slaveWidthPtr) {
+ diffx = cavityWidth - *slaveWidthPtr;
+ }
+
+ if (cavityHeight > *slaveHeightPtr) {
+ diffy = cavityHeight - *slaveHeightPtr;
+ }
+
+ if ((sticky & STICK_EAST) && (sticky & STICK_WEST)) {
+ *slaveWidthPtr += diffx;
+ }
+ if ((sticky & STICK_NORTH) && (sticky & STICK_SOUTH)) {
+ *slaveHeightPtr += diffy;
+ }
+ if (!(sticky & STICK_WEST)) {
+ *xPtr += (sticky & STICK_EAST) ? diffx : diffx/2;
+ }
+ if (!(sticky & STICK_NORTH)) {
+ *yPtr += (sticky & STICK_SOUTH) ? diffy : diffy/2;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MoveSash --
+ *
+ * Move the sash given by index the amount given.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Recomputes the sizes of the panes in a panedwindow.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+MoveSash(pwPtr, sash, diff)
+ PanedWindow *pwPtr;
+ int sash;
+ int diff;
+{
+ int diffConsumed = 0, i, extra, maxCoord, currCoord;
+ int *lengthPtr, newLength;
+ Slave *slave;
+
+ if (diff > 0) {
+ /*
+ * Growing the pane, at the expense of panes to the right.
+ */
+
+
+ /*
+ * First check that moving the sash the requested distance will not
+ * leave it off the screen. If necessary, clip the requested diff
+ * to the maximum possible while remaining visible.
+ */
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ if (Tk_IsMapped(pwPtr->tkwin)) {
+ maxCoord = Tk_Width(pwPtr->tkwin);
+ } else {
+ maxCoord = Tk_ReqWidth(pwPtr->tkwin);
+ }
+ extra = Tk_Width(pwPtr->tkwin) - Tk_ReqWidth(pwPtr->tkwin);
+ currCoord = pwPtr->slaves[sash]->sashx;
+ } else {
+ if (Tk_IsMapped(pwPtr->tkwin)) {
+ maxCoord = Tk_Height(pwPtr->tkwin);
+ } else {
+ maxCoord = Tk_ReqHeight(pwPtr->tkwin);
+ }
+ extra = Tk_Height(pwPtr->tkwin) - Tk_ReqHeight(pwPtr->tkwin);
+ currCoord = pwPtr->slaves[sash]->sashy;
+ }
+
+ maxCoord -= (pwPtr->borderWidth + pwPtr->sashWidth + pwPtr->sashPad);
+ if (currCoord + diff >= maxCoord) {
+ diff = maxCoord - currCoord;
+ }
+
+ for (i = sash + 1; i < pwPtr->numSlaves; i++) {
+ if (diffConsumed == diff) {
+ break;
+ }
+ slave = pwPtr->slaves[i];
+
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ lengthPtr = &(slave->paneWidth);
+ } else {
+ lengthPtr = &(slave->paneHeight);
+ }
+
+ /*
+ * Remove as much space from this pane as possible (constrained
+ * by the minsize value and the visible dimensions of the window).
+ */
+
+ if (i == pwPtr->numSlaves - 1 && extra > 0) {
+ /*
+ * The last pane may have some additional "virtual" space,
+ * if the width (or height) of the paned window is bigger
+ * than the requested width (or height).
+ *
+ * That extra space is not included in the paneWidth
+ * (or paneHeight) value, so we have to handle the last
+ * pane specially.
+ */
+ newLength = (*lengthPtr + extra) - (diff - diffConsumed);
+ if (newLength < slave->minSize) {
+ newLength = slave->minSize;
+ }
+ if (newLength < 0) {
+ newLength = 0;
+ }
+ diffConsumed += (*lengthPtr + extra) - newLength;
+ if (newLength < *lengthPtr) {
+ *lengthPtr = newLength;
+ }
+ } else {
+ newLength = *lengthPtr - (diff - diffConsumed);
+ if (newLength < slave->minSize) {
+ newLength = slave->minSize;
+ }
+ if (newLength < 0) {
+ newLength = 0;
+ }
+ diffConsumed += *lengthPtr - newLength;
+ *lengthPtr = newLength;
+ }
+ }
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ pwPtr->slaves[sash]->paneWidth += diffConsumed;
+ } else {
+ pwPtr->slaves[sash]->paneHeight += diffConsumed;
+ }
+ } else if (diff < 0) {
+ /*
+ * Shrinking the pane; additional space is given to the pane to the
+ * right.
+ */
+ for (i = sash; i >= 0; i--) {
+ if (diffConsumed == diff) {
+ break;
+ }
+ /*
+ * Remove as much space from this pane as possible.
+ */
+ slave = pwPtr->slaves[i];
+
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ lengthPtr = &(slave->paneWidth);
+ } else {
+ lengthPtr = &(slave->paneHeight);
+ }
+
+ newLength = *lengthPtr + (diff - diffConsumed);
+ if (newLength < slave->minSize) {
+ newLength = slave->minSize;
+ }
+ if (newLength < 0) {
+ newLength = 0;
+ }
+ diffConsumed -= *lengthPtr - newLength;
+ *lengthPtr = newLength;
+ }
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ pwPtr->slaves[sash + 1]->paneWidth -= diffConsumed;
+ } else {
+ pwPtr->slaves[sash + 1]->paneHeight -= diffConsumed;
+ }
+ }
+
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ProxyWindowEventProc --
+ *
+ * This procedure is invoked by the Tk dispatcher for various
+ * events on paned window proxy windows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * When the window gets deleted, internal structures get
+ * cleaned up. When it gets exposed, it is redisplayed.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+ProxyWindowEventProc(clientData, eventPtr)
+ ClientData clientData; /* Information about window. */
+ XEvent *eventPtr; /* Information about event. */
+{
+ PanedWindow *pwPtr = (PanedWindow *) clientData;
+
+ if (eventPtr->type == Expose) {
+ if (pwPtr->proxywin != NULL &&!(pwPtr->flags & PROXY_REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DisplayProxyWindow, (ClientData) pwPtr);
+ pwPtr->flags |= PROXY_REDRAW_PENDING;
+ }
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * DisplayProxyWindow --
+ *
+ * This procedure redraws a paned window proxy 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
+DisplayProxyWindow(clientData)
+ ClientData clientData; /* Information about window. */
+{
+ PanedWindow *pwPtr = (PanedWindow *) clientData;
+ Pixmap pixmap;
+ Tk_Window tkwin = pwPtr->proxywin;
+ pwPtr->flags &= ~PROXY_REDRAW_PENDING;
+ if ((tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ return;
+ }
+
+ /*
+ * Create a pixmap for double-buffering, if necessary.
+ */
+
+ pixmap = Tk_GetPixmap(Tk_Display(tkwin), Tk_WindowId(tkwin),
+ Tk_Width(tkwin), Tk_Height(tkwin),
+ DefaultDepthOfScreen(Tk_Screen(tkwin)));
+
+ /*
+ * Redraw the widget's background and border.
+ */
+ Tk_Fill3DRectangle(tkwin, pixmap, pwPtr->background, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin), 2, pwPtr->sashRelief);
+
+ /*
+ * Copy the pixmap to the display.
+ */
+ XCopyArea(Tk_Display(tkwin), pixmap, Tk_WindowId(tkwin), pwPtr->gc,
+ 0, 0, (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin),
+ 0, 0);
+ Tk_FreePixmap(Tk_Display(tkwin), pixmap);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PanedWindowProxyCommand --
+ *
+ * Handles the panedwindow proxy subcommand. See the user
+ * documentation for details.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * May map or unmap the proxy sash.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+PanedWindowProxyCommand(pwPtr, interp, objc, objv)
+ PanedWindow *pwPtr; /* Pointer to paned window information. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj * CONST objv[]; /* Argument objects. */
+{
+ static CONST char *optionStrings[] = { "coord", "forget", "place",
+ (char *) NULL };
+ enum options { PROXY_COORD, PROXY_FORGET, PROXY_PLACE };
+ int index, x, y, sashWidth, sashHeight;
+ Tcl_Obj *coords[2];
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "option ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[2], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum options) index) {
+ case PROXY_COORD:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
+ return TCL_ERROR;
+ }
+
+ coords[0] = Tcl_NewIntObj(pwPtr->proxyx);
+ coords[1] = Tcl_NewIntObj(pwPtr->proxyy);
+ Tcl_SetListObj(Tcl_GetObjResult(interp), 2, coords);
+ break;
+
+ case PROXY_FORGET:
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
+ return TCL_ERROR;
+ }
+ if (Tk_IsMapped(pwPtr->proxywin)) {
+ Tk_UnmapWindow(pwPtr->proxywin);
+ Tk_UnmaintainGeometry(pwPtr->proxywin, pwPtr->tkwin);
+ }
+ break;
+
+ case PROXY_PLACE: {
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 3, objv, "x y");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ if (x < 0) {
+ x = 0;
+ }
+ y = Tk_InternalBorderWidth(pwPtr->tkwin);
+ sashWidth = pwPtr->sashWidth;
+ sashHeight = Tk_Height(pwPtr->tkwin) -
+ (2 * Tk_InternalBorderWidth(pwPtr->tkwin));
+ } else {
+ if (y < 0) {
+ y = 0;
+ }
+ x = Tk_InternalBorderWidth(pwPtr->tkwin);
+ sashHeight = pwPtr->sashWidth;
+ sashWidth = Tk_Width(pwPtr->tkwin) -
+ (2 * Tk_InternalBorderWidth(pwPtr->tkwin));
+ }
+
+ /*
+ * Stash the proxy coordinates for future "proxy coord" calls.
+ */
+
+ pwPtr->proxyx = x;
+ pwPtr->proxyy = y;
+
+ /*
+ * Make sure the proxy window is higher in the stacking order
+ * than the slaves, so that it will be visible when drawn.
+ * It would be more correct to push the proxy window just high
+ * enough to appear above the highest slave, but it's much easier
+ * to just force it all the way to the top of the stacking order.
+ */
+
+ Tk_RestackWindow(pwPtr->proxywin, Above, NULL);
+
+ /*
+ * Let Tk_MaintainGeometry take care of placing the window at
+ * the right coordinates.
+ */
+ Tk_MaintainGeometry(pwPtr->proxywin, pwPtr->tkwin,
+ x, y, sashWidth, sashHeight);
+ break;
+ }
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ObjectIsEmpty --
+ *
+ * This procedure tests whether the string value of an object is
+ * empty.
+ *
+ * Results:
+ * The return value is 1 if the string value of objPtr has length
+ * zero, and 0 otherwise.
+ *
+ * Side effects:
+ * May cause object shimmering, since this function can force a
+ * conversion to a string object.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ObjectIsEmpty(objPtr)
+ Tcl_Obj *objPtr; /* Object to test. May be NULL. */
+{
+ int length;
+
+ if (objPtr == NULL) {
+ return 1;
+ }
+ if (objPtr->bytes != NULL) {
+ return (objPtr->length == 0);
+ }
+ Tcl_GetStringFromObj(objPtr, &length);
+ return (length == 0);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ComputeInternalPointer --
+ *
+ * Given a pointer to the start of a record and the offset of a slot
+ * within that record, compute the address of that slot.
+ *
+ * Results:
+ * If offset is non-negative, returns the computed address; else,
+ * returns NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static char *
+ComputeSlotAddress(recordPtr, offset)
+ char *recordPtr; /* Pointer to the start of a record. */
+ int offset; /* Offset of a slot within that record; may be < 0. */
+{
+ if (offset >= 0) {
+ return recordPtr + offset;
+ } else {
+ return NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PanedWindowIdentifyCoords --
+ *
+ * Given a pair of x,y coordinates, identify the panedwindow component
+ * at that point, if any.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * Modifies the interpreter's result to contain either an empty list,
+ * or a two element list of the form {sash n} or {handle n} to indicate
+ * that the point lies within the n'th sash or handle.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+PanedWindowIdentifyCoords(pwPtr, interp, x, y)
+ PanedWindow *pwPtr; /* Information about the widget. */
+ Tcl_Interp *interp; /* Interpreter in which to store result. */
+ int x, y; /* Coordinates of the point to identify. */
+{
+ Tcl_Obj *list;
+ int i, sashHeight, sashWidth, thisx, thisy;
+ int found, isHandle, lpad, rpad, tpad, bpad;
+ list = Tcl_NewObj();
+
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ if (Tk_IsMapped(pwPtr->tkwin)) {
+ sashHeight = Tk_Height(pwPtr->tkwin);
+ } else {
+ sashHeight = Tk_ReqHeight(pwPtr->tkwin);
+ }
+ sashHeight -= 2 * Tk_InternalBorderWidth(pwPtr->tkwin);
+ if (pwPtr->showHandle && pwPtr->handleSize > pwPtr->sashWidth) {
+ sashWidth = pwPtr->handleSize;
+ lpad = (pwPtr->handleSize - pwPtr->sashWidth) / 2;
+ rpad = pwPtr->handleSize - lpad;
+ lpad += pwPtr->sashPad;
+ rpad += pwPtr->sashPad;
+ } else {
+ sashWidth = pwPtr->sashWidth;
+ lpad = rpad = pwPtr->sashPad;
+ }
+ tpad = bpad = 0;
+ } else {
+ if (pwPtr->showHandle && pwPtr->handleSize > pwPtr->sashWidth) {
+ sashHeight = pwPtr->handleSize;
+ tpad = (pwPtr->handleSize - pwPtr->sashWidth) / 2;
+ bpad = pwPtr->handleSize - tpad;
+ tpad += pwPtr->sashPad;
+ bpad += pwPtr->sashPad;
+ } else {
+ sashHeight = pwPtr->sashWidth;
+ tpad = bpad = pwPtr->sashPad;
+ }
+ if (Tk_IsMapped(pwPtr->tkwin)) {
+ sashWidth = Tk_Width(pwPtr->tkwin);
+ } else {
+ sashWidth = Tk_ReqWidth(pwPtr->tkwin);
+ }
+ sashWidth -= 2 * Tk_InternalBorderWidth(pwPtr->tkwin);
+ lpad = rpad = 0;
+ }
+
+ isHandle = 0;
+ found = -1;
+ for (i = 0; i < pwPtr->numSlaves - 1; i++) {
+ thisx = pwPtr->slaves[i]->sashx;
+ thisy = pwPtr->slaves[i]->sashy;
+
+ if (((thisx - lpad) <= x && x <= (thisx + rpad + sashWidth)) &&
+ ((thisy - tpad) <= y && y <= (thisy + bpad + sashHeight))) {
+ found = i;
+
+ /*
+ * Determine if the point is over the handle or the sash.
+ */
+ if (pwPtr->showHandle) {
+ thisx = pwPtr->slaves[i]->handlex;
+ thisy = pwPtr->slaves[i]->handley;
+ if (pwPtr->orient == ORIENT_HORIZONTAL) {
+ if (thisy <= y && y <= (thisy + pwPtr->handleSize)) {
+ isHandle = 1;
+ }
+ } else {
+ if (thisx <= x && x <= (thisx + pwPtr->handleSize)) {
+ isHandle = 1;
+ }
+ }
+ }
+ break;
+ }
+ }
+
+ /*
+ * Set results.
+ */
+ if (found != -1) {
+ Tcl_ListObjAppendElement(interp, list, Tcl_NewIntObj(found));
+ if (isHandle) {
+ Tcl_ListObjAppendElement(interp, list,
+ Tcl_NewStringObj("handle", -1));
+ } else {
+ Tcl_ListObjAppendElement(interp, list,
+ Tcl_NewStringObj("sash", -1));
+ }
+ }
+
+ Tcl_SetObjResult(interp, list);
+ return TCL_OK;
+}
diff --git a/tk/generic/tkPlace.c b/tk/generic/tkPlace.c
index d48895b2d41..a2909799e87 100644
--- a/tk/generic/tkPlace.c
+++ b/tk/generic/tkPlace.c
@@ -16,6 +16,7 @@
#include "tkPort.h"
#include "tkInt.h"
+
/*
* Border modes for relative placement:
*
@@ -27,6 +28,10 @@
* master's actual window size.
*/
+static char *borderModeStrings[] = {
+ "inside", "outside", "ignore", (char *) NULL
+};
+
typedef enum {BM_INSIDE, BM_OUTSIDE, BM_IGNORE} BorderMode;
/*
@@ -36,6 +41,7 @@ typedef enum {BM_INSIDE, BM_OUTSIDE, BM_IGNORE} BorderMode;
typedef struct Slave {
Tk_Window tkwin; /* Tk's token for window. */
+ Tk_Window inTkwin; /* Token for the -in window. */
struct Master *masterPtr; /* Pointer to information for window
* relative to which tkwin is placed.
* This isn't necessarily the logical
@@ -43,7 +49,6 @@ typedef struct Slave {
* master was deleted or never assigned. */
struct Slave *nextPtr; /* Next in list of windows placed relative
* to same master (NULL for end of list). */
-
/*
* Geometry information for window; where there are both relative
* and absolute values for the same attribute (e.g. x and relX) only
@@ -51,11 +56,17 @@ typedef struct Slave {
*/
int x, y; /* X and Y pixel coordinates for tkwin. */
- float relX, relY; /* X and Y coordinates relative to size of
+ Tcl_Obj *xPtr, *yPtr; /* Tcl_Obj rep's of x, y coords, to keep
+ * pixel spec. information */
+ double relX, relY; /* X and Y coordinates relative to size of
* master. */
int width, height; /* Absolute dimensions for tkwin. */
- float relWidth, relHeight; /* Dimensions for tkwin relative to size of
+ Tcl_Obj *widthPtr; /* Tcl_Obj rep of width, to keep pixel spec */
+ Tcl_Obj *heightPtr; /* Tcl_Obj rep of height, to keep pixel spec */
+ double relWidth, relHeight; /* Dimensions for tkwin relative to size of
* master. */
+ Tcl_Obj *relWidthPtr;
+ Tcl_Obj *relHeightPtr;
Tk_Anchor anchor; /* Which point on tkwin is placed at the
* given position. */
BorderMode borderMode; /* How to treat borders of master window. */
@@ -64,6 +75,40 @@ typedef struct Slave {
} Slave;
/*
+ * Type masks for options:
+ */
+#define IN_MASK 1
+
+static Tk_OptionSpec optionSpecs[] = {
+ {TK_OPTION_ANCHOR, "-anchor", NULL, NULL, "nw", -1,
+ Tk_Offset(Slave, anchor), 0, 0, 0},
+ {TK_OPTION_STRING_TABLE, "-bordermode", NULL, NULL, "inside", -1,
+ Tk_Offset(Slave, borderMode), 0, (ClientData) borderModeStrings, 0},
+ {TK_OPTION_PIXELS, "-height", NULL, NULL, "", Tk_Offset(Slave, heightPtr),
+ Tk_Offset(Slave, height), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_WINDOW, "-in", NULL, NULL, "", -1, Tk_Offset(Slave, inTkwin),
+ 0, 0, IN_MASK},
+ {TK_OPTION_DOUBLE, "-relheight", NULL, NULL, "",
+ Tk_Offset(Slave, relHeightPtr), Tk_Offset(Slave, relHeight),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_DOUBLE, "-relwidth", NULL, NULL, "",
+ Tk_Offset(Slave, relWidthPtr), Tk_Offset(Slave, relWidth),
+ TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_DOUBLE, "-relx", NULL, NULL, "0", -1,
+ Tk_Offset(Slave, relX), 0, 0, 0},
+ {TK_OPTION_DOUBLE, "-rely", NULL, NULL, "0", -1,
+ Tk_Offset(Slave, relY), 0, 0, 0},
+ {TK_OPTION_PIXELS, "-width", NULL, NULL, "", Tk_Offset(Slave, widthPtr),
+ Tk_Offset(Slave, width), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-x", NULL, NULL, "0", Tk_Offset(Slave, xPtr),
+ Tk_Offset(Slave, x), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_PIXELS, "-y", NULL, NULL, "0", Tk_Offset(Slave, yPtr),
+ Tk_Offset(Slave, y), TK_OPTION_NULL_OK, 0, 0},
+ {TK_OPTION_END, (char *) NULL, (char *) NULL, (char *) NULL,
+ (char *) NULL, 0, -1, 0, 0, 0}
+};
+
+/*
* Flag definitions for Slave structures:
*
* CHILD_WIDTH - 1 means -width was specified;
@@ -121,8 +166,13 @@ static Tk_GeomMgr placerType = {
static void SlaveStructureProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
static int ConfigureSlave _ANSI_ARGS_((Tcl_Interp *interp,
- Slave *slavePtr, int argc, char **argv));
+ Tk_Window tkwin, Tk_OptionTable table,
+ int objc, Tcl_Obj *CONST objv[]));
+static int PlaceInfoCommand _ANSI_ARGS_((Tcl_Interp *interp,
+ Tk_Window tkwin));
+static Slave * CreateSlave _ANSI_ARGS_((Tk_Window tkwin));
static Slave * FindSlave _ANSI_ARGS_((Tk_Window tkwin));
+static Master * CreateMaster _ANSI_ARGS_((Tk_Window tkwin));
static Master * FindMaster _ANSI_ARGS_((Tk_Window tkwin));
static void MasterStructureProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
@@ -132,7 +182,7 @@ static void UnlinkSlave _ANSI_ARGS_((Slave *slavePtr));
/*
*--------------------------------------------------------------
*
- * Tk_PlaceCmd --
+ * Tk_PlaceObjCmd --
*
* This procedure is invoked to process the "place" Tcl
* commands. See the user documentation for details on
@@ -148,33 +198,43 @@ static void UnlinkSlave _ANSI_ARGS_((Slave *slavePtr));
*/
int
-Tk_PlaceCmd(clientData, interp, argc, argv)
- ClientData clientData; /* Main window associated with interpreter. */
+Tk_PlaceObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin;
Slave *slavePtr;
- Tcl_HashEntry *hPtr;
- size_t length;
- int c;
+ char *string;
TkDisplay *dispPtr;
-
- if (argc < 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " option|pathName args", (char *) NULL);
+ Tk_OptionTable optionTable;
+ static CONST char *optionStrings[] = {
+ "configure", "forget", "info", "slaves", (char *) NULL
+ };
+ enum options { PLACE_CONFIGURE, PLACE_FORGET, PLACE_INFO, PLACE_SLAVES };
+ int index;
+
+
+ if (objc < 3) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option|pathName args");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
+
+ /*
+ * Create the option table for this widget class. If it has already
+ * been created, the cached pointer will be returned.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, optionSpecs);
/*
* Handle special shortcut where window name is first argument.
*/
- if (c == '.') {
- tkwin = Tk_NameToWindow(interp, argv[1], (Tk_Window) clientData);
+ string = Tcl_GetString(objv[1]);
+ if (string[0] == '.') {
+ tkwin = Tk_NameToWindow(interp, string, Tk_MainWindow(interp));
if (tkwin == NULL) {
return TCL_ERROR;
}
@@ -190,8 +250,7 @@ Tk_PlaceCmd(clientData, interp, argc, argv)
dispPtr->placeInit = 1;
}
- slavePtr = FindSlave(tkwin);
- return ConfigureSlave(interp, slavePtr, argc-2, argv+2);
+ return ConfigureSlave(interp, tkwin, optionTable, objc-2, objv+2);
}
/*
@@ -199,7 +258,8 @@ Tk_PlaceCmd(clientData, interp, argc, argv)
* by possible additional arguments.
*/
- tkwin = Tk_NameToWindow(interp, argv[2], (Tk_Window) clientData);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[2]),
+ Tk_MainWindow(interp));
if (tkwin == NULL) {
return TCL_ERROR;
}
@@ -215,131 +275,102 @@ Tk_PlaceCmd(clientData, interp, argc, argv)
dispPtr->placeInit = 1;
}
- if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0)) {
- if (argc < 5) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0],
- " configure pathName option value ?option value ...?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- slavePtr = FindSlave(tkwin);
- return ConfigureSlave(interp, slavePtr, argc-3, argv+3);
- } else if ((c == 'f') && (strncmp(argv[1], "forget", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " forget pathName\"", (char *) NULL);
- return TCL_ERROR;
- }
- hPtr = Tcl_FindHashEntry(&dispPtr->slaveTable, (char *) tkwin);
- if (hPtr == NULL) {
- return TCL_OK;
- }
- slavePtr = (Slave *) Tcl_GetHashValue(hPtr);
- if ((slavePtr->masterPtr != NULL) &&
- (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin))) {
- Tk_UnmaintainGeometry(slavePtr->tkwin,
- slavePtr->masterPtr->tkwin);
- }
- UnlinkSlave(slavePtr);
- Tcl_DeleteHashEntry(hPtr);
- Tk_DeleteEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
- (ClientData) slavePtr);
- Tk_ManageGeometry(tkwin, (Tk_GeomMgr *) NULL, (ClientData) NULL);
- Tk_UnmapWindow(tkwin);
- ckfree((char *) slavePtr);
- } else if ((c == 'i') && (strncmp(argv[1], "info", length) == 0)) {
- char buffer[32 + TCL_INTEGER_SPACE];
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " info pathName\"", (char *) NULL);
- return TCL_ERROR;
- }
- hPtr = Tcl_FindHashEntry(&dispPtr->slaveTable, (char *) tkwin);
- if (hPtr == NULL) {
- return TCL_OK;
- }
- slavePtr = (Slave *) Tcl_GetHashValue(hPtr);
- sprintf(buffer, "-x %d", slavePtr->x);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- sprintf(buffer, " -relx %.4g", slavePtr->relX);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- sprintf(buffer, " -y %d", slavePtr->y);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- sprintf(buffer, " -rely %.4g", slavePtr->relY);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- if (slavePtr->flags & CHILD_WIDTH) {
- sprintf(buffer, " -width %d", slavePtr->width);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- } else {
- Tcl_AppendResult(interp, " -width {}", (char *) NULL);
- }
- if (slavePtr->flags & CHILD_REL_WIDTH) {
- sprintf(buffer, " -relwidth %.4g", slavePtr->relWidth);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- } else {
- Tcl_AppendResult(interp, " -relwidth {}", (char *) NULL);
+ switch ((enum options) index) {
+ case PLACE_CONFIGURE: {
+ Tcl_Obj *objPtr;
+ if (objc == 3 || objc == 4) {
+ slavePtr = FindSlave(tkwin);
+ if (slavePtr == NULL) {
+ return TCL_OK;
+ }
+ objPtr = Tk_GetOptionInfo(interp, (char *) slavePtr,
+ optionTable,
+ (objc == 4) ? objv[3] : (Tcl_Obj *) NULL, tkwin);
+ if (objPtr == NULL) {
+ return TCL_ERROR;
+ } else {
+ Tcl_SetObjResult(interp, objPtr);
+ return TCL_OK;
+ }
+ } else {
+ return ConfigureSlave(interp, tkwin, optionTable, objc-3,
+ objv+3);
+ }
}
- if (slavePtr->flags & CHILD_HEIGHT) {
- sprintf(buffer, " -height %d", slavePtr->height);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- } else {
- Tcl_AppendResult(interp, " -height {}", (char *) NULL);
+
+ case PLACE_FORGET: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "pathName");
+ return TCL_ERROR;
+ }
+ slavePtr = FindSlave(tkwin);
+ if (slavePtr == NULL) {
+ return TCL_OK;
+ }
+ if ((slavePtr->masterPtr != NULL) &&
+ (slavePtr->masterPtr->tkwin !=
+ Tk_Parent(slavePtr->tkwin))) {
+ Tk_UnmaintainGeometry(slavePtr->tkwin,
+ slavePtr->masterPtr->tkwin);
+ }
+ UnlinkSlave(slavePtr);
+ Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->slaveTable,
+ (char *) tkwin));
+ Tk_DeleteEventHandler(tkwin, StructureNotifyMask,
+ SlaveStructureProc, (ClientData) slavePtr);
+ Tk_ManageGeometry(tkwin, (Tk_GeomMgr *) NULL, (ClientData) NULL);
+ Tk_UnmapWindow(tkwin);
+ ckfree((char *) slavePtr);
+ break;
}
- if (slavePtr->flags & CHILD_REL_HEIGHT) {
- sprintf(buffer, " -relheight %.4g", slavePtr->relHeight);
- Tcl_AppendResult(interp, buffer, (char *) NULL);
- } else {
- Tcl_AppendResult(interp, " -relheight {}", (char *) NULL);
+
+ case PLACE_INFO: {
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "pathName");
+ return TCL_ERROR;
+ }
+ return PlaceInfoCommand(interp, tkwin);
}
- Tcl_AppendResult(interp, " -anchor ", Tk_NameOfAnchor(slavePtr->anchor),
- (char *) NULL);
- if (slavePtr->borderMode == BM_OUTSIDE) {
- Tcl_AppendResult(interp, " -bordermode outside", (char *) NULL);
- } else if (slavePtr->borderMode == BM_IGNORE) {
- Tcl_AppendResult(interp, " -bordermode ignore", (char *) NULL);
- }
- if ((slavePtr->masterPtr != NULL)
- && (slavePtr->masterPtr->tkwin != Tk_Parent(slavePtr->tkwin))) {
- Tcl_AppendResult(interp, " -in ",
- Tk_PathName(slavePtr->masterPtr->tkwin), (char *) NULL);
- }
- } else if ((c == 's') && (strncmp(argv[1], "slaves", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " slaves pathName\"", (char *) NULL);
- return TCL_ERROR;
- }
- hPtr = Tcl_FindHashEntry(&dispPtr->masterTable, (char *) tkwin);
- if (hPtr != NULL) {
+ case PLACE_SLAVES: {
Master *masterPtr;
- masterPtr = (Master *) Tcl_GetHashValue(hPtr);
- for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
- slavePtr = slavePtr->nextPtr) {
- Tcl_AppendElement(interp, Tk_PathName(slavePtr->tkwin));
+ Tcl_Obj *listPtr;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "pathName");
+ return TCL_ERROR;
}
+ masterPtr = FindMaster(tkwin);
+ if (masterPtr != NULL) {
+ listPtr = Tcl_NewObj();
+ for (slavePtr = masterPtr->slavePtr; slavePtr != NULL;
+ slavePtr = slavePtr->nextPtr) {
+ Tcl_ListObjAppendElement(interp, listPtr,
+ Tcl_NewStringObj(Tk_PathName(slavePtr->tkwin),-1));
+ }
+ Tcl_SetObjResult(interp, listPtr);
+ }
+ break;
}
- } else {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
- "\": must be configure, forget, info, or slaves",
- (char *) NULL);
- return TCL_ERROR;
}
+
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
- * FindSlave --
+ * CreateSlave --
*
* Given a Tk_Window token, find the Slave structure corresponding
- * to that token (making a new one if necessary).
+ * to that token, creating a new one if necessary.
*
* Results:
- * None.
+ * Pointer to the Slave structure.
*
* Side effects:
* A new Slave structure may be created.
@@ -348,7 +379,7 @@ Tk_PlaceCmd(clientData, interp, argc, argv)
*/
static Slave *
-FindSlave(tkwin)
+CreateSlave(tkwin)
Tk_Window tkwin; /* Token for desired slave. */
{
Tcl_HashEntry *hPtr;
@@ -359,16 +390,11 @@ FindSlave(tkwin)
hPtr = Tcl_CreateHashEntry(&dispPtr->slaveTable, (char *) tkwin, &new);
if (new) {
slavePtr = (Slave *) ckalloc(sizeof(Slave));
- slavePtr->tkwin = tkwin;
- slavePtr->masterPtr = NULL;
- slavePtr->nextPtr = NULL;
- slavePtr->x = slavePtr->y = 0;
- slavePtr->relX = slavePtr->relY = (float) 0.0;
- slavePtr->width = slavePtr->height = 0;
- slavePtr->relWidth = slavePtr->relHeight = (float) 0.0;
- slavePtr->anchor = TK_ANCHOR_NW;
- slavePtr->borderMode = BM_INSIDE;
- slavePtr->flags = 0;
+ memset(slavePtr, 0, sizeof(Slave));
+ slavePtr->tkwin = tkwin;
+ slavePtr->inTkwin = None;
+ slavePtr->anchor = TK_ANCHOR_NW;
+ slavePtr->borderMode = BM_INSIDE;
Tcl_SetHashValue(hPtr, slavePtr);
Tk_CreateEventHandler(tkwin, StructureNotifyMask, SlaveStructureProc,
(ClientData) slavePtr);
@@ -382,6 +408,40 @@ FindSlave(tkwin)
/*
*----------------------------------------------------------------------
*
+ * FindSlave --
+ *
+ * Given a Tk_Window token, find the Slave structure corresponding
+ * to that token. This is purely a lookup function; it will not
+ * create a record if one does not yet exist.
+ *
+ * Results:
+ * Pointer to Slave structure; NULL if none exists.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Slave *
+FindSlave(tkwin)
+ Tk_Window tkwin; /* Token for desired slave. */
+{
+ Tcl_HashEntry *hPtr;
+ register Slave *slavePtr;
+ TkDisplay * dispPtr = ((TkWindow *) tkwin)->dispPtr;
+
+ hPtr = Tcl_FindHashEntry(&dispPtr->slaveTable, (char *) tkwin);
+ if (hPtr == NULL) {
+ return NULL;
+ }
+ slavePtr = (Slave *) Tcl_GetHashValue(hPtr);
+ return slavePtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* UnlinkSlave --
*
* This procedure removes a slave window from the chain of slaves
@@ -427,13 +487,13 @@ UnlinkSlave(slavePtr)
/*
*----------------------------------------------------------------------
*
- * FindMaster --
+ * CreateMaster --
*
* Given a Tk_Window token, find the Master structure corresponding
- * to that token (making a new one if necessary).
+ * to that token, creating a new one if necessary.
*
* Results:
- * None.
+ * Pointer to the Master structure.
*
* Side effects:
* A new Master structure may be created.
@@ -442,7 +502,7 @@ UnlinkSlave(slavePtr)
*/
static Master *
-FindMaster(tkwin)
+CreateMaster(tkwin)
Tk_Window tkwin; /* Token for desired master. */
{
Tcl_HashEntry *hPtr;
@@ -453,9 +513,9 @@ FindMaster(tkwin)
hPtr = Tcl_CreateHashEntry(&dispPtr->masterTable, (char *) tkwin, &new);
if (new) {
masterPtr = (Master *) ckalloc(sizeof(Master));
- masterPtr->tkwin = tkwin;
- masterPtr->slavePtr = NULL;
- masterPtr->flags = 0;
+ masterPtr->tkwin = tkwin;
+ masterPtr->slavePtr = NULL;
+ masterPtr->flags = 0;
Tcl_SetHashValue(hPtr, masterPtr);
Tk_CreateEventHandler(masterPtr->tkwin, StructureNotifyMask,
MasterStructureProc, (ClientData) masterPtr);
@@ -468,6 +528,41 @@ FindMaster(tkwin)
/*
*----------------------------------------------------------------------
*
+ * FindMaster --
+ *
+ * Given a Tk_Window token, find the Master structure corresponding
+ * to that token. This is simply a lookup procedure; a new record
+ * will not be created if one does not already exist.
+ *
+ * Results:
+ * Pointer to the Master structure; NULL if one does not exist for
+ * the given Tk_Window token.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Master *
+FindMaster(tkwin)
+ Tk_Window tkwin; /* Token for desired master. */
+{
+ Tcl_HashEntry *hPtr;
+ register Master *masterPtr;
+ TkDisplay * dispPtr = ((TkWindow *) tkwin)->dispPtr;
+
+ hPtr = Tcl_FindHashEntry(&dispPtr->masterTable, (char *) tkwin);
+ if (hPtr == NULL) {
+ return NULL;
+ }
+ masterPtr = (Master *) Tcl_GetHashValue(hPtr);
+ return masterPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* ConfigureSlave --
*
* This procedure is called to process an argv/argc list to
@@ -485,191 +580,107 @@ FindMaster(tkwin)
*/
static int
-ConfigureSlave(interp, slavePtr, argc, argv)
+ConfigureSlave(interp, tkwin, table, objc, objv)
Tcl_Interp *interp; /* Used for error reporting. */
- Slave *slavePtr; /* Pointer to current information
- * about slave. */
- int argc; /* Number of config arguments. */
- char **argv; /* String values for arguments. */
+ Tk_Window tkwin; /* Token for the window to manipulate. */
+ Tk_OptionTable table; /* Token for option table. */
+ int objc; /* Number of config arguments. */
+ Tcl_Obj *CONST objv[]; /* Object values for arguments. */
{
register Master *masterPtr;
- int c, result;
- size_t length;
- double d;
-
- result = TCL_OK;
- if (Tk_IsTopLevel(slavePtr->tkwin)) {
+ Tk_SavedOptions savedOptions;
+ int mask;
+ int result = TCL_OK;
+ Slave *slavePtr;
+
+ if (Tk_TopWinHierarchy(tkwin)) {
Tcl_AppendResult(interp, "can't use placer on top-level window \"",
- Tk_PathName(slavePtr->tkwin), "\"; use wm command instead",
+ Tk_PathName(tkwin), "\"; use wm command instead",
(char *) NULL);
return TCL_ERROR;
}
- for ( ; argc > 0; argc -= 2, argv += 2) {
- if (argc < 2) {
- Tcl_AppendResult(interp, "extra option \"", argv[0],
- "\" (option with no value?)", (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- length = strlen(argv[0]);
- c = argv[0][1];
- if ((c == 'a') && (strncmp(argv[0], "-anchor", length) == 0)) {
- if (Tk_GetAnchor(interp, argv[1], &slavePtr->anchor) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- } else if ((c == 'b')
- && (strncmp(argv[0], "-bordermode", length) == 0)) {
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 'i') && (strncmp(argv[1], "ignore", length) == 0)
- && (length >= 2)) {
- slavePtr->borderMode = BM_IGNORE;
- } else if ((c == 'i') && (strncmp(argv[1], "inside", length) == 0)
- && (length >= 2)) {
- slavePtr->borderMode = BM_INSIDE;
- } else if ((c == 'o')
- && (strncmp(argv[1], "outside", length) == 0)) {
- slavePtr->borderMode = BM_OUTSIDE;
- } else {
- Tcl_AppendResult(interp, "bad border mode \"", argv[1],
- "\": must be ignore, inside, or outside",
- (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- } else if ((c == 'h') && (strncmp(argv[0], "-height", length) == 0)) {
- if (argv[1][0] == 0) {
- slavePtr->flags &= ~CHILD_HEIGHT;
- } else {
- if (Tk_GetPixels(interp, slavePtr->tkwin, argv[1],
- &slavePtr->height) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- slavePtr->flags |= CHILD_HEIGHT;
- }
- } else if ((c == 'i') && (strncmp(argv[0], "-in", length) == 0)) {
- Tk_Window tkwin;
- Tk_Window ancestor;
-
- tkwin = Tk_NameToWindow(interp, argv[1], slavePtr->tkwin);
- if (tkwin == NULL) {
- result = TCL_ERROR;
- goto done;
- }
- /*
- * Make sure that the new master is either the logical parent
- * of the slave or a descendant of that window, and that the
- * master and slave aren't the same.
- */
+ slavePtr = CreateSlave(tkwin);
+
+ if (Tk_SetOptions(interp, (char *)slavePtr, table, objc, objv,
+ slavePtr->tkwin, &savedOptions, &mask) != TCL_OK) {
+ Tk_RestoreSavedOptions(&savedOptions);
+ result = TCL_ERROR;
+ goto done;
+ }
- for (ancestor = tkwin; ; ancestor = Tk_Parent(ancestor)) {
- if (ancestor == Tk_Parent(slavePtr->tkwin)) {
- break;
- }
- if (Tk_IsTopLevel(ancestor)) {
- Tcl_AppendResult(interp, "can't place ",
- Tk_PathName(slavePtr->tkwin), " relative to ",
- Tk_PathName(tkwin), (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
+ if (mask & IN_MASK) {
+ /* -in changed */
+ Tk_Window tkwin;
+ Tk_Window ancestor;
+
+ tkwin = slavePtr->inTkwin;
+
+ /*
+ * Make sure that the new master is either the logical parent
+ * of the slave or a descendant of that window, and that the
+ * master and slave aren't the same.
+ */
+
+ for (ancestor = tkwin; ; ancestor = Tk_Parent(ancestor)) {
+ if (ancestor == Tk_Parent(slavePtr->tkwin)) {
+ break;
}
- if (slavePtr->tkwin == tkwin) {
+ if (Tk_TopWinHierarchy(ancestor)) {
Tcl_AppendResult(interp, "can't place ",
- Tk_PathName(slavePtr->tkwin), " relative to itself",
- (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- if ((slavePtr->masterPtr != NULL)
- && (slavePtr->masterPtr->tkwin == tkwin)) {
- /*
- * Re-using same old master. Nothing to do.
- */
- } else {
- if ((slavePtr->masterPtr != NULL)
- && (slavePtr->masterPtr->tkwin
- != Tk_Parent(slavePtr->tkwin))) {
- Tk_UnmaintainGeometry(slavePtr->tkwin,
- slavePtr->masterPtr->tkwin);
- }
- UnlinkSlave(slavePtr);
- slavePtr->masterPtr = FindMaster(tkwin);
- slavePtr->nextPtr = slavePtr->masterPtr->slavePtr;
- slavePtr->masterPtr->slavePtr = slavePtr;
- }
- } else if ((c == 'r') && (strncmp(argv[0], "-relheight", length) == 0)
- && (length >= 5)) {
- if (argv[1][0] == 0) {
- slavePtr->flags &= ~CHILD_REL_HEIGHT;
- } else {
- if (Tcl_GetDouble(interp, argv[1], &d) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- slavePtr->relHeight = (float) d;
- slavePtr->flags |= CHILD_REL_HEIGHT;
- }
- } else if ((c == 'r') && (strncmp(argv[0], "-relwidth", length) == 0)
- && (length >= 5)) {
- if (argv[1][0] == 0) {
- slavePtr->flags &= ~CHILD_REL_WIDTH;
- } else {
- if (Tcl_GetDouble(interp, argv[1], &d) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- slavePtr->relWidth = (float) d;
- slavePtr->flags |= CHILD_REL_WIDTH;
- }
- } else if ((c == 'r') && (strncmp(argv[0], "-relx", length) == 0)
- && (length >= 5)) {
- if (Tcl_GetDouble(interp, argv[1], &d) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- slavePtr->relX = (float) d;
- } else if ((c == 'r') && (strncmp(argv[0], "-rely", length) == 0)
- && (length >= 5)) {
- if (Tcl_GetDouble(interp, argv[1], &d) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- slavePtr->relY = (float) d;
- } else if ((c == 'w') && (strncmp(argv[0], "-width", length) == 0)) {
- if (argv[1][0] == 0) {
- slavePtr->flags &= ~CHILD_WIDTH;
- } else {
- if (Tk_GetPixels(interp, slavePtr->tkwin, argv[1],
- &slavePtr->width) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- slavePtr->flags |= CHILD_WIDTH;
- }
- } else if ((c == 'x') && (strncmp(argv[0], "-x", length) == 0)) {
- if (Tk_GetPixels(interp, slavePtr->tkwin, argv[1],
- &slavePtr->x) != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- } else if ((c == 'y') && (strncmp(argv[0], "-y", length) == 0)) {
- if (Tk_GetPixels(interp, slavePtr->tkwin, argv[1],
- &slavePtr->y) != TCL_OK) {
+ Tk_PathName(slavePtr->tkwin), " relative to ",
+ Tk_PathName(tkwin), (char *) NULL);
result = TCL_ERROR;
+ Tk_RestoreSavedOptions(&savedOptions);
goto done;
}
- } else {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"",
- argv[0], "\": must be -anchor, -bordermode, -height, ",
- "-in, -relheight, -relwidth, -relx, -rely, -width, ",
- "-x, or -y", (char *) NULL);
+ }
+ if (slavePtr->tkwin == tkwin) {
+ Tcl_AppendResult(interp, "can't place ",
+ Tk_PathName(slavePtr->tkwin), " relative to itself",
+ (char *) NULL);
result = TCL_ERROR;
+ Tk_RestoreSavedOptions(&savedOptions);
goto done;
}
+ if ((slavePtr->masterPtr != NULL)
+ && (slavePtr->masterPtr->tkwin == tkwin)) {
+ /*
+ * Re-using same old master. Nothing to do.
+ */
+ } else {
+ if ((slavePtr->masterPtr != NULL)
+ && (slavePtr->masterPtr->tkwin
+ != Tk_Parent(slavePtr->tkwin))) {
+ Tk_UnmaintainGeometry(slavePtr->tkwin,
+ slavePtr->masterPtr->tkwin);
+ }
+ UnlinkSlave(slavePtr);
+ slavePtr->masterPtr = CreateMaster(tkwin);
+ slavePtr->nextPtr = slavePtr->masterPtr->slavePtr;
+ slavePtr->masterPtr->slavePtr = slavePtr;
+ }
+ }
+
+ /*
+ * Set slave flags. First clear the field, then add bits as needed.
+ */
+
+ slavePtr->flags = 0;
+ if (slavePtr->heightPtr) {
+ slavePtr->flags |= CHILD_HEIGHT;
+ }
+
+ if (slavePtr->relHeightPtr) {
+ slavePtr->flags |= CHILD_REL_HEIGHT;
+ }
+
+ if (slavePtr->relWidthPtr) {
+ slavePtr->flags |= CHILD_REL_WIDTH;
+ }
+
+ if (slavePtr->widthPtr) {
+ slavePtr->flags |= CHILD_WIDTH;
}
/*
@@ -677,14 +688,16 @@ ConfigureSlave(interp, slavePtr, argc, argv)
* Then arrange for a placement recalculation in the master.
*/
+ Tk_FreeSavedOptions(&savedOptions);
done:
masterPtr = slavePtr->masterPtr;
if (masterPtr == NULL) {
- masterPtr = FindMaster(Tk_Parent(slavePtr->tkwin));
+ masterPtr = CreateMaster(Tk_Parent(slavePtr->tkwin));
slavePtr->masterPtr = masterPtr;
slavePtr->nextPtr = masterPtr->slavePtr;
masterPtr->slavePtr = slavePtr;
}
+ slavePtr->inTkwin = masterPtr->tkwin;
if (!(masterPtr->flags & PARENT_RECONFIG_PENDING)) {
masterPtr->flags |= PARENT_RECONFIG_PENDING;
Tcl_DoWhenIdle(RecomputePlacement, (ClientData) masterPtr);
@@ -695,6 +708,88 @@ ConfigureSlave(interp, slavePtr, argc, argv)
/*
*----------------------------------------------------------------------
*
+ * PlaceInfoCommand --
+ *
+ * Implementation of the [place info] subcommand. See the user
+ * documentation for information on what it does.
+ *
+ * Results:
+ * Standard Tcl result.
+ *
+ * Side effects:
+ * If the given tkwin is managed by the placer, this function will
+ * put information about that placement in the interp's result.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+PlaceInfoCommand(interp, tkwin)
+ Tcl_Interp *interp; /* Interp into which to place result. */
+ Tk_Window tkwin; /* Token for the window to get info on. */
+{
+ char buffer[32 + TCL_INTEGER_SPACE];
+ Slave *slavePtr;
+
+ slavePtr = FindSlave(tkwin);
+ if (slavePtr == NULL) {
+ return TCL_OK;
+ }
+ sprintf(buffer, "-x %d", slavePtr->x);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ sprintf(buffer, " -relx %.4g", slavePtr->relX);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ sprintf(buffer, " -y %d", slavePtr->y);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ sprintf(buffer, " -rely %.4g", slavePtr->relY);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ if (slavePtr->flags & CHILD_WIDTH) {
+ sprintf(buffer, " -width %d", slavePtr->width);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ } else {
+ Tcl_AppendResult(interp, " -width {}", (char *) NULL);
+ }
+ if (slavePtr->flags & CHILD_REL_WIDTH) {
+ sprintf(buffer, " -relwidth %.4g", slavePtr->relWidth);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ } else {
+ Tcl_AppendResult(interp, " -relwidth {}", (char *) NULL);
+ }
+ if (slavePtr->flags & CHILD_HEIGHT) {
+ sprintf(buffer, " -height %d", slavePtr->height);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ } else {
+ Tcl_AppendResult(interp, " -height {}", (char *) NULL);
+ }
+ if (slavePtr->flags & CHILD_REL_HEIGHT) {
+ sprintf(buffer, " -relheight %.4g", slavePtr->relHeight);
+ Tcl_AppendResult(interp, buffer, (char *) NULL);
+ } else {
+ Tcl_AppendResult(interp, " -relheight {}", (char *) NULL);
+ }
+
+ Tcl_AppendResult(interp, " -anchor ",
+ Tk_NameOfAnchor(slavePtr->anchor),
+ (char *) NULL);
+ if (slavePtr->borderMode == BM_OUTSIDE) {
+ Tcl_AppendResult(interp, " -bordermode outside",
+ (char *) NULL);
+ } else if (slavePtr->borderMode == BM_IGNORE) {
+ Tcl_AppendResult(interp, " -bordermode ignore", (char *) NULL);
+ }
+ if ((slavePtr->masterPtr != NULL)
+ && (slavePtr->masterPtr->tkwin !=
+ Tk_Parent(slavePtr->tkwin))) {
+ Tcl_AppendResult(interp, " -in ",
+ Tk_PathName(slavePtr->masterPtr->tkwin),
+ (char *) NULL);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* RecomputePlacement --
*
* This procedure is called as a when-idle handler. It recomputes
@@ -716,7 +811,7 @@ RecomputePlacement(clientData)
register Master *masterPtr = (Master *) clientData;
register Slave *slavePtr;
int x, y, width, height, tmp;
- int masterWidth, masterHeight, masterBW;
+ int masterWidth, masterHeight, masterX, masterY;
double x1, y1, x2, y2;
masterPtr->flags &= ~PARENT_RECONFIG_PENDING;
@@ -733,25 +828,29 @@ RecomputePlacement(clientData)
* account desired border mode.
*/
- masterBW = 0;
+ masterX = masterY = 0;
masterWidth = Tk_Width(masterPtr->tkwin);
masterHeight = Tk_Height(masterPtr->tkwin);
if (slavePtr->borderMode == BM_INSIDE) {
- masterBW = Tk_InternalBorderWidth(masterPtr->tkwin);
+ masterX = Tk_InternalBorderLeft(masterPtr->tkwin);
+ masterY = Tk_InternalBorderTop(masterPtr->tkwin);
+ masterWidth -= masterX + Tk_InternalBorderRight(masterPtr->tkwin);
+ masterHeight -= masterY +
+ Tk_InternalBorderBottom(masterPtr->tkwin);
} else if (slavePtr->borderMode == BM_OUTSIDE) {
- masterBW = -Tk_Changes(masterPtr->tkwin)->border_width;
+ masterX = masterY = -Tk_Changes(masterPtr->tkwin)->border_width;
+ masterWidth -= 2 * masterX;
+ masterHeight -= 2 * masterY;
}
- masterWidth -= 2*masterBW;
- masterHeight -= 2*masterBW;
/*
* Step 2: compute size of slave (outside dimensions including
* border) and location of anchor point within master.
*/
- x1 = slavePtr->x + masterBW + (slavePtr->relX*masterWidth);
+ x1 = slavePtr->x + masterX + (slavePtr->relX*masterWidth);
x = (int) (x1 + ((x1 > 0) ? 0.5 : -0.5));
- y1 = slavePtr->y + masterBW + (slavePtr->relY*masterHeight);
+ y1 = slavePtr->y + masterY + (slavePtr->relY*masterHeight);
y = (int) (y1 + ((y1 > 0) ? 0.5 : -0.5));
if (slavePtr->flags & (CHILD_WIDTH|CHILD_REL_WIDTH)) {
width = 0;
@@ -1070,5 +1169,3 @@ PlaceLostSlaveProc(clientData, tkwin)
(ClientData) slavePtr);
ckfree((char *) slavePtr);
}
-
-
diff --git a/tk/generic/tkPlatDecls.h b/tk/generic/tkPlatDecls.h
index f2c31235b2a..c39e78ae091 100644
--- a/tk/generic/tkPlatDecls.h
+++ b/tk/generic/tkPlatDecls.h
@@ -25,7 +25,6 @@
* in the generic/tk.decls script.
*/
-
/* !BEGIN!: Do not edit below this line. */
/*
@@ -83,6 +82,40 @@ EXTERN int TkMacHaveAppearance _ANSI_ARGS_((void));
/* 10 */
EXTERN GWorldPtr TkMacGetDrawablePort _ANSI_ARGS_((Drawable drawable));
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+/* 0 */
+EXTERN void Tk_MacOSXSetEmbedHandler _ANSI_ARGS_((
+ Tk_MacOSXEmbedRegisterWinProc * registerWinProcPtr,
+ Tk_MacOSXEmbedGetGrafPortProc * getPortProcPtr,
+ Tk_MacOSXEmbedMakeContainerExistProc * containerExistProcPtr,
+ Tk_MacOSXEmbedGetClipProc * getClipProc,
+ Tk_MacOSXEmbedGetOffsetInParentProc * getOffsetProc));
+/* 1 */
+EXTERN void Tk_MacOSXTurnOffMenus _ANSI_ARGS_((void));
+/* 2 */
+EXTERN void Tk_MacOSXTkOwnsCursor _ANSI_ARGS_((int tkOwnsIt));
+/* 3 */
+EXTERN void TkMacOSXInitMenus _ANSI_ARGS_((Tcl_Interp * interp));
+/* 4 */
+EXTERN void TkMacOSXInitAppleEvents _ANSI_ARGS_((
+ Tcl_Interp * interp));
+/* 5 */
+EXTERN void TkGenWMConfigureEvent _ANSI_ARGS_((Tk_Window tkwin,
+ int x, int y, int width, int height,
+ int flags));
+/* 6 */
+EXTERN void TkMacOSXInvalClipRgns _ANSI_ARGS_((TkWindow * winPtr));
+/* 7 */
+EXTERN GWorldPtr TkMacOSXGetDrawablePort _ANSI_ARGS_((
+ Drawable drawable));
+/* 8 */
+EXTERN ControlRef TkMacOSXGetRootControl _ANSI_ARGS_((
+ Drawable drawable));
+/* 9 */
+EXTERN void Tk_MacOSXSetupTkNotifier _ANSI_ARGS_((void));
+/* 10 */
+EXTERN int Tk_MacOSXIsAppInFront _ANSI_ARGS_((void));
+#endif /* MAC_OSX_TK */
typedef struct TkPlatStubs {
int magic;
@@ -109,6 +142,19 @@ typedef struct TkPlatStubs {
int (*tkMacHaveAppearance) _ANSI_ARGS_((void)); /* 9 */
GWorldPtr (*tkMacGetDrawablePort) _ANSI_ARGS_((Drawable drawable)); /* 10 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ void (*tk_MacOSXSetEmbedHandler) _ANSI_ARGS_((Tk_MacOSXEmbedRegisterWinProc * registerWinProcPtr, Tk_MacOSXEmbedGetGrafPortProc * getPortProcPtr, Tk_MacOSXEmbedMakeContainerExistProc * containerExistProcPtr, Tk_MacOSXEmbedGetClipProc * getClipProc, Tk_MacOSXEmbedGetOffsetInParentProc * getOffsetProc)); /* 0 */
+ void (*tk_MacOSXTurnOffMenus) _ANSI_ARGS_((void)); /* 1 */
+ void (*tk_MacOSXTkOwnsCursor) _ANSI_ARGS_((int tkOwnsIt)); /* 2 */
+ void (*tkMacOSXInitMenus) _ANSI_ARGS_((Tcl_Interp * interp)); /* 3 */
+ void (*tkMacOSXInitAppleEvents) _ANSI_ARGS_((Tcl_Interp * interp)); /* 4 */
+ void (*tkGenWMConfigureEvent) _ANSI_ARGS_((Tk_Window tkwin, int x, int y, int width, int height, int flags)); /* 5 */
+ void (*tkMacOSXInvalClipRgns) _ANSI_ARGS_((TkWindow * winPtr)); /* 6 */
+ GWorldPtr (*tkMacOSXGetDrawablePort) _ANSI_ARGS_((Drawable drawable)); /* 7 */
+ ControlRef (*tkMacOSXGetRootControl) _ANSI_ARGS_((Drawable drawable)); /* 8 */
+ void (*tk_MacOSXSetupTkNotifier) _ANSI_ARGS_((void)); /* 9 */
+ int (*tk_MacOSXIsAppInFront) _ANSI_ARGS_((void)); /* 10 */
+#endif /* MAC_OSX_TK */
} TkPlatStubs;
#ifdef __cplusplus
@@ -197,6 +243,52 @@ extern TkPlatStubs *tkPlatStubsPtr;
(tkPlatStubsPtr->tkMacGetDrawablePort) /* 10 */
#endif
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+#ifndef Tk_MacOSXSetEmbedHandler
+#define Tk_MacOSXSetEmbedHandler \
+ (tkPlatStubsPtr->tk_MacOSXSetEmbedHandler) /* 0 */
+#endif
+#ifndef Tk_MacOSXTurnOffMenus
+#define Tk_MacOSXTurnOffMenus \
+ (tkPlatStubsPtr->tk_MacOSXTurnOffMenus) /* 1 */
+#endif
+#ifndef Tk_MacOSXTkOwnsCursor
+#define Tk_MacOSXTkOwnsCursor \
+ (tkPlatStubsPtr->tk_MacOSXTkOwnsCursor) /* 2 */
+#endif
+#ifndef TkMacOSXInitMenus
+#define TkMacOSXInitMenus \
+ (tkPlatStubsPtr->tkMacOSXInitMenus) /* 3 */
+#endif
+#ifndef TkMacOSXInitAppleEvents
+#define TkMacOSXInitAppleEvents \
+ (tkPlatStubsPtr->tkMacOSXInitAppleEvents) /* 4 */
+#endif
+#ifndef TkGenWMConfigureEvent
+#define TkGenWMConfigureEvent \
+ (tkPlatStubsPtr->tkGenWMConfigureEvent) /* 5 */
+#endif
+#ifndef TkMacOSXInvalClipRgns
+#define TkMacOSXInvalClipRgns \
+ (tkPlatStubsPtr->tkMacOSXInvalClipRgns) /* 6 */
+#endif
+#ifndef TkMacOSXGetDrawablePort
+#define TkMacOSXGetDrawablePort \
+ (tkPlatStubsPtr->tkMacOSXGetDrawablePort) /* 7 */
+#endif
+#ifndef TkMacOSXGetRootControl
+#define TkMacOSXGetRootControl \
+ (tkPlatStubsPtr->tkMacOSXGetRootControl) /* 8 */
+#endif
+#ifndef Tk_MacOSXSetupTkNotifier
+#define Tk_MacOSXSetupTkNotifier \
+ (tkPlatStubsPtr->tk_MacOSXSetupTkNotifier) /* 9 */
+#endif
+#ifndef Tk_MacOSXIsAppInFront
+#define Tk_MacOSXIsAppInFront \
+ (tkPlatStubsPtr->tk_MacOSXIsAppInFront) /* 10 */
+#endif
+#endif /* MAC_OSX_TK */
#endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
diff --git a/tk/generic/tkPointer.c b/tk/generic/tkPointer.c
index f51e82b7506..b9f26174335 100644
--- a/tk/generic/tkPointer.c
+++ b/tk/generic/tkPointer.c
@@ -20,7 +20,13 @@
#include "tkWinInt.h"
#endif
-#ifdef MAC_TCL
+#if defined(MAC_TCL)
+#include "tkMacInt.h"
+#define Cursor XCursor
+#endif
+
+#if defined(MAC_OSX_TK)
+#include "tkMacOSXInt.h"
#define Cursor XCursor
#endif
@@ -561,7 +567,7 @@ UpdateCursor(winPtr)
if (winPtr->atts.cursor != None) {
cursor = winPtr->atts.cursor;
break;
- } else if (winPtr->flags & TK_TOP_LEVEL) {
+ } else if (winPtr->flags & TK_TOP_HIERARCHY) {
break;
}
winPtr = winPtr->parentPtr;
@@ -645,4 +651,3 @@ TkGenerateActivateEvents(winPtr, active)
TkQueueEventForAllChildren(winPtr, &event);
}
-
diff --git a/tk/generic/tkPort.h b/tk/generic/tkPort.h
index aef9026bcc6..bf4b6e6e87e 100644
--- a/tk/generic/tkPort.h
+++ b/tk/generic/tkPort.h
@@ -28,10 +28,11 @@
#else
# if defined(MAC_TCL)
# include "tkMacPort.h"
+# elif defined(MAC_OSX_TK)
+# include "../macosx/tkMacOSXPort.h"
# else
# include "../unix/tkUnixPort.h"
# endif
#endif
#endif /* _TKPORT */
-
diff --git a/tk/generic/tkRectOval.c b/tk/generic/tkRectOval.c
index 0bb54885371..7fb0c1e3f8f 100644
--- a/tk/generic/tkRectOval.c
+++ b/tk/generic/tkRectOval.c
@@ -142,11 +142,11 @@ static Tk_ConfigSpec configSpecs[] = {
static void ComputeRectOvalBbox _ANSI_ARGS_((Tk_Canvas canvas,
RectOvalItem *rectOvalPtr));
static int ConfigureRectOval _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[], int flags));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[], int flags));
static int CreateRectOval _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, struct Tk_Item *itemPtr,
- int argc, Tcl_Obj *CONST argv[]));
+ int objc, Tcl_Obj *CONST objv[]));
static void DeleteRectOval _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, Display *display));
static void DisplayRectOval _ANSI_ARGS_((Tk_Canvas canvas,
@@ -157,8 +157,8 @@ static int OvalToArea _ANSI_ARGS_((Tk_Canvas canvas,
static double OvalToPoint _ANSI_ARGS_((Tk_Canvas canvas,
Tk_Item *itemPtr, double *pointPtr));
static int RectOvalCoords _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Canvas canvas, Tk_Item *itemPtr, int argc,
- Tcl_Obj *CONST argv[]));
+ Tk_Canvas canvas, Tk_Item *itemPtr, int objc,
+ Tcl_Obj *CONST objv[]));
static int RectOvalToPostscript _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Canvas canvas, Tk_Item *itemPtr, int prepass));
static int RectToArea _ANSI_ARGS_((Tk_Canvas canvas,
@@ -243,31 +243,28 @@ Tk_ItemType tkOvalType = {
*/
static int
-CreateRectOval(interp, canvas, itemPtr, argc, argv)
+CreateRectOval(interp, canvas, itemPtr, objc, objv)
Tcl_Interp *interp; /* 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. */
- Tcl_Obj *CONST argv[]; /* Arguments describing rectangle. */
+ int objc; /* Number of arguments in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing rectangle. */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
- int i;
+ int i = 4;
- if (argc==1) {
+ if (objc == 1) {
i = 1;
- } else {
- char *arg = Tcl_GetStringFromObj(argv[1], NULL);
- if ((argc>1) && (arg[0] == '-')
- && (arg[1] >= 'a') && (arg[1] <= 'z')) {
+ } else if (objc > 1) {
+ char *arg = Tcl_GetString(objv[1]);
+ if ((arg[0] == '-') && (arg[1] >= 'a') && (arg[1] <= 'z')) {
i = 1;
- } else {
- i = 4;
}
}
- if (argc < i) {
+ if (objc < i) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
Tk_PathName(Tk_CanvasTkwin(canvas)), " create ",
itemPtr->typePtr->name, " x1 y1 x2 y2 ?options?\"",
@@ -296,10 +293,10 @@ CreateRectOval(interp, canvas, itemPtr, argc, argv)
* Process the arguments to fill in the item record.
*/
- if ((RectOvalCoords(interp, canvas, itemPtr, i, argv) != TCL_OK)) {
+ if ((RectOvalCoords(interp, canvas, itemPtr, i, objv) != TCL_OK)) {
goto error;
}
- if (ConfigureRectOval(interp, canvas, itemPtr, argc-i, argv+i, 0)
+ if (ConfigureRectOval(interp, canvas, itemPtr, objc-i, objv+i, 0)
== TCL_OK) {
return TCL_OK;
}
@@ -328,19 +325,19 @@ CreateRectOval(interp, canvas, itemPtr, argc, argv)
*/
static int
-RectOvalCoords(interp, canvas, itemPtr, argc, argv)
+RectOvalCoords(interp, canvas, itemPtr, objc, objv)
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. */
- Tcl_Obj *CONST argv[]; /* Array of coordinates: x1, y1,
+ int objc; /* Number of coordinates supplied in
+ * objv. */
+ Tcl_Obj *CONST objv[]; /* Array of coordinates: x1, y1,
* x2, y2, ... */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
- if (argc == 0) {
+ if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
Tcl_Obj *subobj = Tcl_NewDoubleObj(rectOvalPtr->bbox[0]);
Tcl_ListObjAppendElement(interp, obj, subobj);
@@ -351,26 +348,26 @@ RectOvalCoords(interp, canvas, itemPtr, argc, argv)
subobj = Tcl_NewDoubleObj(rectOvalPtr->bbox[3]);
Tcl_ListObjAppendElement(interp, obj, subobj);
Tcl_SetObjResult(interp, obj);
- } else if ((argc == 1)||(argc == 4)) {
- if (argc==1) {
- if (Tcl_ListObjGetElements(interp, argv[0], &argc,
- (Tcl_Obj ***) &argv) != TCL_OK) {
+ } else if ((objc == 1)||(objc == 4)) {
+ if (objc==1) {
+ if (Tcl_ListObjGetElements(interp, objv[0], &objc,
+ (Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
- } else if (argc != 4) {
+ } else if (objc != 4) {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 0 or 4, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 0 or 4, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
}
- if ((Tk_CanvasGetCoordFromObj(interp, canvas, argv[0],
+ if ((Tk_CanvasGetCoordFromObj(interp, canvas, objv[0],
&rectOvalPtr->bbox[0]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[1],
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[1],
&rectOvalPtr->bbox[1]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[2],
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[2],
&rectOvalPtr->bbox[2]) != TCL_OK)
- || (Tk_CanvasGetCoordFromObj(interp, canvas, argv[3],
+ || (Tk_CanvasGetCoordFromObj(interp, canvas, objv[3],
&rectOvalPtr->bbox[3]) != TCL_OK)) {
return TCL_ERROR;
}
@@ -378,7 +375,7 @@ RectOvalCoords(interp, canvas, itemPtr, argc, argv)
} else {
char buf[64 + TCL_INTEGER_SPACE];
- sprintf(buf, "wrong # coordinates: expected 0 or 4, got %d", argc);
+ sprintf(buf, "wrong # coordinates: expected 0 or 4, got %d", objc);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
@@ -406,12 +403,12 @@ RectOvalCoords(interp, canvas, itemPtr, argc, argv)
*/
static int
-ConfigureRectOval(interp, canvas, itemPtr, argc, argv, flags)
+ConfigureRectOval(interp, canvas, itemPtr, objc, objv, flags)
Tcl_Interp *interp; /* Used for error reporting. */
Tk_Canvas canvas; /* Canvas containing itemPtr. */
Tk_Item *itemPtr; /* Rectangle item to reconfigure. */
- int argc; /* Number of elements in argv. */
- Tcl_Obj *CONST argv[]; /* Arguments describing things to configure. */
+ int objc; /* Number of elements in objv. */
+ Tcl_Obj *CONST objv[]; /* Arguments describing things to configure. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
RectOvalItem *rectOvalPtr = (RectOvalItem *) itemPtr;
@@ -426,8 +423,8 @@ ConfigureRectOval(interp, canvas, itemPtr, argc, argv, flags)
tkwin = Tk_CanvasTkwin(canvas);
- if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc, (char **) argv,
- (char *) rectOvalPtr, flags|TK_CONFIG_OBJS) != TCL_OK) {
+ if (TCL_OK != Tk_ConfigureWidget(interp, tkwin, configSpecs, objc,
+ (CONST char **) objv, (char *) rectOvalPtr, flags|TK_CONFIG_OBJS)) {
return TCL_ERROR;
}
state = itemPtr->state;
@@ -1392,5 +1389,3 @@ RectOvalToPostscript(interp, canvas, itemPtr, prepass)
}
return TCL_OK;
}
-
-
diff --git a/tk/generic/tkScale.c b/tk/generic/tkScale.c
index fb88fc3da7f..0b260726af1 100644
--- a/tk/generic/tkScale.c
+++ b/tk/generic/tkScale.c
@@ -147,7 +147,7 @@ static Tk_OptionSpec optionSpecs[] = {
* to dispatch the scale widget command.
*/
-static char *commandNames[] = {
+static CONST char *commandNames[] = {
"cget", "configure", "coords", "get", "identify", "set", (char *) NULL
};
@@ -171,8 +171,8 @@ static void ScaleCmdDeletedProc _ANSI_ARGS_((
static void ScaleEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
static char * ScaleVarProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, char *name1, char *name2,
- int flags));
+ Tcl_Interp *interp, CONST char *name1,
+ CONST char *name2, int flags));
static int ScaleWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
@@ -185,10 +185,9 @@ static void ScaleSetVariable _ANSI_ARGS_((TkScale *scalePtr));
* that can be invoked from generic window code.
*/
-static TkClassProcs scaleClass = {
- NULL, /* createProc. */
- ScaleWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+static Tk_ClassProcs scaleClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ ScaleWorldChanged, /* worldChangedProc */
};
@@ -212,7 +211,7 @@ static TkClassProcs scaleClass = {
int
Tk_ScaleObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Either NULL or pointer to option table. */
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument values. */
@@ -221,25 +220,6 @@ Tk_ScaleObjCmd(clientData, interp, objc, objv)
Tk_OptionTable optionTable;
Tk_Window tkwin;
- optionTable = (Tk_OptionTable) clientData;
- if (optionTable == NULL) {
- Tcl_CmdInfo info;
- char *name;
-
- /*
- * We haven't created the option table for this widget class
- * yet. Do it now and save the table as the clientData for
- * the command, so we'll have access to it in future
- * invocations of the command.
- */
-
- optionTable = Tk_CreateOptionTable(interp, optionSpecs);
- name = Tcl_GetString(objv[0]);
- Tcl_GetCommandInfo(interp, name, &info);
- info.objClientData = (ClientData) optionTable;
- Tcl_SetCommandInfo(interp, name, &info);
- }
-
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
return TCL_ERROR;
@@ -251,6 +231,13 @@ Tk_ScaleObjCmd(clientData, interp, objc, objv)
return TCL_ERROR;
}
+ /*
+ * Create the option table for this widget class. If it has already
+ * been created, the cached pointer will be returned.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, optionSpecs);
+
Tk_SetClass(tkwin, "Scale");
scalePtr = TkpCreateScale(tkwin);
@@ -314,7 +301,7 @@ Tk_ScaleObjCmd(clientData, interp, objc, objv)
scalePtr->takeFocusPtr = NULL;
scalePtr->flags = NEVER_SET;
- TkSetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr);
+ Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr);
Tk_CreateEventHandler(scalePtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
ScaleEventProc, (ClientData) scalePtr);
@@ -1198,8 +1185,8 @@ static char *
ScaleVarProc(clientData, interp, name1, name2, flags)
ClientData clientData; /* Information about button. */
Tcl_Interp *interp; /* Interpreter containing variable. */
- char *name1; /* Name of variable. */
- char *name2; /* Second part of variable name. */
+ CONST char *name1; /* Name of variable. */
+ CONST char *name2; /* Second part of variable name. */
int flags; /* Information about what happened. */
{
register TkScale *scalePtr = (TkScale *) clientData;
diff --git a/tk/generic/tkScale.h b/tk/generic/tkScale.h
index 8168aa7171f..972e571fda3 100644
--- a/tk/generic/tkScale.h
+++ b/tk/generic/tkScale.h
@@ -254,5 +254,3 @@ EXTERN int TkScaleValueToPixel _ANSI_ARGS_((TkScale *scalePtr,
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKSCALE */
-
-
diff --git a/tk/generic/tkScrollbar.c b/tk/generic/tkScrollbar.c
index d0f07c59000..d07e5d0e455 100644
--- a/tk/generic/tkScrollbar.c
+++ b/tk/generic/tkScrollbar.c
@@ -102,12 +102,12 @@ Tk_ConfigSpec tkpScrollbarConfigSpecs[] = {
*/
static int ConfigureScrollbar _ANSI_ARGS_((Tcl_Interp *interp,
- TkScrollbar *scrollPtr, int argc, char **argv,
+ TkScrollbar *scrollPtr, int argc, CONST char **argv,
int flags));
static void ScrollbarCmdDeletedProc _ANSI_ARGS_((
ClientData clientData));
static int ScrollbarWidgetCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *, int argc, char **argv));
+ Tcl_Interp *, int argc, CONST char **argv));
/*
*--------------------------------------------------------------
@@ -133,7 +133,7 @@ Tk_ScrollbarCmd(clientData, interp, argc, argv)
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
Tk_Window tkwin = (Tk_Window) clientData;
register TkScrollbar *scrollPtr;
@@ -153,7 +153,7 @@ Tk_ScrollbarCmd(clientData, interp, argc, argv)
Tk_SetClass(new, "Scrollbar");
scrollPtr = TkpCreateScrollbar(new);
- TkSetClassProcs(new, &tkpScrollbarProcs, (ClientData) scrollPtr);
+ Tk_SetClassProcs(new, &tkpScrollbarProcs, (ClientData) scrollPtr);
/*
* Initialize fields that won't be initialized by ConfigureScrollbar,
@@ -231,7 +231,7 @@ ScrollbarWidgetCmd(clientData, interp, argc, argv)
* widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
register TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
int result = TCL_OK;
@@ -538,7 +538,7 @@ ConfigureScrollbar(interp, scrollPtr, argc, argv, flags)
* may not already have values for
* some fields. */
int argc; /* Number of valid entries in argv. */
- char **argv; /* Arguments. */
+ CONST char **argv; /* Arguments. */
int flags; /* Flags to pass to
* Tk_ConfigureWidget. */
{
@@ -709,4 +709,3 @@ TkScrollbarEventuallyRedraw(scrollPtr)
scrollPtr->flags |= REDRAW_PENDING;
}
}
-
diff --git a/tk/generic/tkScrollbar.h b/tk/generic/tkScrollbar.h
index c6580640434..84cb80a75e9 100644
--- a/tk/generic/tkScrollbar.h
+++ b/tk/generic/tkScrollbar.h
@@ -171,7 +171,7 @@ typedef struct TkScrollbar {
* Declaration of scrollbar class procedures structure.
*/
-extern TkClassProcs tkpScrollbarProcs;
+extern Tk_ClassProcs tkpScrollbarProcs;
/*
* Declaration of scrollbar configuration options.
@@ -204,4 +204,3 @@ EXTERN int TkpScrollbarPosition _ANSI_ARGS_((
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKSCROLLBAR */
-
diff --git a/tk/generic/tkSelect.c b/tk/generic/tkSelect.c
index 45821e1e3b4..ea69a7ca90e 100644
--- a/tk/generic/tkSelect.c
+++ b/tk/generic/tkSelect.c
@@ -177,6 +177,48 @@ Tk_CreateSelHandler(tkwin, selection, target, proc, clientData, format)
} else {
selPtr->size = 32;
}
+
+ if ((target == XA_STRING) && (winPtr->dispPtr->utf8Atom != (Atom) NULL)) {
+ /*
+ * If the user asked for a STRING handler and we understand
+ * UTF8_STRING, we implicitly create a UTF8_STRING handler for them.
+ */
+
+ target = winPtr->dispPtr->utf8Atom;
+ for (selPtr = winPtr->selHandlerList; ;
+ selPtr = selPtr->nextPtr) {
+ if (selPtr == NULL) {
+ selPtr = (TkSelHandler *) ckalloc(sizeof(TkSelHandler));
+ selPtr->nextPtr = winPtr->selHandlerList;
+ winPtr->selHandlerList = selPtr;
+ selPtr->selection = selection;
+ selPtr->target = target;
+ selPtr->format = target; /* We want UTF8_STRING format */
+ selPtr->proc = proc;
+ if (selPtr->proc == HandleTclCommand) {
+ /*
+ * The clientData is selection controlled memory, so
+ * we should make a copy for this selPtr.
+ */
+ selPtr->clientData =
+ (ClientData) ckalloc(sizeof(clientData));
+ memcpy(selPtr->clientData, clientData, sizeof(clientData));
+ } else {
+ selPtr->clientData = clientData;
+ }
+ selPtr->size = 8;
+ break;
+ }
+ if ((selPtr->selection == selection)
+ && (selPtr->target == target)) {
+ /*
+ * Looks like we had a utf-8 target already. Leave it alone.
+ */
+
+ break;
+ }
+ }
+ }
}
/*
@@ -247,13 +289,43 @@ Tk_DeleteSelHandler(tkwin, selection, target)
} else {
prevPtr->nextPtr = selPtr->nextPtr;
}
+
+ if ((target == XA_STRING) && (winPtr->dispPtr->utf8Atom != (Atom) NULL)) {
+ /*
+ * If the user asked for a STRING handler and we understand
+ * UTF8_STRING, we may have implicitly created a UTF8_STRING handler
+ * for them. Look for it and delete it as necessary.
+ */
+ TkSelHandler *utf8selPtr;
+
+ target = winPtr->dispPtr->utf8Atom;
+ for (utf8selPtr = winPtr->selHandlerList; utf8selPtr != NULL;
+ utf8selPtr = utf8selPtr->nextPtr) {
+ if ((utf8selPtr->selection == selection)
+ && (utf8selPtr->target == target)) {
+ break;
+ }
+ }
+ if (utf8selPtr != NULL) {
+ if ((utf8selPtr->format == target)
+ && (utf8selPtr->proc == selPtr->proc)
+ && (utf8selPtr->size == selPtr->size)) {
+ /*
+ * This recursive call is OK, because we've
+ * changed the value of 'target'
+ */
+ Tk_DeleteSelHandler(tkwin, selection, target);
+ }
+ }
+ }
+
if (selPtr->proc == HandleTclCommand) {
/*
* Mark the CommandInfo as deleted and free it if we can.
*/
((CommandInfo*)selPtr->clientData)->interp = NULL;
- Tcl_EventuallyFree(selPtr->clientData, Tcl_Free);
+ Tcl_EventuallyFree(selPtr->clientData, TCL_DYNAMIC);
}
ckfree((char *) selPtr);
}
@@ -524,8 +596,8 @@ Tk_GetSelection(interp, tkwin, selection, target, proc, clientData)
TkSelInProgress ip;
for (selPtr = ((TkWindow *) infoPtr->owner)->selHandlerList;
- selPtr != NULL; selPtr = selPtr->nextPtr) {
- if ((selPtr->target == target)
+ selPtr != NULL; selPtr = selPtr->nextPtr) {
+ if ((selPtr->target == target)
&& (selPtr->selection == selection)) {
break;
}
@@ -589,7 +661,7 @@ Tk_GetSelection(interp, tkwin, selection, target, proc, clientData)
/*
*--------------------------------------------------------------
*
- * Tk_SelectionCmd --
+ * Tk_SelectionObjCmd --
*
* This procedure is invoked to process the "selection" Tcl
* command. See the user documentation for details on what
@@ -605,304 +677,351 @@ Tk_GetSelection(interp, tkwin, selection, target, proc, clientData)
*/
int
-Tk_SelectionCmd(clientData, interp, argc, argv)
+Tk_SelectionObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
char *path = NULL;
Atom selection;
- char *selName = NULL;
- int c, count;
- size_t length;
- char **args;
-
- if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " option ?arg arg ...?\"", (char *) NULL);
+ char *selName = NULL, *string;
+ int count, index;
+ Tcl_Obj **objs;
+ static CONST char *optionStrings[] = {
+ "clear", "get", "handle", "own", (char *) NULL
+ };
+ enum options { SELECTION_CLEAR, SELECTION_GET, SELECTION_HANDLE,
+ SELECTION_OWN };
+
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 'c') && (strncmp(argv[1], "clear", length) == 0)) {
- for (count = argc-2, args = argv+2; count > 0; count -= 2, args += 2) {
- if (args[0][0] != '-') {
- break;
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum options) index) {
+ case SELECTION_CLEAR: {
+ static CONST char *clearOptionStrings[] = {
+ "-displayof", "-selection", (char *) NULL
+ };
+ enum clearOptions { CLEAR_DISPLAYOF, CLEAR_SELECTION };
+ int clearIndex;
+
+ for (count = objc-2, objs = ((Tcl_Obj **)objv)+2; count > 0;
+ count-=2, objs+=2) {
+ string = Tcl_GetString(objs[0]);
+ if (string[0] != '-') {
+ break;
+ }
+ if (count < 2) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objs[0], clearOptionStrings,
+ "option", 0, &clearIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ switch ((enum clearOptions) clearIndex) {
+ case CLEAR_DISPLAYOF:
+ path = Tcl_GetString(objs[1]);
+ break;
+ case CLEAR_SELECTION:
+ selName = Tcl_GetString(objs[1]);
+ break;
+ }
}
- if (count < 2) {
- Tcl_AppendResult(interp, "value for \"", *args,
- "\" missing", (char *) NULL);
+ if (count == 1) {
+ path = Tcl_GetString(objs[0]);
+ } else if (count > 1) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options?");
return TCL_ERROR;
}
- c = args[0][1];
- length = strlen(args[0]);
- if ((c == 'd') && (strncmp(args[0], "-displayof", length) == 0)) {
- path = args[1];
- } else if ((c == 's')
- && (strncmp(args[0], "-selection", length) == 0)) {
- selName = args[1];
- } else {
- Tcl_AppendResult(interp, "unknown option \"", args[0],
- "\"", (char *) NULL);
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (tkwin == NULL) {
return TCL_ERROR;
}
+ if (selName != NULL) {
+ selection = Tk_InternAtom(tkwin, selName);
+ } else {
+ selection = XA_PRIMARY;
+ }
+
+ Tk_ClearSelection(tkwin, selection);
+ break;
}
- if (count == 1) {
- path = args[0];
- } else if (count > 1) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " clear ?options?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
- }
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (selName != NULL) {
- selection = Tk_InternAtom(tkwin, selName);
- } else {
- selection = XA_PRIMARY;
- }
+
+ case SELECTION_GET: {
+ Atom target;
+ char *targetName = NULL;
+ Tcl_DString selBytes;
+ int result;
+ static CONST char *getOptionStrings[] = {
+ "-displayof", "-selection", "-type", (char *) NULL
+ };
+ enum getOptions { GET_DISPLAYOF, GET_SELECTION, GET_TYPE };
+ int getIndex;
- Tk_ClearSelection(tkwin, selection);
- return TCL_OK;
- } else if ((c == 'g') && (strncmp(argv[1], "get", length) == 0)) {
- Atom target;
- char *targetName = NULL;
- Tcl_DString selBytes;
- int result;
-
- for (count = argc-2, args = argv+2; count > 0; count -= 2, args += 2) {
- if (args[0][0] != '-') {
- break;
+ for (count = objc-2, objs = ((Tcl_Obj **)objv)+2; count>0;
+ count-=2, objs+=2) {
+ string = Tcl_GetString(objs[0]);
+ if (string[0] != '-') {
+ break;
+ }
+ if (count < 2) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objs[0], getOptionStrings,
+ "option", 0, &getIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum getOptions) getIndex) {
+ case GET_DISPLAYOF:
+ path = Tcl_GetString(objs[1]);
+ break;
+ case GET_SELECTION:
+ selName = Tcl_GetString(objs[1]);
+ break;
+ case GET_TYPE:
+ targetName = Tcl_GetString(objs[1]);
+ break;
+ }
+ }
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
}
- if (count < 2) {
- Tcl_AppendResult(interp, "value for \"", *args,
- "\" missing", (char *) NULL);
+ if (tkwin == NULL) {
return TCL_ERROR;
}
- c = args[0][1];
- length = strlen(args[0]);
- if ((c == 'd') && (strncmp(args[0], "-displayof", length) == 0)) {
- path = args[1];
- } else if ((c == 's')
- && (strncmp(args[0], "-selection", length) == 0)) {
- selName = args[1];
- } else if ((c == 't')
- && (strncmp(args[0], "-type", length) == 0)) {
- targetName = args[1];
+ if (selName != NULL) {
+ selection = Tk_InternAtom(tkwin, selName);
} else {
- Tcl_AppendResult(interp, "unknown option \"", args[0],
- "\"", (char *) NULL);
+ selection = XA_PRIMARY;
+ }
+ if (count > 1) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options?");
return TCL_ERROR;
+ } else if (count == 1) {
+ target = Tk_InternAtom(tkwin, Tcl_GetString(objs[0]));
+ } else if (targetName != NULL) {
+ target = Tk_InternAtom(tkwin, targetName);
+ } else {
+ target = XA_STRING;
}
- }
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
- }
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (selName != NULL) {
- selection = Tk_InternAtom(tkwin, selName);
- } else {
- selection = XA_PRIMARY;
- }
- if (count > 1) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " get ?options?\"", (char *) NULL);
- return TCL_ERROR;
- } else if (count == 1) {
- target = Tk_InternAtom(tkwin, args[0]);
- } else if (targetName != NULL) {
- target = Tk_InternAtom(tkwin, targetName);
- } else {
- target = XA_STRING;
- }
- Tcl_DStringInit(&selBytes);
- result = Tk_GetSelection(interp, tkwin, selection, target, SelGetProc,
- (ClientData) &selBytes);
- if (result == TCL_OK) {
- Tcl_DStringResult(interp, &selBytes);
- } else {
- Tcl_DStringFree(&selBytes);
+ Tcl_DStringInit(&selBytes);
+ result = Tk_GetSelection(interp, tkwin, selection, target,
+ SelGetProc, (ClientData) &selBytes);
+ if (result == TCL_OK) {
+ Tcl_DStringResult(interp, &selBytes);
+ } else {
+ Tcl_DStringFree(&selBytes);
+ }
+ return result;
}
- return result;
- } else if ((c == 'h') && (strncmp(argv[1], "handle", length) == 0)) {
- Atom target, format;
- char *targetName = NULL;
- char *formatName = NULL;
- register CommandInfo *cmdInfoPtr;
- int cmdLength;
-
- for (count = argc-2, args = argv+2; count > 0; count -= 2, args += 2) {
- if (args[0][0] != '-') {
- break;
+
+ case SELECTION_HANDLE: {
+ Atom target, format;
+ char *targetName = NULL;
+ char *formatName = NULL;
+ register CommandInfo *cmdInfoPtr;
+ int cmdLength;
+ static CONST char *handleOptionStrings[] = {
+ "-format", "-selection", "-type", (char *) NULL
+ };
+ enum handleOptions { HANDLE_FORMAT, HANDLE_SELECTION,
+ HANDLE_TYPE };
+ int handleIndex;
+
+ for (count = objc-2, objs = ((Tcl_Obj **)objv)+2; count > 0;
+ count-=2, objs+=2) {
+ string = Tcl_GetString(objs[0]);
+ if (string[0] != '-') {
+ break;
+ }
+ if (count < 2) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objs[0],handleOptionStrings,
+ "option", 0, &handleIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum handleOptions) handleIndex) {
+ case HANDLE_FORMAT:
+ formatName = Tcl_GetString(objs[1]);
+ break;
+ case HANDLE_SELECTION:
+ selName = Tcl_GetString(objs[1]);
+ break;
+ case HANDLE_TYPE:
+ targetName = Tcl_GetString(objs[1]);
+ break;
+ }
}
- if (count < 2) {
- Tcl_AppendResult(interp, "value for \"", *args,
- "\" missing", (char *) NULL);
+
+ if ((count < 2) || (count > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options? window command");
return TCL_ERROR;
}
- c = args[0][1];
- length = strlen(args[0]);
- if ((c == 'f') && (strncmp(args[0], "-format", length) == 0)) {
- formatName = args[1];
- } else if ((c == 's')
- && (strncmp(args[0], "-selection", length) == 0)) {
- selName = args[1];
- } else if ((c == 't')
- && (strncmp(args[0], "-type", length) == 0)) {
- targetName = args[1];
- } else {
- Tcl_AppendResult(interp, "unknown option \"", args[0],
- "\"", (char *) NULL);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objs[0]), tkwin);
+ if (tkwin == NULL) {
return TCL_ERROR;
}
- }
-
- if ((count < 2) || (count > 4)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " handle ?options? window command\"", (char *) NULL);
- return TCL_ERROR;
- }
- tkwin = Tk_NameToWindow(interp, args[0], tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (selName != NULL) {
- selection = Tk_InternAtom(tkwin, selName);
- } else {
- selection = XA_PRIMARY;
- }
+ if (selName != NULL) {
+ selection = Tk_InternAtom(tkwin, selName);
+ } else {
+ selection = XA_PRIMARY;
+ }
- if (count > 2) {
- target = Tk_InternAtom(tkwin, args[2]);
- } else if (targetName != NULL) {
- target = Tk_InternAtom(tkwin, targetName);
- } else {
- target = XA_STRING;
- }
- if (count > 3) {
- format = Tk_InternAtom(tkwin, args[3]);
- } else if (formatName != NULL) {
- format = Tk_InternAtom(tkwin, formatName);
- } else {
- format = XA_STRING;
- }
- cmdLength = strlen(args[1]);
- if (cmdLength == 0) {
- Tk_DeleteSelHandler(tkwin, selection, target);
- } else {
- cmdInfoPtr = (CommandInfo *) ckalloc((unsigned) (
+ if (count > 2) {
+ target = Tk_InternAtom(tkwin, Tcl_GetString(objs[2]));
+ } else if (targetName != NULL) {
+ target = Tk_InternAtom(tkwin, targetName);
+ } else {
+ target = XA_STRING;
+ }
+ if (count > 3) {
+ format = Tk_InternAtom(tkwin, Tcl_GetString(objs[3]));
+ } else if (formatName != NULL) {
+ format = Tk_InternAtom(tkwin, formatName);
+ } else {
+ format = XA_STRING;
+ }
+ string = Tcl_GetStringFromObj(objs[1], &cmdLength);
+ if (cmdLength == 0) {
+ Tk_DeleteSelHandler(tkwin, selection, target);
+ } else {
+ cmdInfoPtr = (CommandInfo *) ckalloc((unsigned) (
sizeof(CommandInfo) - 3 + cmdLength));
- cmdInfoPtr->interp = interp;
- cmdInfoPtr->charOffset = 0;
- cmdInfoPtr->byteOffset = 0;
- cmdInfoPtr->buffer[0] = '\0';
- cmdInfoPtr->cmdLength = cmdLength;
- strcpy(cmdInfoPtr->command, args[1]);
- Tk_CreateSelHandler(tkwin, selection, target, HandleTclCommand,
- (ClientData) cmdInfoPtr, format);
+ cmdInfoPtr->interp = interp;
+ cmdInfoPtr->charOffset = 0;
+ cmdInfoPtr->byteOffset = 0;
+ cmdInfoPtr->buffer[0] = '\0';
+ cmdInfoPtr->cmdLength = cmdLength;
+ strcpy(cmdInfoPtr->command, string);
+ Tk_CreateSelHandler(tkwin, selection, target, HandleTclCommand,
+ (ClientData) cmdInfoPtr, format);
+ }
+ return TCL_OK;
}
- return TCL_OK;
- } else if ((c == 'o') && (strncmp(argv[1], "own", length) == 0)) {
- register LostCommand *lostPtr;
- char *script = NULL;
- int cmdLength;
-
- for (count = argc-2, args = argv+2; count > 0; count -= 2, args += 2) {
- if (args[0][0] != '-') {
- break;
+
+ case SELECTION_OWN: {
+ register LostCommand *lostPtr;
+ char *script = NULL;
+ int cmdLength;
+ static CONST char *ownOptionStrings[] = {
+ "-command", "-displayof", "-selection", (char *) NULL
+ };
+ enum ownOptions { OWN_COMMAND, OWN_DISPLAYOF, OWN_SELECTION };
+ int ownIndex;
+
+ for (count = objc-2, objs = ((Tcl_Obj **)objv)+2; count > 0;
+ count-=2, objs+=2) {
+ string = Tcl_GetString(objs[0]);
+ if (string[0] != '-') {
+ break;
+ }
+ if (count < 2) {
+ Tcl_AppendResult(interp, "value for \"", string,
+ "\" missing", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objs[0], ownOptionStrings,
+ "option", 0, &ownIndex) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ switch ((enum ownOptions) ownIndex) {
+ case OWN_COMMAND:
+ script = Tcl_GetString(objs[1]);
+ break;
+ case OWN_DISPLAYOF:
+ path = Tcl_GetString(objs[1]);
+ break;
+ case OWN_SELECTION:
+ selName = Tcl_GetString(objs[1]);
+ break;
+ }
}
- if (count < 2) {
- Tcl_AppendResult(interp, "value for \"", *args,
- "\" missing", (char *) NULL);
+
+ if (count > 2) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?options? ?window?");
return TCL_ERROR;
}
- c = args[0][1];
- length = strlen(args[0]);
- if ((c == 'c') && (strncmp(args[0], "-command", length) == 0)) {
- script = args[1];
- } else if ((c == 'd')
- && (strncmp(args[0], "-displayof", length) == 0)) {
- path = args[1];
- } else if ((c == 's')
- && (strncmp(args[0], "-selection", length) == 0)) {
- selName = args[1];
+ if (selName != NULL) {
+ selection = Tk_InternAtom(tkwin, selName);
} else {
- Tcl_AppendResult(interp, "unknown option \"", args[0],
- "\"", (char *) NULL);
- return TCL_ERROR;
+ selection = XA_PRIMARY;
}
- }
-
- if (count > 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " own ?options? ?window?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (selName != NULL) {
- selection = Tk_InternAtom(tkwin, selName);
- } else {
- selection = XA_PRIMARY;
- }
- if (count == 0) {
- TkSelectionInfo *infoPtr;
- TkWindow *winPtr;
- if (path != NULL) {
- tkwin = Tk_NameToWindow(interp, path, tkwin);
+ if (count == 0) {
+ TkSelectionInfo *infoPtr;
+ TkWindow *winPtr;
+ if (path != NULL) {
+ tkwin = Tk_NameToWindow(interp, path, tkwin);
+ }
+ if (tkwin == NULL) {
+ return TCL_ERROR;
+ }
+ winPtr = (TkWindow *)tkwin;
+ for (infoPtr = winPtr->dispPtr->selectionInfoPtr;
+ infoPtr != NULL; infoPtr = infoPtr->nextPtr) {
+ if (infoPtr->selection == selection)
+ break;
+ }
+
+ /*
+ * Ignore the internal clipboard window.
+ */
+
+ if ((infoPtr != NULL)
+ && (infoPtr->owner != winPtr->dispPtr->clipWindow)) {
+ Tcl_SetResult(interp, Tk_PathName(infoPtr->owner),
+ TCL_STATIC);
+ }
+ return TCL_OK;
}
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objs[0]), tkwin);
if (tkwin == NULL) {
return TCL_ERROR;
}
- winPtr = (TkWindow *)tkwin;
- for (infoPtr = winPtr->dispPtr->selectionInfoPtr; infoPtr != NULL;
- infoPtr = infoPtr->nextPtr) {
- if (infoPtr->selection == selection)
- break;
+ if (count == 2) {
+ script = Tcl_GetString(objs[1]);
}
-
- /*
- * Ignore the internal clipboard window.
- */
-
- if ((infoPtr != NULL)
- && (infoPtr->owner != winPtr->dispPtr->clipWindow)) {
- Tcl_SetResult(interp, Tk_PathName(infoPtr->owner), TCL_STATIC);
+ if (script == NULL) {
+ Tk_OwnSelection(tkwin, selection, (Tk_LostSelProc *) NULL,
+ (ClientData) NULL);
+ return TCL_OK;
}
+ cmdLength = strlen(script);
+ lostPtr = (LostCommand *) ckalloc((unsigned) (sizeof(LostCommand)
+ -3 + cmdLength));
+ lostPtr->interp = interp;
+ strcpy(lostPtr->command, script);
+ Tk_OwnSelection(tkwin, selection, LostSelection,
+ (ClientData) lostPtr);
return TCL_OK;
}
- tkwin = Tk_NameToWindow(interp, args[0], tkwin);
- if (tkwin == NULL) {
- return TCL_ERROR;
- }
- if (count == 2) {
- script = args[1];
- }
- if (script == NULL) {
- Tk_OwnSelection(tkwin, selection, (Tk_LostSelProc *) NULL,
- (ClientData) NULL);
- return TCL_OK;
- }
- cmdLength = strlen(script);
- lostPtr = (LostCommand *) ckalloc((unsigned) (sizeof(LostCommand)
- -3 + cmdLength));
- lostPtr->interp = interp;
- strcpy(lostPtr->command, script);
- Tk_OwnSelection(tkwin, selection, LostSelection, (ClientData) lostPtr);
- return TCL_OK;
- } else {
- Tcl_AppendResult(interp, "bad option \"", argv[1],
- "\": must be clear, get, handle, or own", (char *) NULL);
- return TCL_ERROR;
}
+ return TCL_OK;
}
/*
@@ -1003,11 +1122,11 @@ TkSelDeadWindow(winPtr)
}
if (selPtr->proc == HandleTclCommand) {
/*
- * Mark the CommandInfo as deleted and free it if we can.
+ * Mark the CommandInfo as deleted and free it when we can.
*/
((CommandInfo*)selPtr->clientData)->interp = NULL;
- Tcl_EventuallyFree(selPtr->clientData, Tcl_Free);
+ Tcl_EventuallyFree(selPtr->clientData, TCL_DYNAMIC);
}
ckfree((char *) selPtr);
}
@@ -1062,15 +1181,29 @@ TkSelInit(tkwin)
* Fetch commonly-used atoms.
*/
- dispPtr->multipleAtom = Tk_InternAtom(tkwin, "MULTIPLE");
- dispPtr->incrAtom = Tk_InternAtom(tkwin, "INCR");
- dispPtr->targetsAtom = Tk_InternAtom(tkwin, "TARGETS");
- dispPtr->timestampAtom = Tk_InternAtom(tkwin, "TIMESTAMP");
- dispPtr->textAtom = Tk_InternAtom(tkwin, "TEXT");
- dispPtr->compoundTextAtom = Tk_InternAtom(tkwin, "COMPOUND_TEXT");
- dispPtr->applicationAtom = Tk_InternAtom(tkwin, "TK_APPLICATION");
- dispPtr->windowAtom = Tk_InternAtom(tkwin, "TK_WINDOW");
- dispPtr->clipboardAtom = Tk_InternAtom(tkwin, "CLIPBOARD");
+ dispPtr->multipleAtom = Tk_InternAtom(tkwin, "MULTIPLE");
+ dispPtr->incrAtom = Tk_InternAtom(tkwin, "INCR");
+ dispPtr->targetsAtom = Tk_InternAtom(tkwin, "TARGETS");
+ dispPtr->timestampAtom = Tk_InternAtom(tkwin, "TIMESTAMP");
+ dispPtr->textAtom = Tk_InternAtom(tkwin, "TEXT");
+ dispPtr->compoundTextAtom = Tk_InternAtom(tkwin, "COMPOUND_TEXT");
+ dispPtr->applicationAtom = Tk_InternAtom(tkwin, "TK_APPLICATION");
+ dispPtr->windowAtom = Tk_InternAtom(tkwin, "TK_WINDOW");
+ dispPtr->clipboardAtom = Tk_InternAtom(tkwin, "CLIPBOARD");
+
+ /*
+ * Using UTF8_STRING instead of the XA_UTF8_STRING macro allows us
+ * to support older X servers that didn't have UTF8_STRING yet.
+ * This is necessary on Unix systems.
+ * For more information, see:
+ * http://www.cl.cam.ac.uk/~mgk25/unicode.html#x11
+ */
+
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
+ dispPtr->utf8Atom = Tk_InternAtom(tkwin, "UTF8_STRING");
+#else
+ dispPtr->utf8Atom = (Atom) NULL;
+#endif
}
/*
@@ -1207,7 +1340,7 @@ HandleTclCommand(clientData, offset, buffer, maxBytes)
Tcl_DString oldResult;
Tcl_Obj *objPtr;
int extraBytes, charOffset, count, numChars;
- char *p;
+ CONST char *p;
/*
* We must also protect the interpreter and the command from being
@@ -1355,7 +1488,7 @@ TkSelDefaultSelection(infoPtr, target, buffer, maxBytes, typePtr)
if (target == dispPtr->targetsAtom) {
register TkSelHandler *selPtr;
- char *atomString;
+ CONST char *atomString;
int length, atomLength;
if (maxBytes < 50) {
@@ -1384,7 +1517,7 @@ TkSelDefaultSelection(infoPtr, target, buffer, maxBytes, typePtr)
if (target == dispPtr->applicationAtom) {
int length;
- char *name = winPtr->mainPtr->winPtr->nameUid;
+ Tk_Uid name = winPtr->mainPtr->winPtr->nameUid;
length = strlen(name);
if (maxBytes <= length) {
@@ -1464,4 +1597,3 @@ LostSelection(clientData)
ckfree((char *) lostPtr);
}
-
diff --git a/tk/generic/tkSelect.h b/tk/generic/tkSelect.h
index 7cce9bbc290..c046f6c4baa 100644
--- a/tk/generic/tkSelect.h
+++ b/tk/generic/tkSelect.h
@@ -183,4 +183,3 @@ extern void TkSelUpdateClipboard _ANSI_ARGS_((TkWindow *winPtr,
#endif
#endif /* _TKSELECT */
-
diff --git a/tk/generic/tkSquare.c b/tk/generic/tkSquare.c
index 983969c1f4d..50615ffbcaf 100644
--- a/tk/generic/tkSquare.c
+++ b/tk/generic/tkSquare.c
@@ -60,7 +60,7 @@ typedef struct {
* Information used for argv parsing.
*/
-static Tk_OptionSpec configSpecs[] = {
+static Tk_OptionSpec optionSpecs[] = {
{TK_OPTION_BORDER, "-background", "background", "Background",
"#d9d9d9", Tk_Offset(Square, bgBorderPtr), -1, 0,
(ClientData) "white"},
@@ -104,7 +104,7 @@ static void SquareDisplay _ANSI_ARGS_((ClientData clientData));
static void KeepInWindow _ANSI_ARGS_((Square *squarePtr));
static void SquareObjEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
-static int SquareWidgetCmd _ANSI_ARGS_((ClientData clientData,
+static int SquareWidgetObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]));
/*
@@ -126,32 +126,14 @@ static int SquareWidgetCmd _ANSI_ARGS_((ClientData clientData,
int
SquareObjCmd(clientData, interp, objc, objv)
- ClientData clientData; /* Main window associated with
- * interpreter. */
+ ClientData clientData; /* NULL. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
Tcl_Obj * CONST objv[]; /* Argument objects. */
{
Square *squarePtr;
Tk_Window tkwin;
- Tk_OptionTable optionTable = (Tk_OptionTable) clientData;
- Tcl_CmdInfo info;
- char *commandName;
-
- if (optionTable == NULL) {
- /*
- * The first time this procedure is invoked, optionTable will
- * be NULL. We then create the option table from the template
- * and store the table pointer as the command's clinical so
- * we'll have easy access to it in the future.
- */
-
- optionTable = Tk_CreateOptionTable(interp, configSpecs);
- commandName = Tcl_GetStringFromObj(objv[0], (int *) NULL);
- Tcl_GetCommandInfo(interp, commandName, &info);
- info.clientData = (ClientData) optionTable;
- Tcl_SetCommandInfo(interp, commandName, &info);
- }
+ Tk_OptionTable optionTable;
if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
@@ -166,29 +148,31 @@ SquareObjCmd(clientData, interp, objc, objv)
Tk_SetClass(tkwin, "Square");
/*
- * Allocate and initialize the widget record.
+ * Create the option table for this widget class. If it has
+ * already been created, the refcount will get bumped and just
+ * the pointer will be returned. The refcount getting bumped
+ * does not concern us, because Tk will ensure the table is
+ * deleted when the interpreter is destroyed.
+ */
+
+ optionTable = Tk_CreateOptionTable(interp, optionSpecs);
+
+ /*
+ * Allocate and initialize the widget record. The memset allows
+ * us to set just the non-NULL/0 items.
*/
- squarePtr = (Square *) ckalloc(sizeof(Square));
- squarePtr->tkwin = tkwin;
- squarePtr->display = Tk_Display(tkwin);
- squarePtr->interp = interp;
- squarePtr->widgetCmd = Tcl_CreateObjCommand(interp,
- Tk_PathName(squarePtr->tkwin), SquareWidgetCmd,
+ squarePtr = (Square *) ckalloc(sizeof(Square));
+ memset((void *) squarePtr, 0, (sizeof(Square)));
+
+ squarePtr->tkwin = tkwin;
+ squarePtr->display = Tk_Display(tkwin);
+ squarePtr->interp = interp;
+ squarePtr->widgetCmd = Tcl_CreateObjCommand(interp,
+ Tk_PathName(squarePtr->tkwin), SquareWidgetObjCmd,
(ClientData) squarePtr, SquareDeletedProc);
- squarePtr->xPtr = NULL;
- squarePtr->yPtr = NULL;
- squarePtr->x = 0;
- squarePtr->y = 0;
- squarePtr->sizeObjPtr = NULL;
- squarePtr->borderWidthPtr = NULL;
- squarePtr->bgBorderPtr = NULL;
- squarePtr->fgBorderPtr = NULL;
- squarePtr->reliefPtr = NULL;
- squarePtr->gc = None;
- squarePtr->doubleBufferPtr = NULL;
- squarePtr->updatePending = 0;
- squarePtr->optionTable = optionTable;
+ squarePtr->gc = None;
+ squarePtr->optionTable = optionTable;
if (Tk_InitOptions(interp, (char *) squarePtr, optionTable, tkwin)
!= TCL_OK) {
@@ -207,8 +191,8 @@ SquareObjCmd(clientData, interp, objc, objv)
goto error;
}
- Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(squarePtr->tkwin),
- -1));
+ Tcl_SetObjResult(interp,
+ Tcl_NewStringObj(Tk_PathName(squarePtr->tkwin), -1));
return TCL_OK;
error:
@@ -219,7 +203,7 @@ error:
/*
*--------------------------------------------------------------
*
- * SquareWidgetCmd --
+ * SquareWidgetObjCmd --
*
* This procedure is invoked to process the Tcl command
* that corresponds to a widget managed by this module.
@@ -235,7 +219,7 @@ error:
*/
static int
-SquareWidgetCmd(clientData, interp, objc, objv)
+SquareWidgetObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Information about square widget. */
Tcl_Interp *interp; /* Current interpreter. */
int objc; /* Number of arguments. */
@@ -243,7 +227,7 @@ SquareWidgetCmd(clientData, interp, objc, objv)
{
Square *squarePtr = (Square *) clientData;
int result = TCL_OK;
- static char *squareOptions[] = {"cget", "configure", (char *) NULL};
+ static CONST char *squareOptions[] = {"cget", "configure", (char *) NULL};
enum {
SQUARE_CGET, SQUARE_CONFIGURE
};
@@ -635,4 +619,3 @@ KeepInWindow(squarePtr)
squarePtr->y = bd;
}
}
-
diff --git a/tk/generic/tkStubImg.c b/tk/generic/tkStubImg.c
index 024e581c578..842fb0eceb9 100644
--- a/tk/generic/tkStubImg.c
+++ b/tk/generic/tkStubImg.c
@@ -61,6 +61,8 @@ Tk_InitImageArgs(interp, argc, argvPtr)
}
if (cmdInfo.isNativeObjectProc == 1) {
useNewImage = 1; /* Tk uses the new image interface */
+ } else {
+ useNewImage = 0; /* Tk uses old image interface */
}
}
if (useNewImage && (argc > 0)) {
@@ -72,4 +74,3 @@ Tk_InitImageArgs(interp, argc, argvPtr)
*argvPtr = (char **) argv;
}
}
-
diff --git a/tk/generic/tkStubInit.c b/tk/generic/tkStubInit.c
index 5dc7b43920a..f6558a8f47c 100644
--- a/tk/generic/tkStubInit.c
+++ b/tk/generic/tkStubInit.c
@@ -14,13 +14,25 @@
#include "tkInt.h"
#include "tkPort.h"
+#if !(defined(__WIN32__) && defined(MAC_TCL) || defined(MAC_OSX_TK))
+/* UNIX */
+#define UNIX_TK
+#endif
+
#ifdef __WIN32__
#include "tkWinInt.h"
#endif
-#ifdef MAC_TCL
+#if defined(MAC_TCL)
+/* set this locally .. we could have used _TKMACINT */
+#define MAC_TK
#include "tkMacInt.h"
#endif
+#if defined(MAC_OSX_TK)
+/* set this locally .. we could have used _TKMACINT */
+#include "tkMacOSXInt.h"
+#endif
+
#include "tkDecls.h"
#include "tkPlatDecls.h"
#include "tkIntDecls.h"
@@ -131,7 +143,7 @@ TkIntStubs tkIntStubs = {
TkSelEventProc, /* 81 */
TkSelInit, /* 82 */
TkSelPropProc, /* 83 */
- TkSetClassProcs, /* 84 */
+ NULL, /* 84 */
TkSetWindowMenuBar, /* 85 */
TkStringToKeysym, /* 86 */
TkThickPolyLineToArea, /* 87 */
@@ -169,6 +181,9 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkClipBox, /* 113 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkClipBox, /* 113 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 114 */
#endif /* UNIX */
@@ -178,6 +193,9 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkCreateRegion, /* 114 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkCreateRegion, /* 114 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 115 */
#endif /* UNIX */
@@ -187,6 +205,9 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkDestroyRegion, /* 115 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkDestroyRegion, /* 115 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 116 */
#endif /* UNIX */
@@ -196,6 +217,9 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkIntersectRegion, /* 116 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkIntersectRegion, /* 116 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 117 */
#endif /* UNIX */
@@ -205,6 +229,9 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkRectInRegion, /* 117 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkRectInRegion, /* 117 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 118 */
#endif /* UNIX */
@@ -214,6 +241,9 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkSetRegion, /* 118 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkSetRegion, /* 118 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 119 */
#endif /* UNIX */
@@ -223,15 +253,10 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkUnionRectWithRegion, /* 119 */
#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 120 */
-#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef MAC_OSX_TK
+ TkUnionRectWithRegion, /* 119 */
+#endif /* MAC_OSX_TK */
NULL, /* 120 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkGenerateActivateEvents, /* 120 */
-#endif /* MAC_TCL */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 121 */
#endif /* UNIX */
@@ -241,6 +266,9 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkpCreateNativeBitmap, /* 121 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkpCreateNativeBitmap, /* 121 */
+#endif /* MAC_OSX_TK */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 122 */
#endif /* UNIX */
@@ -250,15 +278,10 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkpDefineNativeBitmaps, /* 122 */
#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 123 */
-#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef MAC_OSX_TK
+ TkpDefineNativeBitmaps, /* 122 */
+#endif /* MAC_OSX_TK */
NULL, /* 123 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkpGetMS, /* 123 */
-#endif /* MAC_TCL */
#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 124 */
#endif /* UNIX */
@@ -268,100 +291,48 @@ TkIntStubs tkIntStubs = {
#ifdef MAC_TCL
TkpGetNativeAppBitmap, /* 124 */
#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 125 */
-#endif /* UNIX */
-#ifdef __WIN32__
+#ifdef MAC_OSX_TK
+ TkpGetNativeAppBitmap, /* 124 */
+#endif /* MAC_OSX_TK */
NULL, /* 125 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkPointerDeadWindow, /* 125 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 126 */
-#endif /* UNIX */
-#ifdef __WIN32__
- NULL, /* 126 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkpSetCapture, /* 126 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 127 */
-#endif /* UNIX */
-#ifdef __WIN32__
NULL, /* 127 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkpSetCursor, /* 127 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 128 */
-#endif /* UNIX */
-#ifdef __WIN32__
- NULL, /* 128 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkpWmSetState, /* 128 */
-#endif /* MAC_TCL */
NULL, /* 129 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 130 */
-#endif /* UNIX */
-#ifdef __WIN32__
- NULL, /* 130 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkGetTransientMaster, /* 130 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 131 */
-#endif /* UNIX */
-#ifdef __WIN32__
NULL, /* 131 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkGenerateButtonEvent, /* 131 */
-#endif /* MAC_TCL */
NULL, /* 132 */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- NULL, /* 133 */
-#endif /* UNIX */
-#ifdef __WIN32__
NULL, /* 133 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkGenWMDestroyEvent, /* 133 */
-#endif /* MAC_TCL */
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
NULL, /* 134 */
-#endif /* UNIX */
-#ifdef __WIN32__
- NULL, /* 134 */
-#endif /* __WIN32__ */
-#ifdef MAC_TCL
- TkGenWMConfigureEvent, /* 134 */
-#endif /* MAC_TCL */
TkpDrawHighlightBorder, /* 135 */
TkSetFocusWin, /* 136 */
TkpSetKeycodeAndState, /* 137 */
TkpGetKeySym, /* 138 */
TkpInitKeymapInfo, /* 139 */
+ TkPhotoGetValidRegion, /* 140 */
+ TkWmStackorderToplevel, /* 141 */
+ TkFocusFree, /* 142 */
+ TkClipCleanup, /* 143 */
+ TkGCCleanup, /* 144 */
+#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
+ NULL, /* 145 */
+#endif /* UNIX */
+#ifdef __WIN32__
+ TkSubtractRegion, /* 145 */
+#endif /* __WIN32__ */
+#ifdef MAC_TCL
+ TkSubtractRegion, /* 145 */
+#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkSubtractRegion, /* 145 */
+#endif /* MAC_OSX_TK */
+ TkStylePkgInit, /* 146 */
+ TkStylePkgFree, /* 147 */
};
TkIntPlatStubs tkIntPlatStubs = {
TCL_STUB_MAGIC,
NULL,
-#if !defined(__WIN32__) && !defined(MAC_TCL) /* UNIX */
- TkCreateXEventSource, /* 0 */
- TkFreeWindowId, /* 1 */
- TkInitXId, /* 2 */
- TkpCmapStressed, /* 3 */
- TkpSync, /* 4 */
- TkUnixContainerId, /* 5 */
- TkUnixDoOneXEvent, /* 6 */
- TkUnixSetMenubar, /* 7 */
-#endif /* UNIX */
#ifdef __WIN32__
TkAlignImageData, /* 0 */
NULL, /* 1 */
@@ -400,8 +371,8 @@ TkIntPlatStubs tkIntPlatStubs = {
#endif /* __WIN32__ */
#ifdef MAC_TCL
TkGenerateActivateEvents, /* 0 */
- TkpCreateNativeBitmap, /* 1 */
- TkpDefineNativeBitmaps, /* 2 */
+ NULL, /* 1 */
+ NULL, /* 2 */
TkpGetMS, /* 3 */
NULL, /* 4 */
TkPointerDeadWindow, /* 5 */
@@ -416,27 +387,27 @@ TkIntPlatStubs tkIntPlatStubs = {
TkGenerateButtonEvent, /* 14 */
NULL, /* 15 */
TkGenWMDestroyEvent, /* 16 */
- TkGenWMConfigureEvent, /* 17 */
+ NULL, /* 17 */
TkMacButtonKeyState, /* 18 */
TkMacClearMenubarActive, /* 19 */
- TkMacConvertEvent, /* 20 */
+ NULL, /* 20 */
TkMacDispatchMenuEvent, /* 21 */
TkMacInstallCursor, /* 22 */
- TkMacConvertTkEvent, /* 23 */
+ NULL, /* 23 */
TkMacHandleTearoffMenu, /* 24 */
NULL, /* 25 */
- TkMacInvalClipRgns, /* 26 */
+ NULL, /* 26 */
TkMacDoHLEvent, /* 27 */
NULL, /* 28 */
TkMacGenerateTime, /* 29 */
- TkMacGetDrawablePort, /* 30 */
+ NULL, /* 30 */
TkMacGetScrollbarGrowWindow, /* 31 */
TkMacGetXWindow, /* 32 */
TkMacGrowToplevel, /* 33 */
TkMacHandleMenuSelect, /* 34 */
- TkMacHaveAppearance, /* 35 */
- TkMacInitAppleEvents, /* 36 */
- TkMacInitMenus, /* 37 */
+ NULL, /* 35 */
+ NULL, /* 36 */
+ NULL, /* 37 */
TkMacInvalidateWindow, /* 38 */
TkMacIsCharacterMissing, /* 39 */
TkMacMakeRealWindowExist, /* 40 */
@@ -465,7 +436,79 @@ TkIntPlatStubs tkIntPlatStubs = {
TkMacContainerId, /* 63 */
TkMacGetHostToplevel, /* 64 */
TkMacPreprocessMenu, /* 65 */
+ TkpIsWindowFloating, /* 66 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ TkGenerateActivateEvents, /* 0 */
+ NULL, /* 1 */
+ NULL, /* 2 */
+ TkPointerDeadWindow, /* 3 */
+ TkpSetCapture, /* 4 */
+ TkpSetCursor, /* 5 */
+ TkpWmSetState, /* 6 */
+ TkAboutDlg, /* 7 */
+ TkMacOSXButtonKeyState, /* 8 */
+ TkMacOSXClearMenubarActive, /* 9 */
+ TkMacOSXDispatchMenuEvent, /* 10 */
+ TkMacOSXInstallCursor, /* 11 */
+ TkMacOSXHandleTearoffMenu, /* 12 */
+ NULL, /* 13 */
+ TkMacOSXDoHLEvent, /* 14 */
+ NULL, /* 15 */
+ TkMacOSXGetXWindow, /* 16 */
+ TkMacOSXGrowToplevel, /* 17 */
+ TkMacOSXHandleMenuSelect, /* 18 */
+ NULL, /* 19 */
+ NULL, /* 20 */
+ TkMacOSXInvalidateWindow, /* 21 */
+ TkMacOSXIsCharacterMissing, /* 22 */
+ TkMacOSXMakeRealWindowExist, /* 23 */
+ TkMacOSXMakeStippleMap, /* 24 */
+ TkMacOSXMenuClick, /* 25 */
+ TkMacOSXRegisterOffScreenWindow, /* 26 */
+ TkMacOSXResizable, /* 27 */
+ TkMacOSXSetHelpMenuItemCount, /* 28 */
+ TkMacOSXSetScrollbarGrow, /* 29 */
+ TkMacOSXSetUpClippingRgn, /* 30 */
+ TkMacOSXSetUpGraphicsPort, /* 31 */
+ TkMacOSXUpdateClipRgn, /* 32 */
+ TkMacOSXUnregisterMacWindow, /* 33 */
+ TkMacOSXUseMenuID, /* 34 */
+ TkMacOSXVisableClipRgn, /* 35 */
+ TkMacOSXWinBounds, /* 36 */
+ TkMacOSXWindowOffset, /* 37 */
+ TkSetMacColor, /* 38 */
+ TkSetWMName, /* 39 */
+ TkSuspendClipboard, /* 40 */
+ TkMacOSXZoomToplevel, /* 41 */
+ Tk_TopCoordsToWindow, /* 42 */
+ TkMacOSXContainerId, /* 43 */
+ TkMacOSXGetHostToplevel, /* 44 */
+ TkMacOSXPreprocessMenu, /* 45 */
+ TkpIsWindowFloating, /* 46 */
+ TkMacOSXGetCapture, /* 47 */
+ NULL, /* 48 */
+ TkGetTransientMaster, /* 49 */
+ TkGenerateButtonEvent, /* 50 */
+ TkGenWMDestroyEvent, /* 51 */
+ NULL, /* 52 */
+ TkpGetMS, /* 53 */
+#endif /* MAC_OSX_TK */
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)) /* X11 */
+ TkCreateXEventSource, /* 0 */
+ TkFreeWindowId, /* 1 */
+ TkInitXId, /* 2 */
+ TkpCmapStressed, /* 3 */
+ TkpSync, /* 4 */
+ TkUnixContainerId, /* 5 */
+ TkUnixDoOneXEvent, /* 6 */
+ TkUnixSetMenubar, /* 7 */
+ TkpScanWindowId, /* 8 */
+ TkWmCleanup, /* 9 */
+ TkSendCleanup, /* 10 */
+ TkFreeXId, /* 11 */
+ TkpWmSetState, /* 12 */
+#endif /* X11 */
};
TkIntXlibStubs tkIntXlibStubs = {
@@ -672,6 +715,98 @@ TkIntXlibStubs tkIntXlibStubs = {
XQueryColor, /* 88 */
XQueryColors, /* 89 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ XSetDashes, /* 0 */
+ XGetModifierMapping, /* 1 */
+ XCreateImage, /* 2 */
+ XGetImage, /* 3 */
+ XGetAtomName, /* 4 */
+ XKeysymToString, /* 5 */
+ XCreateColormap, /* 6 */
+ XGContextFromGC, /* 7 */
+ XKeycodeToKeysym, /* 8 */
+ XStringToKeysym, /* 9 */
+ XRootWindow, /* 10 */
+ XSetErrorHandler, /* 11 */
+ XAllocColor, /* 12 */
+ XBell, /* 13 */
+ XChangeProperty, /* 14 */
+ XChangeWindowAttributes, /* 15 */
+ XConfigureWindow, /* 16 */
+ XCopyArea, /* 17 */
+ XCopyPlane, /* 18 */
+ XCreateBitmapFromData, /* 19 */
+ XDefineCursor, /* 20 */
+ XDestroyWindow, /* 21 */
+ XDrawArc, /* 22 */
+ XDrawLines, /* 23 */
+ XDrawRectangle, /* 24 */
+ XFillArc, /* 25 */
+ XFillPolygon, /* 26 */
+ XFillRectangles, /* 27 */
+ XFreeColormap, /* 28 */
+ XFreeColors, /* 29 */
+ XFreeModifiermap, /* 30 */
+ XGetGeometry, /* 31 */
+ XGetWindowProperty, /* 32 */
+ XGrabKeyboard, /* 33 */
+ XGrabPointer, /* 34 */
+ XKeysymToKeycode, /* 35 */
+ XMapWindow, /* 36 */
+ XMoveResizeWindow, /* 37 */
+ XMoveWindow, /* 38 */
+ XQueryPointer, /* 39 */
+ XRaiseWindow, /* 40 */
+ XRefreshKeyboardMapping, /* 41 */
+ XResizeWindow, /* 42 */
+ XSelectInput, /* 43 */
+ XSendEvent, /* 44 */
+ XSetIconName, /* 45 */
+ XSetInputFocus, /* 46 */
+ XSetSelectionOwner, /* 47 */
+ XSetWindowBackground, /* 48 */
+ XSetWindowBackgroundPixmap, /* 49 */
+ XSetWindowBorder, /* 50 */
+ XSetWindowBorderPixmap, /* 51 */
+ XSetWindowBorderWidth, /* 52 */
+ XSetWindowColormap, /* 53 */
+ XUngrabKeyboard, /* 54 */
+ XUngrabPointer, /* 55 */
+ XUnmapWindow, /* 56 */
+ TkPutImage, /* 57 */
+ XParseColor, /* 58 */
+ XCreateGC, /* 59 */
+ XFreeGC, /* 60 */
+ XInternAtom, /* 61 */
+ XSetBackground, /* 62 */
+ XSetForeground, /* 63 */
+ XSetClipMask, /* 64 */
+ XSetClipOrigin, /* 65 */
+ XSetTSOrigin, /* 66 */
+ XChangeGC, /* 67 */
+ XSetFont, /* 68 */
+ XSetArcMode, /* 69 */
+ XSetStipple, /* 70 */
+ XSetFillRule, /* 71 */
+ XSetFillStyle, /* 72 */
+ XSetFunction, /* 73 */
+ XSetLineAttributes, /* 74 */
+ _XInitImageFuncPtrs, /* 75 */
+ XCreateIC, /* 76 */
+ XGetVisualInfo, /* 77 */
+ XSetWMClientMachine, /* 78 */
+ XStringListToTextProperty, /* 79 */
+ XDrawSegments, /* 80 */
+ XForceScreenSaver, /* 81 */
+ XDrawLine, /* 82 */
+ XFillRectangle, /* 83 */
+ XClearWindow, /* 84 */
+ XDrawPoint, /* 85 */
+ XDrawPoints, /* 86 */
+ XWarpPointer, /* 87 */
+ XQueryColor, /* 88 */
+ XQueryColors, /* 89 */
+#endif /* MAC_OSX_TK */
};
TkPlatStubs tkPlatStubs = {
@@ -698,6 +833,19 @@ TkPlatStubs tkPlatStubs = {
TkMacHaveAppearance, /* 9 */
TkMacGetDrawablePort, /* 10 */
#endif /* MAC_TCL */
+#ifdef MAC_OSX_TK
+ Tk_MacOSXSetEmbedHandler, /* 0 */
+ Tk_MacOSXTurnOffMenus, /* 1 */
+ Tk_MacOSXTkOwnsCursor, /* 2 */
+ TkMacOSXInitMenus, /* 3 */
+ TkMacOSXInitAppleEvents, /* 4 */
+ TkGenWMConfigureEvent, /* 5 */
+ TkMacOSXInvalClipRgns, /* 6 */
+ TkMacOSXGetDrawablePort, /* 7 */
+ TkMacOSXGetRootControl, /* 8 */
+ Tk_MacOSXSetupTkNotifier, /* 9 */
+ Tk_MacOSXIsAppInFront, /* 10 */
+#endif /* MAC_OSX_TK */
};
static TkStubHooks tkStubHooks = {
@@ -854,8 +1002,8 @@ TkStubs tkStubs = {
Tk_NameToWindow, /* 141 */
Tk_OwnSelection, /* 142 */
Tk_ParseArgv, /* 143 */
- Tk_PhotoPutBlock, /* 144 */
- Tk_PhotoPutZoomedBlock, /* 145 */
+ Tk_PhotoPutBlock_NoComposite, /* 144 */
+ Tk_PhotoPutZoomedBlock_NoComposite, /* 145 */
Tk_PhotoGetImage, /* 146 */
Tk_PhotoBlank, /* 147 */
Tk_PhotoExpand, /* 148 */
@@ -949,6 +1097,36 @@ TkStubs tkStubs = {
Tk_PostscriptStipple, /* 236 */
Tk_PostscriptY, /* 237 */
Tk_PostscriptPhoto, /* 238 */
+ Tk_CreateClientMessageHandler, /* 239 */
+ Tk_DeleteClientMessageHandler, /* 240 */
+ Tk_CreateAnonymousWindow, /* 241 */
+ Tk_SetClassProcs, /* 242 */
+ Tk_SetInternalBorderEx, /* 243 */
+ Tk_SetMinimumRequestSize, /* 244 */
+ Tk_SetCaretPos, /* 245 */
+ Tk_PhotoPutBlock, /* 246 */
+ Tk_PhotoPutZoomedBlock, /* 247 */
+ Tk_CollapseMotionEvents, /* 248 */
+ Tk_RegisterStyleEngine, /* 249 */
+ Tk_GetStyleEngine, /* 250 */
+ Tk_RegisterStyledElement, /* 251 */
+ Tk_GetElementId, /* 252 */
+ Tk_CreateStyle, /* 253 */
+ Tk_GetStyle, /* 254 */
+ Tk_FreeStyle, /* 255 */
+ Tk_NameOfStyle, /* 256 */
+ Tk_AllocStyleFromObj, /* 257 */
+ Tk_GetStyleFromObj, /* 258 */
+ Tk_FreeStyleFromObj, /* 259 */
+ Tk_GetStyledElement, /* 260 */
+ Tk_GetElementSize, /* 261 */
+ Tk_GetElementBox, /* 262 */
+ Tk_GetElementBorderWidth, /* 263 */
+ Tk_DrawElement, /* 264 */
};
/* !END!: Do not edit above this line. */
+
+#undef UNIX_TK
+#undef MAC_TK
+#undef MAC_OSX_TK
diff --git a/tk/generic/tkStubLib.c b/tk/generic/tkStubLib.c
index 7a9e7bd0d53..08868276d3f 100644
--- a/tk/generic/tkStubLib.c
+++ b/tk/generic/tkStubLib.c
@@ -13,6 +13,7 @@
* RCS: @(#) $Id$
*/
+
/*
* We need to ensure that we use the stub macros so that this file contains
* no references to any of the stub functions. This will make it possible
@@ -20,7 +21,6 @@
* including the rest of the stub functions.
*/
-
#ifndef USE_TCL_STUBS
#define USE_TCL_STUBS
#endif
@@ -37,10 +37,15 @@
#ifdef __WIN32__
#include "tkWinInt.h"
#endif
+
#ifdef MAC_TCL
#include "tkMacInt.h"
#endif
+#ifdef MAC_OSX_TK
+#include "tkMacOSXInt.h"
+#endif
+
#include "tkDecls.h"
#include "tkIntDecls.h"
#include "tkPlatDecls.h"
@@ -80,13 +85,17 @@ TkIntXlibStubs *tkIntXlibStubsPtr;
*----------------------------------------------------------------------
*/
-char *
+#ifdef Tk_InitStubs
+#undef Tk_InitStubs
+#endif
+
+CONST char *
Tk_InitStubs(interp, version, exact)
Tcl_Interp *interp;
char *version;
int exact;
{
- char *actualVersion;
+ CONST char *actualVersion;
actualVersion = Tcl_PkgRequireEx(interp, "Tk", version, exact,
(ClientData *) &tkStubsPtr);
diff --git a/tk/generic/tkStyle.c b/tk/generic/tkStyle.c
new file mode 100644
index 00000000000..db1f27e4d34
--- /dev/null
+++ b/tk/generic/tkStyle.c
@@ -0,0 +1,1664 @@
+/*
+ * tkStyle.c --
+ *
+ * This file implements the widget styles and themes support.
+ *
+ * Copyright (c) 1990-1993 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.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+
+/*
+ * The following structure is used to cache widget option specs matching an
+ * element's required options defined by Tk_ElementOptionSpecs. It also holds
+ * information behind Tk_StyledElement opaque tokens.
+ */
+
+typedef struct StyledWidgetSpec {
+ struct StyledElement *elementPtr; /* Pointer to the element holding this
+ * structure. */
+ Tk_OptionTable optionTable; /* Option table for the widget class
+ * using the element. */
+ CONST Tk_OptionSpec **optionsPtr; /* Table of option spec pointers,
+ * matching the option list provided
+ * during element registration.
+ * Malloc'd. */
+} StyledWidgetSpec;
+
+/*
+ * Elements are declared using static templates. But static
+ * information must be completed by dynamic information only
+ * accessible at runtime. For each registered element, an instance of
+ * the following structure is stored in each style engine and used to
+ * cache information about the widget types (identified by their
+ * optionTable) that use the given element.
+ */
+
+typedef struct StyledElement {
+ struct Tk_ElementSpec *specPtr;
+ /* Filled with template provided during
+ * registration. NULL means no implementation
+ * is available for the current engine. */
+ int nbWidgetSpecs; /* Size of the array below. Number of distinct
+ * widget classes (actually, distinct option
+ * tables) that used the element so far. */
+ StyledWidgetSpec *widgetSpecs;
+ /* See above for the structure definition.
+ * Table grows dynamically as new widgets
+ * use the element. Malloc'd. */
+} StyledElement;
+
+/*
+ * The following structure holds information behind Tk_StyleEngine opaque
+ * tokens.
+ */
+
+typedef struct StyleEngine {
+ CONST char *name; /* Name of engine. Points to a hash key. */
+ StyledElement *elements; /* Table of widget element descriptors. Each
+ * element is indexed by a unique system-wide
+ * ID. Table grows dynamically as new elements
+ * are registered. Malloc'd*/
+ struct StyleEngine *parentPtr;
+ /* Parent engine. Engines may be layered to form
+ * a fallback chain, terminated by the default
+ * system engine. */
+} StyleEngine;
+
+/*
+ * Styles are instances of style engines. The following structure holds
+ * information behind Tk_Style opaque tokens.
+ */
+
+typedef struct Style {
+ int refCount; /* Number of active uses of this style.
+ * If this count is 0, then this Style
+ * structure is no longer valid. */
+ Tcl_HashEntry *hashPtr; /* Entry in style table for this structure,
+ * used when deleting it. */
+ CONST char *name; /* Name of style. Points to a hash key. */
+ StyleEngine *enginePtr; /* Style engine of which the style is an
+ * instance. */
+ ClientData clientData; /* Data provided during registration. */
+} Style;
+
+/*
+ * Each registered element uses an instance of the following structure.
+ */
+
+typedef struct Element {
+ CONST char *name; /* Name of element. Points to a hash key. */
+ int id; /* Id of element. */
+ int genericId; /* Id of generic element. */
+ int created; /* Boolean, whether the element was created
+ * explicitly (was registered) or implicitly
+ * (by a derived element). */
+} Element;
+
+/*
+ * Thread-local data.
+ */
+
+typedef struct ThreadSpecificData {
+ int nbInit; /* Number of calls to the init proc. */
+ Tcl_HashTable engineTable; /* Map a name to a style engine. Keys are
+ * strings, values are Tk_StyleEngine
+ * pointers. */
+ StyleEngine *defaultEnginePtr;
+ /* Default, core-defined style engine. Global
+ * fallback for all engines. */
+ Tcl_HashTable styleTable; /* Map a name to a style. Keys are strings,
+ * values are Tk_Style pointers.*/
+ int nbElements; /* Size of the below tables. */
+ Tcl_HashTable elementTable; /* Map a name to an element Id. Keys are
+ * strings, values are integer element IDs. */
+ Element *elements; /* Array of Elements. */
+} ThreadSpecificData;
+
+static Tcl_ThreadDataKey dataKey;
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+/* TODO: sort alpha. */
+static int CreateElement _ANSI_ARGS_((CONST char *name,
+ int create));
+static void DupStyleObjProc _ANSI_ARGS_((Tcl_Obj *srcObjPtr,
+ Tcl_Obj *dupObjPtr));
+static void FreeElement _ANSI_ARGS_((Element *elementPtr));
+static void FreeStyle _ANSI_ARGS_((Style *stylePtr));
+static void FreeStyledElement _ANSI_ARGS_((
+ StyledElement *elementPtr));
+static void FreeStyleEngine _ANSI_ARGS_((
+ StyleEngine *enginePtr));
+static void FreeStyleObjProc _ANSI_ARGS_((Tcl_Obj *objPtr));
+static void FreeWidgetSpec _ANSI_ARGS_((
+ StyledWidgetSpec *widgetSpecPtr));
+static StyledElement * GetStyledElement _ANSI_ARGS_((
+ StyleEngine *enginePtr, int elementId));
+static StyledWidgetSpec * GetWidgetSpec _ANSI_ARGS_((StyledElement *elementPtr,
+ Tk_OptionTable optionTable));
+static void InitElement _ANSI_ARGS_((Element *elementPtr,
+ CONST char *name, int id, int genericId,
+ int created));
+static void InitStyle _ANSI_ARGS_((Style *stylePtr,
+ Tcl_HashEntry *hashPtr, CONST char *name,
+ StyleEngine *enginePtr, ClientData clientData));
+static void InitStyledElement _ANSI_ARGS_((
+ StyledElement *elementPtr));
+static void InitStyleEngine _ANSI_ARGS_((StyleEngine *enginePtr,
+ CONST char *name, StyleEngine *parentPtr));
+static void InitWidgetSpec _ANSI_ARGS_((
+ StyledWidgetSpec *widgetSpecPtr,
+ StyledElement *elementPtr,
+ Tk_OptionTable optionTable));
+static int SetStyleFromAny _ANSI_ARGS_((Tcl_Interp *interp,
+ Tcl_Obj *objPtr));
+
+/*
+ * The following structure defines the implementation of the "style" Tcl
+ * object, used for drawing. The internalRep.otherValuePtr field of
+ * each style object points to the Style structure for the stylefont, or
+ * NULL.
+ */
+
+static Tcl_ObjType styleObjType = {
+ "style", /* name */
+ FreeStyleObjProc, /* freeIntRepProc */
+ DupStyleObjProc, /* dupIntRepProc */
+ NULL, /* updateStringProc */
+ SetStyleFromAny /* setFromAnyProc */
+};
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkStylePkgInit --
+ *
+ * This procedure is called when an application is created. It
+ * initializes all the structures that are used by the style
+ * package on a per application basis.
+ *
+ * Results:
+ * Stores data in thread-local storage.
+ *
+ * Side effects:
+ * Memory allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkStylePkgInit(mainPtr)
+ TkMainInfo *mainPtr; /* The application being created. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ if (tsdPtr->nbInit != 0) return;
+
+ /*
+ * Initialize tables.
+ */
+
+ Tcl_InitHashTable(&tsdPtr->engineTable, TCL_STRING_KEYS);
+ Tcl_InitHashTable(&tsdPtr->styleTable, TCL_STRING_KEYS);
+ Tcl_InitHashTable(&tsdPtr->elementTable, TCL_STRING_KEYS);
+ tsdPtr->nbElements = 0;
+ tsdPtr->elements = NULL;
+
+ /*
+ * Create the default system engine.
+ */
+
+ tsdPtr->defaultEnginePtr =
+ (StyleEngine *) Tk_RegisterStyleEngine(NULL, NULL);
+
+ /*
+ * Create the default system style.
+ */
+
+ Tk_CreateStyle(NULL, (Tk_StyleEngine) tsdPtr->defaultEnginePtr,
+ (ClientData) 0);
+
+ tsdPtr->nbInit++;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkStylePkgFree --
+ *
+ * This procedure is called when an application is deleted. It
+ * deletes all the structures that were used by the style package
+ * for this application.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkStylePkgFree(mainPtr)
+ TkMainInfo *mainPtr; /* The application being deleted. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_HashSearch search;
+ Tcl_HashEntry *entryPtr;
+ StyleEngine *enginePtr;
+ int i;
+
+ tsdPtr->nbInit--;
+ if (tsdPtr->nbInit != 0) return;
+
+ /*
+ * Free styles.
+ */
+
+ entryPtr = Tcl_FirstHashEntry(&tsdPtr->styleTable, &search);
+ while (entryPtr != NULL) {
+ ckfree((char *) Tcl_GetHashValue(entryPtr));
+ entryPtr = Tcl_NextHashEntry(&search);
+ }
+ Tcl_DeleteHashTable(&tsdPtr->styleTable);
+
+ /*
+ * Free engines.
+ */
+
+ entryPtr = Tcl_FirstHashEntry(&tsdPtr->engineTable, &search);
+ while (entryPtr != NULL) {
+ enginePtr = (StyleEngine *) Tcl_GetHashValue(entryPtr);
+ FreeStyleEngine(enginePtr);
+ ckfree((char *) enginePtr);
+ entryPtr = Tcl_NextHashEntry(&search);
+ }
+ Tcl_DeleteHashTable(&tsdPtr->engineTable);
+
+ /*
+ * Free elements.
+ */
+
+ for (i = 0; i < tsdPtr->nbElements; i++) {
+ FreeElement(tsdPtr->elements+i);
+ }
+ Tcl_DeleteHashTable(&tsdPtr->elementTable);
+ ckfree((char *) tsdPtr->elements);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_RegisterStyleEngine --
+ *
+ * This procedure is called to register a new style engine. Style engines
+ * are stored in thread-local space.
+ *
+ * Results:
+ * The newly allocated engine.
+ *
+ * Side effects:
+ * Memory allocated. Data added to thread-local table.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+Tk_StyleEngine
+Tk_RegisterStyleEngine(name, parent)
+ CONST char *name; /* Name of the engine to create. NULL or empty
+ * means the default system engine. */
+ Tk_StyleEngine parent; /* The engine's parent. NULL means the default
+ * system engine. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_HashEntry *entryPtr;
+ int newEntry;
+ StyleEngine *enginePtr;
+
+ /*
+ * Attempt to create a new entry in the engine table.
+ */
+
+ entryPtr = Tcl_CreateHashEntry(&tsdPtr->engineTable, (name?name:""),
+ &newEntry);
+ if (!newEntry) {
+ /*
+ * An engine was already registered by that name.
+ */
+
+ return NULL;
+ }
+
+ /*
+ * Allocate and intitialize a new engine.
+ */
+
+ enginePtr = (StyleEngine *) ckalloc(sizeof(StyleEngine));
+ InitStyleEngine(enginePtr, Tcl_GetHashKey(&tsdPtr->engineTable, entryPtr),
+ (StyleEngine *) parent);
+ Tcl_SetHashValue(entryPtr, (ClientData) enginePtr);
+
+ return (Tk_StyleEngine) enginePtr;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitStyleEngine --
+ *
+ * Initialize a newly allocated style engine.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitStyleEngine(enginePtr, name, parentPtr)
+ StyleEngine *enginePtr; /* Points to an uninitialized engine. */
+ CONST char *name; /* Name of the registered engine. NULL or empty
+ * means the default system engine. Usually
+ * points to the hash key. */
+ StyleEngine *parentPtr; /* The engine's parent. NULL means the default
+ * system engine. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ int elementId;
+
+ if (name == NULL || *name == '\0') {
+ /*
+ * This is the default style engine.
+ */
+
+ enginePtr->parentPtr = NULL;
+
+ } else if (parentPtr == NULL) {
+ /*
+ * The default style engine is the parent.
+ */
+
+ enginePtr->parentPtr = tsdPtr->defaultEnginePtr;
+
+ } else {
+ enginePtr->parentPtr = parentPtr;
+ }
+
+ /*
+ * Allocate and initialize elements array.
+ */
+
+ if (tsdPtr->nbElements > 0) {
+ enginePtr->elements = (StyledElement *) ckalloc(
+ sizeof(StyledElement) * tsdPtr->nbElements);
+ for (elementId = 0; elementId < tsdPtr->nbElements; elementId++) {
+ InitStyledElement(enginePtr->elements+elementId);
+ }
+ } else {
+ enginePtr->elements = NULL;
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FreeStyleEngine --
+ *
+ * Free an engine and its associated data.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * Memory freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+FreeStyleEngine(enginePtr)
+ StyleEngine *enginePtr; /* The style engine to free. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ int elementId;
+
+ /*
+ * Free allocated elements.
+ */
+
+ for (elementId = 0; elementId < tsdPtr->nbElements; elementId++) {
+ FreeStyledElement(enginePtr->elements+elementId);
+ }
+ ckfree((char *) enginePtr->elements);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetStyleEngine --
+ *
+ * Retrieve a registered style engine by its name.
+ *
+ * Results:
+ * A pointer to the style engine, or NULL if none found.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+Tk_StyleEngine
+Tk_GetStyleEngine(name)
+ CONST char *name; /* Name of the engine to retrieve. NULL or
+ * empty means the default system engine. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_HashEntry *entryPtr;
+
+ if (name == NULL) {
+ return (Tk_StyleEngine) tsdPtr->defaultEnginePtr;
+ }
+
+ entryPtr = Tcl_FindHashEntry(&tsdPtr->engineTable, (name?name:""));
+ if (!entryPtr) {
+ return NULL;
+ }
+
+ return (Tk_StyleEngine) Tcl_GetHashValue(entryPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitElement --
+ *
+ * Initialize a newly allocated element.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitElement(elementPtr, name, id, genericId, created)
+ Element *elementPtr; /* Points to an uninitialized element.*/
+ CONST char *name; /* Name of the registered element. Usually
+ * points to the hash key. */
+ int id; /* Unique element ID. */
+ int genericId; /* ID of generic element. -1 means none. */
+ int created; /* Boolean, whether the element was created
+ * explicitly (was registered) or implicitly
+ * (by a derived element). */
+{
+ elementPtr->name = name;
+ elementPtr->id = id;
+ elementPtr->genericId = genericId;
+ elementPtr->created = (created?1:0);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FreeElement --
+ *
+ * Free an element and its associated data.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+FreeElement(elementPtr)
+ Element *elementPtr; /* The element to free. */
+{
+ /* Nothing to do. */
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitStyledElement --
+ *
+ * Initialize a newly allocated styled element.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitStyledElement(elementPtr)
+ StyledElement *elementPtr; /* Points to an uninitialized element.*/
+{
+ memset(elementPtr, 0, sizeof(StyledElement));
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FreeStyledElement --
+ *
+ * Free a styled element and its associated data.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+FreeStyledElement(elementPtr)
+ StyledElement *elementPtr; /* The styled element to free. */
+{
+ int i;
+
+ /*
+ * Free allocated widget specs.
+ */
+
+ for (i = 0; i < elementPtr->nbWidgetSpecs; i++) {
+ FreeWidgetSpec(elementPtr->widgetSpecs+i);
+ }
+ ckfree((char *) elementPtr->widgetSpecs);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * CreateElement --
+ *
+ * Find an existing or create a new element.
+ *
+ * Results:
+ * The unique ID for the created or found element.
+ *
+ * Side effects:
+ * Memory allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static int
+CreateElement(name, create)
+ CONST char *name; /* Name of the element. */
+ int create; /* Boolean, whether the element is being created
+ * explicitly (being registered) or implicitly (by a
+ * derived element). */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_HashEntry *entryPtr, *engineEntryPtr;
+ Tcl_HashSearch search;
+ int newEntry;
+ int elementId, genericId = -1;
+ char *dot;
+ StyleEngine *enginePtr;
+
+ /*
+ * Find or create the element.
+ */
+
+ entryPtr = Tcl_CreateHashEntry(&tsdPtr->elementTable, name, &newEntry);
+ if (!newEntry) {
+ elementId = (int) Tcl_GetHashValue(entryPtr);
+ if (create) {
+ tsdPtr->elements[elementId].created = 1;
+ }
+ return elementId;
+ }
+
+ /*
+ * The element didn't exist. If it's a derived element, find or
+ * create its generic element ID.
+ */
+
+ dot = strchr(name, '.');
+ if (dot) {
+ genericId = CreateElement(dot+1, 0);
+ }
+
+ elementId = tsdPtr->nbElements++;
+ Tcl_SetHashValue(entryPtr, (ClientData) elementId);
+
+ /*
+ * Reallocate element table.
+ */
+
+ tsdPtr->elements = (Element *) ckrealloc((char *) tsdPtr->elements,
+ sizeof(Element) * tsdPtr->nbElements);
+ InitElement(tsdPtr->elements+elementId,
+ Tcl_GetHashKey(&tsdPtr->elementTable, entryPtr), elementId,
+ genericId, create);
+
+ /*
+ * Reallocate style engines' element table.
+ */
+
+ engineEntryPtr = Tcl_FirstHashEntry(&tsdPtr->engineTable, &search);
+ while (engineEntryPtr != NULL) {
+ enginePtr = (StyleEngine *) Tcl_GetHashValue(engineEntryPtr);
+
+ enginePtr->elements = (StyledElement *) ckrealloc(
+ (char *) enginePtr->elements,
+ sizeof(StyledElement) * tsdPtr->nbElements);
+ InitStyledElement(enginePtr->elements+elementId);
+
+ engineEntryPtr = Tcl_NextHashEntry(&search);
+ }
+
+ return elementId;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetElementId --
+ *
+ * Find an existing element.
+ *
+ * Results:
+ * The unique ID for the found element, or -1 if not found.
+ *
+ * Side effects:
+ * Generic elements may be created.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+int
+Tk_GetElementId(name)
+ CONST char *name; /* Name of the element. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_HashEntry *entryPtr;
+ int genericId = -1;
+ char *dot;
+
+ /*
+ * Find the element Id.
+ */
+
+ entryPtr = Tcl_FindHashEntry(&tsdPtr->elementTable, name);
+ if (entryPtr) {
+ return (int) Tcl_GetHashValue(entryPtr);
+ }
+
+ /*
+ * Element not found. If the given name was derived, then first search for
+ * the generic element. If found, create the new derived element.
+ */
+
+ dot = strchr(name, '.');
+ if (!dot) {
+ return -1;
+ }
+ genericId = Tk_GetElementId(dot+1);
+ if (genericId == -1) {
+ return -1;
+ }
+ if (!tsdPtr->elements[genericId].created) {
+ /*
+ * The generic element was created implicitly and thus has no real
+ * existence.
+ */
+
+ return -1;
+ } else {
+ /*
+ * The generic element was created explicitly. Create the derived
+ * element.
+ */
+
+ return CreateElement(name, 1);
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_RegisterStyledElement --
+ *
+ * Register an implementation of a new or existing element for the
+ * given style engine.
+ *
+ * Results:
+ * The unique ID for the created or found element.
+ *
+ * Side effects:
+ * Elements may be created. Memory allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+int
+Tk_RegisterStyledElement(engine, templatePtr)
+ Tk_StyleEngine engine; /* Style engine providing the
+ * implementation. */
+ Tk_ElementSpec *templatePtr; /* Static template information about
+ * the element. */
+{
+ int elementId;
+ StyledElement *elementPtr;
+ Tk_ElementSpec *specPtr;
+ int nbOptions;
+ register Tk_ElementOptionSpec *srcOptions, *dstOptions;
+
+ if (templatePtr->version != TK_STYLE_VERSION_1) {
+ /*
+ * Version mismatch. Do nothing.
+ */
+
+ return -1;
+ }
+
+ if (engine == NULL) {
+ engine = Tk_GetStyleEngine(NULL);
+ }
+
+ /*
+ * Register the element, allocating storage in the various engines if
+ * necessary.
+ */
+
+ elementId = CreateElement(templatePtr->name, 1);
+
+ /*
+ * Initialize the styled element.
+ */
+
+ elementPtr = ((StyleEngine *) engine)->elements+elementId;
+
+ specPtr = (Tk_ElementSpec *) ckalloc(sizeof(Tk_ElementSpec));
+ specPtr->version = templatePtr->version;
+ specPtr->name = ckalloc(strlen(templatePtr->name)+1);
+ strcpy(specPtr->name, templatePtr->name);
+ nbOptions = 0;
+ for (nbOptions = 0, srcOptions = templatePtr->options;
+ srcOptions->name != NULL;
+ nbOptions++, srcOptions++);
+ specPtr->options = (Tk_ElementOptionSpec *) ckalloc(
+ sizeof(Tk_ElementOptionSpec) * (nbOptions+1));
+ for (srcOptions = templatePtr->options, dstOptions = specPtr->options;
+ /* End condition within loop */;
+ srcOptions++, dstOptions++) {
+ if (srcOptions->name == NULL) {
+ dstOptions->name = NULL;
+ break;
+ }
+
+ dstOptions->name = ckalloc(strlen(srcOptions->name)+1);
+ strcpy(dstOptions->name, srcOptions->name);
+ dstOptions->type = srcOptions->type;
+ }
+ specPtr->getSize = templatePtr->getSize;
+ specPtr->getBox = templatePtr->getBox;
+ specPtr->getBorderWidth = templatePtr->getBorderWidth;
+ specPtr->draw = templatePtr->draw;
+
+ elementPtr->specPtr = specPtr;
+ elementPtr->nbWidgetSpecs = 0;
+ elementPtr->widgetSpecs = NULL;
+
+ return elementId;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * GetStyledElement --
+ *
+ * Get a registered implementation of an existing element for the
+ * given style engine.
+ *
+ * Results:
+ * The styled element descriptor, or NULL if not found.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static StyledElement *
+GetStyledElement(enginePtr, elementId)
+ StyleEngine *enginePtr; /* Style engine providing the implementation.
+ * NULL means the default system engine. */
+ int elementId; /* Unique element ID */{
+ StyledElement *elementPtr;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ StyleEngine *enginePtr2;
+
+ if (enginePtr == NULL) {
+ enginePtr = tsdPtr->defaultEnginePtr;
+ }
+
+ while (elementId >= 0 && elementId < tsdPtr->nbElements) {
+ /*
+ * Look for an implemented element through the engine chain.
+ */
+
+ enginePtr2 = enginePtr;
+ do {
+ elementPtr = enginePtr2->elements+elementId;
+ if (elementPtr->specPtr != NULL) {
+ return elementPtr;
+ }
+ enginePtr2 = enginePtr2->parentPtr;
+ } while (enginePtr2 != NULL);
+
+ /*
+ * None found, try with the generic element.
+ */
+
+ elementId = tsdPtr->elements[elementId].genericId;
+ }
+
+ /*
+ * No matching element found.
+ */
+
+ return NULL;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitWidgetSpec --
+ *
+ * Initialize a newly allocated widget spec.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitWidgetSpec(widgetSpecPtr, elementPtr, optionTable)
+ StyledWidgetSpec *widgetSpecPtr; /* Points to an uninitialized widget
+ * spec. */
+ StyledElement *elementPtr; /* Styled element descriptor. */
+ Tk_OptionTable optionTable; /* The widget's option table. */
+{
+ int i, nbOptions;
+ Tk_ElementOptionSpec *elementOptionPtr;
+ CONST Tk_OptionSpec *widgetOptionPtr;
+
+ widgetSpecPtr->elementPtr = elementPtr;
+ widgetSpecPtr->optionTable = optionTable;
+
+ /*
+ * Count the number of options.
+ */
+
+ for (nbOptions = 0, elementOptionPtr = elementPtr->specPtr->options;
+ elementOptionPtr->name != NULL;
+ nbOptions++, elementOptionPtr++) {
+ }
+
+ /*
+ * Build the widget option list.
+ */
+
+ widgetSpecPtr->optionsPtr = (CONST Tk_OptionSpec **) ckalloc(
+ sizeof(Tk_OptionSpec *) * nbOptions);
+ for (i = 0, elementOptionPtr = elementPtr->specPtr->options;
+ i < nbOptions;
+ i++, elementOptionPtr++) {
+ widgetOptionPtr = TkGetOptionSpec(elementOptionPtr->name, optionTable);
+
+ /*
+ * Check that the widget option type is compatible with one of the
+ * element's required types.
+ */
+
+ if ( elementOptionPtr->type == TK_OPTION_END
+ || elementOptionPtr->type == widgetOptionPtr->type) {
+ widgetSpecPtr->optionsPtr[i] = widgetOptionPtr;
+ } else {
+ widgetSpecPtr->optionsPtr[i] = NULL;
+ }
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FreeWidgetSpec --
+ *
+ * Free a widget spec and its associated data.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * Memory freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+FreeWidgetSpec(widgetSpecPtr)
+ StyledWidgetSpec *widgetSpecPtr; /* The widget spec to free. */
+{
+ ckfree((char *) widgetSpecPtr->optionsPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * GetWidgetSpec --
+ *
+ * Return a new or existing widget spec for the given element and
+ * widget type (identified by its option table).
+ *
+ * Results:
+ * A pointer to the matching widget spec.
+ *
+ * Side effects:
+ * Memory may be allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static StyledWidgetSpec *
+GetWidgetSpec(elementPtr, optionTable)
+ StyledElement *elementPtr; /* Styled element descriptor. */
+ Tk_OptionTable optionTable; /* The widget's option table. */
+{
+ StyledWidgetSpec *widgetSpecPtr;
+ int i;
+
+ /*
+ * Try to find an existing widget spec.
+ */
+
+ for (i = 0; i < elementPtr->nbWidgetSpecs; i++) {
+ widgetSpecPtr = elementPtr->widgetSpecs+i;
+ if (widgetSpecPtr->optionTable == optionTable) {
+ return widgetSpecPtr;
+ }
+ }
+
+ /*
+ * Create and initialize a new widget spec.
+ */
+
+ i = elementPtr->nbWidgetSpecs++;
+ elementPtr->widgetSpecs = (StyledWidgetSpec *) ckrealloc(
+ (char *) elementPtr->widgetSpecs,
+ sizeof(StyledWidgetSpec) * elementPtr->nbWidgetSpecs);
+ widgetSpecPtr = elementPtr->widgetSpecs+i;
+ InitWidgetSpec(widgetSpecPtr, elementPtr, optionTable);
+
+ return widgetSpecPtr;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetStyledElement --
+ *
+ * This procedure returns a styled instance of the given element.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Cached data may be allocated or updated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+Tk_StyledElement
+Tk_GetStyledElement(style, elementId, optionTable)
+ Tk_Style style; /* The widget style. */
+ int elementId; /* Unique element ID. */
+ Tk_OptionTable optionTable; /* Option table for the widget. */
+{
+ Style *stylePtr = (Style *) style;
+ StyledElement *elementPtr;
+
+ /*
+ * Get an element implementation and call corresponding hook.
+ */
+
+ elementPtr = GetStyledElement((stylePtr?stylePtr->enginePtr:NULL),
+ elementId);
+ if (!elementPtr) {
+ return NULL;
+ }
+
+ return (Tk_StyledElement) GetWidgetSpec(elementPtr, optionTable);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetElementSize --
+ *
+ * This procedure computes the size of the given widget element according
+ * to its style.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Cached data may be allocated or updated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+Tk_GetElementSize(style, element, recordPtr, tkwin, width, height, inner, widthPtr,
+ heightPtr)
+ Tk_Style style; /* The widget style. */
+ Tk_StyledElement element; /* The styled element, previously
+ * returned by Tk_GetStyledElement. */
+ char *recordPtr; /* The widget record. */
+ Tk_Window tkwin; /* The widget window. */
+ int width, height; /* Requested size. */
+ int inner; /* Boolean. If TRUE, compute the outer
+ * size according to the requested
+ * minimum inner size. If FALSE, compute
+ * the inner size according to the
+ * requested maximum outer size. */
+ int *widthPtr, *heightPtr; /* Returned size. */
+{
+ Style *stylePtr = (Style *) style;
+ StyledWidgetSpec *widgetSpecPtr = (StyledWidgetSpec *) element;
+
+ widgetSpecPtr->elementPtr->specPtr->getSize(stylePtr->clientData,
+ recordPtr, widgetSpecPtr->optionsPtr, tkwin, width, height, inner,
+ widthPtr, heightPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetElementBox --
+ *
+ * This procedure computes the bounding or inscribed box coordinates
+ * of the given widget element according to its style and within the
+ * given limits.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Cached data may be allocated or updated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+Tk_GetElementBox(style, element, recordPtr, tkwin, x, y, width, height, inner,
+ xPtr, yPtr, widthPtr, heightPtr)
+ Tk_Style style; /* The widget style. */
+ Tk_StyledElement element; /* The styled element, previously
+ * returned by Tk_GetStyledElement. */
+ char *recordPtr; /* The widget record. */
+ Tk_Window tkwin; /* The widget window. */
+ int x, y; /* Top left corner of available area. */
+ int width, height; /* Size of available area. */
+ int inner; /* Boolean. If TRUE, compute the
+ * bounding box according to the
+ * requested inscribed box size. If
+ * FALSE, compute the inscribed box
+ * according to the requested bounding
+ * box. */
+ int *xPtr, *yPtr; /* Returned top left corner. */
+ int *widthPtr, *heightPtr; /* Returned size. */
+{
+ Style *stylePtr = (Style *) style;
+ StyledWidgetSpec *widgetSpecPtr = (StyledWidgetSpec *) element;
+
+ widgetSpecPtr->elementPtr->specPtr->getBox(stylePtr->clientData,
+ recordPtr, widgetSpecPtr->optionsPtr, tkwin, x, y, width, height,
+ inner, xPtr, yPtr, widthPtr, heightPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetElementBorderWidth --
+ *
+ * This procedure computes the border widthof the given widget element
+ * according to its style and within the given limits.
+ *
+ * Results:
+ * Border width in pixels. This value is uniform for all four sides.
+ *
+ * Side effects:
+ * Cached data may be allocated or updated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+int
+Tk_GetElementBorderWidth(style, element, recordPtr, tkwin)
+ Tk_Style style; /* The widget style. */
+ Tk_StyledElement element; /* The styled element, previously
+ * returned by Tk_GetStyledElement. */
+ char *recordPtr; /* The widget record. */
+ Tk_Window tkwin; /* The widget window. */
+{
+ Style *stylePtr = (Style *) style;
+ StyledWidgetSpec *widgetSpecPtr = (StyledWidgetSpec *) element;
+
+ return widgetSpecPtr->elementPtr->specPtr->getBorderWidth(
+ stylePtr->clientData, recordPtr, widgetSpecPtr->optionsPtr, tkwin);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_DrawElement --
+ *
+ * This procedure draw the given widget element in a given drawable area.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * Cached data may be allocated or updated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+Tk_DrawElement(style, element, recordPtr, tkwin, d, x, y, width, height, state)
+ Tk_Style style; /* The widget style. */
+ Tk_StyledElement element; /* The styled element, previously
+ * returned by Tk_GetStyledElement. */
+ char *recordPtr; /* The widget record. */
+ Tk_Window tkwin; /* The widget window. */
+ Drawable d; /* Where to draw element. */
+ int x, y; /* Top left corner of element. */
+ int width, height; /* Size of element. */
+ int state; /* Drawing state flags. */
+{
+ Style *stylePtr = (Style *) style;
+ StyledWidgetSpec *widgetSpecPtr = (StyledWidgetSpec *) element;
+
+ widgetSpecPtr->elementPtr->specPtr->draw(stylePtr->clientData,
+ recordPtr, widgetSpecPtr->optionsPtr, tkwin, d, x, y, width,
+ height, state);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_CreateStyle --
+ *
+ * This procedure is called to create a new style as an instance of the
+ * given engine. Styles are stored in thread-local space.
+ *
+ * Results:
+ * The newly allocated style.
+ *
+ * Side effects:
+ * Memory allocated. Data added to thread-local table. The style's
+ * refCount is incremented.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+Tk_Style
+Tk_CreateStyle(name, engine, clientData)
+ CONST char *name; /* Name of the style to create. NULL or empty
+ * means the default system style. */
+ Tk_StyleEngine engine; /* The style engine. */
+ ClientData clientData; /* Private data passed as is to engine code. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_HashEntry *entryPtr;
+ int newEntry;
+ Style *stylePtr;
+
+ /*
+ * Attempt to create a new entry in the style table.
+ */
+
+ entryPtr = Tcl_CreateHashEntry(&tsdPtr->styleTable, (name?name:""),
+ &newEntry);
+ if (!newEntry) {
+ /*
+ * A style was already registered by that name.
+ */
+
+ return NULL;
+ }
+
+ /*
+ * Allocate and intitialize a new style.
+ */
+
+ stylePtr = (Style *) ckalloc(sizeof(Style));
+ InitStyle(stylePtr, entryPtr, Tcl_GetHashKey(&tsdPtr->styleTable, entryPtr),
+ (engine?(StyleEngine *) engine:tsdPtr->defaultEnginePtr), clientData);
+ Tcl_SetHashValue(entryPtr, (ClientData) stylePtr);
+ stylePtr->refCount++;
+
+ return (Tk_Style) stylePtr;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_NameOfStyle --
+ *
+ * Given a style, return its registered name.
+ *
+ * Results:
+ * The return value is the name that was passed to Tk_CreateStyle() to
+ * create the style. The storage for the returned string is private
+ * (it points to the corresponding hash key) The caller should not modify
+ * this string.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+CONST char *
+Tk_NameOfStyle(style)
+ Tk_Style style; /* Style whose name is desired. */
+{
+ Style *stylePtr = (Style *) style;
+
+ return stylePtr->name;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitStyle --
+ *
+ * Initialize a newly allocated style.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitStyle(stylePtr, hashPtr, name, enginePtr, clientData)
+ Style *stylePtr; /* Points to an uninitialized style. */
+ Tcl_HashEntry *hashPtr; /* Hash entry for the registered style. */
+ CONST char *name; /* Name of the registered style. NULL or empty
+ * means the default system style. Usually
+ * points to the hash key. */
+ StyleEngine *enginePtr; /* The style engine. */
+ ClientData clientData; /* Private data passed as is to engine code. */
+{
+ stylePtr->refCount = 0;
+ stylePtr->hashPtr = hashPtr;
+ stylePtr->name = name;
+ stylePtr->enginePtr = enginePtr;
+ stylePtr->clientData = clientData;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FreeStyle --
+ *
+ * Free a style and its associated data.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+FreeStyle(stylePtr)
+ Style *stylePtr; /* The style to free. */
+{
+ /* Nothing to do. */
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_GetStyle --
+ *
+ * Retrieve a registered style by its name.
+ *
+ * Results:
+ * A pointer to the style engine, or NULL if none found. In the latter
+ * case and if the interp is not NULL, an error message is left in the
+ * interp's result.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+Tk_Style
+Tk_GetStyle(interp, name)
+ Tcl_Interp *interp; /* Interp for error return. */
+ CONST char *name; /* Name of the style to retrieve. NULL or empty
+ * means the default system style. */
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_HashEntry *entryPtr;
+ Style *stylePtr;
+
+ /*
+ * Search for a corresponding entry in the style table.
+ */
+
+ entryPtr = Tcl_FindHashEntry(&tsdPtr->styleTable, (name?name:""));
+ if (entryPtr == NULL) {
+ if (interp != NULL) {
+ Tcl_AppendResult(interp, "style \"", name, "\" doesn't exist", NULL);
+ }
+ return (Tk_Style) NULL;
+ }
+ stylePtr = (Style *) Tcl_GetHashValue(entryPtr);
+ stylePtr->refCount++;
+
+ return (Tk_Style) stylePtr;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_FreeStyle --
+ *
+ * Free a style previously created by Tk_CreateStyle.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * The style's refCount is decremented. If it reaches zero, the style
+ * is freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+Tk_FreeStyle(style)
+ Tk_Style style; /* The style to free. */
+{
+ Style *stylePtr = (Style *) style;
+
+ if (stylePtr == NULL) {
+ return;
+ }
+ stylePtr->refCount--;
+ if (stylePtr->refCount > 0) {
+ return;
+ }
+
+ /*
+ * Keep the default style alive.
+ */
+
+ if (*stylePtr->name == '\0') {
+ stylePtr->refCount = 1;
+ return;
+ }
+
+ Tcl_DeleteHashEntry(stylePtr->hashPtr);
+ FreeStyle(stylePtr);
+ ckfree((char *) stylePtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_AllocStyleFromObj --
+ *
+ * Map the string name of a style to a corresponding Tk_Style. The style
+ * must have already been created by Tk_CreateStyle.
+ *
+ * Results:
+ * The return value is a token for the style that matches objPtr, or
+ * NULL if none found. If NULL is returned, an error message will be
+ * left in interp's result object.
+ *
+ * Side effects:
+ * The style's reference count is incremented. For each call to this
+ * procedure, there should eventually be a call to Tk_FreeStyle() or
+ * Tk_FreeStyleFromObj() so that the database is cleaned up when styles
+ * aren't in use anymore.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+Tk_Style
+Tk_AllocStyleFromObj(interp, objPtr)
+ Tcl_Interp *interp; /* Interp for error return. */
+ Tcl_Obj *objPtr; /* Object containing name of the style to
+ * retrieve. */
+{
+ Style *stylePtr;
+
+ if (objPtr->typePtr != &styleObjType) {
+ SetStyleFromAny(interp, objPtr);
+ stylePtr = (Style *) objPtr->internalRep.otherValuePtr;
+ } else {
+ stylePtr = (Style *) objPtr->internalRep.otherValuePtr;
+ stylePtr->refCount++;
+ }
+
+ return (Tk_Style) stylePtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetStyleFromObj --
+ *
+ * Find the style that corresponds to a given object. The style must
+ * have already been created by Tk_CreateStyle.
+ *
+ * Results:
+ * The return value is a token for the style that matches objPtr, or
+ * NULL if none found.
+ *
+ * Side effects:
+ * If the object is not already a style ref, the conversion will free
+ * any old internal representation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tk_Style
+Tk_GetStyleFromObj(objPtr)
+ Tcl_Obj *objPtr; /* The object from which to get the style. */
+{
+ if (objPtr->typePtr != &styleObjType) {
+ SetStyleFromAny((Tcl_Interp *) NULL, objPtr);
+ }
+
+ return (Tk_Style) objPtr->internalRep.otherValuePtr;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_FreeStyleFromObj --
+ *
+ * Called to release a style inside a Tcl_Obj *.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If the object is a style ref, the conversion will free its
+ * internal representation.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+Tk_FreeStyleFromObj(objPtr)
+ Tcl_Obj *objPtr; /* The Tcl_Obj * to be freed. */
+{
+ if (objPtr->typePtr == &styleObjType) {
+ FreeStyleObjProc(objPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetStyleFromAny --
+ *
+ * Convert the internal representation of a Tcl object to the
+ * style internal form.
+ *
+ * Results:
+ * Always returns TCL_OK. If an error occurs is returned (e.g. the
+ * style doesn't exist), an error message will be left in interp's
+ * result.
+ *
+ * Side effects:
+ * The object is left with its typePtr pointing to styleObjType.
+ * The reference count is incremented (in Tk_GetStyle()).
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+SetStyleFromAny(interp, objPtr)
+ Tcl_Interp *interp; /* Used for error reporting if not NULL. */
+ Tcl_Obj *objPtr; /* The object to convert. */
+{
+ Tcl_ObjType *typePtr;
+ char *name;
+
+ /*
+ * Free the old internalRep before setting the new one.
+ */
+
+ name = Tcl_GetString(objPtr);
+ typePtr = objPtr->typePtr;
+ if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
+ (*typePtr->freeIntRepProc)(objPtr);
+ }
+
+ objPtr->typePtr = &styleObjType;
+ objPtr->internalRep.otherValuePtr = (VOID *) Tk_GetStyle(interp, name);
+
+ return TCL_OK;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * FreeStyleObjProc --
+ *
+ * This proc is called to release an object reference to a style.
+ * Called when the object's internal rep is released.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The reference count is decremented (in Tk_FreeStyle()).
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+FreeStyleObjProc(objPtr)
+ Tcl_Obj *objPtr; /* The object we are releasing. */
+{
+ Style *stylePtr = (Style *) objPtr->internalRep.otherValuePtr;
+
+ if (stylePtr != NULL) {
+ Tk_FreeStyle((Tk_Style) stylePtr);
+ objPtr->internalRep.otherValuePtr = NULL;
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * DupStyleObjProc --
+ *
+ * When a cached style object is duplicated, this is called to
+ * update the internal reps.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The style's refCount is incremented and the internal rep of the copy
+ * is set to point to it.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+DupStyleObjProc(srcObjPtr, dupObjPtr)
+ Tcl_Obj *srcObjPtr; /* The object we are copying from. */
+ Tcl_Obj *dupObjPtr; /* The object we are copying to. */
+{
+ Style *stylePtr = (Style *) srcObjPtr->internalRep.otherValuePtr;
+
+ dupObjPtr->typePtr = srcObjPtr->typePtr;
+ dupObjPtr->internalRep.otherValuePtr = (VOID *) stylePtr;
+
+ if (stylePtr != NULL) {
+ stylePtr->refCount++;
+ }
+}
diff --git a/tk/generic/tkTest.c b/tk/generic/tkTest.c
index 7fd0d5125b4..080589c707f 100644
--- a/tk/generic/tkTest.c
+++ b/tk/generic/tkTest.c
@@ -24,7 +24,7 @@
#include "tkWinInt.h"
#endif
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
#include "tkScrollbar.h"
#endif
@@ -157,9 +157,9 @@ static int CBindingEvalProc _ANSI_ARGS_((ClientData clientData,
static void CBindingFreeProc _ANSI_ARGS_((ClientData clientData));
int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
static int ImageCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static int TestcbindCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static int TestbitmapObjCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj * CONST objv[]));
@@ -173,30 +173,41 @@ static int TestcursorObjCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj * CONST objv[]));
static int TestdeleteappsCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static int TestfontObjCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
static int TestmakeexistCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static int TestmenubarCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
-#if defined(__WIN32__) || defined(MAC_TCL)
+ Tcl_Interp *interp, int argc, CONST char **argv));
+#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)
static int TestmetricsCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
#endif
static int TestobjconfigObjCmd _ANSI_ARGS_((ClientData dummy,
Tcl_Interp *interp, int objc,
Tcl_Obj * CONST objv[]));
+static int CustomOptionSet _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, Tk_Window tkwin,
+ Tcl_Obj **value, char *recordPtr, int internalOffset,
+ char *saveInternalPtr, int flags));
+static Tcl_Obj *CustomOptionGet _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin, char *recordPtr, int internalOffset));
+static void CustomOptionRestore _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin, char *internalPtr,
+ char *saveInternalPtr));
+static void CustomOptionFree _ANSI_ARGS_((ClientData clientData,
+ Tk_Window tkwin, char *internalPtr));
static int TestpropCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static int TestsendCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static int TesttextCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
-#if !(defined(__WIN32__) || defined(MAC_TCL))
+ Tcl_Interp *interp, int argc, CONST char **argv));
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
static int TestwrapperCmd _ANSI_ARGS_((ClientData dummy,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
#endif
static void TrivialCmdDeletedProc _ANSI_ARGS_((
ClientData clientData));
@@ -211,9 +222,8 @@ static void TrivialEventProc _ANSI_ARGS_((ClientData clientData,
*/
extern int TkplatformtestInit _ANSI_ARGS_((Tcl_Interp *interp));
-extern int TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp));
-#if !(defined(__WIN32__) || defined(MAC_TCL))
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
#define TkplatformtestInit(x) TCL_OK
#endif
@@ -271,29 +281,27 @@ Tktest_Init(interp)
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
Tcl_CreateCommand(interp, "testmakeexist", TestmakeexistCmd,
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
+#if !(defined(__WIN32__) || defined(MAC_TCL))
Tcl_CreateCommand(interp, "testmenubar", TestmenubarCmd,
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
-#if defined(__WIN32__) || defined(MAC_TCL)
+#endif
+#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)
Tcl_CreateCommand(interp, "testmetrics", TestmetricsCmd,
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
#endif
Tcl_CreateCommand(interp, "testprop", TestpropCmd,
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
+#if !(defined(__WIN32__) || defined(MAC_TCL))
Tcl_CreateCommand(interp, "testsend", TestsendCmd,
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
+#endif
Tcl_CreateCommand(interp, "testtext", TesttextCmd,
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
-#if !(defined(__WIN32__) || defined(MAC_TCL))
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
Tcl_CreateCommand(interp, "testwrapper", TestwrapperCmd,
(ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
#endif
-#ifdef TCL_THREADS
- if (TclThread_Init(interp) != TCL_OK) {
- return TCL_ERROR;
- }
-#endif
-
/*
* Create test image type.
*/
@@ -332,7 +340,7 @@ TestcbindCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
TkWindow *winPtr;
Tk_Window tkwin;
@@ -581,7 +589,7 @@ TestdeleteappsCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
NewApp *nextPtr;
@@ -620,7 +628,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *options[] = {"alltypes", "chain1", "chain2",
+ static CONST char *options[] = {"alltypes", "chain1", "chain2",
"configerror", "delete", "info", "internal", "new",
"notenoughparams", "twowindows", (char *) NULL};
enum {
@@ -639,6 +647,14 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
* created by commands below; indexed
* with same values as "options"
* array. */
+ static Tk_ObjCustomOption CustomOption = {
+ "custom option",
+ CustomOptionSet,
+ CustomOptionGet,
+ CustomOptionRestore,
+ CustomOptionFree,
+ (ClientData) 1
+ };
Tk_Window mainWin = (Tk_Window) clientData;
Tk_Window tkwin;
int index, result = TCL_OK;
@@ -696,6 +712,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
Tcl_Obj *anchorPtr;
Tcl_Obj *pixelPtr;
Tcl_Obj *mmPtr;
+ Tcl_Obj *customPtr;
} TypesRecord;
TypesRecord *recordPtr;
static char *stringTable[] = {"one", "two", "three", "four",
@@ -761,6 +778,10 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
"-pixel", "pixel", "Pixel",
"1", Tk_Offset(TypesRecord, pixelPtr), -1,
TK_CONFIG_NULL_OK, 0, 0x2000},
+ {TK_OPTION_CUSTOM,
+ "-custom", (char *) NULL, (char *) NULL,
+ "", Tk_Offset(TypesRecord, customPtr), -1,
+ TK_CONFIG_NULL_OK, (ClientData)&CustomOption, 0x4000},
{TK_OPTION_SYNONYM,
"-synonym", (char *) NULL, (char *) NULL,
(char *) NULL, 0, -1, 0, (ClientData) "-color",
@@ -798,6 +819,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
recordPtr->pixelPtr = NULL;
recordPtr->mmPtr = NULL;
recordPtr->stringTablePtr = NULL;
+ recordPtr->customPtr = NULL;
result = Tk_InitOptions(interp, (char *) recordPtr, optionTable,
tkwin);
if (result == TCL_OK) {
@@ -1005,6 +1027,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
int pixels;
double mm;
Tk_Window tkwin;
+ char *custom;
} InternalRecord;
InternalRecord *recordPtr;
static char *internalStringTable[] = {
@@ -1071,6 +1094,10 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
"-window", "window", "Window",
(char *) NULL, -1, Tk_Offset(InternalRecord, tkwin),
TK_CONFIG_NULL_OK, 0, 0},
+ {TK_OPTION_CUSTOM,
+ "-custom", (char *) NULL, (char *) NULL,
+ "", -1, Tk_Offset(InternalRecord, custom),
+ TK_CONFIG_NULL_OK, (ClientData)&CustomOption, 0x4000},
{TK_OPTION_SYNONYM,
"-synonym", (char *) NULL, (char *) NULL,
(char *) NULL, -1, -1, 0, (ClientData) "-color",
@@ -1108,6 +1135,7 @@ TestobjconfigObjCmd(clientData, interp, objc, objv)
recordPtr->pixels = 0;
recordPtr->mm = 0.0;
recordPtr->tkwin = NULL;
+ recordPtr->custom = NULL;
result = Tk_InitOptions(interp, (char *) recordPtr, optionTable,
tkwin);
if (result == TCL_OK) {
@@ -1323,7 +1351,9 @@ TrivialConfigObjCmd(clientData, interp, objc, objv)
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
int result = TCL_OK;
- static char *options[] = {"cget", "configure", "csave", (char *) NULL};
+ static CONST char *options[] = {
+ "cget", "configure", "csave", (char *) NULL
+ };
enum {
CGET, CONFIGURE, CSAVE
};
@@ -1507,7 +1537,7 @@ TestfontObjCmd(clientData, interp, objc, objv)
int objc; /* Number of arguments. */
Tcl_Obj *CONST objv[]; /* Argument objects. */
{
- static char *options[] = {"counts", "subfonts", (char *) NULL};
+ static CONST char *options[] = {"counts", "subfonts", (char *) NULL};
enum option {COUNTS, SUBFONTS};
int index;
Tk_Window tkwin;
@@ -1565,12 +1595,12 @@ TestfontObjCmd(clientData, interp, objc, objv)
/* ARGSUSED */
#ifdef USE_OLD_IMAGE
static int
-ImageCreate(interp, name, argc, objv, typePtr, master, clientDataPtr)
+ImageCreate(interp, name, argc, argv, typePtr, master, clientDataPtr)
Tcl_Interp *interp; /* Interpreter for application containing
* image. */
char *name; /* Name to use for image. */
int argc; /* Number of arguments. */
- Tcl_Obj *CONST objv[]; /* Argument strings for options (doesn't
+ char **argv; /* Argument strings for options (doesn't
* include image name or type). */
Tk_ImageType *typePtr; /* Pointer to our type record (not used). */
Tk_ImageMaster master; /* Token for image, to be used by us in
@@ -1595,7 +1625,7 @@ ImageCreate(interp, name, argc, objv, typePtr, master, clientDataPtr)
argv[i], "\" option", (char *) NULL);
return TCL_ERROR;
}
- varName = Tcl_GetStringFromObj(objv[i+1], NULL);
+ varName = argv[i+1];
}
#else
static int
@@ -1670,7 +1700,7 @@ ImageCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
TImageMaster *timPtr = (TImageMaster *) clientData;
int x, y, width, height;
@@ -1893,7 +1923,7 @@ TestmakeexistCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
Tk_Window mainWin = (Tk_Window) clientData;
int i;
@@ -1934,7 +1964,7 @@ TestmenubarCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
#ifdef __UNIX__
Tk_Window mainWin = (Tk_Window) clientData;
@@ -2002,7 +2032,7 @@ TestmetricsCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
char buf[TCL_INTEGER_SPACE];
@@ -2026,13 +2056,13 @@ TestmetricsCmd(clientData, interp, argc, argv)
return TCL_OK;
}
#endif
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
static int
TestmetricsCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr;
@@ -2087,7 +2117,7 @@ TestpropCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
Tk_Window mainWin = (Tk_Window) clientData;
int result, actualFormat;
@@ -2160,16 +2190,15 @@ TestpropCmd(clientData, interp, argc, argv)
*/
/* ARGSUSED */
+#if !(defined(__WIN32__) || defined(MAC_TCL))
static int
TestsendCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
-#if !(defined(__WIN32__) || defined(MAC_TCL))
TkWindow *winPtr = (TkWindow *) clientData;
-#endif
if (argc < 2) {
Tcl_AppendResult(interp, "wrong # args; must be \"", argv[0],
@@ -2177,7 +2206,6 @@ TestsendCmd(clientData, interp, argc, argv)
return TCL_ERROR;
}
-#if !(defined(__WIN32__) || defined(MAC_TCL))
if (strcmp(argv[1], "bogus") == 0) {
XChangeProperty(winPtr->dispPtr->display,
RootWindow(winPtr->dispPtr->display, 0),
@@ -2226,14 +2254,22 @@ TestsendCmd(clientData, interp, argc, argv)
if (argv[4][0] == 0) {
XDeleteProperty(winPtr->dispPtr->display, w, propName);
} else {
- for (p = argv[4]; *p != 0; p++) {
+ Tcl_DString tmp;
+
+ Tcl_DStringInit(&tmp);
+ for (p = Tcl_DStringAppend(&tmp, argv[4],
+ (int) strlen(argv[4]));
+ *p != 0; p++) {
if (*p == '\n') {
*p = 0;
}
}
+
XChangeProperty(winPtr->dispPtr->display,
w, propName, XA_STRING, 8, PropModeReplace,
- (unsigned char *) argv[4], p-argv[4]);
+ (unsigned char *) Tcl_DStringValue(&tmp),
+ p-Tcl_DStringValue(&tmp));
+ Tcl_DStringFree(&tmp);
}
}
} else if (strcmp(argv[1], "serial") == 0) {
@@ -2246,9 +2282,9 @@ TestsendCmd(clientData, interp, argc, argv)
"\": must be bogus, prop, or serial", (char *) NULL);
return TCL_ERROR;
}
-#endif
return TCL_OK;
}
+#endif
/*
*----------------------------------------------------------------------
@@ -2273,7 +2309,7 @@ TesttextCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
TkText *textPtr;
size_t len;
@@ -2329,7 +2365,7 @@ TesttextCmd(clientData, interp, argc, argv)
return TCL_OK;
}
-#if !(defined(__WIN32__) || defined(MAC_TCL))
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
/*
*----------------------------------------------------------------------
*
@@ -2354,7 +2390,7 @@ TestwrapperCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
TkWindow *winPtr, *wrapperPtr;
Tk_Window tkwin;
@@ -2381,5 +2417,125 @@ TestwrapperCmd(clientData, interp, argc, argv)
return TCL_OK;
}
#endif
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CustomOptionSet, CustomOptionGet, CustomOptionRestore, CustomOptionFree --
+ *
+ * Handlers for object-based custom configuration options. See
+ * Testobjconfigcommand.
+ *
+ * Results:
+ * See user documentation for expected results from these functions.
+ * CustomOptionSet Standard Tcl Result.
+ * CustomOptionGet Tcl_Obj * containing value.
+ * CustomOptionRestore None.
+ * CustomOptionFree None.
+ *
+ * Side effects:
+ * Depends on the function.
+ * CustomOptionSet Sets option value to new setting.
+ * CustomOptionGet Creates a new Tcl_Obj.
+ * CustomOptionRestore Resets option value to original value.
+ * CustomOptionFree Free storage for internal rep of
+ * option.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+CustomOptionSet(clientData,interp, tkwin, value, recordPtr, internalOffset,
+ saveInternalPtr, flags)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ Tk_Window tkwin;
+ Tcl_Obj **value;
+ char *recordPtr;
+ int internalOffset;
+ char *saveInternalPtr;
+ int flags;
+{
+ int objEmpty, length;
+ char *new, *string, *internalPtr;
+
+ objEmpty = 0;
+
+ if (internalOffset >= 0) {
+ internalPtr = recordPtr + internalOffset;
+ } else {
+ internalPtr = NULL;
+ }
+
+ /*
+ * See if the object is empty.
+ */
+ if (value == NULL) {
+ objEmpty = 1;
+ } else {
+ if ((*value)->bytes != NULL) {
+ objEmpty = ((*value)->length == 0);
+ } else {
+ Tcl_GetStringFromObj((*value), &length);
+ objEmpty = (length == 0);
+ }
+ }
+
+ if ((flags & TK_OPTION_NULL_OK) && objEmpty) {
+ *value = NULL;
+ } else {
+ string = Tcl_GetStringFromObj((*value), &length);
+ Tcl_UtfToUpper(string);
+ if (strcmp(string, "BAD") == 0) {
+ Tcl_SetResult(interp, "expected good value, got \"BAD\"",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+ }
+ if (internalPtr != NULL) {
+ if ((*value) != NULL) {
+ string = Tcl_GetStringFromObj((*value), &length);
+ new = ckalloc((size_t) (length + 1));
+ strcpy(new, string);
+ } else {
+ new = NULL;
+ }
+ *((char **) saveInternalPtr) = *((char **) internalPtr);
+ *((char **) internalPtr) = new;
+ }
+ return TCL_OK;
+}
+
+static Tcl_Obj *
+CustomOptionGet(clientData, tkwin, recordPtr, internalOffset)
+ ClientData clientData;
+ Tk_Window tkwin;
+ char *recordPtr;
+ int internalOffset;
+{
+ return (Tcl_NewStringObj(*(char **)(recordPtr + internalOffset), -1));
+}
+
+static void
+CustomOptionRestore(clientData, tkwin, internalPtr, saveInternalPtr)
+ ClientData clientData;
+ Tk_Window tkwin;
+ char *internalPtr;
+ char *saveInternalPtr;
+{
+ *(char **)internalPtr = *(char **)saveInternalPtr;
+ return;
+}
+
+static void
+CustomOptionFree(clientData, tkwin, internalPtr)
+ ClientData clientData;
+ Tk_Window tkwin;
+ char *internalPtr;
+{
+ if (*(char **)internalPtr != NULL) {
+ ckfree(*(char **)internalPtr);
+ }
+}
diff --git a/tk/generic/tkText.c b/tk/generic/tkText.c
index 560c0260d9c..eadfd001c22 100644
--- a/tk/generic/tkText.c
+++ b/tk/generic/tkText.c
@@ -20,8 +20,9 @@
#include "default.h"
#include "tkPort.h"
#include "tkInt.h"
+#include "tkUndo.h"
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
#define Style TkStyle
#define DInfo TkDInfo
#endif
@@ -42,6 +43,9 @@ static Tk_CustomOption stateOption = {
*/
static Tk_ConfigSpec configSpecs[] = {
+ {TK_CONFIG_BOOLEAN, "-autoseparators", "autoSeparators",
+ "AutoSeparators", DEF_TEXT_AUTO_SEPARATORS,
+ Tk_Offset(TkText, autoSeparators), 0},
{TK_CONFIG_BORDER, "-background", "background", "Background",
DEF_TEXT_BG_COLOR, Tk_Offset(TkText, border), TK_CONFIG_COLOR_ONLY},
{TK_CONFIG_BORDER, "-background", "background", "Background",
@@ -87,6 +91,8 @@ static Tk_ConfigSpec configSpecs[] = {
DEF_TEXT_INSERT_ON_TIME, Tk_Offset(TkText, insertOnTime), 0},
{TK_CONFIG_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
DEF_TEXT_INSERT_WIDTH, Tk_Offset(TkText, insertWidth), 0},
+ {TK_CONFIG_INT, "-maxundo", "maxUndo", "MaxUndo",
+ DEF_TEXT_MAX_UNDO, Tk_Offset(TkText, maxUndo), 0},
{TK_CONFIG_PIXELS, "-padx", "padX", "Pad",
DEF_TEXT_PADX, Tk_Offset(TkText, padX), 0},
{TK_CONFIG_PIXELS, "-pady", "padY", "Pad",
@@ -129,6 +135,8 @@ static Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
DEF_TEXT_TAKE_FOCUS, Tk_Offset(TkText, takeFocus),
TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BOOLEAN, "-undo", "undo", "Undo",
+ DEF_TEXT_UNDO, Tk_Offset(TkText, undo), 0},
{TK_CONFIG_INT, "-width", "width", "Width",
DEF_TEXT_WIDTH, Tk_Offset(TkText, width), 0},
{TK_CONFIG_CUSTOM, "-wrap", "wrap", "Wrap",
@@ -139,15 +147,6 @@ static Tk_ConfigSpec configSpecs[] = {
{TK_CONFIG_STRING, "-yscrollcommand", "yScrollCommand", "ScrollCommand",
DEF_TEXT_YSCROLL_COMMAND, Tk_Offset(TkText, yScrollCmd),
TK_CONFIG_NULL_OK},
-
- {TK_CONFIG_STRING, "-synccommand", "syncCommand", "SyncCommand",
- DEF_TEXT_YSCROLL_COMMAND, Tk_Offset(TkText, SyncCmd),
- TK_CONFIG_NULL_OK},
-
-
- {TK_CONFIG_INT, "-tabsize", "tabSize", "TabSize",
- DEF_TEXT_TAB_SIZE, Tk_Offset(TkText, tabsize), 0},
-
{TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL,
(char *) NULL, 0, 0}
};
@@ -164,8 +163,8 @@ int tkTextDebug = 0;
*/
static int WrapModeParseProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, Tk_Window tkwin, char *value,
- char *widgRec, int offset));
+ Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *value, char *widgRec, int offset));
static char * WrapModePrintProc _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr));
@@ -199,7 +198,7 @@ WrapModeParseProc(clientData, interp, tkwin, value, widgRec, offset)
ClientData clientData; /* some flags.*/
Tcl_Interp *interp; /* Used for reporting errors. */
Tk_Window tkwin; /* Window containing canvas widget. */
- char *value; /* Value of option (list of tag
+ CONST char *value; /* Value of option (list of tag
* names). */
char *widgRec; /* Pointer to record for item. */
int offset; /* Offset into item. */
@@ -286,12 +285,14 @@ WrapModePrintProc(clientData, tkwin, widgRec, offset, freeProcPtr)
*/
static int ConfigureText _ANSI_ARGS_((Tcl_Interp *interp,
- TkText *textPtr, int argc, char **argv, int flags));
+ TkText *textPtr, int argc, CONST char **argv,
+ int flags));
static int DeleteChars _ANSI_ARGS_((TkText *textPtr,
- char *index1String, char *index2String));
+ CONST char *index1String, CONST char *index2String,
+ TkTextIndex *indexPtr1, TkTextIndex *indexPtr2));
static void DestroyText _ANSI_ARGS_((char *memPtr));
static void InsertChars _ANSI_ARGS_((TkText *textPtr,
- TkTextIndex *indexPtr, char *string));
+ TkTextIndex *indexPtr, CONST char *string));
static void TextBlinkProc _ANSI_ARGS_((ClientData clientData));
static void TextCmdDeletedProc _ANSI_ARGS_((
ClientData clientData));
@@ -299,30 +300,39 @@ static void TextEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
static int TextFetchSelection _ANSI_ARGS_((ClientData clientData,
int offset, char *buffer, int maxBytes));
+static int TextIndexSortProc _ANSI_ARGS_((CONST VOID *first,
+ CONST VOID *second));
static int TextSearchCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
+static int TextEditCmd _ANSI_ARGS_((TkText *textPtr,
+ Tcl_Interp *interp, int argc, CONST char **argv));
static int TextWidgetCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static void TextWorldChanged _ANSI_ARGS_((
ClientData instanceData));
static int TextDumpCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
static void DumpLine _ANSI_ARGS_((Tcl_Interp *interp,
TkText *textPtr, int what, TkTextLine *linePtr,
- int start, int end, int lineno, char *command));
+ int start, int end, int lineno,
+ CONST char *command));
static int DumpSegment _ANSI_ARGS_((Tcl_Interp *interp, char *key,
- char *value, char * command, TkTextIndex *index,
- int what));
+ char *value, CONST char * command,
+ TkTextIndex *index, int what));
+static int TextEditUndo _ANSI_ARGS_((TkText *textPtr));
+static int TextEditRedo _ANSI_ARGS_((TkText *textPtr));
+static void TextGetText _ANSI_ARGS_((TkTextIndex * index1,
+ TkTextIndex * index2, Tcl_DString *dsPtr));
+static void updateDirtyFlag _ANSI_ARGS_((TkText *textPtr));
/*
* The structure below defines text class behavior by means of procedures
* that can be invoked from generic window code.
*/
-static TkClassProcs textClass = {
- NULL, /* createProc. */
- TextWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+static Tk_ClassProcs textClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ TextWorldChanged, /* worldChangedProc */
};
@@ -349,7 +359,7 @@ Tk_TextCmd(clientData, interp, argc, argv)
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
Tk_Window tkwin = (Tk_Window) clientData;
Tk_Window new;
@@ -371,7 +381,14 @@ Tk_TextCmd(clientData, interp, argc, argv)
return TCL_ERROR;
}
+ /*
+ * Create the text widget and initialize everything to zero,
+ * then set the necessary initial (non-NULL) values.
+ */
+
textPtr = (TkText *) ckalloc(sizeof(TkText));
+ memset((VOID *) textPtr, 0, sizeof(TkText));
+
textPtr->tkwin = new;
textPtr->display = Tk_Display(new);
textPtr->interp = interp;
@@ -380,66 +397,26 @@ Tk_TextCmd(clientData, interp, argc, argv)
(ClientData) textPtr, TextCmdDeletedProc);
textPtr->tree = TkBTreeCreate(textPtr);
Tcl_InitHashTable(&textPtr->tagTable, TCL_STRING_KEYS);
- textPtr->numTags = 0;
Tcl_InitHashTable(&textPtr->markTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&textPtr->windowTable, TCL_STRING_KEYS);
Tcl_InitHashTable(&textPtr->imageTable, TCL_STRING_KEYS);
textPtr->state = TK_STATE_NORMAL;
- textPtr->border = NULL;
- textPtr->borderWidth = 0;
- textPtr->padX = 0;
- textPtr->padY = 0;
textPtr->relief = TK_RELIEF_FLAT;
- textPtr->highlightWidth = 0;
- textPtr->highlightBgColorPtr = NULL;
- textPtr->highlightColorPtr = NULL;
textPtr->cursor = None;
- textPtr->fgColor = NULL;
- textPtr->tkfont = NULL;
textPtr->charWidth = 1;
- textPtr->spacing1 = 0;
- textPtr->spacing2 = 0;
- textPtr->spacing3 = 0;
- textPtr->tabOptionString = NULL;
- textPtr->tabsize = 8;
- textPtr->tabArrayPtr = NULL;
textPtr->wrapMode = TEXT_WRAPMODE_CHAR;
- textPtr->width = 0;
- textPtr->height = 0;
- textPtr->setGrid = 0;
textPtr->prevWidth = Tk_Width(new);
textPtr->prevHeight = Tk_Height(new);
TkTextCreateDInfo(textPtr);
TkTextMakeByteIndex(textPtr->tree, 0, 0, &startIndex);
TkTextSetYView(textPtr, &startIndex, 0);
- textPtr->selTagPtr = NULL;
- textPtr->selBorder = NULL;
- textPtr->selBdString = NULL;
- textPtr->selFgColorPtr = NULL;
textPtr->exportSelection = 1;
- textPtr->abortSelections = 0;
- textPtr->insertMarkPtr = NULL;
- textPtr->insertBorder = NULL;
- textPtr->insertWidth = 0;
- textPtr->insertBorderWidth = 0;
- textPtr->insertOnTime = 0;
- textPtr->insertOffTime = 0;
- textPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
- textPtr->bindingTable = NULL;
- textPtr->currentMarkPtr = NULL;
textPtr->pickEvent.type = LeaveNotify;
- textPtr->pickEvent.xcrossing.x = 0;
- textPtr->pickEvent.xcrossing.y = 0;
- textPtr->numCurTags = 0;
- textPtr->curTagArrayPtr = NULL;
- textPtr->takeFocus = NULL;
- textPtr->xScrollCmd = NULL;
- textPtr->yScrollCmd = NULL;
-
- /*
- * KHAMIS */
- textPtr->SyncCmd = NULL;
- textPtr->flags = 0;
+ textPtr->undoStack = TkUndoInitStack(interp,0);
+ textPtr->undo = 1;
+ textPtr->isDirtyIncrement = 1;
+ textPtr->autoSeparators = 1;
+ textPtr->lastEditMode = TK_TEXT_EDIT_OTHER;
/*
* Create the "sel" tag and the "current" and "insert" marks.
@@ -454,7 +431,7 @@ Tk_TextCmd(clientData, interp, argc, argv)
textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex);
Tk_SetClass(textPtr->tkwin, "Text");
- TkSetClassProcs(textPtr->tkwin, &textClass, (ClientData) textPtr);
+ Tk_SetClassProcs(textPtr->tkwin, &textClass, (ClientData) textPtr);
Tk_CreateEventHandler(textPtr->tkwin,
ExposureMask|StructureNotifyMask|FocusChangeMask,
TextEventProc, (ClientData) textPtr);
@@ -490,77 +467,17 @@ Tk_TextCmd(clientData, interp, argc, argv)
*
*--------------------------------------------------------------
*/
-static int
-ExecSyncCmd (interp, textPtr, argc, argv)
- Tcl_Interp *interp;
- TkText *textPtr;
- int argc;
- char *argv[];
-{
- static int ExecSyncCmdActive=0;
- int i, ret;
- Tcl_DString cmd;
-
- if (ExecSyncCmdActive)
- {
- return TCL_OK;
- }
- ExecSyncCmdActive = 1;
-
- Tcl_DStringInit (&cmd);
- Tcl_DStringAppend (&cmd, textPtr->SyncCmd, -1);
- for (i=1;i<argc;i++) {
- Tcl_DStringAppendElement (&cmd, argv[i]);
- }
-
- ret = Tcl_Eval (interp, Tcl_DStringValue(&cmd));
- Tcl_DStringFree (&cmd);
-
- ExecSyncCmdActive = 0;
-
- return ret;
-}
-
-static void
-ViewArgs (reason, argc, argv, mode)
- char *reason;
- int argc;
- char *argv[];
- int mode;
-{
- int i;
- if (reason)
- {
- fprintf (stderr, "%s\nused arguments:\n", reason);
- }
- for (i=0; i<argc; i++)
- {
- if (mode)
- {
- fprintf (stderr, "%s ", argv[i]);
- }
- else
- {
- fprintf (stderr, "argv[%i] = [%s]\n", i, argv[i]);
- }
- }
- if (mode && mode != 2)
- {
- fprintf (stderr, "\n");
- }
-}
static int
TextWidgetCmd(clientData, interp, argc, argv)
ClientData clientData; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
register TkText *textPtr = (TkText *) clientData;
- int result = TCL_OK;
+ int c, result = TCL_OK;
size_t length;
- int c;
TkTextIndex index1, index2;
if (argc < 2) {
@@ -604,7 +521,7 @@ TextWidgetCmd(clientData, interp, argc, argv)
} else if ((c == 'c') && (strncmp(argv[1], "compare", length) == 0)
&& (length >= 3)) {
int relation, value;
- char *p;
+ CONST char *p;
if (argc != 5) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
@@ -678,18 +595,114 @@ TextWidgetCmd(clientData, interp, argc, argv)
}
} else if ((c == 'd') && (strncmp(argv[1], "delete", length) == 0)
&& (length >= 3)) {
-
-/*ViewArgs ("editor", argc, argv, 0);*/
-
- if ((argc != 3) && (argc != 4)) {
+ int i;
+
+ if (argc < 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " delete index1 ?index2?\"", (char *) NULL);
+ argv[0], " delete index1 ?index2 ...?\"", (char *) NULL);
result = TCL_ERROR;
goto done;
}
if (textPtr->state == TK_STATE_NORMAL) {
- result = DeleteChars(textPtr, argv[2],
- (argc == 4) ? argv[3] : (char *) NULL);
+ if (argc < 5) {
+ /*
+ * Simple case requires no predetermination of indices.
+ */
+ result = DeleteChars(textPtr, argv[2],
+ (argc == 4) ? argv[3] : NULL, NULL, NULL);
+ } else {
+ /*
+ * Multi-index pair case requires that we prevalidate the
+ * indices and sort from last to first so that deletes
+ * occur in the exact (unshifted) text. It also needs to
+ * handle partial and fully overlapping ranges. We have to
+ * do this with multiple passes.
+ */
+ TkTextIndex *indices, *ixStart, *ixEnd, *lastStart, *lastEnd;
+ char *useIdx;
+
+ argc -= 2;
+ argv += 2;
+ indices = (TkTextIndex *)
+ ckalloc((argc + 1) * sizeof(TkTextIndex));
+
+ /*
+ * First pass verifies that all indices are valid.
+ */
+ for (i = 0; i < argc; i++) {
+ if (TkTextGetIndex(interp, textPtr, argv[i],
+ &indices[i]) != TCL_OK) {
+ result = TCL_ERROR;
+ ckfree((char *) indices);
+ goto done;
+ }
+ }
+ /*
+ * Pad out the pairs evenly to make later code easier.
+ */
+ if (argc & 1) {
+ indices[i] = indices[i-1];
+ TkTextIndexForwChars(&indices[i], 1, &indices[i]);
+ argc++;
+ }
+ useIdx = (char *) ckalloc((unsigned) argc);
+ memset(useIdx, 0, (unsigned) argc);
+ /*
+ * Do a decreasing order sort so that we delete the end
+ * ranges first to maintain index consistency.
+ */
+ qsort((VOID *) indices, (unsigned) (argc / 2),
+ 2 * sizeof(TkTextIndex), TextIndexSortProc);
+ lastStart = lastEnd = NULL;
+ /*
+ * Second pass will handle bogus ranges (end < start) and
+ * overlapping ranges.
+ */
+ for (i = 0; i < argc; i += 2) {
+ ixStart = &indices[i];
+ ixEnd = &indices[i+1];
+ if (TkTextIndexCmp(ixEnd, ixStart) <= 0) {
+ continue;
+ }
+ if (lastStart) {
+ if (TkTextIndexCmp(ixStart, lastStart) == 0) {
+ /*
+ * Start indices were equal, and the sort placed
+ * the longest range first, so skip this one.
+ */
+ continue;
+ } else if (TkTextIndexCmp(lastStart, ixEnd) < 0) {
+ /*
+ * The next pair has a start range before the end
+ * point of the last range. Constrain the delete
+ * range, but use the pointer values.
+ */
+ *ixEnd = *lastStart;
+ if (TkTextIndexCmp(ixEnd, ixStart) <= 0) {
+ continue;
+ }
+ }
+ }
+ lastStart = ixStart;
+ lastEnd = ixEnd;
+ useIdx[i] = 1;
+ }
+ /*
+ * Final pass take the input from the previous and deletes
+ * the ranges which are flagged to be deleted.
+ */
+ for (i = 0; i < argc; i += 2) {
+ if (useIdx[i]) {
+ /*
+ * We don't need to check the return value because all
+ * indices are preparsed above.
+ */
+ DeleteChars(textPtr, NULL, NULL,
+ &indices[i], &indices[i+1]);
+ }
+ }
+ ckfree((char *) indices);
+ }
}
} else if ((c == 'd') && (strncmp(argv[1], "dlineinfo", length) == 0)
&& (length >= 2)) {
@@ -712,53 +725,64 @@ TextWidgetCmd(clientData, interp, argc, argv)
sprintf(buf, "%d %d %d %d %d", x, y, width, height, base);
Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
+ } else if ((c == 'e') && (strncmp(argv[1], "edit", length) == 0)) {
+ result = TextEditCmd(textPtr, interp, argc, argv);
} else if ((c == 'g') && (strncmp(argv[1], "get", length) == 0)) {
- if ((argc != 3) && (argc != 4)) {
+ Tcl_Obj *objPtr = NULL;
+ Tcl_DString ds;
+ int i, found = 0;
+
+ if (argc < 3) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " get index1 ?index2?\"", (char *) NULL);
- result = TCL_ERROR;
- goto done;
- }
- if (TkTextGetIndex(interp, textPtr, argv[2], &index1) != TCL_OK) {
+ argv[0], " get index1 ?index2 ...?\"", (char *) NULL);
result = TCL_ERROR;
goto done;
}
- if (argc == 3) {
- index2 = index1;
- TkTextIndexForwChars(&index2, 1, &index2);
- } else if (TkTextGetIndex(interp, textPtr, argv[3], &index2)
- != TCL_OK) {
- result = TCL_ERROR;
- goto done;
- }
- if (TkTextIndexCmp(&index1, &index2) >= 0) {
- goto done;
- }
- while (1) {
- int offset, last, savedChar;
- TkTextSegment *segPtr;
-
- segPtr = TkTextIndexToSeg(&index1, &offset);
- last = segPtr->size;
- if (index1.linePtr == index2.linePtr) {
- int last2;
-
- if (index2.byteIndex == index1.byteIndex) {
- break;
- }
- last2 = index2.byteIndex - index1.byteIndex + offset;
- if (last2 < last) {
- last = last2;
+ for (i = 2; i < argc; i += 2) {
+ if (TkTextGetIndex(interp, textPtr, argv[i], &index1) != TCL_OK) {
+ result = TCL_ERROR;
+ goto done;
+ }
+ if (i+1 == argc) {
+ index2 = index1;
+ TkTextIndexForwChars(&index2, 1, &index2);
+ } else if (TkTextGetIndex(interp, textPtr, argv[i+1], &index2)
+ != TCL_OK) {
+ if (objPtr) {
+ Tcl_DecrRefCount(objPtr);
}
+ result = TCL_ERROR;
+ goto done;
}
- if (segPtr->typePtr == &tkTextCharType) {
- savedChar = segPtr->body.chars[last];
- segPtr->body.chars[last] = 0;
- Tcl_AppendResult(interp, segPtr->body.chars + offset,
- (char *) NULL);
- segPtr->body.chars[last] = savedChar;
+ if (TkTextIndexCmp(&index1, &index2) < 0) {
+ /*
+ * Place the text in a DString and move it to the result.
+ * Since this could in principle be a megabyte or more, we
+ * want to do it efficiently!
+ */
+ TextGetText(&index1, &index2, &ds);
+ found++;
+ if (found == 1) {
+ Tcl_DStringResult(interp, &ds);
+ } else {
+ if (found == 2) {
+ /*
+ * Move the first item we put into the result into
+ * the first element of the list object.
+ */
+ objPtr = Tcl_NewObj();
+ Tcl_ListObjAppendElement(NULL, objPtr,
+ Tcl_GetObjResult(interp));
+ }
+ Tcl_ListObjAppendElement(NULL, objPtr,
+ Tcl_NewStringObj(Tcl_DStringValue(&ds),
+ Tcl_DStringLength(&ds)));
+ }
+ Tcl_DStringFree(&ds);
}
- TkTextIndexForwBytes(&index1, last-offset, &index1);
+ }
+ if (found > 1) {
+ Tcl_SetObjResult(interp, objPtr);
}
} else if ((c == 'i') && (strncmp(argv[1], "index", length) == 0)
&& (length >= 3)) {
@@ -780,11 +804,9 @@ TextWidgetCmd(clientData, interp, argc, argv)
} else if ((c == 'i') && (strncmp(argv[1], "insert", length) == 0)
&& (length >= 3)) {
int i, j, numTags;
- char **tagNames;
+ CONST char **tagNames;
TkTextTag **oldTagArrayPtr;
-/*ViewArgs ("editor", argc, argv, 0);*/
-
if (argc < 4) {
Tcl_AppendResult(interp, "wrong # args: should be \"",
argv[0],
@@ -849,8 +871,8 @@ TextWidgetCmd(clientData, interp, argc, argv)
} else {
Tcl_AppendResult(interp, "bad option \"", argv[1],
"\": must be bbox, cget, compare, configure, debug, delete, ",
- "dlineinfo, dump, get, image, index, insert, mark, scan, ",
- "search, see, tag, window, xview, or yview",
+ "dlineinfo, dump, edit, get, image, index, insert, mark, ",
+ "scan, search, see, tag, window, xview, or yview",
(char *) NULL);
result = TCL_ERROR;
}
@@ -863,6 +885,49 @@ TextWidgetCmd(clientData, interp, argc, argv)
/*
*----------------------------------------------------------------------
*
+ * TextIndexSortProc --
+ *
+ * This procedure is called by qsort when sorting an array of
+ * indices in *decreasing* order (last to first).
+ *
+ * Results:
+ * The return value is -1 if the first argument should be before
+ * the second element, 0 if it's equivalent, and 1 if it should be
+ * after the second element.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TextIndexSortProc(first, second)
+ CONST VOID *first, *second; /* Elements to be compared. */
+{
+ TkTextIndex *pair1 = (TkTextIndex *) first;
+ TkTextIndex *pair2 = (TkTextIndex *) second;
+ int cmp = TkTextIndexCmp(&pair1[1], &pair2[1]);
+
+ if (cmp == 0) {
+ /*
+ * If the first indices were equal, we want the second index of the
+ * pair also to be the greater. Use pointer magic to access the
+ * second index pair.
+ */
+ cmp = TkTextIndexCmp(&pair1[0], &pair2[0]);
+ }
+ if (cmp > 0) {
+ return -1;
+ } else if (cmp < 0) {
+ return 1;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* DestroyText --
*
* This procedure is invoked by Tcl_EventuallyFree or Tcl_Release
@@ -917,6 +982,7 @@ DestroyText(memPtr)
if (textPtr->bindingTable != NULL) {
Tk_DeleteBindingTable(textPtr->bindingTable);
}
+ TkUndoFreeStack(textPtr->undoStack);
/*
* NOTE: do NOT free up selBorder, selBdString, or selFgColorPtr:
@@ -958,7 +1024,7 @@ ConfigureText(interp, textPtr, argc, argv, flags)
register TkText *textPtr; /* Information about widget; may or may
* not already have values for some fields. */
int argc; /* Number of valid entries in argv. */
- char **argv; /* Arguments. */
+ CONST char **argv; /* Arguments. */
int flags; /* Flags to pass to Tk_ConfigureWidget. */
{
int oldExport = textPtr->exportSelection;
@@ -968,6 +1034,8 @@ ConfigureText(interp, textPtr, argc, argv, flags)
return TCL_ERROR;
}
+ TkUndoSetDepth(textPtr->undoStack, textPtr->maxUndo);
+
/*
* A few other options also need special processing, such as parsing
* the geometry and setting the background from a 3-D border.
@@ -1076,6 +1144,16 @@ ConfigureText(interp, textPtr, argc, argv, flags)
}
/*
+ * Account for state changes that would reenable blinking cursor state.
+ */
+
+ if (textPtr->flags & GOT_FOCUS) {
+ Tcl_DeleteTimerHandler(textPtr->insertBlinkHandler);
+ textPtr->insertBlinkHandler = (Tcl_TimerToken) NULL;
+ TextBlinkProc((ClientData) textPtr);
+ }
+
+ /*
* Register the desired geometry for the window, and arrange for
* the window to be redisplayed.
*/
@@ -1282,11 +1360,12 @@ InsertChars(textPtr, indexPtr, string)
TkText *textPtr; /* Overall information about text widget. */
TkTextIndex *indexPtr; /* Where to insert new characters. May be
* modified and/or invalidated. */
- char *string; /* Null-terminated string containing new
+ CONST char *string; /* Null-terminated string containing new
* information to add to text. */
{
int lineIndex, resetView, offset;
TkTextIndex newTop;
+ char indexBuffer[TK_POS_CHARS];
/*
* Don't allow insertions on the last (dummy) line of the text.
@@ -1315,6 +1394,68 @@ InsertChars(textPtr, indexPtr, string)
}
TkTextChanged(textPtr, indexPtr, indexPtr);
TkBTreeInsertChars(indexPtr, string);
+
+ /*
+ * Push the insertion on the undo stack
+ */
+
+ if ( textPtr->undo ) {
+ TkTextIndex toIndex;
+
+ Tcl_DString actionCommand;
+ Tcl_DString revertCommand;
+
+ if (textPtr->autoSeparators &&
+ textPtr->lastEditMode != TK_TEXT_EDIT_INSERT) {
+ TkUndoInsertUndoSeparator(textPtr->undoStack);
+ }
+
+ textPtr->lastEditMode = TK_TEXT_EDIT_INSERT;
+
+ Tcl_DStringInit(&actionCommand);
+ Tcl_DStringInit(&revertCommand);
+
+ Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&actionCommand," insert ",-1);
+ TkTextPrintIndex(indexPtr,indexBuffer);
+ Tcl_DStringAppend(&actionCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&actionCommand," ",-1);
+ Tcl_DStringAppendElement(&actionCommand,string);
+ Tcl_DStringAppend(&actionCommand,";",-1);
+ Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&actionCommand," mark set insert ",-1);
+ TkTextIndexForwBytes(indexPtr, (int) strlen(string),
+ &toIndex);
+ TkTextPrintIndex(&toIndex, indexBuffer);
+ Tcl_DStringAppend(&actionCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&actionCommand,"; ",-1);
+ Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&actionCommand," see insert",-1);
+
+ Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&revertCommand," delete ",-1);
+ TkTextPrintIndex(indexPtr,indexBuffer);
+ Tcl_DStringAppend(&revertCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&revertCommand," ",-1);
+ TkTextPrintIndex(&toIndex, indexBuffer);
+ Tcl_DStringAppend(&revertCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&revertCommand," ;",-1);
+ Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&revertCommand," mark set insert ",-1);
+ TkTextPrintIndex(indexPtr,indexBuffer);
+ Tcl_DStringAppend(&revertCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&revertCommand,"; ",-1);
+ Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&revertCommand," see insert",-1);
+
+ TkUndoPushAction(textPtr->undoStack,&actionCommand, &revertCommand);
+
+ Tcl_DStringFree(&actionCommand);
+ Tcl_DStringFree(&revertCommand);
+
+ }
+ updateDirtyFlag(textPtr);
+
if (resetView) {
TkTextMakeByteIndex(textPtr->tree, lineIndex, 0, &newTop);
TkTextIndexForwBytes(&newTop, offset, &newTop);
@@ -1347,34 +1488,51 @@ InsertChars(textPtr, indexPtr, string)
*/
static int
-DeleteChars(textPtr, index1String, index2String)
+DeleteChars(textPtr, index1String, index2String, indexPtr1, indexPtr2)
TkText *textPtr; /* Overall information about text widget. */
- char *index1String; /* String describing location of first
+ CONST char *index1String; /* String describing location of first
* character to delete. */
- char *index2String; /* String describing location of last
+ CONST char *index2String; /* String describing location of last
* character to delete. NULL means just
* delete the one character given by
* index1String. */
+ TkTextIndex *indexPtr1; /* index describing location of first
+ * character to delete. */
+ TkTextIndex *indexPtr2; /* index describing location of last
+ * character to delete. NULL means just
+ * delete the one character given by
+ * indexPtr1. */
{
int line1, line2, line, byteIndex, resetView;
TkTextIndex index1, index2;
+ char indexBuffer[TK_POS_CHARS];
/*
* Parse the starting and stopping indices.
*/
- if (TkTextGetIndex(textPtr->interp, textPtr, index1String, &index1)
- != TCL_OK) {
- return TCL_ERROR;
- }
- if (index2String != NULL) {
- if (TkTextGetIndex(textPtr->interp, textPtr, index2String, &index2)
+ if (index1String != NULL) {
+ if (TkTextGetIndex(textPtr->interp, textPtr, index1String, &index1)
!= TCL_OK) {
return TCL_ERROR;
}
+ if (index2String != NULL) {
+ if (TkTextGetIndex(textPtr->interp, textPtr, index2String, &index2)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ } else {
+ index2 = index1;
+ TkTextIndexForwChars(&index2, 1, &index2);
+ }
} else {
- index2 = index1;
- TkTextIndexForwChars(&index2, 1, &index2);
+ index1 = *indexPtr1;
+ if (indexPtr2 != NULL) {
+ index2 = *indexPtr2;
+ } else {
+ index2 = index1;
+ TkTextIndexForwChars(&index2, 1, &index2);
+ }
}
/*
@@ -1469,6 +1627,68 @@ DeleteChars(textPtr, index1String, index2String)
byteIndex -= (index2.byteIndex - index1.byteIndex);
}
}
+
+ /*
+ * Push the deletion on the undo stack
+ */
+
+ if (textPtr->undo) {
+ Tcl_DString ds;
+ Tcl_DString actionCommand;
+ Tcl_DString revertCommand;
+
+ if (textPtr->autoSeparators
+ && (textPtr->lastEditMode != TK_TEXT_EDIT_DELETE)) {
+ TkUndoInsertUndoSeparator(textPtr->undoStack);
+ }
+
+ textPtr->lastEditMode = TK_TEXT_EDIT_DELETE;
+
+ Tcl_DStringInit(&actionCommand);
+ Tcl_DStringInit(&revertCommand);
+
+ Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&actionCommand," delete ",-1);
+ TkTextPrintIndex(&index1,indexBuffer);
+ Tcl_DStringAppend(&actionCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&actionCommand," ",-1);
+ TkTextPrintIndex(&index2, indexBuffer);
+ Tcl_DStringAppend(&actionCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&actionCommand,"; ",-1);
+ Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&actionCommand," mark set insert ",-1);
+ TkTextPrintIndex(&index1,indexBuffer);
+ Tcl_DStringAppend(&actionCommand,indexBuffer,-1);
+
+ Tcl_DStringAppend(&actionCommand,"; ",-1);
+ Tcl_DStringAppend(&actionCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&actionCommand," see insert",-1);
+
+ TextGetText(&index1, &index2, &ds);
+
+ Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&revertCommand," insert ",-1);
+ TkTextPrintIndex(&index1,indexBuffer);
+ Tcl_DStringAppend(&revertCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&revertCommand," ",-1);
+ Tcl_DStringAppendElement(&revertCommand,Tcl_DStringValue(&ds));
+ Tcl_DStringAppend(&revertCommand,"; ",-1);
+ Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&revertCommand," mark set insert ",-1);
+ TkTextPrintIndex(&index2, indexBuffer);
+ Tcl_DStringAppend(&revertCommand,indexBuffer,-1);
+ Tcl_DStringAppend(&revertCommand,"; ",-1);
+ Tcl_DStringAppend(&revertCommand,Tcl_GetCommandName(textPtr->interp,textPtr->widgetCmd),-1);
+ Tcl_DStringAppend(&revertCommand," see insert",-1);
+
+ TkUndoPushAction(textPtr->undoStack,&actionCommand, &revertCommand);
+
+ Tcl_DStringFree(&actionCommand);
+ Tcl_DStringFree(&revertCommand);
+
+ }
+ updateDirtyFlag(textPtr);
+
TkBTreeDeleteChars(&index1, &index2);
if (resetView) {
TkTextMakeByteIndex(textPtr->tree, line, byteIndex, &index1);
@@ -1648,6 +1868,7 @@ TkTextLostSelection(clientData)
ClientData clientData; /* Information about text widget. */
{
register TkText *textPtr = (TkText *) clientData;
+ XEvent event;
#ifdef ALWAYS_SHOW_SELECTION
TkTextIndex start, end;
@@ -1666,6 +1887,21 @@ TkTextLostSelection(clientData)
TkTextRedrawTag(textPtr, &start, &end, textPtr->selTagPtr, 1);
TkBTreeTag(&start, &end, textPtr->selTagPtr, 0);
#endif
+
+ /*
+ * Send an event that the selection changed. This is equivalent to
+ * "event generate $textWidget <<Selection>>"
+ */
+
+ memset((VOID *) &event, 0, sizeof(event));
+ event.xany.type = VirtualEvent;
+ event.xany.serial = NextRequest(Tk_Display(textPtr->tkwin));
+ event.xany.send_event = False;
+ event.xany.window = Tk_WindowId(textPtr->tkwin);
+ event.xany.display = Tk_Display(textPtr->tkwin);
+ ((XVirtualEvent *) &event)->name = Tk_GetUid("Selection");
+ Tk_HandleEvent(&event);
+
textPtr->flags &= ~GOT_SELECTION;
}
@@ -1737,14 +1973,14 @@ TextSearchCmd(textPtr, interp, argc, argv)
TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
int backwards, exact, searchElide, c, i, argsLeft, noCase, leftToScan;
size_t length;
int numLines, startingLine, startingByte, lineNum, firstByte, lastByte;
int code, matchLength, matchByte, passes, stopLine, searchWholeText;
int patLength;
- char *arg, *pattern, *varName, *p, *startOfLine;
+ CONST char *arg, *pattern, *varName, *p, *startOfLine;
char buffer[20];
TkTextIndex index, stopIndex;
Tcl_DString line, patDString;
@@ -1830,8 +2066,8 @@ TextSearchCmd(textPtr, interp, argc, argv)
if (noCase && exact) {
Tcl_DStringInit(&patDString);
Tcl_DStringAppend(&patDString, pattern, -1);
+ Tcl_UtfToLower(Tcl_DStringValue(&patDString));
pattern = Tcl_DStringValue(&patDString);
- Tcl_UtfToLower(pattern);
}
Tcl_DStringInit(&line);
@@ -1991,7 +2227,7 @@ TextSearchCmd(textPtr, interp, argc, argv)
i = p - startOfLine;
thisLength = patLength;
} else {
- char *start, *end;
+ CONST char *start, *end;
int match;
match = Tcl_RegExpExec(interp, regexp,
@@ -2152,7 +2388,7 @@ TkTextGetTabs(interp, tkwin, string)
* the text manual entry for details. */
{
int argc, i, count, c;
- char **argv;
+ CONST char **argv;
TkTextTabArray *tabArrayPtr;
TkTextTab *tabPtr;
Tcl_UniChar ch;
@@ -2256,7 +2492,7 @@ TextDumpCmd(textPtr, interp, argc, argv)
register TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "dump". */
{
@@ -2266,7 +2502,7 @@ TextDumpCmd(textPtr, interp, argc, argv)
int what = 0; /* bitfield to select segment types */
int atEnd; /* True if dumping up to logical end */
TkTextLine *linePtr;
- char *command = NULL; /* Script callback to apply to segments */
+ CONST char *command = NULL; /* Script callback to apply to segments */
#define TK_DUMP_TEXT 0x1
#define TK_DUMP_MARK 0x2
#define TK_DUMP_TAG 0x4
@@ -2379,7 +2615,7 @@ DumpLine(interp, textPtr, what, linePtr, startByte, endByte, lineno, command)
TkTextLine *linePtr; /* The current line */
int startByte, endByte; /* Byte range to dump */
int lineno; /* Line number for indices dump */
- char *command; /* Script to apply to the segment */
+ CONST char *command; /* Script to apply to the segment */
{
int offset;
TkTextSegment *segPtr;
@@ -2398,9 +2634,9 @@ DumpLine(interp, textPtr, what, linePtr, startByte, endByte, lineno, command)
offset += segPtr->size, segPtr = segPtr->nextPtr) {
if ((what & TK_DUMP_TEXT) && (segPtr->typePtr == &tkTextCharType) &&
(offset + segPtr->size > startByte)) {
- char savedChar; /* Last char used in the seg */
- int last = segPtr->size; /* Index of savedChar */
- int first = 0; /* Index of first char in seg */
+ char savedChar; /* Last char used in the seg */
+ int last = segPtr->size; /* Index of savedChar */
+ int first = 0; /* Index of first char in seg */
if (offset + segPtr->size > endByte) {
last = endByte - offset;
}
@@ -2473,31 +2709,305 @@ DumpSegment(interp, key, value, command, index, what)
Tcl_Interp *interp;
char *key; /* Segment type key */
char *value; /* Segment value */
- char *command; /* Script callback */
+ CONST char *command; /* Script callback */
TkTextIndex *index; /* index with line/byte position info */
int what; /* Look for TK_DUMP_INDEX bit */
{
char buffer[TCL_INTEGER_SPACE*2];
TkTextPrintIndex(index, buffer);
- if (command == (char *) NULL) {
+ if (command == NULL) {
Tcl_AppendElement(interp, key);
Tcl_AppendElement(interp, value);
Tcl_AppendElement(interp, buffer);
return TCL_OK;
} else {
- char *argv[4];
+ CONST char *argv[4];
char *list;
int result;
argv[0] = key;
argv[1] = value;
argv[2] = buffer;
- argv[3] = (char *) NULL;
+ argv[3] = NULL;
list = Tcl_Merge(3, argv);
result = Tcl_VarEval(interp, command, " ", list, (char *) NULL);
ckfree(list);
return result;
}
}
+
+/*
+ * TextEditUndo --
+ * undo the last change.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+static int
+TextEditUndo(textPtr)
+ TkText * textPtr; /* Overall information about text widget. */
+{
+ int status;
+
+ if (!textPtr->undo) {
+ return TCL_OK;
+ }
+
+ /* Turn off the undo feature */
+ textPtr->undo = 0;
+
+ /* The dirty counter should count downwards as we are undoing things */
+ textPtr->isDirtyIncrement = -1;
+
+ /* revert one compound action */
+ status = TkUndoRevert(textPtr->undoStack);
+
+ /* Restore the isdirty increment */
+ textPtr->isDirtyIncrement = 1;
+
+ /* Turn back on the undo feature */
+ textPtr->undo = 1;
+
+ return status;
+}
+
+/*
+ * TextEditRedo --
+ * redo the last undone change.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+static int
+TextEditRedo(textPtr)
+ TkText * textPtr; /* Overall information about text widget. */
+{
+ int status;
+
+ if (!textPtr->undo) {
+ return TCL_OK;
+ }
+
+ /* Turn off the undo feature temporarily */
+ textPtr->undo = 0;
+
+ /* reapply one compound action */
+ status = TkUndoApply(textPtr->undoStack);
+
+ /* Turn back on the undo feature */
+ textPtr->undo = 1;
+
+ return status;
+}
+
+/*
+ * TextEditCmd --
+ *
+ * Handle the subcommands to "$text edit ...".
+ * See documentation for details.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+static int
+TextEditCmd(textPtr, interp, argc, argv)
+ TkText *textPtr; /* Information about text widget. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+ CONST char **argv; /* Argument strings. */
+{
+ int c, setModified;
+ size_t length;
+
+ if (argc < 3) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ argv[0], " edit option ?arg arg ...?\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ c = argv[2][0];
+ length = strlen(argv[2]);
+ if ((c == 'm') && (strncmp(argv[2], "modified", length) == 0)) {
+ if (argc == 3) {
+ Tcl_SetObjResult(interp, Tcl_NewBooleanObj(textPtr->isDirty));
+ } else if (argc != 4) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ argv[0], " edit modified ?boolean?\"", (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ XEvent event;
+ if (Tcl_GetBoolean(interp, argv[3], &setModified) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ /*
+ * Set or reset the dirty info and trigger a Modified event.
+ */
+
+ if (setModified) {
+ textPtr->isDirty = 1;
+ textPtr->modifiedSet = 1;
+ } else {
+ textPtr->isDirty = 0;
+ textPtr->modifiedSet = 0;
+ }
+
+ /*
+ * Send an event that the text was modified. This is equivalent to
+ * "event generate $textWidget <<Modified>>"
+ */
+
+ memset((VOID *) &event, 0, sizeof(event));
+ event.xany.type = VirtualEvent;
+ event.xany.serial = NextRequest(Tk_Display(textPtr->tkwin));
+ event.xany.send_event = False;
+ event.xany.window = Tk_WindowId(textPtr->tkwin);
+ event.xany.display = Tk_Display(textPtr->tkwin);
+ ((XVirtualEvent *) &event)->name = Tk_GetUid("Modified");
+ Tk_HandleEvent(&event);
+ }
+ } else if ((c == 'r') && (strncmp(argv[2], "redo", length) == 0)
+ && (length >= 3)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ argv[0], " edit redo\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if ( TextEditRedo(textPtr) ) {
+ Tcl_AppendResult(interp, "nothing to redo", (char *) NULL);
+ return TCL_ERROR;
+ }
+ } else if ((c == 'r') && (strncmp(argv[2], "reset", length) == 0)
+ && (length >= 3)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ argv[0], " edit reset\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ TkUndoClearStacks(textPtr->undoStack);
+ } else if ((c == 's') && (strncmp(argv[2], "separator", length) == 0)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ argv[0], " edit separator\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ TkUndoInsertUndoSeparator(textPtr->undoStack);
+ } else if ((c == 'u') && (strncmp(argv[2], "undo", length) == 0)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ argv[0], " edit undo\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if ( TextEditUndo(textPtr) ) {
+ Tcl_AppendResult(interp, "nothing to undo",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ } else {
+ Tcl_AppendResult(interp, "bad edit option \"", argv[2],
+ "\": must be modified, redo, reset, separator or undo",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ * TextGetText --
+ * Returns the text from indexPtr1 to indexPtr2, placing that text
+ * in the Tcl_DString given. That DString should be free or uninitialized.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory will be allocated for the DString. Remember to free it.
+ */
+
+static void
+TextGetText(indexPtr1,indexPtr2, dsPtr)
+ TkTextIndex *indexPtr1;
+ TkTextIndex *indexPtr2;
+ Tcl_DString *dsPtr;
+{
+ TkTextIndex tmpIndex;
+ Tcl_DStringInit(dsPtr);
+
+ TkTextMakeByteIndex(indexPtr1->tree, TkBTreeLineIndex(indexPtr1->linePtr),
+ indexPtr1->byteIndex, &tmpIndex);
+
+ if (TkTextIndexCmp(indexPtr1, indexPtr2) < 0) {
+ while (1) {
+ int offset, last;
+ TkTextSegment *segPtr;
+
+ segPtr = TkTextIndexToSeg(&tmpIndex, &offset);
+ last = segPtr->size;
+ if (tmpIndex.linePtr == indexPtr2->linePtr) {
+ int last2;
+
+ if (indexPtr2->byteIndex == tmpIndex.byteIndex) {
+ break;
+ }
+ last2 = indexPtr2->byteIndex - tmpIndex.byteIndex + offset;
+ if (last2 < last) {
+ last = last2;
+ }
+ }
+ if (segPtr->typePtr == &tkTextCharType) {
+ Tcl_DStringAppend(dsPtr, segPtr->body.chars + offset,
+ last - offset);
+ }
+ TkTextIndexForwBytes(&tmpIndex, last-offset, &tmpIndex);
+ }
+ }
+}
+
+/*
+ * updateDirtyFlag --
+ * increases the dirtyness of the text widget
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+static void updateDirtyFlag (textPtr)
+ TkText *textPtr; /* Information about text widget. */
+{
+ int oldDirtyFlag;
+ if (textPtr->modifiedSet) {
+ return;
+ }
+ oldDirtyFlag = textPtr->isDirty;
+ textPtr->isDirty += textPtr->isDirtyIncrement;
+ if (textPtr->isDirty == 0 || oldDirtyFlag == 0) {
+ XEvent event;
+ /*
+ * Send an event that the text was modified. This is equivalent to
+ * "event generate $textWidget <<Modified>>"
+ */
+ memset((VOID *) &event, 0, sizeof(event));
+ event.xany.type = VirtualEvent;
+ event.xany.serial = NextRequest(Tk_Display(textPtr->tkwin));
+ event.xany.send_event = False;
+ event.xany.window = Tk_WindowId(textPtr->tkwin);
+ event.xany.display = Tk_Display(textPtr->tkwin);
+ ((XVirtualEvent *) &event)->name = Tk_GetUid("Modified");
+ Tk_HandleEvent(&event);
+ }
+}
diff --git a/tk/generic/tkText.h b/tk/generic/tkText.h
index 9152e2c7264..4661330051e 100644
--- a/tk/generic/tkText.h
+++ b/tk/generic/tkText.h
@@ -20,6 +20,10 @@
#include "tk.h"
#endif
+#ifndef _TKUNDO
+#include "tkUndo.h"
+#endif
+
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
@@ -451,6 +455,14 @@ typedef struct TkTextTabArray {
* BE THE LAST IN THE STRUCTURE. */
} TkTextTabArray;
+/* enum definining the edit modes of */
+
+typedef enum {
+ TK_TEXT_EDIT_INSERT, /* insert mode */
+ TK_TEXT_EDIT_DELETE, /* delete mode */
+ TK_TEXT_EDIT_OTHER /* none of the above */
+} TkTextEditMode;
+
/*
* A data structure of the following type is kept for each text widget that
* currently exists for this process:
@@ -525,11 +537,6 @@ typedef struct TkText {
* NULL means perform default tabbing
* behavior. */
- int tabsize; /* "-tabs" reconize only fixed placed tabs, but
- * we need to have the behavior of a normal plain
- * text editor (default is 8)
- */
-
/*
* Additional information used for displaying:
*/
@@ -609,7 +616,7 @@ typedef struct TkText {
/* Pointer to segment for "current" mark,
* or NULL if none. */
XEvent pickEvent; /* The event from which the current character
- * was chosen. Must be saved so that we
+ * was chosen. Must be saved so that we
* can repick after modifications to the
* text. */
int numCurTags; /* Number of tags associated with character
@@ -621,19 +628,47 @@ typedef struct TkText {
* Miscellaneous additional information:
*/
- char *takeFocus; /* Value of -takeFocus option; not used in
+ char *takeFocus; /* Value of -takeFocus option; not used in
* the C code, but used by keyboard traversal
* scripts. Malloc'ed, but may be NULL. */
char *xScrollCmd; /* Prefix of command to issue to update
* horizontal scrollbar when view changes. */
char *yScrollCmd; /* Prefix of command to issue to update
* vertical scrollbar when view changes. */
- /* KHAMIS */
- char *SyncCmd; /* Used to synchronize more than editor with the
- * same file*/
-
- int flags; /* Miscellaneous flags; see below for
+ int flags; /* Miscellaneous flags; see below for
* definitions. */
+
+ /*
+ * Information related to the undo/redo functonality
+ */
+
+ TkUndoRedoStack * undoStack; /* The undo/redo stack */
+
+ int undo; /* non zero means the undo/redo behaviour is
+ * enabled */
+
+ int maxUndo; /* The maximum depth of the undo stack expressed
+ * as the maximum number of compound statements */
+
+ int autoSeparators; /* non zero means the separatorss will be
+ * inserted automatically */
+
+ int modifiedSet; /* Flag indicating that the 'dirtynesss' of
+ * the text widget has been expplicitly set.
+ */
+
+ int isDirty; /* Flag indicating the 'dirtynesss' of the text
+ * widget. If the flag is not zero, unsaved
+ * modifications have been applied to the
+ * text widget */
+
+ int isDirtyIncrement; /* Amount with which the isDirty flag is
+ * incremented every edit action
+ */
+
+ TkTextEditMode lastEditMode; /* Keeps track of what the last edit mode was
+ */
+
} TkText;
/*
@@ -760,7 +795,7 @@ EXTERN TkTextLine * TkBTreeFindLine _ANSI_ARGS_((TkTextBTree tree,
EXTERN TkTextTag ** TkBTreeGetTags _ANSI_ARGS_((TkTextIndex *indexPtr,
int *numTagsPtr));
EXTERN void TkBTreeInsertChars _ANSI_ARGS_((TkTextIndex *indexPtr,
- char *string));
+ CONST char *string));
EXTERN int TkBTreeLineIndex _ANSI_ARGS_((TkTextLine *linePtr));
EXTERN void TkBTreeLinkSegment _ANSI_ARGS_((TkTextSegment *segPtr,
TkTextIndex *indexPtr));
@@ -796,12 +831,12 @@ EXTERN int TkTextDLineInfo _ANSI_ARGS_((TkText *textPtr,
TkTextIndex *indexPtr, int *xPtr, int *yPtr,
int *widthPtr, int *heightPtr, int *basePtr));
EXTERN TkTextTag * TkTextCreateTag _ANSI_ARGS_((TkText *textPtr,
- char *tagName));
+ CONST char *tagName));
EXTERN void TkTextFreeDInfo _ANSI_ARGS_((TkText *textPtr));
EXTERN void TkTextFreeTag _ANSI_ARGS_((TkText *textPtr,
TkTextTag *tagPtr));
EXTERN int TkTextGetIndex _ANSI_ARGS_((Tcl_Interp *interp,
- TkText *textPtr, char *string,
+ TkText *textPtr, CONST char *string,
TkTextIndex *indexPtr));
EXTERN TkTextTabArray * TkTextGetTabs _ANSI_ARGS_((Tcl_Interp *interp,
Tk_Window tkwin, char *string));
@@ -837,9 +872,9 @@ EXTERN TkTextIndex * TkTextMakeByteIndex _ANSI_ARGS_((TkTextBTree tree,
int lineIndex, int byteIndex,
TkTextIndex *indexPtr));
EXTERN int TkTextMarkCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkTextMarkNameToIndex _ANSI_ARGS_((TkText *textPtr,
- char *name, TkTextIndex *indexPtr));
+ CONST char *name, TkTextIndex *indexPtr));
EXTERN void TkTextMarkSegToIndex _ANSI_ARGS_((TkText *textPtr,
TkTextSegment *markPtr, TkTextIndex *indexPtr));
EXTERN void TkTextEventuallyRepick _ANSI_ARGS_((TkText *textPtr));
@@ -856,33 +891,32 @@ EXTERN void TkTextRedrawTag _ANSI_ARGS_((TkText *textPtr,
TkTextTag *tagPtr, int withTag));
EXTERN void TkTextRelayoutWindow _ANSI_ARGS_((TkText *textPtr));
EXTERN int TkTextScanCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkTextSeeCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkTextSegToOffset _ANSI_ARGS_((
CONST TkTextSegment *segPtr,
CONST TkTextLine *linePtr));
-EXTERN TkTextSegment * TkTextSetMark _ANSI_ARGS_((TkText *textPtr, char *name,
- TkTextIndex *indexPtr));
+EXTERN TkTextSegment * TkTextSetMark _ANSI_ARGS_((TkText *textPtr,
+ CONST char *name, TkTextIndex *indexPtr));
EXTERN void TkTextSetYView _ANSI_ARGS_((TkText *textPtr,
TkTextIndex *indexPtr, int pickPlace));
EXTERN int TkTextTagCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkTextImageCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkTextImageIndex _ANSI_ARGS_((TkText *textPtr,
- char *name, TkTextIndex *indexPtr));
+ CONST char *name, TkTextIndex *indexPtr));
EXTERN int TkTextWindowCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkTextWindowIndex _ANSI_ARGS_((TkText *textPtr,
- char *name, TkTextIndex *indexPtr));
+ CONST char *name, TkTextIndex *indexPtr));
EXTERN int TkTextXviewCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
EXTERN int TkTextYviewCmd _ANSI_ARGS_((TkText *textPtr,
- Tcl_Interp *interp, int argc, char **argv));
+ Tcl_Interp *interp, int argc, CONST char **argv));
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKTEXT */
-
diff --git a/tk/generic/tkTextBTree.c b/tk/generic/tkTextBTree.c
index 42fa1b2cba4..89d7db99ba4 100644
--- a/tk/generic/tkTextBTree.c
+++ b/tk/generic/tkTextBTree.c
@@ -393,7 +393,7 @@ TkBTreeInsertChars(indexPtr, string)
* index is no longer valid because
* of changes to the segment
* structure. */
- char *string; /* Pointer to bytes to insert (may
+ CONST char *string; /* Pointer to bytes to insert (may
* contain newlines, must be null-
* terminated). */
{
@@ -410,7 +410,7 @@ TkBTreeInsertChars(indexPtr, string)
register TkTextSegment *segPtr;
TkTextLine *newLinePtr;
int chunkSize; /* # characters in current chunk. */
- register char *eol; /* Pointer to character just after last
+ register CONST char *eol; /* Pointer to character just after last
* one in current chunk. */
int changeToLineCount; /* Counts change to total number of
* lines in file. */
@@ -3753,4 +3753,3 @@ TkBTreeBytesInLine(linePtr)
}
return count;
}
-
diff --git a/tk/generic/tkTextDisp.c b/tk/generic/tkTextDisp.c
index 36906b8caba..84e003a519f 100644
--- a/tk/generic/tkTextDisp.c
+++ b/tk/generic/tkTextDisp.c
@@ -96,6 +96,16 @@ typedef struct TextStyle {
&& ((s1)->sValuePtr->bgStipple == (s2)->sValuePtr->bgStipple))
/*
+ * The following macro is used to compare two floating-point numbers
+ * to within a certain degree of scale. Direct comparison fails on
+ * processors where the processor and memory representations of FP
+ * numbers of a particular precision is different (e.g. Intel)
+ */
+
+#define FP_EQUAL_SCALE(double1, double2, scaleFactor) \
+ (fabs((double1)-(double2))*((scaleFactor)+1.0) < 0.3)
+
+/*
* The following structure describes one line of the display, which may
* be either part or all of one line of the text.
*/
@@ -359,7 +369,7 @@ static int MeasureChars _ANSI_ARGS_((Tk_Font tkfont,
static void MeasureUp _ANSI_ARGS_((TkText *textPtr,
TkTextIndex *srcPtr, int distance,
TkTextIndex *dstPtr));
-static int NextTabStop _ANSI_ARGS_((TkText *textPtr, Tk_Font tkfont, int x,
+static int NextTabStop _ANSI_ARGS_((Tk_Font tkfont, int x,
int tabOrigin));
static void UpdateDisplayInfo _ANSI_ARGS_((TkText *textPtr));
static void ScrollByLines _ANSI_ARGS_((TkText *textPtr,
@@ -1880,6 +1890,25 @@ DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap)
rightX = maxX;
}
if (chunkPtr->stylePtr->bgGC != None) {
+ /* Not visible - bail out now */
+ if (rightX + xOffset <= 0) {
+ leftX = rightX;
+ continue;
+ }
+
+ /*
+ * Trim the start position for drawing to be no further away than
+ * -borderWidth. The reason is that on many X servers drawing from
+ * -32768 (or less) to +something simply does not display
+ * correctly. [Patch #541999]
+ */
+ if ((leftX + xOffset) < -(sValuePtr->borderWidth)) {
+ leftX = -sValuePtr->borderWidth - xOffset;
+ }
+ if ((rightX - leftX) > 32767) {
+ rightX = leftX + 32767;
+ }
+
XFillRectangle(display, pixmap, chunkPtr->stylePtr->bgGC,
leftX + xOffset, 0, (unsigned int) (rightX - leftX),
(unsigned int) dlPtr->height);
@@ -3270,7 +3299,7 @@ TkTextSeeCmd(textPtr, interp, argc, argv)
TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "see". */
{
@@ -3392,7 +3421,7 @@ TkTextXviewCmd(textPtr, interp, argc, argv)
TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "xview". */
{
@@ -3580,7 +3609,7 @@ TkTextYviewCmd(textPtr, interp, argc, argv)
TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "yview". */
{
@@ -3746,7 +3775,7 @@ TkTextScanCmd(textPtr, interp, argc, argv)
register TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "scan". */
{
@@ -3865,7 +3894,7 @@ GetXView(interp, textPtr, report)
* scrollbar if it has changed. */
{
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
- char buffer[TCL_DOUBLE_SPACE * 2];
+ char buffer[TCL_DOUBLE_SPACE * 2 + 1];
double first, last;
int code;
@@ -3886,7 +3915,8 @@ GetXView(interp, textPtr, report)
Tcl_SetResult(interp, buffer, TCL_VOLATILE);
return;
}
- if ((first == dInfoPtr->xScrollFirst) && (last == dInfoPtr->xScrollLast)) {
+ if (FP_EQUAL_SCALE(first, dInfoPtr->xScrollFirst, dInfoPtr->maxLength) &&
+ FP_EQUAL_SCALE(last, dInfoPtr->xScrollLast, dInfoPtr->maxLength)) {
return;
}
dInfoPtr->xScrollFirst = first;
@@ -3936,7 +3966,7 @@ GetYView(interp, textPtr, report)
* scrollbar if it has changed. */
{
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
- char buffer[TCL_DOUBLE_SPACE * 2];
+ char buffer[TCL_DOUBLE_SPACE * 2 + 1];
double first, last;
DLine *dlPtr;
int totalLines, code, count;
@@ -3971,7 +4001,8 @@ GetYView(interp, textPtr, report)
Tcl_SetResult(interp, buffer, TCL_VOLATILE);
return;
}
- if ((first == dInfoPtr->yScrollFirst) && (last == dInfoPtr->yScrollLast)) {
+ if (FP_EQUAL_SCALE(first, dInfoPtr->yScrollFirst, totalLines) &&
+ FP_EQUAL_SCALE(last, dInfoPtr->yScrollLast, totalLines)) {
return;
}
dInfoPtr->yScrollFirst = first;
@@ -4380,7 +4411,7 @@ ElideMeasureProc(chunkPtr, x)
*
* This procedure is the "layoutProc" for character segments.
*
-n * Results:
+ * Results:
* If there is something to display for the chunk then a
* non-zero value is returned and the fields of chunkPtr
* will be filled in (see the declaration of TkTextDispChunk
@@ -4830,7 +4861,7 @@ AdjustForTab(textPtr, tabArrayPtr, index, chunkPtr)
* interpretation of tabs.
*/
- desired = NextTabStop(textPtr, textPtr->tkfont, x, 0);
+ desired = NextTabStop(textPtr->tkfont, x, 0);
goto update;
}
@@ -4988,7 +5019,7 @@ SizeOfTab(textPtr, tabArrayPtr, index, x, maxX)
TkTextTabAlign alignment;
if ((tabArrayPtr == NULL) || (tabArrayPtr->numTabs == 0)) {
- tabX = NextTabStop(textPtr, textPtr->tkfont, x, 0);
+ tabX = NextTabStop(textPtr->tkfont, x, 0);
return tabX - x;
}
if (index < tabArrayPtr->numTabs) {
@@ -5070,8 +5101,7 @@ SizeOfTab(textPtr, tabArrayPtr, index, x, maxX)
*/
static int
-NextTabStop(textPtr, tkfont, x, tabOrigin)
- TkText *textPtr;
+NextTabStop(tkfont, x, tabOrigin)
Tk_Font tkfont; /* Font in which chunk that contains tab
* stop will be drawn. */
int x; /* X-position in pixels where last
@@ -5082,11 +5112,7 @@ NextTabStop(textPtr, tkfont, x, tabOrigin)
{
int tabWidth, rem;
-#if 1
- tabWidth = Tk_TextWidth(tkfont, "0", 1) * textPtr->tabsize;
-#else
tabWidth = Tk_TextWidth(tkfont, "0", 1) * 8;
-#endif
if (tabWidth == 0) {
tabWidth = 1;
}
@@ -5197,4 +5223,3 @@ MeasureChars(tkfont, source, maxBytes, startX, maxX, tabOrigin, nextXPtr)
*nextXPtr = curX;
return start - source;
}
-
diff --git a/tk/generic/tkTextImage.c b/tk/generic/tkTextImage.c
index 01757b071f8..3bed0cd1715 100644
--- a/tk/generic/tkTextImage.c
+++ b/tk/generic/tkTextImage.c
@@ -38,8 +38,8 @@
*/
static int AlignParseProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, Tk_Window tkwin, char *value,
- char *widgRec, int offset));
+ Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *value, char *widgRec, int offset));
static char * AlignPrintProc _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr));
@@ -52,7 +52,7 @@ static void EmbImageBboxProc _ANSI_ARGS_((TkTextDispChunk *chunkPtr,
int *xPtr, int *yPtr, int *widthPtr,
int *heightPtr));
static int EmbImageConfigure _ANSI_ARGS_((TkText *textPtr,
- TkTextSegment *eiPtr, int argc, char **argv));
+ TkTextSegment *eiPtr, int argc, CONST char **argv));
static int EmbImageDeleteProc _ANSI_ARGS_((TkTextSegment *segPtr,
TkTextLine *linePtr, int treeGone));
static void EmbImageDisplayProc _ANSI_ARGS_((
@@ -132,7 +132,7 @@ TkTextImageCmd(textPtr, interp, argc, argv)
register TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "image". */
{
@@ -303,7 +303,7 @@ EmbImageConfigure(textPtr, eiPtr, argc, argv)
* contains embedded image. */
TkTextSegment *eiPtr; /* Embedded image to be configured. */
int argc; /* Number of strings in argv. */
- char **argv; /* Array of strings describing configuration
+ CONST char **argv; /* Array of strings describing configuration
* options. */
{
Tk_Image image;
@@ -423,7 +423,7 @@ AlignParseProc(clientData, interp, tkwin, value, widgRec, offset)
ClientData clientData; /* Not used.*/
Tcl_Interp *interp; /* Used for reporting errors. */
Tk_Window tkwin; /* Window for text widget. */
- char *value; /* Value of option. */
+ CONST char *value; /* Value of option. */
char *widgRec; /* Pointer to TkTextEmbWindow
* structure. */
int offset; /* Offset into item (ignored). */
@@ -844,7 +844,7 @@ EmbImageBboxProc(chunkPtr, index, y, lineHeight, baseline, xPtr, yPtr,
int
TkTextImageIndex(textPtr, name, indexPtr)
TkText *textPtr; /* Text widget containing image. */
- char *name; /* Name of image. */
+ CONST char *name; /* Name of image. */
TkTextIndex *indexPtr; /* Index information gets stored here. */
{
Tcl_HashEntry *hPtr;
@@ -896,4 +896,3 @@ EmbImageProc(clientData, x, y, width, height, imgWidth, imgHeight)
index.byteIndex = TkTextSegToOffset(eiPtr, eiPtr->body.ei.linePtr);
TkTextChanged(eiPtr->body.ei.textPtr, &index, &index);
}
-
diff --git a/tk/generic/tkTextIndex.c b/tk/generic/tkTextIndex.c
index 0b59b536c07..b1a4311ba15 100644
--- a/tk/generic/tkTextIndex.c
+++ b/tk/generic/tkTextIndex.c
@@ -28,9 +28,9 @@
* Forward declarations for procedures defined later in this file:
*/
-static char * ForwBack _ANSI_ARGS_((char *string,
+static CONST char * ForwBack _ANSI_ARGS_((CONST char *string,
TkTextIndex *indexPtr));
-static char * StartEnd _ANSI_ARGS_(( char *string,
+static CONST char * StartEnd _ANSI_ARGS_((CONST char *string,
TkTextIndex *indexPtr));
/*
@@ -64,7 +64,7 @@ TkTextMakeByteIndex(tree, lineIndex, byteIndex, indexPtr)
{
TkTextSegment *segPtr;
int index;
- char *p, *start;
+ CONST char *p, *start;
Tcl_UniChar ch;
indexPtr->tree = tree;
@@ -314,7 +314,7 @@ int
TkTextGetIndex(interp, textPtr, string, indexPtr)
Tcl_Interp *interp; /* Use this for error reporting. */
TkText *textPtr; /* Information about text widget. */
- char *string; /* Textual description of position. */
+ CONST char *string; /* Textual description of position. */
TkTextIndex *indexPtr; /* Index structure to fill in. */
{
char *p, *end, *endOfBase;
@@ -324,6 +324,8 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
TkTextIndex first, last;
int wantLast, result;
char c;
+ CONST char *cp;
+ Tcl_DString copy;
/*
*---------------------------------------------------------------------
@@ -354,7 +356,8 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
* funny characters like "@" or "+1c".
*/
- p = strrchr(string, '.');
+ Tcl_DStringInit(&copy);
+ p = strrchr(Tcl_DStringAppend(&copy, string, -1), '.');
if (p != NULL) {
if ((p[1] == 'f') && (strncmp(p+1, "first", 5) == 0)) {
wantLast = 0;
@@ -366,7 +369,7 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
goto tryxy;
}
*p = 0;
- hPtr = Tcl_FindHashEntry(&textPtr->tagTable, string);
+ hPtr = Tcl_FindHashEntry(&textPtr->tagTable, Tcl_DStringValue(&copy));
*p = '.';
if (hPtr == NULL) {
goto tryxy;
@@ -377,10 +380,12 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
&last);
TkBTreeStartSearch(&first, &last, tagPtr, &search);
if (!TkBTreeCharTagged(&first, tagPtr) && !TkBTreeNextTag(&search)) {
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp,
"text doesn't contain any characters tagged with \"",
Tcl_GetHashKey(&textPtr->tagTable, hPtr), "\"",
(char *) NULL);
+ Tcl_DStringFree(&copy);
return TCL_ERROR;
}
*indexPtr = search.curIndex;
@@ -400,14 +405,14 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
int x, y;
- p = string+1;
- x = strtol(p, &end, 0);
- if ((end == p) || (*end != ',')) {
+ cp = string+1;
+ x = strtol(cp, &end, 0);
+ if ((end == cp) || (*end != ',')) {
goto error;
}
- p = end+1;
- y = strtol(p, &end, 0);
- if (end == p) {
+ cp = end+1;
+ y = strtol(cp, &end, 0);
+ if (end == cp) {
goto error;
}
TkTextPixelIndex(textPtr, x, y, indexPtr);
@@ -441,7 +446,7 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
goto gotBase;
}
- for (p = string; *p != 0; p++) {
+ for (p = Tcl_DStringValue(&copy); *p != 0; p++) {
if (isspace(UCHAR(*p)) || (*p == '+') || (*p == '-')) {
break;
}
@@ -454,14 +459,15 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
c = *endOfBase;
*endOfBase = 0;
- result = TkTextWindowIndex(textPtr, string, indexPtr);
+ result = TkTextWindowIndex(textPtr, Tcl_DStringValue(&copy), indexPtr);
*endOfBase = c;
if (result != 0) {
goto gotBase;
}
}
if ((string[0] == 'e')
- && (strncmp(string, "end", (size_t) (endOfBase-string)) == 0)) {
+ && (strncmp(string, "end",
+ (size_t) (endOfBase-Tcl_DStringValue(&copy))) == 0)) {
/*
* Base position is end of text.
*/
@@ -476,7 +482,8 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
c = *endOfBase;
*endOfBase = 0;
- result = TkTextMarkNameToIndex(textPtr, string, indexPtr);
+ result = TkTextMarkNameToIndex(textPtr, Tcl_DStringValue(&copy),
+ indexPtr);
*endOfBase = c;
if (result == TCL_OK) {
goto gotBase;
@@ -488,7 +495,7 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
c = *endOfBase;
*endOfBase = 0;
- result = TkTextImageIndex(textPtr, string, indexPtr);
+ result = TkTextImageIndex(textPtr, Tcl_DStringValue(&copy), indexPtr);
*endOfBase = c;
if (result != 0) {
goto gotBase;
@@ -506,27 +513,30 @@ TkTextGetIndex(interp, textPtr, string, indexPtr)
*/
gotBase:
- p = endOfBase;
+ cp = endOfBase;
while (1) {
- while (isspace(UCHAR(*p))) {
- p++;
+ while (isspace(UCHAR(*cp))) {
+ cp++;
}
- if (*p == 0) {
+ if (*cp == 0) {
break;
}
- if ((*p == '+') || (*p == '-')) {
- p = ForwBack(p, indexPtr);
+ if ((*cp == '+') || (*cp == '-')) {
+ cp = ForwBack(cp, indexPtr);
} else {
- p = StartEnd(p, indexPtr);
+ cp = StartEnd(cp, indexPtr);
}
- if (p == NULL) {
+ if (cp == NULL) {
goto error;
}
}
+ Tcl_DStringFree(&copy);
return TCL_OK;
error:
+ Tcl_DStringFree(&copy);
+ Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "bad text index \"", string, "\"",
(char *) NULL);
return TCL_ERROR;
@@ -645,16 +655,16 @@ TkTextIndexCmp(index1Ptr, index2Ptr)
*---------------------------------------------------------------------------
*/
-static char *
+static CONST char *
ForwBack(string, indexPtr)
- char *string; /* String to parse for additional info
+ CONST char *string; /* String to parse for additional info
* about modifier (count and units).
* Points to "+" or "-" that starts
* modifier. */
TkTextIndex *indexPtr; /* Index to update as specified in string. */
{
- register char *p;
- char *end, *units;
+ register CONST char *p, *units;
+ char *end;
int count, lineIndex;
size_t length;
@@ -977,7 +987,7 @@ TkTextIndexBackChars(srcPtr, charCount, dstPtr)
{
TkTextSegment *segPtr, *oldPtr;
int lineIndex, segSize;
- char *p, *start, *end;
+ CONST char *p, *start, *end;
if (charCount <= 0) {
TkTextIndexForwChars(srcPtr, -charCount, dstPtr);
@@ -1085,15 +1095,15 @@ TkTextIndexBackChars(srcPtr, charCount, dstPtr)
*----------------------------------------------------------------------
*/
-static char *
+static CONST char *
StartEnd(string, indexPtr)
- char *string; /* String to parse for additional info
+ CONST char *string; /* String to parse for additional info
* about modifier (count and units).
* Points to first character of modifer
* word. */
TkTextIndex *indexPtr; /* Index to mdoify based on string. */
{
- char *p;
+ CONST char *p;
int c, offset;
size_t length;
register TkTextSegment *segPtr;
@@ -1184,4 +1194,3 @@ StartEnd(string, indexPtr)
done:
return p;
}
-
diff --git a/tk/generic/tkTextMark.c b/tk/generic/tkTextMark.c
index c2e262a4c92..e11a58f62b2 100644
--- a/tk/generic/tkTextMark.c
+++ b/tk/generic/tkTextMark.c
@@ -42,9 +42,9 @@ static int MarkLayoutProc _ANSI_ARGS_((TkText *textPtr,
int noCharsYet, TkWrapMode wrapMode,
TkTextDispChunk *chunkPtr));
static int MarkFindNext _ANSI_ARGS_((Tcl_Interp *interp,
- TkText *textPtr, char *markName));
+ TkText *textPtr, CONST char *markName));
static int MarkFindPrev _ANSI_ARGS_((Tcl_Interp *interp,
- TkText *textPtr, char *markName));
+ TkText *textPtr, CONST char *markName));
/*
@@ -99,7 +99,7 @@ TkTextMarkCmd(textPtr, interp, argc, argv)
register TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "mark". */
{
@@ -235,7 +235,7 @@ TkTextMarkCmd(textPtr, interp, argc, argv)
TkTextSegment *
TkTextSetMark(textPtr, name, indexPtr)
TkText *textPtr; /* Text widget in which to create mark. */
- char *name; /* Name of mark to set. */
+ CONST char *name; /* Name of mark to set. */
TkTextIndex *indexPtr; /* Where to set mark. */
{
Tcl_HashEntry *hPtr;
@@ -350,7 +350,7 @@ TkTextMarkSegToIndex(textPtr, markPtr, indexPtr)
int
TkTextMarkNameToIndex(textPtr, name, indexPtr)
TkText *textPtr; /* Text widget containing mark. */
- char *name; /* Name of mark. */
+ CONST char *name; /* Name of mark. */
TkTextIndex *indexPtr; /* Index information gets stored here. */
{
Tcl_HashEntry *hPtr;
@@ -526,12 +526,16 @@ TkTextInsertDisplayProc(chunkPtr, x, y, height, baseline, display, dst, screenY)
if ((x + halfWidth) < 0) {
/*
- * The insertion cursor is off-screen. Just return.
+ * The insertion cursor is off-screen.
+ * Indicate caret at 0,0 and return.
*/
+ Tk_SetCaretPos(textPtr->tkwin, 0, 0, height);
return;
}
+ Tk_SetCaretPos(textPtr->tkwin, x - halfWidth, screenY, height);
+
/*
* As a special hack to keep the cursor visible on mono displays
* (or anywhere else that the selection and insertion cursors
@@ -542,12 +546,12 @@ TkTextInsertDisplayProc(chunkPtr, x, y, height, baseline, display, dst, screenY)
if (textPtr->flags & INSERT_ON) {
Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->insertBorder,
- x - textPtr->insertWidth/2, y, textPtr->insertWidth,
- height, textPtr->insertBorderWidth, TK_RELIEF_RAISED);
+ x - halfWidth, y, textPtr->insertWidth, height,
+ textPtr->insertBorderWidth, TK_RELIEF_RAISED);
} else if (textPtr->selBorder == textPtr->insertBorder) {
Tk_Fill3DRectangle(textPtr->tkwin, dst, textPtr->border,
- x - textPtr->insertWidth/2, y, textPtr->insertWidth,
- height, 0, TK_RELIEF_FLAT);
+ x - halfWidth, y, textPtr->insertWidth, height,
+ 0, TK_RELIEF_FLAT);
}
}
@@ -643,7 +647,7 @@ static int
MarkFindNext(interp, textPtr, string)
Tcl_Interp *interp; /* For error reporting */
TkText *textPtr; /* The widget */
- char *string; /* The starting index or mark name */
+ CONST char *string; /* The starting index or mark name */
{
TkTextIndex index;
Tcl_HashEntry *hPtr;
@@ -717,7 +721,7 @@ static int
MarkFindPrev(interp, textPtr, string)
Tcl_Interp *interp; /* For error reporting */
TkText *textPtr; /* The widget */
- char *string; /* The starting index or mark name */
+ CONST char *string; /* The starting index or mark name */
{
TkTextIndex index;
Tcl_HashEntry *hPtr;
@@ -773,4 +777,3 @@ MarkFindPrev(interp, textPtr, string)
segPtr = NULL;
}
}
-
diff --git a/tk/generic/tkTextTag.c b/tk/generic/tkTextTag.c
index f623b93026e..b35390c393c 100644
--- a/tk/generic/tkTextTag.c
+++ b/tk/generic/tkTextTag.c
@@ -76,7 +76,7 @@ static Tk_ConfigSpec tagConfigSpecs[] = {
static void ChangeTagPriority _ANSI_ARGS_((TkText *textPtr,
TkTextTag *tagPtr, int prio));
static TkTextTag * FindTag _ANSI_ARGS_((Tcl_Interp *interp,
- TkText *textPtr, char *tagName));
+ TkText *textPtr, CONST char *tagName));
static void SortTags _ANSI_ARGS_((int numTags,
TkTextTag **tagArrayPtr));
static int TagSortProc _ANSI_ARGS_((CONST VOID *first,
@@ -105,7 +105,7 @@ TkTextTagCmd(textPtr, interp, argc, argv)
register TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "tag". */
{
@@ -151,7 +151,7 @@ TkTextTagCmd(textPtr, interp, argc, argv)
index2 = index1;
TkTextIndexForwChars(&index2, 1, &index2);
}
-
+
if (tagPtr->affectsDisplay) {
TkTextRedrawTag(textPtr, &index1, &index2, tagPtr, !addTag);
} else {
@@ -159,18 +159,34 @@ TkTextTagCmd(textPtr, interp, argc, argv)
* Still need to trigger enter/leave events on tags that
* have changed.
*/
-
+
TkTextEventuallyRepick(textPtr);
}
TkBTreeTag(&index1, &index2, tagPtr, addTag);
-
+
/*
* If the tag is "sel" then grab the selection if we're supposed
* to export it and don't already have it. Also, invalidate
* partially-completed selection retrievals.
*/
-
+
if (tagPtr == textPtr->selTagPtr) {
+ XEvent event;
+ /*
+ * Send an event that the selection changed.
+ * This is equivalent to
+ * "event generate $textWidget <<Selection>>"
+ */
+
+ memset((VOID *) &event, 0, sizeof(event));
+ event.xany.type = VirtualEvent;
+ event.xany.serial = NextRequest(Tk_Display(textPtr->tkwin));
+ event.xany.send_event = False;
+ event.xany.window = Tk_WindowId(textPtr->tkwin);
+ event.xany.display = Tk_Display(textPtr->tkwin);
+ ((XVirtualEvent *) &event)->name = Tk_GetUid("Selection");
+ Tk_HandleEvent(&event);
+
if (addTag && textPtr->exportSelection
&& !(textPtr->flags & GOT_SELECTION)) {
Tk_OwnSelection(textPtr->tkwin, XA_PRIMARY,
@@ -229,12 +245,12 @@ TkTextTagCmd(textPtr, interp, argc, argv)
return TCL_ERROR;
}
} else if (argc == 5) {
- char *command;
+ CONST char *command;
command = Tk_GetBinding(interp, textPtr->bindingTable,
(ClientData) tagPtr, argv[4]);
if (command == NULL) {
- char *string = Tcl_GetStringResult(interp);
+ CONST char *string = Tcl_GetStringResult(interp);
/*
* Ignore missing binding errors. This is a special hack
@@ -248,7 +264,7 @@ TkTextTagCmd(textPtr, interp, argc, argv)
Tcl_ResetResult(interp);
}
} else {
- Tcl_SetResult(interp, command, TCL_STATIC);
+ Tcl_SetResult(interp, (char *) command, TCL_STATIC);
}
} else {
Tk_GetAllBindings(interp, textPtr->bindingTable,
@@ -462,6 +478,25 @@ TkTextTagCmd(textPtr, interp, argc, argv)
TkTextMakeByteIndex(textPtr->tree, TkBTreeNumLines(textPtr->tree),
0, &last),
TkBTreeTag(&first, &last, tagPtr, 0);
+
+ if (tagPtr == textPtr->selTagPtr) {
+ XEvent event;
+ /*
+ * Send an event that the selection changed.
+ * This is equivalent to
+ * "event generate $textWidget <<Selection>>"
+ */
+
+ memset((VOID *) &event, 0, sizeof(event));
+ event.xany.type = VirtualEvent;
+ event.xany.serial = NextRequest(Tk_Display(textPtr->tkwin));
+ event.xany.send_event = False;
+ event.xany.window = Tk_WindowId(textPtr->tkwin);
+ event.xany.display = Tk_Display(textPtr->tkwin);
+ ((XVirtualEvent *) &event)->name = Tk_GetUid("Selection");
+ Tk_HandleEvent(&event);
+ }
+
Tcl_DeleteHashEntry(hPtr);
if (textPtr->bindingTable != NULL) {
Tk_DeleteAllBindings(textPtr->bindingTable,
@@ -769,7 +804,7 @@ TkTextTagCmd(textPtr, interp, argc, argv)
TkTextTag *
TkTextCreateTag(textPtr, tagName)
TkText *textPtr; /* Widget in which tag is being used. */
- char *tagName; /* Name of desired tag. */
+ CONST char *tagName; /* Name of desired tag. */
{
register TkTextTag *tagPtr;
Tcl_HashEntry *hPtr;
@@ -855,7 +890,7 @@ FindTag(interp, textPtr, tagName)
* if NULL, then don't record an error
* message. */
TkText *textPtr; /* Widget in which tag is being used. */
- char *tagName; /* Name of desired tag. */
+ CONST char *tagName; /* Name of desired tag. */
{
Tcl_HashEntry *hPtr;
@@ -1386,4 +1421,3 @@ TkTextPickCurrent(textPtr, eventPtr)
ckfree((char *) copyArrayPtr);
}
}
-
diff --git a/tk/generic/tkTextWind.c b/tk/generic/tkTextWind.c
index 9624403cf2c..d3fb22c9fa3 100644
--- a/tk/generic/tkTextWind.c
+++ b/tk/generic/tkTextWind.c
@@ -55,8 +55,8 @@ static Tk_GeomMgr textGeomType = {
*/
static int AlignParseProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, Tk_Window tkwin, char *value,
- char *widgRec, int offset));
+ Tcl_Interp *interp, Tk_Window tkwin,
+ CONST char *value, char *widgRec, int offset));
static char * AlignPrintProc _ANSI_ARGS_((ClientData clientData,
Tk_Window tkwin, char *widgRec, int offset,
Tcl_FreeProc **freeProcPtr));
@@ -69,7 +69,7 @@ static void EmbWinBboxProc _ANSI_ARGS_((TkTextDispChunk *chunkPtr,
int *xPtr, int *yPtr, int *widthPtr,
int *heightPtr));
static int EmbWinConfigure _ANSI_ARGS_((TkText *textPtr,
- TkTextSegment *ewPtr, int argc, char **argv));
+ TkTextSegment *ewPtr, int argc, CONST char **argv));
static void EmbWinDelayedUnmap _ANSI_ARGS_((
ClientData clientData));
static int EmbWinDeleteProc _ANSI_ARGS_((TkTextSegment *segPtr,
@@ -155,7 +155,7 @@ TkTextWindowCmd(textPtr, interp, argc, argv)
register TkText *textPtr; /* Information about text widget. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. Someone else has already
+ CONST char **argv; /* Argument strings. Someone else has already
* parsed this command enough to know that
* argv[1] is "window". */
{
@@ -327,7 +327,7 @@ EmbWinConfigure(textPtr, ewPtr, argc, argv)
* contains embedded window. */
TkTextSegment *ewPtr; /* Embedded window to be configured. */
int argc; /* Number of strings in argv. */
- char **argv; /* Array of strings describing configuration
+ CONST char **argv; /* Array of strings describing configuration
* options. */
{
Tk_Window oldWindow;
@@ -370,7 +370,7 @@ EmbWinConfigure(textPtr, ewPtr, argc, argv)
if (ancestor == parent) {
break;
}
- if (Tk_IsTopLevel(ancestor)) {
+ if (Tk_TopWinHierarchy(ancestor)) {
badMaster:
Tcl_AppendResult(textPtr->interp, "can't embed ",
Tk_PathName(ewPtr->body.ew.tkwin), " in ",
@@ -379,7 +379,7 @@ EmbWinConfigure(textPtr, ewPtr, argc, argv)
return TCL_ERROR;
}
}
- if (Tk_IsTopLevel(ewPtr->body.ew.tkwin)
+ if (Tk_TopWinHierarchy(ewPtr->body.ew.tkwin)
|| (ewPtr->body.ew.tkwin == textPtr->tkwin)) {
goto badMaster;
}
@@ -435,7 +435,7 @@ AlignParseProc(clientData, interp, tkwin, value, widgRec, offset)
ClientData clientData; /* Not used.*/
Tcl_Interp *interp; /* Used for reporting errors. */
Tk_Window tkwin; /* Window for text widget. */
- char *value; /* Value of option. */
+ CONST char *value; /* Value of option. */
char *widgRec; /* Pointer to TkTextEmbWindow
* structure. */
int offset; /* Offset into item (ignored). */
@@ -790,7 +790,7 @@ EmbWinLayoutProc(textPtr, indexPtr, ewPtr, offset, maxX, maxChars,
if (ancestor == Tk_Parent(ewPtr->body.ew.tkwin)) {
break;
}
- if (Tk_IsTopLevel(ancestor)) {
+ if (Tk_TopWinHierarchy(ancestor)) {
badMaster:
Tcl_AppendResult(textPtr->interp, "can't embed ",
Tk_PathName(ewPtr->body.ew.tkwin), " relative to ",
@@ -800,7 +800,7 @@ EmbWinLayoutProc(textPtr, indexPtr, ewPtr, offset, maxX, maxChars,
goto gotWindow;
}
}
- if (Tk_IsTopLevel(ewPtr->body.ew.tkwin)
+ if (Tk_TopWinHierarchy(ewPtr->body.ew.tkwin)
|| (textPtr->tkwin == ewPtr->body.ew.tkwin)) {
goto badMaster;
}
@@ -1158,7 +1158,7 @@ EmbWinDelayedUnmap(clientData)
int
TkTextWindowIndex(textPtr, name, indexPtr)
TkText *textPtr; /* Text widget containing window. */
- char *name; /* Name of window. */
+ CONST char *name; /* Name of window. */
TkTextIndex *indexPtr; /* Index information gets stored here. */
{
Tcl_HashEntry *hPtr;
@@ -1174,4 +1174,3 @@ TkTextWindowIndex(textPtr, name, indexPtr)
indexPtr->byteIndex = TkTextSegToOffset(ewPtr, indexPtr->linePtr);
return 1;
}
-
diff --git a/tk/generic/tkTrig.c b/tk/generic/tkTrig.c
index b9f0628242a..549982130b0 100644
--- a/tk/generic/tkTrig.c
+++ b/tk/generic/tkTrig.c
@@ -1473,4 +1473,3 @@ TkGetButtPoints(p1, p2, width, project, m1, m2)
}
}
}
-
diff --git a/tk/generic/tkUndo.c b/tk/generic/tkUndo.c
new file mode 100644
index 00000000000..e2271ee3775
--- /dev/null
+++ b/tk/generic/tkUndo.c
@@ -0,0 +1,400 @@
+/*
+ * tkUndo.c --
+ *
+ * This module provides the implementation of an undo stack.
+ *
+ * Copyright (c) 2002 by Ludwig Callewaert.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkUndo.h"
+
+
+/*
+ * TkUndoPushStack
+ * Push elem on the stack identified by stack.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+void TkUndoPushStack ( stack, elem )
+ TkUndoAtom ** stack;
+ TkUndoAtom * elem;
+{
+ elem->next = *stack;
+ *stack = elem;
+}
+
+/*
+ * TkUndoPopStack --
+ * Remove and return the top element from the stack identified by
+ * stack.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+TkUndoAtom * TkUndoPopStack ( stack )
+ TkUndoAtom ** stack ;
+{
+ TkUndoAtom * elem = NULL;
+ if (*stack != NULL ) {
+ elem = *stack;
+ *stack = elem->next;
+ }
+ return elem;
+}
+
+/*
+ * TkUndoInsertSeparator --
+ * insert a separator on the stack, indicating a border for
+ * an undo/redo chunk.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+int TkUndoInsertSeparator ( stack )
+ TkUndoAtom ** stack;
+{
+ TkUndoAtom * separator;
+
+ if ( *stack != NULL && (*stack)->type != TK_UNDO_SEPARATOR ) {
+ separator = (TkUndoAtom *) ckalloc(sizeof(TkUndoAtom));
+ separator->type = TK_UNDO_SEPARATOR;
+ TkUndoPushStack(stack,separator);
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+/*
+ * TkUndoClearStack --
+ * Clear an entire undo or redo stack and destroy all elements in it.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+void TkUndoClearStack ( stack )
+ TkUndoAtom ** stack; /* An Undo or Redo stack */
+{
+ TkUndoAtom * elem;
+
+ while ( (elem = TkUndoPopStack(stack)) ) {
+ if ( elem->type != TK_UNDO_SEPARATOR ) {
+ Tcl_DecrRefCount(elem->apply);
+ Tcl_DecrRefCount(elem->revert);
+ }
+ ckfree((char *)elem);
+ }
+ *stack = NULL;
+}
+
+/*
+ * TkUndoPushAction
+ * Push a new elem on the stack identified by stack.
+ * action and revert are given through Tcl_DStrings
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+void TkUndoPushAction ( stack, actionScript, revertScript )
+ TkUndoRedoStack * stack; /* An Undo or Redo stack */
+ Tcl_DString * actionScript; /* The script to get the action (redo) */
+ Tcl_DString * revertScript; /* The script to revert the action (undo) */
+{
+ TkUndoAtom * atom;
+
+ atom = (TkUndoAtom *) ckalloc(sizeof(TkUndoAtom));
+ atom->type = TK_UNDO_ACTION;
+
+ atom->apply = Tcl_NewStringObj(Tcl_DStringValue(actionScript),Tcl_DStringLength(actionScript));
+ Tcl_IncrRefCount(atom->apply);
+
+ atom->revert = Tcl_NewStringObj(Tcl_DStringValue(revertScript),Tcl_DStringLength(revertScript));
+ Tcl_IncrRefCount(atom->revert);
+
+ TkUndoPushStack(&(stack->undoStack), atom);
+ TkUndoClearStack(&(stack->redoStack));
+}
+
+
+/*
+ * TkUndoInitStack
+ * Initialize a new undo/redo stack
+ *
+ * Results:
+ * un Undo/Redo stack pointer
+ *
+ * Side effects:
+ * None.
+ */
+
+TkUndoRedoStack * TkUndoInitStack ( interp, maxdepth )
+ Tcl_Interp * interp; /* The interpreter */
+ int maxdepth; /* The maximum stack depth */
+{
+ TkUndoRedoStack * stack; /* An Undo/Redo stack */
+ stack = (TkUndoRedoStack *) ckalloc(sizeof(TkUndoRedoStack));
+ stack->undoStack = NULL;
+ stack->redoStack = NULL;
+ stack->interp = interp;
+ stack->maxdepth = maxdepth;
+ stack->depth = 0;
+ return stack;
+}
+
+
+/*
+ * TkUndoInitStack
+ * Initialize a new undo/redo stack
+ *
+ * Results:
+ * un Undo/Redo stack pointer
+ *
+ * Side effects:
+ * None.
+ */
+
+void TkUndoSetDepth ( stack, maxdepth )
+ TkUndoRedoStack * stack; /* An Undo/Redo stack */
+ int maxdepth; /* The maximum stack depth */
+{
+ TkUndoAtom * elem;
+ TkUndoAtom * prevelem;
+ int sepNumber = 0;
+
+ stack->maxdepth = maxdepth;
+
+ if ((stack->maxdepth > 0) && (stack->depth > stack->maxdepth)) {
+ /* Maximum stack depth exceeded. We have to remove the last compound
+ elements on the stack */
+ elem = stack->undoStack;
+ prevelem = NULL;
+ while ( sepNumber <= stack->maxdepth ) {
+ if (elem != NULL && (elem->type == TK_UNDO_SEPARATOR) ) {
+ sepNumber++;
+ }
+ prevelem = elem;
+ elem = elem->next;
+ }
+ prevelem->next = NULL;
+ while ( elem ) {
+ prevelem = elem;
+ elem = elem->next;
+ ckfree((char *) elem);
+ }
+ stack->depth = stack->maxdepth;
+ }
+}
+
+
+/*
+ * TkUndoClearStacks
+ * Clear both the undo and redo stack
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+void TkUndoClearStacks ( stack )
+ TkUndoRedoStack * stack; /* An Undo/Redo stack */
+{
+ TkUndoClearStack(&(stack->undoStack));
+ TkUndoClearStack(&(stack->redoStack));
+ stack->depth = 0;
+}
+
+
+/*
+ * TkUndoFreeStack
+ * Clear both the undo and redo stack
+ * also free the memory allocated to the u/r stack pointer
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+void TkUndoFreeStack ( stack )
+ TkUndoRedoStack * stack; /* An Undo/Redo stack */
+{
+ TkUndoClearStacks(stack);
+/* ckfree((TkUndoRedoStack *) stack); */
+ ckfree((char *) stack);
+}
+
+
+/*
+ * TkUndoInsertUndoSeparator --
+ * insert a separator on the undo stack, indicating a border for
+ * an undo/redo chunk.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None.
+ */
+
+void TkUndoInsertUndoSeparator ( stack )
+ TkUndoRedoStack * stack;
+{
+/* TkUndoAtom * elem;
+ TkUndoAtom * prevelem;
+ int sepNumber = 0;
+*/
+
+ if ( TkUndoInsertSeparator(&(stack->undoStack)) ) {
+ ++(stack->depth);
+ TkUndoSetDepth(stack,stack->maxdepth);
+/* if ((stack->maxdepth > 0) && (stack->depth > stack->maxdepth)) {
+ elem = stack->undoStack;
+ prevelem = NULL;
+ while ( sepNumber < stack->depth ) {
+ if (elem != NULL && (elem->type == TK_UNDO_SEPARATOR) ) {
+ sepNumber++;
+ }
+ prevelem = elem;
+ elem = elem->next;
+ }
+ prevelem->next = NULL;
+ while ( elem ) {
+ prevelem = elem;
+ elem = elem->next;
+ ckfree((char *) elem);
+ }
+ stack->depth;
+ } */
+ }
+}
+
+
+/*
+ * TkUndoRevert --
+ * Undo a compound action on the stack.
+ *
+ * Results:
+ * A TCL status code
+ *
+ * Side effects:
+ * None.
+ */
+
+int TkUndoRevert ( stack )
+ TkUndoRedoStack * stack;
+{
+ TkUndoAtom * elem;
+
+ /* insert a separator on the undo and the redo stack */
+
+ TkUndoInsertUndoSeparator(stack);
+ TkUndoInsertSeparator(&(stack->redoStack));
+
+ /* Pop and skip the first separator if there is one*/
+
+ elem = TkUndoPopStack(&(stack->undoStack));
+
+ if ( elem == NULL ) {
+ return TCL_ERROR;
+ }
+
+ if ( ( elem != NULL ) && ( elem->type == TK_UNDO_SEPARATOR ) ) {
+ ckfree((char *) elem);
+ elem = TkUndoPopStack(&(stack->undoStack));
+ }
+
+ while ( elem && (elem->type != TK_UNDO_SEPARATOR) ) {
+ Tcl_EvalObjEx(stack->interp,elem->revert,TCL_EVAL_GLOBAL);
+
+ TkUndoPushStack(&(stack->redoStack),elem);
+ elem = TkUndoPopStack(&(stack->undoStack));
+ }
+
+ /* insert a separator on the redo stack */
+
+ TkUndoInsertSeparator(&(stack->redoStack));
+
+ --(stack->depth);
+
+ return TCL_OK;
+}
+
+
+/*
+ * TkUndoApply --
+ * Redo a compound action on the stack.
+ *
+ * Results:
+ * A TCL status code
+ *
+ * Side effects:
+ * None.
+ */
+
+int TkUndoApply ( stack )
+ TkUndoRedoStack * stack;
+{
+ TkUndoAtom *elem;
+
+ /* insert a separator on the undo stack */
+
+ TkUndoInsertSeparator(&(stack->undoStack));
+
+ /* Pop and skip the first separator if there is one*/
+
+ elem = TkUndoPopStack(&(stack->redoStack));
+
+ if ( elem == NULL ) {
+ return TCL_ERROR;
+ }
+
+ if ( ( elem != NULL ) && ( elem->type == TK_UNDO_SEPARATOR ) ) {
+ ckfree((char *) elem);
+ elem = TkUndoPopStack(&(stack->redoStack));
+ }
+
+ while ( elem && (elem->type != TK_UNDO_SEPARATOR) ) {
+ Tcl_EvalObjEx(stack->interp,elem->apply,TCL_EVAL_GLOBAL);
+
+ TkUndoPushStack(&(stack->undoStack), elem);
+ elem = TkUndoPopStack(&(stack->redoStack));
+ }
+
+ /* insert a separator on the undo stack */
+
+ TkUndoInsertSeparator(&(stack->undoStack));
+
+ ++(stack->depth);
+
+ return TCL_OK;
+}
+
diff --git a/tk/generic/tkUndo.h b/tk/generic/tkUndo.h
new file mode 100644
index 00000000000..2775cce86f8
--- /dev/null
+++ b/tk/generic/tkUndo.h
@@ -0,0 +1,90 @@
+/*
+ * tkUndo.h --
+ *
+ * Declarations shared among the files that implement an undo
+ * stack.
+ *
+ * Copyright (c) 2002 Ludwig Callewaert.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#ifndef _TKUNDO
+#define _TKUNDO
+
+#ifndef _TK
+#include "tk.h"
+#endif
+
+#ifdef BUILD_tk
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLEXPORT
+#endif
+
+/* enum definining the types used in an undo stack */
+
+typedef enum {
+ TK_UNDO_SEPARATOR, /* Marker */
+ TK_UNDO_ACTION /* Command */
+} TkUndoAtomType;
+
+/* struct defining the basic undo/redo stack element */
+
+typedef struct TkUndoAtom {
+ TkUndoAtomType type; /* The type that will trigger the
+ * required action*/
+ Tcl_Obj * apply; /* Command to apply the action that was taken */
+ Tcl_Obj * revert; /* The command to undo the action */
+ struct TkUndoAtom * next; /* Pointer to the next element in the
+ * stack */
+} TkUndoAtom;
+
+/* struct defining the basic undo/redo stack element */
+
+typedef struct TkUndoRedoStack {
+ TkUndoAtom * undoStack; /* The undo stack */
+ TkUndoAtom * redoStack; /* The redo stack */
+ Tcl_Interp * interp ; /* The interpreter in which to execute the revert and apply scripts */
+ int maxdepth;
+ int depth;
+} TkUndoRedoStack;
+
+/* basic functions */
+
+EXTERN void TkUndoPushStack _ANSI_ARGS_((TkUndoAtom ** stack,
+ TkUndoAtom * elem));
+
+EXTERN TkUndoAtom * TkUndoPopStack _ANSI_ARGS_((TkUndoAtom ** stack));
+
+EXTERN int TkUndoInsertSeparator _ANSI_ARGS_((TkUndoAtom ** stack));
+
+EXTERN void TkUndoClearStack _ANSI_ARGS_((TkUndoAtom ** stack));
+
+/* functions working on an undo/redo stack */
+
+EXTERN TkUndoRedoStack * TkUndoInitStack _ANSI_ARGS_((Tcl_Interp * interp,
+ int maxdepth));
+
+EXTERN void TkUndoSetDepth _ANSI_ARGS_((TkUndoRedoStack * stack,
+ int maxdepth));
+
+EXTERN void TkUndoClearStacks _ANSI_ARGS_((TkUndoRedoStack * stack));
+
+EXTERN void TkUndoFreeStack _ANSI_ARGS_((TkUndoRedoStack * stack));
+
+EXTERN void TkUndoInsertUndoSeparator _ANSI_ARGS_((TkUndoRedoStack * stack));
+
+EXTERN void TkUndoPushAction _ANSI_ARGS_((TkUndoRedoStack * stack,
+ Tcl_DString * actionScript, Tcl_DString * revertScript));
+
+EXTERN int TkUndoRevert _ANSI_ARGS_((TkUndoRedoStack * stack));
+
+EXTERN int TkUndoApply _ANSI_ARGS_((TkUndoRedoStack * stack));
+
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLIMPORT
+
+#endif /* _TKUNDO */
diff --git a/tk/generic/tkUtil.c b/tk/generic/tkUtil.c
index cbb49e6d8bb..dcf0de29300 100644
--- a/tk/generic/tkUtil.c
+++ b/tk/generic/tkUtil.c
@@ -22,7 +22,7 @@
* Tcl object, used for quickly finding a mapping in a TkStateMap.
*/
-static Tcl_ObjType stateKeyType = {
+Tcl_ObjType tkStateKeyObjType = {
"statekey", /* name */
(Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */
(Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */
@@ -630,7 +630,7 @@ int
Tk_GetScrollInfo(interp, argc, argv, dblPtr, intPtr)
Tcl_Interp *interp; /* Used for error reporting. */
int argc; /* # arguments for command. */
- char **argv; /* Arguments for command. */
+ CONST char **argv; /* Arguments for command. */
double *dblPtr; /* Filled in with argument "moveto"
* option, if any. */
int *intPtr; /* Filled in with number of pages
@@ -794,7 +794,7 @@ TkComputeAnchor(anchor, tkwin, padX, padY, innerWidth, innerHeight, xPtr, yPtr)
case TK_ANCHOR_NW:
case TK_ANCHOR_W:
case TK_ANCHOR_SW:
- *xPtr = Tk_InternalBorderWidth(tkwin) + padX;
+ *xPtr = Tk_InternalBorderLeft(tkwin) + padX;
break;
case TK_ANCHOR_N:
@@ -804,7 +804,7 @@ TkComputeAnchor(anchor, tkwin, padX, padY, innerWidth, innerHeight, xPtr, yPtr)
break;
default:
- *xPtr = Tk_Width(tkwin) - (Tk_InternalBorderWidth(tkwin) + padX)
+ *xPtr = Tk_Width(tkwin) - (Tk_InternalBorderRight(tkwin) + padX)
- innerWidth;
break;
}
@@ -813,7 +813,7 @@ TkComputeAnchor(anchor, tkwin, padX, padY, innerWidth, innerHeight, xPtr, yPtr)
case TK_ANCHOR_NW:
case TK_ANCHOR_N:
case TK_ANCHOR_NE:
- *yPtr = Tk_InternalBorderWidth(tkwin) + padY;
+ *yPtr = Tk_InternalBorderTop(tkwin) + padY;
break;
case TK_ANCHOR_W:
@@ -823,7 +823,7 @@ TkComputeAnchor(anchor, tkwin, padX, padY, innerWidth, innerHeight, xPtr, yPtr)
break;
default:
- *yPtr = Tk_Height(tkwin) - Tk_InternalBorderWidth(tkwin) - padY
+ *yPtr = Tk_Height(tkwin) - Tk_InternalBorderBottom(tkwin) - padY
- innerHeight;
break;
}
@@ -920,7 +920,7 @@ TkFindStateNumObj(interp, optionPtr, mapPtr, keyPtr)
CONST char *key;
CONST Tcl_ObjType *typePtr;
- if ((keyPtr->typePtr == &stateKeyType)
+ if ((keyPtr->typePtr == &tkStateKeyObjType)
&& (keyPtr->internalRep.twoPtrValue.ptr1 == (VOID *) mapPtr)) {
return (int) keyPtr->internalRep.twoPtrValue.ptr2;
}
@@ -934,7 +934,7 @@ TkFindStateNumObj(interp, optionPtr, mapPtr, keyPtr)
}
keyPtr->internalRep.twoPtrValue.ptr1 = (VOID *) mapPtr;
keyPtr->internalRep.twoPtrValue.ptr2 = (VOID *) mPtr->numKey;
- keyPtr->typePtr = &stateKeyType;
+ keyPtr->typePtr = &tkStateKeyObjType;
return mPtr->numKey;
}
}
@@ -951,5 +951,3 @@ TkFindStateNumObj(interp, optionPtr, mapPtr, keyPtr)
}
return mPtr->numKey;
}
-
-
diff --git a/tk/generic/tkVisual.c b/tk/generic/tkVisual.c
index a2d717a119d..e60e5a23240 100644
--- a/tk/generic/tkVisual.c
+++ b/tk/generic/tkVisual.c
@@ -92,7 +92,7 @@ Tk_GetVisual(interp, tkwin, string, depthPtr, colormapPtr)
* reporting. */
Tk_Window tkwin; /* Window in which visual will be
* used. */
- char *string; /* String describing visual. See
+ CONST char *string; /* String describing visual. See
* manual entry for details. */
int *depthPtr; /* The depth of the returned visual
* is stored here. */
@@ -106,7 +106,7 @@ Tk_GetVisual(interp, tkwin, string, depthPtr, colormapPtr)
long mask;
Visual *visual;
int length, c, numVisuals, prio, bestPrio, i;
- char *p;
+ CONST char *p;
VisualDictionary *dictPtr;
TkColormap *cmapPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
@@ -369,7 +369,7 @@ Tk_GetColormap(interp, tkwin, string)
* reporting. */
Tk_Window tkwin; /* Window where colormap will be
* used. */
- char *string; /* String that identifies colormap:
+ CONST char *string; /* String that identifies colormap:
* either "new" or the name of
* another window. */
{
@@ -539,4 +539,3 @@ Tk_PreserveColormap(display, colormap)
}
}
}
-
diff --git a/tk/generic/tkWindow.c b/tk/generic/tkWindow.c
index 5f3a8a0c517..47e2a472e71 100644
--- a/tk/generic/tkWindow.c
+++ b/tk/generic/tkWindow.c
@@ -18,7 +18,7 @@
#include "tkPort.h"
#include "tkInt.h"
-#if !defined(__WIN32__) && !defined(MAC_TCL)
+#if !( defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
#include "tkUnixInt.h"
#endif
@@ -98,25 +98,25 @@ static TkCmd commands[] = {
*/
{"bell", NULL, Tk_BellObjCmd, 0, 1},
- {"bind", Tk_BindCmd, NULL, 1, 1},
- {"bindtags", Tk_BindtagsCmd, NULL, 1, 1},
- {"clipboard", Tk_ClipboardCmd, NULL, 0, 1},
+ {"bind", NULL, Tk_BindObjCmd, 1, 1},
+ {"bindtags", NULL, Tk_BindtagsObjCmd, 1, 1},
+ {"clipboard", NULL, Tk_ClipboardObjCmd, 0, 1},
{"destroy", NULL, Tk_DestroyObjCmd, 1, 1},
{"event", NULL, Tk_EventObjCmd, 1, 1},
{"focus", NULL, Tk_FocusObjCmd, 1, 1},
{"font", NULL, Tk_FontObjCmd, 1, 1},
- {"grab", Tk_GrabCmd, NULL, 0, 1},
- {"grid", Tk_GridCmd, NULL, 1, 1},
+ {"grab", NULL, Tk_GrabObjCmd, 0, 1},
+ {"grid", NULL, Tk_GridObjCmd, 1, 1},
{"image", NULL, Tk_ImageObjCmd, 1, 1},
{"lower", NULL, Tk_LowerObjCmd, 1, 1},
{"option", NULL, Tk_OptionObjCmd, 1, 1},
- {"pack", Tk_PackCmd, NULL, 1, 1},
- {"place", Tk_PlaceCmd, NULL, 1, 1},
+ {"pack", NULL, Tk_PackObjCmd, 1, 1},
+ {"place", NULL, Tk_PlaceObjCmd, 1, 0},
{"raise", NULL, Tk_RaiseObjCmd, 1, 1},
- {"selection", Tk_SelectionCmd, NULL, 0, 1},
- {"tk", NULL, Tk_TkObjCmd, 0, 1},
- {"tkwait", Tk_TkwaitCmd, NULL, 1, 1},
-#if defined(__WIN32__) || defined(MAC_TCL)
+ {"selection", NULL, Tk_SelectionObjCmd, 0, 1},
+ {"tk", NULL, Tk_TkObjCmd, 1, 1},
+ {"tkwait", NULL, Tk_TkwaitObjCmd, 1, 1},
+#if defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK)
{"tk_chooseColor", NULL, Tk_ChooseColorObjCmd, 0, 1},
{"tk_chooseDirectory", NULL, Tk_ChooseDirectoryObjCmd, 0, 1},
{"tk_getOpenFile", NULL, Tk_GetOpenFileObjCmd, 0, 1},
@@ -127,7 +127,7 @@ static TkCmd commands[] = {
#endif
{"update", NULL, Tk_UpdateObjCmd, 1, 1},
{"winfo", NULL, Tk_WinfoObjCmd, 1, 1},
- {"wm", Tk_WmCmd, NULL, 0, 1},
+ {"wm", NULL, Tk_WmObjCmd, 0, 1},
/*
* Widget class commands.
@@ -137,25 +137,29 @@ static TkCmd commands[] = {
{"canvas", NULL, Tk_CanvasObjCmd, 1, 1},
{"checkbutton", NULL, Tk_CheckbuttonObjCmd, 1, 0},
{"entry", NULL, Tk_EntryObjCmd, 1, 0},
- {"frame", NULL, Tk_FrameObjCmd, 1, 1},
+ {"frame", NULL, Tk_FrameObjCmd, 1, 0},
{"label", NULL, Tk_LabelObjCmd, 1, 0},
+ {"labelframe", NULL, Tk_LabelframeObjCmd, 1, 0},
{"listbox", NULL, Tk_ListboxObjCmd, 1, 0},
{"menubutton", NULL, Tk_MenubuttonObjCmd, 1, 0},
- {"message", Tk_MessageCmd, NULL, 1, 1},
+ {"message", NULL, Tk_MessageObjCmd, 1, 0},
+ {"panedwindow", NULL, Tk_PanedWindowObjCmd, 1, 0},
{"radiobutton", NULL, Tk_RadiobuttonObjCmd, 1, 0},
{"scale", NULL, Tk_ScaleObjCmd, 1, 0},
{"scrollbar", Tk_ScrollbarCmd, NULL, 1, 1},
+ {"spinbox", NULL, Tk_SpinboxObjCmd, 1, 0},
{"text", Tk_TextCmd, NULL, 1, 1},
- {"toplevel", NULL, Tk_ToplevelObjCmd, 0, 1},
+ {"toplevel", NULL, Tk_ToplevelObjCmd, 0, 0},
/*
* Misc.
*/
-#ifdef MAC_TCL
- {"unsupported1", TkUnsupported1Cmd, NULL, 1, 1},
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
+ {"::tk::unsupported::MacWindowStyle",
+ TkUnsupported1Cmd, NULL, 1, 1},
#endif
- {(char *) NULL, (int (*) _ANSI_ARGS_((ClientData, Tcl_Interp *, int, char **))) NULL, NULL, 0}
+ {(char *) NULL, (int (*) _ANSI_ARGS_((ClientData, Tcl_Interp *, int, CONST char **))) NULL, NULL, 0}
};
/*
@@ -198,21 +202,81 @@ static Tk_ArgvInfo argTable[] = {
*/
static Tk_Window CreateTopLevelWindow _ANSI_ARGS_((Tcl_Interp *interp,
- Tk_Window parent, char *name, char *screenName));
+ Tk_Window parent, CONST char *name,
+ CONST char *screenName, unsigned int flags));
static void DeleteWindowsExitProc _ANSI_ARGS_((
ClientData clientData));
static TkDisplay * GetScreen _ANSI_ARGS_((Tcl_Interp *interp,
- char *screenName, int *screenPtr));
+ CONST char *screenName, int *screenPtr));
static int Initialize _ANSI_ARGS_((Tcl_Interp *interp));
static int NameWindow _ANSI_ARGS_((Tcl_Interp *interp,
TkWindow *winPtr, TkWindow *parentPtr,
- char *name));
-static void OpenIM _ANSI_ARGS_((TkDisplay *dispPtr));
+ CONST char *name));
static void UnlinkWindow _ANSI_ARGS_((TkWindow *winPtr));
/*
*----------------------------------------------------------------------
*
+ * TkCloseDisplay --
+ * Closing the display can lead to order of deletion problems.
+ * We defer it until exit handling for Mac/Win, but since Unix can
+ * use many displays, try and clean it up as best as possible.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Resources associated with the display will be free.
+ * The display may not be referenced at all after this.
+ *----------------------------------------------------------------------
+ */
+
+static void
+TkCloseDisplay(TkDisplay *dispPtr)
+{
+ TkClipCleanup(dispPtr);
+
+ if (dispPtr->name != NULL) {
+ ckfree(dispPtr->name);
+ }
+
+ if (dispPtr->atomInit) {
+ Tcl_DeleteHashTable(&dispPtr->nameTable);
+ Tcl_DeleteHashTable(&dispPtr->atomTable);
+ dispPtr->atomInit = 0;
+ }
+
+ if (dispPtr->errorPtr != NULL) {
+ TkErrorHandler *errorPtr;
+ for (errorPtr = dispPtr->errorPtr;
+ errorPtr != NULL;
+ errorPtr = dispPtr->errorPtr) {
+ dispPtr->errorPtr = errorPtr->nextPtr;
+ ckfree((char *) errorPtr);
+ }
+ }
+
+ TkGCCleanup(dispPtr);
+
+ TkpCloseDisplay(dispPtr);
+
+ /*
+ * Delete winTable after TkpCloseDisplay since special windows
+ * may need call Tk_DestroyWindow and it checks the winTable.
+ */
+
+ Tcl_DeleteHashTable(&dispPtr->winTable);
+
+ ckfree((char *) dispPtr);
+
+ /*
+ * There is more to clean up, we leave it at this for the time being.
+ */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* CreateTopLevelWindow --
*
* Make a new window that will be at top-level (its parent will
@@ -233,19 +297,20 @@ static void UnlinkWindow _ANSI_ARGS_((TkWindow *winPtr));
*/
static Tk_Window
-CreateTopLevelWindow(interp, parent, name, screenName)
+CreateTopLevelWindow(interp, parent, name, screenName, flags)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
Tk_Window parent; /* Token for logical parent of new window
* (used for naming, options, etc.). May
* be NULL. */
- char *name; /* Name for new window; if parent is
+ CONST char *name; /* Name for new window; if parent is
* non-NULL, must be unique among parent's
* children. */
- char *screenName; /* Name of screen on which to create
+ CONST char *screenName; /* Name of screen on which to create
* window. NULL means use DISPLAY environment
* variable to determine. Empty string means
* use parent's screen, or DISPLAY if no
* parent. */
+ unsigned int flags; /* Additional flags to set on the window. */
{
register TkWindow *winPtr;
register TkDisplay *dispPtr;
@@ -291,6 +356,11 @@ CreateTopLevelWindow(interp, parent, name, screenName)
winPtr = TkAllocWindow(dispPtr, screenId, (TkWindow *) parent);
/*
+ * Set the flags specified in the call.
+ */
+ winPtr->flags |= flags;
+
+ /*
* Force the window to use a border pixel instead of border pixmap.
* This is needed for the case where the window doesn't use the
* default visual. In this case, the default border is a pixmap
@@ -301,12 +371,12 @@ CreateTopLevelWindow(interp, parent, name, screenName)
winPtr->dirtyAtts |= CWBorderPixel;
/*
- * (Need to set the TK_TOP_LEVEL flag immediately here; otherwise
+ * (Need to set the TK_TOP_HIERARCHY flag immediately here; otherwise
* Tk_DestroyWindow will core dump if it is called before the flag
* has been set.)
*/
- winPtr->flags |= TK_TOP_LEVEL;
+ winPtr->flags |= TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED;
if (parent != NULL) {
if (NameWindow(interp, winPtr, (TkWindow *) parent, name) != TCL_OK) {
@@ -346,12 +416,12 @@ CreateTopLevelWindow(interp, parent, name, screenName)
static TkDisplay *
GetScreen(interp, screenName, screenPtr)
Tcl_Interp *interp; /* Place to leave error message. */
- char *screenName; /* Name for screen. NULL or empty means
+ CONST char *screenName; /* Name for screen. NULL or empty means
* use DISPLAY envariable. */
int *screenPtr; /* Where to store screen number. */
{
register TkDisplay *dispPtr;
- char *p;
+ CONST char *p;
int screenId;
size_t length;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
@@ -387,82 +457,39 @@ GetScreen(interp, screenName, screenPtr)
* then open a new connection.
*/
- for (dispPtr = TkGetDisplayList(); ; dispPtr = dispPtr->nextPtr) {
+ for (dispPtr = tsdPtr->displayList; ; dispPtr = dispPtr->nextPtr) {
if (dispPtr == NULL) {
+ /*
+ * The private function zeros out dispPtr when it is created,
+ * so we only need to initialize the non-zero items.
+ */
dispPtr = TkpOpenDisplay(screenName);
if (dispPtr == NULL) {
Tcl_AppendResult(interp, "couldn't connect to display \"",
screenName, "\"", (char *) NULL);
return (TkDisplay *) NULL;
}
- dispPtr->nextPtr = TkGetDisplayList();
- dispPtr->name = (char *) ckalloc((unsigned) (length+1));
+ dispPtr->nextPtr = tsdPtr->displayList; /* TkGetDisplayList(); */
+ tsdPtr->displayList = dispPtr;
+
dispPtr->lastEventTime = CurrentTime;
- dispPtr->borderInit = 0;
- dispPtr->atomInit = 0;
dispPtr->bindInfoStale = 1;
- dispPtr->modeModMask = 0;
- dispPtr->metaModMask = 0;
- dispPtr->altModMask = 0;
- dispPtr->numModKeyCodes = 0;
- dispPtr->modKeyCodes = NULL;
- dispPtr->bitmapInit = 0;
- dispPtr->bitmapAutoNumber = 0;
- dispPtr->numIdSearches = 0;
- dispPtr->numSlowSearches = 0;
- dispPtr->colorInit = 0;
- dispPtr->stressPtr = NULL;
- dispPtr->cursorInit = 0;
- dispPtr->cursorString[0] = '\0';
dispPtr->cursorFont = None;
- dispPtr->errorPtr = NULL;
- dispPtr->deleteCount = 0;
- dispPtr->delayedMotionPtr = NULL;
- dispPtr->focusDebug = 0;
- dispPtr->implicitWinPtr = NULL;
- dispPtr->focusPtr = NULL;
- dispPtr->gcInit = 0;
- dispPtr->geomInit = 0;
- dispPtr->uidInit = 0;
- dispPtr->grabWinPtr = NULL;
- dispPtr->eventualGrabWinPtr = NULL;
- dispPtr->buttonWinPtr = NULL;
- dispPtr->serverWinPtr = NULL;
- dispPtr->firstGrabEventPtr = NULL;
- dispPtr->lastGrabEventPtr = NULL;
- dispPtr->grabFlags = 0;
- dispPtr->mouseButtonState = 0;
- dispPtr->warpInProgress = 0;
dispPtr->warpWindow = None;
- dispPtr->warpX = 0;
- dispPtr->warpY = 0;
- dispPtr->gridInit = 0;
- dispPtr->imageId = 0;
- dispPtr->packInit = 0;
- dispPtr->placeInit = 0;
- dispPtr->selectionInfoPtr = NULL;
dispPtr->multipleAtom = None;
- dispPtr->clipWindow = NULL;
- dispPtr->clipboardActive = 0;
- dispPtr->clipboardAppPtr = NULL;
- dispPtr->clipTargetPtr = NULL;
- dispPtr->commTkwin = NULL;
- dispPtr->wmTracing = 0;
- dispPtr->firstWmPtr = NULL;
- dispPtr->foregroundWmPtr = NULL;
- dispPtr->destroyCount = 0;
- dispPtr->lastDestroyRequest = 0;
- dispPtr->cmapPtr = NULL;
+ /*
+ * By default we do want to collapse motion events in
+ * Tk_QueueWindowEvent.
+ */
+ dispPtr->flags |= TK_DISPLAY_COLLAPSE_MOTION_EVENTS;
+
Tcl_InitHashTable(&dispPtr->winTable, TCL_ONE_WORD_KEYS);
- dispPtr->refCount = 0;
+ dispPtr->name = (char *) ckalloc((unsigned) (length+1));
strncpy(dispPtr->name, screenName, length);
dispPtr->name[length] = '\0';
- dispPtr->useInputMethods = 0;
- OpenIM(dispPtr);
- TkInitXId(dispPtr);
- tsdPtr->displayList = dispPtr;
+ TkInitXId(dispPtr);
break;
}
if ((strncmp(dispPtr->name, screenName, length) == 0)
@@ -639,11 +666,16 @@ TkAllocWindow(dispPtr, screenNum, parentPtr)
winPtr->geomMgrPtr = NULL;
winPtr->geomData = NULL;
winPtr->reqWidth = winPtr->reqHeight = 1;
- winPtr->internalBorderWidth = 0;
+ winPtr->internalBorderLeft = 0;
winPtr->wmInfoPtr = NULL;
winPtr->classProcsPtr = NULL;
winPtr->instanceData = NULL;
winPtr->privatePtr = NULL;
+ winPtr->internalBorderRight = 0;
+ winPtr->internalBorderTop = 0;
+ winPtr->internalBorderBottom = 0;
+ winPtr->minReqWidth = 0;
+ winPtr->minReqHeight = 0;
return winPtr;
}
@@ -672,7 +704,7 @@ NameWindow(interp, winPtr, parentPtr, name)
register TkWindow *winPtr; /* Window that is to be named and inserted. */
TkWindow *parentPtr; /* Pointer to logical parent for winPtr
* (used for naming, options, etc.). */
- char *name; /* Name for winPtr; must be unique among
+ CONST char *name; /* Name for winPtr; must be unique among
* parentPtr's children. */
{
#define FIXED_SIZE 200
@@ -698,6 +730,19 @@ NameWindow(interp, winPtr, parentPtr, name)
parentPtr->lastChildPtr = winPtr;
winPtr->mainPtr = parentPtr->mainPtr;
winPtr->mainPtr->refCount++;
+
+ /*
+ * If this is an anonymous window (ie, it has no name), just return OK
+ * now.
+ */
+ if (winPtr->flags & TK_ANONYMOUS_WINDOW) {
+ return TCL_OK;
+ }
+
+ /*
+ * For non-anonymous windows, set up the window name.
+ */
+
winPtr->nameUid = Tk_GetUid(name);
/*
@@ -776,7 +821,7 @@ NameWindow(interp, winPtr, parentPtr, name)
Tk_Window
TkCreateMainWindow(interp, screenName, baseName)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- char *screenName; /* Name of screen on which to create
+ CONST char *screenName; /* Name of screen on which to create
* window. Empty or NULL string means
* use DISPLAY environment variable. */
char *baseName; /* Base name for application; usually of the
@@ -807,7 +852,7 @@ TkCreateMainWindow(interp, screenName, baseName)
*/
tkwin = CreateTopLevelWindow(interp, (Tk_Window) NULL, baseName,
- screenName);
+ screenName, /* flags */ 0);
if (tkwin == NULL) {
return NULL;
}
@@ -826,6 +871,7 @@ TkCreateMainWindow(interp, screenName, baseName)
TkEventInit();
TkBindInit(mainPtr);
TkFontPkgInit(mainPtr);
+ TkStylePkgInit(mainPtr);
mainPtr->tlFocusPtr = NULL;
mainPtr->displayFocusPtr = NULL;
mainPtr->optionRootPtr = NULL;
@@ -925,9 +971,9 @@ Tk_CreateWindow(interp, parent, name, screenName)
* the interp's result is assumed to be
* initialized by the caller. */
Tk_Window parent; /* Token for parent of new window. */
- char *name; /* Name for new window. Must be unique
+ CONST char *name; /* Name for new window. Must be unique
* among parent's children. */
- char *screenName; /* If NULL, new window will be internal on
+ CONST char *screenName; /* If NULL, new window will be internal on
* same screen as its parent. If non-NULL,
* gives name of screen on which to create
* new window; window will be a top-level
@@ -958,7 +1004,79 @@ Tk_CreateWindow(interp, parent, name, screenName)
return (Tk_Window) winPtr;
}
} else {
- return CreateTopLevelWindow(interp, parent, name, screenName);
+ return CreateTopLevelWindow(interp, parent, name, screenName,
+ /* flags */ 0);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * Tk_CreateAnonymousWindow --
+ *
+ * Create a new internal or top-level window as a child of an
+ * existing window; this window will be anonymous (unnamed), so
+ * it will not be visible at the Tcl level.
+ *
+ * Results:
+ * The return value is a token for the new window. This
+ * is not the same as X's token for the window. If an error
+ * occurred in creating the window (e.g. no such display or
+ * screen), then an error message is left in the interp's result and
+ * NULL is returned.
+ *
+ * Side effects:
+ * A new window structure is allocated locally. An X
+ * window is not initially created, but will be created
+ * the first time the window is mapped.
+ *
+ *--------------------------------------------------------------
+ */
+
+Tk_Window
+Tk_CreateAnonymousWindow(interp, parent, screenName)
+ Tcl_Interp *interp; /* Interpreter to use for error reporting.
+ * the interp's result is assumed to be
+ * initialized by the caller. */
+ Tk_Window parent; /* Token for parent of new window. */
+ CONST char *screenName; /* If NULL, new window will be internal on
+ * same screen as its parent. If non-NULL,
+ * gives name of screen on which to create
+ * new window; window will be a top-level
+ * window. */
+{
+ TkWindow *parentPtr = (TkWindow *) parent;
+ TkWindow *winPtr;
+
+ if ((parentPtr != NULL) && (parentPtr->flags & TK_ALREADY_DEAD)) {
+ Tcl_AppendResult(interp,
+ "can't create window: parent has been destroyed",
+ (char *) NULL);
+ return NULL;
+ } else if ((parentPtr != NULL) &&
+ (parentPtr->flags & TK_CONTAINER)) {
+ Tcl_AppendResult(interp,
+ "can't create window: its parent has -container = yes",
+ (char *) NULL);
+ return NULL;
+ }
+ if (screenName == NULL) {
+ winPtr = TkAllocWindow(parentPtr->dispPtr, parentPtr->screenNum,
+ parentPtr);
+ /*
+ * Add the anonymous window flag now, so that NameWindow will behave
+ * correctly.
+ */
+
+ winPtr->flags |= TK_ANONYMOUS_WINDOW;
+ if (NameWindow(interp, winPtr, parentPtr, (char *)NULL) != TCL_OK) {
+ Tk_DestroyWindow((Tk_Window) winPtr);
+ return NULL;
+ }
+ return (Tk_Window) winPtr;
+ } else {
+ return CreateTopLevelWindow(interp, parent, (char *)NULL, screenName,
+ TK_ANONYMOUS_WINDOW);
}
}
@@ -993,11 +1111,11 @@ Tk_CreateWindowFromPath(interp, tkwin, pathName, screenName)
* initialized by the caller. */
Tk_Window tkwin; /* Token for any window in application
* that is to contain new window. */
- char *pathName; /* Path name for new window within the
+ CONST char *pathName; /* Path name for new window within the
* application of tkwin. The parent of
* this window must already exist, but
* the window itself must not exist. */
- char *screenName; /* If NULL, new window will be on same
+ CONST char *screenName; /* If NULL, new window will be on same
* screen as its parent. If non-NULL,
* gives name of screen on which to create
* new window; window will be a top-level
@@ -1024,7 +1142,7 @@ Tk_CreateWindowFromPath(interp, tkwin, pathName, screenName)
"\"", (char *) NULL);
return NULL;
}
- numChars = p-pathName;
+ numChars = (int) (p-pathName);
if (numChars > FIXED_SPACE) {
p = (char *) ckalloc((unsigned) (numChars+1));
} else {
@@ -1079,7 +1197,7 @@ Tk_CreateWindowFromPath(interp, tkwin, pathName, screenName)
}
} else {
return CreateTopLevelWindow(interp, parent, pathName+numChars+1,
- screenName);
+ screenName, /* flags */ 0);
}
}
@@ -1151,7 +1269,7 @@ Tk_DestroyWindow(tkwin)
* can be closed and its data structures deleted.
*/
- if (winPtr->mainPtr->winPtr == winPtr) {
+ if (winPtr->mainPtr != NULL && winPtr->mainPtr->winPtr == winPtr) {
dispPtr->refCount--;
if (tsdPtr->mainWindowList == winPtr->mainPtr) {
tsdPtr->mainWindowList = winPtr->mainPtr->nextPtr;
@@ -1218,12 +1336,13 @@ Tk_DestroyWindow(tkwin)
* expensive, but without it no event handlers will get called for
* windows that don't exist yet.
*
- * Note: if the window's pathName is NULL it means that the window
- * was not successfully initialized in the first place, so we should
- * not make the window exist or generate the event.
+ * Note: if the window's pathName is NULL and the window is not an
+ * anonymous window, it means that the window was not successfully
+ * initialized in the first place, so we should not make the window exist
+ * or generate the event.
*/
- if (winPtr->pathName != NULL) {
+ if (winPtr->pathName != NULL && !(winPtr->flags & TK_ANONYMOUS_WINDOW)) {
if (winPtr->window == None) {
Tk_MakeWindowExist(tkwin);
}
@@ -1241,16 +1360,16 @@ Tk_DestroyWindow(tkwin)
* Cleanup the data structures associated with this window.
*/
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_WIN_MANAGED) {
TkWmDeadWindow(winPtr);
} else if (winPtr->flags & TK_WM_COLORMAP_WINDOW) {
TkWmRemoveFromColormapWindows(winPtr);
}
if (winPtr->window != None) {
-#if defined(MAC_TCL) || defined(__WIN32__)
+#if defined(MAC_TCL) || defined(MAC_OSX_TK) || defined(__WIN32__)
XDestroyWindow(winPtr->display, winPtr->window);
#else
- if ((winPtr->flags & TK_TOP_LEVEL)
+ if ((winPtr->flags & TK_TOP_HIERARCHY)
|| !(winPtr->flags & TK_DONT_DESTROY_WINDOW)) {
/*
* The parent has already been destroyed and this isn't
@@ -1276,6 +1395,7 @@ Tk_DestroyWindow(tkwin)
#ifdef TK_USE_INPUT_METHODS
if (winPtr->inputContext != NULL) {
XDestroyIC(winPtr->inputContext);
+ winPtr->inputContext = NULL;
}
#endif /* TK_USE_INPUT_METHODS */
if (winPtr->tagPtr != NULL) {
@@ -1290,6 +1410,17 @@ Tk_DestroyWindow(tkwin)
(ClientData) winPtr->pathName);
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&winPtr->mainPtr->nameTable,
winPtr->pathName));
+ /*
+ * The memory pointed to by pathName has been deallocated.
+ * Keep users from accessing it after the window has been
+ * destroyed by setting it to NULL.
+ */
+ winPtr->pathName = NULL;
+
+ /*
+ * Invalidate all objects referring to windows on this display.
+ */
+ dispPtr->deletionEpoch++;
}
winPtr->mainPtr->refCount--;
if (winPtr->mainPtr->refCount == 0) {
@@ -1298,12 +1429,12 @@ Tk_DestroyWindow(tkwin)
/*
* We just deleted the last window in the application. Delete
* the TkMainInfo structure too and replace all of Tk's commands
- * with dummy commands that return errors. Also delete the
+ * with dummy commands that return errors. Also delete the
* "send" command to unregister the interpreter.
- *
- * NOTE: Only replace the commands it if the interpreter is
- * not being deleted. If it *is*, the interpreter cleanup will
- * do all the needed work.
+ *
+ * NOTE: Only replace the commands it if the interpreter is
+ * not being deleted. If it *is*, the interpreter cleanup will
+ * do all the needed work.
*/
if ((winPtr->mainPtr->interp != NULL) &&
@@ -1323,6 +1454,8 @@ Tk_DestroyWindow(tkwin)
TkBindFree(winPtr->mainPtr);
TkDeleteAllImages(winPtr->mainPtr);
TkFontPkgFree(winPtr->mainPtr);
+ TkFocusFree(winPtr->mainPtr);
+ TkStylePkgFree(winPtr->mainPtr);
/*
* When embedding Tk into other applications, make sure
@@ -1332,7 +1465,7 @@ Tk_DestroyWindow(tkwin)
*/
if (winPtr->flags & TK_EMBEDDED) {
- XSync(winPtr->display,False) ;
+ XSync(winPtr->display, False);
}
ckfree((char *) winPtr->mainPtr);
@@ -1340,15 +1473,22 @@ Tk_DestroyWindow(tkwin)
* If no other applications are using the display, close the
* display now and relinquish its data structures.
*/
-
+
+#if !defined(WIN32) && !defined(MAC_TCL) && defined(NOT_YET)
if (dispPtr->refCount <= 0) {
-#ifdef NOT_YET
/*
* I have disabled this code because on Windows there are
* still order dependencies in close-down. All displays
* and resources will get closed down properly anyway at
- * exit, through the exit handler.
+ * exit, through the exit handler. -- jyl
*/
+ /*
+ * Ideally this should be enabled, as unix Tk can use multiple
+ * displays. However, there are order issues still, as well
+ * as the handling of queued events and such that must be
+ * addressed before this can be enabled. The current cleanup
+ * works except for send event issues. -- hobbs 04/2002
+ */
TkDisplay *theDispPtr, *backDispPtr;
@@ -1356,7 +1496,7 @@ Tk_DestroyWindow(tkwin)
* Splice this display out of the list of displays.
*/
- for (theDispPtr = displayList, backDispPtr = NULL;
+ for (theDispPtr = tsdPtr->displayList, backDispPtr = NULL;
(theDispPtr != winPtr->dispPtr) &&
(theDispPtr != NULL);
theDispPtr = theDispPtr->nextPtr) {
@@ -1366,39 +1506,27 @@ Tk_DestroyWindow(tkwin)
panic("could not find display to close!");
}
if (backDispPtr == NULL) {
- displayList = theDispPtr->nextPtr;
+ tsdPtr->displayList = theDispPtr->nextPtr;
} else {
backDispPtr->nextPtr = theDispPtr->nextPtr;
}
-
- /*
- * Found and spliced it out, now actually do the cleanup.
- */
-
- if (dispPtr->name != NULL) {
- ckfree(dispPtr->name);
- }
-
- Tcl_DeleteHashTable(&(dispPtr->winTable));
-
- /*
- * Cannot yet close the display because we still have
- * order of deletion problems. Defer until exit handling
- * instead. At that time, the display will cleanly shut
- * down (hopefully..). (JYL)
- */
- TkpCloseDisplay(dispPtr);
+ /*
+ * Calling XSync creates X server traffic, but addresses a
+ * focus issue on close (but not the send issue). -- hobbs
+ XSync(dispPtr->display, True);
+ */
/*
- * There is lots more to clean up, we leave it at this for
- * the time being.
+ * Found and spliced it out, now actually do the cleanup.
*/
-#endif
+
+ TkCloseDisplay(dispPtr);
}
+#endif
}
}
- ckfree((char *) winPtr);
+ Tcl_EventuallyFree((ClientData) winPtr, TCL_DYNAMIC);
}
/*
@@ -1423,7 +1551,7 @@ void
Tk_MapWindow(tkwin)
Tk_Window tkwin; /* Token for window to map. */
{
- register TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *winPtr = (TkWindow *) tkwin;
XEvent event;
if (winPtr->flags & TK_MAPPED) {
@@ -1432,7 +1560,7 @@ Tk_MapWindow(tkwin)
if (winPtr->window == None) {
Tk_MakeWindowExist(tkwin);
}
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_WIN_MANAGED) {
/*
* Lots of special processing has to be done for top-level
* windows. Let tkWm.c handle everything itself.
@@ -1482,13 +1610,14 @@ Tk_MakeWindowExist(tkwin)
TkWindow *winPtr2;
Window parent;
Tcl_HashEntry *hPtr;
+ Tk_ClassCreateProc *createProc;
int new;
if (winPtr->window != None) {
return;
}
- if ((winPtr->parentPtr == NULL) || (winPtr->flags & TK_TOP_LEVEL)) {
+ if ((winPtr->parentPtr == NULL) || (winPtr->flags & TK_TOP_HIERARCHY)) {
parent = XRootWindow(winPtr->display, winPtr->screenNum);
} else {
if (winPtr->parentPtr->window == None) {
@@ -1497,10 +1626,9 @@ Tk_MakeWindowExist(tkwin)
parent = winPtr->parentPtr->window;
}
- if (winPtr->classProcsPtr != NULL
- && winPtr->classProcsPtr->createProc != NULL) {
- winPtr->window = (*winPtr->classProcsPtr->createProc)(tkwin, parent,
- winPtr->instanceData);
+ createProc = Tk_GetClassProc(winPtr->classProcsPtr, createProc);
+ if (createProc != NULL) {
+ winPtr->window = (*createProc)(tkwin, parent, winPtr->instanceData);
} else {
winPtr->window = TkpMakeWindow(winPtr, parent);
}
@@ -1510,11 +1638,8 @@ Tk_MakeWindowExist(tkwin)
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 (!(winPtr->flags & TK_TOP_HIERARCHY)) {
/*
* If any siblings higher up in the stacking order have already
* been created then move this window to its rightful position
@@ -1529,7 +1654,7 @@ Tk_MakeWindowExist(tkwin)
for (winPtr2 = winPtr->nextPtr; winPtr2 != NULL;
winPtr2 = winPtr2->nextPtr) {
if ((winPtr2->window != None)
- && !(winPtr2->flags & (TK_TOP_LEVEL|TK_REPARENTED))) {
+ && !(winPtr2->flags & (TK_TOP_HIERARCHY|TK_REPARENTED))) {
XWindowChanges changes;
changes.sibling = winPtr2->window;
changes.stack_mode = Below;
@@ -1559,7 +1684,7 @@ Tk_MakeWindowExist(tkwin)
*/
if ((winPtr->flags & TK_NEED_CONFIG_NOTIFY)
- && !(winPtr->flags & TK_ALREADY_DEAD)){
+ && !(winPtr->flags & TK_ALREADY_DEAD)) {
winPtr->flags &= ~TK_NEED_CONFIG_NOTIFY;
TkDoConfigureNotify(winPtr);
}
@@ -1595,7 +1720,7 @@ Tk_UnmapWindow(tkwin)
if (!(winPtr->flags & TK_MAPPED) || (winPtr->flags & TK_ALREADY_DEAD)) {
return;
}
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_WIN_MANAGED) {
/*
* Special processing has to be done for top-level windows. Let
* tkWm.c handle everything itself.
@@ -1606,7 +1731,7 @@ Tk_UnmapWindow(tkwin)
}
winPtr->flags &= ~TK_MAPPED;
XUnmapWindow(winPtr->display, winPtr->window);
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!(winPtr->flags & TK_TOP_HIERARCHY)) {
XEvent event;
event.type = UnmapNotify;
@@ -1884,7 +2009,7 @@ Tk_DefineCursor(tkwin, cursor)
{
register TkWindow *winPtr = (TkWindow *) tkwin;
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
winPtr->atts.cursor = (XCursor) cursor;
#else
winPtr->atts.cursor = (Cursor) cursor;
@@ -1915,7 +2040,7 @@ Tk_SetWindowColormap(tkwin, colormap)
if (winPtr->window != None) {
XSetWindowColormap(winPtr->display, winPtr->window, colormap);
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!(winPtr->flags & TK_WIN_MANAGED)) {
TkWmAddToColormapWindows(winPtr);
winPtr->flags |= TK_WM_COLORMAP_WINDOW;
}
@@ -2039,12 +2164,12 @@ TkDoConfigureNotify(winPtr)
void
Tk_SetClass(tkwin, className)
Tk_Window tkwin; /* Token for window to assign class. */
- char *className; /* New class for tkwin. */
+ CONST char *className; /* New class for tkwin. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
winPtr->classUid = Tk_GetUid(className);
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_WIN_MANAGED) {
TkWmSetClass(winPtr);
}
TkOptionClassChanged(winPtr);
@@ -2053,7 +2178,7 @@ Tk_SetClass(tkwin, className)
/*
*----------------------------------------------------------------------
*
- * TkSetClassProcs --
+ * Tk_SetClassProcs --
*
* This procedure is used to set the class procedures and
* instance data for a window.
@@ -2069,9 +2194,9 @@ Tk_SetClass(tkwin, className)
*/
void
-TkSetClassProcs(tkwin, procs, instanceData)
+Tk_SetClassProcs(tkwin, procs, instanceData)
Tk_Window tkwin; /* Token for window to modify. */
- TkClassProcs *procs; /* Class procs structure. */
+ Tk_ClassProcs *procs; /* Class procs structure. */
ClientData instanceData; /* Data to be passed to class procedures. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
@@ -2103,7 +2228,7 @@ TkSetClassProcs(tkwin, procs, instanceData)
Tk_Window
Tk_NameToWindow(interp, pathName, tkwin)
Tcl_Interp *interp; /* Where to report errors. */
- char *pathName; /* Path name of window. */
+ CONST char *pathName; /* Path name of window. */
Tk_Window tkwin; /* Token for window: name is assumed to
* belong to the same main window as tkwin. */
{
@@ -2189,7 +2314,7 @@ Tk_IdToWindow(display, window)
*----------------------------------------------------------------------
*/
-char *
+CONST char *
Tk_DisplayName(tkwin)
Tk_Window tkwin; /* Window whose display name is desired. */
{
@@ -2280,8 +2405,8 @@ Tk_RestackWindow(tkwin, aboveBelow, other)
* otherPtr without changing any of Tk's childLists.
*/
- if (winPtr->flags & TK_TOP_LEVEL) {
- while ((otherPtr != NULL) && !(otherPtr->flags & TK_TOP_LEVEL)) {
+ if (winPtr->flags & TK_WIN_MANAGED) {
+ while ((otherPtr != NULL) && !(otherPtr->flags & TK_TOP_HIERARCHY)) {
otherPtr = otherPtr->parentPtr;
}
TkWmRestackToplevel(winPtr, aboveBelow, otherPtr);
@@ -2307,7 +2432,7 @@ Tk_RestackWindow(tkwin, aboveBelow, other)
}
} else {
while (winPtr->parentPtr != otherPtr->parentPtr) {
- if ((otherPtr == NULL) || (otherPtr->flags & TK_TOP_LEVEL)) {
+ if ((otherPtr == NULL) || (otherPtr->flags & TK_TOP_HIERARCHY)) {
return TCL_ERROR;
}
otherPtr = otherPtr->parentPtr;
@@ -2359,7 +2484,7 @@ Tk_RestackWindow(tkwin, aboveBelow, other)
for (otherPtr = winPtr->nextPtr; otherPtr != NULL;
otherPtr = otherPtr->nextPtr) {
if ((otherPtr->window != None)
- && !(otherPtr->flags & (TK_TOP_LEVEL|TK_REPARENTED))){
+ && !(otherPtr->flags & (TK_TOP_HIERARCHY|TK_REPARENTED))){
changes.sibling = otherPtr->window;
changes.stack_mode = Below;
mask = CWStackMode|CWSibling;
@@ -2396,8 +2521,18 @@ Tk_MainWindow(interp)
* reporting also. */
{
TkMainInfo *mainPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr;
+
+ if (interp == NULL) {
+ return NULL;
+ }
+#ifdef USE_TCL_STUBS
+ if (tclStubsPtr == NULL) {
+ return NULL;
+ }
+#endif
+ tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
for (mainPtr = tsdPtr->mainWindowList; mainPtr != NULL;
mainPtr = mainPtr->nextPtr) {
@@ -2437,65 +2572,6 @@ Tk_StrictMotif(tkwin)
return ((TkWindow *) tkwin)->mainPtr->strictMotif;
}
-/*
- *--------------------------------------------------------------
- *
- * OpenIM --
- *
- * Tries to open an X input method, associated with the
- * given display. Right now we can only deal with a bare-bones
- * input style: no preedit, and no status.
- *
- * Results:
- * Stores the input method in dispPtr->inputMethod; if there isn't
- * a suitable input method, then NULL is stored in dispPtr->inputMethod.
- *
- * Side effects:
- * An input method gets opened.
- *
- *--------------------------------------------------------------
- */
-
-static void
-OpenIM(dispPtr)
- TkDisplay *dispPtr; /* Tk's structure for the display. */
-{
-#ifndef TK_USE_INPUT_METHODS
- return;
-#else
- unsigned short i;
- XIMStyles *stylePtr;
-
- dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL);
- if (dispPtr->inputMethod == NULL) {
- return;
- }
-
- if ((XGetIMValues(dispPtr->inputMethod, XNQueryInputStyle, &stylePtr,
- NULL) != NULL) || (stylePtr == NULL)) {
- goto error;
- }
- for (i = 0; i < stylePtr->count_styles; i++) {
- if (stylePtr->supported_styles[i]
- == (XIMPreeditNothing|XIMStatusNothing)) {
- XFree(stylePtr);
- return;
- }
- }
- XFree(stylePtr);
-
- error:
-
- /*
- * Should close the input method, but this causes core dumps on some
- * systems (e.g. Solaris 2.3 as of 1/6/95).
- * XCloseIM(dispPtr->inputMethod);
- */
- dispPtr->inputMethod = NULL;
- return;
-#endif /* TK_USE_INPUT_METHODS */
-}
-
/*
*----------------------------------------------------------------------
*
@@ -2516,8 +2592,16 @@ OpenIM(dispPtr)
int
Tk_GetNumMainWindows()
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr;
+
+#ifdef USE_TCL_STUBS
+ if (tclStubsPtr == NULL) {
+ return 0;
+ }
+#endif
+
+ tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return tsdPtr->numMainWindows;
}
@@ -2543,11 +2627,11 @@ static void
DeleteWindowsExitProc(clientData)
ClientData clientData; /* Not used. */
{
- TkDisplay *displayPtr, *nextPtr;
+ TkDisplay *dispPtr, *nextPtr;
Tcl_Interp *interp;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
+
while (tsdPtr->mainWindowList != NULL) {
/*
* We must protect the interpreter while deleting the window,
@@ -2561,21 +2645,17 @@ DeleteWindowsExitProc(clientData)
Tk_DestroyWindow((Tk_Window) tsdPtr->mainWindowList->winPtr);
Tcl_Release((ClientData) interp);
}
-
- displayPtr = tsdPtr->displayList;
- tsdPtr->displayList = NULL;
-
+
/*
* Iterate destroying the displays until no more displays remain.
* It is possible for displays to get recreated during exit by any
* code that calls GetScreen, so we must destroy these new displays
* as well as the old ones.
*/
-
- for (displayPtr = tsdPtr->displayList;
- displayPtr != NULL;
- displayPtr = tsdPtr->displayList) {
+ for (dispPtr = tsdPtr->displayList;
+ dispPtr != NULL;
+ dispPtr = tsdPtr->displayList) {
/*
* Now iterate over the current list of open displays, and first
* set the global pointer to NULL so we will be able to notice if
@@ -2584,18 +2664,14 @@ DeleteWindowsExitProc(clientData)
* the old display as it is being destroyed, when it wants to see
* if it needs to dispatch a message.
*/
-
- for (tsdPtr->displayList = NULL; displayPtr != NULL;
- displayPtr = nextPtr) {
- nextPtr = displayPtr->nextPtr;
- if (displayPtr->name != (char *) NULL) {
- ckfree(displayPtr->name);
- }
- Tcl_DeleteHashTable(&(displayPtr->winTable));
- TkpCloseDisplay(displayPtr);
+
+ for (tsdPtr->displayList = NULL; dispPtr != NULL;
+ dispPtr = nextPtr) {
+ nextPtr = dispPtr->nextPtr;
+ TkCloseDisplay(dispPtr);
}
}
-
+
tsdPtr->numMainWindows = 0;
tsdPtr->mainWindowList = NULL;
tsdPtr->initialized = 0;
@@ -2665,8 +2741,8 @@ Tk_SafeInit(interp)
* - Continuous ringing of the bell is a nuisance.
* - Cannot allow access to the clipboard because a malicious script
* can replace the contents with the string "rm -r *" and lead to
- * surprises when the contents of the clipboard are pasted. We do
- * not currently hide the selection command.. Should we?
+ * surprises when the contents of the clipboard are pasted. Similarly,
+ * the selection command is blocked.
* - Cannot allow send because it can be used to cause unsafe
* interpreters to execute commands. The tk command recreates the
* send command, so that too must be hidden.
@@ -2719,7 +2795,9 @@ Initialize(interp)
{
char *p;
int argc, code;
- char **argv, *args[20];
+ CONST char **argv;
+ char *args[20];
+ CONST char *argString = NULL;
Tcl_DString class;
ThreadSpecificData *tsdPtr;
@@ -2732,6 +2810,11 @@ Initialize(interp)
return TCL_ERROR;
}
+ /*
+ * Ensure that our obj-types are registered with the Tcl runtime.
+ */
+ TkRegisterObjTypes();
+
tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -2824,7 +2907,7 @@ Initialize(interp)
* cross interp refcounting and changing the code below.
*/
- p = Tcl_GetStringResult(master);
+ argString = Tcl_GetStringResult(master);
} else {
/*
* If there is an "argv" variable, get its value, extract out
@@ -2832,13 +2915,13 @@ Initialize(interp)
* the arguments that we used.
*/
- p = Tcl_GetVar2(interp, "argv", (char *) NULL, TCL_GLOBAL_ONLY);
+ argString = Tcl_GetVar2(interp, "argv", (char *) NULL, TCL_GLOBAL_ONLY);
}
argv = NULL;
- if (p != NULL) {
+ if (argString != NULL) {
char buffer[TCL_INTEGER_SPACE];
- if (Tcl_SplitList(interp, p, &argc, &argv) != TCL_OK) {
+ if (Tcl_SplitList(interp, argString, &argc, &argv) != TCL_OK) {
argError:
Tcl_AddErrorInfo(interp,
"\n (processing arguments in argv variable)");
@@ -2961,6 +3044,16 @@ Initialize(interp)
code = Tcl_PkgProvideEx(interp, "Tk", TK_VERSION, (ClientData) &tkStubs);
if (code != TCL_OK) {
goto done;
+ } else {
+ /*
+ * If we were able to provide ourselves as a package, then set
+ * the main loop procedure in Tcl to our main loop proc. This
+ * will cause tclsh to be event-aware when Tk is dynamically
+ * loaded. This will have no effect in wish, which already is
+ * prepared to run the event loop.
+ */
+
+ Tcl_SetMainLoop(Tk_MainLoop);
}
#ifdef Tk_InitStubs
@@ -2981,5 +3074,3 @@ Initialize(interp)
}
return code;
}
-
-
diff --git a/tk/library/bgerror.tcl b/tk/library/bgerror.tcl
index e5f47f324a9..1407b55c4bf 100644
--- a/tk/library/bgerror.tcl
+++ b/tk/library/bgerror.tcl
@@ -1,19 +1,79 @@
# bgerror.tcl --
#
-# This file contains a default version of the bgerror procedure. It
-# posts a dialog box with the error message and gives the user a chance
-# to see a more detailed stack trace.
+# Implementation of the bgerror procedure. It posts a dialog box with
+# the error message and gives the user a chance to see a more detailed
+# stack trace, and possible do something more interesting with that
+# trace (like save it to a log). This is adapted from work done by
+# Donal K. Fellows.
#
+# Copyright (c) 1998-2000 by Ajuba Solutions.
+# All rights reserved.
+#
# RCS: @(#) $Id$
-#
-# Copyright (c) 1992-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.
+# $Id$
+namespace eval ::tk {
+ namespace eval dialog {
+ namespace eval error {
+ namespace import ::tk::msgcat::*
+ namespace export bgerror
+ option add *ErrorDialog.function.text [mc "Save To Log"] \
+ widgetDefault
+ option add *ErrorDialog.function.command [namespace code SaveToLog]
+ }
+ }
+}
-# bgerror --
+proc ::tk::dialog::error::Return {} {
+ variable button
+
+ .bgerrorDialog.ok configure -state active -relief sunken
+ update idletasks
+ after 100
+ set button 0
+}
+
+proc ::tk::dialog::error::Details {} {
+ set w .bgerrorDialog
+ set caption [option get $w.function text {}]
+ set command [option get $w.function command {}]
+ if { ($caption eq "") || ($command eq "") } {
+ grid forget $w.function
+ }
+ $w.function configure -text $caption -command \
+ "$command [list [.bgerrorDialog.top.info.text get 1.0 end]]"
+ grid $w.top.info - -sticky nsew -padx 3m -pady 3m
+}
+
+proc ::tk::dialog::error::SaveToLog {text} {
+ if { $::tcl_platform(platform) eq "windows" } {
+ set allFiles *.*
+ } else {
+ set allFiles *
+ }
+ set types [list \
+ [list [mc "Log Files"] .log] \
+ [list [mc "Text Files"] .txt] \
+ [list [mc "All Files"] $allFiles] \
+ ]
+ set filename [tk_getSaveFile -title [mc "Select Log File"] \
+ -filetypes $types -defaultextension .log -parent .bgerrorDialog]
+ if {![string length $filename]} {
+ return
+ }
+ set f [open $filename w]
+ puts -nonewline $f $text
+ close $f
+}
+
+proc ::tk::dialog::error::Destroy {w} {
+ if {$w eq ".bgerrorDialog"} {
+ variable button
+ set button -1
+ }
+}
+
+# ::tk::dialog::error::bgerror --
# This is the default version of bgerror.
# It tries to execute tkerror, if that fails it posts a dialog box containing
# the error message and gives the user a chance to ask to see a stack
@@ -21,82 +81,212 @@
# Arguments:
# err - The error message.
-proc bgerror err {
+proc ::tk::dialog::error::bgerror err {
global errorInfo tcl_platform
-
- # save errorInfo which would be erased in the catch below otherwise.
- set info $errorInfo ;
-
- # For backward compatibility :
- # Let's try to execute "tkerror" (using catch {tkerror ...}
- # instead of searching it with info procs so the application gets
- # a chance to auto load it using its favorite "unknown" mecanism.
- # (we do the default dialog only if we get a TCL_ERROR (=1) return
- # code from the tkerror trial, other ret codes are passed back
- # to our caller (tcl background error handler) so the called "tkerror"
- # can still use return -code break, to skip remaining messages
- # in the error queue for instance)
-
- set ret [catch {tkerror $err} msg];
+ variable button
+
+ set info $errorInfo
+
+ set ret [catch {::tkerror $err} msg];
if {$ret != 1} {return -code $ret $msg}
# Ok the application's tkerror either failed or was not found
# we use the default dialog then :
- if {$tcl_platform(platform) == "macintosh"} {
- set ok Ok
+ if {($tcl_platform(platform) eq "macintosh")
+ || ([tk windowingsystem] eq "aqua")} {
+ set ok [mc Ok]
+ set messageFont system
+ set textRelief flat
+ set textHilight 0
} else {
- set ok OK
+ set ok [mc OK]
+ set messageFont {Times -18}
+ set textRelief sunken
+ set textHilight 1
}
- set button [tk_dialog .bgerrorDialog "Error in Tcl Script" \
- "Error: $err" error 0 $ok "Skip Messages" "Stack Trace"]
- if {$button == 0} {
- return
- } elseif {$button == 1} {
- return -code break
+
+
+ # Truncate the message if it is too wide (longer than 30 characacters) or
+ # too tall (more than 4 newlines). Truncation occurs at the first point at
+ # which one of those conditions is met.
+ set displayedErr ""
+ set lines 0
+ foreach line [split $err \n] {
+ if { [string length $line] > 30 } {
+ append displayedErr "[string range $line 0 29]..."
+ break
+ }
+ if { $lines > 4 } {
+ append displayedErr "..."
+ break
+ } else {
+ append displayedErr "${line}\n"
+ }
+ incr lines
+ }
+
+ set w .bgerrorDialog
+ set title [mc "Application Error"]
+ set text [mc {Error: %1$s} $err]
+ set buttons [list ok $ok dismiss [mc "Skip Messages"] \
+ function [mc "Details >>"]]
+
+ # 1. Create the top-level window and divide it into top
+ # and bottom parts.
+
+ catch {destroy .bgerrorDialog}
+ toplevel .bgerrorDialog -class ErrorDialog
+ wm title .bgerrorDialog $title
+ wm iconname .bgerrorDialog ErrorDialog
+ wm protocol .bgerrorDialog WM_DELETE_WINDOW { }
+
+ if {($tcl_platform(platform) eq "macintosh")
+ || ([tk windowingsystem] eq "aqua")} {
+ ::tk::unsupported::MacWindowStyle style .bgerrorDialog dBoxProc
}
- set w .bgerrorTrace
- catch {destroy $w}
- toplevel $w -class ErrorTrace
- wm minsize $w 1 1
- wm title $w "Stack Trace for Error"
- wm iconname $w "Stack Trace"
- button $w.ok -text OK -command "destroy $w" -default active
- if {![string compare $tcl_platform(platform) "macintosh"]} {
- text $w.text -relief flat -bd 2 -highlightthickness 0 -setgrid true \
- -yscrollcommand "$w.scroll set" -width 60 -height 20
+ frame .bgerrorDialog.bot
+ frame .bgerrorDialog.top
+ if {[tk windowingsystem] eq "x11"} {
+ .bgerrorDialog.bot configure -relief raised -bd 1
+ .bgerrorDialog.top configure -relief raised -bd 1
+ }
+ pack .bgerrorDialog.bot -side bottom -fill both
+ pack .bgerrorDialog.top -side top -fill both -expand 1
+
+ set W [frame $w.top.info]
+ text $W.text \
+ -bd 2 \
+ -yscrollcommand [list $W.scroll set]\
+ -setgrid true \
+ -width 40 \
+ -height 10 \
+ -state normal \
+ -relief $textRelief \
+ -highlightthickness $textHilight \
+ -wrap char
+
+ scrollbar $W.scroll -relief sunken -command [list $W.text yview]
+ pack $W.scroll -side right -fill y
+ pack $W.text -side left -expand yes -fill both
+ $W.text insert 0.0 "$err\n$info"
+ $W.text mark set insert 0.0
+ bind $W.text <ButtonPress-1> { focus %W }
+ $W.text configure -state disabled
+
+ # 2. Fill the top part with bitmap and message
+
+ # Max-width of message is the width of the screen...
+ set wrapwidth [winfo screenwidth .bgerrorDialog]
+ # ...minus the width of the icon, padding and a fudge factor for
+ # the window manager decorations and aesthetics.
+ set wrapwidth [expr {$wrapwidth-60-[winfo pixels .bgerrorDialog 9m]}]
+ label .bgerrorDialog.msg -justify left -text $text -font $messageFont \
+ -wraplength $wrapwidth
+ if {($tcl_platform(platform) eq "macintosh")
+ || ([tk windowingsystem] eq "aqua")} {
+ # On the Macintosh, use the stop bitmap
+ label .bgerrorDialog.bitmap -bitmap stop
} else {
- text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scroll set" \
- -setgrid true -width 60 -height 20
+ # On other platforms, make the error icon
+ canvas .bgerrorDialog.bitmap -width 32 -height 32 -highlightthickness 0
+ .bgerrorDialog.bitmap create oval 0 0 31 31 -fill red -outline black
+ .bgerrorDialog.bitmap create line 9 9 23 23 -fill white -width 4
+ .bgerrorDialog.bitmap create line 9 23 23 9 -fill white -width 4
}
- scrollbar $w.scroll -relief sunken -command "$w.text yview"
- pack $w.ok -side bottom -padx 3m -pady 2m
- pack $w.scroll -side right -fill y
- pack $w.text -side left -expand yes -fill both
- $w.text insert 0.0 $info
- $w.text mark set insert 0.0
+ grid .bgerrorDialog.bitmap .bgerrorDialog.msg \
+ -in .bgerrorDialog.top \
+ -row 0 \
+ -padx 3m \
+ -pady 3m
+ grid configure .bgerrorDialog.msg -sticky nsw -padx {0 3m}
+ grid rowconfigure .bgerrorDialog.top 1 -weight 1
+ grid columnconfigure .bgerrorDialog.top 1 -weight 1
- bind $w <Return> "destroy $w"
- bind $w.text <Return> "destroy $w; break"
+ # 3. Create a row of buttons at the bottom of the dialog.
- # Center the window on the screen.
+ set i 0
+ foreach {name caption} $buttons {
+ button .bgerrorDialog.$name \
+ -text $caption \
+ -default normal \
+ -command [namespace code "set button $i"]
+ grid .bgerrorDialog.$name \
+ -in .bgerrorDialog.bot \
+ -column $i \
+ -row 0 \
+ -sticky ew \
+ -padx 10
+ grid columnconfigure .bgerrorDialog.bot $i -weight 1
+ # We boost the size of some Mac buttons for l&f
+ if {($tcl_platform(platform) eq "macintosh")
+ || ([tk windowingsystem] eq "aqua")} {
+ if {($name eq "ok") || ($name eq "dismiss")} {
+ grid columnconfigure .bgerrorDialog.bot $i -minsize 79
+ }
+ }
+ incr i
+ }
+ # The "OK" button is the default for this dialog.
+ .bgerrorDialog.ok configure -default active
- wm withdraw $w
+ bind .bgerrorDialog <Return> [namespace code Return]
+ bind .bgerrorDialog <Destroy> [namespace code [list Destroy %W]]
+ .bgerrorDialog.function configure -command [namespace code Details]
+
+ # 6. Withdraw the window, then update all the geometry information
+ # so we know how big it wants to be, then center the window in the
+ # display and de-iconify it.
+
+ wm withdraw .bgerrorDialog
update idletasks
- set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \
- - [winfo vrootx [winfo parent $w]]}]
- set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \
- - [winfo vrooty [winfo parent $w]]}]
- wm geom $w +$x+$y
- wm deiconify $w
-
- # Be sure to release any grabs that might be present on the
- # screen, since they could make it impossible for the user
- # to interact with the stack trace.
-
- if {[string compare [grab current .] ""]} {
- grab release [grab current .]
+ set parent [winfo parent .bgerrorDialog]
+ set width [winfo reqwidth .bgerrorDialog]
+ set height [winfo reqheight .bgerrorDialog]
+ set x [expr {([winfo screenwidth .bgerrorDialog] - $width )/2 - \
+ [winfo vrootx $parent]}]
+ set y [expr {([winfo screenheight .bgerrorDialog] - $height)/2 - \
+ [winfo vrooty $parent]}]
+ .bgerrorDialog configure -width $width
+ wm geometry .bgerrorDialog +$x+$y
+ wm deiconify .bgerrorDialog
+
+ # 7. Set a grab and claim the focus too.
+
+ set oldFocus [focus]
+ set oldGrab [grab current .bgerrorDialog]
+ if {$oldGrab != ""} {
+ set grabStatus [grab status $oldGrab]
}
-}
+ grab .bgerrorDialog
+ focus .bgerrorDialog.ok
+
+ # 8. Wait for the user to respond, then restore the focus and
+ # return the index of the selected button. Restore the focus
+ # before deleting the window, since otherwise the window manager
+ # may take the focus away so we can't redirect it. Finally,
+ # restore any grab that was in effect.
+ vwait [namespace which -variable button]
+ set copy $button; # Save a copy...
+ catch {focus $oldFocus}
+ catch {destroy .bgerrorDialog}
+ if {$oldGrab ne ""} {
+ if {$grabStatus eq "global"} {
+ grab -global $oldGrab
+ } else {
+ grab $oldGrab
+ }
+ }
+
+ if {$copy == 1} {
+ return -code break
+ }
+}
+namespace eval :: {
+ # Fool the indexer
+ proc bgerror err {}
+ rename bgerror {}
+ namespace import ::tk::dialog::error::bgerror
+}
diff --git a/tk/library/button.tcl b/tk/library/button.tcl
index d930aee86ef..d92facfa902 100644
--- a/tk/library/button.tcl
+++ b/tk/library/button.tcl
@@ -8,6 +8,7 @@
#
# 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.
@@ -17,122 +18,123 @@
# The code below creates the default class bindings for buttons.
#-------------------------------------------------------------------------
-if {[string match "macintosh" $tcl_platform(platform)]} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
bind Radiobutton <Enter> {
- tkButtonEnter %W
+ tk::ButtonEnter %W
}
bind Radiobutton <1> {
- tkButtonDown %W
+ tk::ButtonDown %W
}
bind Radiobutton <ButtonRelease-1> {
- tkButtonUp %W
+ tk::ButtonUp %W
}
bind Checkbutton <Enter> {
- tkButtonEnter %W
+ tk::ButtonEnter %W
}
bind Checkbutton <1> {
- tkButtonDown %W
+ tk::ButtonDown %W
}
bind Checkbutton <ButtonRelease-1> {
- tkButtonUp %W
+ tk::ButtonUp %W
}
}
-if {[string match "windows" $tcl_platform(platform)]} {
+if {[string equal "windows" $tcl_platform(platform)]} {
bind Checkbutton <equal> {
- tkCheckRadioInvoke %W select
+ tk::CheckRadioInvoke %W select
}
bind Checkbutton <plus> {
- tkCheckRadioInvoke %W select
+ tk::CheckRadioInvoke %W select
}
bind Checkbutton <minus> {
- tkCheckRadioInvoke %W deselect
+ tk::CheckRadioInvoke %W deselect
}
bind Checkbutton <1> {
- tkCheckRadioDown %W
+ tk::CheckRadioDown %W
}
bind Checkbutton <ButtonRelease-1> {
- tkButtonUp %W
+ tk::ButtonUp %W
}
bind Checkbutton <Enter> {
- tkCheckRadioEnter %W
+ tk::CheckRadioEnter %W
}
bind Radiobutton <1> {
- tkCheckRadioDown %W
+ tk::CheckRadioDown %W
}
bind Radiobutton <ButtonRelease-1> {
- tkButtonUp %W
+ tk::ButtonUp %W
}
bind Radiobutton <Enter> {
- tkCheckRadioEnter %W
+ tk::CheckRadioEnter %W
}
}
-if {[string match "unix" $tcl_platform(platform)]} {
+if {[string equal "x11" [tk windowingsystem]]} {
bind Checkbutton <Return> {
if {!$tk_strictMotif} {
- tkCheckRadioInvoke %W
+ tk::CheckRadioInvoke %W
}
}
bind Radiobutton <Return> {
if {!$tk_strictMotif} {
- tkCheckRadioInvoke %W
+ tk::CheckRadioInvoke %W
}
}
bind Checkbutton <1> {
- tkCheckRadioInvoke %W
+ tk::CheckRadioInvoke %W
}
bind Radiobutton <1> {
- tkCheckRadioInvoke %W
+ tk::CheckRadioInvoke %W
}
bind Checkbutton <Enter> {
- tkButtonEnter %W
+ tk::ButtonEnter %W
}
bind Radiobutton <Enter> {
- tkButtonEnter %W
+ tk::ButtonEnter %W
}
}
bind Button <space> {
- tkButtonInvoke %W
+ tk::ButtonInvoke %W
}
bind Checkbutton <space> {
- tkCheckRadioInvoke %W
+ tk::CheckRadioInvoke %W
}
bind Radiobutton <space> {
- tkCheckRadioInvoke %W
+ tk::CheckRadioInvoke %W
}
bind Button <FocusIn> {}
bind Button <Enter> {
- tkButtonEnter %W
+ tk::ButtonEnter %W
}
bind Button <Leave> {
- tkButtonLeave %W
+ tk::ButtonLeave %W
}
bind Button <1> {
- tkButtonDown %W
+ tk::ButtonDown %W
}
bind Button <ButtonRelease-1> {
- tkButtonUp %W
+ tk::ButtonUp %W
}
bind Checkbutton <FocusIn> {}
bind Checkbutton <Leave> {
- tkButtonLeave %W
+ tk::ButtonLeave %W
}
bind Radiobutton <FocusIn> {}
bind Radiobutton <Leave> {
- tkButtonLeave %W
+ tk::ButtonLeave %W
}
-if {[string match "windows" $tcl_platform(platform)]} {
+if {[string equal "windows" $tcl_platform(platform)]} {
#########################
# Windows implementation
#########################
-# tkButtonEnter --
+# ::tk::ButtonEnter --
# 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.
@@ -140,55 +142,54 @@ if {[string match "windows" $tcl_platform(platform)]} {
# Arguments:
# w - The name of the widget.
-proc tkButtonEnter w {
- global tkPriv
- if {[string compare [$w cget -state] "disabled"] \
- && [string equal $tkPriv(buttonWindow) $w]} {
- $w configure -state active -relief sunken
+proc ::tk::ButtonEnter w {
+ variable ::tk::Priv
+ if {[$w cget -state] ne "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 Priv($w,relief) [$w cget -relief]
+ if {$Priv(buttonWindow) eq $w} {
+ $w configure -relief sunken -state active
+ set Priv($w,prelief) sunken
+ } elseif {[set over [$w cget -overrelief]] ne ""} {
+ $w configure -relief $over
+ set Priv($w,prelief) $over
+ }
}
- set tkPriv(window) $w
+ set Priv(window) $w
}
-# tkButtonLeave --
+# ::tk::ButtonLeave --
# 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 (tkPriv(buttonWindow) == $w), restore the relief of the
-# button too.
+# 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 tkButtonLeave w {
- global tkPriv
- if {[string compare [$w cget -state] "disabled"]} {
+proc ::tk::ButtonLeave w {
+ variable ::tk::Priv
+ if {[$w cget -state] ne "disabled"} {
$w configure -state normal
}
- if {[string equal $tkPriv(buttonWindow) $w]} {
- $w configure -relief $tkPriv(relief)
- }
- set tkPriv(window) ""
-}
-# tkCheckRadioEnter --
-# 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.
+ # Restore the original button relief if it was changed by Tk.
+ # That is signaled by the existence of Priv($w,prelief).
-proc tkCheckRadioEnter w {
- global tkPriv
- if {[string compare [$w cget -state] "disabled"] \
- && [string equal $tkPriv(buttonWindow) $w]} {
- $w configure -state active
+ if {[info exists Priv($w,relief)]} {
+ if {[info exists Priv($w,prelief)] && \
+ $Priv($w,prelief) eq [$w cget -relief]} {
+ $w configure -relief $Priv($w,relief)
+ }
+ unset -nocomplain Priv($w,relief) Priv($w,prelief)
}
- set tkPriv(window) $w
+
+ set Priv(window) ""
}
-# tkButtonDown --
+# ::tk::ButtonDown --
# 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
@@ -197,63 +198,124 @@ proc tkCheckRadioEnter w {
# Arguments:
# w - The name of the widget.
-proc tkButtonDown w {
- global tkPriv
- set tkPriv(relief) [$w cget -relief]
- if {[string compare [$w cget -state] "disabled"]} {
- set tkPriv(buttonWindow) $w
+proc ::tk::ButtonDown w {
+ variable ::tk::Priv
+
+ # 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 Priv($w,relief)]} {
+ set Priv($w,relief) [$w cget -relief]
+ }
+
+ if {[$w cget -state] ne "disabled"} {
+ set Priv(buttonWindow) $w
$w configure -relief sunken -state active
+ set Priv($w,prelief) sunken
+
+ # If this button has a repeatdelay set up, get it going with an after
+ after cancel $Priv(afterId)
+ set delay [$w cget -repeatdelay]
+ set Priv(repeated) 0
+ if {$delay > 0} {
+ set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]]
+ }
}
}
-# tkCheckRadioDown --
-# 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.
+# ::tk::ButtonUp --
+# 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 tkCheckRadioDown w {
- global tkPriv
- set tkPriv(relief) [$w cget -relief]
- if {[string compare [$w cget -state] "disabled"]} {
- set tkPriv(buttonWindow) $w
- $w configure -state active
+proc ::tk::ButtonUp w {
+ variable ::tk::Priv
+ if {$Priv(buttonWindow) eq $w} {
+ set Priv(buttonWindow) ""
+
+ # Restore the button's relief if it was cached.
+
+ if {[info exists Priv($w,relief)]} {
+ if {[info exists Priv($w,prelief)] && \
+ $Priv($w,prelief) eq [$w cget -relief]} {
+ $w configure -relief $Priv($w,relief)
+ }
+ unset -nocomplain Priv($w,relief) Priv($w,prelief)
+ }
+
+ # Clean up the after event from the auto-repeater
+ after cancel $Priv(afterId)
+
+ if {$Priv(window) eq $w && [$w cget -state] ne "disabled"} {
+ $w configure -state normal
+
+ # Only invoke the command if it wasn't already invoked by the
+ # auto-repeater functionality
+ if { $Priv(repeated) == 0 } {
+ uplevel #0 [list $w invoke]
+ }
+ }
}
}
-# tkButtonUp --
-# 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.
+# ::tk::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 tkButtonUp w {
- global tkPriv
- if {[string equal $tkPriv(buttonWindow) $w]} {
- set tkPriv(buttonWindow) ""
- $w configure -relief $tkPriv(relief)
- if {[string equal $tkPriv(window) $w]
- && [string compare [$w cget -state] "disabled"]} {
- $w configure -state normal
- uplevel #0 [list $w invoke]
+proc ::tk::CheckRadioEnter w {
+ variable ::tk::Priv
+ if {[$w cget -state] ne "disabled"} {
+ if {$Priv(buttonWindow) eq $w} {
+ $w configure -state active
+ }
+ if {[set over [$w cget -overrelief]] ne ""} {
+ set Priv($w,relief) [$w cget -relief]
+ set Priv($w,prelief) $over
+ $w configure -relief $over
}
}
+ set Priv(window) $w
+}
+
+# ::tk::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 ::tk::CheckRadioDown w {
+ variable ::tk::Priv
+ if {![info exists Priv($w,relief)]} {
+ set Priv($w,relief) [$w cget -relief]
+ }
+ if {[$w cget -state] ne "disabled"} {
+ set Priv(buttonWindow) $w
+ set Priv(repeated) 0
+ $w configure -state active
+ }
}
}
-if {[string match "unix" $tcl_platform(platform)]} {
+if {[string equal "x11" [tk windowingsystem]]} {
#####################
# Unix implementation
#####################
-# tkButtonEnter --
+# ::tk::ButtonEnter --
# 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.
@@ -261,39 +323,56 @@ if {[string match "unix" $tcl_platform(platform)]} {
# Arguments:
# w - The name of the widget.
-proc tkButtonEnter {w} {
- global tkPriv
- if {[string compare [$w cget -state] "disabled"]} {
+proc ::tk::ButtonEnter {w} {
+ variable ::tk::Priv
+ if {[$w cget -state] ne "disabled"} {
+ # On unix the state is active just with mouse-over
$w configure -state active
- if {[string equal $tkPriv(buttonWindow) $w]} {
- $w configure -state active -relief sunken
+
+ # 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 Priv($w,relief) [$w cget -relief]
+ if {$Priv(buttonWindow) eq $w} {
+ $w configure -relief sunken
+ set Priv($w,prelief) sunken
+ } elseif {[set over [$w cget -overrelief]] ne ""} {
+ $w configure -relief $over
+ set Priv($w,prelief) $over
}
}
- set tkPriv(window) $w
+ set Priv(window) $w
}
-# tkButtonLeave --
+# ::tk::ButtonLeave --
# 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 (tkPriv(buttonWindow) == $w), restore the relief of the
-# button too.
+# 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 tkButtonLeave w {
- global tkPriv
- if {[string compare [$w cget -state] "disabled"]} {
+proc ::tk::ButtonLeave w {
+ variable ::tk::Priv
+ if {[$w cget -state] ne "disabled"} {
$w configure -state normal
}
- if {[string equal $tkPriv(buttonWindow) $w]} {
- $w configure -relief $tkPriv(relief)
+
+ # Restore the original button relief if it was changed by Tk.
+ # That is signaled by the existence of Priv($w,prelief).
+
+ if {[info exists Priv($w,relief)]} {
+ if {[info exists Priv($w,prelief)] && \
+ $Priv($w,prelief) eq [$w cget -relief]} {
+ $w configure -relief $Priv($w,relief)
+ }
+ unset -nocomplain Priv($w,relief) Priv($w,prelief)
}
- set tkPriv(window) ""
+
+ set Priv(window) ""
}
-# tkButtonDown --
+# ::tk::ButtonDown --
# 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
@@ -302,16 +381,33 @@ proc tkButtonLeave w {
# Arguments:
# w - The name of the widget.
-proc tkButtonDown w {
- global tkPriv
- set tkPriv(relief) [$w cget -relief]
- if {[string compare [$w cget -state] "disabled"]} {
- set tkPriv(buttonWindow) $w
+proc ::tk::ButtonDown w {
+ variable ::tk::Priv
+
+ # 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 Priv($w,relief)]} {
+ set Priv($w,relief) [$w cget -relief]
+ }
+
+ if {[$w cget -state] ne "disabled"} {
+ set Priv(buttonWindow) $w
$w configure -relief sunken
+ set Priv($w,prelief) sunken
+
+ # If this button has a repeatdelay set up, get it going with an after
+ after cancel $Priv(afterId)
+ set delay [$w cget -repeatdelay]
+ set Priv(repeated) 0
+ if {$delay > 0} {
+ set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]]
+ }
}
}
-# tkButtonUp --
+# ::tk::ButtonUp --
# 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.
@@ -319,27 +415,44 @@ proc tkButtonDown w {
# Arguments:
# w - The name of the widget.
-proc tkButtonUp w {
- global tkPriv
- if {[string equal $w $tkPriv(buttonWindow)]} {
- set tkPriv(buttonWindow) ""
- $w configure -relief $tkPriv(relief)
- if {[string equal $w $tkPriv(window)] \
- && [string compare [$w cget -state] "disabled"]} {
- uplevel #0 [list $w invoke]
+proc ::tk::ButtonUp w {
+ variable ::tk::Priv
+ if {[string equal $w $Priv(buttonWindow)]} {
+ set Priv(buttonWindow) ""
+
+ # Restore the button's relief if it was cached.
+
+ if {[info exists Priv($w,relief)]} {
+ if {[info exists Priv($w,prelief)] && \
+ $Priv($w,prelief) eq [$w cget -relief]} {
+ $w configure -relief $Priv($w,relief)
+ }
+ unset -nocomplain Priv($w,relief) Priv($w,prelief)
+ }
+
+ # Clean up the after event from the auto-repeater
+ after cancel $Priv(afterId)
+
+ if {$Priv(window) eq $w && [$w cget -state] ne "disabled"} {
+ # Only invoke the command if it wasn't already invoked by the
+ # auto-repeater functionality
+ if { $Priv(repeated) == 0 } {
+ uplevel #0 [list $w invoke]
+ }
}
}
}
}
-if {[string match "macintosh" $tcl_platform(platform)]} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
####################
# Mac implementation
####################
-# tkButtonEnter --
+# ::tk::ButtonEnter --
# 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.
@@ -347,35 +460,54 @@ if {[string match "macintosh" $tcl_platform(platform)]} {
# Arguments:
# w - The name of the widget.
-proc tkButtonEnter {w} {
- global tkPriv
- if {[string compare [$w cget -state] "disabled"]} {
- if {[string equal $w $tkPriv(buttonWindow)]} {
+proc ::tk::ButtonEnter {w} {
+ variable ::tk::Priv
+ if {[$w cget -state] ne "disabled"} {
+
+ # If there's an -overrelief value, set the relief to that.
+
+ if {$Priv(buttonWindow) eq $w} {
$w configure -state active
+ } elseif {[set over [$w cget -overrelief]] ne ""} {
+ set Priv($w,relief) [$w cget -relief]
+ set Priv($w,prelief) $over
+ $w configure -relief $over
}
}
- set tkPriv(window) $w
+ set Priv(window) $w
}
-# tkButtonLeave --
+# ::tk::ButtonLeave --
# 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 (tkPriv(buttonWindow) == $w), restore the relief of the
+# pressed (Priv(buttonWindow) == $w), restore the relief of the
# button too.
#
# Arguments:
# w - The name of the widget.
-proc tkButtonLeave w {
- global tkPriv
- if {[string equal $w $tkPriv(buttonWindow)]} {
+proc ::tk::ButtonLeave w {
+ variable ::tk::Priv
+ if {$w eq $Priv(buttonWindow)} {
$w configure -state normal
}
- set tkPriv(window) ""
+
+ # Restore the original button relief if it was changed by Tk.
+ # That is signaled by the existence of Priv($w,prelief).
+
+ if {[info exists Priv($w,relief)]} {
+ if {[info exists Priv($w,prelief)] && \
+ $Priv($w,prelief) eq [$w cget -relief]} {
+ $w configure -relief $Priv($w,relief)
+ }
+ unset -nocomplain Priv($w,relief) Priv($w,prelief)
+ }
+
+ set Priv(window) ""
}
-# tkButtonDown --
+# ::tk::ButtonDown --
# 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
@@ -384,15 +516,25 @@ proc tkButtonLeave w {
# Arguments:
# w - The name of the widget.
-proc tkButtonDown w {
- global tkPriv
- if {[string compare [$w cget -state] "disabled"]} {
- set tkPriv(buttonWindow) $w
+proc ::tk::ButtonDown w {
+ variable ::tk::Priv
+
+ if {[$w cget -state] ne "disabled"} {
+ set Priv(buttonWindow) $w
$w configure -state active
+
+ # If this button has a repeatdelay set up, get it going with an after
+ after cancel $Priv(afterId)
+ set Priv(repeated) 0
+ if { ![catch {$w cget -repeatdelay} delay] } {
+ if {$delay > 0} {
+ set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]]
+ }
+ }
}
}
-# tkButtonUp --
+# ::tk::ButtonUp --
# 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.
@@ -400,14 +542,31 @@ proc tkButtonDown w {
# Arguments:
# w - The name of the widget.
-proc tkButtonUp w {
- global tkPriv
- if {[string equal $w $tkPriv(buttonWindow)]} {
+proc ::tk::ButtonUp w {
+ variable ::tk::Priv
+ if {$Priv(buttonWindow) eq $w} {
+ set Priv(buttonWindow) ""
$w configure -state normal
- set tkPriv(buttonWindow) ""
- if {[string equal $w $tkPriv(window)]
- && [string compare [$w cget -state] "disabled"]} {
- uplevel #0 [list $w invoke]
+
+ # Restore the button's relief if it was cached.
+
+ if {[info exists Priv($w,relief)]} {
+ if {[info exists Priv($w,prelief)] && \
+ $Priv($w,prelief) eq [$w cget -relief]} {
+ $w configure -relief $Priv($w,relief)
+ }
+ unset -nocomplain Priv($w,relief) Priv($w,prelief)
+ }
+
+ # Clean up the after event from the auto-repeater
+ after cancel $Priv(afterId)
+
+ if {$Priv(window) eq $w && [$w cget -state] ne "disabled"} {
+ # Only invoke the command if it wasn't already invoked by the
+ # auto-repeater functionality
+ if { $Priv(repeated) == 0 } {
+ uplevel #0 [list $w invoke]
+ }
}
}
}
@@ -418,15 +577,15 @@ proc tkButtonUp w {
# Shared routines
##################
-# tkButtonInvoke --
+# ::tk::ButtonInvoke --
# The procedure below is called when a button is invoked through
# the keyboard. It simulate a press of the button via the mouse.
#
# Arguments:
# w - The name of the widget.
-proc tkButtonInvoke w {
- if {[string compare [$w cget -state] "disabled"]} {
+proc ::tk::ButtonInvoke w {
+ if {[$w cget -state] ne "disabled"} {
set oldRelief [$w cget -relief]
set oldState [$w cget -state]
$w configure -state active -relief sunken
@@ -437,7 +596,33 @@ proc tkButtonInvoke w {
}
}
-# tkCheckRadioInvoke --
+# ::tk::ButtonAutoInvoke --
+#
+# 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 ::tk::ButtonAutoInvoke.
+
+proc ::tk::ButtonAutoInvoke {w} {
+ variable ::tk::Priv
+ after cancel $Priv(afterId)
+ set delay [$w cget -repeatinterval]
+ if {$Priv(window) eq $w} {
+ incr Priv(repeated)
+ uplevel #0 [list $w invoke]
+ }
+ if {$delay > 0} {
+ set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]]
+ }
+}
+
+# ::tk::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
@@ -447,10 +632,8 @@ proc tkButtonInvoke w {
# w - The name of the widget.
# cmd - The subcommand to invoke (one of invoke, select, or deselect).
-proc tkCheckRadioInvoke {w {cmd invoke}} {
- if {[string compare [$w cget -state] "disabled"]} {
+proc ::tk::CheckRadioInvoke {w {cmd invoke}} {
+ if {[$w cget -state] ne "disabled"} {
uplevel #0 [list $w $cmd]
}
}
-
-
diff --git a/tk/library/choosedir.tcl b/tk/library/choosedir.tcl
index 0d0972ebb67..12fd7447009 100644
--- a/tk/library/choosedir.tcl
+++ b/tk/library/choosedir.tcl
@@ -13,17 +13,18 @@ namespace eval ::tk::dialog::file {}
# Make the chooseDir namespace inside the dialog namespace
namespace eval ::tk::dialog::file::chooseDir {
+ namespace import ::tk::msgcat::*
}
-# ::tk::dialog::file::tkChooseDirectory --
+# ::tk::dialog::file::chooseDir:: --
#
# Implements the TK directory selection dialog.
#
# Arguments:
# args Options parsed by the procedure.
#
-proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} {
- global tkPriv
+proc ::tk::dialog::file::chooseDir:: {args} {
+ variable ::tk::Priv
set dataName __tk_choosedir
upvar ::tk::dialog::file::$dataName data
::tk::dialog::file::chooseDir::Config $dataName $args
@@ -50,7 +51,17 @@ proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} {
set data(okBtn) $w.f2.ok
set data(cancelBtn) $w.f3.cancel
}
- wm transient $w $data(-parent)
+
+ # Dialog boxes should be transient with respect to their parent,
+ # so that they will always stay on top of their parent window. However,
+ # some window managers will create the window as withdrawn if the parent
+ # window is withdrawn or iconified. Combined with the grab we put on the
+ # window, this can hang the entire application. Therefore we only make
+ # the dialog transient if the parent is viewable.
+
+ if {[winfo viewable [winfo toplevel $data(-parent)]] } {
+ wm transient $w $data(-parent)
+ }
trace variable data(selectPath) w [list ::tk::dialog::file::SetPath $w]
$data(dirMenuBtn) configure \
@@ -81,7 +92,7 @@ proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} {
# may take the focus away so we can't redirect it. Finally,
# restore any grab that was in effect.
- tkwait variable tkPriv(selectFilePath)
+ vwait ::tk::Priv(selectFilePath)
::tk::RestoreFocusGrab $w $data(ent) withdraw
@@ -96,7 +107,7 @@ proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} {
# Return value to user
#
- return $tkPriv(selectFilePath)
+ return $Priv(selectFilePath)
}
# ::tk::dialog::file::chooseDir::Config --
@@ -135,8 +146,13 @@ proc ::tk::dialog::file::chooseDir::Config {dataName argList} {
tclParseConfigSpec ::tk::dialog::file::$dataName $specs "" $argList
if {$data(-title) == ""} {
- set data(-title) "Choose Directory"
+ set data(-title) "[mc "Choose Directory"]"
}
+
+ # Stub out the -multiple value for the dialog; it doesn't make sense for
+ # choose directory dialogs, but we have to have something there because we
+ # share so much code with the file dialogs.
+ set data(-multiple) 0
# 4: set the default directory and selection according to the -initial
# settings
@@ -177,8 +193,9 @@ proc ::tk::dialog::file::chooseDir::OkCmd {w} {
# 4b. If the value is different from the current directory, change to
# that directory.
- set iconText [tkIconList_Get $data(icons)]
- if { ![string equal $iconText ""] } {
+ set selection [tk::IconList_Curselection $data(icons)]
+ if { [llength $selection] != 0 } {
+ set iconText [tk::IconList_Get $data(icons) [lindex $selection 0]]
set iconText [file join $data(selectPath) $iconText]
::tk::dialog::file::chooseDir::Done $w $iconText
} else {
@@ -214,11 +231,13 @@ proc ::tk::dialog::file::chooseDir::OkCmd {w} {
proc ::tk::dialog::file::chooseDir::DblClick {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- set text [tkIconList_Get $data(icons)]
- if {[string compare $text ""]} {
+ set selection [tk::IconList_Curselection $data(icons)]
+ if { [llength $selection] != 0 } {
+ set filenameFragment \
+ [tk::IconList_Get $data(icons) [lindex $selection 0]]
set file $data(selectPath)
if {[file isdirectory $file]} {
- ::tk::dialog::file::ListInvoke $w $text
+ ::tk::dialog::file::ListInvoke $w [list $filenameFragment]
return
}
}
@@ -243,13 +262,13 @@ proc ::tk::dialog::file::chooseDir::ListBrowse {w text} {
#
# Gets called when user has input a valid filename. Pops up a
# dialog box to confirm selection when necessary. Sets the
-# tkPriv(selectFilePath) variable, which will break the "tkwait"
+# Priv(selectFilePath) variable, which will break the "vwait"
# loop in tk_chooseDirectory and return the selected filename to the
# script that calls tk_getOpenFile or tk_getSaveFile
#
proc ::tk::dialog::file::chooseDir::Done {w {selectFilePath ""}} {
upvar ::tk::dialog::file::[winfo name $w] data
- global tkPriv
+ variable ::tk::Priv
if {[string equal $selectFilePath ""]} {
set selectFilePath $data(selectPath)
@@ -260,5 +279,5 @@ proc ::tk::dialog::file::chooseDir::Done {w {selectFilePath ""}} {
return
}
}
- set tkPriv(selectFilePath) $selectFilePath
+ set Priv(selectFilePath) $selectFilePath
}
diff --git a/tk/library/clrpick.tcl b/tk/library/clrpick.tcl
index cf7dc04ef73..da174863be9 100644
--- a/tk/library/clrpick.tcl
+++ b/tk/library/clrpick.tcl
@@ -17,16 +17,24 @@
# (2): Implement HSV color selection.
#
-# tkColorDialog --
+# Make sure namespaces exist
+namespace eval ::tk {}
+namespace eval ::tk::dialog {}
+namespace eval ::tk::dialog::color {
+ namespace import ::tk::msgcat::*
+}
+
+# ::tk::dialog::color:: --
#
# Create a color dialog and let the user choose a color. This function
# should not be called directly. It is called by the tk_chooseColor
# function when a native color selector widget does not exist
#
-proc tkColorDialog {args} {
- global tkPriv
- set w .__tk__color
- upvar #0 $w data
+proc ::tk::dialog::color:: {args} {
+ variable ::tk::Priv
+ set dataName __tk__color
+ upvar ::tk::dialog::color::$dataName data
+ set w .$dataName
# The lines variables track the start and end indices of the line
# elements in the colorbar canvases.
@@ -41,11 +49,11 @@ proc tkColorDialog {args} {
# Note that the bars may be of any width.
# However, NUM_COLORBARS must be a number that evenly divides 256.
# Such as 256, 128, 64, etc.
- set data(NUM_COLORBARS) 8
+ set data(NUM_COLORBARS) 16
# BARS_WIDTH is the number of pixels wide the color bar portion of the
# canvas is. This number must be a multiple of NUM_COLORBARS
- set data(BARS_WIDTH) 128
+ set data(BARS_WIDTH) 160
# PLGN_WIDTH is the number of pixels wide of the triangular selection
# polygon. This also results in the definition of the padding on the
@@ -56,8 +64,8 @@ proc tkColorDialog {args} {
# selection rectangle at the bottom of the color bar. No restrictions.
set data(PLGN_WIDTH) 10
- tkColorDialog_Config $w $args
- tkColorDialog_InitValues $w
+ Config $dataName $args
+ InitValues $dataName
set sc [winfo screen $data(-parent)]
set winExists [winfo exists $w]
@@ -65,11 +73,20 @@ proc tkColorDialog {args} {
if {$winExists} {
destroy $w
}
- toplevel $w -class tkColorDialog -screen $sc
- tkColorDialog_BuildDialog $w
+ toplevel $w -class TkColorDialog -screen $sc
+ BuildDialog $w
}
- wm transient $w $data(-parent)
+ # Dialog boxes should be transient with respect to their parent,
+ # so that they will always stay on top of their parent window. However,
+ # some window managers will create the window as withdrawn if the parent
+ # window is withdrawn or iconified. Combined with the grab we put on the
+ # window, this can hang the entire application. Therefore we only make
+ # the dialog transient if the parent is viewable.
+
+ if {[winfo viewable [winfo toplevel $data(-parent)]] } {
+ wm transient $w $data(-parent)
+ }
# 5. Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
@@ -88,19 +105,19 @@ proc tkColorDialog {args} {
# may take the focus away so we can't redirect it. Finally,
# restore any grab that was in effect.
- vwait tkPriv(selectColor)
+ vwait ::tk::Priv(selectColor)
::tk::RestoreFocusGrab $w $data(okBtn)
unset data
- return $tkPriv(selectColor)
+ return $Priv(selectColor)
}
-# tkColorDialog_InitValues --
+# ::tk::dialog::color::InitValues --
#
# Get called during initialization or when user resets NUM_COLORBARS
#
-proc tkColorDialog_InitValues {w} {
- upvar #0 $w data
+proc ::tk::dialog::color::InitValues {dataName} {
+ upvar ::tk::dialog::color::$dataName data
# IntensityIncr is the difference in color intensity between a colorbar
# and its neighbors.
@@ -144,19 +161,19 @@ proc tkColorDialog_InitValues {w} {
set data(blue,intensity) [expr {[lindex $rgb 2]/0x100}]
}
-# tkColorDialog_Config --
+# ::tk::dialog::color::Config --
#
# Parses the command line arguments to tk_chooseColor
#
-proc tkColorDialog_Config {w argList} {
- global tkPriv
- upvar #0 $w data
+proc ::tk::dialog::color::Config {dataName argList} {
+ variable ::tk::Priv
+ upvar ::tk::dialog::color::$dataName data
# 1: the configuration specs
#
- if {[info exists tkPriv(selectColor)] && \
- [string compare $tkPriv(selectColor) ""]} {
- set defaultColor $tkPriv(selectColor)
+ if {[info exists Priv(selectColor)] && \
+ [string compare $Priv(selectColor) ""]} {
+ set defaultColor $Priv(selectColor)
} else {
set defaultColor [. cget -background]
}
@@ -164,12 +181,12 @@ proc tkColorDialog_Config {w argList} {
set specs [list \
[list -initialcolor "" "" $defaultColor] \
[list -parent "" "" "."] \
- [list -title "" "" "Color"] \
+ [list -title "" "" [mc "Color"]] \
]
# 2: parse the arguments
#
- tclParseConfigSpec $w $specs "" $argList
+ tclParseConfigSpec ::tk::dialog::color::$dataName $specs "" $argList
if {[string equal $data(-title) ""]} {
set data(-title) " "
@@ -183,12 +200,12 @@ proc tkColorDialog_Config {w argList} {
}
}
-# tkColorDialog_BuildDialog --
+# ::tk::dialog::color::BuildDialog --
#
# Build the dialog.
#
-proc tkColorDialog_BuildDialog {w} {
- upvar #0 $w data
+proc ::tk::dialog::color::BuildDialog {w} {
+ upvar ::tk::dialog::color::[winfo name $w] data
# TopFrame contains the color strips and the color selection
#
@@ -197,18 +214,26 @@ proc tkColorDialog_BuildDialog {w} {
# StripsFrame contains the colorstrips and the individual RGB entries
set stripsFrame [frame $topFrame.colorStrip]
- foreach c { Red Green Blue } {
- set color [string tolower $c]
-
+ set maxWidth [::tk::mcmaxamp &Red &Green &Blue]
+ set maxWidth [expr {$maxWidth<6?6:$maxWidth}]
+ set colorList [list \
+ red [mc "&Red"] \
+ green [mc "&Green"] \
+ blue [mc "&Blue"] \
+ ]
+ foreach {color l} $colorList {
# each f frame contains an [R|G|B] entry and the equiv. color strip.
set f [frame $stripsFrame.$color]
# The box frame contains the label and entry widget for an [R|G|B]
set box [frame $f.box]
- label $box.label -text $c: -width 6 -under 0 -anchor ne
- entry $box.entry -textvariable [format %s $w]($color,intensity) \
- -width 4
+ bind [::tk::AmpWidget label $box.label -text $l: -width $maxWidth \
+ -anchor ne] <<AltUnderlined>> [list focus $box.entry]
+
+ entry $box.entry -textvariable \
+ ::tk::dialog::color::[winfo name $w]($color,intensity) \
+ -width 4
pack $box.label -side left -fill y -padx 2 -pady 3
pack $box.entry -side left -anchor n -pady 0
pack $box -side left -fill both
@@ -231,18 +256,18 @@ proc tkColorDialog_BuildDialog {w} {
set data($color,sel) $f.sel
bind $data($color,col) <Configure> \
- [list tkColorDialog_DrawColorScale $w $color 1]
+ [list tk::dialog::color::DrawColorScale $w $color 1]
bind $data($color,col) <Enter> \
- [list tkColorDialog_EnterColorBar $w $color]
+ [list tk::dialog::color::EnterColorBar $w $color]
bind $data($color,col) <Leave> \
- [list tkColorDialog_LeaveColorBar $w $color]
+ [list tk::dialog::color::LeaveColorBar $w $color]
bind $data($color,sel) <Enter> \
- [list tkColorDialog_EnterColorBar $w $color]
+ [list tk::dialog::color::EnterColorBar $w $color]
bind $data($color,sel) <Leave> \
- [list tkColorDialog_LeaveColorBar $w $color]
+ [list tk::dialog::color::LeaveColorBar $w $color]
- bind $box.entry <Return> [list tkColorDialog_HandleRGBEntry $w]
+ bind $box.entry <Return> [list tk::dialog::color::HandleRGBEntry $w]
}
pack $stripsFrame -side left -fill both -padx 4 -pady 10
@@ -251,8 +276,10 @@ proc tkColorDialog_BuildDialog {w} {
# selected color
#
set selFrame [frame $topFrame.sel]
- set lab [label $selFrame.lab -text "Selection:" -under 0 -anchor sw]
- set ent [entry $selFrame.ent -textvariable [format %s $w](selection) \
+ set lab [::tk::AmpWidget label $selFrame.lab -text [mc "&Selection:"] \
+ -anchor sw]
+ set ent [entry $selFrame.ent \
+ -textvariable ::tk::dialog::color::[winfo name $w](selection) \
-width 16]
set f1 [frame $selFrame.f1 -relief sunken -bd 2]
set data(finalCanvas) [frame $f1.demo -bd 0 -width 100 -height 70]
@@ -261,7 +288,7 @@ proc tkColorDialog_BuildDialog {w} {
pack $f1 -expand yes -anchor nw -fill both -padx 6 -pady 10
pack $data(finalCanvas) -expand yes -fill both
- bind $ent <Return> [list tkColorDialog_HandleSelEntry $w]
+ bind $ent <Return> [list tk::dialog::color::HandleSelEntry $w]
pack $selFrame -side left -fill none -anchor nw
pack $topFrame -side top -expand yes -fill both -anchor nw
@@ -269,10 +296,14 @@ proc tkColorDialog_BuildDialog {w} {
# the botFrame frame contains the buttons
#
set botFrame [frame $w.bot -relief raised -bd 1]
- button $botFrame.ok -text OK -width 8 -under 0 \
- -command [list tkColorDialog_OkCmd $w]
- button $botFrame.cancel -text Cancel -width 8 -under 0 \
- -command [list tkColorDialog_CancelCmd $w]
+ set maxWidth [::tk::mcmaxamp &OK &Cancel]
+ set maxWidth [expr {$maxWidth<8?8:$maxWidth}]
+ ::tk::AmpWidget button $botFrame.ok -text [mc "&OK"] \
+ -width $maxWidth \
+ -command [list tk::dialog::color::OkCmd $w]
+ ::tk::AmpWidget button $botFrame.cancel -text [mc "&Cancel"] \
+ -width $maxWidth \
+ -command [list tk::dialog::color::CancelCmd $w]
set data(okBtn) $botFrame.ok
set data(cancelBtn) $botFrame.cancel
@@ -283,67 +314,63 @@ proc tkColorDialog_BuildDialog {w} {
# Accelerator bindings
+ bind $lab <<AltUnderlined>> [list focus $ent]
+ bind $w <KeyPress-Escape> [list tk::ButtonInvoke $data(cancelBtn)]
+ bind $w <Alt-Key> [list tk::AltKeyInDialog $w %A]
- bind $w <Alt-r> [list focus $data(red,entry)]
- bind $w <Alt-g> [list focus $data(green,entry)]
- bind $w <Alt-b> [list focus $data(blue,entry)]
- bind $w <Alt-s> [list focus $ent]
- bind $w <KeyPress-Escape> [list tkButtonInvoke $data(cancelBtn)]
- bind $w <Alt-c> [list tkButtonInvoke $data(cancelBtn)]
- bind $w <Alt-o> [list tkButtonInvoke $data(okBtn)]
-
- wm protocol $w WM_DELETE_WINDOW [list tkColorDialog_CancelCmd $w]
+ wm protocol $w WM_DELETE_WINDOW [list tk::dialog::color::CancelCmd $w]
}
-# tkColorDialog_SetRGBValue --
+# ::tk::dialog::color::SetRGBValue --
#
# Sets the current selection of the dialog box
#
-proc tkColorDialog_SetRGBValue {w color} {
- upvar #0 $w data
+proc ::tk::dialog::color::SetRGBValue {w color} {
+ upvar ::tk::dialog::color::[winfo name $w] data
set data(red,intensity) [lindex $color 0]
set data(green,intensity) [lindex $color 1]
set data(blue,intensity) [lindex $color 2]
- tkColorDialog_RedrawColorBars $w all
+ RedrawColorBars $w all
# Now compute the new x value of each colorbars pointer polygon
- foreach color { red green blue } {
- set x [tkColorDialog_RgbToX $w $data($color,intensity)]
- tkColorDialog_MoveSelector $w $data($color,sel) $color $x 0
+ foreach color [list red green blue ] {
+ set x [RgbToX $w $data($color,intensity)]
+ MoveSelector $w $data($color,sel) $color $x 0
}
}
-# tkColorDialog_XToRgb --
+# ::tk::dialog::color::XToRgb --
#
# Converts a screen coordinate to intensity
#
-proc tkColorDialog_XToRgb {w x} {
- upvar #0 $w data
+proc ::tk::dialog::color::XToRgb {w x} {
+ upvar ::tk::dialog::color::[winfo name $w] data
- return [expr {($x * $data(intensityIncr))/ $data(colorbarWidth)}]
+ set x [expr {($x * $data(intensityIncr))/ $data(colorbarWidth)}]
+ if {$x > 255} { set x 255 }
+ return $x
}
-# tkColorDialog_RgbToX
+# ::tk::dialog::color::RgbToX
#
# Converts an intensity to screen coordinate.
#
-proc tkColorDialog_RgbToX {w color} {
- upvar #0 $w data
+proc ::tk::dialog::color::RgbToX {w color} {
+ upvar ::tk::dialog::color::[winfo name $w] data
return [expr {($color * $data(colorbarWidth)/ $data(intensityIncr))}]
}
-# tkColorDialog_DrawColorScale --
+# ::tk::dialog::color::DrawColorScale --
#
# Draw color scale is called whenever the size of one of the color
# scale canvases is changed.
#
-proc tkColorDialog_DrawColorScale {w c {create 0}} {
- global lines
- upvar #0 $w data
+proc ::tk::dialog::color::DrawColorScale {w c {create 0}} {
+ upvar ::tk::dialog::color::[winfo name $w] data
# col: color bar canvas
# sel: selector canvas
@@ -365,13 +392,13 @@ proc tkColorDialog_DrawColorScale {w c {create 0}} {
}
# Draw the selection polygons
- tkColorDialog_CreateSelector $w $sel $c
+ CreateSelector $w $sel $c
$sel bind $data($c,index) <ButtonPress-1> \
- [list tkColorDialog_StartMove $w $sel $c %x $data(selPad) 1]
+ [list tk::dialog::color::StartMove $w $sel $c %x $data(selPad) 1]
$sel bind $data($c,index) <B1-Motion> \
- [list tkColorDialog_MoveSelector $w $sel $c %x $data(selPad)]
+ [list tk::dialog::color::MoveSelector $w $sel $c %x $data(selPad)]
$sel bind $data($c,index) <ButtonRelease-1> \
- [list tkColorDialog_ReleaseMouse $w $sel $c %x $data(selPad)]
+ [list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(selPad)]
set height [winfo height $col]
# Create an invisible region under the colorstrip to catch mouse clicks
@@ -380,18 +407,18 @@ proc tkColorDialog_DrawColorScale {w c {create 0}} {
$data(canvasWidth) $height -fill {} -outline {}]
bind $col <ButtonPress-1> \
- [list tkColorDialog_StartMove $w $sel $c %x $data(colorPad)]
+ [list tk::dialog::color::StartMove $w $sel $c %x $data(colorPad)]
bind $col <B1-Motion> \
- [list tkColorDialog_MoveSelector $w $sel $c %x $data(colorPad)]
+ [list tk::dialog::color::MoveSelector $w $sel $c %x $data(colorPad)]
bind $col <ButtonRelease-1> \
- [list tkColorDialog_ReleaseMouse $w $sel $c %x $data(colorPad)]
+ [list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(colorPad)]
$sel bind $data($c,clickRegion) <ButtonPress-1> \
- [list tkColorDialog_StartMove $w $sel $c %x $data(selPad)]
+ [list tk::dialog::color::StartMove $w $sel $c %x $data(selPad)]
$sel bind $data($c,clickRegion) <B1-Motion> \
- [list tkColorDialog_MoveSelector $w $sel $c %x $data(selPad)]
+ [list tk::dialog::color::MoveSelector $w $sel $c %x $data(selPad)]
$sel bind $data($c,clickRegion) <ButtonRelease-1> \
- [list tkColorDialog_ReleaseMouse $w $sel $c %x $data(selPad)]
+ [list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(selPad)]
} else {
# l is the canvas index of the first colorbar.
set l $data(lines,$c,start)
@@ -436,30 +463,30 @@ proc tkColorDialog_DrawColorScale {w c {create 0}} {
set data(lines,$c,start) [expr {$index - $data(NUM_COLORBARS) + 1}]
}
- tkColorDialog_RedrawFinalColor $w
+ RedrawFinalColor $w
}
-# tkColorDialog_CreateSelector --
+# ::tk::dialog::color::CreateSelector --
#
# Creates and draws the selector polygon at the position
# $data($c,intensity).
#
-proc tkColorDialog_CreateSelector {w sel c } {
- upvar #0 $w data
+proc ::tk::dialog::color::CreateSelector {w sel c } {
+ upvar ::tk::dialog::color::[winfo name $w] data
set data($c,index) [$sel create polygon \
0 $data(PLGN_HEIGHT) \
$data(PLGN_WIDTH) $data(PLGN_HEIGHT) \
$data(indent) 0]
- set data($c,x) [tkColorDialog_RgbToX $w $data($c,intensity)]
+ set data($c,x) [RgbToX $w $data($c,intensity)]
$sel move $data($c,index) $data($c,x) 0
}
-# tkColorDialog_RedrawFinalColor
+# ::tk::dialog::color::RedrawFinalColor
#
# Combines the intensities of the three colors into the final color
#
-proc tkColorDialog_RedrawFinalColor {w} {
- upvar #0 $w data
+proc ::tk::dialog::color::RedrawFinalColor {w} {
+ upvar ::tk::dialog::color::[winfo name $w] data
set color [format "#%02x%02x%02x" $data(red,intensity) \
$data(green,intensity) $data(blue,intensity)]
@@ -473,42 +500,42 @@ proc tkColorDialog_RedrawFinalColor {w} {
$data(blue,intensity)]
}
-# tkColorDialog_RedrawColorBars --
+# ::tk::dialog::color::RedrawColorBars --
#
# Only redraws the colors on the color strips that were not manipulated.
# Params: color of colorstrip that changed. If color is not [red|green|blue]
# Then all colorstrips will be updated
#
-proc tkColorDialog_RedrawColorBars {w colorChanged} {
- upvar #0 $w data
+proc ::tk::dialog::color::RedrawColorBars {w colorChanged} {
+ upvar ::tk::dialog::color::[winfo name $w] data
switch $colorChanged {
red {
- tkColorDialog_DrawColorScale $w green
- tkColorDialog_DrawColorScale $w blue
+ DrawColorScale $w green
+ DrawColorScale $w blue
}
green {
- tkColorDialog_DrawColorScale $w red
- tkColorDialog_DrawColorScale $w blue
+ DrawColorScale $w red
+ DrawColorScale $w blue
}
blue {
- tkColorDialog_DrawColorScale $w red
- tkColorDialog_DrawColorScale $w green
+ DrawColorScale $w red
+ DrawColorScale $w green
}
default {
- tkColorDialog_DrawColorScale $w red
- tkColorDialog_DrawColorScale $w green
- tkColorDialog_DrawColorScale $w blue
+ DrawColorScale $w red
+ DrawColorScale $w green
+ DrawColorScale $w blue
}
}
- tkColorDialog_RedrawFinalColor $w
+ RedrawFinalColor $w
}
#----------------------------------------------------------------------
# Event handlers
#----------------------------------------------------------------------
-# tkColorDialog_StartMove --
+# ::tk::dialog::color::StartMove --
#
# Handles a mousedown button event over the selector polygon.
# Adds the bindings for moving the mouse while the button is
@@ -516,15 +543,15 @@ proc tkColorDialog_RedrawColorBars {w colorChanged} {
#
# Params: sel is the selector canvas window, color is the color of the strip.
#
-proc tkColorDialog_StartMove {w sel color x delta {dontMove 0}} {
- upvar #0 $w data
+proc ::tk::dialog::color::StartMove {w sel color x delta {dontMove 0}} {
+ upvar ::tk::dialog::color::[winfo name $w] data
if {!$dontMove} {
- tkColorDialog_MoveSelector $w $sel $color $x $delta
+ MoveSelector $w $sel $color $x $delta
}
}
-# tkColorDialog_MoveSelector --
+# ::tk::dialog::color::MoveSelector --
#
# Moves the polygon selector so that its middle point has the same
# x value as the specified x. If x is outside the bounds [0,255],
@@ -533,15 +560,15 @@ proc tkColorDialog_StartMove {w sel color x delta {dontMove 0}} {
# Params: sel is the selector canvas, c is [red|green|blue]
# x is a x-coordinate.
#
-proc tkColorDialog_MoveSelector {w sel color x delta} {
- upvar #0 $w data
+proc ::tk::dialog::color::MoveSelector {w sel color x delta} {
+ upvar ::tk::dialog::color::[winfo name $w] data
incr x -$delta
if { $x < 0 } {
set x 0
- } elseif { $x >= $data(BARS_WIDTH)} {
- set x [expr {$data(BARS_WIDTH) - 1}]
+ } elseif { $x > $data(BARS_WIDTH)} {
+ set x $data(BARS_WIDTH)
}
set diff [expr {$x - $data($color,x)}]
$sel move $data($color,index) $diff 0
@@ -551,49 +578,49 @@ proc tkColorDialog_MoveSelector {w sel color x delta} {
return $x
}
-# tkColorDialog_ReleaseMouse
+# ::tk::dialog::color::ReleaseMouse
#
# Removes mouse tracking bindings, updates the colorbars.
#
# Params: sel is the selector canvas, color is the color of the strip,
# x is the x-coord of the mouse.
#
-proc tkColorDialog_ReleaseMouse {w sel color x delta} {
- upvar #0 $w data
+proc ::tk::dialog::color::ReleaseMouse {w sel color x delta} {
+ upvar ::tk::dialog::color::[winfo name $w] data
- set x [tkColorDialog_MoveSelector $w $sel $color $x $delta]
+ set x [MoveSelector $w $sel $color $x $delta]
# Determine exactly what color we are looking at.
- set data($color,intensity) [tkColorDialog_XToRgb $w $x]
+ set data($color,intensity) [XToRgb $w $x]
- tkColorDialog_RedrawColorBars $w $color
+ RedrawColorBars $w $color
}
-# tkColorDialog_ResizeColorbars --
+# ::tk::dialog::color::ResizeColorbars --
#
# Completely redraws the colorbars, including resizing the
# colorstrips
#
-proc tkColorDialog_ResizeColorBars {w} {
- upvar #0 $w data
+proc ::tk::dialog::color::ResizeColorBars {w} {
+ upvar ::tk::dialog::color::[winfo name $w] data
if { ($data(BARS_WIDTH) < $data(NUM_COLORBARS)) ||
(($data(BARS_WIDTH) % $data(NUM_COLORBARS)) != 0)} {
set data(BARS_WIDTH) $data(NUM_COLORBARS)
}
- tkColorDialog_InitValues $w
- foreach color { red green blue } {
+ InitValues [winfo name $w]
+ foreach color [list red green blue ] {
$data($color,col) configure -width $data(canvasWidth)
- tkColorDialog_DrawColorScale $w $color 1
+ DrawColorScale $w $color 1
}
}
-# tkColorDialog_HandleSelEntry --
+# ::tk::dialog::color::HandleSelEntry --
#
# Handles the return keypress event in the "Selection:" entry
#
-proc tkColorDialog_HandleSelEntry {w} {
- upvar #0 $w data
+proc ::tk::dialog::color::HandleSelEntry {w} {
+ upvar ::tk::dialog::color::[winfo name $w] data
set text [string trim $data(selection)]
# Check to make sure that the color is valid
@@ -606,18 +633,18 @@ proc tkColorDialog_HandleSelEntry {w} {
set G [expr {[lindex $color 1]/0x100}]
set B [expr {[lindex $color 2]/0x100}]
- tkColorDialog_SetRGBValue $w "$R $G $B"
+ SetRGBValue $w "$R $G $B"
set data(selection) $text
}
-# tkColorDialog_HandleRGBEntry --
+# ::tk::dialog::color::HandleRGBEntry --
#
# Handles the return keypress event in the R, G or B entry
#
-proc tkColorDialog_HandleRGBEntry {w} {
- upvar #0 $w data
+proc ::tk::dialog::color::HandleRGBEntry {w} {
+ upvar ::tk::dialog::color::[winfo name $w] data
- foreach c {red green blue} {
+ foreach c [list red green blue] {
if {[catch {
set data($c,intensity) [expr {int($data($c,intensity))}]
}]} {
@@ -632,42 +659,39 @@ proc tkColorDialog_HandleRGBEntry {w} {
}
}
- tkColorDialog_SetRGBValue $w "$data(red,intensity) $data(green,intensity) \
- $data(blue,intensity)"
+ SetRGBValue $w "$data(red,intensity) \
+ $data(green,intensity) $data(blue,intensity)"
}
# mouse cursor enters a color bar
#
-proc tkColorDialog_EnterColorBar {w color} {
- upvar #0 $w data
+proc ::tk::dialog::color::EnterColorBar {w color} {
+ upvar ::tk::dialog::color::[winfo name $w] data
$data($color,sel) itemconfig $data($color,index) -fill red
}
# mouse leaves enters a color bar
#
-proc tkColorDialog_LeaveColorBar {w color} {
- upvar #0 $w data
+proc ::tk::dialog::color::LeaveColorBar {w color} {
+ upvar ::tk::dialog::color::[winfo name $w] data
$data($color,sel) itemconfig $data($color,index) -fill black
}
# user hits OK button
#
-proc tkColorDialog_OkCmd {w} {
- global tkPriv
- upvar #0 $w data
+proc ::tk::dialog::color::OkCmd {w} {
+ variable ::tk::Priv
+ upvar ::tk::dialog::color::[winfo name $w] data
- set tkPriv(selectColor) $data(finalColor)
+ set Priv(selectColor) $data(finalColor)
}
# user hits Cancel button
#
-proc tkColorDialog_CancelCmd {w} {
- global tkPriv
-
- set tkPriv(selectColor) ""
+proc ::tk::dialog::color::CancelCmd {w} {
+ variable ::tk::Priv
+ set Priv(selectColor) ""
}
-
-
diff --git a/tk/library/comdlg.tcl b/tk/library/comdlg.tcl
index 929f741a1bb..7be38743984 100644
--- a/tk/library/comdlg.tcl
+++ b/tk/library/comdlg.tcl
@@ -112,94 +112,99 @@ proc tclListValidFlags {v} {
#----------------------------------------------------------------------
-# tkFocusGroup_Create --
+# ::tk::FocusGroup_Create --
#
# Create a focus group. All the widgets in a focus group must be
# within the same focus toplevel. Each toplevel can have only
# one focus group, which is identified by the name of the
# toplevel widget.
#
-proc tkFocusGroup_Create {t} {
- global tkPriv
+proc ::tk::FocusGroup_Create {t} {
+ variable ::tk::Priv
if {[string compare [winfo toplevel $t] $t]} {
error "$t is not a toplevel window"
}
- if {![info exists tkPriv(fg,$t)]} {
- set tkPriv(fg,$t) 1
- set tkPriv(focus,$t) ""
- bind $t <FocusIn> [list tkFocusGroup_In $t %W %d]
- bind $t <FocusOut> [list tkFocusGroup_Out $t %W %d]
- bind $t <Destroy> [list tkFocusGroup_Destroy $t %W]
+ if {![info exists Priv(fg,$t)]} {
+ set Priv(fg,$t) 1
+ set Priv(focus,$t) ""
+ bind $t <FocusIn> [list tk::FocusGroup_In $t %W %d]
+ bind $t <FocusOut> [list tk::FocusGroup_Out $t %W %d]
+ bind $t <Destroy> [list tk::FocusGroup_Destroy $t %W]
}
}
-# tkFocusGroup_BindIn --
+# ::tk::FocusGroup_BindIn --
#
# Add a widget into the "FocusIn" list of the focus group. The $cmd will be
# called when the widget is focused on by the user.
#
-proc tkFocusGroup_BindIn {t w cmd} {
- global tkFocusIn tkPriv
- if {![info exists tkPriv(fg,$t)]} {
+proc ::tk::FocusGroup_BindIn {t w cmd} {
+ variable FocusIn
+ variable ::tk::Priv
+ if {![info exists Priv(fg,$t)]} {
error "focus group \"$t\" doesn't exist"
}
- set tkFocusIn($t,$w) $cmd
+ set FocusIn($t,$w) $cmd
}
-# tkFocusGroup_BindOut --
+# ::tk::FocusGroup_BindOut --
#
# Add a widget into the "FocusOut" list of the focus group. The
# $cmd will be called when the widget loses the focus (User
# types Tab or click on another widget).
#
-proc tkFocusGroup_BindOut {t w cmd} {
- global tkFocusOut tkPriv
- if {![info exists tkPriv(fg,$t)]} {
+proc ::tk::FocusGroup_BindOut {t w cmd} {
+ variable FocusOut
+ variable ::tk::Priv
+ if {![info exists Priv(fg,$t)]} {
error "focus group \"$t\" doesn't exist"
}
- set tkFocusOut($t,$w) $cmd
+ set FocusOut($t,$w) $cmd
}
-# tkFocusGroup_Destroy --
+# ::tk::FocusGroup_Destroy --
#
# Cleans up when members of the focus group is deleted, or when the
# toplevel itself gets deleted.
#
-proc tkFocusGroup_Destroy {t w} {
- global tkPriv tkFocusIn tkFocusOut
+proc ::tk::FocusGroup_Destroy {t w} {
+ variable FocusIn
+ variable FocusOut
+ variable ::tk::Priv
if {[string equal $t $w]} {
- unset tkPriv(fg,$t)
- unset tkPriv(focus,$t)
+ unset Priv(fg,$t)
+ unset Priv(focus,$t)
- foreach name [array names tkFocusIn $t,*] {
- unset tkFocusIn($name)
+ foreach name [array names FocusIn $t,*] {
+ unset FocusIn($name)
}
- foreach name [array names tkFocusOut $t,*] {
- unset tkFocusOut($name)
+ foreach name [array names FocusOut $t,*] {
+ unset FocusOut($name)
}
} else {
- if {[info exists tkPriv(focus,$t)] && \
- [string equal $tkPriv(focus,$t) $w]} {
- set tkPriv(focus,$t) ""
+ if {[info exists Priv(focus,$t)] && \
+ [string equal $Priv(focus,$t) $w]} {
+ set Priv(focus,$t) ""
}
catch {
- unset tkFocusIn($t,$w)
+ unset FocusIn($t,$w)
}
catch {
- unset tkFocusOut($t,$w)
+ unset FocusOut($t,$w)
}
}
}
-# tkFocusGroup_In --
+# ::tk::FocusGroup_In --
#
# Handles the <FocusIn> event. Calls the FocusIn command for the newly
# focused widget in the focus group.
#
-proc tkFocusGroup_In {t w detail} {
- global tkPriv tkFocusIn
+proc ::tk::FocusGroup_In {t w detail} {
+ variable FocusIn
+ variable ::tk::Priv
if {[string compare $detail NotifyNonlinear] && \
[string compare $detail NotifyNonlinearVirtual]} {
@@ -207,56 +212,57 @@ proc tkFocusGroup_In {t w detail} {
# ordinary keypresses some window managers (ie: CDE [Bug: 2960]).
return
}
- if {![info exists tkFocusIn($t,$w)]} {
- set tkFocusIn($t,$w) ""
+ if {![info exists FocusIn($t,$w)]} {
+ set FocusIn($t,$w) ""
return
}
- if {![info exists tkPriv(focus,$t)]} {
+ if {![info exists Priv(focus,$t)]} {
return
}
- if {[string equal $tkPriv(focus,$t) $w]} {
+ if {[string equal $Priv(focus,$t) $w]} {
# This is already in focus
#
return
} else {
- set tkPriv(focus,$t) $w
- eval $tkFocusIn($t,$w)
+ set Priv(focus,$t) $w
+ eval $FocusIn($t,$w)
}
}
-# tkFocusGroup_Out --
+# ::tk::FocusGroup_Out --
#
# Handles the <FocusOut> event. Checks if this is really a lose
# focus event, not one generated by the mouse moving out of the
# toplevel window. Calls the FocusOut command for the widget
# who loses its focus.
#
-proc tkFocusGroup_Out {t w detail} {
- global tkPriv tkFocusOut
+proc ::tk::FocusGroup_Out {t w detail} {
+ variable FocusOut
+ variable ::tk::Priv
if {[string compare $detail NotifyNonlinear] && \
[string compare $detail NotifyNonlinearVirtual]} {
# This is caused by mouse moving out of the window
return
}
- if {![info exists tkPriv(focus,$t)]} {
+ if {![info exists Priv(focus,$t)]} {
return
}
- if {![info exists tkFocusOut($t,$w)]} {
+ if {![info exists FocusOut($t,$w)]} {
return
} else {
- eval $tkFocusOut($t,$w)
- set tkPriv(focus,$t) ""
+ eval $FocusOut($t,$w)
+ set Priv(focus,$t) ""
}
}
-# tkFDGetFileTypes --
+# ::tk::FDGetFileTypes --
#
# Process the string given by the -filetypes option of the file
# dialogs. Similar to the C function TkGetFileFilters() on the Mac
# and Windows platform.
#
-proc tkFDGetFileTypes {string} {
+proc ::tk::FDGetFileTypes {string} {
foreach t $string {
if {[llength $t] < 2 || [llength $t] > 3} {
error "bad file type \"$t\", should be \"typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?\""
@@ -295,5 +301,3 @@ proc tkFDGetFileTypes {string} {
return $types
}
-
-
diff --git a/tk/library/console.tcl b/tk/library/console.tcl
index de884118c8e..cc5e3adb8bf 100644
--- a/tk/library/console.tcl
+++ b/tk/library/console.tcl
@@ -6,8 +6,8 @@
#
# RCS: @(#) $Id$
#
-# Copyright (c) 1998-1999 Scriptics Corp.
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-2000 Ajuba Solutions.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -15,112 +15,152 @@
# TODO: history - remember partially written command
-# tkConsoleInit --
+namespace eval ::tk::console {
+ variable blinkTime 500 ; # msecs to blink braced range for
+ variable blinkRange 1 ; # enable blinking of the entire braced range
+ variable magicKeys 1 ; # enable brace matching and proc/var recognition
+ variable maxLines 600 ; # maximum # of lines buffered in console
+ variable showMatches 1 ; # show multiple expand matches
+
+ variable inPlugin [info exists embed_args]
+ variable defaultPrompt ; # default prompt if tcl_prompt1 isn't used
+
+
+ if {$inPlugin} {
+ set defaultPrompt {subst {[history nextid] % }}
+ } else {
+ set defaultPrompt {subst {([file tail [pwd]]) [history nextid] % }}
+ }
+}
+
+# simple compat function for tkcon code added for this console
+interp alias {} EvalAttached {} consoleinterp eval
+
+# ::tk::ConsoleInit --
# This procedure constructs and configures the console windows.
#
# Arguments:
# None.
-proc tkConsoleInit {} {
+proc ::tk::ConsoleInit {} {
global tcl_platform
if {![consoleinterp eval {set tcl_interactive}]} {
wm withdraw .
}
- if {[string compare $tcl_platform(platform) "macintosh"]} {
- set mod "Ctrl"
- } else {
+ if {[string equal $tcl_platform(platform) "macintosh"]
+ || [string equal [tk windowingsystem] "aqua"]} {
set mod "Cmd"
+ } else {
+ set mod "Ctrl"
}
- menu .menubar
+ if {[catch {menu .menubar} err]} { bgerror "INIT: $err" }
.menubar add cascade -label File -menu .menubar.file -underline 0
.menubar add cascade -label Edit -menu .menubar.edit -underline 0
menu .menubar.file -tearoff 0
- .menubar.file add command -label "Source..." -underline 0 \
- -command tkConsoleSource
- .menubar.file add command -label "Hide Console" -underline 0 \
- -command {wm withdraw .}
- if {[string compare $tcl_platform(platform) "macintosh"]} {
- .menubar.file add command -label "Exit" -underline 1 -command exit
+ .menubar.file add command -label [mc "Source..."] \
+ -underline 0 -command tk::ConsoleSource
+ .menubar.file add command -label [mc "Hide Console"] \
+ -underline 0 -command {wm withdraw .}
+ .menubar.file add command -label [mc "Clear Console"] \
+ -underline 0 -command {.console delete 1.0 "promptEnd linestart"}
+ if {[string equal $tcl_platform(platform) "macintosh"]
+ || [string equal [tk windowingsystem] "aqua"]} {
+ .menubar.file add command -label [mc "Quit"] \
+ -command exit -accel Cmd-Q
} else {
- .menubar.file add command -label "Quit" -command exit -accel Cmd-Q
+ .menubar.file add command -label [mc "Exit"] \
+ -underline 1 -command exit
}
menu .menubar.edit -tearoff 0
- .menubar.edit add command -label "Cut" -underline 2 \
+ .menubar.edit add command -label [mc "Cut"] -underline 2 \
-command { event generate .console <<Cut>> } -accel "$mod+X"
- .menubar.edit add command -label "Copy" -underline 0 \
+ .menubar.edit add command -label [mc "Copy"] -underline 0 \
-command { event generate .console <<Copy>> } -accel "$mod+C"
- .menubar.edit add command -label "Paste" -underline 1 \
+ .menubar.edit add command -label [mc "Paste"] -underline 1 \
-command { event generate .console <<Paste>> } -accel "$mod+V"
if {[string compare $tcl_platform(platform) "windows"]} {
- .menubar.edit add command -label "Clear" -underline 2 \
+ .menubar.edit add command -label [mc "Clear"] -underline 2 \
-command { event generate .console <<Clear>> }
} else {
- .menubar.edit add command -label "Delete" -underline 0 \
+ .menubar.edit add command -label [mc "Delete"] -underline 0 \
-command { event generate .console <<Clear>> } -accel "Del"
-
+
.menubar add cascade -label Help -menu .menubar.help -underline 0
menu .menubar.help -tearoff 0
- .menubar.help add command -label "About..." -underline 0 \
- -command tkConsoleAbout
+ .menubar.help add command -label [mc "About..."] \
+ -underline 0 -command tk::ConsoleAbout
}
. configure -menu .menubar
- text .console -yscrollcommand ".sb set" -setgrid true
- scrollbar .sb -command ".console yview"
+ set con [text .console -yscrollcommand [list .sb set] -setgrid true]
+ scrollbar .sb -command [list $con yview]
pack .sb -side right -fill both
- pack .console -fill both -expand 1 -side left
+ pack $con -fill both -expand 1 -side left
switch -exact $tcl_platform(platform) {
"macintosh" {
- .console configure -font {Monaco 9 normal} -highlightthickness 0
+ $con configure -font {Monaco 9 normal} -highlightthickness 0
}
"windows" {
- .console configure -font systemfixed
+ $con configure -font systemfixed
+ }
+ "unix" {
+ if {[string equal [tk windowingsystem] "aqua"]} {
+ $con configure -font {Monaco 9 normal} -highlightthickness 0
+ }
}
}
- tkConsoleBind .console
+ ConsoleBind $con
- .console tag configure stderr -foreground red
- .console tag configure stdin -foreground blue
+ $con tag configure stderr -foreground red
+ $con tag configure stdin -foreground blue
+ $con tag configure prompt -foreground \#8F4433
+ $con tag configure proc -foreground \#008800
+ $con tag configure var -background \#FFC0D0
+ $con tag raise sel
+ $con tag configure blink -background \#FFFF00
+ $con tag configure find -background \#FFFF00
+
+ focus $con
- focus .console
-
wm protocol . WM_DELETE_WINDOW { wm withdraw . }
- wm title . "Console"
+ wm title . [mc "Console"]
flush stdout
- .console mark set output [.console index "end - 1 char"]
- tkTextSetCursor .console end
- .console mark set promptEnd insert
- .console mark gravity promptEnd left
+ $con mark set output [$con index "end - 1 char"]
+ tk::TextSetCursor $con end
+ $con mark set promptEnd insert
+ $con mark gravity promptEnd left
}
-# tkConsoleSource --
+# ::tk::ConsoleSource --
#
# Prompts the user for a file to source in the main interpreter.
#
# Arguments:
# None.
-proc tkConsoleSource {} {
+proc ::tk::ConsoleSource {} {
set filename [tk_getOpenFile -defaultextension .tcl -parent . \
- -title "Select a file to source" \
- -filetypes {{"Tcl Scripts" .tcl} {"All Files" *}}]
+ -title [mc "Select a file to source"] \
+ -filetypes [list \
+ [list [mc "Tcl Scripts"] .tcl] \
+ [list [mc "All Files"] *]]]
if {[string compare $filename ""]} {
set cmd [list source $filename]
if {[catch {consoleinterp eval $cmd} result]} {
- tkConsoleOutput stderr "$result\n"
+ ConsoleOutput stderr "$result\n"
}
}
}
-# tkConsoleInvoke --
+# ::tk::ConsoleInvoke --
# Processes the command line input. If the command is complete it
# is evaled in the main interpreter. Otherwise, the continuation
# prompt is added and more input may be added.
@@ -128,7 +168,7 @@ proc tkConsoleSource {} {
# Arguments:
# None.
-proc tkConsoleInvoke {args} {
+proc ::tk::ConsoleInvoke {args} {
set ranges [.console tag ranges input]
set cmd ""
if {[llength $ranges]} {
@@ -141,7 +181,7 @@ proc tkConsoleInvoke {args} {
}
}
if {[string equal $cmd ""]} {
- tkConsolePrompt
+ ConsolePrompt
} elseif {[info complete $cmd]} {
.console mark set output end
.console tag delete input
@@ -149,51 +189,51 @@ proc tkConsoleInvoke {args} {
if {[string compare $result ""]} {
puts $result
}
- tkConsoleHistory reset
- tkConsolePrompt
+ ConsoleHistory reset
+ ConsolePrompt
} else {
- tkConsolePrompt partial
+ ConsolePrompt partial
}
.console yview -pickplace insert
}
-# tkConsoleHistory --
+# ::tk::ConsoleHistory --
# This procedure implements command line history for the
# console. In general is evals the history command in the
-# main interpreter to obtain the history. The global variable
-# histNum is used to store the current location in the history.
+# main interpreter to obtain the history. The variable
+# ::tk::HistNum is used to store the current location in the history.
#
# Arguments:
# cmd - Which action to take: prev, next, reset.
-set histNum 1
-proc tkConsoleHistory {cmd} {
- global histNum
-
+set ::tk::HistNum 1
+proc ::tk::ConsoleHistory {cmd} {
+ variable HistNum
+
switch $cmd {
prev {
- incr histNum -1
- if {$histNum == 0} {
+ incr HistNum -1
+ if {$HistNum == 0} {
set cmd {history event [expr {[history nextid] -1}]}
} else {
- set cmd "history event $histNum"
+ set cmd "history event $HistNum"
}
if {[catch {consoleinterp eval $cmd} cmd]} {
- incr histNum
+ incr HistNum
return
}
.console delete promptEnd end
.console insert promptEnd $cmd {input stdin}
}
next {
- incr histNum
- if {$histNum == 0} {
+ incr HistNum
+ if {$HistNum == 0} {
set cmd {history event [expr {[history nextid] -1}]}
- } elseif {$histNum > 0} {
+ } elseif {$HistNum > 0} {
set cmd ""
- set histNum 1
+ set HistNum 1
} else {
- set cmd "history event $histNum"
+ set cmd "history event $HistNum"
}
if {[string compare $cmd ""]} {
catch {consoleinterp eval $cmd} cmd
@@ -202,12 +242,12 @@ proc tkConsoleHistory {cmd} {
.console insert promptEnd $cmd {input stdin}
}
reset {
- set histNum 1
+ set HistNum 1
}
}
}
-# tkConsolePrompt --
+# ::tk::ConsolePrompt --
# This procedure draws the prompt. If tcl_prompt1 or tcl_prompt2
# exists in the main interpreter it will be called to generate the
# prompt. Otherwise, a hard coded default prompt is printed.
@@ -215,18 +255,19 @@ proc tkConsoleHistory {cmd} {
# Arguments:
# partial - Flag to specify which prompt to print.
-proc tkConsolePrompt {{partial normal}} {
+proc ::tk::ConsolePrompt {{partial normal}} {
+ set w .console
if {[string equal $partial "normal"]} {
- set temp [.console index "end - 1 char"]
- .console mark set output end
+ set temp [$w index "end - 1 char"]
+ $w mark set output end
if {[consoleinterp eval "info exists tcl_prompt1"]} {
consoleinterp eval "eval \[set tcl_prompt1\]"
} else {
- puts -nonewline "% "
+ puts -nonewline [EvalAttached $::tk::console::defaultPrompt]
}
} else {
- set temp [.console index output]
- .console mark set output end
+ set temp [$w index output]
+ $w mark set output end
if {[consoleinterp eval "info exists tcl_prompt2"]} {
consoleinterp eval "eval \[set tcl_prompt2\]"
} else {
@@ -234,13 +275,15 @@ proc tkConsolePrompt {{partial normal}} {
}
}
flush stdout
- .console mark set output $temp
- tkTextSetCursor .console end
- .console mark set promptEnd insert
- .console mark gravity promptEnd left
+ $w mark set output $temp
+ ::tk::TextSetCursor $w end
+ $w mark set promptEnd insert
+ $w mark gravity promptEnd left
+ ::tk::console::ConstrainBuffer $w $::tk::console::maxLines
+ $w see end
}
-# tkConsoleBind --
+# ::tk::ConsoleBind --
# This procedure first ensures that the default bindings for the Text
# class have been defined. Then certain bindings are overridden for
# the class.
@@ -248,166 +291,231 @@ proc tkConsolePrompt {{partial normal}} {
# Arguments:
# None.
-proc tkConsoleBind {win} {
- bindtags $win "$win Text . all"
+proc ::tk::ConsoleBind {w} {
+ bindtags $w [list $w Console PostConsole [winfo toplevel $w] all]
+
+ ## Get all Text bindings into Console
+ foreach ev [bind Text] { bind Console $ev [bind Text $ev] }
+ ## We really didn't want the newline insertion...
+ bind Console <Control-Key-o> {}
+ ## ...or any Control-v binding (would block <<Paste>>)
+ bind Console <Control-Key-v> {}
+
+ # For the moment, transpose isn't enabled until the console
+ # gets and overhaul of how it handles input -- hobbs
+ bind Console <Control-Key-t> {}
# 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>.
-
- bind $win <Alt-KeyPress> {# nothing }
- bind $win <Meta-KeyPress> {# nothing}
- bind $win <Control-KeyPress> {# nothing}
- bind $win <Escape> {# nothing}
- bind $win <KP_Enter> {# nothing}
-
- bind $win <Tab> {
- tkConsoleInsert %W \t
- focus %W
- break
- }
- bind $win <Return> {
+
+ bind Console <Alt-KeyPress> {# nothing }
+ bind Console <Meta-KeyPress> {# nothing}
+ bind Console <Control-KeyPress> {# nothing}
+
+ foreach {ev key} {
+ <<Console_Prev>> <Key-Up>
+ <<Console_Next>> <Key-Down>
+ <<Console_NextImmediate>> <Control-Key-n>
+ <<Console_PrevImmediate>> <Control-Key-p>
+ <<Console_PrevSearch>> <Control-Key-r>
+ <<Console_NextSearch>> <Control-Key-s>
+
+ <<Console_Expand>> <Key-Tab>
+ <<Console_Expand>> <Key-Escape>
+ <<Console_ExpandFile>> <Control-Shift-Key-F>
+ <<Console_ExpandProc>> <Control-Shift-Key-P>
+ <<Console_ExpandVar>> <Control-Shift-Key-V>
+ <<Console_Tab>> <Control-Key-i>
+ <<Console_Tab>> <Meta-Key-i>
+ <<Console_Eval>> <Key-Return>
+ <<Console_Eval>> <Key-KP_Enter>
+
+ <<Console_Clear>> <Control-Key-l>
+ <<Console_KillLine>> <Control-Key-k>
+ <<Console_Transpose>> <Control-Key-t>
+ <<Console_ClearLine>> <Control-Key-u>
+ <<Console_SaveCommand>> <Control-Key-z>
+ } {
+ event add $ev $key
+ bind Console $key {}
+ }
+
+ bind Console <<Console_Expand>> {
+ if {[%W compare insert > promptEnd]} {::tk::console::Expand %W}
+ }
+ bind Console <<Console_ExpandFile>> {
+ if {[%W compare insert > promptEnd]} {::tk::console::Expand %W path}
+ }
+ bind Console <<Console_ExpandProc>> {
+ if {[%W compare insert > promptEnd]} {::tk::console::Expand %W proc}
+ }
+ bind Console <<Console_ExpandVar>> {
+ if {[%W compare insert > promptEnd]} {::tk::console::Expand %W var}
+ }
+ bind Console <<Console_Eval>> {
%W mark set insert {end - 1c}
- tkConsoleInsert %W "\n"
- tkConsoleInvoke
+ tk::ConsoleInsert %W "\n"
+ tk::ConsoleInvoke
break
}
- bind $win <Delete> {
- if {[string compare [%W tag nextrange sel 1.0 end] ""]} {
- %W tag remove sel sel.first promptEnd
- } elseif {[%W compare insert < promptEnd]} {
- break
+ bind Console <Delete> {
+ if {[string compare {} [%W tag nextrange sel 1.0 end]] \
+ && [%W compare sel.first >= promptEnd]} {
+ %W delete sel.first sel.last
+ } elseif {[%W compare insert >= promptEnd]} {
+ %W delete insert
+ %W see insert
}
}
- bind $win <BackSpace> {
- if {[string compare [%W tag nextrange sel 1.0 end] ""]} {
- %W tag remove sel sel.first promptEnd
- } elseif {[%W compare insert <= promptEnd]} {
- break
+ bind Console <BackSpace> {
+ if {[string compare {} [%W tag nextrange sel 1.0 end]] \
+ && [%W compare sel.first >= promptEnd]} {
+ %W delete sel.first sel.last
+ } elseif {[%W compare insert != 1.0] && \
+ [%W compare insert > promptEnd]} {
+ %W delete insert-1c
+ %W see insert
}
}
- foreach left {Control-a Home} {
- bind $win <$left> {
- if {[%W compare insert < promptEnd]} {
- tkTextSetCursor %W {insert linestart}
- } else {
- tkTextSetCursor %W promptEnd
- }
- break
+ bind Console <Control-h> [bind Console <BackSpace>]
+
+ bind Console <Home> {
+ if {[%W compare insert < promptEnd]} {
+ tk::TextSetCursor %W {insert linestart}
+ } else {
+ tk::TextSetCursor %W promptEnd
}
}
- foreach right {Control-e End} {
- bind $win <$right> {
- tkTextSetCursor %W {insert lineend}
- break
- }
+ bind Console <Control-a> [bind Console <Home>]
+ bind Console <End> {
+ tk::TextSetCursor %W {insert lineend}
}
- bind $win <Control-d> {
- if {[%W compare insert < promptEnd]} {
- break
- }
+ bind Console <Control-e> [bind Console <End>]
+ bind Console <Control-d> {
+ if {[%W compare insert < promptEnd]} break
+ %W delete insert
}
- bind $win <Control-k> {
- if {[%W compare insert < promptEnd]} {
- %W mark set insert promptEnd
+ bind Console <<Console_KillLine>> {
+ if {[%W compare insert < promptEnd]} break
+ if {[%W compare insert == {insert lineend}]} {
+ %W delete insert
+ } else {
+ %W delete insert {insert lineend}
}
}
- bind $win <Control-t> {
- if {[%W compare insert < promptEnd]} {
- break
- }
+ bind Console <<Console_Clear>> {
+ ## Clear console display
+ %W delete 1.0 "promptEnd linestart"
}
- bind $win <Meta-d> {
- if {[%W compare insert < promptEnd]} {
- break
+ bind Console <<Console_ClearLine>> {
+ ## Clear command line (Unix shell staple)
+ %W delete promptEnd end
+ }
+ bind Console <Meta-d> {
+ if {[%W compare insert >= promptEnd]} {
+ %W delete insert {insert wordend}
}
}
- bind $win <Meta-BackSpace> {
- if {[%W compare insert <= promptEnd]} {
- break
+ bind Console <Meta-BackSpace> {
+ if {[%W compare {insert -1c wordstart} >= promptEnd]} {
+ %W delete {insert -1c wordstart} insert
}
}
- bind $win <Control-h> {
- if {[%W compare insert <= promptEnd]} {
- break
+ bind Console <Meta-d> {
+ if {[%W compare insert >= promptEnd]} {
+ %W delete insert {insert wordend}
}
}
- foreach prev {Control-p Up} {
- bind $win <$prev> {
- tkConsoleHistory prev
- break
+ bind Console <Meta-BackSpace> {
+ if {[%W compare {insert -1c wordstart} >= promptEnd]} {
+ %W delete {insert -1c wordstart} insert
}
}
- foreach prev {Control-n Down} {
- bind $win <$prev> {
- tkConsoleHistory next
- break
+ bind Console <Meta-Delete> {
+ if {[%W compare insert >= promptEnd]} {
+ %W delete insert {insert wordend}
}
}
- bind $win <Insert> {
- catch {tkConsoleInsert %W [selection get -displayof %W]}
- break
+ bind Console <<Console_Prev>> {
+ tk::ConsoleHistory prev
}
- bind $win <KeyPress> {
- tkConsoleInsert %W %A
- break
+ bind Console <<Console_Next>> {
+ tk::ConsoleHistory next
}
- foreach left {Control-b Left} {
- bind $win <$left> {
- if {[%W compare insert == promptEnd]} {
- break
- }
- tkTextSetCursor %W insert-1c
- break
- }
+ bind Console <Insert> {
+ catch {tk::ConsoleInsert %W [::tk::GetSelection %W PRIMARY]}
}
- foreach right {Control-f Right} {
- bind $win <$right> {
- tkTextSetCursor %W insert+1c
- break
- }
+ bind Console <KeyPress> {
+ tk::ConsoleInsert %W %A
}
- bind $win <F9> {
+ bind Console <F9> {
eval destroy [winfo child .]
if {[string equal $tcl_platform(platform) "macintosh"]} {
- source -rsrc Console
+ if {[catch {source [file join $tk_library console.tcl]}]} {source -rsrc console}
} else {
source [file join $tk_library console.tcl]
}
}
- bind $win <<Cut>> {
+ bind Console <<Cut>> {
# Same as the copy event
if {![catch {set data [%W get sel.first sel.last]}]} {
clipboard clear -displayof %W
clipboard append -displayof %W $data
}
- break
}
- bind $win <<Copy>> {
+ bind Console <<Copy>> {
if {![catch {set data [%W get sel.first sel.last]}]} {
clipboard clear -displayof %W
clipboard append -displayof %W $data
}
- break
}
- bind $win <<Paste>> {
+ bind Console <<Paste>> {
catch {
- set clip [selection get -displayof %W -selection CLIPBOARD]
+ set clip [::tk::GetSelection %W CLIPBOARD]
set list [split $clip \n\r]
- tkConsoleInsert %W [lindex $list 0]
+ tk::ConsoleInsert %W [lindex $list 0]
foreach x [lrange $list 1 end] {
%W mark set insert {end - 1c}
- tkConsoleInsert %W "\n"
- tkConsoleInvoke
- tkConsoleInsert %W $x
+ tk::ConsoleInsert %W "\n"
+ tk::ConsoleInvoke
+ tk::ConsoleInsert %W $x
}
}
+ }
+
+ ##
+ ## Bindings for doing special things based on certain keys
+ ##
+ bind PostConsole <Key-parenright> {
+ if {[string compare \\ [%W get insert-2c]]} {
+ ::tk::console::MatchPair %W \( \) promptEnd
+ }
+ }
+ bind PostConsole <Key-bracketright> {
+ if {[string compare \\ [%W get insert-2c]]} {
+ ::tk::console::MatchPair %W \[ \] promptEnd
+ }
+ }
+ bind PostConsole <Key-braceright> {
+ if {[string compare \\ [%W get insert-2c]]} {
+ ::tk::console::MatchPair %W \{ \} promptEnd
+ }
+ }
+ bind PostConsole <Key-quotedbl> {
+ if {[string compare \\ [%W get insert-2c]]} {
+ ::tk::console::MatchQuote %W promptEnd
+ }
+ }
+
+ bind PostConsole <KeyPress> {
+ if {"%A" != ""} {
+ ::tk::console::TagProc %W
+ }
break
}
}
-# tkConsoleInsert --
+# ::tk::ConsoleInsert --
# Insert a string into a text at the point of the insertion cursor.
# If there is a selection in the text, and it covers the point of the
# insertion cursor, then delete the selection before inserting. Insertion
@@ -417,7 +525,7 @@ proc tkConsoleBind {win} {
# w - The text window in which to insert the string
# s - The string to insert (usually just a single character)
-proc tkConsoleInsert {w s} {
+proc ::tk::ConsoleInsert {w s} {
if {[string equal $s ""]} {
return
}
@@ -429,13 +537,13 @@ proc tkConsoleInsert {w s} {
}
}
if {[$w compare insert < promptEnd]} {
- $w mark set insert end
+ $w mark set insert end
}
$w insert insert $s {input stdin}
$w see insert
}
-# tkConsoleOutput --
+# ::tk::ConsoleOutput --
#
# This routine is called directly by ConsolePutsCmd to cause a string
# to be displayed in the console.
@@ -444,12 +552,14 @@ proc tkConsoleInsert {w s} {
# dest - The output tag to be used: either "stderr" or "stdout".
# string - The string to be displayed.
-proc tkConsoleOutput {dest string} {
- .console insert output $string $dest
- .console see insert
+proc ::tk::ConsoleOutput {dest string} {
+ set w .console
+ $w insert output $string $dest
+ ::tk::console::ConstrainBuffer $w $::tk::console::maxLines
+ $w see insert
}
-# tkConsoleExit --
+# ::tk::ConsoleExit --
#
# This routine is called by ConsoleEventProc when the main window of
# the application is destroyed. Don't call exit - that probably already
@@ -458,28 +568,367 @@ proc tkConsoleOutput {dest string} {
# Arguments:
# None.
-proc tkConsoleExit {} {
+proc ::tk::ConsoleExit {} {
destroy .
}
-# tkConsoleAbout --
+# ::tk::ConsoleAbout --
#
# This routine displays an About box to show Tcl/Tk version info.
#
# Arguments:
# None.
-proc tkConsoleAbout {} {
- global tk_patchLevel
- tk_messageBox -type ok -message "Tcl for Windows
-Copyright \251 2000 Scriptics Corporation
+proc ::tk::ConsoleAbout {} {
+ tk_messageBox -type ok -message "[mc {Tcl for Windows}]
-Tcl [info patchlevel]
-Tk $tk_patchLevel"
+Tcl $::tcl_patchLevel
+Tk $::tk_patchLevel"
}
-# now initialize the console
+# ::tk::console::TagProc --
+#
+# Tags a procedure in the console if it's recognized
+# This procedure is not perfect. However, making it perfect wastes
+# too much CPU time...
+#
+# Arguments:
+# w - console text widget
+
+proc ::tk::console::TagProc w {
+ if {!$::tk::console::magicKeys} { return }
+ set exp "\[^\\\\\]\[\[ \t\n\r\;{}\"\$\]"
+ set i [$w search -backwards -regexp $exp insert-1c promptEnd-1c]
+ if {$i == ""} {set i promptEnd} else {append i +2c}
+ regsub -all "\[\[\\\\\\?\\*\]" [$w get $i "insert-1c wordend"] {\\\0} c
+ if {[llength [EvalAttached [list info commands $c]]]} {
+ $w tag add proc $i "insert-1c wordend"
+ } else {
+ $w tag remove proc $i "insert-1c wordend"
+ }
+ if {[llength [EvalAttached [list info vars $c]]]} {
+ $w tag add var $i "insert-1c wordend"
+ } else {
+ $w tag remove var $i "insert-1c wordend"
+ }
+}
-tkConsoleInit
+# ::tk::console::MatchPair --
+#
+# Blinks a matching pair of characters
+# c2 is assumed to be at the text index 'insert'.
+# This proc is really loopy and took me an hour to figure out given
+# all possible combinations with escaping except for escaped \'s.
+# It doesn't take into account possible commenting... Oh well. If
+# anyone has something better, I'd like to see/use it. This is really
+# only efficient for small contexts.
+#
+# Arguments:
+# w - console text widget
+# c1 - first char of pair
+# c2 - second char of pair
+#
+# Calls: ::tk::console::Blink
+
+proc ::tk::console::MatchPair {w c1 c2 {lim 1.0}} {
+ if {!$::tk::console::magicKeys} { return }
+ if {[string compare {} [set ix [$w search -back $c1 insert $lim]]]} {
+ while {
+ [string match {\\} [$w get $ix-1c]] &&
+ [string compare {} [set ix [$w search -back $c1 $ix-1c $lim]]]
+ } {}
+ set i1 insert-1c
+ while {[string compare {} $ix]} {
+ set i0 $ix
+ set j 0
+ while {[string compare {} [set i0 [$w search $c2 $i0 $i1]]]} {
+ append i0 +1c
+ if {[string match {\\} [$w get $i0-2c]]} continue
+ incr j
+ }
+ if {!$j} break
+ set i1 $ix
+ while {$j && [string compare {} \
+ [set ix [$w search -back $c1 $ix $lim]]]} {
+ if {[string match {\\} [$w get $ix-1c]]} continue
+ incr j -1
+ }
+ }
+ if {[string match {} $ix]} { set ix [$w index $lim] }
+ } else { set ix [$w index $lim] }
+ if {$::tk::console::blinkRange} {
+ Blink $w $ix [$w index insert]
+ } else {
+ Blink $w $ix $ix+1c [$w index insert-1c] [$w index insert]
+ }
+}
+# ::tk::console::MatchQuote --
+#
+# Blinks between matching quotes.
+# Blinks just the quote if it's unmatched, otherwise blinks quoted string
+# The quote to match is assumed to be at the text index 'insert'.
+#
+# Arguments:
+# w - console text widget
+#
+# Calls: ::tk::console::Blink
+
+proc ::tk::console::MatchQuote {w {lim 1.0}} {
+ if {!$::tk::console::magicKeys} { return }
+ set i insert-1c
+ set j 0
+ while {[string compare [set i [$w search -back \" $i $lim]] {}]} {
+ if {[string match {\\} [$w get $i-1c]]} continue
+ if {!$j} {set i0 $i}
+ incr j
+ }
+ if {$j&1} {
+ if {$::tk::console::blinkRange} {
+ Blink $w $i0 [$w index insert]
+ } else {
+ Blink $w $i0 $i0+1c [$w index insert-1c] [$w index insert]
+ }
+ } else {
+ Blink $w [$w index insert-1c] [$w index insert]
+ }
+}
+
+# ::tk::console::Blink --
+#
+# Blinks between n index pairs for a specified duration.
+#
+# Arguments:
+# w - console text widget
+# i1 - start index to blink region
+# i2 - end index of blink region
+# dur - duration in usecs to blink for
+#
+# Outputs:
+# blinks selected characters in $w
+
+proc ::tk::console::Blink {w args} {
+ eval [list $w tag add blink] $args
+ after $::tk::console::blinkTime [list $w] tag remove blink $args
+}
+
+# ::tk::console::ConstrainBuffer --
+#
+# This limits the amount of data in the text widget
+# Called by Prompt and ConsoleOutput
+#
+# Arguments:
+# w - console text widget
+# size - # of lines to constrain to
+#
+# Outputs:
+# may delete data in console widget
+
+proc ::tk::console::ConstrainBuffer {w size} {
+ if {[$w index end] > $size} {
+ $w delete 1.0 [expr {int([$w index end])-$size}].0
+ }
+}
+# ::tk::console::Expand --
+#
+# Arguments:
+# ARGS: w - text widget in which to expand str
+# type - type of expansion (path / proc / variable)
+#
+# Calls: ::tk::console::Expand(Pathname|Procname|Variable)
+#
+# Outputs: The string to match is expanded to the longest possible match.
+# If ::tk::console::showMatches is non-zero and the longest match
+# equaled the string to expand, then all possible matches are
+# output to stdout. Triggers bell if no matches are found.
+#
+# Returns: number of matches found
+
+proc ::tk::console::Expand {w {type ""}} {
+ set exp "\[^\\\\\]\[\[ \t\n\r\\\{\"\\\\\$\]"
+ set tmp [$w search -backwards -regexp $exp insert-1c promptEnd-1c]
+ if {$tmp == ""} {set tmp promptEnd} else {append tmp +2c}
+ if {[$w compare $tmp >= insert]} { return }
+ set str [$w get $tmp insert]
+ switch -glob $type {
+ path* { set res [ExpandPathname $str] }
+ proc* { set res [ExpandProcname $str] }
+ var* { set res [ExpandVariable $str] }
+ default {
+ set res {}
+ foreach t {Pathname Procname Variable} {
+ if {![catch {Expand$t $str} res] && ($res != "")} { break }
+ }
+ }
+ }
+ set len [llength $res]
+ if {$len} {
+ set repl [lindex $res 0]
+ $w delete $tmp insert
+ $w insert $tmp $repl {input stdin}
+ if {($len > 1) && $::tk::console::showMatches \
+ && [string equal $repl $str]} {
+ puts stdout [lsort [lreplace $res 0 0]]
+ }
+ } else { bell }
+ return [incr len -1]
+}
+
+# ::tk::console::ExpandPathname --
+#
+# Expand a file pathname based on $str
+# This is based on UNIX file name conventions
+#
+# Arguments:
+# str - partial file pathname to expand
+#
+# Calls: ::tk::console::ExpandBestMatch
+#
+# Returns: list containing longest unique match followed by all the
+# possible further matches
+
+proc ::tk::console::ExpandPathname str {
+ set pwd [EvalAttached pwd]
+ if {[catch {EvalAttached [list cd [file dirname $str]]} err]} {
+ return -code error $err
+ }
+ set dir [file tail $str]
+ ## Check to see if it was known to be a directory and keep the trailing
+ ## slash if so (file tail cuts it off)
+ if {[string match */ $str]} { append dir / }
+ if {[catch {lsort [EvalAttached [list glob $dir*]]} m]} {
+ set match {}
+ } else {
+ if {[llength $m] > 1} {
+ global tcl_platform
+ if {[string match windows $tcl_platform(platform)]} {
+ ## Windows is screwy because it's case insensitive
+ set tmp [ExpandBestMatch [string tolower $m] \
+ [string tolower $dir]]
+ ## Don't change case if we haven't changed the word
+ if {[string length $dir]==[string length $tmp]} {
+ set tmp $dir
+ }
+ } else {
+ set tmp [ExpandBestMatch $m $dir]
+ }
+ if {[string match ?*/* $str]} {
+ set tmp [file dirname $str]/$tmp
+ } elseif {[string match /* $str]} {
+ set tmp /$tmp
+ }
+ regsub -all { } $tmp {\\ } tmp
+ set match [linsert $m 0 $tmp]
+ } else {
+ ## This may look goofy, but it handles spaces in path names
+ eval append match $m
+ if {[file isdir $match]} {append match /}
+ if {[string match ?*/* $str]} {
+ set match [file dirname $str]/$match
+ } elseif {[string match /* $str]} {
+ set match /$match
+ }
+ regsub -all { } $match {\\ } match
+ ## Why is this one needed and the ones below aren't!!
+ set match [list $match]
+ }
+ }
+ EvalAttached [list cd $pwd]
+ return $match
+}
+
+# ::tk::console::ExpandProcname --
+#
+# Expand a tcl proc name based on $str
+#
+# Arguments:
+# str - partial proc name to expand
+#
+# Calls: ::tk::console::ExpandBestMatch
+#
+# Returns: list containing longest unique match followed by all the
+# possible further matches
+
+proc ::tk::console::ExpandProcname str {
+ set match [EvalAttached [list info commands $str*]]
+ if {[llength $match] == 0} {
+ set ns [EvalAttached \
+ "namespace children \[namespace current\] [list $str*]"]
+ if {[llength $ns]==1} {
+ set match [EvalAttached [list info commands ${ns}::*]]
+ } else {
+ set match $ns
+ }
+ }
+ if {[llength $match] > 1} {
+ regsub -all { } [ExpandBestMatch $match $str] {\\ } str
+ set match [linsert $match 0 $str]
+ } else {
+ regsub -all { } $match {\\ } match
+ }
+ return $match
+}
+
+# ::tk::console::ExpandVariable --
+#
+# Expand a tcl variable name based on $str
+#
+# Arguments:
+# str - partial tcl var name to expand
+#
+# Calls: ::tk::console::ExpandBestMatch
+#
+# Returns: list containing longest unique match followed by all the
+# possible further matches
+
+proc ::tk::console::ExpandVariable str {
+ if {[regexp {([^\(]*)\((.*)} $str junk ary str]} {
+ ## Looks like they're trying to expand an array.
+ set match [EvalAttached [list array names $ary $str*]]
+ if {[llength $match] > 1} {
+ set vars $ary\([ExpandBestMatch $match $str]
+ foreach var $match {lappend vars $ary\($var\)}
+ return $vars
+ } else {set match $ary\($match\)}
+ ## Space transformation avoided for array names.
+ } else {
+ set match [EvalAttached [list info vars $str*]]
+ if {[llength $match] > 1} {
+ regsub -all { } [ExpandBestMatch $match $str] {\\ } str
+ set match [linsert $match 0 $str]
+ } else {
+ regsub -all { } $match {\\ } match
+ }
+ }
+ return $match
+}
+
+# ::tk::console::ExpandBestMatch --
+#
+# Finds the best unique match in a list of names.
+# The extra $e in this argument allows us to limit the innermost loop a little
+# further. This improves speed as $l becomes large or $e becomes long.
+#
+# Arguments:
+# l - list to find best unique match in
+# e - currently best known unique match
+#
+# Returns: longest unique match in the list
+
+proc ::tk::console::ExpandBestMatch {l {e {}}} {
+ set ec [lindex $l 0]
+ if {[llength $l]>1} {
+ set e [string length $e]; incr e -1
+ set ei [string length $ec]; incr ei -1
+ foreach l $l {
+ while {$ei>=$e && [string first $ec $l]} {
+ set ec [string range $ec 0 [incr ei -1]]
+ }
+ }
+ }
+ return $ec
+}
+
+# now initialize the console
+::tk::ConsoleInit
diff --git a/tk/library/demos/README b/tk/library/demos/README
index 229c48707f2..b8dd11f60fa 100644
--- a/tk/library/demos/README
+++ b/tk/library/demos/README
@@ -44,4 +44,3 @@ browse - A simple directory browser. Invoke it with and argument
Control-c and control-q cause the program to exit.
RCS: @(#) $Id$
-
diff --git a/tk/library/demos/arrow.tcl b/tk/library/demos/arrow.tcl
index f3f00c1084c..c2d0d4b7e9e 100644
--- a/tk/library/demos/arrow.tcl
+++ b/tk/library/demos/arrow.tcl
@@ -33,68 +33,69 @@ proc arrowSetup c {
# Create the arrow and outline.
$c delete all
- eval "$c create line $v(x1) $v(y) $v(x2) $v(y) -width [expr 10*$v(width)] \
- -arrowshape {[expr 10*$v(a)] [expr 10*$v(b)] [expr 10*$v(c)]} \
- -arrow last $v(bigLineStyle)"
- set xtip [expr $v(x2)-10*$v(b)]
- set deltaY [expr 10*$v(c)+5*$v(width)]
- $c create line $v(x2) $v(y) $xtip [expr $v(y)+$deltaY] \
- [expr $v(x2)-10*$v(a)] $v(y) $xtip [expr $v(y)-$deltaY] \
+ eval {$c create line $v(x1) $v(y) $v(x2) $v(y) -arrow last \
+ -width [expr {10*$v(width)}] -arrowshape [list \
+ [expr {10*$v(a)}] [expr {10*$v(b)}] [expr {10*$v(c)}]]} \
+ $v(bigLineStyle)
+ set xtip [expr {$v(x2)-10*$v(b)}]
+ set deltaY [expr {10*$v(c)+5*$v(width)}]
+ $c create line $v(x2) $v(y) $xtip [expr {$v(y)+$deltaY}] \
+ [expr {$v(x2)-10*$v(a)}] $v(y) $xtip [expr {$v(y)-$deltaY}] \
$v(x2) $v(y) -width 2 -capstyle round -joinstyle round
# Create the boxes for reshaping the line and arrowhead.
- eval "$c create rect [expr $v(x2)-10*$v(a)-5] [expr $v(y)-5] \
- [expr $v(x2)-10*$v(a)+5] [expr $v(y)+5] $v(boxStyle) \
- -tags {box1 box}"
- eval "$c create rect [expr $xtip-5] [expr $v(y)-$deltaY-5] \
- [expr $xtip+5] [expr $v(y)-$deltaY+5] $v(boxStyle) \
- -tags {box2 box}"
- eval "$c create rect [expr $v(x1)-5] [expr $v(y)-5*$v(width)-5] \
- [expr $v(x1)+5] [expr $v(y)-5*$v(width)+5] $v(boxStyle) \
- -tags {box3 box}"
+ eval {$c create rect [expr {$v(x2)-10*$v(a)-5}] [expr {$v(y)-5}] \
+ [expr {$v(x2)-10*$v(a)+5}] [expr {$v(y)+5}] \
+ -tags {box1 box}} $v(boxStyle)
+ eval {$c create rect [expr {$xtip-5}] [expr {$v(y)-$deltaY-5}] \
+ [expr {$xtip+5}] [expr {$v(y)-$deltaY+5}] \
+ -tags {box2 box}} $v(boxStyle)
+ eval {$c create rect [expr {$v(x1)-5}] [expr {$v(y)-5*$v(width)-5}] \
+ [expr {$v(x1)+5}] [expr {$v(y)-5*$v(width)+5}] \
+ -tags {box3 box}} $v(boxStyle)
if {$cur != ""} {
eval $c itemconfigure $cur $v(activeStyle)
}
# Create three arrows in actual size with the same parameters
- $c create line [expr $v(x2)+50] 0 [expr $v(x2)+50] 1000 \
+ $c create line [expr {$v(x2)+50}] 0 [expr {$v(x2)+50}] 1000 \
-width 2
- set tmp [expr $v(x2)+100]
- $c create line $tmp [expr $v(y)-125] $tmp [expr $v(y)-75] \
+ set tmp [expr {$v(x2)+100}]
+ $c create line $tmp [expr {$v(y)-125}] $tmp [expr {$v(y)-75}] \
-width $v(width) \
-arrow both -arrowshape "$v(a) $v(b) $v(c)"
- $c create line [expr $tmp-25] $v(y) [expr $tmp+25] $v(y) \
+ $c create line [expr {$tmp-25}] $v(y) [expr {$tmp+25}] $v(y) \
-width $v(width) \
-arrow both -arrowshape "$v(a) $v(b) $v(c)"
- $c create line [expr $tmp-25] [expr $v(y)+75] [expr $tmp+25] \
- [expr $v(y)+125] -width $v(width) \
+ $c create line [expr {$tmp-25}] [expr {$v(y)+75}] [expr {$tmp+25}] \
+ [expr {$v(y)+125}] -width $v(width) \
-arrow both -arrowshape "$v(a) $v(b) $v(c)"
# Create a bunch of other arrows and text items showing the
# current dimensions.
- set tmp [expr $v(x2)+10]
- $c create line $tmp [expr $v(y)-5*$v(width)] \
- $tmp [expr $v(y)-$deltaY] \
+ set tmp [expr {$v(x2)+10}]
+ $c create line $tmp [expr {$v(y)-5*$v(width)}] \
+ $tmp [expr {$v(y)-$deltaY}] \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x2)+15] [expr $v(y)-$deltaY+5*$v(c)] \
+ $c create text [expr {$v(x2)+15}] [expr {$v(y)-$deltaY+5*$v(c)}] \
-text $v(c) -anchor w
- set tmp [expr $v(x1)-10]
- $c create line $tmp [expr $v(y)-5*$v(width)] \
- $tmp [expr $v(y)+5*$v(width)] \
+ set tmp [expr {$v(x1)-10}]
+ $c create line $tmp [expr {$v(y)-5*$v(width)}] \
+ $tmp [expr {$v(y)+5*$v(width)}] \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x1)-15] $v(y) -text $v(width) -anchor e
- set tmp [expr $v(y)+5*$v(width)+10*$v(c)+10]
- $c create line [expr $v(x2)-10*$v(a)] $tmp $v(x2) $tmp \
+ $c create text [expr {$v(x1)-15}] $v(y) -text $v(width) -anchor e
+ set tmp [expr {$v(y)+5*$v(width)+10*$v(c)+10}]
+ $c create line [expr {$v(x2)-10*$v(a)}] $tmp $v(x2) $tmp \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x2)-5*$v(a)] [expr $tmp+5] \
+ $c create text [expr {$v(x2)-5*$v(a)}] [expr {$tmp+5}] \
-text $v(a) -anchor n
- set tmp [expr $tmp+25]
- $c create line [expr $v(x2)-10*$v(b)] $tmp $v(x2) $tmp \
+ set tmp [expr {$tmp+25}]
+ $c create line [expr {$v(x2)-10*$v(b)}] $tmp $v(x2) $tmp \
-arrow both -arrowshape $v(smallTips)
- $c create text [expr $v(x2)-5*$v(b)] [expr $tmp+5] \
+ $c create text [expr {$v(x2)-5*$v(b)}] [expr {$tmp+5}] \
-text $v(b) -anchor n
$c create text $v(x1) 310 -text "-width $v(width)" \
@@ -168,7 +169,7 @@ bind $c <Any-ButtonRelease-1> "arrowSetup $c"
proc arrowMove1 {c x y} {
upvar #0 demo_arrowInfo v
- set newA [expr ($v(x2)+5-round([$c canvasx $x]))/10]
+ set newA [expr {($v(x2)+5-round([$c canvasx $x]))/10}]
if {$newA < 0} {
set newA 0
}
@@ -176,7 +177,7 @@ proc arrowMove1 {c x y} {
set newA 25
}
if {$newA != $v(a)} {
- $c move box1 [expr 10*($v(a)-$newA)] 0
+ $c move box1 [expr {10*($v(a)-$newA)}] 0
set v(a) $newA
}
}
@@ -192,14 +193,14 @@ proc arrowMove1 {c x y} {
proc arrowMove2 {c x y} {
upvar #0 demo_arrowInfo v
- set newB [expr ($v(x2)+5-round([$c canvasx $x]))/10]
+ set newB [expr {($v(x2)+5-round([$c canvasx $x]))/10}]
if {$newB < 0} {
set newB 0
}
if {$newB > 25} {
set newB 25
}
- set newC [expr ($v(y)+5-round([$c canvasy $y])-5*$v(width))/10]
+ set newC [expr {($v(y)+5-round([$c canvasy $y])-5*$v(width))/10}]
if {$newC < 0} {
set newC 0
}
@@ -207,7 +208,7 @@ proc arrowMove2 {c x y} {
set newC 20
}
if {($newB != $v(b)) || ($newC != $v(c))} {
- $c move box2 [expr 10*($v(b)-$newB)] [expr 10*($v(c)-$newC)]
+ $c move box2 [expr {10*($v(b)-$newB)}] [expr {10*($v(c)-$newC)}]
set v(b) $newB
set v(c) $newC
}
@@ -224,7 +225,7 @@ proc arrowMove2 {c x y} {
proc arrowMove3 {c x y} {
upvar #0 demo_arrowInfo v
- set newWidth [expr ($v(y)+2-round([$c canvasy $y]))/5]
+ set newWidth [expr {($v(y)+2-round([$c canvasy $y]))/5}]
if {$newWidth < 0} {
set newWidth 0
}
@@ -232,8 +233,7 @@ proc arrowMove3 {c x y} {
set newWidth 20
}
if {$newWidth != $v(width)} {
- $c move box3 0 [expr 5*($v(width)-$newWidth)]
+ $c move box3 0 [expr {5*($v(width)-$newWidth)}]
set v(width) $newWidth
}
}
-
diff --git a/tk/library/demos/bind.tcl b/tk/library/demos/bind.tcl
index a55cb00d367..c2b2a2eb462 100644
--- a/tk/library/demos/bind.tcl
+++ b/tk/library/demos/bind.tcl
@@ -77,4 +77,3 @@ $w.text tag bind d6 <1> {source [file join $tk_library demos cscroll.tcl]}
$w.text mark set insert 0.0
$w.text configure -state disabled
-
diff --git a/tk/library/demos/bitmap.tcl b/tk/library/demos/bitmap.tcl
index 5345b69ca05..e69187eb40d 100644
--- a/tk/library/demos/bitmap.tcl
+++ b/tk/library/demos/bitmap.tcl
@@ -53,4 +53,3 @@ frame $w.frame
bitmapRow $w.frame.0 error gray12 gray25 gray50 gray75
bitmapRow $w.frame.1 hourglass info question questhead warning
pack $w.frame -side top -expand yes -fill both
-
diff --git a/tk/library/demos/browse b/tk/library/demos/browse
index af553105baf..3ec0366d588 100755
--- a/tk/library/demos/browse
+++ b/tk/library/demos/browse
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# browse --
# This script generates a directory browser, which lists the working
@@ -24,29 +24,35 @@ wm minsize . 1 1
# the file is a regular file then the Mx editor is invoked to display
# the file.
+set browseScript [file join [pwd] $argv0]
proc browse {dir file} {
- global env
+ global env browseScript
if {[string compare $dir "."] != 0} {set file $dir/$file}
- if [file isdirectory $file] {
- exec browse $file &
- } else {
- if [file isfile $file] {
- if [info exists env(EDITOR)] {
+ switch [file type $file] {
+ directory {
+ exec [info nameofexecutable] $browseScript $file &
+ }
+ file {
+ if {[info exists env(EDITOR)]} {
eval exec $env(EDITOR) $file &
} else {
exec xedit $file &
}
- } else {
+ }
+ default {
puts stdout "\"$file\" isn't a directory or regular file"
}
}
}
-# Fill the listbox with a list of all the files in the directory (run
-# the "ls" command to get that information).
+# Fill the listbox with a list of all the files in the directory.
-if $argc>0 {set dir [lindex $argv 0]} else {set dir "."}
-foreach i [exec ls -a $dir] {
+if {$argc>0} {set dir [lindex $argv 0]} else {set dir "."}
+foreach i [lsort [glob * .* *.*]] {
+ if {[file type $i] eq "directory"} {
+ # Safe to do since it is still a directory.
+ append i /
+ }
.list insert end $i
}
@@ -55,3 +61,6 @@ foreach i [exec ls -a $dir] {
bind all <Control-c> {destroy .}
bind .list <Double-Button-1> {foreach i [selection get] {browse $dir $i}}
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tk/library/demos/button.tcl b/tk/library/demos/button.tcl
index 651706db8d2..fe00a1c99cb 100644
--- a/tk/library/demos/button.tcl
+++ b/tk/library/demos/button.tcl
@@ -34,4 +34,3 @@ button $w.b3 -text "Sea Green" -width 10 \
button $w.b4 -text "Yellow" -width 10 \
-command "$w config -bg Yellow1; $w.buttons config -bg Yellow1"
pack $w.b1 $w.b2 $w.b3 $w.b4 -side top -expand yes -pady 2
-
diff --git a/tk/library/demos/check.tcl b/tk/library/demos/check.tcl
index 000ef61ae84..f863b5796c7 100644
--- a/tk/library/demos/check.tcl
+++ b/tk/library/demos/check.tcl
@@ -31,4 +31,3 @@ checkbutton $w.b1 -text "Wipers OK" -variable wipers -relief flat
checkbutton $w.b2 -text "Brakes OK" -variable brakes -relief flat
checkbutton $w.b3 -text "Driver Sober" -variable sober -relief flat
pack $w.b1 $w.b2 $w.b3 -side top -pady 2 -anchor w
-
diff --git a/tk/library/demos/clrpick.tcl b/tk/library/demos/clrpick.tcl
index fc09ae44044..983cbe1deb4 100644
--- a/tk/library/demos/clrpick.tcl
+++ b/tk/library/demos/clrpick.tcl
@@ -38,7 +38,7 @@ proc setColor {w button name options} {
set initialColor [$button cget -$name]
set color [tk_chooseColor -title "Choose a $name color" -parent $w \
-initialcolor $initialColor]
- if [string compare $color ""] {
+ if {[string compare $color ""]} {
setColor_helper $w $options $color
}
grab release $w
@@ -54,4 +54,3 @@ proc setColor_helper {w options color} {
setColor_helper $child $options $color
}
}
-
diff --git a/tk/library/demos/colors.tcl b/tk/library/demos/colors.tcl
index 9d95ed890a5..aad1d1dde45 100644
--- a/tk/library/demos/colors.tcl
+++ b/tk/library/demos/colors.tcl
@@ -99,4 +99,3 @@ $w.frame.list insert 0 gray60 gray70 gray80 gray85 gray90 gray95 \
purple2 purple3 purple4 MediumPurple1 MediumPurple2 \
MediumPurple3 MediumPurple4 thistle1 thistle2 thistle3 \
thistle4
-
diff --git a/tk/library/demos/cscroll.tcl b/tk/library/demos/cscroll.tcl
index 5897dcb26cd..aeabc181662 100644
--- a/tk/library/demos/cscroll.tcl
+++ b/tk/library/demos/cscroll.tcl
@@ -48,9 +48,9 @@ set bg [lindex [$c config -bg] 4]
for {set i 0} {$i < 20} {incr i} {
set x [expr {-10 + 3*$i}]
for {set j 0; set y -10} {$j < 10} {incr j; incr y 3} {
- $c create rect ${x}c ${y}c [expr $x+2]c [expr $y+2]c \
+ $c create rect ${x}c ${y}c [expr {$x+2}]c [expr {$y+2}]c \
-outline black -fill $bg -tags rect
- $c create text [expr $x+1]c [expr $y+1]c -text "$i,$j" \
+ $c create text [expr {$x+1}]c [expr {$y+1}]c -text "$i,$j" \
-anchor center -tags text
}
}
@@ -65,14 +65,14 @@ proc scrollEnter canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] >= 0} {
- set id [expr $id-1]
+ set id [expr {$id-1}]
}
set oldFill [lindex [$canvas itemconfig $id -fill] 4]
if {[winfo depth $canvas] > 1} {
$canvas itemconfigure $id -fill SeaGreen1
} else {
$canvas itemconfigure $id -fill black
- $canvas itemconfigure [expr $id+1] -fill white
+ $canvas itemconfigure [expr {$id+1}] -fill white
}
}
@@ -80,18 +80,17 @@ proc scrollLeave canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] >= 0} {
- set id [expr $id-1]
+ set id [expr {$id-1}]
}
$canvas itemconfigure $id -fill $oldFill
- $canvas itemconfigure [expr $id+1] -fill black
+ $canvas itemconfigure [expr {$id+1}] -fill black
}
proc scrollButton canvas {
global oldFill
set id [$canvas find withtag current]
if {[lsearch [$canvas gettags current] text] < 0} {
- set id [expr $id+1]
+ set id [expr {$id+1}]
}
puts stdout "You buttoned at [lindex [$canvas itemconf $id -text] 4]"
}
-
diff --git a/tk/library/demos/ctext.tcl b/tk/library/demos/ctext.tcl
index 83eac45e611..d5efcc3da23 100644
--- a/tk/library/demos/ctext.tcl
+++ b/tk/library/demos/ctext.tcl
@@ -58,7 +58,7 @@ $c bind text <2> "textPaste $c @%x,%y"
# to be edited.
proc mkTextConfig {w x y option value color} {
- set item [$w create rect [expr $x] [expr $y] [expr $x+30] [expr $y+30] \
+ set item [$w create rect $x $y [expr {$x+30}] [expr {$y+30}] \
-outline black -fill $color -width 1]
$w bind $item <1> "$w itemconf text $option $value"
$w addtag config withtag $item
@@ -68,19 +68,20 @@ set x 50
set y 50
set color LightSkyBlue1
mkTextConfig $c $x $y -anchor se $color
-mkTextConfig $c [expr $x+30] [expr $y] -anchor s $color
-mkTextConfig $c [expr $x+60] [expr $y] -anchor sw $color
-mkTextConfig $c [expr $x] [expr $y+30] -anchor e $color
-mkTextConfig $c [expr $x+30] [expr $y+30] -anchor center $color
-mkTextConfig $c [expr $x+60] [expr $y+30] -anchor w $color
-mkTextConfig $c [expr $x] [expr $y+60] -anchor ne $color
-mkTextConfig $c [expr $x+30] [expr $y+60] -anchor n $color
-mkTextConfig $c [expr $x+60] [expr $y+60] -anchor nw $color
-set item [$c create rect [expr $x+40] [expr $y+40] [expr $x+50] [expr $y+50] \
+mkTextConfig $c [expr {$x+30}] [expr {$y }] -anchor s $color
+mkTextConfig $c [expr {$x+60}] [expr {$y }] -anchor sw $color
+mkTextConfig $c [expr {$x }] [expr {$y+30}] -anchor e $color
+mkTextConfig $c [expr {$x+30}] [expr {$y+30}] -anchor center $color
+mkTextConfig $c [expr {$x+60}] [expr {$y+30}] -anchor w $color
+mkTextConfig $c [expr {$x }] [expr {$y+60}] -anchor ne $color
+mkTextConfig $c [expr {$x+30}] [expr {$y+60}] -anchor n $color
+mkTextConfig $c [expr {$x+60}] [expr {$y+60}] -anchor nw $color
+set item [$c create rect \
+ [expr {$x+40}] [expr {$y+40}] [expr {$x+50}] [expr {$y+50}] \
-outline black -fill red]
$c bind $item <1> "$c itemconf text -anchor center"
-$c create text [expr $x+45] [expr $y-5] -text {Text Position} -anchor s \
- -font {Times 24} -fill brown
+$c create text [expr {$x+45}] [expr {$y-5}] \
+ -text {Text Position} -anchor s -font {Times 24} -fill brown
# Lastly, create some items that allow the text's justification to be
# changed.
@@ -89,10 +90,10 @@ set x 350
set y 50
set color SeaGreen2
mkTextConfig $c $x $y -justify left $color
-mkTextConfig $c [expr $x+30] [expr $y] -justify center $color
-mkTextConfig $c [expr $x+60] [expr $y] -justify right $color
-$c create text [expr $x+45] [expr $y-5] -text {Justification} -anchor s \
- -font {Times 24} -fill brown
+mkTextConfig $c [expr {$x+30}] $y -justify center $color
+mkTextConfig $c [expr {$x+60}] $y -justify right $color
+$c create text [expr {$x+45}] [expr {$y-5}] \
+ -text {Justification} -anchor s -font {Times 24} -fill brown
$c bind config <Enter> "textEnter $c"
$c bind config <Leave> "$c itemconf current -fill \$textConfigFill"
@@ -131,7 +132,7 @@ proc textB1Move {w x y} {
}
proc textBs {w} {
- if ![catch {$w dchars text sel.first sel.last}] {
+ if {![catch {$w dchars text sel.first sel.last}]} {
return
}
set char [expr {[$w index text insert] - 1}]
@@ -139,9 +140,8 @@ proc textBs {w} {
}
proc textDel {w} {
- if ![catch {$w dchars text sel.first sel.last}] {
+ if {![catch {$w dchars text sel.first sel.last}]} {
return
}
$w dchars text insert
}
-
diff --git a/tk/library/demos/dialog1.tcl b/tk/library/demos/dialog1.tcl
index 63f97fef750..0a1b48d4974 100644
--- a/tk/library/demos/dialog1.tcl
+++ b/tk/library/demos/dialog1.tcl
@@ -13,4 +13,3 @@ switch $i {
1 {puts "You pressed Cancel"}
2 {showCode .dialog1}
}
-
diff --git a/tk/library/demos/dialog2.tcl b/tk/library/demos/dialog2.tcl
index 6451c8dff45..bc074455b21 100644
--- a/tk/library/demos/dialog2.tcl
+++ b/tk/library/demos/dialog2.tcl
@@ -10,11 +10,10 @@ after idle {
after 100 {
grab -global .dialog2
}
-set i [tk_dialog .dialog2 "Dialog with local grab" {This dialog box uses a global grab, so it prevents you from interacting with anything on your display until you invoke one of the buttons below. Global grabs are almost always a bad idea; don't use them unless you're truly desperate.} warning 0 OK Cancel {Show Code}]
+set i [tk_dialog .dialog2 "Dialog with global grab" {This dialog box uses a global grab, so it prevents you from interacting with anything on your display until you invoke one of the buttons below. Global grabs are almost always a bad idea; don't use them unless you're truly desperate.} warning 0 OK Cancel {Show Code}]
switch $i {
0 {puts "You pressed OK"}
1 {puts "You pressed Cancel"}
2 {showCode .dialog2}
}
-
diff --git a/tk/library/demos/entry1.tcl b/tk/library/demos/entry1.tcl
index 35d776c97b2..062eb45f489 100644
--- a/tk/library/demos/entry1.tcl
+++ b/tk/library/demos/entry1.tcl
@@ -34,4 +34,3 @@ $w.e1 insert 0 "Initial value"
$w.e2 insert end "This entry contains a long value, much too long "
$w.e2 insert end "to fit in the window at one time, so long in fact "
$w.e2 insert end "that you'll have to scan or scroll to see the end."
-
diff --git a/tk/library/demos/entry2.tcl b/tk/library/demos/entry2.tcl
index cf5c16c6c6d..87a91cb34d7 100644
--- a/tk/library/demos/entry2.tcl
+++ b/tk/library/demos/entry2.tcl
@@ -46,4 +46,3 @@ $w.frame.e1 insert 0 "Initial value"
$w.frame.e2 insert end "This entry contains a long value, much too long "
$w.frame.e2 insert end "to fit in the window at one time, so long in fact "
$w.frame.e2 insert end "that you'll have to scan or scroll to see the end."
-
diff --git a/tk/library/demos/entry3.tcl b/tk/library/demos/entry3.tcl
new file mode 100644
index 00000000000..54ad80fd1a6
--- /dev/null
+++ b/tk/library/demos/entry3.tcl
@@ -0,0 +1,187 @@
+# entry2.tcl --
+#
+# This demonstration script creates several entry widgets whose
+# permitted input is constrained in some way. It also shows off a
+# password entry.
+#
+# RCS: @(#) $Id$
+
+if {![info exists widgetDemo]} {
+ error "This script should be run from the \"widget\" demo."
+}
+
+set w .entry3
+catch {destroy $w}
+toplevel $w
+wm title $w "Constrained Entry Demonstration"
+wm iconname $w "entry3"
+positionWindow $w
+
+
+label $w.msg -font $font -wraplength 5i -justify left -text "Four different\
+ entries are displayed below. You can add characters by pointing,\
+ clicking and typing, though each is constrained in what it will\
+ accept. The first only accepts integers or the empty string\
+ (checking when focus leaves it) and will flash to indicate any\
+ problem. The second only accepts strings with fewer than ten\
+ characters and sounds the bell when an attempt to go over the limit\
+ is made. The third accepts US phone numbers, mapping letters to\
+ their digit equivalent and sounding the bell on encountering an\
+ illegal character or if trying to type over a character that is not\
+ a digit. The fourth is a password field that accepts up to eight\
+ characters (silently ignoring further ones), and displaying them as\
+ asterisk characters."
+
+frame $w.buttons
+button $w.buttons.dismiss -text Dismiss -command "destroy $w"
+button $w.buttons.code -text "See Code" -command "showCode $w"
+pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
+
+
+# focusAndFlash --
+# Error handler for entry widgets that forces the focus onto the
+# widget and makes the widget flash by exchanging the foreground and
+# background colours at intervals of 200ms (i.e. at approximately
+# 2.5Hz).
+#
+# Arguments:
+# W - Name of entry widget to flash
+# fg - Initial foreground colour
+# bg - Initial background colour
+# count - Counter to control the number of times flashed
+
+proc focusAndFlash {W fg bg {count 9}} {
+ focus -force $W
+ if {$count<1} {
+ $W configure -foreground $fg -background $bg
+ } else {
+ if {$count%2} {
+ $W configure -foreground $bg -background $fg
+ } else {
+ $W configure -foreground $fg -background $bg
+ }
+ after 200 [list focusAndFlash $W $fg $bg [expr {$count-1}]]
+ }
+}
+
+labelframe $w.l1 -text "Integer Entry"
+entry $w.l1.e -validate focus -vcmd {string is integer %P}
+$w.l1.e configure -invalidcommand \
+ "focusAndFlash %W [$w.l1.e cget -fg] [$w.l1.e cget -bg]"
+pack $w.l1.e -fill x -expand 1 -padx 1m -pady 1m
+
+labelframe $w.l2 -text "Length-Constrained Entry"
+entry $w.l2.e -validate key -invcmd bell -vcmd {expr {[string length %P]<10}}
+pack $w.l2.e -fill x -expand 1 -padx 1m -pady 1m
+
+### PHONE NUMBER ENTRY ###
+# Note that the source to this is quite a bit longer as the behaviour
+# demonstrated is a lot more ambitious than with the others.
+
+# Initial content for the third entry widget
+set entry3content "1-(000)-000-0000"
+# Mapping from alphabetic characters to numbers. This is probably
+# wrong, but it is the only mapping I have; the UK doesn't really go
+# for associating letters with digits for some reason.
+set phoneNumberMap {}
+foreach {chars digit} {abc 2 def 3 ghi 4 jkl 5 mno 6 pqrs 7 tuv 8 wxyz 9} {
+ foreach char [split $chars ""] {
+ lappend phoneNumberMap $char $digit [string toupper $char] $digit
+ }
+}
+
+# validatePhoneChange --
+# Checks that the replacement (mapped to a digit) of the given
+# character in an entry widget at the given position will leave a
+# valid phone number in the widget.
+#
+# W - The entry widget to validate
+# vmode - The widget's validation mode
+# idx - The index where replacement is to occur
+# char - The character (or string, though that will always be
+# refused) to be overwritten at that point.
+
+proc validatePhoneChange {W vmode idx char} {
+ global phoneNumberMap entry3content
+ if {$idx == -1} {return 1}
+ after idle [list $W configure -validate $vmode -invcmd bell]
+ if {
+ !($idx<3 || $idx==6 || $idx==7 || $idx==11 || $idx>15) &&
+ [string match {[0-9A-Za-z]} $char]
+ } then {
+ $W delete $idx
+ $W insert $idx [string map $phoneNumberMap $char]
+ after idle [list phoneSkipRight $W -1]
+ return 1
+ }
+ return 0
+}
+
+# phoneSkipLeft --
+# Skip over fixed characters in a phone-number string when moving left.
+#
+# Arguments:
+# W - The entry widget containing the phone-number.
+
+proc phoneSkipLeft {W} {
+ set idx [$W index insert]
+ if {$idx == 8} {
+ # Skip back two extra characters
+ $W icursor [incr idx -2]
+ } elseif {$idx == 7 || $idx == 12} {
+ # Skip back one extra character
+ $W icursor [incr idx -1]
+ } elseif {$idx <= 3} {
+ # Can't move any further
+ bell
+ return -code break
+ }
+}
+
+# phoneSkipRight --
+# Skip over fixed characters in a phone-number string when moving right.
+#
+# Arguments:
+# W - The entry widget containing the phone-number.
+# add - Offset to add to index before calculation (used by validation.)
+
+proc phoneSkipRight {W {add 0}} {
+ set idx [$W index insert]
+ if {$idx+$add == 5} {
+ # Skip forward two extra characters
+ $W icursor [incr idx 2]
+ } elseif {$idx+$add == 6 || $idx+$add == 10} {
+ # Skip forward one extra character
+ $W icursor [incr idx]
+ } elseif {$idx+$add == 15 && !$add} {
+ # Can't move any further
+ bell
+ return -code break
+ }
+}
+
+labelframe $w.l3 -text "US Phone-Number Entry"
+entry $w.l3.e -validate key -invcmd bell -textvariable entry3content \
+ -vcmd {validatePhoneChange %W %v %i %S}
+# Click to focus goes to the first editable character...
+bind $w.l3.e <FocusIn> {
+ if {"%d" ne "NotifyAncestor"} {
+ %W icursor 3
+ after idle {%W selection clear}
+ }
+}
+bind $w.l3.e <Left> {phoneSkipLeft %W}
+bind $w.l3.e <Right> {phoneSkipRight %W}
+pack $w.l3.e -fill x -expand 1 -padx 1m -pady 1m
+
+labelframe $w.l4 -text "Password Entry"
+entry $w.l4.e -validate key -show "*" -vcmd {expr {[string length %P]<=8}}
+pack $w.l4.e -fill x -expand 1 -padx 1m -pady 1m
+
+lower [frame $w.mid]
+grid $w.l1 $w.l2 -in $w.mid -padx 3m -pady 1m -sticky ew
+grid $w.l3 $w.l4 -in $w.mid -padx 3m -pady 1m -sticky ew
+grid columnconfigure $w.mid {0 1} -uniform 1
+pack $w.msg -side top
+pack $w.buttons -side bottom -fill x -pady 2m
+pack $w.mid -fill both -expand 1
diff --git a/tk/library/demos/filebox.tcl b/tk/library/demos/filebox.tcl
index fdfff8aa061..a0c32a585b7 100644
--- a/tk/library/demos/filebox.tcl
+++ b/tk/library/demos/filebox.tcl
@@ -35,7 +35,7 @@ foreach i {open save} {
pack $f -fill x -padx 1c -pady 3
}
-if ![string compare $tcl_platform(platform) unix] {
+if {![string compare $tcl_platform(platform) unix]} {
checkbutton $w.strict -text "Use Motif Style Dialog" \
-variable tk_strictMotif -onvalue 1 -offvalue 0
pack $w.strict -anchor c
@@ -62,10 +62,9 @@ proc fileDialog {w ent operation} {
set file [tk_getSaveFile -filetypes $types -parent $w \
-initialfile Untitled -defaultextension .txt]
}
- if [string compare $file ""] {
+ if {[string compare $file ""]} {
$ent delete 0 end
$ent insert 0 $file
$ent xview end
}
}
-
diff --git a/tk/library/demos/floor.tcl b/tk/library/demos/floor.tcl
index 6c62d3a4aad..d488eacea17 100644
--- a/tk/library/demos/floor.tcl
+++ b/tk/library/demos/floor.tcl
@@ -94,7 +94,7 @@ proc newRoom w {
proc roomChanged {w args} {
global currentRoom floorItems colors
$w delete highlight
- if [catch {set item $floorItems($currentRoom)}] {
+ if {[catch {set item $floorItems($currentRoom)}]} {
return
}
set new [eval \
@@ -1368,4 +1368,3 @@ bind $c <B2-Motion> "$c scan dragto %x %y"
bind $c <Destroy> "unset currentRoom"
set currentRoom ""
trace variable currentRoom w "roomChanged $c"
-
diff --git a/tk/library/demos/form.tcl b/tk/library/demos/form.tcl
index f50c06d3e17..082cbf3d31f 100644
--- a/tk/library/demos/form.tcl
+++ b/tk/library/demos/form.tcl
@@ -38,4 +38,3 @@ $w.f5.label config -text Phone:
pack $w.msg $w.f1 $w.f2 $w.f3 $w.f4 $w.f5 -side top -fill x
bind $w <Return> "destroy $w"
focus $w.f1.entry
-
diff --git a/tk/library/demos/hello b/tk/library/demos/hello
index ec8b798cd2d..b163175fb93 100755
--- a/tk/library/demos/hello
+++ b/tk/library/demos/hello
@@ -17,3 +17,6 @@ button .hello -text "Hello, world" -command {
}
pack .hello
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tk/library/demos/hscale.tcl b/tk/library/demos/hscale.tcl
index 13bf81c70ff..25ae7794a4d 100644
--- a/tk/library/demos/hscale.tcl
+++ b/tk/library/demos/hscale.tcl
@@ -38,11 +38,10 @@ $w.frame.scale set 75
proc setWidth {w width} {
incr width 21
- set x2 [expr $width - 30]
+ set x2 [expr {$width - 30}]
if {$x2 < 21} {
set x2 21
}
$w coords poly 20 15 20 35 $x2 35 $x2 45 $width 25 $x2 5 $x2 15 20 15
$w coords line 20 15 20 35 $x2 35 $x2 45 $width 25 $x2 5 $x2 15 20 15
}
-
diff --git a/tk/library/demos/icon.tcl b/tk/library/demos/icon.tcl
index fece907b5a6..06cdc1fd63a 100644
--- a/tk/library/demos/icon.tcl
+++ b/tk/library/demos/icon.tcl
@@ -50,4 +50,3 @@ radiobutton $w.frame.left.b4 \
-bitmap @[file join $tk_library demos images noletter.bmp] \
-variable letters -value empty
pack $w.frame.left.b3 $w.frame.left.b4 -side top -expand yes
-
diff --git a/tk/library/demos/image1.tcl b/tk/library/demos/image1.tcl
index 30391f61b3e..820c9c1f10e 100644
--- a/tk/library/demos/image1.tcl
+++ b/tk/library/demos/image1.tcl
@@ -34,4 +34,3 @@ image create photo image1b \
label $w.l2 -image image1b -bd 1 -relief sunken
pack $w.l1 $w.l2 -side top -padx .5m -pady .5m
-
diff --git a/tk/library/demos/image2.tcl b/tk/library/demos/image2.tcl
index 827753cde2a..226202461d7 100644
--- a/tk/library/demos/image2.tcl
+++ b/tk/library/demos/image2.tcl
@@ -20,11 +20,28 @@ proc loadDir w {
global dirName
$w.f.list delete 0 end
- foreach i [lsort [glob [file join $dirName *]]] {
+ foreach i [lsort [glob -directory $dirName *]] {
$w.f.list insert end [file tail $i]
}
}
+# selectAndLoadDir --
+# This procedure pops up a dialog to ask for a directory to load into
+# the listobx and (if the user presses OK) reloads the directory
+# listbox from the directory named in the demo's entry.
+#
+# Arguments:
+# w - Name of the toplevel window of the demo.
+
+proc selectAndLoadDir w {
+ global dirName
+ set dir [tk_chooseDirectory -initialdir $dirName -parent $w -mustexist 1]
+ if {[string length $dir] != 0} {
+ set dirName $dir
+ loadDir $w
+ }
+}
+
# loadImage --
# Given the name of the toplevel window of the demo and the mouse
# position, extracts the directory entry under the mouse and loads
@@ -57,14 +74,18 @@ button $w.buttons.dismiss -text Dismiss -command "destroy $w"
button $w.buttons.code -text "See Code" -command "showCode $w"
pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
-label $w.dirLabel -text "Directory:"
+frame $w.mid
+pack $w.mid -fill both -expand 1
+
+labelframe $w.dir -text "Directory:"
set dirName [file join $tk_library demos images]
-entry $w.dirName -width 30 -textvariable dirName
-bind $w.dirName <Return> "loadDir $w"
-frame $w.spacer1 -height 3m -width 20
-label $w.fileLabel -text "File:"
-frame $w.f
-pack $w.dirLabel $w.dirName $w.spacer1 $w.fileLabel $w.f -side top -anchor w
+entry $w.dir.e -width 30 -textvariable dirName
+button $w.dir.b -pady 0 -padx 2m -text "Select Dir." \
+ -command "selectAndLoadDir $w"
+bind $w.dir.e <Return> "loadDir $w"
+pack $w.dir.e -side left -fill both -padx 2m -pady 2m -expand true
+pack $w.dir.b -side left -fill y -padx {0 2m} -pady 2m
+labelframe $w.f -text "File:" -padx 2m -pady 2m
listbox $w.f.list -width 20 -height 10 -yscrollcommand "$w.f.scroll set"
scrollbar $w.f.scroll -command "$w.f.list yview"
@@ -74,8 +95,10 @@ bind $w.f.list <Double-1> "loadImage $w %x %y"
catch {image delete image2a}
image create photo image2a
-frame $w.spacer2 -height 3m -width 20
-label $w.imageLabel -text "Image:"
-label $w.image -image image2a
-pack $w.spacer2 $w.imageLabel $w.image -side top -anchor w
+labelframe $w.image -text "Image:"
+label $w.image.image -image image2a
+pack $w.image.image -padx 2m -pady 2m
+grid $w.dir - -sticky ew -padx 1m -pady 1m -in $w.mid
+grid $w.f $w.image -sticky nw -padx 1m -pady 1m -in $w.mid
+grid columnconfigure $w.mid 1 -weight 1
diff --git a/tk/library/demos/items.tcl b/tk/library/demos/items.tcl
index 0f3ffde2eeb..fea5e8b1a5e 100644
--- a/tk/library/demos/items.tcl
+++ b/tk/library/demos/items.tcl
@@ -271,7 +271,7 @@ proc itemDrag {c x y} {
global lastX lastY
set x [$c canvasx $x]
set y [$c canvasy $y]
- $c move current [expr $x-$lastX] [expr $y-$lastY]
+ $c move current [expr {$x-$lastX}] [expr {$y-$lastY}]
set lastX $x
set lastY $y
}
@@ -283,4 +283,3 @@ proc butPress {w color} {
set i [$w create text 25c 18.1c -text "Ouch!!" -fill $color -anchor n]
after 500 "$w delete $i"
}
-
diff --git a/tk/library/demos/ixset b/tk/library/demos/ixset
index 1e4716c2524..76319cc0bb6 100755
--- a/tk/library/demos/ixset
+++ b/tk/library/demos/ixset
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# ixset --
# A nice interface to "xset" to change X server settings
@@ -27,10 +27,15 @@ proc ok {} {
proc cancel {} {
readsettings
dispsettings
+ .buttons.apply configure -state disabled
+ .buttons.cancel configure -state disabled
}
-# apply is just "writesettings"
-
+proc apply {} {
+ writesettings
+ .buttons.apply configure -state disabled
+ .buttons.cancel configure -state disabled
+}
#
# Read current settings
@@ -120,8 +125,8 @@ proc writesettings {} {
set mouseacc [.mouse.hor.acc.entry get]
set mousethr [.mouse.hor.thr.entry get]
- set screentim [.screen.val.le.tim.entry get]
- set screencyc [.screen.val.le.cyc.entry get]
+ set screentim [.screen.tim.entry get]
+ set screencyc [.screen.cyc.entry get]
exec xset \
b $bellvol $bellpit $belldur \
@@ -155,12 +160,12 @@ proc dispsettings {} {
.mouse.hor.thr.entry delete 0 end
.mouse.hor.thr.entry insert 0 $mousethr
- .screen.val.rb.blank [expr "{$screenbla}=={blank} ? {select} : {deselect}"]
- .screen.val.rb.pat [expr "{$screenbla}!={blank} ? {select} : {deselect}"]
- .screen.val.le.tim.entry delete 0 end
- .screen.val.le.tim.entry insert 0 $screentim
- .screen.val.le.cyc.entry delete 0 end
- .screen.val.le.cyc.entry insert 0 $screencyc
+ .screen.blank [expr "{$screenbla}=={blank} ? {select} : {deselect}"]
+ .screen.pat [expr "{$screenbla}!={blank} ? {select} : {deselect}"]
+ .screen.tim.entry delete 0 end
+ .screen.tim.entry insert 0 $screentim
+ .screen.cyc.entry delete 0 end
+ .screen.cyc.entry insert 0 $screencyc
}
@@ -168,12 +173,17 @@ proc dispsettings {} {
# Create all windows, and pack them
#
-proc labelentry {path text length} {
+proc labelentry {path text length {range {}}} {
frame $path
label $path.label -text $text
- entry $path.entry -width $length -relief sunken
- pack $path.label -side left -expand y
- pack $path.entry -side right -expand y
+ if {[llength $range]} {
+ spinbox $path.entry -width $length -relief sunken \
+ -from [lindex $range 0] -to [lindex $range 1]
+ } else {
+ entry $path.entry -width $length -relief sunken
+ }
+ pack $path.label -side left
+ pack $path.entry -side right -expand y -fill x
}
proc createwindows {} {
@@ -182,38 +192,57 @@ proc createwindows {} {
#
frame .buttons
- button .buttons.ok -command "ok" -text "Ok"
- button .buttons.apply -command "writesettings" -text "Apply"
- button .buttons.cancel -command "cancel" -text "Cancel"
- button .buttons.quit -command "quit" -text "Quit"
+ button .buttons.ok -default active -command ok -text "Ok"
+ button .buttons.apply -default normal -command apply -text "Apply" \
+ -state disabled
+ button .buttons.cancel -default normal -command cancel -text "Cancel" \
+ -state disabled
+ button .buttons.quit -default normal -command quit -text "Quit"
pack .buttons.ok .buttons.apply .buttons.cancel .buttons.quit \
-side left -expand yes -pady 5
+ bind . <Return> {.buttons.ok flash; .buttons.ok invoke}
+ bind . <Escape> {.buttons.quit flash; .buttons.quit invoke}
+ bind . <1> {
+ if {![string match .buttons* %W]} {
+ .buttons.apply configure -state normal
+ .buttons.cancel configure -state normal
+ }
+ }
+ bind . <Key> {
+ if {![string match .buttons* %W]} {
+ switch -glob %K {
+ Return - Escape - Tab - *Shift* {}
+ default {
+ .buttons.apply configure -state normal
+ .buttons.cancel configure -state normal
+ }
+ }
+ }
+ }
+
#
# Bell settings
#
- frame .bell -relief raised -borderwidth 2
- label .bell.label -text "Bell Settings"
+ labelframe .bell -text "Bell Settings" -padx 1.5m -pady 1.5m
scale .bell.vol \
-from 0 -to 100 -length 200 -tickinterval 20 \
-label "Volume (%)" -orient horizontal
frame .bell.val
- labelentry .bell.val.pit "Pitch (Hz)" 6
- labelentry .bell.val.dur "Duration (ms)" 6
+ labelentry .bell.val.pit "Pitch (Hz)" 6 {25 20000}
+ labelentry .bell.val.dur "Duration (ms)" 6 {1 10000}
pack .bell.val.pit -side left -padx 5
pack .bell.val.dur -side right -padx 5
- pack .bell.label .bell.vol .bell.val -side top -expand yes
+ pack .bell.vol .bell.val -side top -expand yes
#
# Keyboard settings
#
- frame .kbd -relief raised -borderwidth 2
-
- label .kbd.label -text "Keyboard Repeat Settings"
+ labelframe .kbd -text "Keyboard Repeat Settings" -padx 1.5m -pady 1.5m
frame .kbd.val
checkbutton .kbd.val.onoff \
@@ -223,62 +252,52 @@ proc createwindows {} {
scale .kbd.val.cli \
-from 0 -to 100 -length 200 -tickinterval 20 \
-label "Click Volume (%)" -orient horizontal
- pack .kbd.val.onoff -side left -expand yes -fill both
- pack .kbd.val.cli -side left -expand yes
+ pack .kbd.val.onoff -side left -fill x -expand yes -padx {0 1m}
+ pack .kbd.val.cli -side left -expand yes -fill x -padx {1m 0}
- pack .kbd.label -side top -expand yes
pack .kbd.val -side top -expand yes -pady 2 -fill x
#
# Mouse settings
#
- frame .mouse -relief raised -borderwidth 2
+ labelframe .mouse -text "Mouse Settings" -padx 1.5m -pady 1.5m
- label .mouse.label -text "Mouse Settings"
frame .mouse.hor
- labelentry .mouse.hor.acc "Acceleration" 3
- labelentry .mouse.hor.thr "Threshold (pixels)" 3
+ labelentry .mouse.hor.acc "Acceleration" 5
+ labelentry .mouse.hor.thr "Threshold (pixels)" 3 {1 2000}
- pack .mouse.hor.acc -side left
- pack .mouse.hor.thr -side right
+ pack .mouse.hor.acc -side left -padx {0 1m}
+ pack .mouse.hor.thr -side right -padx {1m 0}
- pack .mouse.label -side top
pack .mouse.hor -side top -expand yes
#
# Screen Saver settings
#
- frame .screen -relief raised -borderwidth 2
-
- label .screen.label -text "Screen-saver Settings"
- frame .screen.val
+ labelframe .screen -text "Screen-saver Settings" -padx 1.5m -pady 1.5m
- frame .screen.val.rb
- radiobutton .screen.val.rb.blank \
+ radiobutton .screen.blank \
-variable screenblank -text "Blank" -relief flat \
- -value "blank" -variable screenbla
- radiobutton .screen.val.rb.pat \
+ -value "blank" -variable screenbla -anchor w
+ radiobutton .screen.pat \
-variable screenblank -text "Pattern" -relief flat \
- -value "noblank" -variable screenbla
- pack .screen.val.rb.blank .screen.val.rb.pat -side top -pady 2 -anchor w
- frame .screen.val.le
- labelentry .screen.val.le.tim "Timeout (s)" 5
- labelentry .screen.val.le.cyc "Cycle (s)" 5
- pack .screen.val.le.tim .screen.val.le.cyc -side top -pady 2 -anchor e
-
- pack .screen.val.rb .screen.val.le -side left
+ -value "noblank" -variable screenbla -anchor w
+ labelentry .screen.tim "Timeout (s)" 5 {1 100000}
+ labelentry .screen.cyc "Cycle (s)" 5 {1 100000}
- pack .screen.label -side top
- pack .screen.val -side top -expand y
+ grid .screen.blank .screen.tim -sticky e
+ grid .screen.pat .screen.cyc -sticky e
+ grid configure .screen.blank .screen.pat -sticky ew
#
# Main window
#
pack .buttons -side top -fill both
- pack .bell .kbd .mouse .screen -side top -fill both -ipady 5 -expand yes
+ pack .bell .kbd .mouse .screen -side top -fill both -expand yes \
+ -padx 1m -pady 1m
#
# Let the user resize our window
@@ -311,3 +330,6 @@ dispsettings
# Now, wait for user actions...
#
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tk/library/demos/label.tcl b/tk/library/demos/label.tcl
index 63fe44e128a..86ff4d61b5f 100644
--- a/tk/library/demos/label.tcl
+++ b/tk/library/demos/label.tcl
@@ -38,4 +38,3 @@ label $w.right.bitmap -borderwidth 2 -relief sunken \
-bitmap @[file join $tk_library demos images face.bmp]
label $w.right.caption -text "Tcl/Tk Proprietor"
pack $w.right.bitmap $w.right.caption -side top
-
diff --git a/tk/library/demos/labelframe.tcl b/tk/library/demos/labelframe.tcl
new file mode 100644
index 00000000000..7688368025f
--- /dev/null
+++ b/tk/library/demos/labelframe.tcl
@@ -0,0 +1,80 @@
+# labelframe.tcl --
+#
+# This demonstration script creates a toplevel window containing
+# several labelframe widgets.
+#
+# RCS: @(#) $Id$
+
+if {![info exists widgetDemo]} {
+ error "This script should be run from the \"widget\" demo."
+}
+
+set w .labelframe
+catch {destroy $w}
+toplevel $w
+wm title $w "Labelframe Demonstration"
+wm iconname $w "labelframe"
+positionWindow $w
+
+# Some information
+
+label $w.msg -font $font -wraplength 4i -justify left -text "Labelframes are\
+ used to group related widgets together. The label may be either \
+ plain text or another widget."
+pack $w.msg -side top
+
+# The bottom buttons
+
+frame $w.buttons
+pack $w.buttons -side bottom -fill x -pady 2m
+button $w.buttons.dismiss -text Dismiss -command "destroy $w" -width 15
+button $w.buttons.code -text "See Code" -command "showCode $w" -width 15
+pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
+
+# Demo area
+
+frame $w.f
+pack $w.f -side bottom -fill both -expand 1
+set w $w.f
+
+# A group of radiobuttons in a labelframe
+
+labelframe $w.f -text "Value" -padx 2 -pady 2
+grid $w.f -row 0 -column 0 -pady 2m -padx 2m
+
+foreach value {1 2 3 4} {
+ radiobutton $w.f.b$value -text "This is value $value" \
+ -variable lfdummy -value $value
+ pack $w.f.b$value -side top -fill x -pady 2
+}
+
+
+# Using a label window to control a group of options.
+
+proc lfEnableButtons {w} {
+ foreach child [winfo children $w] {
+ if {$child == "$w.cb"} continue
+ if {$::lfdummy2} {
+ $child configure -state normal
+ } else {
+ $child configure -state disabled
+ }
+ }
+}
+
+labelframe $w.f2 -pady 2 -padx 2
+checkbutton $w.f2.cb -text "Use this option." -variable lfdummy2 \
+ -command "lfEnableButtons $w.f2" -padx 0
+$w.f2 configure -labelwidget $w.f2.cb
+grid $w.f2 -row 0 -column 1 -pady 2m -padx 2m
+
+set t 0
+foreach str {Option1 Option2 Option3} {
+ checkbutton $w.f2.b$t -text $str
+ pack $w.f2.b$t -side top -fill x -pady 2
+ incr t
+}
+lfEnableButtons $w.f2
+
+
+grid columnconfigure $w {0 1} -weight 1
diff --git a/tk/library/demos/menu.tcl b/tk/library/demos/menu.tcl
index 9900cd59a1b..9b0f6bb4fe1 100644
--- a/tk/library/demos/menu.tcl
+++ b/tk/library/demos/menu.tcl
@@ -17,7 +17,8 @@ wm iconname $w "menu"
positionWindow $w
label $w.msg -font $font -wraplength 4i -justify left
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
$w.msg configure -text "This window contains a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by dragging outside of its bounds and releasing the mouse."
} else {
$w.msg configure -text "This window contains a menubar with cascaded menus. You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu. You can then traverse among the menus using the arrow keys. When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character. If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu."
@@ -55,7 +56,8 @@ set m $w.menu.basic
$w.menu add cascade -label "Basic" -menu $m -underline 0
menu $m -tearoff 0
$m add command -label "Long entry that does nothing"
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
set modifier Command
} elseif {$tcl_platform(platform) == "windows"} {
set modifier Control
@@ -131,6 +133,12 @@ menu $m -tearoff 0
foreach i {{An entry} {Another entry} {Does nothing} {Does almost nothing} {Make life meaningful}} {
$m add command -label $i -command [list puts "You invoked \"$i\""]
}
+$m entryconfigure "Does almost nothing" \
+ -bitmap questhead -compound left -command {
+ tk_dialog .compound {Compound Menu Entry} {The menu entry you invoked\
+ displays both a bitmap and a text string. Other than this, it\
+ is just like any other menu entry.} {} 0 OK
+}
set m $w.menu.colors
$w.menu add cascade -label "Colors" -menu $m -underline 1
@@ -150,4 +158,3 @@ bind Menu <<MenuSelect>> {
set menustatus $label
update idletasks
}
-
diff --git a/tk/library/demos/menubu.tcl b/tk/library/demos/menubu.tcl
index dc0681e55b3..2f9fea930b0 100644
--- a/tk/library/demos/menubu.tcl
+++ b/tk/library/demos/menubu.tcl
@@ -57,7 +57,8 @@ pack $body.buttons -padx 25 -pady 25
tk_optionMenu $body.buttons.options menubuttonoptions one two three
pack $body.buttons.options -side left -padx 25 -pady 25
set m [tk_optionMenu $body.buttons.colors paletteColor Black red4 DarkGreen NavyBlue gray75 Red Green Blue gray50 Yellow Cyan Magenta White Brown DarkSeaGreen DarkViolet]
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
set topBorderColor Black
set bottomBorderColor Black
} else {
@@ -91,4 +92,3 @@ pack $body.buttons.colors -side left -padx 25 -pady 25
-
diff --git a/tk/library/demos/msgbox.tcl b/tk/library/demos/msgbox.tcl
index 73b7caa512d..bc286c16c50 100644
--- a/tk/library/demos/msgbox.tcl
+++ b/tk/library/demos/msgbox.tcl
@@ -63,4 +63,3 @@ proc showMessageBox {w} {
tk_messageBox -icon info -message "You have selected \"$button\"" -type ok\
-parent $w
}
-
diff --git a/tk/library/demos/paned1.tcl b/tk/library/demos/paned1.tcl
new file mode 100644
index 00000000000..5adc2550c75
--- /dev/null
+++ b/tk/library/demos/paned1.tcl
@@ -0,0 +1,34 @@
+# paned1.tcl --
+#
+# This demonstration script creates a toplevel window containing
+# a paned window that separates two windows horizontally.
+#
+# RCS: @(#) $Id$
+
+if {![info exists widgetDemo]} {
+ error "This script should be run from the \"widget\" demo."
+}
+
+set w .paned1
+catch {destroy $w}
+toplevel $w
+wm title $w "Horizontal Paned Window Demonstration"
+wm iconname $w "paned1"
+positionWindow $w
+
+label $w.msg -font $font -wraplength 4i -justify left -text "The sash between the two coloured windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.)"
+pack $w.msg -side top
+
+frame $w.buttons
+pack $w.buttons -side bottom -fill x -pady 2m
+button $w.buttons.dismiss -text Dismiss -command "destroy $w"
+button $w.buttons.code -text "See Code" -command "showCode $w"
+pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
+
+panedwindow $w.pane
+pack $w.pane -side top -expand yes -fill both -pady 2 -padx 2m
+
+label $w.pane.left -text "This is the\nleft side" -bg yellow
+label $w.pane.right -text "This is the\nright side" -bg cyan
+
+$w.pane add $w.pane.left $w.pane.right
diff --git a/tk/library/demos/paned2.tcl b/tk/library/demos/paned2.tcl
new file mode 100644
index 00000000000..5bfcf06f837
--- /dev/null
+++ b/tk/library/demos/paned2.tcl
@@ -0,0 +1,76 @@
+# paned2.tcl --
+#
+# This demonstration script creates a toplevel window containing
+# a paned window that separates two windows vertically.
+#
+# RCS: @(#) $Id$
+
+if {![info exists widgetDemo]} {
+ error "This script should be run from the \"widget\" demo."
+}
+
+set w .paned2
+catch {destroy $w}
+toplevel $w
+wm title $w "Vertical Paned Window Demonstration"
+wm iconname $w "paned2"
+positionWindow $w
+
+label $w.msg -font $font -wraplength 4i -justify left -text "The sash between the two scrolled windows below can be used to divide the area between them. Use the left mouse button to resize without redrawing by just moving the sash, and use the middle mouse button to resize opaquely (always redrawing the windows in each position.)"
+pack $w.msg -side top
+
+frame $w.buttons
+pack $w.buttons -side bottom -fill x -pady 2m
+button $w.buttons.dismiss -text Dismiss -command "destroy $w"
+button $w.buttons.code -text "See Code" -command "showCode $w"
+pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
+
+# Create the pane itself
+panedwindow $w.pane -orient vertical
+pack $w.pane -side top -expand yes -fill both -pady 2 -padx 2m
+
+# The top window is a listbox with scrollbar
+set paneList {
+ {List of Tk Widgets}
+ button
+ canvas
+ checkbutton
+ entry
+ frame
+ label
+ labelframe
+ listbox
+ menu
+ menubutton
+ message
+ panedwindow
+ radiobutton
+ scale
+ scrollbar
+ spinbox
+ text
+ toplevel
+}
+set f [frame $w.pane.top]
+listbox $f.list -listvariable paneList -yscrollcommand "$f.scr set"
+# Invert the first item to highlight it
+$f.list itemconfigure 0 \
+ -background [$f.list cget -fg] -foreground [$f.list cget -bg]
+scrollbar $f.scr -orient vertical -command "$f.list yview"
+pack $f.scr -side right -fill y
+pack $f.list -fill both -expand 1
+
+# The bottom window is a text widget with scrollbar
+set f [frame $w.pane.bottom]
+text $f.text -xscrollcommand "$f.xscr set" -yscrollcommand "$f.yscr set" \
+ -width 30 -wrap none
+scrollbar $f.xscr -orient horizontal -command "$f.text xview"
+scrollbar $f.yscr -orient vertical -command "$f.text yview"
+grid $f.text $f.yscr -sticky nsew
+grid $f.xscr -sticky nsew
+grid columnconfigure $f 0 -weight 1
+grid rowconfigure $f 0 -weight 1
+$f.text insert 1.0 "This is just a normal text widget"
+
+# Now add our contents to the paned window
+$w.pane add $w.pane.top $w.pane.bottom
diff --git a/tk/library/demos/plot.tcl b/tk/library/demos/plot.tcl
index b226c84f2ae..dadf6158c4d 100644
--- a/tk/library/demos/plot.tcl
+++ b/tk/library/demos/plot.tcl
@@ -38,20 +38,21 @@ $c create text 225 20 -text "A Simple Plot" -font $plotFont -fill brown
for {set i 0} {$i <= 10} {incr i} {
set x [expr {100 + ($i*30)}]
$c create line $x 250 $x 245 -width 2
- $c create text $x 254 -text [expr 10*$i] -anchor n -font $plotFont
+ $c create text $x 254 -text [expr {10*$i}] -anchor n -font $plotFont
}
for {set i 0} {$i <= 5} {incr i} {
set y [expr {250 - ($i*40)}]
$c create line 100 $y 105 $y -width 2
- $c create text 96 $y -text [expr $i*50].0 -anchor e -font $plotFont
+ $c create text 96 $y -text [expr {$i*50}].0 -anchor e -font $plotFont
}
-foreach point {{12 56} {20 94} {33 98} {32 120} {61 180}
- {75 160} {98 223}} {
+foreach point {
+ {12 56} {20 94} {33 98} {32 120} {61 180} {75 160} {98 223}
+} {
set x [expr {100 + (3*[lindex $point 0])}]
set y [expr {250 - (4*[lindex $point 1])/5}]
- set item [$c create oval [expr $x-6] [expr $y-6] \
- [expr $x+6] [expr $y+6] -width 1 -outline black \
+ set item [$c create oval [expr {$x-6}] [expr {$y-6}] \
+ [expr {$x+6}] [expr {$y+6}] -width 1 -outline black \
-fill SkyBlue2]
$c addtag point withtag $item
}
@@ -92,8 +93,7 @@ proc plotDown {w x y} {
proc plotMove {w x y} {
global plot
- $w move selected [expr $x-$plot(lastX)] [expr $y-$plot(lastY)]
+ $w move selected [expr {$x-$plot(lastX)}] [expr {$y-$plot(lastY)}]
set plot(lastX) $x
set plot(lastY) $y
}
-
diff --git a/tk/library/demos/puzzle.tcl b/tk/library/demos/puzzle.tcl
index 0dcef217bd8..31f13facd52 100644
--- a/tk/library/demos/puzzle.tcl
+++ b/tk/library/demos/puzzle.tcl
@@ -54,16 +54,27 @@ pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
# scrollbar widget and using its trough color.
scrollbar $w.s
-frame $w.frame -width 120 -height 120 -borderwidth 2 -relief sunken \
- -bg [$w.s cget -troughcolor]
+
+# The button metrics are a bit bigger in Aqua, and since we are
+# using place which doesn't autosize, then we need to have a
+# slightly larger frame here...
+
+if {[string equal [tk windowingsystem] aqua]} {
+ set frameSize 160
+} else {
+ set frameSize 120
+}
+
+frame $w.frame -width $frameSize -height $frameSize -borderwidth 2\
+ -relief sunken -bg [$w.s cget -troughcolor]
pack $w.frame -side top -pady 1c -padx 1c
destroy $w.s
set order {3 1 6 2 5 7 15 13 4 11 8 9 14 10 12}
-for {set i 0} {$i < 15} {set i [expr $i+1]} {
+for {set i 0} {$i < 15} {set i [expr {$i+1}]} {
set num [lindex $order $i]
- set xpos($num) [expr ($i%4)*.25]
- set ypos($num) [expr ($i/4)*.25]
+ set xpos($num) [expr {($i%4)*.25}]
+ set ypos($num) [expr {($i/4)*.25}]
button $w.frame.$num -relief raised -text $num -highlightthickness 0 \
-command "puzzleSwitch $w $num"
place $w.frame.$num -relx $xpos($num) -rely $ypos($num) \
@@ -71,4 +82,3 @@ for {set i 0} {$i < 15} {set i [expr $i+1]} {
}
set xpos(space) .75
set ypos(space) .75
-
diff --git a/tk/library/demos/radio.tcl b/tk/library/demos/radio.tcl
index 91d9e8ecae8..80bfd37dc65 100644
--- a/tk/library/demos/radio.tcl
+++ b/tk/library/demos/radio.tcl
@@ -15,31 +15,45 @@ toplevel $w
wm title $w "Radiobutton Demonstration"
wm iconname $w "radio"
positionWindow $w
-label $w.msg -font $font -wraplength 5i -justify left -text "Two groups of radiobuttons are displayed below. If you click on a button then the button will become selected exclusively among all the buttons in its group. A Tcl variable is associated with each group to indicate which of the group's buttons is selected. Click the \"See Variables\" button to see the current values of the variables."
+label $w.msg -font $font -wraplength 5i -justify left -text "Three groups of radiobuttons are displayed below. If you click on a button then the button will become selected exclusively among all the buttons in its group. A Tcl variable is associated with each group to indicate which of the group's buttons is selected. Click the \"See Variables\" button to see the current values of the variables."
pack $w.msg -side top
frame $w.buttons
pack $w.buttons -side bottom -fill x -pady 2m
button $w.buttons.dismiss -text Dismiss -command "destroy $w"
button $w.buttons.code -text "See Code" -command "showCode $w"
-button $w.buttons.vars -text "See Variables" \
- -command "showVars $w.dialog size color"
+button $w.buttons.vars -text "See Variables" \
+ -command "showVars $w.dialog size color align"
pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1
-frame $w.left
-frame $w.right
-pack $w.left $w.right -side left -expand yes -pady .5c -padx .5c
+labelframe $w.left -pady 2 -text "Point Size" -padx 2
+labelframe $w.mid -pady 2 -text "Color" -padx 2
+labelframe $w.right -pady 2 -text "Alignment" -padx 2
+pack $w.left $w.mid $w.right -side left -expand yes -pady .5c -padx .5c
-foreach i {10 12 18 24} {
+foreach i {10 12 14 18 24} {
radiobutton $w.left.b$i -text "Point Size $i" -variable size \
-relief flat -value $i
- pack $w.left.b$i -side top -pady 2 -anchor w
+ pack $w.left.b$i -side top -pady 2 -anchor w -fill x
}
-foreach color {Red Green Blue Yellow Orange Purple} {
- set lower [string tolower $color]
- radiobutton $w.right.$lower -text $color -variable color \
- -relief flat -value $lower
- pack $w.right.$lower -side top -pady 2 -anchor w
+foreach c {Red Green Blue Yellow Orange Purple} {
+ set lower [string tolower $c]
+ radiobutton $w.mid.$lower -text $c -variable color \
+ -relief flat -value $lower -anchor w \
+ -command "$w.mid configure -fg \$color"
+ pack $w.mid.$lower -side top -pady 2 -fill x
}
+label $w.right.l -text "Label" -bitmap questhead -compound left
+$w.right.l configure -width [winfo reqwidth $w.right.l] -compound top
+$w.right.l configure -height [winfo reqheight $w.right.l]
+foreach a {Top Left Right Bottom} {
+ set lower [string tolower $a]
+ radiobutton $w.right.$lower -text $a -variable align \
+ -relief flat -value $lower -indicatoron 0 -width 7 \
+ -command "$w.right.l configure -compound \$align"
+}
+grid x $w.right.top
+grid $w.right.left $w.right.l $w.right.right
+grid x $w.right.bottom
diff --git a/tk/library/demos/rmt b/tk/library/demos/rmt
index de3ff853728..d0df5e25107 100755
--- a/tk/library/demos/rmt
+++ b/tk/library/demos/rmt
@@ -32,22 +32,21 @@ set lastCommand ""
# Create menu bar. Arrange to recreate all the information in the
# applications sub-menu whenever it is cascaded to.
-frame .menu -relief raised -bd 2
-pack .menu -side top -fill x
-menubutton .menu.file -text "File" -menu .menu.file.m -underline 0
-menu .menu.file.m
-.menu.file.m add cascade -label "Select Application" \
- -menu .menu.file.m.apps -underline 0
-.menu.file.m add command -label "Quit" -command "destroy ." -underline 0
-menu .menu.file.m.apps -postcommand fillAppsMenu
-pack .menu.file -side left
+. configure -menu [menu .menu]
+menu .menu.file
+menu .menu.file.apps -postcommand fillAppsMenu
+.menu add cascade -label "File" -underline 0 -menu .menu.file
+.menu.file add cascade -label "Select Application" -underline 0 \
+ -menu .menu.file.apps
+.menu.file add command -label "Quit" -command "destroy ." -underline 0
# Create text window and scrollbar.
text .t -relief sunken -bd 2 -yscrollcommand ".s set" -setgrid true
scrollbar .s -command ".t yview"
-pack .s -side right -fill both
-pack .t -side left
+grid .t .s -sticky nsew
+grid rowconfigure . 0 -weight 1
+grid columnconfigure . 0 -weight 1
# Create a binding to forward commands to the target application,
# plus modify many of the built-in bindings so that only information
@@ -123,6 +122,7 @@ proc tkTextInsert {w s} {
$w see insert
}
+.t configure -font {Courier 12}
.t tag configure bold -font {Courier 12 bold}
# The procedure below is used to print out a prompt at the
@@ -193,14 +193,18 @@ proc newApp appName {
# of all the applications that currently exist.
proc fillAppsMenu {} {
- catch {.menu.file.m.apps delete 0 last}
+ set m .menu.file.apps
+ catch {$m delete 0 last}
foreach i [lsort [winfo interps]] {
- .menu.file.m.apps add command -label $i -command [list newApp $i]
+ $m add command -label $i -command [list newApp $i]
}
- .menu.file.m.apps add command -label local -command {newApp local}
+ $m add command -label local -command {newApp local}
}
set app [winfo name .]
prompt
focus .t
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tk/library/demos/rolodex b/tk/library/demos/rolodex
index 3e334f7ef70..58bb0520b7a 100755
--- a/tk/library/demos/rolodex
+++ b/tk/library/demos/rolodex
@@ -1,6 +1,6 @@
#!/bin/sh
# the next line restarts using wish \
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
# rolodex --
# This script was written as an entry in Tom LaStrange's rolodex
@@ -14,6 +14,8 @@ foreach i [winfo child .] {
catch {destroy $i}
}
+set version 1.2
+
#------------------------------------------
# Phase 0: create the front end.
#------------------------------------------
@@ -23,12 +25,9 @@ pack .frame -side top -fill y -anchor center
set names {{} Name: Address: {} {} {Home Phone:} {Work Phone:} Fax:}
foreach i {1 2 3 4 5 6 7} {
- frame .frame.$i
- pack .frame.$i -side top -pady 2 -anchor e
-
- label .frame.$i.label -text [lindex $names $i] -anchor e
- entry .frame.$i.entry -width 30 -relief sunken
- pack .frame.$i.entry .frame.$i.label -side right
+ label .frame.label$i -text [lindex $names $i] -anchor e
+ entry .frame.entry$i -width 35
+ grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1
}
frame .buttons
@@ -77,7 +76,7 @@ proc fileAction {} {
proc addAction {} {
global names
foreach i {1 2 3 4 5 6 7} {
- puts stderr [format "%-12s %s" [lindex $names $i] [.frame.$i.entry get]]
+ puts stderr [format "%-12s %s" [lindex $names $i] [.frame.entry$i get]]
}
}
.buttons.add config -command addAction
@@ -88,20 +87,20 @@ proc addAction {} {
proc clearAction {} {
foreach i {1 2 3 4 5 6 7} {
- .frame.$i.entry delete 0 end
+ .frame.entry$i delete 0 end
}
}
.buttons.clear config -command clearAction
proc fillCard {} {
clearAction
- .frame.1.entry insert 0 "John Ousterhout"
- .frame.2.entry insert 0 "CS Division, Department of EECS"
- .frame.3.entry insert 0 "University of California"
- .frame.4.entry insert 0 "Berkeley, CA 94720"
- .frame.5.entry insert 0 "private"
- .frame.6.entry insert 0 "510-642-0865"
- .frame.7.entry insert 0 "510-642-5775"
+ .frame.entry1 insert 0 "John Ousterhout"
+ .frame.entry2 insert 0 "CS Division, Department of EECS"
+ .frame.entry3 insert 0 "University of California"
+ .frame.entry4 insert 0 "Berkeley, CA 94720"
+ .frame.entry5 insert 0 "private"
+ .frame.entry6 insert 0 "510-642-0865"
+ .frame.entry7 insert 0 "510-642-5775"
}
.buttons.search config -command "addAction; fillCard"
@@ -123,7 +122,7 @@ bind . <Control-f> fileAction
.menu.file.m entryconfig 2 -accel Ctrl+Q
bind . <Control-q> {destroy .}
-focus .frame.1.entry
+focus .frame.entry1
#----------------------------------------------------
# Phase 6: help
@@ -145,42 +144,43 @@ proc Help {topic {x 0} {y 0}} {
}
proc getMenuTopic {w x y} {
- return $w.[$w index @[expr $y-[winfo rooty $w]]]
+ return $w.[$w index @[expr {$y-[winfo rooty $w]}]]
}
-bind . <Any-F1> {Help [winfo containing %X %Y] %X %Y}
-bind . <Any-Help> {Help [winfo containing %X %Y] %X %Y}
+event add <<Help>> <F1> <Help>
+bind . <<Help>> {Help [winfo containing %X %Y] %X %Y}
+bind Menu <<Help>> {Help [winfo containing %X %Y] %X %Y}
# Help text and commands follow:
set helpTopics(.menu.file) {This is the "file" menu. It can be used to invoke some overall operations on the rolodex applications, such as loading a file or exiting.}
set helpCmds(.menu.file.m) {getMenuTopic $topic $x $y}
-set helpTopics(.menu.file.m.0) {The "Load" entry in the "File" menu posts a dialog box that you can use to select a rolodex file}
-set helpTopics(.menu.file.m.1) {The "Exit" entry in the "File" menu causes the rolodex application to terminate}
+set helpTopics(.menu.file.m.1) {The "Load" entry in the "File" menu posts a dialog box that you can use to select a rolodex file}
+set helpTopics(.menu.file.m.2) {The "Exit" entry in the "File" menu causes the rolodex application to terminate}
set helpCmds(.menu.file.m.none) {set topic ".menu.file"}
-set helpTopics(.frame.1.entry) {In this field of the rolodex entry you should type the person's name}
-set helpTopics(.frame.2.entry) {In this field of the rolodex entry you should type the first line of the person's address}
-set helpTopics(.frame.3.entry) {In this field of the rolodex entry you should type the second line of the person's address}
-set helpTopics(.frame.4.entry) {In this field of the rolodex entry you should type the third line of the person's address}
-set helpTopics(.frame.5.entry) {In this field of the rolodex entry you should type the person's home phone number, or "private" if the person doesn't want his or her number publicized}
-set helpTopics(.frame.6.entry) {In this field of the rolodex entry you should type the person's work phone number}
-set helpTopics(.frame.7.entry) {In this field of the rolodex entry you should type the phone number for the person's FAX machine}
-
-set helpCmds(.frame.1.label) {set topic .frame.1.entry}
-set helpCmds(.frame.2.label) {set topic .frame.2.entry}
-set helpCmds(.frame.3.label) {set topic .frame.3.entry}
-set helpCmds(.frame.4.label) {set topic .frame.4.entry}
-set helpCmds(.frame.5.label) {set topic .frame.5.entry}
-set helpCmds(.frame.6.label) {set topic .frame.6.entry}
-set helpCmds(.frame.7.label) {set topic .frame.7.entry}
+set helpTopics(.frame.entry1) {In this field of the rolodex entry you should type the person's name}
+set helpTopics(.frame.entry2) {In this field of the rolodex entry you should type the first line of the person's address}
+set helpTopics(.frame.entry3) {In this field of the rolodex entry you should type the second line of the person's address}
+set helpTopics(.frame.entry4) {In this field of the rolodex entry you should type the third line of the person's address}
+set helpTopics(.frame.entry5) {In this field of the rolodex entry you should type the person's home phone number, or "private" if the person doesn't want his or her number publicized}
+set helpTopics(.frame.entry6) {In this field of the rolodex entry you should type the person's work phone number}
+set helpTopics(.frame.entry7) {In this field of the rolodex entry you should type the phone number for the person's FAX machine}
+
+set helpCmds(.frame.label1) {set topic .frame.entry1}
+set helpCmds(.frame.label2) {set topic .frame.entry2}
+set helpCmds(.frame.label3) {set topic .frame.entry3}
+set helpCmds(.frame.label4) {set topic .frame.entry4}
+set helpCmds(.frame.label5) {set topic .frame.entry5}
+set helpCmds(.frame.label6) {set topic .frame.entry6}
+set helpCmds(.frame.label7) {set topic .frame.entry7}
set helpTopics(context) {Unfortunately, this application doesn't support context-sensitive help in the usual way, because when this demo was written Tk didn't have a grab mechanism and this is needed for context-sensitive help. Instead, you can achieve much the same effect by simply moving the mouse over the window you're curious about and pressing the Help or F1 keys. You can do this anytime.}
set helpTopics(help) {This application provides only very crude help. Besides the entries in this menu, you can get help on individual windows by moving the mouse cursor over the window and pressing the Help or F1 keys.}
set helpTopics(window) {This window is a dummy rolodex application created as part of Tom LaStrange's toolkit benchmark. It doesn't really do anything useful except to demonstrate a few features of the Tk toolkit.}
set helpTopics(keys) "The following accelerator keys are defined for this application (in addition to those already available for the entry windows):\n\nCtrl+A:\t\tAdd\nCtrl+C:\t\tClear\nCtrl+D:\t\tDelete\nCtrl+F:\t\tEnter file name\nCtrl+Q:\t\tExit application (quit)\nCtrl+S:\t\tSearch (dummy operation)"
-set helpTopics(version) {This is version 1.0.}
+set helpTopics(version) "This is version $version."
# Entries in "Help" menu
@@ -194,4 +194,3 @@ set helpTopics(version) {This is version 1.0.}
-underline 3
.menu.help.m add command -label "On Version..." -command {Help version} \
-underline 3
-
diff --git a/tk/library/demos/ruler.tcl b/tk/library/demos/ruler.tcl
index e73e462fc46..38b7170b9b4 100644
--- a/tk/library/demos/ruler.tcl
+++ b/tk/library/demos/ruler.tcl
@@ -19,8 +19,8 @@ if {![info exists widgetDemo]} {
proc rulerMkTab {c x y} {
upvar #0 demo_rulerInfo v
- $c create polygon $x $y [expr $x+$v(size)] [expr $y+$v(size)] \
- [expr $x-$v(size)] [expr $y+$v(size)]
+ $c create polygon $x $y [expr {$x+$v(size)}] [expr {$y+$v(size)}] \
+ [expr {$x-$v(size)}] [expr {$y+$v(size)}]
}
set w .ruler
@@ -63,7 +63,7 @@ if {[winfo depth $c] > 1} {
$c create line 1c 0.5c 1c 1c 13c 1c 13c 0.5c -width 1
for {set i 0} {$i < 12} {incr i} {
- set x [expr $i+1]
+ set x [expr {$i+1}]
$c create line ${x}c 1c ${x}c 0.6c -width 1
$c create line $x.25c 1c $x.25c 0.8c -width 1
$c create line $x.5c 1c $x.5c 0.7c -width 1
@@ -110,7 +110,7 @@ proc rulerNewTab {c x y} {
proc rulerSelectTab {c x y} {
upvar #0 demo_rulerInfo v
set v(x) [$c canvasx $x $v(grid)]
- set v(y) [expr $v(top)+2]
+ set v(y) [expr {$v(top)+2}]
$c addtag active withtag current
eval "$c itemconf active $v(activeStyle)"
$c raise active
@@ -139,13 +139,13 @@ proc rulerMoveTab {c x y} {
set cx $v(right)
}
if {($cy >= $v(top)) && ($cy <= $v(bottom))} {
- set cy [expr $v(top)+2]
+ set cy [expr {$v(top)+2}]
eval "$c itemconf active $v(activeStyle)"
} else {
- set cy [expr $cy-$v(size)-2]
+ set cy [expr {$cy-$v(size)-2}]
eval "$c itemconf active $v(deleteStyle)"
}
- $c move active [expr $cx-$v(x)] [expr $cy-$v(y)]
+ $c move active [expr {$cx-$v(x)}] [expr {$cy-$v(y)}]
set v(x) $cx
set v(y) $cy
}
@@ -164,11 +164,10 @@ proc rulerReleaseTab c {
if {[$c find withtag active] == {}} {
return
}
- if {$v(y) != [expr $v(top)+2]} {
+ if {$v(y) != $v(top)+2} {
$c delete active
} else {
eval "$c itemconf active $v(normalStyle)"
$c dtag active
}
}
-
diff --git a/tk/library/demos/sayings.tcl b/tk/library/demos/sayings.tcl
index 8f24ec907e8..872e5d26095 100644
--- a/tk/library/demos/sayings.tcl
+++ b/tk/library/demos/sayings.tcl
@@ -44,4 +44,3 @@ grid columnconfig $w.frame 0 -weight 1 -minsize 0
$w.frame.list insert 0 "Waste not, want not" "Early to bed and early to rise makes a man healthy, wealthy, and wise" "Ask not what your country can do for you, ask what you can do for your country" "I shall return" "NOT" "A picture is worth a thousand words" "User interfaces are hard to build" "Thou shalt not steal" "A penny for your thoughts" "Fool me once, shame on you; fool me twice, shame on me" "Every cloud has a silver lining" "Where there's smoke there's fire" "It takes one to know one" "Curiosity killed the cat" "Take this job and shove it" "Up a creek without a paddle" "I'm mad as hell and I'm not going to take it any more" "An apple a day keeps the doctor away" "Don't look a gift horse in the mouth"
-
diff --git a/tk/library/demos/search.tcl b/tk/library/demos/search.tcl
index 130cb53ee39..c8b267101eb 100644
--- a/tk/library/demos/search.tcl
+++ b/tk/library/demos/search.tcl
@@ -139,4 +139,3 @@ $w.text mark set insert 0.0
set fileName ""
set searchString ""
-
diff --git a/tk/library/demos/spin.tcl b/tk/library/demos/spin.tcl
new file mode 100644
index 00000000000..4ba158b9b8d
--- /dev/null
+++ b/tk/library/demos/spin.tcl
@@ -0,0 +1,55 @@
+# spin.tcl --
+#
+# This demonstration script creates several spinbox widgets.
+#
+# RCS: @(#) $Id$
+
+if {![info exists widgetDemo]} {
+ error "This script should be run from the \"widget\" demo."
+}
+
+set w .spin
+catch {destroy $w}
+toplevel $w
+wm title $w "Spinbox Demonstration"
+wm iconname $w "spin"
+positionWindow $w
+
+label $w.msg -font $font -wraplength 5i -justify left -text "Three different\
+ spin-boxes are displayed below. You can add characters by pointing,\
+ clicking and typing. The normal Motif editing characters are\
+ supported, along with many Emacs bindings. For example, Backspace\
+ and Control-h delete the character to the left of the insertion\
+ cursor and Delete and Control-d delete the chararacter to the right\
+ of the insertion cursor. For values that are too large to fit in the\
+ window all at once, you can scan through the value by dragging with\
+ mouse button2 pressed. Note that the first spin-box will only permit\
+ you to type in integers, and the third selects from a list of\
+ Australian cities."
+pack $w.msg -side top
+
+frame $w.buttons
+pack $w.buttons -side bottom -fill x -pady 2m
+button $w.buttons.dismiss -text Dismiss -command "destroy $w"
+button $w.buttons.code -text "See Code" -command "showCode $w"
+pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
+
+set australianCities {
+ Canberra Sydney Melbourne Perth Adelaide Brisbane
+ Hobart Darwin "Alice Springs"
+}
+
+spinbox $w.s1 -from 1 -to 10 -width 10 -validate key \
+ -vcmd {string is integer %P}
+spinbox $w.s2 -from 0 -to 3 -increment .5 -format %05.2f -width 10
+spinbox $w.s3 -values $australianCities -width 10
+
+#entry $w.e1
+#entry $w.e2
+#entry $w.e3
+pack $w.s1 $w.s2 $w.s3 -side top -pady 5 -padx 10 ;#-fill x
+
+#$w.e1 insert 0 "Initial value"
+#$w.e2 insert end "This entry contains a long value, much too long "
+#$w.e2 insert end "to fit in the window at one time, so long in fact "
+#$w.e2 insert end "that you'll have to scan or scroll to see the end."
diff --git a/tk/library/demos/square b/tk/library/demos/square
index 4a17ef14ef3..2ea0722f924 100755
--- a/tk/library/demos/square
+++ b/tk/library/demos/square
@@ -53,4 +53,3 @@ proc timer {} {
.s size [expr {$s+$inc}]
after 30 timer
}
-
diff --git a/tk/library/demos/states.tcl b/tk/library/demos/states.tcl
index 425c0bc582b..08834eea470 100644
--- a/tk/library/demos/states.tcl
+++ b/tk/library/demos/states.tcl
@@ -43,4 +43,3 @@ $w.frame.list insert 0 Alabama Alaska Arizona Arkansas California \
"South Carolina" "South Dakota" \
Tennessee Texas Utah Vermont Virginia Washington \
"West Virginia" Wisconsin Wyoming
-
diff --git a/tk/library/demos/style.tcl b/tk/library/demos/style.tcl
index cf5d049cbec..136d4e22898 100644
--- a/tk/library/demos/style.tcl
+++ b/tk/library/demos/style.tcl
@@ -150,4 +150,3 @@ $w.text insert end "in this example.\n" spacing
$w.text insert end "To see where the space is, select ranges of " spacing
$w.text insert end "text within these paragraphs. The selection " spacing
$w.text insert end "highlight will cover the extra space." spacing
-
diff --git a/tk/library/demos/tcolor b/tk/library/demos/tcolor
index edef7235c93..27b931fc73e 100755
--- a/tk/library/demos/tcolor
+++ b/tk/library/demos/tcolor
@@ -41,67 +41,70 @@ set updating 0
set autoUpdate 1
set name ""
+if {$tcl_platform(platform) eq "unix"} {
+ option add *Entry.background white
+}
+
# Create the menu bar at the top of the window.
-frame .menu -relief raised -borderwidth 2
-pack .menu -side top -fill x
-menubutton .menu.file -text File -menu .menu.file.m -underline 0
-menu .menu.file.m
-.menu.file.m add radio -label "RGB color space" -variable colorSpace \
+. configure -menu [menu .menu]
+menu .menu.file
+.menu add cascade -menu .menu.file -label File -underline 0
+.menu.file add radio -label "RGB color space" -variable colorSpace \
-value rgb -underline 0 -command {changeColorSpace rgb}
-.menu.file.m add radio -label "CMY color space" -variable colorSpace \
+.menu.file add radio -label "CMY color space" -variable colorSpace \
-value cmy -underline 0 -command {changeColorSpace cmy}
-.menu.file.m add radio -label "HSB color space" -variable colorSpace \
+.menu.file add radio -label "HSB color space" -variable colorSpace \
-value hsb -underline 0 -command {changeColorSpace hsb}
-.menu.file.m add separator
-.menu.file.m add radio -label "Automatic updates" -variable autoUpdate \
+.menu.file add separator
+.menu.file add radio -label "Automatic updates" -variable autoUpdate \
-value 1 -underline 0
-.menu.file.m add radio -label "Manual updates" -variable autoUpdate \
+.menu.file add radio -label "Manual updates" -variable autoUpdate \
-value 0 -underline 0
-.menu.file.m add separator
-.menu.file.m add command -label "Exit program" -underline 0 \
- -command "destroy ."
-pack .menu.file -side left
+.menu.file add separator
+.menu.file add command -label "Exit program" -underline 0 -command {exit}
# Create the command entry window at the bottom of the window, along
# with the update button.
-frame .bot -relief raised -borderwidth 2
-pack .bot -side bottom -fill x
-label .commandLabel -text "Command:"
-entry .command -relief sunken -borderwidth 2 -textvariable command \
+labelframe .command -text "Command:" -padx {1m 0}
+entry .command.e -relief sunken -borderwidth 2 -textvariable command \
-font {Courier 12}
-button .update -text Update -command doUpdate
-pack .commandLabel -in .bot -side left
-pack .update -in .bot -side right -pady .1c -padx .25c
-pack .command -in .bot -expand yes -fill x -ipadx 0.25c
+button .command.update -text Update -command doUpdate
+pack .command.update -side right -pady .1c -padx {.25c 0}
+pack .command.e -expand yes -fill x -ipadx 0.25c
+
# Create the listbox that holds all of the color names in rgb.txt,
# if an rgb.txt file can be found.
-frame .middle -relief raised -borderwidth 2
-pack .middle -side top -fill both
-foreach i {/usr/local/lib/X11/rgb.txt /usr/lib/X11/rgb.txt
- /X11/R5/lib/X11/rgb.txt /X11/R4/lib/rgb/rgb.txt
- /usr/openwin/lib/X11/rgb.txt} {
- if ![file readable $i] {
+grid .command -sticky nsew -row 2 -columnspan 3 -padx 1m -pady {0 1m}
+
+grid columnconfigure . {1 2} -weight 1
+grid rowconfigure . 0 -weight 1
+foreach i {
+ /usr/local/lib/X11/rgb.txt /usr/lib/X11/rgb.txt
+ /X11/R5/lib/X11/rgb.txt /X11/R4/lib/rgb/rgb.txt
+ /usr/openwin/lib/X11/rgb.txt
+} {
+ if {![file readable $i]} {
continue;
}
set f [open $i]
- frame .middle.left
- pack .middle.left -side left -padx .25c -pady .25c
- listbox .names -width 20 -height 12 -yscrollcommand ".scroll set" \
+ labelframe .names -text "Select:" -padx .1c -pady .1c
+ grid .names -row 0 -column 0 -sticky nsew -padx .15c -pady .15c -rowspan 2
+ grid columnconfigure . 0 -weight 1
+ listbox .names.lb -width 20 -height 12 -yscrollcommand ".names.s set" \
-relief sunken -borderwidth 2 -exportselection false
- bind .names <Double-1> {
- tc_loadNamedColor [.names get [.names curselection]]
+ bind .names.lb <Double-1> {
+ tc_loadNamedColor [.names.lb get [.names.lb curselection]]
}
- scrollbar .scroll -orient vertical -command ".names yview" \
+ scrollbar .names.s -orient vertical -command ".names.lb yview" \
-relief sunken -borderwidth 2
- pack .names -in .middle.left -side left
- pack .scroll -in .middle.left -side right -fill y
+ pack .names.lb .names.s -side left -fill y -expand 1
while {[gets $f line] >= 0} {
- if {[llength $line] == 4} {
- .names insert end [lindex $line 3]
+ if {[regexp {^\s*\d+\s+\d+\s+\d+\s+(\S+)$} $line -> col]} {
+ .names.lb insert end $col
}
}
close $f
@@ -111,35 +114,33 @@ foreach i {/usr/local/lib/X11/rgb.txt /usr/lib/X11/rgb.txt
# Create the three scales for editing the color, and the entry for
# typing in a color value.
-frame .middle.middle
-pack .middle.middle -side left -expand yes -fill y
-frame .middle.middle.1
-frame .middle.middle.2
-frame .middle.middle.3
-frame .middle.middle.4
-pack .middle.middle.1 .middle.middle.2 .middle.middle.3 -side top -expand yes
-pack .middle.middle.4 -side top -expand yes -fill x
+frame .adjust
foreach i {1 2 3} {
- label .label$i -textvariable label$i
+ label .adjust.l$i -textvariable label$i -pady 0
+ labelframe .adjust.$i -labelwidget .adjust.l$i -padx 1m -pady 1m
scale .scale$i -from 0 -to 1000 -length 6c -orient horizontal \
-command tc_scaleChanged
- pack .scale$i .label$i -in .middle.middle.$i -side top -anchor w
+ pack .scale$i -in .adjust.$i
+ pack .adjust.$i
}
-label .nameLabel -text "Name:"
-entry .name -relief sunken -borderwidth 2 -textvariable name -width 10 \
+grid .adjust -row 0 -column 1 -sticky nsew -padx .15c -pady .15c
+
+labelframe .name -text "Name:" -padx 1m -pady 1m
+entry .name.e -relief sunken -borderwidth 2 -textvariable name -width 10 \
-font {Courier 12}
-pack .nameLabel -in .middle.middle.4 -side left
-pack .name -in .middle.middle.4 -side right -expand 1 -fill x
-bind .name <Return> {tc_loadNamedColor $name}
+pack .name.e -side right -expand 1 -fill x
+bind .name.e <Return> {tc_loadNamedColor $name}
+grid .name -column 1 -row 1 -sticky nsew -padx .15c -pady .15c
# Create the color display swatch on the right side of the window.
-frame .middle.right
-pack .middle.right -side left -pady .25c -padx .25c -anchor s
-frame .swatch -width 2c -height 5c -background $color
-label .value -textvariable color -width 13 -font {Courier 12}
-pack .swatch -in .middle.right -side top -expand yes -fill both
-pack .value -in .middle.right -side bottom -pady .25c
+labelframe .sample -text "Color:" -padx 1m -pady 1m
+frame .sample.swatch -width 2c -height 5c -background $color
+label .sample.value -textvariable color -width 13 -font {Courier 12}
+pack .sample.swatch -side top -expand yes -fill both
+pack .sample.value -side bottom -pady .25c
+grid .sample -row 0 -column 2 -sticky nsew -padx .15c -pady .15c -rowspan 2
+
# The procedure below is invoked when one of the scales is adjusted.
# It propagates color information from the current scale readings
@@ -147,19 +148,21 @@ pack .value -in .middle.right -side bottom -pady .25c
proc tc_scaleChanged args {
global red green blue colorSpace color updating autoUpdate
- if $updating {
+ if {$updating} {
return
}
- if {$colorSpace == "rgb"} {
- set red [format %.0f [expr [.scale1 get]*65.535]]
- set green [format %.0f [expr [.scale2 get]*65.535]]
- set blue [format %.0f [expr [.scale3 get]*65.535]]
- } else {
- if {$colorSpace == "cmy"} {
+ switch $colorSpace {
+ rgb {
+ set red [format %.0f [expr {[.scale1 get]*65.535}]]
+ set green [format %.0f [expr {[.scale2 get]*65.535}]]
+ set blue [format %.0f [expr {[.scale3 get]*65.535}]]
+ }
+ cmy {
set red [format %.0f [expr {65535 - [.scale1 get]*65.535}]]
set green [format %.0f [expr {65535 - [.scale2 get]*65.535}]]
set blue [format %.0f [expr {65535 - [.scale3 get]*65.535}]]
- } else {
+ }
+ hsb {
set list [hsbToRgb [expr {[.scale1 get]/1000.0}] \
[expr {[.scale2 get]/1000.0}] \
[expr {[.scale3 get]/1000.0}]]
@@ -169,8 +172,8 @@ proc tc_scaleChanged args {
}
}
set color [format "#%04x%04x%04x" $red $green $blue]
- .swatch config -bg $color
- if $autoUpdate doUpdate
+ .sample.swatch config -bg $color
+ if {$autoUpdate} doUpdate
update idletasks
}
@@ -182,16 +185,18 @@ proc tc_scaleChanged args {
proc tc_setScales {} {
global red green blue colorSpace updating
set updating 1
- if {$colorSpace == "rgb"} {
- .scale1 set [format %.0f [expr $red/65.535]]
- .scale2 set [format %.0f [expr $green/65.535]]
- .scale3 set [format %.0f [expr $blue/65.535]]
- } else {
- if {$colorSpace == "cmy"} {
- .scale1 set [format %.0f [expr (65535-$red)/65.535]]
- .scale2 set [format %.0f [expr (65535-$green)/65.535]]
- .scale3 set [format %.0f [expr (65535-$blue)/65.535]]
- } else {
+ switch $colorSpace {
+ rgb {
+ .scale1 set [format %.0f [expr {$red/65.535}]]
+ .scale2 set [format %.0f [expr {$green/65.535}]]
+ .scale3 set [format %.0f [expr {$blue/65.535}]]
+ }
+ cmy {
+ .scale1 set [format %.0f [expr {(65535-$red)/65.535}]]
+ .scale2 set [format %.0f [expr {(65535-$green)/65.535}]]
+ .scale3 set [format %.0f [expr {(65535-$blue)/65.535}]]
+ }
+ hsb {
set list [rgbToHsv $red $green $blue]
.scale1 set [format %.0f [expr {[lindex $list 0] * 1000.0}]]
.scale2 set [format %.0f [expr {[lindex $list 1] * 1000.0}]]
@@ -209,14 +214,14 @@ proc tc_loadNamedColor name {
global red green blue color autoUpdate
if {[string index $name 0] != "#"} {
- set list [winfo rgb .swatch $name]
+ set list [winfo rgb .sample.swatch $name]
set red [lindex $list 0]
set green [lindex $list 1]
set blue [lindex $list 2]
} else {
- case [string length $name] {
- 4 {set format "#%1x%1x%1x"; set shift 12}
- 7 {set format "#%2x%2x%2x"; set shift 8}
+ switch [string length $name] {
+ 4 {set format "#%1x%1x%1x"; set shift 12}
+ 7 {set format "#%2x%2x%2x"; set shift 8}
10 {set format "#%3x%3x%3x"; set shift 4}
13 {set format "#%4x%4x%4x"; set shift 0}
default {error "syntax error in color name \"$name\""}
@@ -224,14 +229,14 @@ proc tc_loadNamedColor name {
if {[scan $name $format red green blue] != 3} {
error "syntax error in color name \"$name\""
}
- set red [expr $red<<$shift]
- set green [expr $green<<$shift]
- set blue [expr $blue<<$shift]
+ set red [expr {$red<<$shift}]
+ set green [expr {$green<<$shift}]
+ set blue [expr {$blue<<$shift}]
}
tc_setScales
set color [format "#%04x%04x%04x" $red $green $blue]
- .swatch config -bg $color
- if $autoUpdate doUpdate
+ .sample.swatch config -bg $color
+ if {$autoUpdate} doUpdate
}
# The procedure below is invoked when a new color space is selected.
@@ -240,26 +245,28 @@ proc tc_loadNamedColor name {
proc changeColorSpace space {
global label1 label2 label3
- if {$space == "rgb"} {
- set label1 Red
- set label2 Green
- set label3 Blue
- tc_setScales
- return
- }
- if {$space == "cmy"} {
- set label1 Cyan
- set label2 Magenta
- set label3 Yellow
- tc_setScales
- return
- }
- if {$space == "hsb"} {
- set label1 Hue
- set label2 Saturation
- set label3 Brightness
- tc_setScales
- return
+ switch $space {
+ rgb {
+ set label1 "Adjust Red:"
+ set label2 "Adjust Green:"
+ set label3 "Adjust Blue:"
+ tc_setScales
+ return
+ }
+ cmy {
+ set label1 "Adjust Cyan:"
+ set label2 "Adjust Magenta:"
+ set label3 "Adjust Yellow:"
+ tc_setScales
+ return
+ }
+ hsb {
+ set label1 "Adjust Hue:"
+ set label2 "Adjust Saturation:"
+ set label3 "Adjust Brightness:"
+ tc_setScales
+ return
+ }
}
}
@@ -271,20 +278,18 @@ proc changeColorSpace space {
proc rgbToHsv {red green blue} {
if {$red > $green} {
- set max $red.0
- set min $green.0
+ set max [expr {double($red)}]
+ set min [expr {double($green)}]
} else {
- set max $green.0
- set min $red.0
+ set max [expr {double($green)}]
+ set min [expr {double($red)}]
}
if {$blue > $max} {
- set max $blue.0
- } else {
- if {$blue < $min} {
- set min $blue.0
- }
+ set max [expr {double($blue)}]
+ } elseif {$blue < $min} {
+ set min [expr {double($blue)}]
}
- set range [expr $max-$min]
+ set range [expr {$max-$min}]
if {$max == 0} {
set sat 0
} else {
@@ -297,16 +302,14 @@ proc rgbToHsv {red green blue} {
set gc [expr {($max - $green)/$range}]
set bc [expr {($max - $blue)/$range}]
if {$red == $max} {
- set hue [expr {.166667*($bc - $gc)}]
+ set hue [expr {($bc - $gc)/6.0}]
+ } elseif {$green == $max} {
+ set hue [expr {(2 + $rc - $bc)/6.0}]
} else {
- if {$green == $max} {
- set hue [expr {.166667*(2 + $rc - $bc)}]
- } else {
- set hue [expr {.166667*(4 + $gc - $rc)}]
- }
+ set hue [expr {(4 + $gc - $rc)/6.0}]
}
if {$hue < 0.0} {
- set hue [expr $hue + 1.0]
+ set hue [expr {$hue + 1.0}]
}
}
return [list $hue $sat [expr {$max/65535}]]
@@ -319,27 +322,28 @@ proc rgbToHsv {red green blue} {
# Computer Graphics" by Foley and Van Dam.
proc hsbToRgb {hue sat value} {
- set v [format %.0f [expr 65535.0*$value]]
+ set v [format %.0f [expr {65535.0*$value}]]
if {$sat == 0} {
return "$v $v $v"
} else {
- set hue [expr $hue*6.0]
+ set hue [expr {$hue*6.0}]
if {$hue >= 6.0} {
set hue 0.0
}
scan $hue. %d i
- set f [expr $hue-$i]
+ set f [expr {$hue-$i}]
set p [format %.0f [expr {65535.0*$value*(1 - $sat)}]]
set q [format %.0f [expr {65535.0*$value*(1 - ($sat*$f))}]]
set t [format %.0f [expr {65535.0*$value*(1 - ($sat*(1 - $f)))}]]
- case $i \
- 0 {return "$v $t $p"} \
- 1 {return "$q $v $p"} \
- 2 {return "$p $v $t"} \
- 3 {return "$p $q $v"} \
- 4 {return "$t $p $v"} \
+ switch $i {
+ 0 {return "$v $t $p"}
+ 1 {return "$q $v $p"}
+ 2 {return "$p $v $t"}
+ 3 {return "$p $q $v"}
+ 4 {return "$t $p $v"}
5 {return "$v $p $q"}
- error "i value $i is out of range"
+ default {error "i value $i is out of range"}
+ }
}
}
@@ -357,3 +361,6 @@ proc doUpdate {} {
changeColorSpace hsb
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tk/library/demos/text.tcl b/tk/library/demos/text.tcl
index 0cd2219c165..555b095413d 100644
--- a/tk/library/demos/text.tcl
+++ b/tk/library/demos/text.tcl
@@ -23,7 +23,7 @@ button $w.buttons.code -text "See Code" -command "showCode $w"
pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scroll set" -setgrid 1 \
- -height 30
+ -height 30 -undo 1 -autosep 1
scrollbar $w.scroll -command "$w.text yview"
pack $w.scroll -side right -fill y
pack $w.text -expand yes -fill both
@@ -66,7 +66,19 @@ the insertion cursor to the end of the line, or it deletes the newline
character if that is the only thing left on the line. Control-o opens
a new line by inserting a newline character to the right of the insertion
cursor. Control-t transposes the two characters on either side of the
-insertion cursor.
+insertion cursor. Control-z undoes the last editing action performed,
+and }
+
+switch $tcl_platform(platform) {
+ "unix" - "macintosh" {
+ $w.text insert end "Control-Shift-z"
+ }
+ "windows" {
+ $w.text insert end "Control-y"
+ }
+}
+
+$w.text insert end { redoes undone edits.
7. Resize the window. This widget has been configured with the "setGrid"
option on, so that if you resize the window it will always resize to an
@@ -74,4 +86,3 @@ even number of characters high and wide. Also, if you make the window
narrow you can see that long lines automatically wrap around onto
additional lines so that all the information is always visible.}
$w.text mark set insert 0.0
-
diff --git a/tk/library/demos/timer b/tk/library/demos/timer
index 04a68f37f3e..5241331f839 100755
--- a/tk/library/demos/timer
+++ b/tk/library/demos/timer
@@ -7,35 +7,41 @@ exec wish "$0" "$@"
#
# RCS: @(#) $Id$
-label .counter -text 0.00 -relief raised -width 10
+label .counter -text 0.00 -relief raised -width 10 -padx 2m -pady 1m
button .start -text Start -command {
- if $stopped {
+ if {$stopped} {
set stopped 0
+ set startMoment [clock clicks -milliseconds]
tick
+ .stop configure -state normal
+ .start configure -state disabled
}
}
-button .stop -text Stop -command {set stopped 1}
+button .stop -text Stop -state disabled -command {
+ set stopped 1
+ .stop configure -state disabled
+ .start configure -state normal
+}
pack .counter -side bottom -fill both
pack .start -side left -fill both -expand yes
pack .stop -side right -fill both -expand yes
-set seconds 0
-set hundredths 0
+set startMoment {}
+
set stopped 1
proc tick {} {
- global seconds hundredths stopped
- if $stopped return
+ global startMoment stopped
+ if {$stopped} {return}
after 50 tick
- set hundredths [expr $hundredths+5]
- if {$hundredths >= 100} {
- set hundredths 0
- set seconds [expr $seconds+1]
- }
- .counter config -text [format "%d.%02d" $seconds $hundredths]
+ set elapsedMS [expr {[clock clicks -milliseconds] - $startMoment}]
+ .counter config -text [format "%.2f" [expr {double($elapsedMS)/1000}]]
}
bind . <Control-c> {destroy .}
bind . <Control-q> {destroy .}
focus .
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tk/library/demos/twind.tcl b/tk/library/demos/twind.tcl
index 475cbd724bf..0a41c0d1e49 100644
--- a/tk/library/demos/twind.tcl
+++ b/tk/library/demos/twind.tcl
@@ -115,7 +115,7 @@ proc textWindOff w {
proc textWindPlot t {
set c $t.c
- if [winfo exists $c] {
+ if {[winfo exists $c]} {
return
}
canvas $c -relief sunken -width 450 -height 300 -cursor top_left_arrow
@@ -129,20 +129,21 @@ proc textWindPlot t {
for {set i 0} {$i <= 10} {incr i} {
set x [expr {100 + ($i*30)}]
$c create line $x 250 $x 245 -width 2
- $c create text $x 254 -text [expr 10*$i] -anchor n -font $font
+ $c create text $x 254 -text [expr {10*$i}] -anchor n -font $font
}
for {set i 0} {$i <= 5} {incr i} {
set y [expr {250 - ($i*40)}]
$c create line 100 $y 105 $y -width 2
- $c create text 96 $y -text [expr $i*50].0 -anchor e -font $font
+ $c create text 96 $y -text [expr {$i*50}].0 -anchor e -font $font
}
- foreach point {{12 56} {20 94} {33 98} {32 120} {61 180}
- {75 160} {98 223}} {
+ foreach point {
+ {12 56} {20 94} {33 98} {32 120} {61 180} {75 160} {98 223}
+ } {
set x [expr {100 + (3*[lindex $point 0])}]
set y [expr {250 - (4*[lindex $point 1])/5}]
- set item [$c create oval [expr $x-6] [expr $y-6] \
- [expr $x+6] [expr $y+6] -width 1 -outline black \
+ set item [$c create oval [expr {$x-6}] [expr {$y-6}] \
+ [expr {$x+6}] [expr {$y+6}] -width 1 -outline black \
-fill SkyBlue2]
$c addtag point withtag $item
}
@@ -175,14 +176,14 @@ proc embPlotDown {w x y} {
proc embPlotMove {w x y} {
global embPlot
- $w move selected [expr $x-$embPlot(lastX)] [expr $y-$embPlot(lastY)]
+ $w move selected [expr {$x-$embPlot(lastX)}] [expr {$y-$embPlot(lastY)}]
set embPlot(lastX) $x
set embPlot(lastY) $y
}
proc textWindDel w {
set t $w.f.text
- if [winfo exists $t.c] {
+ if {[winfo exists $t.c]} {
$t delete $t.c
while {[string first [$t get plot] " \t\n"] >= 0} {
$t delete plot
@@ -194,4 +195,3 @@ proc textWindDel w {
proc embDefBg t {
$t configure -background [lindex [$t configure -background] 3]
}
-
diff --git a/tk/library/demos/vscale.tcl b/tk/library/demos/vscale.tcl
index 7f1afd2a780..278e7d0a659 100644
--- a/tk/library/demos/vscale.tcl
+++ b/tk/library/demos/vscale.tcl
@@ -39,11 +39,10 @@ $w.frame.scale set 75
proc setHeight {w height} {
incr height 21
- set y2 [expr $height - 30]
+ set y2 [expr {$height - 30}]
if {$y2 < 21} {
set y2 21
}
$w coords poly 15 20 35 20 35 $y2 45 $y2 25 $height 5 $y2 15 $y2 15 20
$w coords line 15 20 35 20 35 $y2 45 $y2 25 $height 5 $y2 15 $y2 15 20
}
-
diff --git a/tk/library/demos/widget b/tk/library/demos/widget
index eca4cb723c8..8414aab3471 100755
--- a/tk/library/demos/widget
+++ b/tk/library/demos/widget
@@ -15,7 +15,26 @@ exec wish "$0" "$@"
eval destroy [winfo child .]
wm title . "Widget Demonstration"
+if {$tcl_platform(platform) eq "unix"} {
+ # This won't work everywhere, but there's no other way in core Tk
+ # at the moment to display a coloured icon.
+ image create photo TclPowered \
+ -file [file join $tk_library images logo64.gif]
+ wm iconwindow . [toplevel ._iconWindow]
+ pack [label ._iconWindow.i -image TclPowered]
+ wm iconname . "tkWidgetDemo"
+}
+
+array set widgetFont {
+ main {Helvetica 12}
+ bold {Helvetica 12 bold}
+ title {Helvetica 18 bold}
+ status {Helvetica 10}
+ vars {Helvetica 14}
+}
+
set widgetDemo 1
+set font $widgetFont(main)
#----------------------------------------------------------------
# The code below create the main window, consisting of a menu bar
@@ -23,13 +42,12 @@ set widgetDemo 1
# all of the demos as hypertext items.
#----------------------------------------------------------------
-set font {Helvetica 14}
menu .menuBar -tearoff 0
.menuBar add cascade -menu .menuBar.file -label "File" -underline 0
menu .menuBar.file -tearoff 0
# On the Mac use the specia .apple menu for the about item
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string equal [tk windowingsystem] "classic"]} {
.menuBar add cascade -menu .menuBar.apple
menu .menuBar.apple -tearoff 0
.menuBar.apple add command -label "About..." -command "aboutBox"
@@ -46,9 +64,9 @@ bind . <F1> aboutBox
frame .statusBar
label .statusBar.lab -text " " -relief sunken -bd 1 \
- -font -*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* -anchor w
+ -font $widgetFont(status) -anchor w
label .statusBar.foo -width 8 -relief sunken -bd 1 \
- -font -*-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* -anchor w
+ -font $widgetFont(status) -anchor w
pack .statusBar.lab -side left -padx 2 -expand yes -fill both
pack .statusBar.foo -side left -padx 2
pack .statusBar -side bottom -fill x -pady 2
@@ -57,8 +75,9 @@ frame .textFrame
scrollbar .s -orient vertical -command {.t yview} -highlightthickness 0 \
-takefocus 1
pack .s -in .textFrame -side right -fill y
-text .t -yscrollcommand {.s set} -wrap word -width 60 -height 30 -font $font \
- -setgrid 1 -highlightthickness 0 -padx 4 -pady 2 -takefocus 0
+text .t -yscrollcommand {.s set} -wrap word -width 70 -height 30 \
+ -font $widgetFont(main) -setgrid 1 -highlightthickness 0 \
+ -padx 4 -pady 2 -takefocus 0
pack .t -in .textFrame -expand y -fill both -padx 1
pack .textFrame -expand yes -fill both
@@ -66,7 +85,8 @@ pack .textFrame -expand yes -fill both
# section titles and demo descriptions. Also define the bindings for
# tags.
-.t tag configure title -font {Helvetica 18 bold}
+.t tag configure title -font $widgetFont(title)
+.t tag configure bold -font $widgetFont(bold)
# We put some "space" characters to the left and right of each demo description
# so that the descriptions are highlighted only when the mouse cursor
@@ -120,113 +140,86 @@ set lastLine ""
# Create the text for the text widget.
-.t insert end "Tk Widget Demonstrations\n" title
-.t insert end {
-This application provides a front end for several short scripts that demonstrate what you can do with Tk widgets. Each of the numbered lines below describes a demonstration; you can click on it to invoke the demonstration. Once the demonstration window appears, you can click the "See Code" button to see the Tcl/Tk code that created the demonstration. If you wish, you can edit the code and click the "Rerun Demo" button in the code window to reinvoke the demonstration with the modified code.
+proc addDemoSection {title demos} {
+ .t insert end "\n" {} $title title " \n " demospace
+ set num 0
+ foreach {name description} $demos {
+ .t insert end "[incr num]. $description." [list demo demo-$name]
+ .t insert end " \n " demospace
+ }
+}
+.t insert end "Tk Widget Demonstrations\n" title
+.t insert end "\nThis application provides a front end for several short\
+ scripts that demonstrate what you can do with Tk widgets. Each of\
+ the numbered lines below describes a demonstration; you can click\
+ on it to invoke the demonstration. Once the demonstration window\
+ appears, you can click the " {} "See Code" bold " button to see the\
+ Tcl/Tk code that created the demonstration. If you wish, you can\
+ edit the code and click the " {} "Rerun Demo" bold " button in the\
+ code window to reinvoke the demonstration with the modified code.\n"
+
+addDemoSection "Labels, buttons, checkbuttons, and radiobuttons" {
+ label "Labels (text and bitmaps)"
+ button "Buttons"
+ check "Check-buttons (select any of a group)"
+ radio "Radio-buttons (select one of a group)"
+ puzzle "A 15-puzzle game made out of buttons"
+ icon "Iconic buttons that use bitmaps"
+ image1 "Two labels displaying images"
+ image2 "A simple user interface for viewing images"
+ labelframe "Labelled frames"
+}
+addDemoSection "Listboxes" {
+ states "The 50 states"
+ colors "Colors: change the color scheme for the application"
+ sayings "A collection of famous and infamous sayings"
+}
+addDemoSection "Entries and Spin-boxes" {
+ entry1 "Entries without scrollbars"
+ entry2 "Entries with scrollbars"
+ entry3 "Validated entries and password fields"
+ spin "Spin-boxes"
+ form "Simple Rolodex-like form"
+}
+addDemoSection "Text" {
+ text "Basic editable text"
+ style "Text display styles"
+ bind "Hypertext (tag bindings)"
+ twind "A text widget with embedded windows"
+ search "A search tool built with a text widget"
+}
+addDemoSection "Canvases" {
+ items "The canvas item types"
+ plot "A simple 2-D plot"
+ ctext "Text items in canvases"
+ arrow "An editor for arrowheads on canvas lines"
+ ruler "A ruler with adjustable tab stops"
+ floor "A building floor plan"
+ cscroll "A simple scrollable canvas"
+}
+addDemoSection "Scales" {
+ hscale "Horizontal scale"
+ vscale "Vertical scale"
+}
+addDemoSection "Paned Windows" {
+ paned1 "Horizontal paned window"
+ paned2 "Vertical paned window"
+}
+addDemoSection "Menus" {
+ menu "Menus and cascades (sub-menus)"
+ menubu "Menu-buttons"
+}
+addDemoSection "Common Dialogs" {
+ msgbox "Message boxes"
+ filebox "File selection dialog"
+ clrpick "Color picker"
+}
+addDemoSection "Miscellaneous" {
+ bitmap "The built-in bitmaps"
+ dialog1 "A dialog box with a local grab"
+ dialog2 "A dialog box with a global grab"
}
-.t insert end "Labels, buttons, checkbuttons, and radiobuttons" title
-.t insert end " \n " {demospace}
-.t insert end "1. Labels (text and bitmaps)." {demo demo-label}
-.t insert end " \n " {demospace}
-.t insert end "2. Buttons." {demo demo-button}
-.t insert end " \n " {demospace}
-.t insert end "3. Checkbuttons (select any of a group)." {demo demo-check}
-.t insert end " \n " {demospace}
-.t insert end "4. Radiobuttons (select one of a group)." {demo demo-radio}
-.t insert end " \n " {demospace}
-.t insert end "5. A 15-puzzle game made out of buttons." {demo demo-puzzle}
-.t insert end " \n " {demospace}
-.t insert end "6. Iconic buttons that use bitmaps." {demo demo-icon}
-.t insert end " \n " {demospace}
-.t insert end "7. Two labels displaying images." {demo demo-image1}
-.t insert end " \n " {demospace}
-.t insert end "8. A simple user interface for viewing images." \
- {demo demo-image2}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Listboxes" title
-.t insert end " \n " {demospace}
-.t insert end "1. 50 states." {demo demo-states}
-.t insert end " \n " {demospace}
-.t insert end "2. Colors: change the color scheme for the application." \
- {demo demo-colors}
-.t insert end " \n " {demospace}
-.t insert end "3. A collection of famous sayings." {demo demo-sayings}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Entries" title
-.t insert end " \n " {demospace}
-.t insert end "1. Without scrollbars." {demo demo-entry1}
-.t insert end " \n " {demospace}
-.t insert end "2. With scrollbars." {demo demo-entry2}
-.t insert end " \n " {demospace}
-.t insert end "3. Simple Rolodex-like form." {demo demo-form}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Text" title
-.t insert end " \n " {demospace}
-.t insert end "1. Basic editable text." {demo demo-text}
-.t insert end " \n " {demospace}
-.t insert end "2. Text display styles." {demo demo-style}
-.t insert end " \n " {demospace}
-.t insert end "3. Hypertext (tag bindings)." {demo demo-bind}
-.t insert end " \n " {demospace}
-.t insert end "4. A text widget with embedded windows." {demo demo-twind}
-.t insert end " \n " {demospace}
-.t insert end "5. A search tool built with a text widget." {demo demo-search}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Canvases" title
-.t insert end " \n " {demospace}
-.t insert end "1. The canvas item types." {demo demo-items}
-.t insert end " \n " {demospace}
-.t insert end "2. A simple 2-D plot." {demo demo-plot}
-.t insert end " \n " {demospace}
-.t insert end "3. Text items in canvases." {demo demo-ctext}
-.t insert end " \n " {demospace}
-.t insert end "4. An editor for arrowheads on canvas lines." {demo demo-arrow}
-.t insert end " \n " {demospace}
-.t insert end "5. A ruler with adjustable tab stops." {demo demo-ruler}
-.t insert end " \n " {demospace}
-.t insert end "6. A building floor plan." {demo demo-floor}
-.t insert end " \n " {demospace}
-.t insert end "7. A simple scrollable canvas." {demo demo-cscroll}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Scales" title
-.t insert end " \n " {demospace}
-.t insert end "1. Vertical scale." {demo demo-vscale}
-.t insert end " \n " {demospace}
-.t insert end "2. Horizontal scale." {demo demo-hscale}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Menus" title
-.t insert end " \n " {demospace}
-.t insert end "1. Menus and cascades." \
- {demo demo-menu}
-.t insert end " \n " {demospace}
-.t insert end "2. Menubuttons"\
- {demo demo-menubu}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Common Dialogs" title
-.t insert end " \n " {demospace}
-.t insert end "1. Message boxes." {demo demo-msgbox}
-.t insert end " \n " {demospace}
-.t insert end "2. File selection dialog." {demo demo-filebox}
-.t insert end " \n " {demospace}
-.t insert end "3. Color picker." {demo demo-clrpick}
-.t insert end " \n " {demospace}
-
-.t insert end \n {} "Miscellaneous" title
-.t insert end " \n " {demospace}
-.t insert end "1. The built-in bitmaps." {demo demo-bitmap}
-.t insert end " \n " {demospace}
-.t insert end "2. A dialog box with a local grab." {demo demo-dialog1}
-.t insert end " \n " {demospace}
-.t insert end "3. A dialog box with a global grab." {demo demo-dialog2}
-.t insert end " \n " {demospace}
.t configure -state disabled
focus .s
@@ -251,11 +244,12 @@ proc positionWindow w {
# args - Any number of names of variables.
proc showVars {w args} {
+ global widgetFont
catch {destroy $w}
toplevel $w
wm title $w "Variable values"
label $w.title -text "Variable values:" -width 20 -anchor center \
- -font {Helvetica 18}
+ -font $widgetFont(vars)
pack $w.title -side top -fill x
set len 1
foreach i $args {
@@ -385,8 +379,15 @@ proc showCode w {
#
proc aboutBox {} {
tk_messageBox -icon info -type ok -title "About Widget Demo" -message \
-"Tk widget demonstration\n\n\
-Copyright (c) 1996-1997 Sun Microsystems, Inc."
-}
+"Tk widget demonstration
+
+Copyright (c) 1996-1997 Sun Microsystems, Inc.
+Copyright (c) 1997-2000 Ajuba Solutions, Inc.
+
+Copyright (c) 2001-2002 Donal K. Fellows"
+}
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/tk/library/dialog.tcl b/tk/library/dialog.tcl
index 37dd66460bb..2d5036a66be 100644
--- a/tk/library/dialog.tcl
+++ b/tk/library/dialog.tcl
@@ -13,7 +13,7 @@
#
#
-# tk_dialog:
+# ::tk_dialog:
#
# This procedure displays a dialog box, waits for a button in the dialog
# to be invoked, then returns the index of the selected button. If the
@@ -29,8 +29,9 @@
# args - One or more strings to display in buttons across the
# bottom of the dialog box.
-proc tk_dialog {w title text bitmap default args} {
- global tkPriv tcl_platform
+proc ::tk_dialog {w title text bitmap default args} {
+ global tcl_platform
+ variable ::tk::Priv
# Check that $default was properly given
if {[string is int $default]} {
@@ -51,7 +52,7 @@ proc tk_dialog {w title text bitmap default args} {
toplevel $w -class Dialog
wm title $w $title
wm iconname $w Dialog
- wm protocol $w WM_DELETE_WINDOW {set tkPriv(button) -1}
+ wm protocol $w WM_DELETE_WINDOW { }
# Dialog boxes should be transient with respect to their parent,
# so that they will always stay on top of their parent window. However,
@@ -60,17 +61,18 @@ proc tk_dialog {w title text bitmap default args} {
# window, this can hang the entire application. Therefore we only make
# the dialog transient if the parent is viewable.
#
- if { [winfo viewable [winfo toplevel [winfo parent $w]]] } {
+ if {[winfo viewable [winfo toplevel [winfo parent $w]]] } {
wm transient $w [winfo toplevel [winfo parent $w]]
}
- if {[string equal $tcl_platform(platform) "macintosh"]} {
- unsupported1 style $w dBoxProc
+ if {[string equal $tcl_platform(platform) "macintosh"]
+ || [string equal [tk windowingsystem] "aqua"]} {
+ ::tk::unsupported::MacWindowStyle style $w dBoxProc
}
frame $w.bot
frame $w.top
- if {[string equal $tcl_platform(platform) "unix"]} {
+ if {[string equal [tk windowingsystem] "x11"]} {
$w.bot configure -relief raised -bd 1
$w.top configure -relief raised -bd 1
}
@@ -82,7 +84,8 @@ proc tk_dialog {w title text bitmap default args} {
# overridden by the caller).
option add *Dialog.msg.wrapLength 3i widgetDefault
- if {[string equal $tcl_platform(platform) "macintosh"]} {
+ if {[string equal $tcl_platform(platform) "macintosh"]
+ || [string equal [tk windowingsystem] "aqua"]} {
option add *Dialog.msg.font system widgetDefault
} else {
option add *Dialog.msg.font {Times 12} widgetDefault
@@ -91,7 +94,8 @@ proc tk_dialog {w title text bitmap default args} {
label $w.msg -justify left -text $text
pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m
if {[string compare $bitmap ""]} {
- if {[string equal $tcl_platform(platform) "macintosh"] && \
+ if {([string equal $tcl_platform(platform) "macintosh"]
+ || [string equal [tk windowingsystem] "aqua"]) &&\
[string equal $bitmap "error"]} {
set bitmap "stop"
}
@@ -103,16 +107,18 @@ proc tk_dialog {w title text bitmap default args} {
set i 0
foreach but $args {
- button $w.button$i -text $but -command [list set tkPriv(button) $i]
+ button $w.button$i -text $but -command [list set ::tk::Priv(button) $i]
if {$i == $default} {
$w.button$i configure -default active
} else {
$w.button$i configure -default normal
}
- grid $w.button$i -in $w.bot -column $i -row 0 -sticky ew -padx 10
+ grid $w.button$i -in $w.bot -column $i -row 0 -sticky ew \
+ -padx 10 -pady 4
grid columnconfigure $w.bot $i
# We boost the size of some Mac buttons for l&f
- if {[string equal $tcl_platform(platform) "macintosh"]} {
+ if {[string equal $tcl_platform(platform) "macintosh"]
+ || [string equal [tk windowingsystem] "aqua"]} {
set tmp [string tolower $but]
if {[string equal $tmp "ok"] || [string equal $tmp "cancel"]} {
grid columnconfigure $w.bot $i -minsize [expr {59 + 20}]
@@ -129,7 +135,7 @@ proc tk_dialog {w title text bitmap default args} {
[list $w.button$default] configure -state active -relief sunken
update idletasks
after 100
- set tkPriv(button) $default
+ set ::tk::Priv(button) $default
"
}
@@ -137,7 +143,7 @@ proc tk_dialog {w title text bitmap default args} {
# button variable to -1; this is needed in case something happens
# that destroys the window, such as its parent window being destroyed.
- bind $w <Destroy> {set tkPriv(button) -1}
+ bind $w <Destroy> {set ::tk::Priv(button) -1}
# 6. Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
@@ -150,7 +156,6 @@ proc tk_dialog {w title text bitmap default args} {
set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \
- [winfo vrooty [winfo parent $w]]}]
wm geom $w +$x+$y
- update idle
wm deiconify $w
# 7. Set a grab and claim the focus too.
@@ -173,12 +178,12 @@ proc tk_dialog {w title text bitmap default args} {
# may take the focus away so we can't redirect it. Finally,
# restore any grab that was in effect.
- tkwait variable tkPriv(button)
+ vwait ::tk::Priv(button)
catch {focus $oldFocus}
catch {
# It's possible that the window has already been destroyed,
# hence this "catch". Delete the Destroy handler so that
- # tkPriv(button) doesn't get reset by it.
+ # Priv(button) doesn't get reset by it.
bind $w <Destroy> {}
destroy $w
@@ -190,7 +195,5 @@ proc tk_dialog {w title text bitmap default args} {
grab -global $oldGrab
}
}
- return $tkPriv(button)
+ return $Priv(button)
}
-
-
diff --git a/tk/library/entry.tcl b/tk/library/entry.tcl
index 594811a6108..5bc2ed381b0 100644
--- a/tk/library/entry.tcl
+++ b/tk/library/entry.tcl
@@ -13,7 +13,7 @@
#
#-------------------------------------------------------------------------
-# Elements of tkPriv that are used in this file:
+# Elements of tk::Priv that are used in this file:
#
# afterId - If non-null, it means that auto-scanning is underway
# and it gives the "after" id for the next auto-scan
@@ -33,128 +33,129 @@
# The code below creates the default class bindings for entries.
#-------------------------------------------------------------------------
bind Entry <<Cut>> {
- if {![catch {tkEntryGetSelection %W} tkPriv(data)]} {
+ if {![catch {tk::EntryGetSelection %W} tk::Priv(data)]} {
clipboard clear -displayof %W
- clipboard append -displayof %W $tkPriv(data)
+ clipboard append -displayof %W $tk::Priv(data)
%W delete sel.first sel.last
- unset tkPriv(data)
+ unset tk::Priv(data)
}
}
bind Entry <<Copy>> {
- if {![catch {tkEntryGetSelection %W} tkPriv(data)]} {
+ if {![catch {tk::EntryGetSelection %W} tk::Priv(data)]} {
clipboard clear -displayof %W
- clipboard append -displayof %W $tkPriv(data)
- unset tkPriv(data)
+ clipboard append -displayof %W $tk::Priv(data)
+ unset tk::Priv(data)
}
}
bind Entry <<Paste>> {
global tcl_platform
catch {
- if {[string compare $tcl_platform(platform) "unix"]} {
+ if {[string compare [tk windowingsystem] "x11"]} {
catch {
%W delete sel.first sel.last
}
}
- %W insert insert [selection get -displayof %W -selection CLIPBOARD]
- tkEntrySeeInsert %W
+ %W insert insert [::tk::GetSelection %W CLIPBOARD]
+ tk::EntrySeeInsert %W
}
}
bind Entry <<Clear>> {
%W delete sel.first sel.last
}
bind Entry <<PasteSelection>> {
- if {!$tkPriv(mouseMoved) || $tk_strictMotif} {
- tkEntryPaste %W %x
+ if {$tk_strictMotif || ![info exists tk::Priv(mouseMoved)]
+ || !$tk::Priv(mouseMoved)} {
+ tk::EntryPaste %W %x
}
}
# Standard Motif bindings:
bind Entry <1> {
- tkEntryButton1 %W %x
+ tk::EntryButton1 %W %x
%W selection clear
}
bind Entry <B1-Motion> {
- set tkPriv(x) %x
- tkEntryMouseSelect %W %x
+ set tk::Priv(x) %x
+ tk::EntryMouseSelect %W %x
}
bind Entry <Double-1> {
- set tkPriv(selectMode) word
- tkEntryMouseSelect %W %x
- catch {%W icursor sel.first}
+ set tk::Priv(selectMode) word
+ tk::EntryMouseSelect %W %x
+ catch {%W icursor sel.last}
}
bind Entry <Triple-1> {
- set tkPriv(selectMode) line
- tkEntryMouseSelect %W %x
- %W icursor 0
+ set tk::Priv(selectMode) line
+ tk::EntryMouseSelect %W %x
+ catch {%W icursor sel.last}
}
bind Entry <Shift-1> {
- set tkPriv(selectMode) char
+ set tk::Priv(selectMode) char
%W selection adjust @%x
}
bind Entry <Double-Shift-1> {
- set tkPriv(selectMode) word
- tkEntryMouseSelect %W %x
+ set tk::Priv(selectMode) word
+ tk::EntryMouseSelect %W %x
}
bind Entry <Triple-Shift-1> {
- set tkPriv(selectMode) line
- tkEntryMouseSelect %W %x
+ set tk::Priv(selectMode) line
+ tk::EntryMouseSelect %W %x
}
bind Entry <B1-Leave> {
- set tkPriv(x) %x
- tkEntryAutoScan %W
+ set tk::Priv(x) %x
+ tk::EntryAutoScan %W
}
bind Entry <B1-Enter> {
- tkCancelRepeat
+ tk::CancelRepeat
}
bind Entry <ButtonRelease-1> {
- tkCancelRepeat
+ tk::CancelRepeat
}
bind Entry <Control-1> {
%W icursor @%x
}
bind Entry <Left> {
- tkEntrySetCursor %W [expr {[%W index insert] - 1}]
+ tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
}
bind Entry <Right> {
- tkEntrySetCursor %W [expr {[%W index insert] + 1}]
+ tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
}
bind Entry <Shift-Left> {
- tkEntryKeySelect %W [expr {[%W index insert] - 1}]
- tkEntrySeeInsert %W
+ tk::EntryKeySelect %W [expr {[%W index insert] - 1}]
+ tk::EntrySeeInsert %W
}
bind Entry <Shift-Right> {
- tkEntryKeySelect %W [expr {[%W index insert] + 1}]
- tkEntrySeeInsert %W
+ tk::EntryKeySelect %W [expr {[%W index insert] + 1}]
+ tk::EntrySeeInsert %W
}
bind Entry <Control-Left> {
- tkEntrySetCursor %W [tkEntryPreviousWord %W insert]
+ tk::EntrySetCursor %W [tk::EntryPreviousWord %W insert]
}
bind Entry <Control-Right> {
- tkEntrySetCursor %W [tkEntryNextWord %W insert]
+ tk::EntrySetCursor %W [tk::EntryNextWord %W insert]
}
bind Entry <Shift-Control-Left> {
- tkEntryKeySelect %W [tkEntryPreviousWord %W insert]
- tkEntrySeeInsert %W
+ tk::EntryKeySelect %W [tk::EntryPreviousWord %W insert]
+ tk::EntrySeeInsert %W
}
bind Entry <Shift-Control-Right> {
- tkEntryKeySelect %W [tkEntryNextWord %W insert]
- tkEntrySeeInsert %W
+ tk::EntryKeySelect %W [tk::EntryNextWord %W insert]
+ tk::EntrySeeInsert %W
}
bind Entry <Home> {
- tkEntrySetCursor %W 0
+ tk::EntrySetCursor %W 0
}
bind Entry <Shift-Home> {
- tkEntryKeySelect %W 0
- tkEntrySeeInsert %W
+ tk::EntryKeySelect %W 0
+ tk::EntrySeeInsert %W
}
bind Entry <End> {
- tkEntrySetCursor %W end
+ tk::EntrySetCursor %W end
}
bind Entry <Shift-End> {
- tkEntryKeySelect %W end
- tkEntrySeeInsert %W
+ tk::EntryKeySelect %W end
+ tk::EntrySeeInsert %W
}
bind Entry <Delete> {
@@ -165,7 +166,7 @@ bind Entry <Delete> {
}
}
bind Entry <BackSpace> {
- tkEntryBackspace %W
+ tk::EntryBackspace %W
}
bind Entry <Control-space> {
@@ -187,7 +188,7 @@ bind Entry <Control-backslash> {
%W selection clear
}
bind Entry <KeyPress> {
- tkEntryInsert %W %A
+ tk::EntryInsert %W %A
}
# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
@@ -202,7 +203,8 @@ bind Entry <Escape> {# nothing}
bind Entry <Return> {# nothing}
bind Entry <KP_Enter> {# nothing}
bind Entry <Tab> {# nothing}
-if {[string equal $tcl_platform(platform) "macintosh"]} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
bind Entry <Command-KeyPress> {# nothing}
}
@@ -210,7 +212,7 @@ if {[string equal $tcl_platform(platform) "macintosh"]} {
# generates the <<Paste>> event, so we don't need to do anything here.
if {[string compare $tcl_platform(platform) "windows"]} {
bind Entry <Insert> {
- catch {tkEntryInsert %W [selection get -displayof %W]}
+ catch {tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]}
}
}
@@ -218,12 +220,12 @@ if {[string compare $tcl_platform(platform) "windows"]} {
bind Entry <Control-a> {
if {!$tk_strictMotif} {
- tkEntrySetCursor %W 0
+ tk::EntrySetCursor %W 0
}
}
bind Entry <Control-b> {
if {!$tk_strictMotif} {
- tkEntrySetCursor %W [expr {[%W index insert] - 1}]
+ tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
}
}
bind Entry <Control-d> {
@@ -233,17 +235,17 @@ bind Entry <Control-d> {
}
bind Entry <Control-e> {
if {!$tk_strictMotif} {
- tkEntrySetCursor %W end
+ tk::EntrySetCursor %W end
}
}
bind Entry <Control-f> {
if {!$tk_strictMotif} {
- tkEntrySetCursor %W [expr {[%W index insert] + 1}]
+ tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
}
}
bind Entry <Control-h> {
if {!$tk_strictMotif} {
- tkEntryBackspace %W
+ tk::EntryBackspace %W
}
}
bind Entry <Control-k> {
@@ -253,32 +255,32 @@ bind Entry <Control-k> {
}
bind Entry <Control-t> {
if {!$tk_strictMotif} {
- tkEntryTranspose %W
+ tk::EntryTranspose %W
}
}
bind Entry <Meta-b> {
if {!$tk_strictMotif} {
- tkEntrySetCursor %W [tkEntryPreviousWord %W insert]
+ tk::EntrySetCursor %W [tk::EntryPreviousWord %W insert]
}
}
bind Entry <Meta-d> {
if {!$tk_strictMotif} {
- %W delete insert [tkEntryNextWord %W insert]
+ %W delete insert [tk::EntryNextWord %W insert]
}
}
bind Entry <Meta-f> {
if {!$tk_strictMotif} {
- tkEntrySetCursor %W [tkEntryNextWord %W insert]
+ tk::EntrySetCursor %W [tk::EntryNextWord %W insert]
}
}
bind Entry <Meta-BackSpace> {
if {!$tk_strictMotif} {
- %W delete [tkEntryPreviousWord %W insert] insert
+ %W delete [tk::EntryPreviousWord %W insert] insert
}
}
bind Entry <Meta-Delete> {
if {!$tk_strictMotif} {
- %W delete [tkEntryPreviousWord %W insert] insert
+ %W delete [tk::EntryPreviousWord %W insert] insert
}
}
@@ -286,22 +288,16 @@ bind Entry <Meta-Delete> {
bind Entry <2> {
if {!$tk_strictMotif} {
- %W scan mark %x
- set tkPriv(x) %x
- set tkPriv(y) %y
- set tkPriv(mouseMoved) 0
+ ::tk::EntryScanMark %W %x
}
}
bind Entry <B2-Motion> {
if {!$tk_strictMotif} {
- if {abs(%x-$tkPriv(x)) > 2} {
- set tkPriv(mouseMoved) 1
- }
- %W scan dragto %x
+ ::tk::EntryScanDrag %W %x
}
}
-# tkEntryClosestGap --
+# ::tk::EntryClosestGap --
# Given x and y coordinates, this procedure finds the closest boundary
# between characters to the given coordinates and returns the index
# of the character just after the boundary.
@@ -310,7 +306,7 @@ bind Entry <B2-Motion> {
# w - The entry window.
# x - X-coordinate within the window.
-proc tkEntryClosestGap {w x} {
+proc ::tk::EntryClosestGap {w x} {
set pos [$w index @$x]
set bbox [$w bbox $pos]
if {($x - [lindex $bbox 0]) < ([lindex $bbox 2]/2)} {
@@ -319,7 +315,7 @@ proc tkEntryClosestGap {w x} {
incr pos
}
-# tkEntryButton1 --
+# ::tk::EntryButton1 --
# This procedure is invoked to handle button-1 presses in entry
# widgets. It moves the insertion cursor, sets the selection anchor,
# and claims the input focus.
@@ -328,18 +324,18 @@ proc tkEntryClosestGap {w x} {
# w - The entry window in which the button was pressed.
# x - The x-coordinate of the button press.
-proc tkEntryButton1 {w x} {
- global tkPriv
+proc ::tk::EntryButton1 {w x} {
+ variable ::tk::Priv
- set tkPriv(selectMode) char
- set tkPriv(mouseMoved) 0
- set tkPriv(pressX) $x
- $w icursor [tkEntryClosestGap $w $x]
+ set Priv(selectMode) char
+ set Priv(mouseMoved) 0
+ set Priv(pressX) $x
+ $w icursor [EntryClosestGap $w $x]
$w selection from insert
- if {[string equal [$w cget -state] "normal"]} {focus $w}
+ if {[string compare "disabled" [$w cget -state]]} {focus $w}
}
-# tkEntryMouseSelect --
+# ::tk::EntryMouseSelect --
# This procedure is invoked when dragging out a selection with
# the mouse. Depending on the selection mode (character, word,
# line) it selects in different-sized units. This procedure
@@ -350,17 +346,17 @@ proc tkEntryButton1 {w x} {
# w - The entry window in which the button was pressed.
# x - The x-coordinate of the mouse.
-proc tkEntryMouseSelect {w x} {
- global tkPriv
+proc ::tk::EntryMouseSelect {w x} {
+ variable ::tk::Priv
- set cur [tkEntryClosestGap $w $x]
+ set cur [EntryClosestGap $w $x]
set anchor [$w index anchor]
- if {($cur != $anchor) || (abs($tkPriv(pressX) - $x) >= 3)} {
- set tkPriv(mouseMoved) 1
+ if {($cur != $anchor) || (abs($Priv(pressX) - $x) >= 3)} {
+ set Priv(mouseMoved) 1
}
- switch $tkPriv(selectMode) {
+ switch $Priv(selectMode) {
char {
- if {$tkPriv(mouseMoved)} {
+ if {$Priv(mouseMoved)} {
if {$cur < $anchor} {
$w selection range $cur $anchor
} elseif {$cur > $anchor} {
@@ -390,10 +386,13 @@ proc tkEntryMouseSelect {w x} {
$w selection range 0 end
}
}
+ if {$Priv(mouseMoved)} {
+ $w icursor $cur
+ }
update idletasks
}
-# tkEntryPaste --
+# ::tk::EntryPaste --
# This procedure sets the insertion cursor to the current mouse position,
# pastes the selection there, and sets the focus to the window.
#
@@ -401,15 +400,13 @@ proc tkEntryMouseSelect {w x} {
# w - The entry window.
# x - X position of the mouse.
-proc tkEntryPaste {w x} {
- global tkPriv
-
- $w icursor [tkEntryClosestGap $w $x]
- catch {$w insert insert [selection get -displayof $w]}
- if {[string equal [$w cget -state] "normal"]} {focus $w}
+proc ::tk::EntryPaste {w x} {
+ $w icursor [EntryClosestGap $w $x]
+ catch {$w insert insert [::tk::GetSelection $w PRIMARY]}
+ if {[string compare "disabled" [$w cget -state]]} {focus $w}
}
-# tkEntryAutoScan --
+# ::tk::EntryAutoScan --
# This procedure is invoked when the mouse leaves an entry window
# with button 1 down. It scrolls the window left or right,
# depending on where the mouse is, and reschedules itself as an
@@ -419,21 +416,21 @@ proc tkEntryPaste {w x} {
# Arguments:
# w - The entry window.
-proc tkEntryAutoScan {w} {
- global tkPriv
- set x $tkPriv(x)
+proc ::tk::EntryAutoScan {w} {
+ variable ::tk::Priv
+ set x $Priv(x)
if {![winfo exists $w]} return
if {$x >= [winfo width $w]} {
$w xview scroll 2 units
- tkEntryMouseSelect $w $x
+ EntryMouseSelect $w $x
} elseif {$x < 0} {
$w xview scroll -2 units
- tkEntryMouseSelect $w $x
+ EntryMouseSelect $w $x
}
- set tkPriv(afterId) [after 50 [list tkEntryAutoScan $w]]
+ set Priv(afterId) [after 50 [list tk::EntryAutoScan $w]]
}
-# tkEntryKeySelect --
+# ::tk::EntryKeySelect --
# This procedure is invoked when stroking out selections using the
# keyboard. It moves the cursor to a new position, then extends
# the selection to that position.
@@ -443,7 +440,7 @@ proc tkEntryAutoScan {w} {
# new - A new position for the insertion cursor (the cursor hasn't
# actually been moved to this position yet).
-proc tkEntryKeySelect {w new} {
+proc ::tk::EntryKeySelect {w new} {
if {![$w selection present]} {
$w selection from insert
$w selection to $new
@@ -453,7 +450,7 @@ proc tkEntryKeySelect {w new} {
$w icursor $new
}
-# tkEntryInsert --
+# ::tk::EntryInsert --
# 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.
@@ -462,7 +459,7 @@ proc tkEntryKeySelect {w new} {
# w - The entry window in which to insert the string
# s - The string to insert (usually just a single character)
-proc tkEntryInsert {w s} {
+proc ::tk::EntryInsert {w s} {
if {[string equal $s ""]} {
return
}
@@ -474,10 +471,10 @@ proc tkEntryInsert {w s} {
}
}
$w insert insert $s
- tkEntrySeeInsert $w
+ EntrySeeInsert $w
}
-# tkEntryBackspace --
+# ::tk::EntryBackspace --
# Backspace over the character just before the insertion cursor.
# If backspacing would move the cursor off the left edge of the
# window, reposition the cursor at about the middle of the window.
@@ -485,7 +482,7 @@ proc tkEntryInsert {w s} {
# Arguments:
# w - The entry window in which to backspace.
-proc tkEntryBackspace w {
+proc ::tk::EntryBackspace w {
if {[$w selection present]} {
$w delete sel.first sel.last
} else {
@@ -500,21 +497,21 @@ proc tkEntryBackspace w {
}
}
-# tkEntrySeeInsert --
+# ::tk::EntrySeeInsert --
# Make sure that the insertion cursor is visible in the entry window.
# If not, adjust the view so that it is.
#
# Arguments:
# w - The entry window.
-proc tkEntrySeeInsert w {
+proc ::tk::EntrySeeInsert w {
set c [$w index insert]
if {($c < [$w index @0]) || ($c > [$w index @[winfo width $w]])} {
$w xview $c
}
}
-# tkEntrySetCursor -
+# ::tk::EntrySetCursor -
# Move the insertion cursor to a given position in an entry. Also
# clears the selection, if there is one in the entry, and makes sure
# that the insertion cursor is visible.
@@ -523,13 +520,13 @@ proc tkEntrySeeInsert w {
# w - The entry window.
# pos - The desired new position for the cursor in the window.
-proc tkEntrySetCursor {w pos} {
+proc ::tk::EntrySetCursor {w pos} {
$w icursor $pos
$w selection clear
- tkEntrySeeInsert $w
+ EntrySeeInsert $w
}
-# tkEntryTranspose -
+# ::tk::EntryTranspose -
# 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
@@ -539,7 +536,7 @@ proc tkEntrySetCursor {w pos} {
# Arguments:
# w - The entry window.
-proc tkEntryTranspose w {
+proc ::tk::EntryTranspose w {
set i [$w index insert]
if {$i < [$w index end]} {
incr i
@@ -548,13 +545,14 @@ proc tkEntryTranspose w {
if {$first < 0} {
return
}
- set new [string index [$w get] [expr {$i-1}]][string index [$w get] $first]
+ set data [$w get]
+ set new [string index $data [expr {$i-1}]][string index $data $first]
$w delete $first $i
$w insert insert $new
- tkEntrySeeInsert $w
+ EntrySeeInsert $w
}
-# tkEntryNextWord --
+# ::tk::EntryNextWord --
# 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
@@ -565,7 +563,7 @@ proc tkEntryTranspose w {
# start - Position at which to start search.
if {[string equal $tcl_platform(platform) "windows"]} {
- proc tkEntryNextWord {w start} {
+ proc ::tk::EntryNextWord {w start} {
set pos [tcl_endOfWord [$w get] [$w index $start]]
if {$pos >= 0} {
set pos [tcl_startOfNextWord [$w get] $pos]
@@ -576,7 +574,7 @@ if {[string equal $tcl_platform(platform) "windows"]} {
return $pos
}
} else {
- proc tkEntryNextWord {w start} {
+ proc ::tk::EntryNextWord {w start} {
set pos [tcl_endOfWord [$w get] [$w index $start]]
if {$pos < 0} {
return end
@@ -585,7 +583,7 @@ if {[string equal $tcl_platform(platform) "windows"]} {
}
}
-# tkEntryPreviousWord --
+# ::tk::EntryPreviousWord --
#
# Returns the index of the previous word position before a given
# position in the entry.
@@ -594,26 +592,61 @@ if {[string equal $tcl_platform(platform) "windows"]} {
# w - The entry window in which the cursor is to move.
# start - Position at which to start search.
-proc tkEntryPreviousWord {w start} {
+proc ::tk::EntryPreviousWord {w start} {
set pos [tcl_startOfPreviousWord [$w get] [$w index $start]]
if {$pos < 0} {
return 0
}
return $pos
}
-# tkEntryGetSelection --
+
+# ::tk::EntryScanMark --
+#
+# Marks the start of a possible scan drag operation
+#
+# Arguments:
+# w - The entry window from which the text to get
+# x - x location on screen
+
+proc ::tk::EntryScanMark {w x} {
+ $w scan mark $x
+ set ::tk::Priv(x) $x
+ set ::tk::Priv(y) 0 ; # not used
+ set ::tk::Priv(mouseMoved) 0
+}
+
+# ::tk::EntryScanDrag --
+#
+# Marks the start of a possible scan drag operation
+#
+# Arguments:
+# w - The entry window from which the text to get
+# x - x location on screen
+
+proc ::tk::EntryScanDrag {w x} {
+ # Make sure these exist, as some weird situations can trigger the
+ # motion binding without the initial press. [Bug #220269]
+ if {![info exists ::tk::Priv(x)]} { set ::tk::Priv(x) $x }
+ # allow for a delta
+ if {abs($x-$::tk::Priv(x)) > 2} {
+ set ::tk::Priv(mouseMoved) 1
+ }
+ $w scan dragto $x
+}
+
+# ::tk::EntryGetSelection --
#
# 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 tkEntryGetSelection {w} {
+proc ::tk::EntryGetSelection {w} {
set entryString [string range [$w get] [$w index sel.first] \
[expr {[$w index sel.last] - 1}]]
if {[string compare [$w cget -show] ""]} {
- regsub -all . $entryString [string index [$w cget -show] 0] entryString
+ return [string repeat [string index [$w cget -show] 0] \
+ [string length $entryString]]
}
return $entryString
}
-
diff --git a/tk/library/focus.tcl b/tk/library/focus.tcl
index 8661245cdca..ea0f64de269 100644
--- a/tk/library/focus.tcl
+++ b/tk/library/focus.tcl
@@ -11,7 +11,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# tk_focusNext --
+# ::tk_focusNext --
# This procedure returns the name of the next window after "w" in
# "focus order" (the window that should receive the focus next if
# Tab is typed in w). "Next" is defined by a pre-order search
@@ -22,7 +22,7 @@
# Arguments:
# w - Name of a window.
-proc tk_focusNext w {
+proc ::tk_focusNext w {
set cur $w
while {1} {
@@ -57,13 +57,13 @@ proc tk_focusNext w {
set children [winfo children $parent]
set i [lsearch -exact $children $cur]
}
- if {[string equal $w $cur] || [tkFocusOK $cur]} {
+ if {[string equal $w $cur] || [tk::FocusOK $cur]} {
return $cur
}
}
}
-# tk_focusPrev --
+# ::tk_focusPrev --
# This procedure returns the name of the previous window before "w" in
# "focus order" (the window that should receive the focus next if
# Shift-Tab is typed in w). "Next" is defined by a pre-order search
@@ -74,7 +74,7 @@ proc tk_focusNext w {
# Arguments:
# w - Name of a window.
-proc tk_focusPrev w {
+proc ::tk_focusPrev w {
set cur $w
while {1} {
@@ -108,13 +108,13 @@ proc tk_focusPrev w {
set i [llength $children]
}
set cur $parent
- if {[string equal $w $cur] || [tkFocusOK $cur]} {
+ if {[string equal $w $cur] || [tk::FocusOK $cur]} {
return $cur
}
}
}
-# tkFocusOK --
+# ::tk::FocusOK --
#
# This procedure is invoked to decide whether or not to focus on
# a given window. It returns 1 if it's OK to focus on the window,
@@ -128,7 +128,7 @@ proc tk_focusPrev w {
# Arguments:
# w - Name of a window.
-proc tkFocusOK w {
+proc ::tk::FocusOK w {
set code [catch {$w cget -takefocus} value]
if {($code == 0) && ($value != "")} {
if {$value == 0} {
@@ -152,7 +152,7 @@ proc tkFocusOK w {
regexp Key|Focus "[bind $w] [bind [winfo class $w]]"
}
-# tk_focusFollowsMouse --
+# ::tk_focusFollowsMouse --
#
# If this procedure is invoked, Tk will enter "focus-follows-mouse"
# mode, where the focus is always on whatever window contains the
@@ -162,13 +162,13 @@ proc tkFocusOK w {
# Arguments:
# None.
-proc tk_focusFollowsMouse {} {
+proc ::tk_focusFollowsMouse {} {
set old [bind all <Enter>]
set script {
if {[string equal "%d" "NotifyAncestor"] \
|| [string equal "%d" "NotifyNonlinear"] \
|| [string equal "%d" "NotifyInferior"]} {
- if {[tkFocusOK %W]} {
+ if {[tk::FocusOK %W]} {
focus %W
}
}
@@ -179,5 +179,3 @@ proc tk_focusFollowsMouse {} {
bind all <Enter> $script
}
}
-
-
diff --git a/tk/library/images/README b/tk/library/images/README
index 1a8d7781726..65101cd3797 100644
--- a/tk/library/images/README
+++ b/tk/library/images/README
@@ -10,4 +10,3 @@ used to promote Tcl in your product documentation, web site or other
places you so desire.
-
diff --git a/tk/library/listbox.tcl b/tk/library/listbox.tcl
index f65b31e0a6f..c48e9823743 100644
--- a/tk/library/listbox.tcl
+++ b/tk/library/listbox.tcl
@@ -13,7 +13,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#--------------------------------------------------------------------------
-# tkPriv elements used in this file:
+# tk::Priv elements used in this file:
#
# afterId - Token returned by "after" for autoscanning.
# listboxPrev - The last element to be selected or deselected
@@ -35,7 +35,7 @@
bind Listbox <1> {
if {[winfo exists %W]} {
- tkListboxBeginSelect %W [%W index @%x,%y]
+ tk::ListboxBeginSelect %W [%W index @%x,%y]
}
}
@@ -48,40 +48,40 @@ bind Listbox <Double-1> {
}
bind Listbox <B1-Motion> {
- set tkPriv(x) %x
- set tkPriv(y) %y
- tkListboxMotion %W [%W index @%x,%y]
+ set tk::Priv(x) %x
+ set tk::Priv(y) %y
+ tk::ListboxMotion %W [%W index @%x,%y]
}
bind Listbox <ButtonRelease-1> {
- tkCancelRepeat
+ tk::CancelRepeat
%W activate @%x,%y
}
bind Listbox <Shift-1> {
- tkListboxBeginExtend %W [%W index @%x,%y]
+ tk::ListboxBeginExtend %W [%W index @%x,%y]
}
bind Listbox <Control-1> {
- tkListboxBeginToggle %W [%W index @%x,%y]
+ tk::ListboxBeginToggle %W [%W index @%x,%y]
}
bind Listbox <B1-Leave> {
- set tkPriv(x) %x
- set tkPriv(y) %y
- tkListboxAutoScan %W
+ set tk::Priv(x) %x
+ set tk::Priv(y) %y
+ tk::ListboxAutoScan %W
}
bind Listbox <B1-Enter> {
- tkCancelRepeat
+ tk::CancelRepeat
}
bind Listbox <Up> {
- tkListboxUpDown %W -1
+ tk::ListboxUpDown %W -1
}
bind Listbox <Shift-Up> {
- tkListboxExtendUpDown %W -1
+ tk::ListboxExtendUpDown %W -1
}
bind Listbox <Down> {
- tkListboxUpDown %W 1
+ tk::ListboxUpDown %W 1
}
bind Listbox <Shift-Down> {
- tkListboxExtendUpDown %W 1
+ tk::ListboxExtendUpDown %W 1
}
bind Listbox <Left> {
%W xview scroll -1 units
@@ -123,7 +123,7 @@ bind Listbox <Control-Home> {
event generate %W <<ListboxSelect>>
}
bind Listbox <Shift-Control-Home> {
- tkListboxDataExtend %W 0
+ tk::ListboxDataExtend %W 0
}
bind Listbox <Control-End> {
%W activate end
@@ -133,7 +133,7 @@ bind Listbox <Control-End> {
event generate %W <<ListboxSelect>>
}
bind Listbox <Shift-Control-End> {
- tkListboxDataExtend %W [%W index end]
+ tk::ListboxDataExtend %W [%W index end]
}
bind Listbox <<Copy>> {
if {[string equal [selection own -displayof %W] "%W"]} {
@@ -142,22 +142,22 @@ bind Listbox <<Copy>> {
}
}
bind Listbox <space> {
- tkListboxBeginSelect %W [%W index active]
+ tk::ListboxBeginSelect %W [%W index active]
}
bind Listbox <Select> {
- tkListboxBeginSelect %W [%W index active]
+ tk::ListboxBeginSelect %W [%W index active]
}
bind Listbox <Control-Shift-space> {
- tkListboxBeginExtend %W [%W index active]
+ tk::ListboxBeginExtend %W [%W index active]
}
bind Listbox <Shift-Select> {
- tkListboxBeginExtend %W [%W index active]
+ tk::ListboxBeginExtend %W [%W index active]
}
bind Listbox <Escape> {
- tkListboxCancel %W
+ tk::ListboxCancel %W
}
bind Listbox <Control-slash> {
- tkListboxSelectAll %W
+ tk::ListboxSelectAll %W
}
bind Listbox <Control-backslash> {
if {[string compare [%W cget -selectmode] "browse"]} {
@@ -183,7 +183,7 @@ bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}
-if {[string equal "unix" $tcl_platform(platform)]} {
+if {[string equal "x11" [tk windowingsystem]]} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
@@ -200,7 +200,7 @@ if {[string equal "unix" $tcl_platform(platform)]} {
}
}
-# tkListboxBeginSelect --
+# ::tk::ListboxBeginSelect --
#
# This procedure is typically invoked on button-1 presses. It begins
# the process of making a selection in the listbox. Its exact behavior
@@ -212,8 +212,8 @@ if {[string equal "unix" $tcl_platform(platform)]} {
# el - The element for the selection operation (typically the
# one under the pointer). Must be in numerical form.
-proc tkListboxBeginSelect {w el} {
- global tkPriv
+proc ::tk::ListboxBeginSelect {w el} {
+ variable ::tk::Priv
if {[string equal [$w cget -selectmode] "multiple"]} {
if {[$w selection includes $el]} {
$w selection clear $el
@@ -224,13 +224,13 @@ proc tkListboxBeginSelect {w el} {
$w selection clear 0 end
$w selection set $el
$w selection anchor $el
- set tkPriv(listboxSelection) {}
- set tkPriv(listboxPrev) $el
+ set Priv(listboxSelection) {}
+ set Priv(listboxPrev) $el
}
event generate $w <<ListboxSelect>>
}
-# tkListboxMotion --
+# ::tk::ListboxMotion --
#
# This procedure is called to process mouse motion events while
# button 1 is down. It may move or extend the selection, depending
@@ -240,9 +240,9 @@ proc tkListboxBeginSelect {w el} {
# w - The listbox widget.
# el - The element under the pointer (must be a number).
-proc tkListboxMotion {w el} {
- global tkPriv
- if {$el == $tkPriv(listboxPrev)} {
+proc ::tk::ListboxMotion {w el} {
+ variable ::tk::Priv
+ if {$el == $Priv(listboxPrev)} {
return
}
set anchor [$w index anchor]
@@ -250,11 +250,11 @@ proc tkListboxMotion {w el} {
browse {
$w selection clear 0 end
$w selection set $el
- set tkPriv(listboxPrev) $el
+ set Priv(listboxPrev) $el
event generate $w <<ListboxSelect>>
}
extended {
- set i $tkPriv(listboxPrev)
+ set i $Priv(listboxPrev)
if {[string equal {} $i]} {
set i $el
$w selection set $el
@@ -266,28 +266,28 @@ proc tkListboxMotion {w el} {
$w selection clear $i $el
$w selection clear anchor $el
}
- if {![info exists tkPriv(listboxSelection)]} {
- set tkPriv(listboxSelection) [$w curselection]
+ if {![info exists Priv(listboxSelection)]} {
+ set Priv(listboxSelection) [$w curselection]
}
while {($i < $el) && ($i < $anchor)} {
- if {[lsearch $tkPriv(listboxSelection) $i] >= 0} {
+ if {[lsearch $Priv(listboxSelection) $i] >= 0} {
$w selection set $i
}
incr i
}
while {($i > $el) && ($i > $anchor)} {
- if {[lsearch $tkPriv(listboxSelection) $i] >= 0} {
+ if {[lsearch $Priv(listboxSelection) $i] >= 0} {
$w selection set $i
}
incr i -1
}
- set tkPriv(listboxPrev) $el
+ set Priv(listboxPrev) $el
event generate $w <<ListboxSelect>>
}
}
}
-# tkListboxBeginExtend --
+# ::tk::ListboxBeginExtend --
#
# This procedure is typically invoked on shift-button-1 presses. It
# begins the process of extending a selection in the listbox. Its
@@ -299,18 +299,18 @@ proc tkListboxMotion {w el} {
# el - The element for the selection operation (typically the
# one under the pointer). Must be in numerical form.
-proc tkListboxBeginExtend {w el} {
+proc ::tk::ListboxBeginExtend {w el} {
if {[string equal [$w cget -selectmode] "extended"]} {
if {[$w selection includes anchor]} {
- tkListboxMotion $w $el
+ ListboxMotion $w $el
} else {
# No selection yet; simulate the begin-select operation.
- tkListboxBeginSelect $w $el
+ ListboxBeginSelect $w $el
}
}
}
-# tkListboxBeginToggle --
+# ::tk::ListboxBeginToggle --
#
# This procedure is typically invoked on control-button-1 presses. It
# begins the process of toggling a selection in the listbox. Its
@@ -322,11 +322,11 @@ proc tkListboxBeginExtend {w el} {
# el - The element for the selection operation (typically the
# one under the pointer). Must be in numerical form.
-proc tkListboxBeginToggle {w el} {
- global tkPriv
+proc ::tk::ListboxBeginToggle {w el} {
+ variable ::tk::Priv
if {[string equal [$w cget -selectmode] "extended"]} {
- set tkPriv(listboxSelection) [$w curselection]
- set tkPriv(listboxPrev) $el
+ set Priv(listboxSelection) [$w curselection]
+ set Priv(listboxPrev) $el
$w selection anchor $el
if {[$w selection includes $el]} {
$w selection clear $el
@@ -337,7 +337,7 @@ proc tkListboxBeginToggle {w el} {
}
}
-# tkListboxAutoScan --
+# ::tk::ListboxAutoScan --
# This procedure is invoked when the mouse leaves an entry window
# with button 1 down. It scrolls the window up, down, left, or
# right, depending on where the mouse left the window, and reschedules
@@ -347,11 +347,11 @@ proc tkListboxBeginToggle {w el} {
# Arguments:
# w - The entry window.
-proc tkListboxAutoScan {w} {
- global tkPriv
+proc ::tk::ListboxAutoScan {w} {
+ variable ::tk::Priv
if {![winfo exists $w]} return
- set x $tkPriv(x)
- set y $tkPriv(y)
+ set x $Priv(x)
+ set y $Priv(y)
if {$y >= [winfo height $w]} {
$w yview scroll 1 units
} elseif {$y < 0} {
@@ -363,11 +363,11 @@ proc tkListboxAutoScan {w} {
} else {
return
}
- tkListboxMotion $w [$w index @$x,$y]
- set tkPriv(afterId) [after 50 [list tkListboxAutoScan $w]]
+ ListboxMotion $w [$w index @$x,$y]
+ set Priv(afterId) [after 50 [list tk::ListboxAutoScan $w]]
}
-# tkListboxUpDown --
+# ::tk::ListboxUpDown --
#
# Moves the location cursor (active element) up or down by one element,
# and changes the selection if we're in browse or extended selection
@@ -377,8 +377,8 @@ proc tkListboxAutoScan {w} {
# w - The listbox widget.
# amount - +1 to move down one item, -1 to move back one item.
-proc tkListboxUpDown {w amount} {
- global tkPriv
+proc ::tk::ListboxUpDown {w amount} {
+ variable ::tk::Priv
$w activate [expr {[$w index active] + $amount}]
$w see active
switch [$w cget -selectmode] {
@@ -391,14 +391,14 @@ proc tkListboxUpDown {w amount} {
$w selection clear 0 end
$w selection set active
$w selection anchor active
- set tkPriv(listboxPrev) [$w index active]
- set tkPriv(listboxSelection) {}
+ set Priv(listboxPrev) [$w index active]
+ set Priv(listboxSelection) {}
event generate $w <<ListboxSelect>>
}
}
}
-# tkListboxExtendUpDown --
+# ::tk::ListboxExtendUpDown --
#
# Does nothing unless we're in extended selection mode; in this
# case it moves the location cursor (active element) up or down by
@@ -408,22 +408,22 @@ proc tkListboxUpDown {w amount} {
# w - The listbox widget.
# amount - +1 to move down one item, -1 to move back one item.
-proc tkListboxExtendUpDown {w amount} {
+proc ::tk::ListboxExtendUpDown {w amount} {
+ variable ::tk::Priv
if {[string compare [$w cget -selectmode] "extended"]} {
return
}
set active [$w index active]
- if {![info exists tkPriv(listboxSelection)]} {
- global tkPriv
+ if {![info exists Priv(listboxSelection)]} {
$w selection set $active
- set tkPriv(listboxSelection) [$w curselection]
+ set Priv(listboxSelection) [$w curselection]
}
$w activate [expr {$active + $amount}]
$w see active
- tkListboxMotion $w [$w index active]
+ ListboxMotion $w [$w index active]
}
-# tkListboxDataExtend
+# ::tk::ListboxDataExtend
#
# This procedure is called for key-presses such as Shift-KEndData.
# If the selection mode isn't multiple or extend then it does nothing.
@@ -434,13 +434,13 @@ proc tkListboxExtendUpDown {w amount} {
# w - The listbox widget.
# el - An integer element number.
-proc tkListboxDataExtend {w el} {
+proc ::tk::ListboxDataExtend {w el} {
set mode [$w cget -selectmode]
if {[string equal $mode "extended"]} {
$w activate $el
$w see $el
if {[$w selection includes anchor]} {
- tkListboxMotion $w $el
+ ListboxMotion $w $el
}
} elseif {[string equal $mode "multiple"]} {
$w activate $el
@@ -448,7 +448,7 @@ proc tkListboxDataExtend {w el} {
}
}
-# tkListboxCancel
+# ::tk::ListboxCancel
#
# This procedure is invoked to cancel an extended selection in
# progress. If there is an extended selection in progress, it
@@ -458,13 +458,13 @@ proc tkListboxDataExtend {w el} {
# Arguments:
# w - The listbox widget.
-proc tkListboxCancel w {
- global tkPriv
+proc ::tk::ListboxCancel w {
+ variable ::tk::Priv
if {[string compare [$w cget -selectmode] "extended"]} {
return
}
set first [$w index anchor]
- set last $tkPriv(listboxPrev)
+ set last $Priv(listboxPrev)
if { [string equal $last ""] } {
# Not actually doing any selection right now
return
@@ -476,7 +476,7 @@ proc tkListboxCancel w {
}
$w selection clear $first $last
while {$first <= $last} {
- if {[lsearch $tkPriv(listboxSelection) $first] >= 0} {
+ if {[lsearch $Priv(listboxSelection) $first] >= 0} {
$w selection set $first
}
incr first
@@ -484,7 +484,7 @@ proc tkListboxCancel w {
event generate $w <<ListboxSelect>>
}
-# tkListboxSelectAll
+# ::tk::ListboxSelectAll
#
# This procedure is invoked to handle the "select all" operation.
# For single and browse mode, it just selects the active element.
@@ -493,7 +493,7 @@ proc tkListboxCancel w {
# Arguments:
# w - The listbox widget.
-proc tkListboxSelectAll w {
+proc ::tk::ListboxSelectAll w {
set mode [$w cget -selectmode]
if {[string equal $mode "single"] || [string equal $mode "browse"]} {
$w selection clear 0 end
@@ -503,5 +503,3 @@ proc tkListboxSelectAll w {
}
event generate $w <<ListboxSelect>>
}
-
-
diff --git a/tk/library/menu.tcl b/tk/library/menu.tcl
index 5e473b1dfe9..1fe2710b7ab 100644
--- a/tk/library/menu.tcl
+++ b/tk/library/menu.tcl
@@ -15,13 +15,13 @@
#
#-------------------------------------------------------------------------
-# Elements of tkPriv that are used in this file:
+# Elements of tk::Priv that are used in this file:
#
# cursor - Saves the -cursor option for the posted menubutton.
# focus - Saves the focus during a menu selection operation.
# Focus gets restored here when the menu is unposted.
-# grabGlobal - Used in conjunction with tkPriv(oldGrab): if
-# tkPriv(oldGrab) is non-empty, then tkPriv(grabGlobal)
+# grabGlobal - Used in conjunction with tk::Priv(oldGrab): if
+# tk::Priv(oldGrab) is non-empty, then tk::Priv(grabGlobal)
# contains either an empty string or "-global" to
# indicate whether the old grab was a local one or
# a global one.
@@ -62,14 +62,14 @@
# can be used:
#
# 1. As a pulldown from a menubutton. In this style, the variable
-# tkPriv(postedMb) identifies the posted menubutton.
+# tk::Priv(postedMb) identifies the posted menubutton.
# 2. As a torn-off menu copied from some other menu. In this style
-# tkPriv(postedMb) is empty, and menu's type is "tearoff".
+# tk::Priv(postedMb) is empty, and menu's type is "tearoff".
# 3. As an option menu, triggered from an option menubutton. In this
-# style tkPriv(postedMb) identifies the posted menubutton.
-# 4. As a popup menu. In this style tkPriv(postedMb) is empty and
+# style tk::Priv(postedMb) identifies the posted menubutton.
+# 4. As a popup menu. In this style tk::Priv(postedMb) is empty and
# the top-level menu's type is "normal".
-# 5. As a pulldown from a menubar. The variable tkPriv(menubar) has
+# 5. As a pulldown from a menubar. The variable tk::Priv(menubar) has
# the owning menubar, and the menu itself is of type "normal".
#
# The various binding procedures use the state described above to
@@ -84,28 +84,28 @@
bind Menubutton <FocusIn> {}
bind Menubutton <Enter> {
- tkMbEnter %W
+ tk::MbEnter %W
}
bind Menubutton <Leave> {
- tkMbLeave %W
+ tk::MbLeave %W
}
bind Menubutton <1> {
- if {[string compare $tkPriv(inMenubutton) ""]} {
- tkMbPost $tkPriv(inMenubutton) %X %Y
+ if {$tk::Priv(inMenubutton) ne ""} {
+ tk::MbPost $tk::Priv(inMenubutton) %X %Y
}
}
bind Menubutton <Motion> {
- tkMbMotion %W up %X %Y
+ tk::MbMotion %W up %X %Y
}
bind Menubutton <B1-Motion> {
- tkMbMotion %W down %X %Y
+ tk::MbMotion %W down %X %Y
}
bind Menubutton <ButtonRelease-1> {
- tkMbButtonUp %W
+ tk::MbButtonUp %W
}
bind Menubutton <space> {
- tkMbPost %W
- tkMenuFirstEntry [%W cget -menu]
+ tk::MbPost %W
+ tk::MenuFirstEntry [%W cget -menu]
}
# Must set focus when mouse enters a menu, in order to allow
@@ -118,107 +118,107 @@ bind Menubutton <space> {
bind Menu <FocusIn> {}
bind Menu <Enter> {
- set tkPriv(window) %W
- if {[string equal [%W cget -type] "tearoff"]} {
- if {[string compare "%m" "NotifyUngrab"]} {
- if {[string equal $tcl_platform(platform) "unix"]} {
+ set tk::Priv(window) %W
+ if {[%W cget -type] eq "tearoff"} {
+ if {"%m" ne "NotifyUngrab"} {
+ if {[tk windowingsystem] eq "x11"} {
tk_menuSetFocus %W
}
}
}
- tkMenuMotion %W %x %y %s
+ tk::MenuMotion %W %x %y %s
}
bind Menu <Leave> {
- tkMenuLeave %W %X %Y %s
+ tk::MenuLeave %W %X %Y %s
}
bind Menu <Motion> {
- tkMenuMotion %W %x %y %s
+ tk::MenuMotion %W %x %y %s
}
bind Menu <ButtonPress> {
- tkMenuButtonDown %W
+ tk::MenuButtonDown %W
}
bind Menu <ButtonRelease> {
- tkMenuInvoke %W 1
+ tk::MenuInvoke %W 1
}
bind Menu <space> {
- tkMenuInvoke %W 0
+ tk::MenuInvoke %W 0
}
bind Menu <Return> {
- tkMenuInvoke %W 0
+ tk::MenuInvoke %W 0
}
bind Menu <Escape> {
- tkMenuEscape %W
+ tk::MenuEscape %W
}
bind Menu <Left> {
- tkMenuLeftArrow %W
+ tk::MenuLeftArrow %W
}
bind Menu <Right> {
- tkMenuRightArrow %W
+ tk::MenuRightArrow %W
}
bind Menu <Up> {
- tkMenuUpArrow %W
+ tk::MenuUpArrow %W
}
bind Menu <Down> {
- tkMenuDownArrow %W
+ tk::MenuDownArrow %W
}
bind Menu <KeyPress> {
- tkTraverseWithinMenu %W %A
+ tk::TraverseWithinMenu %W %A
}
# The following bindings apply to all windows, and are used to
# implement keyboard menu traversal.
-if {[string equal $tcl_platform(platform) "unix"]} {
+if {[string equal [tk windowingsystem] "x11"]} {
bind all <Alt-KeyPress> {
- tkTraverseToMenu %W %A
+ tk::TraverseToMenu %W %A
}
bind all <F10> {
- tkFirstMenu %W
+ tk::FirstMenu %W
}
} else {
bind Menubutton <Alt-KeyPress> {
- tkTraverseToMenu %W %A
+ tk::TraverseToMenu %W %A
}
bind Menubutton <F10> {
- tkFirstMenu %W
+ tk::FirstMenu %W
}
}
-# tkMbEnter --
+# ::tk::MbEnter --
# This procedure is invoked when the mouse enters a menubutton
# widget. It activates the widget unless it is disabled. Note:
# this procedure is only invoked when mouse button 1 is *not* down.
-# The procedure tkMbB1Enter is invoked if the button is down.
+# The procedure ::tk::MbB1Enter is invoked if the button is down.
#
# Arguments:
# w - The name of the widget.
-proc tkMbEnter w {
- global tkPriv
+proc ::tk::MbEnter w {
+ variable ::tk::Priv
- if {[string compare $tkPriv(inMenubutton) ""]} {
- tkMbLeave $tkPriv(inMenubutton)
+ if {[string compare $Priv(inMenubutton) ""]} {
+ MbLeave $Priv(inMenubutton)
}
- set tkPriv(inMenubutton) $w
+ set Priv(inMenubutton) $w
if {[string compare [$w cget -state] "disabled"]} {
$w configure -state active
}
}
-# tkMbLeave --
+# ::tk::MbLeave --
# This procedure is invoked when the mouse leaves a menubutton widget.
# It de-activates the widget, if the widget still exists.
#
# Arguments:
# w - The name of the widget.
-proc tkMbLeave w {
- global tkPriv
+proc ::tk::MbLeave w {
+ variable ::tk::Priv
- set tkPriv(inMenubutton) {}
+ set Priv(inMenubutton) {}
if {![winfo exists $w]} {
return
}
@@ -227,7 +227,7 @@ proc tkMbLeave w {
}
}
-# tkMbPost --
+# ::tk::MbPost --
# Given a menubutton, this procedure does all the work of posting
# its associated menu and unposting any other menu that is currently
# posted.
@@ -239,36 +239,36 @@ proc tkMbLeave w {
# option menus. If not specified, then the center
# of the menubutton is used for an option menu.
-proc tkMbPost {w {x {}} {y {}}} {
- global tkPriv errorInfo
+proc ::tk::MbPost {w {x {}} {y {}}} {
+ global errorInfo
+ variable ::tk::Priv
global tcl_platform
- if {[string equal [$w cget -state] "disabled"] || \
- [string equal $w $tkPriv(postedMb)]} {
+ if {[$w cget -state] eq "disabled" || $w eq $Priv(postedMb)} {
return
}
set menu [$w cget -menu]
if {[string equal $menu ""]} {
return
}
- set tearoff [expr {[string equal $tcl_platform(platform) "unix"] \
- || [string equal [$menu cget -type] "tearoff"]}]
+ set tearoff [expr {[tk windowingsystem] eq "x11" \
+ || [$menu cget -type] eq "tearoff"}]
if {[string first $w $menu] != 0} {
error "can't post $menu: it isn't a descendant of $w (this is a new requirement in Tk versions 3.0 and later)"
}
- set cur $tkPriv(postedMb)
+ set cur $Priv(postedMb)
if {[string compare $cur ""]} {
- tkMenuUnpost {}
+ MenuUnpost {}
}
- set tkPriv(cursor) [$w cget -cursor]
- set tkPriv(relief) [$w cget -relief]
+ set Priv(cursor) [$w cget -cursor]
+ set Priv(relief) [$w cget -relief]
$w configure -cursor arrow
$w configure -relief raised
- set tkPriv(postedMb) $w
- set tkPriv(focus) [focus]
+ set Priv(postedMb) $w
+ set Priv(focus) [focus]
$menu activate none
- tkGenerateMenuSelect $menu
+ 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
@@ -280,17 +280,17 @@ proc tkMbPost {w {x {}} {y {}}} {
above {
set x [winfo rootx $w]
set y [expr {[winfo rooty $w] - [winfo reqheight $menu]}]
- $menu post $x $y
+ PostOverPoint $menu $x $y
}
below {
set x [winfo rootx $w]
set y [expr {[winfo rooty $w] + [winfo height $w]}]
- $menu post $x $y
+ PostOverPoint $menu $x $y
}
left {
set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}]
set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
- set entry [tkMenuFindName $menu [$w cget -text]]
+ set entry [MenuFindName $menu [$w cget -text]]
if {[$w cget -indicatoron]} {
if {$entry == [$menu index last]} {
incr y [expr {-([$menu yposition $entry] \
@@ -300,16 +300,17 @@ proc tkMbPost {w {x {}} {y {}}} {
+ [$menu yposition [expr {$entry+1}]])/2}]
}
}
- $menu post $x $y
- if {[string compare $entry {}] && [string compare [$menu entrycget $entry -state] "disabled"]} {
+ PostOverPoint $menu $x $y
+ if {$entry ne "" \
+ && [$menu entrycget $entry -state] ne "disabled"} {
$menu activate $entry
- tkGenerateMenuSelect $menu
+ GenerateMenuSelect $menu
}
}
right {
set x [expr {[winfo rootx $w] + [winfo width $w]}]
set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
- set entry [tkMenuFindName $menu [$w cget -text]]
+ set entry [MenuFindName $menu [$w cget -text]]
if {[$w cget -indicatoron]} {
if {$entry == [$menu index last]} {
incr y [expr {-([$menu yposition $entry] \
@@ -319,10 +320,11 @@ proc tkMbPost {w {x {}} {y {}}} {
+ [$menu yposition [expr {$entry+1}]])/2}]
}
}
- $menu post $x $y
- if {[string compare $entry {}] && [string compare [$menu entrycget $entry -state] "disabled"]} {
+ PostOverPoint $menu $x $y
+ if {$entry ne "" \
+ && [$menu entrycget $entry -state] ne "disabled"} {
$menu activate $entry
- tkGenerateMenuSelect $menu
+ GenerateMenuSelect $menu
}
}
default {
@@ -331,9 +333,9 @@ proc tkMbPost {w {x {}} {y {}}} {
set x [expr {[winfo rootx $w] + [winfo width $w]/2}]
set y [expr {[winfo rooty $w] + [winfo height $w]/2}]
}
- tkPostOverPoint $menu $x $y [tkMenuFindName $menu [$w cget -text]]
+ PostOverPoint $menu $x $y [MenuFindName $menu [$w cget -text]]
} else {
- $menu post [winfo rootx $w] [expr {[winfo rooty $w]+[winfo height $w]}]
+ PostOverPoint $menu [winfo rootx $w] [expr {[winfo rooty $w]+[winfo height $w]}]
}
}
}
@@ -342,22 +344,22 @@ proc tkMbPost {w {x {}} {y {}}} {
# reflect the error.
set savedInfo $errorInfo
- tkMenuUnpost {}
+ MenuUnpost {}
error $msg $savedInfo
}
- set tkPriv(tearoff) $tearoff
+ set Priv(tearoff) $tearoff
if {$tearoff != 0} {
focus $menu
if {[winfo viewable $w]} {
- tkSaveGrabInfo $w
+ SaveGrabInfo $w
grab -global $w
}
}
}
-# tkMenuUnpost --
+# ::tk::MenuUnpost --
# 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
@@ -373,17 +375,17 @@ proc tkMbPost {w {x {}} {y {}}} {
# menu - Name of a menu to unpost. Ignored if there
# is a posted menubutton.
-proc tkMenuUnpost menu {
+proc ::tk::MenuUnpost menu {
global tcl_platform
- global tkPriv
- set mb $tkPriv(postedMb)
+ variable ::tk::Priv
+ set mb $Priv(postedMb)
# 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 $tkPriv(focus)}
- set tkPriv(focus) ""
+ catch {focus $Priv(focus)}
+ set Priv(focus) ""
# Unpost menu(s) and restore some stuff that's dependent on
# what was posted.
@@ -392,12 +394,12 @@ proc tkMenuUnpost menu {
if {[string compare $mb ""]} {
set menu [$mb cget -menu]
$menu unpost
- set tkPriv(postedMb) {}
- $mb configure -cursor $tkPriv(cursor)
- $mb configure -relief $tkPriv(relief)
- } elseif {[string compare $tkPriv(popup) ""]} {
- $tkPriv(popup) unpost
- set tkPriv(popup) {}
+ set Priv(postedMb) {}
+ $mb configure -cursor $Priv(cursor)
+ $mb configure -relief $Priv(relief)
+ } elseif {[string compare $Priv(popup) ""]} {
+ $Priv(popup) unpost
+ set Priv(popup) {}
} elseif {[string compare [$menu cget -type] "menubar"] \
&& [string compare [$menu cget -type] "tearoff"]} {
# We're in a cascaded sub-menu from a torn-off menu or popup.
@@ -413,7 +415,7 @@ proc tkMenuUnpost menu {
}
$parent activate none
$parent postcascade none
- tkGenerateMenuSelect $parent
+ GenerateMenuSelect $parent
set type [$parent cget -type]
if {[string equal $type "menubar"] || \
[string equal $type "tearoff"]} {
@@ -427,7 +429,7 @@ proc tkMenuUnpost menu {
}
}
- if {($tkPriv(tearoff) != 0) || [string compare $tkPriv(menuBar) ""]} {
+ if {($Priv(tearoff) != 0) || $Priv(menuBar) ne ""} {
# Release grab, if any, and restore the previous grab, if there
# was one.
if {[string compare $menu ""]} {
@@ -436,18 +438,18 @@ proc tkMenuUnpost menu {
grab release $grab
}
}
- tkRestoreOldGrab
- if {[string compare $tkPriv(menuBar) ""]} {
- $tkPriv(menuBar) configure -cursor $tkPriv(cursor)
- set tkPriv(menuBar) {}
+ RestoreOldGrab
+ if {$Priv(menuBar) ne ""} {
+ $Priv(menuBar) configure -cursor $Priv(cursor)
+ set Priv(menuBar) {}
}
- if {[string compare $tcl_platform(platform) "unix"]} {
- set tkPriv(tearoff) 0
+ if {[tk windowingsystem] ne "x11"} {
+ set Priv(tearoff) 0
}
}
}
-# tkMbMotion --
+# ::tk::MbMotion --
# This procedure handles mouse motion events inside menubuttons, and
# also outside menubuttons when a menubutton has a grab (e.g. when a
# menu selection operation is in progress).
@@ -458,33 +460,33 @@ proc tkMenuUnpost menu {
# it isn't.
# rootx, rooty - Coordinates of mouse, in (virtual?) root window.
-proc tkMbMotion {w upDown rootx rooty} {
- global tkPriv
+proc ::tk::MbMotion {w upDown rootx rooty} {
+ variable ::tk::Priv
- if {[string equal $tkPriv(inMenubutton) $w]} {
+ if {[string equal $Priv(inMenubutton) $w]} {
return
}
set new [winfo containing $rootx $rooty]
- if {[string compare $new $tkPriv(inMenubutton)] \
+ if {[string compare $new $Priv(inMenubutton)] \
&& ([string equal $new ""] \
|| [string equal [winfo toplevel $new] [winfo toplevel $w]])} {
- if {[string compare $tkPriv(inMenubutton) ""]} {
- tkMbLeave $tkPriv(inMenubutton)
+ if {[string compare $Priv(inMenubutton) ""]} {
+ MbLeave $Priv(inMenubutton)
}
if {[string compare $new ""] \
&& [string equal [winfo class $new] "Menubutton"] \
&& ([$new cget -indicatoron] == 0) \
&& ([$w cget -indicatoron] == 0)} {
if {[string equal $upDown "down"]} {
- tkMbPost $new $rootx $rooty
+ MbPost $new $rootx $rooty
} else {
- tkMbEnter $new
+ MbEnter $new
}
}
}
}
-# tkMbButtonUp --
+# ::tk::MbButtonUp --
# This procedure is invoked to handle button 1 releases for menubuttons.
# If the release happens inside the menubutton then leave its menu
# posted with element 0 activated. Otherwise, unpost the menu.
@@ -492,23 +494,22 @@ proc tkMbMotion {w upDown rootx rooty} {
# Arguments:
# w - The name of the menubutton widget.
-proc tkMbButtonUp w {
- global tkPriv
+proc ::tk::MbButtonUp w {
+ variable ::tk::Priv
global tcl_platform
set menu [$w cget -menu]
- set tearoff [expr {[string equal $tcl_platform(platform) "unix"] || \
- ([string compare $menu {}] && \
- [string equal [$menu cget -type] "tearoff"])}]
- if {($tearoff != 0) && [string equal $tkPriv(postedMb) $w] \
- && [string equal $tkPriv(inMenubutton) $w]} {
- tkMenuFirstEntry [$tkPriv(postedMb) cget -menu]
+ set tearoff [expr {[tk windowingsystem] eq "x11" || \
+ ($menu ne "" && [$menu cget -type] eq "tearoff")}]
+ if {($tearoff != 0) && $Priv(postedMb) eq $w \
+ && $Priv(inMenubutton) eq $w} {
+ MenuFirstEntry [$Priv(postedMb) cget -menu]
} else {
- tkMenuUnpost {}
+ MenuUnpost {}
}
}
-# tkMenuMotion --
+# ::tk::MenuMotion --
# This procedure is called to handle mouse motion events for menus.
# It does two things. First, it resets the active element in the
# menu, if the mouse is over the menu. Second, if a mouse button
@@ -521,18 +522,18 @@ proc tkMbButtonUp w {
# y - The y position of the mouse.
# state - Modifier state (tells whether buttons are down).
-proc tkMenuMotion {menu x y state} {
- global tkPriv
- if {[string equal $menu $tkPriv(window)]} {
+proc ::tk::MenuMotion {menu x y state} {
+ variable ::tk::Priv
+ if {[string equal $menu $Priv(window)]} {
if {[string equal [$menu cget -type] "menubar"]} {
- if {[info exists tkPriv(focus)] && \
- [string compare $menu $tkPriv(focus)]} {
+ if {[info exists Priv(focus)] && \
+ [string compare $menu $Priv(focus)]} {
$menu activate @$x,$y
- tkGenerateMenuSelect $menu
+ GenerateMenuSelect $menu
}
} else {
$menu activate @$x,$y
- tkGenerateMenuSelect $menu
+ GenerateMenuSelect $menu
}
}
if {($state & 0x1f00) != 0} {
@@ -540,7 +541,7 @@ proc tkMenuMotion {menu x y state} {
}
}
-# tkMenuButtonDown --
+# ::tk::MenuButtonDown --
# Handles button presses in menus. There are a couple of tricky things
# here:
# 1. Change the posted cascade entry (if any) to match the mouse position.
@@ -555,17 +556,17 @@ proc tkMenuMotion {menu x y state} {
# Arguments:
# menu - The menu window.
-proc tkMenuButtonDown menu {
- global tkPriv
+proc ::tk::MenuButtonDown menu {
+ variable ::tk::Priv
global tcl_platform
if {![winfo viewable $menu]} {
return
}
$menu postcascade active
- if {[string compare $tkPriv(postedMb) ""] && \
- [winfo viewable $tkPriv(postedMb)]} {
- grab -global $tkPriv(postedMb)
+ if {[string compare $Priv(postedMb) ""] && \
+ [winfo viewable $Priv(postedMb)]} {
+ grab -global $Priv(postedMb)
} else {
while {[string equal [$menu cget -type] "normal"] \
&& [string equal [winfo class [winfo parent $menu]] "Menu"] \
@@ -573,9 +574,9 @@ proc tkMenuButtonDown menu {
set menu [winfo parent $menu]
}
- if {[string equal $tkPriv(menuBar) {}]} {
- set tkPriv(menuBar) $menu
- set tkPriv(cursor) [$menu cget -cursor]
+ if {[string equal $Priv(menuBar) {}]} {
+ set Priv(menuBar) $menu
+ set Priv(cursor) [$menu cget -cursor]
$menu configure -cursor arrow
}
@@ -585,19 +586,19 @@ proc tkMenuButtonDown menu {
# anymore.
if {[string compare $menu [grab current $menu]]} {
- tkSaveGrabInfo $menu
+ SaveGrabInfo $menu
}
# Must re-grab even if the grab window hasn't changed, in order
# to release the implicit grab from the button press.
- if {[string equal $tcl_platform(platform) "unix"]} {
+ if {[string equal [tk windowingsystem] "x11"]} {
grab -global $menu
}
}
}
-# tkMenuLeave --
+# ::tk::MenuLeave --
# This procedure is invoked to handle Leave events for a menu. It
# deactivates everything unless the active element is a cascade element
# and the mouse is now over the submenu.
@@ -607,9 +608,9 @@ proc tkMenuButtonDown menu {
# rootx, rooty - Root coordinates of mouse.
# state - Modifier state.
-proc tkMenuLeave {menu rootx rooty state} {
- global tkPriv
- set tkPriv(window) {}
+proc ::tk::MenuLeave {menu rootx rooty state} {
+ variable ::tk::Priv
+ set Priv(window) {}
if {[string equal [$menu index active] "none"]} {
return
}
@@ -619,10 +620,10 @@ proc tkMenuLeave {menu rootx rooty state} {
return
}
$menu activate none
- tkGenerateMenuSelect $menu
+ GenerateMenuSelect $menu
}
-# tkMenuInvoke --
+# ::tk::MenuInvoke --
# This procedure is invoked when button 1 is released over a menu.
# It invokes the appropriate menu action and unposts the menu if
# it came from a menubutton.
@@ -632,10 +633,10 @@ proc tkMenuLeave {menu rootx rooty state} {
# buttonRelease - 1 means this procedure is called because of
# a button release; 0 means because of keystroke.
-proc tkMenuInvoke {w buttonRelease} {
- global tkPriv
+proc ::tk::MenuInvoke {w buttonRelease} {
+ variable ::tk::Priv
- if {$buttonRelease && [string equal $tkPriv(window) {}]} {
+ if {$buttonRelease && [string equal $Priv(window) {}]} {
# Mouse was pressed over a menu without a menu button, then
# dragged off the menu (possibly with a cascade posted) and
# released. Unpost everything and quit.
@@ -643,16 +644,16 @@ proc tkMenuInvoke {w buttonRelease} {
$w postcascade none
$w activate none
event generate $w <<MenuSelect>>
- tkMenuUnpost $w
+ MenuUnpost $w
return
}
if {[string equal [$w type active] "cascade"]} {
$w postcascade active
set menu [$w entrycget active -menu]
- tkMenuFirstEntry $menu
+ MenuFirstEntry $menu
} elseif {[string equal [$w type active] "tearoff"]} {
- tkTearOffMenu $w
- tkMenuUnpost $w
+ ::tk::TearOffMenu $w
+ MenuUnpost $w
} elseif {[string equal [$w cget -type] "menubar"]} {
$w postcascade none
set active [$w index active]
@@ -667,7 +668,7 @@ proc tkMenuInvoke {w buttonRelease} {
event generate $w <<MenuSelect>>
}
- tkMenuUnpost $w
+ MenuUnpost $w
# If the active item is not a cascade, invoke it. This enables
# the use of checkbuttons/commands/etc. on menubars (which is legal,
@@ -677,12 +678,12 @@ proc tkMenuInvoke {w buttonRelease} {
uplevel #0 [list $w invoke $active]
}
} else {
- tkMenuUnpost $w
+ MenuUnpost $w
uplevel #0 [list $w invoke active]
}
}
-# tkMenuEscape --
+# ::tk::MenuEscape --
# This procedure is invoked for the Cancel (or Escape) key. It unposts
# the given menu and, if it is the top-level menu for a menu button,
# unposts the menu button as well.
@@ -690,54 +691,54 @@ proc tkMenuInvoke {w buttonRelease} {
# Arguments:
# menu - Name of the menu window.
-proc tkMenuEscape menu {
+proc ::tk::MenuEscape menu {
set parent [winfo parent $menu]
if {[string compare [winfo class $parent] "Menu"]} {
- tkMenuUnpost $menu
+ MenuUnpost $menu
} elseif {[string equal [$parent cget -type] "menubar"]} {
- tkMenuUnpost $menu
- tkRestoreOldGrab
+ MenuUnpost $menu
+ RestoreOldGrab
} else {
- tkMenuNextMenu $menu left
+ MenuNextMenu $menu left
}
}
# The following routines handle arrow keys. Arrow keys behave
# differently depending on whether the menu is a menu bar or not.
-proc tkMenuUpArrow {menu} {
+proc ::tk::MenuUpArrow {menu} {
if {[string equal [$menu cget -type] "menubar"]} {
- tkMenuNextMenu $menu left
+ MenuNextMenu $menu left
} else {
- tkMenuNextEntry $menu -1
+ MenuNextEntry $menu -1
}
}
-proc tkMenuDownArrow {menu} {
+proc ::tk::MenuDownArrow {menu} {
if {[string equal [$menu cget -type] "menubar"]} {
- tkMenuNextMenu $menu right
+ MenuNextMenu $menu right
} else {
- tkMenuNextEntry $menu 1
+ MenuNextEntry $menu 1
}
}
-proc tkMenuLeftArrow {menu} {
+proc ::tk::MenuLeftArrow {menu} {
if {[string equal [$menu cget -type] "menubar"]} {
- tkMenuNextEntry $menu -1
+ MenuNextEntry $menu -1
} else {
- tkMenuNextMenu $menu left
+ MenuNextMenu $menu left
}
}
-proc tkMenuRightArrow {menu} {
+proc ::tk::MenuRightArrow {menu} {
if {[string equal [$menu cget -type] "menubar"]} {
- tkMenuNextEntry $menu 1
+ MenuNextEntry $menu 1
} else {
- tkMenuNextMenu $menu right
+ MenuNextMenu $menu right
}
}
-# tkMenuNextMenu --
+# ::tk::MenuNextMenu --
# This procedure is invoked to handle "left" and "right" traversal
# motions in menus. It traverses to the next menu in a menu bar,
# or into or out of a cascaded menu.
@@ -747,8 +748,8 @@ proc tkMenuRightArrow {menu} {
# event.
# direction - Direction in which to move: "left" or "right"
-proc tkMenuNextMenu {menu direction} {
- global tkPriv
+proc ::tk::MenuNextMenu {menu direction} {
+ variable ::tk::Priv
# First handle traversals into and out of cascaded menus.
@@ -760,7 +761,7 @@ proc tkMenuNextMenu {menu direction} {
$menu postcascade active
set m2 [$menu entrycget active -menu]
if {[string compare $m2 ""]} {
- tkMenuFirstEntry $m2
+ MenuFirstEntry $m2
}
return
} else {
@@ -769,7 +770,7 @@ proc tkMenuNextMenu {menu direction} {
if {[string equal [winfo class $parent] "Menu"] \
&& [string equal [$parent cget -type] "menubar"]} {
tk_menuSetFocus $parent
- tkMenuNextEntry $parent 1
+ MenuNextEntry $parent 1
return
}
set parent [winfo parent $parent]
@@ -779,16 +780,13 @@ proc tkMenuNextMenu {menu direction} {
set count -1
set m2 [winfo parent $menu]
if {[string equal [winfo class $m2] "Menu"]} {
+ $menu activate none
+ GenerateMenuSelect $menu
+ tk_menuSetFocus $m2
+
+ $m2 postcascade none
+
if {[string compare [$m2 cget -type] "menubar"]} {
- $menu activate none
- tkGenerateMenuSelect $menu
- tk_menuSetFocus $m2
-
- # This code unposts any posted submenu in the parent.
-
- set tmp [$m2 index active]
- $m2 activate none
- $m2 activate $tmp
return
}
}
@@ -801,12 +799,12 @@ proc tkMenuNextMenu {menu direction} {
if {[string equal [winfo class $m2] "Menu"]} {
if {[string equal [$m2 cget -type] "menubar"]} {
tk_menuSetFocus $m2
- tkMenuNextEntry $m2 -1
+ MenuNextEntry $m2 -1
return
}
}
- set w $tkPriv(postedMb)
+ set w $Priv(postedMb)
if {[string equal $w ""]} {
return
}
@@ -832,11 +830,11 @@ proc tkMenuNextMenu {menu direction} {
}
incr i $count
}
- tkMbPost $mb
- tkMenuFirstEntry [$mb cget -menu]
+ MbPost $mb
+ MenuFirstEntry [$mb cget -menu]
}
-# tkMenuNextEntry --
+# ::tk::MenuNextEntry --
# Activate the next higher or lower entry in the posted menu,
# wrapping around at the ends. Disabled entries are skipped.
#
@@ -845,8 +843,7 @@ proc tkMenuNextMenu {menu direction} {
# count - 1 means go to the next lower entry,
# -1 means go to the next higher entry.
-proc tkMenuNextEntry {menu count} {
- global tkPriv
+proc ::tk::MenuNextEntry {menu count} {
if {[string equal [$menu index last] "none"]} {
return
@@ -873,7 +870,9 @@ proc tkMenuNextEntry {menu count} {
incr i -$length
}
if {[catch {$menu entrycget $i -state} state] == 0} {
- if {[string compare $state "disabled"]} {
+ if {$state ne "disabled" && \
+ ($i!=0 || [$menu cget -type] ne "tearoff" \
+ || [$menu type 0] ne "tearoff")} {
break
}
}
@@ -884,20 +883,22 @@ proc tkMenuNextEntry {menu count} {
incr quitAfter -1
}
$menu activate $i
- tkGenerateMenuSelect $menu
- if {[string equal [$menu type $i] "cascade"]} {
+ GenerateMenuSelect $menu
+
+ if {[string equal [$menu type $i] "cascade"] \
+ && [string equal [$menu cget -type] "menubar"]} {
set cascade [$menu entrycget $i -menu]
if {[string compare $cascade ""]} {
# Here we auto-post a cascade. This is necessary when
# we traverse left/right in the menubar, but undesirable when
# we traverse up/down in a menu.
$menu postcascade $i
- tkMenuFirstEntry $cascade
+ MenuFirstEntry $cascade
}
}
}
-# tkMenuFind --
+# ::tk::MenuFind --
# This procedure searches the entire window hierarchy under w for
# a menubutton that isn't disabled and whose underlined character
# is "char" or an entry in a menubar that isn't disabled and whose
@@ -913,15 +914,13 @@ proc tkMenuNextEntry {menu count} {
# may be either upper or lower case, and
# will match either upper or lower case.
-proc tkMenuFind {w char} {
- global tkPriv
+proc ::tk::MenuFind {w char} {
set char [string tolower $char]
set windowlist [winfo child $w]
foreach child $windowlist {
# Don't descend into other toplevels.
- if {[string compare [winfo toplevel [focus]] \
- [winfo toplevel $child]]} {
+ if {[string compare [winfo toplevel $w] [winfo toplevel $child]]} {
continue
}
if {[string equal [winfo class $child] "Menu"] && \
@@ -948,8 +947,7 @@ proc tkMenuFind {w char} {
foreach child $windowlist {
# Don't descend into other toplevels.
- if {[string compare [winfo toplevel [focus]] \
- [winfo toplevel $child]]} {
+ if {[string compare [winfo toplevel $w] [winfo toplevel $child]]} {
continue
}
switch [winfo class $child] {
@@ -965,7 +963,7 @@ proc tkMenuFind {w char} {
}
default {
- set match [tkMenuFind $child $char]
+ set match [MenuFind $child $char]
if {[string compare $match ""]} {
return $match
}
@@ -975,7 +973,7 @@ proc tkMenuFind {w char} {
return {}
}
-# tkTraverseToMenu --
+# ::tk::TraverseToMenu --
# This procedure implements keyboard traversal of menus. Given an
# ASCII character "char", it looks for a menubutton with that character
# underlined. If one is found, it posts the menubutton's menu
@@ -987,14 +985,14 @@ proc tkMenuFind {w char} {
# is ignored. If an empty string, nothing
# happens.
-proc tkTraverseToMenu {w char} {
- global tkPriv
+proc ::tk::TraverseToMenu {w char} {
+ variable ::tk::Priv
if {[string equal $char ""]} {
return
}
while {[string equal [winfo class $w] "Menu"]} {
if {[string compare [$w cget -type] "menubar"] \
- && [string equal $tkPriv(postedMb) ""]} {
+ && [string equal $Priv(postedMb) ""]} {
return
}
if {[string equal [$w cget -type] "menubar"]} {
@@ -1002,22 +1000,22 @@ proc tkTraverseToMenu {w char} {
}
set w [winfo parent $w]
}
- set w [tkMenuFind [winfo toplevel $w] $char]
+ set w [MenuFind [winfo toplevel $w] $char]
if {[string compare $w ""]} {
if {[string equal [winfo class $w] "Menu"]} {
tk_menuSetFocus $w
- set tkPriv(window) $w
- tkSaveGrabInfo $w
+ set Priv(window) $w
+ SaveGrabInfo $w
grab -global $w
- tkTraverseWithinMenu $w $char
+ TraverseWithinMenu $w $char
} else {
- tkMbPost $w
- tkMenuFirstEntry [$w cget -menu]
+ MbPost $w
+ MenuFirstEntry [$w cget -menu]
}
}
}
-# tkFirstMenu --
+# ::tk::FirstMenu --
# This procedure traverses to the first menubutton in the toplevel
# for a given window, and posts that menubutton's menu.
#
@@ -1025,23 +1023,24 @@ proc tkTraverseToMenu {w char} {
# w - Name of a window. Selects which toplevel
# to search for menubuttons.
-proc tkFirstMenu w {
- set w [tkMenuFind [winfo toplevel $w] ""]
+proc ::tk::FirstMenu w {
+ variable ::tk::Priv
+ set w [MenuFind [winfo toplevel $w] ""]
if {[string compare $w ""]} {
if {[string equal [winfo class $w] "Menu"]} {
tk_menuSetFocus $w
- set tkPriv(window) $w
- tkSaveGrabInfo $w
+ set Priv(window) $w
+ SaveGrabInfo $w
grab -global $w
- tkMenuFirstEntry $w
+ MenuFirstEntry $w
} else {
- tkMbPost $w
- tkMenuFirstEntry [$w cget -menu]
+ MbPost $w
+ MenuFirstEntry [$w cget -menu]
}
}
}
-# tkTraverseWithinMenu
+# ::tk::TraverseWithinMenu
# This procedure implements keyboard traversal within a menu. It
# searches for an entry in the menu that has "char" underlined. If
# such an entry is found, it is invoked and the menu is unposted.
@@ -1052,7 +1051,7 @@ proc tkFirstMenu w {
# ignored. If the string is empty then
# nothing happens.
-proc tkTraverseWithinMenu {w char} {
+proc ::tk::TraverseWithinMenu {w char} {
if {[string equal $char ""]} {
return
}
@@ -1073,10 +1072,10 @@ proc tkTraverseWithinMenu {w char} {
event generate $w <<MenuSelect>>
set m2 [$w entrycget $i -menu]
if {[string compare $m2 ""]} {
- tkMenuFirstEntry $m2
+ MenuFirstEntry $m2
}
} else {
- tkMenuUnpost $w
+ MenuUnpost $w
uplevel #0 [list $w invoke $i]
}
return
@@ -1084,18 +1083,18 @@ proc tkTraverseWithinMenu {w char} {
}
}
-# tkMenuFirstEntry --
+# ::tk::MenuFirstEntry --
# Given a menu, this procedure finds the first entry that isn't
# disabled or a tear-off or separator, and activates that entry.
# However, if there is already an active entry in the menu (e.g.,
-# because of a previous call to tkPostOverPoint) then the active
+# because of a previous call to tk::PostOverPoint) then the active
# entry isn't changed. This procedure also sets the input focus
# to the menu.
#
# Arguments:
# menu - Name of the menu window (possibly empty).
-proc tkMenuFirstEntry menu {
+proc ::tk::MenuFirstEntry menu {
if {[string equal $menu ""]} {
return
}
@@ -1112,7 +1111,7 @@ proc tkMenuFirstEntry menu {
&& [string compare $state "disabled"] \
&& [string compare [$menu type $i] "tearoff"]} {
$menu activate $i
- tkGenerateMenuSelect $menu
+ GenerateMenuSelect $menu
# Only post the cascade if the current menu is a menubar;
# otherwise, if the first entry of the cascade is a cascade,
# we can get an annoying cascading effect resulting in a bunch of
@@ -1122,7 +1121,7 @@ proc tkMenuFirstEntry menu {
set cascade [$menu entrycget $i -menu]
if {[string compare $cascade ""]} {
$menu postcascade $i
- tkMenuFirstEntry $cascade
+ MenuFirstEntry $cascade
}
}
return
@@ -1130,7 +1129,7 @@ proc tkMenuFirstEntry menu {
}
}
-# tkMenuFindName --
+# ::tk::MenuFindName --
# Given a menu and a text string, return the index of the menu entry
# that displays the string as its label. If there is no such entry,
# return an empty string. This procedure is tricky because some names
@@ -1141,7 +1140,7 @@ proc tkMenuFirstEntry menu {
# menu - Name of the menu widget.
# s - String to look for.
-proc tkMenuFindName {menu s} {
+proc ::tk::MenuFindName {menu s} {
set i ""
if {![regexp {^active$|^last$|^none$|^[0-9]|^@} $s]} {
catch {set i [$menu index $s]}
@@ -1161,7 +1160,7 @@ proc tkMenuFindName {menu s} {
return ""
}
-# tkPostOverPoint --
+# ::tk::PostOverPoint --
# This procedure posts a given menu such that a given entry in the
# menu is centered over a given point in the root window. It also
# activates the given entry.
@@ -1173,7 +1172,7 @@ proc tkMenuFindName {menu s} {
# If omitted or specified as {}, then the menu's
# upper-left corner goes at (x,y).
-proc tkPostOverPoint {menu x y {entry {}}} {
+proc ::tk::PostOverPoint {menu x y {entry {}}} {
global tcl_platform
if {[string compare $entry {}]} {
@@ -1186,75 +1185,89 @@ proc tkPostOverPoint {menu x y {entry {}}} {
}
incr x [expr {-[winfo reqwidth $menu]/2}]
}
+ if {$tcl_platform(platform) == "windows"} {
+ # We need to fix some problems with menu posting on Windows.
+ set yoffset [expr {[winfo screenheight $menu] \
+ - $y - [winfo reqheight $menu]}]
+ if {$yoffset < 0} {
+ # The bottom of the menu is offscreen, so adjust upwards
+ incr y $yoffset
+ if {$y < 0} { set y 0 }
+ }
+ # If we're off the top of the screen (either because we were
+ # originally or because we just adjusted too far upwards),
+ # then make the menu popup on the top edge.
+ if {$y < 0} {
+ set y 0
+ }
+ }
$menu post $x $y
- if {[string compare $entry {}] \
- && [string compare [$menu entrycget $entry -state] "disabled"]} {
+ if {$entry ne "" && [$menu entrycget $entry -state] ne "disabled"} {
$menu activate $entry
- tkGenerateMenuSelect $menu
+ GenerateMenuSelect $menu
}
}
-# tkSaveGrabInfo --
-# Sets the variables tkPriv(oldGrab) and tkPriv(grabStatus) to record
+# ::tk::SaveGrabInfo --
+# Sets the variables tk::Priv(oldGrab) and tk::Priv(grabStatus) 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 tkSaveGrabInfo w {
- global tkPriv
- set tkPriv(oldGrab) [grab current $w]
- if {[string compare $tkPriv(oldGrab) ""]} {
- set tkPriv(grabStatus) [grab status $tkPriv(oldGrab)]
+proc tk::SaveGrabInfo w {
+ variable ::tk::Priv
+ set Priv(oldGrab) [grab current $w]
+ if {$Priv(oldGrab) ne ""} {
+ set Priv(grabStatus) [grab status $Priv(oldGrab)]
}
}
-# tkRestoreOldGrab --
+# ::tk::RestoreOldGrab --
# Restores the grab to what it was before TkSaveGrabInfo was called.
#
-proc tkRestoreOldGrab {} {
- global tkPriv
-
- if {[string compare $tkPriv(oldGrab) ""]} {
+proc ::tk::RestoreOldGrab {} {
+ variable ::tk::Priv
+ if {$Priv(oldGrab) ne ""} {
# Be careful restoring the old grab, since it's window may not
# be visible anymore.
catch {
- if {[string equal $tkPriv(grabStatus) "global"]} {
- grab set -global $tkPriv(oldGrab)
+ if {[string equal $Priv(grabStatus) "global"]} {
+ grab set -global $Priv(oldGrab)
} else {
- grab set $tkPriv(oldGrab)
+ grab set $Priv(oldGrab)
}
}
- set tkPriv(oldGrab) ""
+ set Priv(oldGrab) ""
}
}
-proc tk_menuSetFocus {menu} {
- global tkPriv
- if {![info exists tkPriv(focus)] || [string equal $tkPriv(focus) {}]} {
- set tkPriv(focus) [focus]
+proc ::tk_menuSetFocus {menu} {
+ variable ::tk::Priv
+ if {![info exists Priv(focus)] || [string equal $Priv(focus) {}]} {
+ set Priv(focus) [focus]
}
focus $menu
}
-proc tkGenerateMenuSelect {menu} {
- global tkPriv
+proc ::tk::GenerateMenuSelect {menu} {
+ variable ::tk::Priv
- if {[string equal $tkPriv(activeMenu) $menu] \
- && [string equal $tkPriv(activeItem) [$menu index active]]} {
+ if {[string equal $Priv(activeMenu) $menu] \
+ && [string equal $Priv(activeItem) [$menu index active]]} {
return
}
- set tkPriv(activeMenu) $menu
- set tkPriv(activeItem) [$menu index active]
+ set Priv(activeMenu) $menu
+ set Priv(activeItem) [$menu index active]
event generate $menu <<MenuSelect>>
}
-# tk_popup --
+# ::tk_popup --
# This procedure pops up a menu and sets things up for traversing
# the menu and its submenus.
#
@@ -1266,21 +1279,17 @@ proc tkGenerateMenuSelect {menu} {
# If omitted or specified as {}, then menu's
# upper-left corner goes at (x,y).
-proc tk_popup {menu x y {entry {}}} {
- global tkPriv
+proc ::tk_popup {menu x y {entry {}}} {
+ variable ::tk::Priv
global tcl_platform
- if {[string compare $tkPriv(popup) ""] \
- || [string compare $tkPriv(postedMb) ""]} {
- tkMenuUnpost {}
- }
- tkPostOverPoint $menu $x $y $entry
- if {[string equal $tcl_platform(platform) "unix"] \
- && [winfo viewable $menu]} {
- tkSaveGrabInfo $menu
+ if {$Priv(popup) ne "" || $Priv(postedMb) ne ""} {
+ tk::MenuUnpost {}
+ }
+ tk::PostOverPoint $menu $x $y $entry
+ if {[tk windowingsystem] eq "x11" && [winfo viewable $menu]} {
+ tk::SaveGrabInfo $menu
grab -global $menu
- set tkPriv(popup) $menu
+ set Priv(popup) $menu
tk_menuSetFocus $menu
}
}
-
-
diff --git a/tk/library/mkpsenc.tcl b/tk/library/mkpsenc.tcl
new file mode 100644
index 00000000000..c1cf4129232
--- /dev/null
+++ b/tk/library/mkpsenc.tcl
@@ -0,0 +1,1367 @@
+# mkpsenc.tcl --
+#
+# Creates Postscript encoding vector for given encoding
+#
+
+proc ::tk::CreatePostscriptEncoding {encoding} {
+ # now check for known. Even if it is known, it can be other
+ # than we need. GhostScript seems to be happy with such approach
+ set result "/CurrentEncoding \[\n"
+ for {set i 0} {$i<256} {incr i 8} {
+ for {set j 0} {$j<8} {incr j} {
+ set enc [encoding convertfrom $encoding [format %c [expr {$i+$j}]]]
+ if {[catch {format %04X [scan $enc %c]} hexcode]} {set hexcode {}}
+ if [info exists ::tk::psglyphs($hexcode)] {
+ append result "/$::tk::psglyphs($hexcode)"
+ } else {
+ append result "/space"
+ }
+ }
+ append result "\n"
+ }
+ append result "\] def\n"
+ return $result
+}
+
+# List of adobe glyph names. Converted from glyphlist.txt, downloaded
+# from Adobe
+
+namespace eval ::tk {
+array set psglyphs {
+ 0020 space
+ 0021 exclam
+ 0022 quotedbl
+ 0023 numbersign
+ 0024 dollar
+ 0025 percent
+ 0026 ampersand
+ 0027 quotesingle
+ 0028 parenleft
+ 0029 parenright
+ 002A asterisk
+ 002B plus
+ 002C comma
+ 002D hyphen
+ 002E period
+ 002F slash
+ 0030 zero
+ 0031 one
+ 0032 two
+ 0033 three
+ 0034 four
+ 0035 five
+ 0036 six
+ 0037 seven
+ 0038 eight
+ 0039 nine
+ 003A colon
+ 003B semicolon
+ 003C less
+ 003D equal
+ 003E greater
+ 003F question
+ 0040 at
+ 0041 A
+ 0042 B
+ 0043 C
+ 0044 D
+ 0045 E
+ 0046 F
+ 0047 G
+ 0048 H
+ 0049 I
+ 004A J
+ 004B K
+ 004C L
+ 004D M
+ 004E N
+ 004F O
+ 0050 P
+ 0051 Q
+ 0052 R
+ 0053 S
+ 0054 T
+ 0055 U
+ 0056 V
+ 0057 W
+ 0058 X
+ 0059 Y
+ 005A Z
+ 005B bracketleft
+ 005C backslash
+ 005D bracketright
+ 005E asciicircum
+ 005F underscore
+ 0060 grave
+ 0061 a
+ 0062 b
+ 0063 c
+ 0064 d
+ 0065 e
+ 0066 f
+ 0067 g
+ 0068 h
+ 0069 i
+ 006A j
+ 006B k
+ 006C l
+ 006D m
+ 006E n
+ 006F o
+ 0070 p
+ 0071 q
+ 0072 r
+ 0073 s
+ 0074 t
+ 0075 u
+ 0076 v
+ 0077 w
+ 0078 x
+ 0079 y
+ 007A z
+ 007B braceleft
+ 007C bar
+ 007D braceright
+ 007E asciitilde
+ 00A0 space
+ 00A1 exclamdown
+ 00A2 cent
+ 00A3 sterling
+ 00A4 currency
+ 00A5 yen
+ 00A6 brokenbar
+ 00A7 section
+ 00A8 dieresis
+ 00A9 copyright
+ 00AA ordfeminine
+ 00AB guillemotleft
+ 00AC logicalnot
+ 00AD hyphen
+ 00AE registered
+ 00AF macron
+ 00B0 degree
+ 00B1 plusminus
+ 00B2 twosuperior
+ 00B3 threesuperior
+ 00B4 acute
+ 00B5 mu
+ 00B6 paragraph
+ 00B7 periodcentered
+ 00B8 cedilla
+ 00B9 onesuperior
+ 00BA ordmasculine
+ 00BB guillemotright
+ 00BC onequarter
+ 00BD onehalf
+ 00BE threequarters
+ 00BF questiondown
+ 00C0 Agrave
+ 00C1 Aacute
+ 00C2 Acircumflex
+ 00C3 Atilde
+ 00C4 Adieresis
+ 00C5 Aring
+ 00C6 AE
+ 00C7 Ccedilla
+ 00C8 Egrave
+ 00C9 Eacute
+ 00CA Ecircumflex
+ 00CB Edieresis
+ 00CC Igrave
+ 00CD Iacute
+ 00CE Icircumflex
+ 00CF Idieresis
+ 00D0 Eth
+ 00D1 Ntilde
+ 00D2 Ograve
+ 00D3 Oacute
+ 00D4 Ocircumflex
+ 00D5 Otilde
+ 00D6 Odieresis
+ 00D7 multiply
+ 00D8 Oslash
+ 00D9 Ugrave
+ 00DA Uacute
+ 00DB Ucircumflex
+ 00DC Udieresis
+ 00DD Yacute
+ 00DE Thorn
+ 00DF germandbls
+ 00E0 agrave
+ 00E1 aacute
+ 00E2 acircumflex
+ 00E3 atilde
+ 00E4 adieresis
+ 00E5 aring
+ 00E6 ae
+ 00E7 ccedilla
+ 00E8 egrave
+ 00E9 eacute
+ 00EA ecircumflex
+ 00EB edieresis
+ 00EC igrave
+ 00ED iacute
+ 00EE icircumflex
+ 00EF idieresis
+ 00F0 eth
+ 00F1 ntilde
+ 00F2 ograve
+ 00F3 oacute
+ 00F4 ocircumflex
+ 00F5 otilde
+ 00F6 odieresis
+ 00F7 divide
+ 00F8 oslash
+ 00F9 ugrave
+ 00FA uacute
+ 00FB ucircumflex
+ 00FC udieresis
+ 00FD yacute
+ 00FE thorn
+ 00FF ydieresis
+ 0100 Amacron
+ 0101 amacron
+ 0102 Abreve
+ 0103 abreve
+ 0104 Aogonek
+ 0105 aogonek
+ 0106 Cacute
+ 0107 cacute
+ 0108 Ccircumflex
+ 0109 ccircumflex
+ 010A Cdotaccent
+ 010B cdotaccent
+ 010C Ccaron
+ 010D ccaron
+ 010E Dcaron
+ 010F dcaron
+ 0110 Dcroat
+ 0111 dcroat
+ 0112 Emacron
+ 0113 emacron
+ 0114 Ebreve
+ 0115 ebreve
+ 0116 Edotaccent
+ 0117 edotaccent
+ 0118 Eogonek
+ 0119 eogonek
+ 011A Ecaron
+ 011B ecaron
+ 011C Gcircumflex
+ 011D gcircumflex
+ 011E Gbreve
+ 011F gbreve
+ 0120 Gdotaccent
+ 0121 gdotaccent
+ 0122 Gcommaaccent
+ 0123 gcommaaccent
+ 0124 Hcircumflex
+ 0125 hcircumflex
+ 0126 Hbar
+ 0127 hbar
+ 0128 Itilde
+ 0129 itilde
+ 012A Imacron
+ 012B imacron
+ 012C Ibreve
+ 012D ibreve
+ 012E Iogonek
+ 012F iogonek
+ 0130 Idotaccent
+ 0131 dotlessi
+ 0132 IJ
+ 0133 ij
+ 0134 Jcircumflex
+ 0135 jcircumflex
+ 0136 Kcommaaccent
+ 0137 kcommaaccent
+ 0138 kgreenlandic
+ 0139 Lacute
+ 013A lacute
+ 013B Lcommaaccent
+ 013C lcommaaccent
+ 013D Lcaron
+ 013E lcaron
+ 013F Ldot
+ 0140 ldot
+ 0141 Lslash
+ 0142 lslash
+ 0143 Nacute
+ 0144 nacute
+ 0145 Ncommaaccent
+ 0146 ncommaaccent
+ 0147 Ncaron
+ 0148 ncaron
+ 0149 napostrophe
+ 014A Eng
+ 014B eng
+ 014C Omacron
+ 014D omacron
+ 014E Obreve
+ 014F obreve
+ 0150 Ohungarumlaut
+ 0151 ohungarumlaut
+ 0152 OE
+ 0153 oe
+ 0154 Racute
+ 0155 racute
+ 0156 Rcommaaccent
+ 0157 rcommaaccent
+ 0158 Rcaron
+ 0159 rcaron
+ 015A Sacute
+ 015B sacute
+ 015C Scircumflex
+ 015D scircumflex
+ 015E Scedilla
+ 015F scedilla
+ 0160 Scaron
+ 0161 scaron
+ 0162 Tcommaaccent
+ 0163 tcommaaccent
+ 0164 Tcaron
+ 0165 tcaron
+ 0166 Tbar
+ 0167 tbar
+ 0168 Utilde
+ 0169 utilde
+ 016A Umacron
+ 016B umacron
+ 016C Ubreve
+ 016D ubreve
+ 016E Uring
+ 016F uring
+ 0170 Uhungarumlaut
+ 0171 uhungarumlaut
+ 0172 Uogonek
+ 0173 uogonek
+ 0174 Wcircumflex
+ 0175 wcircumflex
+ 0176 Ycircumflex
+ 0177 ycircumflex
+ 0178 Ydieresis
+ 0179 Zacute
+ 017A zacute
+ 017B Zdotaccent
+ 017C zdotaccent
+ 017D Zcaron
+ 017E zcaron
+ 017F longs
+ 0192 florin
+ 01A0 Ohorn
+ 01A1 ohorn
+ 01AF Uhorn
+ 01B0 uhorn
+ 01E6 Gcaron
+ 01E7 gcaron
+ 01FA Aringacute
+ 01FB aringacute
+ 01FC AEacute
+ 01FD aeacute
+ 01FE Oslashacute
+ 01FF oslashacute
+ 0218 Scommaaccent
+ 0219 scommaaccent
+ 021A Tcommaaccent
+ 021B tcommaaccent
+ 02BC afii57929
+ 02BD afii64937
+ 02C6 circumflex
+ 02C7 caron
+ 02C9 macron
+ 02D8 breve
+ 02D9 dotaccent
+ 02DA ring
+ 02DB ogonek
+ 02DC tilde
+ 02DD hungarumlaut
+ 0300 gravecomb
+ 0301 acutecomb
+ 0303 tildecomb
+ 0309 hookabovecomb
+ 0323 dotbelowcomb
+ 0384 tonos
+ 0385 dieresistonos
+ 0386 Alphatonos
+ 0387 anoteleia
+ 0388 Epsilontonos
+ 0389 Etatonos
+ 038A Iotatonos
+ 038C Omicrontonos
+ 038E Upsilontonos
+ 038F Omegatonos
+ 0390 iotadieresistonos
+ 0391 Alpha
+ 0392 Beta
+ 0393 Gamma
+ 0394 Delta
+ 0395 Epsilon
+ 0396 Zeta
+ 0397 Eta
+ 0398 Theta
+ 0399 Iota
+ 039A Kappa
+ 039B Lambda
+ 039C Mu
+ 039D Nu
+ 039E Xi
+ 039F Omicron
+ 03A0 Pi
+ 03A1 Rho
+ 03A3 Sigma
+ 03A4 Tau
+ 03A5 Upsilon
+ 03A6 Phi
+ 03A7 Chi
+ 03A8 Psi
+ 03A9 Omega
+ 03AA Iotadieresis
+ 03AB Upsilondieresis
+ 03AC alphatonos
+ 03AD epsilontonos
+ 03AE etatonos
+ 03AF iotatonos
+ 03B0 upsilondieresistonos
+ 03B1 alpha
+ 03B2 beta
+ 03B3 gamma
+ 03B4 delta
+ 03B5 epsilon
+ 03B6 zeta
+ 03B7 eta
+ 03B8 theta
+ 03B9 iota
+ 03BA kappa
+ 03BB lambda
+ 03BC mu
+ 03BD nu
+ 03BE xi
+ 03BF omicron
+ 03C0 pi
+ 03C1 rho
+ 03C2 sigma1
+ 03C3 sigma
+ 03C4 tau
+ 03C5 upsilon
+ 03C6 phi
+ 03C7 chi
+ 03C8 psi
+ 03C9 omega
+ 03CA iotadieresis
+ 03CB upsilondieresis
+ 03CC omicrontonos
+ 03CD upsilontonos
+ 03CE omegatonos
+ 03D1 theta1
+ 03D2 Upsilon1
+ 03D5 phi1
+ 03D6 omega1
+ 0401 afii10023
+ 0402 afii10051
+ 0403 afii10052
+ 0404 afii10053
+ 0405 afii10054
+ 0406 afii10055
+ 0407 afii10056
+ 0408 afii10057
+ 0409 afii10058
+ 040A afii10059
+ 040B afii10060
+ 040C afii10061
+ 040E afii10062
+ 040F afii10145
+ 0410 afii10017
+ 0411 afii10018
+ 0412 afii10019
+ 0413 afii10020
+ 0414 afii10021
+ 0415 afii10022
+ 0416 afii10024
+ 0417 afii10025
+ 0418 afii10026
+ 0419 afii10027
+ 041A afii10028
+ 041B afii10029
+ 041C afii10030
+ 041D afii10031
+ 041E afii10032
+ 041F afii10033
+ 0420 afii10034
+ 0421 afii10035
+ 0422 afii10036
+ 0423 afii10037
+ 0424 afii10038
+ 0425 afii10039
+ 0426 afii10040
+ 0427 afii10041
+ 0428 afii10042
+ 0429 afii10043
+ 042A afii10044
+ 042B afii10045
+ 042C afii10046
+ 042D afii10047
+ 042E afii10048
+ 042F afii10049
+ 0430 afii10065
+ 0431 afii10066
+ 0432 afii10067
+ 0433 afii10068
+ 0434 afii10069
+ 0435 afii10070
+ 0436 afii10072
+ 0437 afii10073
+ 0438 afii10074
+ 0439 afii10075
+ 043A afii10076
+ 043B afii10077
+ 043C afii10078
+ 043D afii10079
+ 043E afii10080
+ 043F afii10081
+ 0440 afii10082
+ 0441 afii10083
+ 0442 afii10084
+ 0443 afii10085
+ 0444 afii10086
+ 0445 afii10087
+ 0446 afii10088
+ 0447 afii10089
+ 0448 afii10090
+ 0449 afii10091
+ 044A afii10092
+ 044B afii10093
+ 044C afii10094
+ 044D afii10095
+ 044E afii10096
+ 044F afii10097
+ 0451 afii10071
+ 0452 afii10099
+ 0453 afii10100
+ 0454 afii10101
+ 0455 afii10102
+ 0456 afii10103
+ 0457 afii10104
+ 0458 afii10105
+ 0459 afii10106
+ 045A afii10107
+ 045B afii10108
+ 045C afii10109
+ 045E afii10110
+ 045F afii10193
+ 0462 afii10146
+ 0463 afii10194
+ 0472 afii10147
+ 0473 afii10195
+ 0474 afii10148
+ 0475 afii10196
+ 0490 afii10050
+ 0491 afii10098
+ 04D9 afii10846
+ 05B0 afii57799
+ 05B1 afii57801
+ 05B2 afii57800
+ 05B3 afii57802
+ 05B4 afii57793
+ 05B5 afii57794
+ 05B6 afii57795
+ 05B7 afii57798
+ 05B8 afii57797
+ 05B9 afii57806
+ 05BB afii57796
+ 05BC afii57807
+ 05BD afii57839
+ 05BE afii57645
+ 05BF afii57841
+ 05C0 afii57842
+ 05C1 afii57804
+ 05C2 afii57803
+ 05C3 afii57658
+ 05D0 afii57664
+ 05D1 afii57665
+ 05D2 afii57666
+ 05D3 afii57667
+ 05D4 afii57668
+ 05D5 afii57669
+ 05D6 afii57670
+ 05D7 afii57671
+ 05D8 afii57672
+ 05D9 afii57673
+ 05DA afii57674
+ 05DB afii57675
+ 05DC afii57676
+ 05DD afii57677
+ 05DE afii57678
+ 05DF afii57679
+ 05E0 afii57680
+ 05E1 afii57681
+ 05E2 afii57682
+ 05E3 afii57683
+ 05E4 afii57684
+ 05E5 afii57685
+ 05E6 afii57686
+ 05E7 afii57687
+ 05E8 afii57688
+ 05E9 afii57689
+ 05EA afii57690
+ 05F0 afii57716
+ 05F1 afii57717
+ 05F2 afii57718
+ 060C afii57388
+ 061B afii57403
+ 061F afii57407
+ 0621 afii57409
+ 0622 afii57410
+ 0623 afii57411
+ 0624 afii57412
+ 0625 afii57413
+ 0626 afii57414
+ 0627 afii57415
+ 0628 afii57416
+ 0629 afii57417
+ 062A afii57418
+ 062B afii57419
+ 062C afii57420
+ 062D afii57421
+ 062E afii57422
+ 062F afii57423
+ 0630 afii57424
+ 0631 afii57425
+ 0632 afii57426
+ 0633 afii57427
+ 0634 afii57428
+ 0635 afii57429
+ 0636 afii57430
+ 0637 afii57431
+ 0638 afii57432
+ 0639 afii57433
+ 063A afii57434
+ 0640 afii57440
+ 0641 afii57441
+ 0642 afii57442
+ 0643 afii57443
+ 0644 afii57444
+ 0645 afii57445
+ 0646 afii57446
+ 0647 afii57470
+ 0648 afii57448
+ 0649 afii57449
+ 064A afii57450
+ 064B afii57451
+ 064C afii57452
+ 064D afii57453
+ 064E afii57454
+ 064F afii57455
+ 0650 afii57456
+ 0651 afii57457
+ 0652 afii57458
+ 0660 afii57392
+ 0661 afii57393
+ 0662 afii57394
+ 0663 afii57395
+ 0664 afii57396
+ 0665 afii57397
+ 0666 afii57398
+ 0667 afii57399
+ 0668 afii57400
+ 0669 afii57401
+ 066A afii57381
+ 066D afii63167
+ 0679 afii57511
+ 067E afii57506
+ 0686 afii57507
+ 0688 afii57512
+ 0691 afii57513
+ 0698 afii57508
+ 06A4 afii57505
+ 06AF afii57509
+ 06BA afii57514
+ 06D2 afii57519
+ 06D5 afii57534
+ 1E80 Wgrave
+ 1E81 wgrave
+ 1E82 Wacute
+ 1E83 wacute
+ 1E84 Wdieresis
+ 1E85 wdieresis
+ 1EF2 Ygrave
+ 1EF3 ygrave
+ 200C afii61664
+ 200D afii301
+ 200E afii299
+ 200F afii300
+ 2012 figuredash
+ 2013 endash
+ 2014 emdash
+ 2015 afii00208
+ 2017 underscoredbl
+ 2018 quoteleft
+ 2019 quoteright
+ 201A quotesinglbase
+ 201B quotereversed
+ 201C quotedblleft
+ 201D quotedblright
+ 201E quotedblbase
+ 2020 dagger
+ 2021 daggerdbl
+ 2022 bullet
+ 2024 onedotenleader
+ 2025 twodotenleader
+ 2026 ellipsis
+ 202C afii61573
+ 202D afii61574
+ 202E afii61575
+ 2030 perthousand
+ 2032 minute
+ 2033 second
+ 2039 guilsinglleft
+ 203A guilsinglright
+ 203C exclamdbl
+ 2044 fraction
+ 2070 zerosuperior
+ 2074 foursuperior
+ 2075 fivesuperior
+ 2076 sixsuperior
+ 2077 sevensuperior
+ 2078 eightsuperior
+ 2079 ninesuperior
+ 207D parenleftsuperior
+ 207E parenrightsuperior
+ 207F nsuperior
+ 2080 zeroinferior
+ 2081 oneinferior
+ 2082 twoinferior
+ 2083 threeinferior
+ 2084 fourinferior
+ 2085 fiveinferior
+ 2086 sixinferior
+ 2087 seveninferior
+ 2088 eightinferior
+ 2089 nineinferior
+ 208D parenleftinferior
+ 208E parenrightinferior
+ 20A1 colonmonetary
+ 20A3 franc
+ 20A4 lira
+ 20A7 peseta
+ 20AA afii57636
+ 20AB dong
+ 20AC Euro
+ 2105 afii61248
+ 2111 Ifraktur
+ 2113 afii61289
+ 2116 afii61352
+ 2118 weierstrass
+ 211C Rfraktur
+ 211E prescription
+ 2122 trademark
+ 2126 Omega
+ 212E estimated
+ 2135 aleph
+ 2153 onethird
+ 2154 twothirds
+ 215B oneeighth
+ 215C threeeighths
+ 215D fiveeighths
+ 215E seveneighths
+ 2190 arrowleft
+ 2191 arrowup
+ 2192 arrowright
+ 2193 arrowdown
+ 2194 arrowboth
+ 2195 arrowupdn
+ 21A8 arrowupdnbse
+ 21B5 carriagereturn
+ 21D0 arrowdblleft
+ 21D1 arrowdblup
+ 21D2 arrowdblright
+ 21D3 arrowdbldown
+ 21D4 arrowdblboth
+ 2200 universal
+ 2202 partialdiff
+ 2203 existential
+ 2205 emptyset
+ 2206 Delta
+ 2207 gradient
+ 2208 element
+ 2209 notelement
+ 220B suchthat
+ 220F product
+ 2211 summation
+ 2212 minus
+ 2215 fraction
+ 2217 asteriskmath
+ 2219 periodcentered
+ 221A radical
+ 221D proportional
+ 221E infinity
+ 221F orthogonal
+ 2220 angle
+ 2227 logicaland
+ 2228 logicalor
+ 2229 intersection
+ 222A union
+ 222B integral
+ 2234 therefore
+ 223C similar
+ 2245 congruent
+ 2248 approxequal
+ 2260 notequal
+ 2261 equivalence
+ 2264 lessequal
+ 2265 greaterequal
+ 2282 propersubset
+ 2283 propersuperset
+ 2284 notsubset
+ 2286 reflexsubset
+ 2287 reflexsuperset
+ 2295 circleplus
+ 2297 circlemultiply
+ 22A5 perpendicular
+ 22C5 dotmath
+ 2302 house
+ 2310 revlogicalnot
+ 2320 integraltp
+ 2321 integralbt
+ 2329 angleleft
+ 232A angleright
+ 2500 SF100000
+ 2502 SF110000
+ 250C SF010000
+ 2510 SF030000
+ 2514 SF020000
+ 2518 SF040000
+ 251C SF080000
+ 2524 SF090000
+ 252C SF060000
+ 2534 SF070000
+ 253C SF050000
+ 2550 SF430000
+ 2551 SF240000
+ 2552 SF510000
+ 2553 SF520000
+ 2554 SF390000
+ 2555 SF220000
+ 2556 SF210000
+ 2557 SF250000
+ 2558 SF500000
+ 2559 SF490000
+ 255A SF380000
+ 255B SF280000
+ 255C SF270000
+ 255D SF260000
+ 255E SF360000
+ 255F SF370000
+ 2560 SF420000
+ 2561 SF190000
+ 2562 SF200000
+ 2563 SF230000
+ 2564 SF470000
+ 2565 SF480000
+ 2566 SF410000
+ 2567 SF450000
+ 2568 SF460000
+ 2569 SF400000
+ 256A SF540000
+ 256B SF530000
+ 256C SF440000
+ 2580 upblock
+ 2584 dnblock
+ 2588 block
+ 258C lfblock
+ 2590 rtblock
+ 2591 ltshade
+ 2592 shade
+ 2593 dkshade
+ 25A0 filledbox
+ 25A1 H22073
+ 25AA H18543
+ 25AB H18551
+ 25AC filledrect
+ 25B2 triagup
+ 25BA triagrt
+ 25BC triagdn
+ 25C4 triaglf
+ 25CA lozenge
+ 25CB circle
+ 25CF H18533
+ 25D8 invbullet
+ 25D9 invcircle
+ 25E6 openbullet
+ 263A smileface
+ 263B invsmileface
+ 263C sun
+ 2640 female
+ 2642 male
+ 2660 spade
+ 2663 club
+ 2665 heart
+ 2666 diamond
+ 266A musicalnote
+ 266B musicalnotedbl
+ F6BE dotlessj
+ F6BF LL
+ F6C0 ll
+ F6C1 Scedilla
+ F6C2 scedilla
+ F6C3 commaaccent
+ F6C4 afii10063
+ F6C5 afii10064
+ F6C6 afii10192
+ F6C7 afii10831
+ F6C8 afii10832
+ F6C9 Acute
+ F6CA Caron
+ F6CB Dieresis
+ F6CC DieresisAcute
+ F6CD DieresisGrave
+ F6CE Grave
+ F6CF Hungarumlaut
+ F6D0 Macron
+ F6D1 cyrBreve
+ F6D2 cyrFlex
+ F6D3 dblGrave
+ F6D4 cyrbreve
+ F6D5 cyrflex
+ F6D6 dblgrave
+ F6D7 dieresisacute
+ F6D8 dieresisgrave
+ F6D9 copyrightserif
+ F6DA registerserif
+ F6DB trademarkserif
+ F6DC onefitted
+ F6DD rupiah
+ F6DE threequartersemdash
+ F6DF centinferior
+ F6E0 centsuperior
+ F6E1 commainferior
+ F6E2 commasuperior
+ F6E3 dollarinferior
+ F6E4 dollarsuperior
+ F6E5 hypheninferior
+ F6E6 hyphensuperior
+ F6E7 periodinferior
+ F6E8 periodsuperior
+ F6E9 asuperior
+ F6EA bsuperior
+ F6EB dsuperior
+ F6EC esuperior
+ F6ED isuperior
+ F6EE lsuperior
+ F6EF msuperior
+ F6F0 osuperior
+ F6F1 rsuperior
+ F6F2 ssuperior
+ F6F3 tsuperior
+ F6F4 Brevesmall
+ F6F5 Caronsmall
+ F6F6 Circumflexsmall
+ F6F7 Dotaccentsmall
+ F6F8 Hungarumlautsmall
+ F6F9 Lslashsmall
+ F6FA OEsmall
+ F6FB Ogoneksmall
+ F6FC Ringsmall
+ F6FD Scaronsmall
+ F6FE Tildesmall
+ F6FF Zcaronsmall
+ F721 exclamsmall
+ F724 dollaroldstyle
+ F726 ampersandsmall
+ F730 zerooldstyle
+ F731 oneoldstyle
+ F732 twooldstyle
+ F733 threeoldstyle
+ F734 fouroldstyle
+ F735 fiveoldstyle
+ F736 sixoldstyle
+ F737 sevenoldstyle
+ F738 eightoldstyle
+ F739 nineoldstyle
+ F73F questionsmall
+ F760 Gravesmall
+ F761 Asmall
+ F762 Bsmall
+ F763 Csmall
+ F764 Dsmall
+ F765 Esmall
+ F766 Fsmall
+ F767 Gsmall
+ F768 Hsmall
+ F769 Ismall
+ F76A Jsmall
+ F76B Ksmall
+ F76C Lsmall
+ F76D Msmall
+ F76E Nsmall
+ F76F Osmall
+ F770 Psmall
+ F771 Qsmall
+ F772 Rsmall
+ F773 Ssmall
+ F774 Tsmall
+ F775 Usmall
+ F776 Vsmall
+ F777 Wsmall
+ F778 Xsmall
+ F779 Ysmall
+ F77A Zsmall
+ F7A1 exclamdownsmall
+ F7A2 centoldstyle
+ F7A8 Dieresissmall
+ F7AF Macronsmall
+ F7B4 Acutesmall
+ F7B8 Cedillasmall
+ F7BF questiondownsmall
+ F7E0 Agravesmall
+ F7E1 Aacutesmall
+ F7E2 Acircumflexsmall
+ F7E3 Atildesmall
+ F7E4 Adieresissmall
+ F7E5 Aringsmall
+ F7E6 AEsmall
+ F7E7 Ccedillasmall
+ F7E8 Egravesmall
+ F7E9 Eacutesmall
+ F7EA Ecircumflexsmall
+ F7EB Edieresissmall
+ F7EC Igravesmall
+ F7ED Iacutesmall
+ F7EE Icircumflexsmall
+ F7EF Idieresissmall
+ F7F0 Ethsmall
+ F7F1 Ntildesmall
+ F7F2 Ogravesmall
+ F7F3 Oacutesmall
+ F7F4 Ocircumflexsmall
+ F7F5 Otildesmall
+ F7F6 Odieresissmall
+ F7F8 Oslashsmall
+ F7F9 Ugravesmall
+ F7FA Uacutesmall
+ F7FB Ucircumflexsmall
+ F7FC Udieresissmall
+ F7FD Yacutesmall
+ F7FE Thornsmall
+ F7FF Ydieresissmall
+ F8E5 radicalex
+ F8E6 arrowvertex
+ F8E7 arrowhorizex
+ F8E8 registersans
+ F8E9 copyrightsans
+ F8EA trademarksans
+ F8EB parenlefttp
+ F8EC parenleftex
+ F8ED parenleftbt
+ F8EE bracketlefttp
+ F8EF bracketleftex
+ F8F0 bracketleftbt
+ F8F1 bracelefttp
+ F8F2 braceleftmid
+ F8F3 braceleftbt
+ F8F4 braceex
+ F8F5 integralex
+ F8F6 parenrighttp
+ F8F7 parenrightex
+ F8F8 parenrightbt
+ F8F9 bracketrighttp
+ F8FA bracketrightex
+ F8FB bracketrightbt
+ F8FC bracerighttp
+ F8FD bracerightmid
+ F8FE bracerightbt
+ FB00 ff
+ FB01 fi
+ FB02 fl
+ FB03 ffi
+ FB04 ffl
+ FB1F afii57705
+ FB2A afii57694
+ FB2B afii57695
+ FB35 afii57723
+ FB4B afii57700
+}
+
+# precalculate entire prolog when this file is loaded
+# (to speed things up)
+set ps_preamable "%%BeginProlog\n"
+append ps_preamable [CreatePostscriptEncoding [encoding system]]
+append ps_preamable {
+50 dict begin
+% This is a standard prolog for Postscript generated by Tk's canvas
+% widget.
+% RCS: @(#) $Id$
+
+% The definitions below just define all of the variables used in
+% any of the procedures here. This is needed for obscure reasons
+% explained on p. 716 of the Postscript manual (Section H.2.7,
+% "Initializing Variables," in the section on Encapsulated Postscript).
+
+/baseline 0 def
+/stipimage 0 def
+/height 0 def
+/justify 0 def
+/lineLength 0 def
+/spacing 0 def
+/stipple 0 def
+/strings 0 def
+/xoffset 0 def
+/yoffset 0 def
+/tmpstip null def
+
+
+/cstringshow {
+ {
+ dup type /stringtype eq
+ { show } { glyphshow }
+ ifelse
+ }
+ forall
+} bind def
+
+
+
+/cstringwidth {
+ 0 exch 0 exch
+ {
+ dup type /stringtype eq
+ { stringwidth } {
+ currentfont /Encoding get exch 1 exch put (\001) stringwidth
+ }
+ ifelse
+ exch 3 1 roll add 3 1 roll add exch
+ }
+ forall
+} bind def
+
+% font ISOEncode font
+% This procedure changes the encoding of a font from the default
+% Postscript encoding to current system encoding. 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 CurrentEncoding 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
+
+% StrokeClip
+%
+% This procedure converts the current path into a clip area under
+% the assumption of stroking. It's a bit tricky because some Postscript
+% interpreters get errors during strokepath for dashed lines. If
+% this happens then turn off dashes and try again.
+
+/StrokeClip {
+ {strokepath} stopped {
+ (This Postscript printer gets limitcheck overflows when) =
+ (stippling dashed lines; lines will be printed solid instead.) =
+ [] 0 setdash strokepath} if
+ clip
+} bind def
+
+% 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 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
+
+% -- AdjustColor --
+% Given a color value already set for output by the caller, adjusts
+% that value to a grayscale or mono value if requested by the CL
+% variable.
+
+/AdjustColor {
+ CL 2 lt {
+ currentgray
+ CL 0 eq {
+ .5 lt {0} {1} ifelse
+ } if
+ setgray
+ } if
+} bind def
+
+% x y strings spacing xoffset yoffset justify stipple DrawText --
+% This procedure does all of the real work of drawing text. The
+% color and font must already have been set by the caller, and the
+% following arguments must be on the stack:
+%
+% x, y - Coordinates at which to draw text.
+% strings - An array of strings, one for each line of the text item,
+% in order from top to bottom.
+% spacing - Spacing between lines.
+% xoffset - Horizontal offset for text bbox relative to x and y: 0 for
+% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se.
+% yoffset - Vertical offset for text bbox relative to x and y: 0 for
+% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se.
+% justify - 0 for left justification, 0.5 for center, 1 for right justify.
+% stipple - Boolean value indicating whether or not text is to be
+% drawn in stippled fashion. If text is stippled,
+% procedure StippleText must have been defined to call
+% StippleFill in the right way.
+%
+% Also, when this procedure is invoked, the color and font must already
+% have been set for the text.
+
+/DrawText {
+ /stipple exch def
+ /justify exch def
+ /yoffset exch def
+ /xoffset exch def
+ /spacing exch def
+ /strings exch def
+
+ % First scan through all of the text to find the widest line.
+
+ /lineLength 0 def
+ strings {
+ cstringwidth pop
+ dup lineLength gt {/lineLength exch def} {pop} ifelse
+ newpath
+ } forall
+
+ % Compute the baseline offset and the actual font height.
+
+ 0 0 moveto (TXygqPZ) false charpath
+ pathbbox dup /baseline exch def
+ exch pop exch sub /height exch def pop
+ newpath
+
+ % Translate coordinates first so that the origin is at the upper-left
+ % corner of the text's bounding box. Remember that x and y for
+ % positioning are still on the stack.
+
+ translate
+ lineLength xoffset mul
+ strings length 1 sub spacing mul height add yoffset mul translate
+
+ % Now use the baseline and justification information to translate so
+ % that the origin is at the baseline and positioning point for the
+ % first line of text.
+
+ justify lineLength mul baseline neg translate
+
+ % Iterate over each of the lines to output it. For each line,
+ % compute its width again so it can be properly justified, then
+ % display it.
+
+ strings {
+ dup cstringwidth pop
+ justify neg mul 0 moveto
+ stipple {
+
+
+ % The text is stippled, so turn it into a path and print
+ % by calling StippledText, which in turn calls StippleFill.
+ % Unfortunately, many Postscript interpreters will get
+ % overflow errors if we try to do the whole string at
+ % once, so do it a character at a time.
+
+ gsave
+ /char (X) def
+ {
+ dup type /stringtype eq {
+ % This segment is a string.
+ {
+ char 0 3 -1 roll put
+ currentpoint
+ gsave
+ char true charpath clip StippleText
+ grestore
+ char stringwidth translate
+ moveto
+ } forall
+ } {
+ % This segment is glyph name
+ % Temporary override
+ currentfont /Encoding get exch 1 exch put
+ currentpoint
+ gsave (\001) true charpath clip StippleText
+ grestore
+ (\001) stringwidth translate
+ moveto
+ } ifelse
+ } forall
+ grestore
+ } {cstringshow} ifelse
+ 0 spacing neg translate
+ } forall
+} bind def
+
+%%EndProlog
+}
+
+}
+
+proc tk::ensure_psenc_is_loaded {} {
+}
diff --git a/tk/library/msgbox.tcl b/tk/library/msgbox.tcl
index 1e6744f629f..20862b5b117 100644
--- a/tk/library/msgbox.tcl
+++ b/tk/library/msgbox.tcl
@@ -114,7 +114,7 @@ static unsigned char w3_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};"
-# tkMessageBox --
+# ::tk::MessageBox --
#
# Pops up a messagebox with an application-supplied message with
# an icon and a list of buttons. This procedure will be called
@@ -130,11 +130,12 @@ static unsigned char w3_bits[] = {
#
# See the user documentation for details on what tk_messageBox does.
#
-proc tkMessageBox {args} {
- global tkPriv tcl_platform tk_strictMotif
+proc ::tk::MessageBox {args} {
+ global tcl_platform tk_strictMotif
+ variable ::tk::Priv
- set w tkPrivMsgBox
- upvar #0 $w data
+ set w ::tk::PrivMsgBox
+ upvar $w data
#
# The default value of the title is space (" ") not the empty string
@@ -146,7 +147,6 @@ proc tkMessageBox {args} {
{-default "" "" ""}
{-icon "" "" "info"}
{-message "" "" ""}
- {-modal "" "" ""}
{-parent "" "" .}
{-title "" "" " "}
{-type "" "" "ok"}
@@ -157,7 +157,8 @@ proc tkMessageBox {args} {
if {[lsearch -exact {info warning error question} $data(-icon)] == -1} {
error "bad -icon value \"$data(-icon)\": must be error, info, question, or warning"
}
- if {[string equal $tcl_platform(platform) "macintosh"]} {
+ if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
switch -- $data(-icon) {
"error" {set data(-icon) "stop"}
"warning" {set data(-icon) "caution"}
@@ -170,63 +171,64 @@ proc tkMessageBox {args} {
}
switch -- $data(-type) {
- abortretryignore {
- set buttons {
- {abort -width 6 -text Abort -under 0}
- {retry -width 6 -text Retry -under 0}
- {ignore -width 6 -text Ignore -under 0}
- }
+ abortretryignore {
+ set names [list abort retry ignore]
+ set labels [list &Abort &Retry &Ignore]
}
ok {
- set buttons {
- {ok -width 6 -text OK -under 0}
- }
- if {[string equal $data(-default) ""]} {
- set data(-default) "ok"
- }
+ set names [list ok]
+ set labels {&OK}
}
okcancel {
- set buttons {
- {ok -width 6 -text OK -under 0}
- {cancel -width 6 -text Cancel -under 0}
- }
+ set names [list ok cancel]
+ set labels [list &OK &Cancel]
}
retrycancel {
- set buttons {
- {retry -width 6 -text Retry -under 0}
- {cancel -width 6 -text Cancel -under 0}
- }
+ set names [list retry cancel]
+ set labels [list &Retry &Cancel]
}
yesno {
- set buttons {
- {yes -width 6 -text Yes -under 0}
- {no -width 6 -text No -under 0}
- }
+ set names [list yes no]
+ set labels [list &Yes &No]
}
yesnocancel {
- set buttons {
- {yes -width 6 -text Yes -under 0}
- {no -width 6 -text No -under 0}
- {cancel -width 6 -text Cancel -under 0}
- }
+ set names [list yes no cancel]
+ set labels [list &Yes &No &Cancel]
}
default {
- error "bad -type value \"$data(-type)\": must be abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel"
+ error "bad -type value \"$data(-type)\": must be\
+ abortretryignore, ok, okcancel, retrycancel,\
+ yesno, or yesnocancel"
}
}
+
+ set maxWidth [eval mcmaxamp $labels]
+ if {$maxWidth <6} {
+ set maxWidth 6
+ }
- if {[string compare $data(-default) ""]} {
- set valid 0
- foreach btn $buttons {
- if {[string equal [lindex $btn 0] $data(-default)]} {
- set valid 1
- break
- }
- }
- if {!$valid} {
- error "invalid default button \"$data(-default)\""
+ set buttons {}
+ foreach name $names lab $labels {
+ lappend buttons [list $name -width $maxWidth -text [mc $lab]]
+ }
+
+ # If no default button was specified, the default default is the
+ # first button (Bug: 2218).
+
+ if {$data(-default) == ""} {
+ set data(-default) [lindex [lindex $buttons 0] 0]
+ }
+
+ set valid 0
+ foreach btn $buttons {
+ if {[string equal [lindex $btn 0] $data(-default)]} {
+ set valid 1
+ break
}
}
+ if {!$valid} {
+ error "invalid default button \"$data(-default)\""
+ }
# 2. Set the dialog to be a child window of $parent
#
@@ -245,6 +247,8 @@ proc tkMessageBox {args} {
wm title $w $data(-title)
wm iconname $w Dialog
wm protocol $w WM_DELETE_WINDOW { }
+ # There is only one background colour for the whole dialog
+ set bg [$w cget -background]
# Message boxes should be transient with respect to their parent so that
# they always stay on top of the parent window. But some window managers
@@ -253,19 +257,21 @@ proc tkMessageBox {args} {
# "grab"bed windows. So only make the message box transient if the parent
# is viewable.
#
- if { [winfo viewable [winfo toplevel $data(-parent)]] } {
+ if {[winfo viewable [winfo toplevel $data(-parent)]] } {
wm transient $w $data(-parent)
}
- if {[string equal $tcl_platform(platform) "macintosh"]} {
- unsupported1 style $w dBoxProc
+ if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
+ unsupported::MacWindowStyle style $w dBoxProc
}
- frame $w.bot
+ frame $w.bot -background $bg
pack $w.bot -side bottom -fill both
- frame $w.top
+ frame $w.top -background $bg
pack $w.top -side top -fill both -expand 1
- if {[string compare $tcl_platform(platform) "macintosh"]} {
+ if {![string equal [tk windowingsystem] "classic"]
+ && ![string equal [tk windowingsystem] "aqua"]} {
$w.bot configure -relief raised -bd 1
$w.top configure -relief raised -bd 1
}
@@ -275,19 +281,23 @@ proc tkMessageBox {args} {
# overridden by the caller).
option add *Dialog.msg.wrapLength 3i widgetDefault
- if {[string equal $tcl_platform(platform) "macintosh"]} {
+ if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
option add *Dialog.msg.font system widgetDefault
} else {
option add *Dialog.msg.font {Times 18} widgetDefault
}
- label $w.msg -anchor nw -justify left -text $data(-message)
+ label $w.msg -anchor nw -justify left -text $data(-message) \
+ -background $bg
if {[string compare $data(-icon) ""]} {
- if {[string equal $tcl_platform(platform) "macintosh"] \
+ if {([string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"])
|| ([winfo depth $w] < 4) || $tk_strictMotif} {
- label $w.bitmap -bitmap $data(-icon)
+ label $w.bitmap -bitmap $data(-icon) -background $bg
} else {
- canvas $w.bitmap -width 32 -height 32 -highlightthickness 0
+ canvas $w.bitmap -width 32 -height 32 -highlightthickness 0 \
+ -background $bg
switch $data(-icon) {
error {
$w.bitmap create oval 0 0 31 31 -fill red -outline black
@@ -337,28 +347,27 @@ proc tkMessageBox {args} {
set opts [list -text $capName]
}
- eval button [list $w.$name] $opts [list -command [list set tkPriv(button) $name]]
+ eval [list tk::AmpWidget button $w.$name] $opts \
+ [list -command [list set tk::Priv(button) $name]]
if {[string equal $name $data(-default)]} {
$w.$name configure -default active
+ } else {
+ $w.$name configure -default normal
}
pack $w.$name -in $w.bot -side left -expand 1 -padx 3m -pady 2m
# create the binding for the key accelerator, based on the underline
#
- set underIdx [$w.$name cget -under]
- if {$underIdx >= 0} {
- set key [string index [$w.$name cget -text] $underIdx]
- bind $w <Alt-[string tolower $key]> [list $w.$name invoke]
- bind $w <Alt-[string toupper $key]> [list $w.$name invoke]
- }
-
- # CYGNUS LOCAL - bind all buttons so that <Return>
- # activates them
- bind $w.$name <Return> "$w.$name invoke"
-
- incr i
+ # set underIdx [$w.$name cget -under]
+ # if {$underIdx >= 0} {
+ # set key [string index [$w.$name cget -text] $underIdx]
+ # bind $w <Alt-[string tolower $key]> [list $w.$name invoke]
+ # bind $w <Alt-[string toupper $key]> [list $w.$name invoke]
+ # }
+ # incr i
}
+ bind $w <Alt-Key> [list ::tk::AltKeyInDialog $w %A]
if {[string compare {} $data(-default)]} {
bind $w <FocusIn> {
@@ -377,7 +386,7 @@ proc tkMessageBox {args} {
bind $w <Return> {
if {[string equal Button [winfo class %W]]} {
- tkButtonInvoke %W
+ tk::ButtonInvoke %W
}
}
@@ -402,11 +411,9 @@ proc tkMessageBox {args} {
# may take the focus away so we can't redirect it. Finally,
# restore any grab that was in effect.
- tkwait variable tkPriv(button)
+ vwait ::tk::Priv(button)
::tk::RestoreFocusGrab $w $focus
- return $tkPriv(button)
+ return $Priv(button)
}
-
-
diff --git a/tk/library/msgs/cs.msg b/tk/library/msgs/cs.msg
new file mode 100644
index 00000000000..e4014a334a9
--- /dev/null
+++ b/tk/library/msgs/cs.msg
@@ -0,0 +1,70 @@
+namespace eval ::tk {
+ ::msgcat::mcset cs "&Abort" "&P\u0159eru\u0161it"
+ ::msgcat::mcset cs "About..." "O programu..."
+ ::msgcat::mcset cs "All Files" "V\u0161echny soubory"
+ ::msgcat::mcset cs "Application Error" "Chyba programu"
+ ::msgcat::mcset cs "&Blue" "&Modr\341"
+ ::msgcat::mcset cs "&Cancel" "&Zru\u0161it"
+ ::msgcat::mcset cs "Cannot change to the directory \"%1\$s\".\nPermission denied." "Nemohu zm\u011bnit atku\341ln\355 adres\341\u0159 na \"%1\$s\".\nP\u0159\355stup odm\355tnut."
+ ::msgcat::mcset cs "Choose Directory" "V\375b\u011br adres\341\u0159e"
+ ::msgcat::mcset cs "Clear" "Smazat"
+ ::msgcat::mcset cs "Color" "Barva"
+ ::msgcat::mcset cs "Console" "Konzole"
+ ::msgcat::mcset cs "Copy" "Kop\355rovat"
+ ::msgcat::mcset cs "Cut" "Vy\u0159\355znout"
+ ::msgcat::mcset cs "Delete" "Smazat"
+ ::msgcat::mcset cs "Details >>" "Detaily >>"
+ ::msgcat::mcset cs "Directory \"%1\$s\" does not exist." "Adres\341\u0159 \"%1\$s\" neexistuje."
+ ::msgcat::mcset cs "&Directory:" "&Adres\341\u0159:"
+ ::msgcat::mcset cs "Error: %1\$s" "Chyba: %1\$s"
+ ::msgcat::mcset cs "Exit" "Konec"
+ ::msgcat::mcset cs "File \"%1\$s\" already exists.\n\n" "Soubor \"%1\$s\" ji\u017e existuje.\n\n"
+ ::msgcat::mcset cs "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Soubor \"%1\$s\" ji\u017e existuje.\nChcete jej p\u0159epsat?"
+ ::msgcat::mcset cs "File \"%1\$s\" does not exist." "Soubor \"%1\$s\" neexistuje."
+ ::msgcat::mcset cs "File &name:" "&Jm\351no souboru:"
+ ::msgcat::mcset cs "File &names:" "&Jm\351na soubor\u016f:"
+ ::msgcat::mcset cs "Files of &type:" "&Typy soubor\u016f:"
+ ::msgcat::mcset cs "Fi&les:" "Sou&bory:"
+ ::msgcat::mcset cs "&Filter" "&Filtr"
+ ::msgcat::mcset cs "Fil&ter:" "Fil&tr:"
+ ::msgcat::mcset cs "&Green" "Ze&len\341"
+ ::msgcat::mcset cs "Hi"
+ ::msgcat::mcset cs "Hide Console" "Skr\375t konsolu"
+ ::msgcat::mcset cs "&Ignore" "&Ignorovat"
+ ::msgcat::mcset cs "Invalid file name \"%1\$s\"." "\u0160patn\351 jm\351no souboru \"%1\$s\"."
+ ::msgcat::mcset cs "Log Files" "Log soubory"
+ ::msgcat::mcset cs "&No" "&Ne"
+ ::msgcat::mcset cs "&OK"
+ ::msgcat::mcset cs "Ok"
+ ::msgcat::mcset cs "Open" "Otev\u0159\355t"
+ ::msgcat::mcset cs "&Open" "&Otev\u0159\355t"
+ ::msgcat::mcset cs "Open Multiple Files" "Otev\u0159\355t v\355ce soubor\u016f"
+ ::msgcat::mcset cs "Paste" "Vlo\u017eit"
+ ::msgcat::mcset cs "Quit" "Skon\u010dit"
+ ::msgcat::mcset cs "&Red" " \u010ce&rven\341"
+ ::msgcat::mcset cs "Replace existing file?" "Nahradit st\341vaj\355c\355 soubor?"
+ ::msgcat::mcset cs "&Retry" "Z&novu"
+ ::msgcat::mcset cs "&Save" "&Ulo\u017eit"
+ ::msgcat::mcset cs "Save As" "Ulo\u017eit jako"
+ ::msgcat::mcset cs "Save To Log" "Ulo\u017eit do logu"
+ ::msgcat::mcset cs "Select Log File" "Vybrat log soubor"
+ ::msgcat::mcset cs "Select a file to source" "Vybrat soubor k nahr\341n\355"
+ ::msgcat::mcset cs "&Selection:" "&V\375b\u011br:"
+ ::msgcat::mcset cs "Skip Messages" "P\u0159esko\u010dit zpr\341vy"
+ ::msgcat::mcset cs "Source..." "Nahr\341t..."
+ ::msgcat::mcset cs "Tcl Scripts" "Tcl skripty"
+ ::msgcat::mcset cs "Tcl for Windows" "Tcl pro Windows"
+ ::msgcat::mcset cs "Text Files" "Textov\351 soubory"
+ ::msgcat::mcset cs "&Yes" "&Ano"
+ ::msgcat::mcset cs "abort" "p\u0159eru\u0161it"
+ ::msgcat::mcset cs "blue" "modr\341"
+ ::msgcat::mcset cs "cancel" "zru\u0161it"
+ ::msgcat::mcset cs "extension" "p\u0159\355pona"
+ ::msgcat::mcset cs "extensions" "p\u0159\355pony"
+ ::msgcat::mcset cs "green" "zelen\341"
+ ::msgcat::mcset cs "ignore" "ignorovat"
+ ::msgcat::mcset cs "ok"
+ ::msgcat::mcset cs "red" "\u010derven\341"
+ ::msgcat::mcset cs "retry" "znovu"
+ ::msgcat::mcset cs "yes" "ano"
+}
diff --git a/tk/library/msgs/de.msg b/tk/library/msgs/de.msg
new file mode 100644
index 00000000000..c5ae6893d98
--- /dev/null
+++ b/tk/library/msgs/de.msg
@@ -0,0 +1,70 @@
+namespace eval ::tk {
+ ::msgcat::mcset de "&Abort" "&Abbruch"
+ ::msgcat::mcset de "About..." "\u00dcber..."
+ ::msgcat::mcset de "All Files" "Alle Dateien"
+ ::msgcat::mcset de "Application Error" "Applikationsfehler"
+ ::msgcat::mcset de "&Blue" "&Blau"
+ ::msgcat::mcset de "&Cancel" "&Abbruch"
+ ::msgcat::mcset de "Cannot change to the directory \"%1\$s\".\nPermission denied." "Kann nicht in das Verzeichnis \"%1\$s\" wechseln.\nKeine Rechte vorhanden."
+ ::msgcat::mcset de "Choose Directory" "W\u00e4hle Verzeichnis"
+ ::msgcat::mcset de "Clear" "R\u00fccksetzen"
+ ::msgcat::mcset de "Color" "Farbe"
+ ::msgcat::mcset de "Console" "Konsole"
+ ::msgcat::mcset de "Copy" "Kopieren"
+ ::msgcat::mcset de "Cut" "Ausschneiden"
+ ::msgcat::mcset de "Delete" "L\u00f6schen"
+ ::msgcat::mcset de "Details >>"
+ ::msgcat::mcset de "Directory \"%1\$s\" does not exist." "Das Verzeichnis \"%1\$s\" existiert nicht."
+ ::msgcat::mcset de "&Directory:" "&Verzeichnis:"
+ ::msgcat::mcset de "Error: %1\$s" "Fehler: %1\$s"
+ ::msgcat::mcset de "Exit" "Ende"
+ ::msgcat::mcset de "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Die Datei \"%1\$s\" ist bereits vorhanden.\nWollen sie diese Datei \u00fcberschreiben ?"
+ ::msgcat::mcset de "File \"%1\$s\" already exists.\n\n" "Die Datei \"%1\$s\" ist bereits vorhanden.\n\n"
+ ::msgcat::mcset de "File \"%1\$s\" does not exist." "Die Datei \"%1\$s\" existiert nicht."
+ ::msgcat::mcset de "File &name:" "Datei&name:"
+ ::msgcat::mcset de "File &names:" "Datei&namen:"
+ ::msgcat::mcset de "Files of &type:" "Dateien des &Typs:"
+ ::msgcat::mcset de "Fi&les:" "Dat&eien:"
+ ::msgcat::mcset de "&Filter"
+ ::msgcat::mcset de "Fil&ter:"
+ ::msgcat::mcset de "&Green" "&Gr\u00fcn"
+ ::msgcat::mcset de "Hi" "Hallo"
+ ::msgcat::mcset de "Hide Console" "Konsole unsichtbar machen"
+ ::msgcat::mcset de "&Ignore" "&Ignorieren"
+ ::msgcat::mcset de "Invalid file name \"%1\$s\"." "Ung\u00fcltiger Dateiname \"%1\$s\"."
+ ::msgcat::mcset de "Log Files" "Protokolldatei"
+ ::msgcat::mcset de "&No" "&Nein"
+ ::msgcat::mcset de "OK"
+ ::msgcat::mcset de "Ok"
+ ::msgcat::mcset de "Open" "\u00d6ffnen"
+ ::msgcat::mcset de "&Open" "\u00d6&ffnen"
+ ::msgcat::mcset de "Open Multiple Files"
+ ::msgcat::mcset de "Paste" "Einf\u00fcgen"
+ ::msgcat::mcset de "Quit" "Beenden"
+ ::msgcat::mcset de "&Red" "&Rot"
+ ::msgcat::mcset de "Replace existing file?" "Existierende Datei ersetzen?"
+ ::msgcat::mcset de "&Retry" "&Wiederholen"
+ ::msgcat::mcset de "&Save" "&Speichern"
+ ::msgcat::mcset de "Save As" "Speichern unter"
+ ::msgcat::mcset de "Save To Log" "In Protokoll speichern"
+ ::msgcat::mcset de "Select Log File" "Protokolldatei ausw\u00e4hlen"
+ ::msgcat::mcset de "Select a file to source" "Auszuf\u00fchrende Datei ausw\u00e4hlen"
+ ::msgcat::mcset de "&Selection:" "Auswah&l:"
+ ::msgcat::mcset de "Skip Messages" "Weitere Nachrichten \u00fcberspringen"
+ ::msgcat::mcset de "Source..." "Ausf\u00fchren..."
+ ::msgcat::mcset de "Tcl Scripts" "Tcl-Skripte"
+ ::msgcat::mcset de "Tcl for Windows" "Tcl f\u00fcr Windows"
+ ::msgcat::mcset de "Text Files" "Textdateien"
+ ::msgcat::mcset de "&Yes" "&Ja"
+ ::msgcat::mcset de "abort" "abbrechen"
+ ::msgcat::mcset de "blue" "blau"
+ ::msgcat::mcset de "cancel" "abbrechen"
+ ::msgcat::mcset de "extension" "Erweiterung"
+ ::msgcat::mcset de "extensions" "Erweiterungen"
+ ::msgcat::mcset de "green" "gr\u00fcn"
+ ::msgcat::mcset de "ignore" "ignorieren"
+ ::msgcat::mcset de "ok"
+ ::msgcat::mcset de "red" "rot"
+ ::msgcat::mcset de "retry" "wiederholen"
+ ::msgcat::mcset de "yes" "ja"
+}
diff --git a/tk/library/msgs/el.msg b/tk/library/msgs/el.msg
new file mode 100644
index 00000000000..2e96cd96043
--- /dev/null
+++ b/tk/library/msgs/el.msg
@@ -0,0 +1,86 @@
+## Messages for the Greek (Hellenic - "el") language.
+## Please report any changes/suggestions to:
+## petasis@iit.demokritos.gr
+
+namespace eval ::tk {
+ ::msgcat::mcset el "&Abort" "\u03a4\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2"
+ ::msgcat::mcset el "About..." "\u03a3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac..."
+ ::msgcat::mcset el "All Files" "\u038c\u03bb\u03b1 \u03c4\u03b1 \u0391\u03c1\u03c7\u03b5\u03af\u03b1"
+ ::msgcat::mcset el "Application Error" "\u039b\u03ac\u03b8\u03bf\u03c2 \u0395\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae\u03c2"
+ ::msgcat::mcset el "&Blue" "\u039c\u03c0\u03bb\u03b5"
+ ::msgcat::mcset el "&Cancel" "\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7"
+ ::msgcat::mcset el \
+"Cannot change to the directory \"%1\$s\".\nPermission denied." \
+"\u0394\u03b5\u03bd \u03b5\u03af\u03bd\u03b1\u03b9 \u03b4\u03c5\u03bd\u03b1\u03c4\u03ae \u03b7 \u03b1\u03bb\u03bb\u03b1\u03b3\u03ae \u03ba\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5 \u03c3\u03b5 \"%1\$s\".\n\u0397 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03b4\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9."
+ ::msgcat::mcset el "Choose Directory" "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u039a\u03b1\u03c4\u03b1\u03bb\u03cc\u03b3\u03bf\u03c5"
+ ::msgcat::mcset el "Clear" "\u039a\u03b1\u03b8\u03b1\u03c1\u03b9\u03c3\u03bc\u03cc\u03c2"
+ ::msgcat::mcset el "Color" "\u03a7\u03c1\u03ce\u03bc\u03b1"
+ ::msgcat::mcset el "Console" "\u039a\u03bf\u03bd\u03c3\u03cc\u03bb\u03b1"
+ ::msgcat::mcset el "Copy" "\u0391\u03bd\u03c4\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae"
+ ::msgcat::mcset el "Cut" "\u0391\u03c0\u03bf\u03ba\u03bf\u03c0\u03ae"
+ ::msgcat::mcset el "Delete" "\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae"
+ ::msgcat::mcset el "Details >>" "\u039b\u03b5\u03c0\u03c4\u03bf\u03bc\u03ad\u03c1\u03b5\u03b9\u03b5\u03c2 >>"
+ ::msgcat::mcset el "Directory \"%1\$s\" does not exist." \
+ "\u039f \u03ba\u03b1\u03c4\u03ac\u03bb\u03bf\u03b3\u03bf\u03c2 \"%1\$s\" \u03b4\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9."
+ ::msgcat::mcset el "&Directory:" "&\u039a\u03b1\u03c4\u03ac\u03bb\u03bf\u03b3\u03bf\u03c2:"
+ ::msgcat::mcset el "Error: %1\$s" "\u039b\u03ac\u03b8\u03bf\u03c2: %1\$s"
+ ::msgcat::mcset el "Exit" "\u0388\u03be\u03bf\u03b4\u03bf\u03c2"
+ ::msgcat::mcset el \
+ "File \"%1\$s\" already exists.\nDo you want to overwrite it?" \
+ "\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \"%1\$s\" \u03ae\u03b4\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.\n\u0398\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03b5\u03c0\u03b9\u03ba\u03b1\u03bb\u03c5\u03c6\u03b8\u03b5\u03af;"
+ ::msgcat::mcset el "File \"%1\$s\" already exists.\n\n" \
+ "\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \"%1\$s\" \u03ae\u03b4\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9.\n\n"
+ ::msgcat::mcset el "File \"%1\$s\" does not exist." \
+ "\u03a4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \"%1\$s\" \u03b4\u03b5\u03bd \u03c5\u03c0\u03ac\u03c1\u03c7\u03b5\u03b9."
+ ::msgcat::mcset el "File &name:" "\u038c&\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5:"
+ ::msgcat::mcset el "File &names:" "\u038c&\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd:"
+ ::msgcat::mcset el "Files of &type:" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u03c4\u03bf\u03c5 &\u03c4\u03cd\u03c0\u03bf\u03c5:"
+ ::msgcat::mcset el "Fi&les:" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1:"
+ ::msgcat::mcset el "&Filter" "\u03a6\u03af\u03bb\u03c4\u03c1\u03bf"
+ ::msgcat::mcset el "Fil&ter:" "\u03a6\u03af\u03bb\u03c4\u03c1\u03bf:"
+ ::msgcat::mcset el "&Green" "\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "Hi" "\u0393\u03b5\u03b9\u03b1"
+ ::msgcat::mcset el "Hide Console" "\u0391\u03c0\u03cc\u03ba\u03c1\u03c5\u03c8\u03b7 \u03ba\u03bf\u03bd\u03c3\u03cc\u03bb\u03b1\u03c2"
+ ::msgcat::mcset el "&Ignore" "\u0391\u03b3\u03bd\u03cc\u03b7\u03c3\u03b7"
+ ::msgcat::mcset el "Invalid file name \"%1\$s\"." \
+ "\u0386\u03ba\u03c5\u03c1\u03bf \u03cc\u03bd\u03bf\u03bc\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 \"%1\$s\"."
+ ::msgcat::mcset el "Log Files" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u039a\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2"
+ ::msgcat::mcset el "&No" "\u038c\u03c7\u03b9"
+ ::msgcat::mcset el "&OK" "\u0395\u03bd\u03c4\u03ac\u03be\u03b5\u03b9"
+ ::msgcat::mcset el "&Ok" "\u0395\u03bd\u03c4\u03ac\u03be\u03b5\u03b9"
+ ::msgcat::mcset el "Open" "\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1"
+ ::msgcat::mcset el "&Open" "\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1"
+ ::msgcat::mcset el "Open Multiple Files" \
+ "\u0386\u03bd\u03bf\u03b9\u03b3\u03bc\u03b1 \u03c0\u03bf\u03bb\u03bb\u03b1\u03c0\u03bb\u03ce\u03bd \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd"
+ ::msgcat::mcset el "Paste" "\u0395\u03c0\u03b9\u03ba\u03cc\u03bb\u03bb\u03b7\u03c3\u03b7"
+ ::msgcat::mcset el "Quit" "\u0388\u03be\u03bf\u03b4\u03bf\u03c2"
+ ::msgcat::mcset el "&Red" "\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "Replace existing file?" \
+ "\u0395\u03c0\u03b9\u03ba\u03ac\u03bb\u03c5\u03c8\u03b7 \u03c5\u03c0\u03ac\u03c1\u03c7\u03bf\u03bd\u03c4\u03bf\u03c2 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5;"
+ ::msgcat::mcset el "&Retry" "\u03a0\u03c1\u03bf\u03c3\u03c0\u03ac\u03b8\u03b7\u03c3\u03b5 \u03be\u03b1\u03bd\u03ac"
+ ::msgcat::mcset el "&Save" "\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7"
+ ::msgcat::mcset el "Save As" "\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u03c3\u03b1\u03bd"
+ ::msgcat::mcset el "Save To Log" "\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u03c3\u03c4\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03ba\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2"
+ ::msgcat::mcset el "Select Log File" "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 \u03ba\u03b1\u03c4\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae\u03c2"
+ ::msgcat::mcset el "Select a file to source" \
+ "\u0395\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03b3\u03b9\u03b1 \u03b5\u03ba\u03c4\u03ad\u03bb\u03b5\u03c3\u03b7"
+ ::msgcat::mcset el "&Selection:" "\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae:"
+ ::msgcat::mcset el "Skip Messages" "\u0391\u03c0\u03bf\u03c6\u03c5\u03b3\u03ae \u03bc\u03c5\u03bd\u03b7\u03bc\u03ac\u03c4\u03c9\u03bd"
+ ::msgcat::mcset el "Source..." "\u0395\u03ba\u03c4\u03ad\u03bb\u03b5\u03c3\u03b7..."
+ ::msgcat::mcset el "Tcl Scripts" "Tcl Scripts"
+ ::msgcat::mcset el "Tcl for Windows" "Tcl \u03b3\u03b9\u03b1 Windows"
+ ::msgcat::mcset el "Text Files" "\u0391\u03c1\u03c7\u03b5\u03af\u03b1 \u039a\u03b5\u03b9\u03bc\u03ad\u03bd\u03bf\u03c5"
+ ::msgcat::mcset el "&Yes" "\u039d\u03b1\u03b9"
+ ::msgcat::mcset el "abort" "\u03c4\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2"
+ ::msgcat::mcset el "blue" "\u03bc\u03c0\u03bb\u03b5"
+ ::msgcat::mcset el "cancel" "\u03b1\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7"
+ ::msgcat::mcset el "extension" "\u03b5\u03c0\u03ad\u03ba\u03c4\u03b1\u03c3\u03b7"
+ ::msgcat::mcset el "extensions" "\u03b5\u03c0\u03b5\u03ba\u03c4\u03ac\u03c3\u03b5\u03b9\u03c2"
+ ::msgcat::mcset el "green" "\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "ignore" "\u03b1\u03b3\u03bd\u03cc\u03b7\u03c3\u03b7"
+ ::msgcat::mcset el "ok" "\u03b5\u03bd\u03c4\u03ac\u03be\u03b5\u03b9"
+ ::msgcat::mcset el "red" "\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf"
+ ::msgcat::mcset el "retry" "\u03c0\u03c1\u03bf\u03c3\u03c0\u03ac\u03b8\u03b7\u03c3\u03b5 \u03be\u03b1\u03bd\u03ac"
+ ::msgcat::mcset el "yes" "\u03bd\u03b1\u03b9"
+}
+
diff --git a/tk/library/msgs/en.msg b/tk/library/msgs/en.msg
new file mode 100644
index 00000000000..7242f913ce2
--- /dev/null
+++ b/tk/library/msgs/en.msg
@@ -0,0 +1,70 @@
+namespace eval ::tk {
+ ::msgcat::mcset en "&Abort"
+ ::msgcat::mcset en "About..."
+ ::msgcat::mcset en "All Files"
+ ::msgcat::mcset en "Application Error"
+ ::msgcat::mcset en "&Blue"
+ ::msgcat::mcset en "&Cancel"
+ ::msgcat::mcset en "Cannot change to the directory \"%1\$s\".\nPermission denied."
+ ::msgcat::mcset en "Choose Directory"
+ ::msgcat::mcset en "Clear"
+ ::msgcat::mcset en "Color"
+ ::msgcat::mcset en "Console"
+ ::msgcat::mcset en "Copy"
+ ::msgcat::mcset en "Cut"
+ ::msgcat::mcset en "Delete"
+ ::msgcat::mcset en "Details >>"
+ ::msgcat::mcset en "Directory \"%1\$s\" does not exist."
+ ::msgcat::mcset en "&Directory:"
+ ::msgcat::mcset en "Error: %1\$s"
+ ::msgcat::mcset en "Exit"
+ ::msgcat::mcset en "File \"%1\$s\" already exists.\nDo you want to overwrite it?"
+ ::msgcat::mcset en "File \"%1\$s\" already exists.\n\n"
+ ::msgcat::mcset en "File \"%1\$s\" does not exist."
+ ::msgcat::mcset en "File &name:"
+ ::msgcat::mcset en "File &names:"
+ ::msgcat::mcset en "Files of &type:"
+ ::msgcat::mcset en "Fi&les:"
+ ::msgcat::mcset en "&Filter"
+ ::msgcat::mcset en "Fil&ter:"
+ ::msgcat::mcset en "&Green"
+ ::msgcat::mcset en "Hi"
+ ::msgcat::mcset en "Hide Console"
+ ::msgcat::mcset en "&Ignore"
+ ::msgcat::mcset en "Invalid file name \"%1\$s\"."
+ ::msgcat::mcset en "Log Files"
+ ::msgcat::mcset en "&No"
+ ::msgcat::mcset en "&OK"
+ ::msgcat::mcset en "Ok"
+ ::msgcat::mcset en "Open"
+ ::msgcat::mcset en "&Open"
+ ::msgcat::mcset en "Open Multiple Files"
+ ::msgcat::mcset en "Paste"
+ ::msgcat::mcset en "Quit"
+ ::msgcat::mcset en "&Red"
+ ::msgcat::mcset en "Replace existing file?"
+ ::msgcat::mcset en "&Retry"
+ ::msgcat::mcset en "&Save"
+ ::msgcat::mcset en "Save As"
+ ::msgcat::mcset en "Save To Log"
+ ::msgcat::mcset en "Select Log File"
+ ::msgcat::mcset en "Select a file to source"
+ ::msgcat::mcset en "&Selection:"
+ ::msgcat::mcset en "Skip Messages"
+ ::msgcat::mcset en "Source..."
+ ::msgcat::mcset en "Tcl Scripts"
+ ::msgcat::mcset en "Tcl for Windows"
+ ::msgcat::mcset en "Text Files"
+ ::msgcat::mcset en "&Yes"
+ ::msgcat::mcset en "abort"
+ ::msgcat::mcset en "blue"
+ ::msgcat::mcset en "cancel"
+ ::msgcat::mcset en "extension"
+ ::msgcat::mcset en "extensions"
+ ::msgcat::mcset en "green"
+ ::msgcat::mcset en "ignore"
+ ::msgcat::mcset en "ok"
+ ::msgcat::mcset en "red"
+ ::msgcat::mcset en "retry"
+ ::msgcat::mcset en "yes"
+}
diff --git a/tk/library/msgs/en_gb.msg b/tk/library/msgs/en_gb.msg
new file mode 100644
index 00000000000..efafa38c6d7
--- /dev/null
+++ b/tk/library/msgs/en_gb.msg
@@ -0,0 +1,3 @@
+namespace eval ::tk {
+ ::msgcat::mcset en_gb Color Colour
+}
diff --git a/tk/library/msgs/es.msg b/tk/library/msgs/es.msg
new file mode 100644
index 00000000000..7de0faef215
--- /dev/null
+++ b/tk/library/msgs/es.msg
@@ -0,0 +1,70 @@
+namespace eval ::tk {
+ ::msgcat::mcset es "&Abort" "&Abortar"
+ ::msgcat::mcset es "About..." "Acerca de ..."
+ ::msgcat::mcset es "All Files" "Todos los archivos"
+ ::msgcat::mcset es "Application Error" "Error de la aplicaci\u00f3n"
+ ::msgcat::mcset es "&Blue" "&Azul"
+ ::msgcat::mcset es "&Cancel" "&Cancelar"
+ ::msgcat::mcset es "Cannot change to the directory \"%1\$s\".\nPermission denied." "No es posible acceder al directorio \"%1\$s\".\nPermiso denegado."
+ ::msgcat::mcset es "Choose Directory" "Elegir directorio"
+ ::msgcat::mcset es "Clear" "Borrar"
+ ::msgcat::mcset es "Color" "Color"
+ ::msgcat::mcset es "Console" "Consola"
+ ::msgcat::mcset es "Copy" "Copiar"
+ ::msgcat::mcset es "Cut" "Cortar"
+ ::msgcat::mcset es "Delete" "Borrar"
+ ::msgcat::mcset es "Details >>" "Detalles >>"
+ ::msgcat::mcset es "Directory \"%1\$s\" does not exist." "El directorio \"%1\$s\" no existe."
+ ::msgcat::mcset es "&Directory:" "&Directorio:"
+ ::msgcat::mcset es "Error: %1\$s" "Error: %1\$s"
+ ::msgcat::mcset es "Exit" "Salir"
+ ::msgcat::mcset es "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "El archivo \"%1\$s\" ya existe.\nDesea sobreescribirlo?"
+ ::msgcat::mcset es "File \"%1\$s\" already exists.\n\n" "El archivo \"%1\$s\" ya existe.\n\n"
+ ::msgcat::mcset es "File \"%1\$s\" does not exist." "El archivo \"%1\$s\" no existe."
+ ::msgcat::mcset es "File &name:" "&Nombre de archivo:"
+ ::msgcat::mcset es "File &names:" "&Nombres de archivo:"
+ ::msgcat::mcset es "Files of &type:" "Archivos de &tipo:"
+ ::msgcat::mcset es "Fi&les:" "&Archivos:"
+ ::msgcat::mcset es "&Filter" "&Filtro"
+ ::msgcat::mcset es "Fil&ter:" "Fil&tro:"
+ ::msgcat::mcset es "&Green" "&Verde"
+ ::msgcat::mcset es "Hi" "Hola"
+ ::msgcat::mcset es "Hide Console" "Esconder la consola"
+ ::msgcat::mcset es "&Ignore" "&Ignorar"
+ ::msgcat::mcset es "Invalid file name \"%1\$s\"." "Nombre de archivo inv\u00e1lido \"%1\$s\"."
+ ::msgcat::mcset es "Log Files" "Ficheros de traza"
+ ::msgcat::mcset es "&No" "&No"
+ ::msgcat::mcset es "&OK" "&OK"
+ ::msgcat::mcset es "Ok" "Ok"
+ ::msgcat::mcset es "Open" "Abrir"
+ ::msgcat::mcset es "&Open" "&Abrir"
+ ::msgcat::mcset es "Open Multiple Files" "Abrir m\u00faltiples archivos"
+ ::msgcat::mcset es "Paste" "Pegar"
+ ::msgcat::mcset es "Quit" "Abandonar"
+ ::msgcat::mcset es "&Red" "&Rojo"
+ ::msgcat::mcset es "Replace existing file?" "Reemplazar el archivo existente?"
+ ::msgcat::mcset es "&Retry" "&Reintentar"
+ ::msgcat::mcset es "&Save" "&Salvar"
+ ::msgcat::mcset es "Save As" "Salvar como"
+ ::msgcat::mcset es "Save To Log" "Salvar al archivo de traza"
+ ::msgcat::mcset es "Select Log File" "Elegir un archivo de traza"
+ ::msgcat::mcset es "Select a file to source" "Seleccionar un archivo a evaluar"
+ ::msgcat::mcset es "&Selection:" "&Selecci\u00f3n:"
+ ::msgcat::mcset es "Skip Messages" "Omitir los mensajes"
+ ::msgcat::mcset es "Source..." "Evaluar..."
+ ::msgcat::mcset es "Tcl Scripts" "Scripts Tcl"
+ ::msgcat::mcset es "Tcl for Windows" "Tcl para Windows"
+ ::msgcat::mcset es "Text Files" "Archivos de texto"
+ ::msgcat::mcset es "&Yes" "&S\u00ed"
+ ::msgcat::mcset es "abort" "abortar"
+ ::msgcat::mcset es "blue" "azul"
+ ::msgcat::mcset es "cancel" "cancelar"
+ ::msgcat::mcset es "extension" "extensi\u00f3n"
+ ::msgcat::mcset es "extensions" "extensiones"
+ ::msgcat::mcset es "green" "verde"
+ ::msgcat::mcset es "ignore" "ignorar"
+ ::msgcat::mcset es "ok" "ok"
+ ::msgcat::mcset es "red" "rojo"
+ ::msgcat::mcset es "retry" "reintentar"
+ ::msgcat::mcset es "yes" "s\u00ed"
+}
diff --git a/tk/library/msgs/fr.msg b/tk/library/msgs/fr.msg
new file mode 100644
index 00000000000..6dba60afbea
--- /dev/null
+++ b/tk/library/msgs/fr.msg
@@ -0,0 +1,70 @@
+namespace eval ::tk {
+ ::msgcat::mcset fr "&Abort" "&Annuler"
+ ::msgcat::mcset fr "About..." "\u00c0 propos..."
+ ::msgcat::mcset fr "All Files" "Tous les fichiers"
+ ::msgcat::mcset fr "Application Error" "Erreur d'application"
+ ::msgcat::mcset fr "&Blue" "&Bleu"
+ ::msgcat::mcset fr "&Cancel" "&Annuler"
+ ::msgcat::mcset fr "Cannot change to the directory \"%1\$s\".\nPermission denied." "Impossible d'acc\u00e9der au r\u00e9pertoire \"%1\$s\".\nPermission refus\u00e9e."
+ ::msgcat::mcset fr "Choose Directory" "Choisir r\u00e9pertoire"
+ ::msgcat::mcset fr "Clear" "Effacer"
+ ::msgcat::mcset fr "Color" "Couleur"
+ ::msgcat::mcset fr "Console"
+ ::msgcat::mcset fr "Copy" "Copier"
+ ::msgcat::mcset fr "Cut" "Couper"
+ ::msgcat::mcset fr "Delete" "Effacer"
+ ::msgcat::mcset fr "Details >>" "D\u00e9tails >>"
+ ::msgcat::mcset fr "Directory \"%1\$s\" does not exist."
+ ::msgcat::mcset fr "&Directory:" "&R\u00e9pertoire:"
+ ::msgcat::mcset fr "Error: %1\$s"
+ ::msgcat::mcset fr "Exit"
+ ::msgcat::mcset fr "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Le fichier \"%1\$s\" existe d\u00e9j\u00e0.\nVoulez-vous l'\u00e9craser?"
+ ::msgcat::mcset fr "File \"%1\$s\" already exists.\n\n" "Le fichier \"%1\$s\" existe d\u00e9j\u00e0.\n\n"
+ ::msgcat::mcset fr "File \"%1\$s\" does not exist." "Le fichier \"%1\$s\" n'existe pas."
+ ::msgcat::mcset fr "File &name:" "&Nom de fichier:"
+ ::msgcat::mcset fr "File &names:" "&Noms de fichiers:"
+ ::msgcat::mcset fr "Files of &type:" "&Type de fichiers:"
+ ::msgcat::mcset fr "Fi&les:" "Fich&iers:"
+ ::msgcat::mcset fr "&Filter" "&Filtre"
+ ::msgcat::mcset fr "Fil&ter:" "Fil&tre:"
+ ::msgcat::mcset fr "&Green" "&Vert"
+ ::msgcat::mcset fr "Hi" "All\u00f4"
+ ::msgcat::mcset fr "Hide Console" "Cacher la Console"
+ ::msgcat::mcset fr "&Ignore" "&Ignorer"
+ ::msgcat::mcset fr "Invalid file name \"%1\$s\"." "Nom de fichier invalide \"%1\$s\"."
+ ::msgcat::mcset fr "Log Files" "Fichiers de trace"
+ ::msgcat::mcset fr "&No" "&Non"
+ ::msgcat::mcset fr "&OK"
+ ::msgcat::mcset fr "Ok"
+ ::msgcat::mcset fr "Open" "Ouvrir"
+ ::msgcat::mcset fr "&Open" "&Ouvrir"
+ ::msgcat::mcset fr "Open Multiple Files" "Ouvrir plusieurs fichiers"
+ ::msgcat::mcset fr "Paste" "Coller"
+ ::msgcat::mcset fr "Quit" "Abandonner"
+ ::msgcat::mcset fr "&Red" "&Rouge"
+ ::msgcat::mcset fr "Replace existing file?" "Remplacer fichier existant?"
+ ::msgcat::mcset fr "&Retry" "&R\u00e9-essayer"
+ ::msgcat::mcset fr "&Save" "&Sauvegarder"
+ ::msgcat::mcset fr "Save As" "Sauvegarder sous"
+ ::msgcat::mcset fr "Save To Log" "Sauvegarde au fichier de trace"
+ ::msgcat::mcset fr "Select Log File" "Choisir un fichier de trace"
+ ::msgcat::mcset fr "Select a file to source" "Choisir un fichier \u00e0 \u00e9valuer"
+ ::msgcat::mcset fr "&Selection:" "&S\u00e9lection:"
+ ::msgcat::mcset fr "Skip Messages" "Omettre les messages"
+ ::msgcat::mcset fr "Source..." "\u00c9valuer..."
+ ::msgcat::mcset fr "Tcl Scripts" "Scripts Tcl"
+ ::msgcat::mcset fr "Tcl for Windows" "Tcl pour Windows"
+ ::msgcat::mcset fr "Text Files" "Fichiers texte"
+ ::msgcat::mcset fr "&Yes" "&Oui"
+ ::msgcat::mcset fr "abort" "annuler"
+ ::msgcat::mcset fr "blue" "bleu"
+ ::msgcat::mcset fr "cancel" "annuler"
+ ::msgcat::mcset fr "extension"
+ ::msgcat::mcset fr "extensions"
+ ::msgcat::mcset fr "green" "vert"
+ ::msgcat::mcset fr "ignore" "ignorer"
+ ::msgcat::mcset fr "ok"
+ ::msgcat::mcset fr "red" "rouge"
+ ::msgcat::mcset fr "retry" "r\u00e9-essayer"
+ ::msgcat::mcset fr "yes" "oui"
+}
diff --git a/tk/library/msgs/it.msg b/tk/library/msgs/it.msg
new file mode 100644
index 00000000000..9e6298b8d79
--- /dev/null
+++ b/tk/library/msgs/it.msg
@@ -0,0 +1,70 @@
+namespace eval ::tk {
+ ::msgcat::mcset it "&Abort" "&Interrompi"
+ ::msgcat::mcset it "About..." "Informazioni ..."
+ ::msgcat::mcset it "All Files" "Tutti i file"
+ ::msgcat::mcset it "Application Error" "Errore dell' applicazione"
+ ::msgcat::mcset it "&Blue" "&Blu"
+ ::msgcat::mcset it "&Cancel" "&Annulla"
+ ::msgcat::mcset it "Cannot change to the directory \"%1\$s\".\nPermission denied." "Impossibile accedere alla directory \"%1\$s\".\nPermesso negato."
+ ::msgcat::mcset it "Choose Directory" "Scegli directory"
+ ::msgcat::mcset it "Clear" "Azzera"
+ ::msgcat::mcset it "Color" "Colore"
+ ::msgcat::mcset it "Console"
+ ::msgcat::mcset it "Copy" "Copia"
+ ::msgcat::mcset it "Cut" "Taglia"
+ ::msgcat::mcset it "Delete" "Incolla"
+ ::msgcat::mcset it "Details >>" "Dettagli >>"
+ ::msgcat::mcset it "Directory \"%1\$s\" does not exist." "La directory \"%1\$s\" non esiste."
+ ::msgcat::mcset it "&Directory:"
+ ::msgcat::mcset it "Error: %1\$s" "Errore: %1\$s"
+ ::msgcat::mcset it "Exit" "Esci"
+ ::msgcat::mcset it "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Il file \"%1\$s\" esiste gi\u00e0.\nVuoi sovrascriverlo?"
+ ::msgcat::mcset it "File \"%1\$s\" already exists.\n\n" "Il file \"%1\$s\" esiste gi\u00e0.\n\n"
+ ::msgcat::mcset it "File \"%1\$s\" does not exist." "Il file \"%1\$s\" non esiste."
+ ::msgcat::mcset it "File &name:" "&Nome del file:"
+ ::msgcat::mcset it "File &names:" "&Nomi dei file:"
+ ::msgcat::mcset it "Files of &type:" "File di &tipo:"
+ ::msgcat::mcset it "Fi&les:" "Fi&le:"
+ ::msgcat::mcset it "&Filter" "&Filtro"
+ ::msgcat::mcset it "Fil&ter:" "Fil&tro:"
+ ::msgcat::mcset it "&Green" "&Verde"
+ ::msgcat::mcset it "Hi" "Salve"
+ ::msgcat::mcset it "Hide Console" "Nascondi la console"
+ ::msgcat::mcset it "&Ignore" "&Ignora"
+ ::msgcat::mcset it "Invalid file name \"%1\$s\"." "Nome di file non valido \"%1\$s\"."
+ ::msgcat::mcset it "Log Files" "File di log"
+ ::msgcat::mcset it "&No"
+ ::msgcat::mcset it "&OK"
+ ::msgcat::mcset it "Ok"
+ ::msgcat::mcset it "&Open" "A&pri"
+ ::msgcat::mcset it "Open" "Apri"
+ ::msgcat::mcset it "Open Multiple Files" "Apri file multipli"
+ ::msgcat::mcset it "Paste" "Incolla"
+ ::msgcat::mcset it "Quit" "Esci"
+ ::msgcat::mcset it "&Red" "&Rosso"
+ ::msgcat::mcset it "Replace existing file?" "Sostituisci il file esistente?"
+ ::msgcat::mcset it "&Retry" "&Riprova"
+ ::msgcat::mcset it "&Save" "&Salva"
+ ::msgcat::mcset it "Save As" "Salva come"
+ ::msgcat::mcset it "Save To Log" "Salva il log"
+ ::msgcat::mcset it "Select Log File" "Scegli un file di log"
+ ::msgcat::mcset it "Select a file to source" "Scegli un file da eseguire"
+ ::msgcat::mcset it "&Selection:" "&Selezione:"
+ ::msgcat::mcset it "Skip Messages" "Salta i messaggi"
+ ::msgcat::mcset it "Source..." "Esegui..."
+ ::msgcat::mcset it "Tcl Scripts" "Scripts Tcl"
+ ::msgcat::mcset it "Tcl for Windows" "Tcl per Windows"
+ ::msgcat::mcset it "Text Files" "File di testo"
+ ::msgcat::mcset it "&Yes" "&Si"
+ ::msgcat::mcset it "abort" "interrompi"
+ ::msgcat::mcset it "blue" "blu"
+ ::msgcat::mcset it "cancel" "annulla"
+ ::msgcat::mcset it "extension" "estensione"
+ ::msgcat::mcset it "extensions" "estensioni"
+ ::msgcat::mcset it "green" "verde"
+ ::msgcat::mcset it "ignore" "ignora"
+ ::msgcat::mcset it "ok"
+ ::msgcat::mcset it "red" "rosso"
+ ::msgcat::mcset it "retry" "riprova"
+ ::msgcat::mcset it "yes" "si"
+}
diff --git a/tk/library/msgs/nl.msg b/tk/library/msgs/nl.msg
new file mode 100644
index 00000000000..daad8474bf0
--- /dev/null
+++ b/tk/library/msgs/nl.msg
@@ -0,0 +1,106 @@
+namespace eval ::tk {
+ ::msgcat::mcset nl "\"%1\$s\" must be an absolute pathname" "\"%1\$s\" moet een absolute pad-naam zijn"
+ ::msgcat::mcset nl "%1\$s is not a toplevel window" "%1\$s is geen toplevel window"
+ ::msgcat::mcset nl ", or" ", of"
+ ::msgcat::mcset nl "-default, -icon, -message, -parent, -title, or -type" "-default, -icon, -message, -parent, -title, of -type"
+ ::msgcat::mcset nl "-initialdir, -mustexist, -parent, or -title" "-initialdir, -mustexist, -parent, of -title"
+ ::msgcat::mcset nl "&Abort" "&Afbreken"
+ ::msgcat::mcset nl "About..." "Over..."
+ ::msgcat::mcset nl "All Files" "Alle Bestanden"
+ ::msgcat::mcset nl "Application Error" "Toepassingsfout"
+ ::msgcat::mcset nl "&Blue" "&Blauw"
+ ::msgcat::mcset nl "&Cancel" "&Annuleren"
+ ::msgcat::mcset nl "Cannot change to the directory \"%1\$s\".\nPermission denied." "Kan niet naar map \"%1\$s\" gaan.\nU heeft geen toestemming hiervoor."
+ ::msgcat::mcset nl "Choose Directory" "Kies map"
+ ::msgcat::mcset nl "Clear" "Wissen"
+ ::msgcat::mcset nl "Clear entry, Press OK; Enter %1\$s, press OK" "Wis veld, Druk op OK; Geef %1\$s in, druk op OK"
+ ::msgcat::mcset nl "Color" "Kleur"
+ ::msgcat::mcset nl "Console"
+ ::msgcat::mcset nl "Copy" "Copi\u00ebren"
+ ::msgcat::mcset nl "Cut" "Knippen"
+ ::msgcat::mcset nl "Delete" "Wissen"
+ ::msgcat::mcset nl "Details"
+ ::msgcat::mcset nl "Details >>"
+ ::msgcat::mcset nl "Directory \"%1\$s\" does not exist." "Map \"%1\$s\" bestaat niet."
+ ::msgcat::mcset nl "&Directory:" "&Map:"
+ ::msgcat::mcset nl "Enter \"%1\$s\", press OK" "Toets \"%1\$s\", druk op OK"
+ ::msgcat::mcset nl "Enter \"%1\$s\", press OK, enter \"%2\$s\", press OK" "Toets \"%1\$s\", druk op OK, toets \"%2\$s\", druk op OK"
+ ::msgcat::mcset nl "Error: %1\$s" "Fout: %1\$s"
+ ::msgcat::mcset nl "Exit" "Be\u00ebindigen"
+ ::msgcat::mcset nl "File \"%1\$s\" already exists.\n\n" "Bestand \"%1\$s\" bestaat al.\n\n"
+ ::msgcat::mcset nl "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Bestand \"%1\$s\" bestaat al.\nWilt u het overschrijven?"
+ ::msgcat::mcset nl "File \"%1\$s\" does not exist." "Bestand \"%1\$s\" bestaat niet."
+ ::msgcat::mcset nl "File &name:" "Bestands&naam:"
+ ::msgcat::mcset nl "File &names:" "Bestands&namen:"
+ ::msgcat::mcset nl "Files of &type:" "Bestanden van het &type:"
+ ::msgcat::mcset nl "Fi&les:" "&Bestanden:"
+ ::msgcat::mcset nl "&Filter"
+ ::msgcat::mcset nl "Fil&ter:"
+ ::msgcat::mcset nl "&Green" "&Groen"
+ ::msgcat::mcset nl "Hi" "H\u00e9"
+ ::msgcat::mcset nl "Hide Console" "Verberg Console"
+ ::msgcat::mcset nl "&Ignore"
+ ::msgcat::mcset nl "Invalid file name \"%1\$s\"." "Ongeldige bestandsnaam \"%1\$s\"."
+ ::msgcat::mcset nl "Log Files" "Log Bestanden"
+ ::msgcat::mcset nl "&No" "&Nee"
+ ::msgcat::mcset nl "&OK"
+ ::msgcat::mcset nl "Ok"
+ ::msgcat::mcset nl "&Open" "&Openen"
+ ::msgcat::mcset nl "Open" "Openen"
+ ::msgcat::mcset nl "Open Multiple Files" "Open meerdere bestanden"
+ ::msgcat::mcset nl "Paste" "Plakken"
+ ::msgcat::mcset nl "Please press %1\$s" "Druk op %1\$s, A.U.B."
+ ::msgcat::mcset nl "Please press ok" "Druk op ok, A.U.B."
+ ::msgcat::mcset nl "Press Cancel" "Druk op Annuleren"
+ ::msgcat::mcset nl "Press Ok" "Druk op Ok"
+ ::msgcat::mcset nl "Quit" "Stoppen"
+ ::msgcat::mcset nl "&Red" "&Rood"
+ ::msgcat::mcset nl "Replace existing file?" "Vervang bestaand bestand?"
+ ::msgcat::mcset nl "&Retry" "O&nieuw"
+ ::msgcat::mcset nl "&Save" "Op&slaan"
+ ::msgcat::mcset nl "Save As" "Opslaan als"
+ ::msgcat::mcset nl "Save To Log" "Opslaan naar Log"
+ ::msgcat::mcset nl "Select Log File" "Selecteer Log bestand"
+ ::msgcat::mcset nl "Select a file to source" "Selecteer bronbestand"
+ ::msgcat::mcset nl "&Selection:" "&Selectie:"
+ ::msgcat::mcset nl "Skip Messages" "Berichten overslaan"
+ ::msgcat::mcset nl "Source..." "Bron..."
+ ::msgcat::mcset nl "Tcl Scripts"
+ ::msgcat::mcset nl "Tcl for Windows" "Tcl voor Windows"
+ ::msgcat::mcset nl "Text Files" "Tekst Bestanden"
+ ::msgcat::mcset nl "&Yes" "&Ja"
+ ::msgcat::mcset nl "abort" "afbreken"
+ ::msgcat::mcset nl "abort, retry, ignore, ok, cancel, no, or yes" "afbreken, opnieuw, negeren, ok, annuleren, nee, of ja"
+ ::msgcat::mcset nl "abortretryignore, ok, okcancel, retrycancel, yesno, or yesnocancel" "abortretryignore, ok, okcancel, retrycancel, yesno, of yesnocancel"
+ ::msgcat::mcset nl "bad %1\$s value \"%2\$s\": must be %3\$s" "foutieve %1\$s waarde \"%2\$s\": moet zijn %3\$s"
+ ::msgcat::mcset nl "bad file type \"%1\$s\", should be" "foutief bestandstype \"%1\$s\", moet zijn"
+ ::msgcat::mcset nl "bad option \"%1\$s\": should be %2\$s" "foutieve optie \"%1\$s\": moet zijn %2\$s"
+ ::msgcat::mcset nl "bad window path name \"%1\$s\"" "foutieve window pad naam \"%1\$s\""
+ ::msgcat::mcset nl "blue" "blauw"
+ ::msgcat::mcset nl "can't post %1\$s: it isn't a descendant of %2\$s (this is a new requirement in Tk versions 3.0 and later)" "kan %1\$s niet verzenden: het is geen afstammeling van %2\$s (dit is een niewe verplichting in Tk versies 3.0 en later)"
+ ::msgcat::mcset nl "cancel" "annuleren"
+ ::msgcat::mcset nl "default button index greater than number of buttons specified for tk_dialog" "default knop index is groter dan het aantal knoppen beschikbaar voor tk_dialog"
+ ::msgcat::mcset nl "display name to use (current one otherwise)" "te gebruiken schermnaam (anders huidige scherm)"
+ ::msgcat::mcset nl "error, info, question, or warning" "error, info, question, of warning"
+ ::msgcat::mcset nl "extension"
+ ::msgcat::mcset nl "extensions"
+ ::msgcat::mcset nl "focus group \"%1\$s\" doesn't exist" "focus groep \"%1\$s\" bestaat niet"
+ ::msgcat::mcset nl "green" "groen"
+ ::msgcat::mcset nl "history event %1\$s"
+ ::msgcat::mcset nl "ignore" "negeren"
+ ::msgcat::mcset nl "invalid default button \"%1\$s\"" "ongeldige default knop \"%1\$s\""
+ ::msgcat::mcset nl "macType"
+ ::msgcat::mcset nl "macTypes"
+ ::msgcat::mcset nl "must specify a background color" "een achtergrondkleur is verplicht"
+ ::msgcat::mcset nl "name of the slave interpreter" "naam van de slaaf interpreter"
+ ::msgcat::mcset nl "no winfo screen . nor env(DISPLAY)" "geen winfo scherm . noch env(DISPLAY)"
+ ::msgcat::mcset nl "ok"
+ ::msgcat::mcset nl "red" "rood"
+ ::msgcat::mcset nl "retry" "opnieuw"
+ ::msgcat::mcset nl "should contain 5 or 4 elements" "moet 4 of 5 elementen bevatten"
+ ::msgcat::mcset nl "spec"
+ ::msgcat::mcset nl "tk_chooseDirectory command" "tk_chooseDirectory commando"
+ ::msgcat::mcset nl "tk_chooseDirectory command, cancel gives null" "tk_chooseDirectory commando, annuleren geeft lege waarde"
+ ::msgcat::mcset nl "tk_chooseDirectory command, initialdir" "tk_chooseDirectory commando, initi\u00eble map"
+ ::msgcat::mcset nl "yes" "ja"
+}
diff --git a/tk/library/msgs/ru.msg b/tk/library/msgs/ru.msg
new file mode 100644
index 00000000000..9f6aa807e0a
--- /dev/null
+++ b/tk/library/msgs/ru.msg
@@ -0,0 +1,73 @@
+namespace eval ::tk {
+ ::msgcat::mcset ru "&Abort" "&\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c"
+ ::msgcat::mcset ru "About..." "\u041f\u0440\u043e..."
+ ::msgcat::mcset ru "All Files" "\u0412\u0441\u0435 \u0444\u0430\u0439\u043b\u044b"
+ ::msgcat::mcset ru "Application Error" "\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435"
+ ::msgcat::mcset ru "&Blue" " &\u0413\u043e\u043b\u0443\u0431\u043e\u0439"
+ ::msgcat::mcset ru "&Cancel" "\u041e\u0442&\u043c\u0435\u043d\u0430"
+ ::msgcat::mcset ru "Cannot change to the directory \"%1\$s\".\nPermission denied." \
+ "\u041d\u0435 \u043c\u043e\u0433\u0443 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \"%1\$s\".\n\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430"
+ ::msgcat::mcset ru "Choose Directory" "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433"
+ ::msgcat::mcset ru "Clear" "\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Color" "\u0426\u0432\u0435\u0442"
+ ::msgcat::mcset ru "Console" "\u041a\u043e\u043d\u0441\u043e\u043b\u044c"
+ ::msgcat::mcset ru "Copy" "\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c"
+ ::msgcat::mcset ru "Cut" "\u0412\u044b\u0440\u0435\u0437\u0430\u0442\u044c"
+ ::msgcat::mcset ru "Delete" "\u0423\u0434\u0430\u043b\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Details >>" "\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 >>"
+ ::msgcat::mcset ru "Directory \"%1\$s\" does not exist." "\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \"%1\$s\" \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442."
+ ::msgcat::mcset ru "&Directory:" "&\u041a\u0430\u0442\u0430\u043b\u043e\u0433:"
+ ::msgcat::mcset ru "Error: %1\$s" "\u041e\u0448\u0438\u0431\u043a\u0430: %1\$s"
+ ::msgcat::mcset ru "Exit" "\u0412\u044b\u0445\u043e\u0434"
+ ::msgcat::mcset ru "File \"%1\$s\" already exists.\nDo you want to overwrite it?" \
+ "\u0424\u0430\u0439\u043b \"%1\$s\" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\n\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e?"
+ ::msgcat::mcset ru "File \"%1\$s\" already exists.\n\n" "\u0424\u0430\u0439\u043b \"%1\$s\" \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.\n\n"
+ ::msgcat::mcset ru "File \"%1\$s\" does not exist." "\u0424\u0430\u0439\u043b \"%1\$s\" \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d."
+ ::msgcat::mcset ru "File &name:" "&\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430:"
+ ::msgcat::mcset ru "File &names:" "&\u0418\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432:"
+ ::msgcat::mcset ru "Files of &type:" "&\u0422\u0438\u043f \u0444\u0430\u0439\u043b\u043e\u0432:"
+ ::msgcat::mcset ru "Fi&les:" "\u0424\u0430\u0439&\u043b\u044b:"
+ ::msgcat::mcset ru "&Filter" "&\u0424\u0438\u043b\u044c\u0442\u0440"
+ ::msgcat::mcset ru "Fil&ter:" "\u0424\u0438\u043b\u044c&\u0442\u0440:"
+ ::msgcat::mcset ru "&Green" " &\u0417\u0435\u043b\u0435\u043d\u044b\u0439"
+ ::msgcat::mcset ru "Hi" "\u041f\u0440\u0438\u0432\u0435\u0442"
+ ::msgcat::mcset ru "Hide Console" "\u0421\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c"
+ ::msgcat::mcset ru "&Ignore" "&\u0418\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c"
+ ::msgcat::mcset ru "Invalid file name \"%1\$s\"." "\u041d\u0435\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430 \"%1\$s\"."
+ ::msgcat::mcset ru "Log Files" "\u0424\u0430\u0439\u043b\u044b \u0436\u0443\u0440\u043d\u0430\u043b\u0430"
+ ::msgcat::mcset ru "&No" "&\u041d\u0435\u0442"
+ ::msgcat::mcset ru "&OK" "&\u041e\u041a"
+ ::msgcat::mcset ru "Ok" "\u0414\u0430"
+ ::msgcat::mcset ru "Open" "\u041e\u0442\u043a\u0440\u044b\u0442\u044c"
+ ::msgcat::mcset ru "&Open" "&\u041e\u0442\u043a\u0440\u044b\u0442\u044c"
+ ::msgcat::mcset ru "Open Multiple Files" "\u041e\u0442\u043a\u0440\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432"
+ ::msgcat::mcset ru "Paste" "\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Quit" "\u0412\u044b\u0445\u043e\u0434"
+ ::msgcat::mcset ru "&Red" " &\u041a\u0440\u0430\u0441\u043d\u044b\u0439"
+ ::msgcat::mcset ru "Replace existing file?" "\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b?"
+ ::msgcat::mcset ru "&Retry" "&\u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"
+ ::msgcat::mcset ru "&Save" "&\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"
+ ::msgcat::mcset ru "Save As" "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a"
+ ::msgcat::mcset ru "Save To Log" "\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b"
+ ::msgcat::mcset ru "Select Log File" "\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0436\u0443\u0440\u043d\u0430\u043b"
+ ::msgcat::mcset ru "Select a file to source" "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438"
+ ::msgcat::mcset ru "&Selection:" "&Selection:"
+ ::msgcat::mcset ru "Skip Messages" "\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f"
+ ::msgcat::mcset ru "Source..." "\u0418\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b..."
+ ::msgcat::mcset ru "Tcl Scripts" "\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 TCL"
+ ::msgcat::mcset ru "Tcl for Windows" "TCL \u0434\u043b\u044f Windows"
+ ::msgcat::mcset ru "Text Files" "\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0444\u0430\u0439\u043b\u044b"
+ ::msgcat::mcset ru "&Yes" "&\u0414\u0430"
+ ::msgcat::mcset ru "abort" "\u043e\u0442\u043c\u0435\u043d\u0430"
+ ::msgcat::mcset ru "blue" " \u0433\u043e\u043b\u0443\u0431\u043e\u0439"
+ ::msgcat::mcset ru "cancel" "\u043e\u0442\u043c\u0435\u043d\u0430"
+ ::msgcat::mcset ru "extension" "\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435"
+ ::msgcat::mcset ru "extensions" "\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f"
+ ::msgcat::mcset ru "green" " \u0437\u0435\u043b\u0435\u043d\u044b\u0439"
+ ::msgcat::mcset ru "ignore" "\u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c"
+ ::msgcat::mcset ru "ok" "\u043e\u043a"
+ ::msgcat::mcset ru "red" " \u043a\u0440\u0430\u0441\u043d\u044b\u0439"
+ ::msgcat::mcset ru "retry" "\u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c"
+ ::msgcat::mcset ru "yes" "\u0434\u0430"
+}
+
diff --git a/tk/library/obsolete.tcl b/tk/library/obsolete.tcl
index 78774297929..587e2dd0b71 100644
--- a/tk/library/obsolete.tcl
+++ b/tk/library/obsolete.tcl
@@ -19,4 +19,3 @@
proc tk_menuBar args {}
proc tk_bindForTraversal args {}
-
diff --git a/tk/library/optMenu.tcl b/tk/library/optMenu.tcl
index 6a84755760e..15e981852df 100644
--- a/tk/library/optMenu.tcl
+++ b/tk/library/optMenu.tcl
@@ -12,7 +12,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# tk_optionMenu --
+# ::tk_optionMenu --
# This procedure creates an option button named $w and an associated
# menu. Together they provide the functionality of Motif option menus:
# they can be used to select one of many values, and the current value
@@ -27,7 +27,7 @@
# firstValue - First of legal values for option (must be >= 1).
# args - Any number of additional values.
-proc tk_optionMenu {w varName firstValue args} {
+proc ::tk_optionMenu {w varName firstValue args} {
upvar #0 $varName var
if {![info exists var]} {
@@ -43,4 +43,3 @@ proc tk_optionMenu {w varName firstValue args} {
}
return $w.menu
}
-
diff --git a/tk/library/palette.tcl b/tk/library/palette.tcl
index 3f90d830eba..443c7da7139 100644
--- a/tk/library/palette.tcl
+++ b/tk/library/palette.tcl
@@ -11,7 +11,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# tk_setPalette --
+# ::tk_setPalette --
# Changes the default color scheme for a Tk application by setting
# default colors in the option database and by modifying all of the
# color options for existing widgets that have the default value.
@@ -23,14 +23,12 @@
# option names and values. The name for an option is the one used
# for the option database, such as activeForeground, not -activeforeground.
-proc tk_setPalette {args} {
+proc ::tk_setPalette {args} {
if {[winfo depth .] == 1} {
# Just return on monochrome displays, otherwise errors will occur
return
}
- global tkPalette
-
# Create an array that has the complete new palette. If some colors
# aren't specified, compute them from other colors that are specified.
@@ -42,10 +40,18 @@ proc tk_setPalette {args} {
if {![info exists new(background)]} {
error "must specify a background color"
}
+ set bg [winfo rgb . $new(background)]
if {![info exists new(foreground)]} {
- set new(foreground) black
+ # Note that the range of each value in the triple returned by
+ # [winfo rgb] is 0-65535, and your eyes are more sensitive to
+ # green than to red, and more to red than to blue.
+ foreach {r g b} $bg {break}
+ if {$r+1.5*$g+0.5*$b > 100000} {
+ set new(foreground) black
+ } else {
+ set new(foreground) white
+ }
}
- set bg [winfo rgb . $new(background)]
set fg [winfo rgb . $new(foreground)]
set darkerBg [format #%02x%02x%02x [expr {(9*[lindex $bg 0])/2560}] \
[expr {(9*[lindex $bg 1])/2560}] [expr {(9*[lindex $bg 2])/2560}]]
@@ -100,15 +106,18 @@ proc tk_setPalette {args} {
# defaults are currently for this platform.
toplevel .___tk_set_palette
wm withdraw .___tk_set_palette
- foreach q {button canvas checkbutton entry frame label listbox \
- menubutton menu message radiobutton scale scrollbar text} {
+ foreach q {
+ button canvas checkbutton entry frame label labelframe
+ listbox menubutton menu message radiobutton scale scrollbar
+ spinbox text
+ } {
$q .___tk_set_palette.$q
}
# Walk the widget hierarchy, recoloring all existing windows.
# The option database must be set according to what we do here,
# but it breaks things if we set things in the database while
- # we are changing colors...so, tkRecolorTree now returns the
+ # we are changing colors...so, ::tk::RecolorTree now returns the
# option database changes that need to be made, and they
# need to be evalled here to take effect.
# We have to walk the whole widget tree instead of just
@@ -117,7 +126,7 @@ proc tk_setPalette {args} {
# of widgets that we don't currently know about, so we'll
# walk the whole hierarchy just in case.
- eval [tkRecolorTree . new]
+ eval [tk::RecolorTree . new]
catch {destroy .___tk_set_palette}
@@ -128,13 +137,13 @@ proc tk_setPalette {args} {
option add *$option $new($option) widgetDefault
}
- # Save the options in the global variable tkPalette, for use the
+ # Save the options in the variable ::tk::Palette, for use the
# next time we change the options.
- array set tkPalette [array get new]
+ array set ::tk::Palette [array get new]
}
-# tkRecolorTree --
+# ::tk::RecolorTree --
# This procedure changes the colors in a window and all of its
# descendants, according to information provided by the colors
# argument. This looks at the defaults provided by the option
@@ -149,23 +158,29 @@ proc tk_setPalette {args} {
# is named after a widget configuration option, and
# each value is the value for that option.
-proc tkRecolorTree {w colors} {
- global tkPalette
+proc ::tk::RecolorTree {w colors} {
upvar $colors c
set result {}
+ set prototype .___tk_set_palette.[string tolower [winfo class $w]]
+ if {![winfo exists $prototype]} {
+ unset prototype
+ }
foreach dbOption [array names c] {
set option -[string tolower $dbOption]
+ set class [string replace $dbOption 0 0 [string toupper \
+ [string index $dbOption 0]]]
if {![catch {$w config $option} value]} {
# if the option database has a preference for this
# dbOption, then use it, otherwise use the defaults
# for the widget.
- set defaultcolor [option get $w $dbOption widgetDefault]
- if {[string match {} $defaultcolor]} {
+ set defaultcolor [option get $w $dbOption $class]
+ if {[string match {} $defaultcolor] || \
+ ([info exists prototype] && \
+ [$prototype cget $option] ne "$defaultcolor")} {
set defaultcolor [winfo rgb . [lindex $value 3]]
} else {
set defaultcolor [winfo rgb . $defaultcolor]
}
- if {[lindex $value 4] != {}} {
set chosencolor [winfo rgb . [lindex $value 4]]
if {[string match $defaultcolor $chosencolor]} {
# Change the option database so that future windows will get
@@ -174,16 +189,15 @@ proc tkRecolorTree {w colors} {
*[winfo class $w].$dbOption $c($dbOption) 60]"
$w configure $option $c($dbOption)
}
- }
}
}
foreach child [winfo children $w] {
- append result ";\n[tkRecolorTree $child c]"
+ append result ";\n[::tk::RecolorTree $child c]"
}
return $result
}
-# tkDarken --
+# ::tk::Darken --
# Given a color name, computes a new color value that darkens (or
# brightens) the given color by a given percent.
#
@@ -193,7 +207,7 @@ proc tkRecolorTree {w colors} {
# percent: 50 means darken by 50%, 110 means brighten
# by 10%.
-proc tkDarken {color percent} {
+proc ::tk::Darken {color percent} {
foreach {red green blue} [winfo rgb . $color] {
set red [expr {($red/256)*$percent/100}]
set green [expr {($green/256)*$percent/100}]
@@ -212,13 +226,13 @@ proc tkDarken {color percent} {
return [format "#%02x%02x%02x" $red $green $blue]
}
-# tk_bisque --
+# ::tk_bisque --
# Reset the Tk color palette to the old "bisque" colors.
#
# Arguments:
# None.
-proc tk_bisque {} {
+proc ::tk_bisque {} {
tk_setPalette activeBackground #e6ceb1 activeForeground black \
background #ffe4c4 disabledForeground #b0b0b0 foreground black \
highlightBackground #ffe4c4 highlightColor black \
@@ -226,4 +240,3 @@ proc tk_bisque {} {
selectBackground #e6ceb1 selectForeground black \
troughColor #cdb79e
}
-
diff --git a/tk/library/panedwindow.tcl b/tk/library/panedwindow.tcl
new file mode 100644
index 00000000000..c52bfa39910
--- /dev/null
+++ b/tk/library/panedwindow.tcl
@@ -0,0 +1,181 @@
+# panedwindow.tcl --
+#
+# This file defines the default bindings for Tk panedwindow widgets and
+# provides procedures that help in implementing those bindings.
+#
+# RCS: @(#) $Id$
+#
+
+bind Panedwindow <Button-1> { ::tk::panedwindow::MarkSash %W %x %y 1 }
+bind Panedwindow <Button-2> { ::tk::panedwindow::MarkSash %W %x %y 0 }
+
+bind Panedwindow <B1-Motion> { ::tk::panedwindow::DragSash %W %x %y 1 }
+bind Panedwindow <B2-Motion> { ::tk::panedwindow::DragSash %W %x %y 0 }
+
+bind Panedwindow <ButtonRelease-1> {::tk::panedwindow::ReleaseSash %W 1}
+bind Panedwindow <ButtonRelease-2> {::tk::panedwindow::ReleaseSash %W 0}
+
+bind Panedwindow <Motion> { ::tk::panedwindow::Motion %W %x %y }
+
+bind Panedwindow <Leave> { ::tk::panedwindow::Leave %W }
+
+# Initialize namespace
+namespace eval ::tk::panedwindow {}
+
+# ::tk::panedwindow::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} {
+ set what [$w identify $x $y]
+ if { [llength $what] == 2 } {
+ foreach {index which} $what break
+ if { !$::tk_strictMotif || [string equal $which "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}]
+ }
+ }
+}
+
+# ::tk::panedwindow::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 ::tk::panedwindow::DragSash {w x y proxy} {
+ 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)}]
+ }
+ }
+}
+
+# ::tk::panedwindow::ReleaseSash --
+#
+# Handle releasing of the sash
+#
+# Arguments:
+# w the widget
+# proxy whether this should be a proxy sash
+# Results:
+# Returns ...
+#
+proc ::tk::panedwindow::ReleaseSash {w proxy} {
+ 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)
+ }
+}
+
+# ::tk::panedwindow::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 ::tk::panedwindow::Motion {w x y} {
+ variable ::tk::Priv
+ set id [$w identify $x $y]
+ if {([llength $id] == 2) && \
+ (!$::tk_strictMotif || [string equal [lindex $id 1] "handle"])} {
+ if { ![info exists Priv(panecursor)] } {
+ set Priv(panecursor) [$w cget -cursor]
+ if { [string equal [$w cget -sashcursor] ""] } {
+ if { [string equal [$w cget -orient] "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(pwAfterId)]} {
+ after cancel $Priv(pwAfterId)
+ }
+ set Priv(pwAfterId) [after 150 \
+ [list ::tk::panedwindow::Cursor $w]]
+ }
+ return
+ }
+ if { [info exists Priv(panecursor)] } {
+ $w configure -cursor $Priv(panecursor)
+ unset Priv(panecursor)
+ }
+}
+
+# ::tk::panedwindow::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 ::tk::panedwindow::Cursor {w} {
+ variable ::tk::Priv
+ if {[info exists Priv(panecursor)]} {
+ if {[winfo containing [winfo pointerx $w] [winfo pointery $w]] == $w} {
+ set Priv(pwAfterId) [after 150 [list ::tk::panedwindow::Cursor $w]]
+ } else {
+ $w configure -cursor $Priv(panecursor)
+ unset Priv(panecursor)
+ if {[info exists Priv(pwAfterId)]} {
+ after cancel $Priv(pwAfterId)
+ unset Priv(pwAfterId)
+ }
+ }
+ }
+}
+
+# ::tk::panedwindow::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(panecursor)]} {
+ $w configure -cursor $::tk::Priv(panecursor)
+ unset ::tk::Priv(panecursor)
+ }
+}
diff --git a/tk/library/safetk.tcl b/tk/library/safetk.tcl
index e8ca616eed4..8c0a12bea10 100644
--- a/tk/library/safetk.tcl
+++ b/tk/library/safetk.tcl
@@ -40,7 +40,7 @@ namespace eval ::safe {
# We have to make sure that the tk_library variable uses a file
# pathname that works better in Tk (of the style returned by
# [file join], ie C:/path/to/tk/lib, not C:\path\to\tk\lib
- set tk_library [eval [list file join] [file split $tk_library]]
+ set tk_library [file join $tk_library]
# Clear Tk's access for that interp (path).
allowTk $slave $argv
@@ -275,5 +275,3 @@ proc ::safe::tkTopLevel {slave display} {
}
}
-
-
diff --git a/tk/library/scale.tcl b/tk/library/scale.tcl
index 54199d4bc06..e9ab3e88a03 100644
--- a/tk/library/scale.tcl
+++ b/tk/library/scale.tcl
@@ -20,74 +20,82 @@
bind Scale <Enter> {
if {$tk_strictMotif} {
- set tkPriv(activeBg) [%W cget -activebackground]
+ set tk::Priv(activeBg) [%W cget -activebackground]
%W config -activebackground [%W cget -background]
}
- tkScaleActivate %W %x %y
+ tk::ScaleActivate %W %x %y
}
bind Scale <Motion> {
- tkScaleActivate %W %x %y
+ tk::ScaleActivate %W %x %y
}
bind Scale <Leave> {
if {$tk_strictMotif} {
- %W config -activebackground $tkPriv(activeBg)
+ %W config -activebackground $tk::Priv(activeBg)
}
if {[string equal [%W cget -state] "active"]} {
%W configure -state normal
}
}
bind Scale <1> {
- tkScaleButtonDown %W %x %y
+ tk::ScaleButtonDown %W %x %y
}
bind Scale <B1-Motion> {
- tkScaleDrag %W %x %y
+ tk::ScaleDrag %W %x %y
}
bind Scale <B1-Leave> { }
bind Scale <B1-Enter> { }
bind Scale <ButtonRelease-1> {
- tkCancelRepeat
- tkScaleEndDrag %W
- tkScaleActivate %W %x %y
+ tk::CancelRepeat
+ tk::ScaleEndDrag %W
+ tk::ScaleActivate %W %x %y
}
bind Scale <2> {
- tkScaleButton2Down %W %x %y
+ tk::ScaleButton2Down %W %x %y
}
bind Scale <B2-Motion> {
- tkScaleDrag %W %x %y
+ tk::ScaleDrag %W %x %y
}
bind Scale <B2-Leave> { }
bind Scale <B2-Enter> { }
bind Scale <ButtonRelease-2> {
- tkCancelRepeat
- tkScaleEndDrag %W
- tkScaleActivate %W %x %y
+ tk::CancelRepeat
+ tk::ScaleEndDrag %W
+ tk::ScaleActivate %W %x %y
+}
+if {[string equal $tcl_platform(platform) "windows"]} {
+ # On Windows do the same with button 3, as that is the right mouse button
+ bind Scale <3> [bind Scale <2>]
+ bind Scale <B3-Motion> [bind Scale <B2-Motion>]
+ bind Scale <B3-Leave> [bind Scale <B2-Leave>]
+ bind Scale <B3-Enter> [bind Scale <B2-Enter>]
+ bind Scale <ButtonRelease-3> [bind Scale <ButtonRelease-2>]
}
bind Scale <Control-1> {
- tkScaleControlPress %W %x %y
+ tk::ScaleControlPress %W %x %y
}
bind Scale <Up> {
- tkScaleIncrement %W up little noRepeat
+ tk::ScaleIncrement %W up little noRepeat
}
bind Scale <Down> {
- tkScaleIncrement %W down little noRepeat
+ tk::ScaleIncrement %W down little noRepeat
}
bind Scale <Left> {
- tkScaleIncrement %W up little noRepeat
+ tk::ScaleIncrement %W up little noRepeat
}
bind Scale <Right> {
- tkScaleIncrement %W down little noRepeat
+ tk::ScaleIncrement %W down little noRepeat
}
bind Scale <Control-Up> {
- tkScaleIncrement %W up big noRepeat
+ tk::ScaleIncrement %W up big noRepeat
}
bind Scale <Control-Down> {
- tkScaleIncrement %W down big noRepeat
+ tk::ScaleIncrement %W down big noRepeat
}
bind Scale <Control-Left> {
- tkScaleIncrement %W up big noRepeat
+ tk::ScaleIncrement %W up big noRepeat
}
bind Scale <Control-Right> {
- tkScaleIncrement %W down big noRepeat
+ tk::ScaleIncrement %W down big noRepeat
}
bind Scale <Home> {
%W set [%W cget -from]
@@ -96,7 +104,7 @@ bind Scale <End> {
%W set [%W cget -to]
}
-# tkScaleActivate --
+# ::tk::ScaleActivate --
# This procedure is invoked to check a given x-y position in the
# scale and activate the slider if the x-y position falls within
# the slider.
@@ -105,7 +113,7 @@ bind Scale <End> {
# w - The scale widget.
# x, y - Mouse coordinates.
-proc tkScaleActivate {w x y} {
+proc ::tk::ScaleActivate {w x y} {
if {[string equal [$w cget -state] "disabled"]} {
return
}
@@ -119,7 +127,7 @@ proc tkScaleActivate {w x y} {
}
}
-# tkScaleButtonDown --
+# ::tk::ScaleButtonDown --
# This procedure is invoked when a button is pressed in a scale. It
# takes different actions depending on where the button was pressed.
#
@@ -127,25 +135,25 @@ proc tkScaleActivate {w x y} {
# w - The scale widget.
# x, y - Mouse coordinates of button press.
-proc tkScaleButtonDown {w x y} {
- global tkPriv
- set tkPriv(dragging) 0
+proc ::tk::ScaleButtonDown {w x y} {
+ variable ::tk::Priv
+ set Priv(dragging) 0
set el [$w identify $x $y]
if {[string equal $el "trough1"]} {
- tkScaleIncrement $w up little initial
+ ScaleIncrement $w up little initial
} elseif {[string equal $el "trough2"]} {
- tkScaleIncrement $w down little initial
+ ScaleIncrement $w down little initial
} elseif {[string equal $el "slider"]} {
- set tkPriv(dragging) 1
- set tkPriv(initValue) [$w get]
+ set Priv(dragging) 1
+ set Priv(initValue) [$w get]
set coords [$w coords]
- set tkPriv(deltaX) [expr {$x - [lindex $coords 0]}]
- set tkPriv(deltaY) [expr {$y - [lindex $coords 1]}]
+ set Priv(deltaX) [expr {$x - [lindex $coords 0]}]
+ set Priv(deltaY) [expr {$y - [lindex $coords 1]}]
$w configure -sliderrelief sunken
}
}
-# tkScaleDrag --
+# ::tk::ScaleDrag --
# This procedure is called when the mouse is dragged with
# mouse button 1 down. If the drag started inside the slider
# (i.e. the scale is active) then the scale's value is adjusted
@@ -155,28 +163,28 @@ proc tkScaleButtonDown {w x y} {
# w - The scale widget.
# x, y - Mouse coordinates.
-proc tkScaleDrag {w x y} {
- global tkPriv
- if {!$tkPriv(dragging)} {
+proc ::tk::ScaleDrag {w x y} {
+ variable ::tk::Priv
+ if {!$Priv(dragging)} {
return
}
- $w set [$w get [expr {$x-$tkPriv(deltaX)}] [expr {$y-$tkPriv(deltaY)}]]
+ $w set [$w get [expr {$x-$Priv(deltaX)}] [expr {$y-$Priv(deltaY)}]]
}
-# tkScaleEndDrag --
+# ::tk::ScaleEndDrag --
# This procedure is called to end an interactive drag of the
# slider. It just marks the drag as over.
#
# Arguments:
# w - The scale widget.
-proc tkScaleEndDrag {w} {
- global tkPriv
- set tkPriv(dragging) 0
+proc ::tk::ScaleEndDrag {w} {
+ variable ::tk::Priv
+ set Priv(dragging) 0
$w configure -sliderrelief raised
}
-# tkScaleIncrement --
+# ::tk::ScaleIncrement --
# This procedure is invoked to increment the value of a scale and
# to set up auto-repeating of the action if that is desired. The
# way the value is incremented depends on the "dir" and "big"
@@ -192,8 +200,8 @@ proc tkScaleEndDrag {w} {
# first action in an auto-repeat sequence, and "again"
# means this is the second repetition or later.
-proc tkScaleIncrement {w dir big repeat} {
- global tkPriv
+proc ::tk::ScaleIncrement {w dir big repeat} {
+ variable ::tk::Priv
if {![winfo exists $w]} return
if {[string equal $big "big"]} {
set inc [$w cget -bigincrement]
@@ -212,18 +220,18 @@ proc tkScaleIncrement {w dir big repeat} {
$w set [expr {[$w get] + $inc}]
if {[string equal $repeat "again"]} {
- set tkPriv(afterId) [after [$w cget -repeatinterval] \
- [list tkScaleIncrement $w $dir $big again]]
+ set Priv(afterId) [after [$w cget -repeatinterval] \
+ [list tk::ScaleIncrement $w $dir $big again]]
} elseif {[string equal $repeat "initial"]} {
set delay [$w cget -repeatdelay]
if {$delay > 0} {
- set tkPriv(afterId) [after $delay \
- [list tkScaleIncrement $w $dir $big again]]
+ set Priv(afterId) [after $delay \
+ [list tk::ScaleIncrement $w $dir $big again]]
}
}
}
-# tkScaleControlPress --
+# ::tk::ScaleControlPress --
# This procedure handles button presses that are made with the Control
# key down. Depending on the mouse position, it adjusts the scale
# value to one end of the range or the other.
@@ -232,7 +240,7 @@ proc tkScaleIncrement {w dir big repeat} {
# w - The scale widget.
# x, y - Mouse coordinates where the button was pressed.
-proc tkScaleControlPress {w x y} {
+proc ::tk::ScaleControlPress {w x y} {
set el [$w identify $x $y]
if {[string equal $el "trough1"]} {
$w set [$w cget -from]
@@ -241,7 +249,7 @@ proc tkScaleControlPress {w x y} {
}
}
-# tkScaleButton2Down
+# ::tk::ScaleButton2Down
# This procedure is invoked when button 2 is pressed over a scale.
# It sets the value to correspond to the mouse position and starts
# a slider drag.
@@ -250,19 +258,17 @@ proc tkScaleControlPress {w x y} {
# w - The scrollbar widget.
# x, y - Mouse coordinates within the widget.
-proc tkScaleButton2Down {w x y} {
- global tkPriv
+proc ::tk::ScaleButton2Down {w x y} {
+ variable ::tk::Priv
if {[string equal [$w cget -state] "disabled"]} {
return
}
$w configure -state active
$w set [$w get $x $y]
- set tkPriv(dragging) 1
- set tkPriv(initValue) [$w get]
+ set Priv(dragging) 1
+ set Priv(initValue) [$w get]
set coords "$x $y"
- set tkPriv(deltaX) 0
- set tkPriv(deltaY) 0
+ set Priv(deltaX) 0
+ set Priv(deltaY) 0
}
-
-
diff --git a/tk/library/scrlbar.tcl b/tk/library/scrlbar.tcl
index 2659d820c0a..8f241954dd4 100644
--- a/tk/library/scrlbar.tcl
+++ b/tk/library/scrlbar.tcl
@@ -17,12 +17,11 @@
#-------------------------------------------------------------------------
# Standard Motif bindings:
-if {[string compare $tcl_platform(platform) "windows"] && \
- [string compare $tcl_platform(platform) "macintosh"]} {
+if {[string equal [tk windowingsystem] "x11"]} {
bind Scrollbar <Enter> {
if {$tk_strictMotif} {
- set tkPriv(activeBg) [%W cget -activebackground]
+ set tk::Priv(activeBg) [%W cget -activebackground]
%W config -activebackground [%W cget -background]
}
%W activate [%W identify %x %y]
@@ -37,22 +36,22 @@ bind Scrollbar <Motion> {
# unknown reasons.
bind Scrollbar <Leave> {
- if {$tk_strictMotif && [info exists tkPriv(activeBg)]} {
- %W config -activebackground $tkPriv(activeBg)
+ if {$tk_strictMotif && [info exists tk::Priv(activeBg)]} {
+ %W config -activebackground $tk::Priv(activeBg)
}
%W activate {}
}
bind Scrollbar <1> {
- tkScrollButtonDown %W %x %y
+ tk::ScrollButtonDown %W %x %y
}
bind Scrollbar <B1-Motion> {
- tkScrollDrag %W %x %y
+ tk::ScrollDrag %W %x %y
}
bind Scrollbar <B1-B2-Motion> {
- tkScrollDrag %W %x %y
+ tk::ScrollDrag %W %x %y
}
bind Scrollbar <ButtonRelease-1> {
- tkScrollButtonUp %W %x %y
+ tk::ScrollButtonUp %W %x %y
}
bind Scrollbar <B1-Leave> {
# Prevents <Leave> binding from being invoked.
@@ -61,7 +60,7 @@ bind Scrollbar <B1-Enter> {
# Prevents <Enter> binding from being invoked.
}
bind Scrollbar <2> {
- tkScrollButton2Down %W %x %y
+ tk::ScrollButton2Down %W %x %y
}
bind Scrollbar <B1-2> {
# Do nothing, since button 1 is already down.
@@ -70,10 +69,10 @@ bind Scrollbar <B2-1> {
# Do nothing, since button 2 is already down.
}
bind Scrollbar <B2-Motion> {
- tkScrollDrag %W %x %y
+ tk::ScrollDrag %W %x %y
}
bind Scrollbar <ButtonRelease-2> {
- tkScrollButtonUp %W %x %y
+ tk::ScrollButtonUp %W %x %y
}
bind Scrollbar <B1-ButtonRelease-2> {
# Do nothing: B1 release will handle it.
@@ -88,50 +87,50 @@ bind Scrollbar <B2-Enter> {
# Prevents <Enter> binding from being invoked.
}
bind Scrollbar <Control-1> {
- tkScrollTopBottom %W %x %y
+ tk::ScrollTopBottom %W %x %y
}
bind Scrollbar <Control-2> {
- tkScrollTopBottom %W %x %y
+ tk::ScrollTopBottom %W %x %y
}
bind Scrollbar <Up> {
- tkScrollByUnits %W v -1
+ tk::ScrollByUnits %W v -1
}
bind Scrollbar <Down> {
- tkScrollByUnits %W v 1
+ tk::ScrollByUnits %W v 1
}
bind Scrollbar <Control-Up> {
- tkScrollByPages %W v -1
+ tk::ScrollByPages %W v -1
}
bind Scrollbar <Control-Down> {
- tkScrollByPages %W v 1
+ tk::ScrollByPages %W v 1
}
bind Scrollbar <Left> {
- tkScrollByUnits %W h -1
+ tk::ScrollByUnits %W h -1
}
bind Scrollbar <Right> {
- tkScrollByUnits %W h 1
+ tk::ScrollByUnits %W h 1
}
bind Scrollbar <Control-Left> {
- tkScrollByPages %W h -1
+ tk::ScrollByPages %W h -1
}
bind Scrollbar <Control-Right> {
- tkScrollByPages %W h 1
+ tk::ScrollByPages %W h 1
}
bind Scrollbar <Prior> {
- tkScrollByPages %W hv -1
+ tk::ScrollByPages %W hv -1
}
bind Scrollbar <Next> {
- tkScrollByPages %W hv 1
+ tk::ScrollByPages %W hv 1
}
bind Scrollbar <Home> {
- tkScrollToPos %W 0
+ tk::ScrollToPos %W 0
}
bind Scrollbar <End> {
- tkScrollToPos %W 1
+ tk::ScrollToPos %W 1
}
}
-# tkScrollButtonDown --
+# tk::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.
@@ -140,19 +139,19 @@ bind Scrollbar <End> {
# w - The scrollbar widget.
# x, y - Mouse coordinates.
-proc tkScrollButtonDown {w x y} {
- global tkPriv
- set tkPriv(relief) [$w cget -activerelief]
+proc tk::ScrollButtonDown {w x y} {
+ variable ::tk::Priv
+ set Priv(relief) [$w cget -activerelief]
$w configure -activerelief sunken
set element [$w identify $x $y]
if {[string equal $element "slider"]} {
- tkScrollStartDrag $w $x $y
+ ScrollStartDrag $w $x $y
} else {
- tkScrollSelect $w $element initial
+ ScrollSelect $w $element initial
}
}
-# tkScrollButtonUp --
+# ::tk::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.
@@ -161,18 +160,18 @@ proc tkScrollButtonDown {w x y} {
# w - The scrollbar widget.
# x, y - Mouse coordinates.
-proc tkScrollButtonUp {w x y} {
- global tkPriv
- tkCancelRepeat
- if {[info exists tkPriv(relief)]} {
+proc ::tk::ScrollButtonUp {w x y} {
+ variable ::tk::Priv
+ tk::CancelRepeat
+ if {[info exists Priv(relief)]} {
# Avoid error due to spurious release events
- $w configure -activerelief $tkPriv(relief)
- tkScrollEndDrag $w $x $y
+ $w configure -activerelief $Priv(relief)
+ ScrollEndDrag $w $x $y
$w activate [$w identify $x $y]
}
}
-# tkScrollSelect --
+# ::tk::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.
@@ -186,29 +185,29 @@ proc tkScrollButtonUp {w x y} {
# first action in an auto-repeat sequence, and "again"
# means this is the second repetition or later.
-proc tkScrollSelect {w element repeat} {
- global tkPriv
+proc ::tk::ScrollSelect {w element repeat} {
+ variable ::tk::Priv
if {![winfo exists $w]} return
switch -- $element {
- "arrow1" {tkScrollByUnits $w hv -1}
- "trough1" {tkScrollByPages $w hv -1}
- "trough2" {tkScrollByPages $w hv 1}
- "arrow2" {tkScrollByUnits $w hv 1}
+ "arrow1" {ScrollByUnits $w hv -1}
+ "trough1" {ScrollByPages $w hv -1}
+ "trough2" {ScrollByPages $w hv 1}
+ "arrow2" {ScrollByUnits $w hv 1}
default {return}
}
if {[string equal $repeat "again"]} {
- set tkPriv(afterId) [after [$w cget -repeatinterval] \
- [list tkScrollSelect $w $element again]]
+ set Priv(afterId) [after [$w cget -repeatinterval] \
+ [list tk::ScrollSelect $w $element again]]
} elseif {[string equal $repeat "initial"]} {
set delay [$w cget -repeatdelay]
if {$delay > 0} {
- set tkPriv(afterId) [after $delay \
- [list tkScrollSelect $w $element again]]
+ set Priv(afterId) [after $delay \
+ [list tk::ScrollSelect $w $element again]]
}
}
}
-# tkScrollStartDrag --
+# ::tk::ScrollStartDrag --
# This procedure is called to initiate a drag of the slider. It just
# remembers the starting position of the mouse and slider.
#
@@ -216,27 +215,27 @@ proc tkScrollSelect {w element repeat} {
# w - The scrollbar widget.
# x, y - The mouse position at the start of the drag operation.
-proc tkScrollStartDrag {w x y} {
- global tkPriv
+proc ::tk::ScrollStartDrag {w x y} {
+ variable ::tk::Priv
if {[string equal [$w cget -command] ""]} {
return
}
- set tkPriv(pressX) $x
- set tkPriv(pressY) $y
- set tkPriv(initValues) [$w get]
- set iv0 [lindex $tkPriv(initValues) 0]
- if {[llength $tkPriv(initValues)] == 2} {
- set tkPriv(initPos) $iv0
+ set Priv(pressX) $x
+ set Priv(pressY) $y
+ set Priv(initValues) [$w get]
+ set iv0 [lindex $Priv(initValues) 0]
+ if {[llength $Priv(initValues)] == 2} {
+ set Priv(initPos) $iv0
} elseif {$iv0 == 0} {
- set tkPriv(initPos) 0.0
+ set Priv(initPos) 0.0
} else {
- set tkPriv(initPos) [expr {(double([lindex $tkPriv(initValues) 2])) \
- / [lindex $tkPriv(initValues) 0]}]
+ set Priv(initPos) [expr {(double([lindex $Priv(initValues) 2])) \
+ / [lindex $Priv(initValues) 0]}]
}
}
-# tkScrollDrag --
+# ::tk::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
@@ -246,29 +245,29 @@ proc tkScrollStartDrag {w x y} {
# w - The scrollbar widget.
# x, y - The current mouse position.
-proc tkScrollDrag {w x y} {
- global tkPriv
+proc ::tk::ScrollDrag {w x y} {
+ variable ::tk::Priv
- if {[string equal $tkPriv(initPos) ""]} {
+ if {[string equal $Priv(initPos) ""]} {
return
}
- set delta [$w delta [expr {$x - $tkPriv(pressX)}] [expr {$y - $tkPriv(pressY)}]]
+ set delta [$w delta [expr {$x - $Priv(pressX)}] [expr {$y - $Priv(pressY)}]]
if {[$w cget -jump]} {
- if {[llength $tkPriv(initValues)] == 2} {
- $w set [expr {[lindex $tkPriv(initValues) 0] + $delta}] \
- [expr {[lindex $tkPriv(initValues) 1] + $delta}]
+ if {[llength $Priv(initValues)] == 2} {
+ $w set [expr {[lindex $Priv(initValues) 0] + $delta}] \
+ [expr {[lindex $Priv(initValues) 1] + $delta}]
} else {
- set delta [expr {round($delta * [lindex $tkPriv(initValues) 0])}]
- eval [list $w] set [lreplace $tkPriv(initValues) 2 3 \
- [expr {[lindex $tkPriv(initValues) 2] + $delta}] \
- [expr {[lindex $tkPriv(initValues) 3] + $delta}]]
+ set delta [expr {round($delta * [lindex $Priv(initValues) 0])}]
+ eval [list $w] set [lreplace $Priv(initValues) 2 3 \
+ [expr {[lindex $Priv(initValues) 2] + $delta}] \
+ [expr {[lindex $Priv(initValues) 3] + $delta}]]
}
} else {
- tkScrollToPos $w [expr {$tkPriv(initPos) + $delta}]
+ ScrollToPos $w [expr {$Priv(initPos) + $delta}]
}
}
-# tkScrollEndDrag --
+# ::tk::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.
#
@@ -276,21 +275,21 @@ proc tkScrollDrag {w x y} {
# w - The scrollbar widget.
# x, y - The mouse position at the end of the drag operation.
-proc tkScrollEndDrag {w x y} {
- global tkPriv
+proc ::tk::ScrollEndDrag {w x y} {
+ variable ::tk::Priv
- if {[string equal $tkPriv(initPos) ""]} {
+ if {[string equal $Priv(initPos) ""]} {
return
}
if {[$w cget -jump]} {
- set delta [$w delta [expr {$x - $tkPriv(pressX)}] \
- [expr {$y - $tkPriv(pressY)}]]
- tkScrollToPos $w [expr {$tkPriv(initPos) + $delta}]
+ set delta [$w delta [expr {$x - $Priv(pressX)}] \
+ [expr {$y - $Priv(pressY)}]]
+ ScrollToPos $w [expr {$Priv(initPos) + $delta}]
}
- set tkPriv(initPos) ""
+ set Priv(initPos) ""
}
-# tkScrollByUnits --
+# ::tk::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.
@@ -301,7 +300,7 @@ proc tkScrollEndDrag {w x y} {
# horizontal, "v" for vertical, "hv" for both.
# amount - How many units to scroll: typically 1 or -1.
-proc tkScrollByUnits {w orient amount} {
+proc ::tk::ScrollByUnits {w orient amount} {
set cmd [$w cget -command]
if {[string equal $cmd ""] || ([string first \
[string index [$w cget -orient] 0] $orient] < 0)} {
@@ -315,7 +314,7 @@ proc tkScrollByUnits {w orient amount} {
}
}
-# tkScrollByPages --
+# ::tk::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.
@@ -326,7 +325,7 @@ proc tkScrollByUnits {w orient amount} {
# horizontal, "v" for vertical, "hv" for both.
# amount - How many screens to scroll: typically 1 or -1.
-proc tkScrollByPages {w orient amount} {
+proc ::tk::ScrollByPages {w orient amount} {
set cmd [$w cget -command]
if {[string equal $cmd ""] || ([string first \
[string index [$w cget -orient] 0] $orient] < 0)} {
@@ -340,7 +339,7 @@ proc tkScrollByPages {w orient amount} {
}
}
-# tkScrollToPos --
+# ::tk::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.
@@ -350,7 +349,7 @@ proc tkScrollByPages {w orient amount} {
# pos - A fraction between 0 and 1 indicating a desired position
# in the document.
-proc tkScrollToPos {w pos} {
+proc ::tk::ScrollToPos {w pos} {
set cmd [$w cget -command]
if {[string equal $cmd ""]} {
return
@@ -363,7 +362,7 @@ proc tkScrollToPos {w pos} {
}
}
-# tkScrollTopBottom
+# ::tk::ScrollTopBottom
# Scroll to the top or bottom of the document, depending on the mouse
# position.
#
@@ -371,21 +370,21 @@ proc tkScrollToPos {w pos} {
# w - The scrollbar widget.
# x, y - Mouse coordinates within the widget.
-proc tkScrollTopBottom {w x y} {
- global tkPriv
+proc ::tk::ScrollTopBottom {w x y} {
+ variable ::tk::Priv
set element [$w identify $x $y]
if {[string match *1 $element]} {
- tkScrollToPos $w 0
+ ScrollToPos $w 0
} elseif {[string match *2 $element]} {
- tkScrollToPos $w 1
+ ScrollToPos $w 1
}
- # Set tkPriv(relief), since it's needed by tkScrollButtonUp.
+ # Set Priv(relief), since it's needed by tk::ScrollButtonUp.
- set tkPriv(relief) [$w cget -activerelief]
+ set Priv(relief) [$w cget -activerelief]
}
-# tkScrollButton2Down
+# ::tk::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
@@ -395,15 +394,15 @@ proc tkScrollTopBottom {w x y} {
# w - The scrollbar widget.
# x, y - Mouse coordinates within the widget.
-proc tkScrollButton2Down {w x y} {
- global tkPriv
+proc ::tk::ScrollButton2Down {w x y} {
+ variable ::tk::Priv
set element [$w identify $x $y]
if {[string match {arrow[12]} $element]} {
- tkScrollButtonDown $w $x $y
+ ScrollButtonDown $w $x $y
return
}
- tkScrollToPos $w [$w fraction $x $y]
- set tkPriv(relief) [$w cget -activerelief]
+ ScrollToPos $w [$w fraction $x $y]
+ set Priv(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
@@ -412,6 +411,5 @@ proc tkScrollButton2Down {w x y} {
update idletasks
$w configure -activerelief sunken
$w activate slider
- tkScrollStartDrag $w $x $y
+ ScrollStartDrag $w $x $y
}
-
diff --git a/tk/library/spinbox.tcl b/tk/library/spinbox.tcl
new file mode 100644
index 00000000000..449d45d859b
--- /dev/null
+++ b/tk/library/spinbox.tcl
@@ -0,0 +1,568 @@
+# spinbox.tcl --
+#
+# This file defines the default bindings for Tk spinbox widgets and provides
+# procedures that help in implementing those bindings. The spinbox builds
+# off the entry widget, so it can reuse Entry bindings and procedures.
+#
+# RCS: @(#) $Id$
+#
+# Copyright (c) 1992-1994 The Regents of the University of California.
+# Copyright (c) 1994-1997 Sun Microsystems, Inc.
+# Copyright (c) 1999-2000 Jeffrey Hobbs
+# Copyright (c) 2000 Ajuba Solutions
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+
+#-------------------------------------------------------------------------
+# Elements of tk::Priv that are used in this file:
+#
+# afterId - If non-null, it means that auto-scanning is underway
+# and it gives the "after" id for the next auto-scan
+# command to be executed.
+# mouseMoved - Non-zero means the mouse has moved a significant
+# amount since the button went down (so, for example,
+# start dragging out a selection).
+# pressX - X-coordinate at which the mouse button was pressed.
+# selectMode - The style of selection currently underway:
+# char, word, or line.
+# x, y - Last known mouse coordinates for scanning
+# and auto-scanning.
+# data - Used for Cut and Copy
+#-------------------------------------------------------------------------
+
+# Initialize namespace
+namespace eval ::tk::spinbox {}
+
+#-------------------------------------------------------------------------
+# The code below creates the default class bindings for entries.
+#-------------------------------------------------------------------------
+bind Spinbox <<Cut>> {
+ if {![catch {::tk::spinbox::GetSelection %W} tk::Priv(data)]} {
+ clipboard clear -displayof %W
+ clipboard append -displayof %W $tk::Priv(data)
+ %W delete sel.first sel.last
+ unset tk::Priv(data)
+ }
+}
+bind Spinbox <<Copy>> {
+ if {![catch {::tk::spinbox::GetSelection %W} tk::Priv(data)]} {
+ clipboard clear -displayof %W
+ clipboard append -displayof %W $tk::Priv(data)
+ unset tk::Priv(data)
+ }
+}
+bind Spinbox <<Paste>> {
+ global tcl_platform
+ catch {
+ if {[tk windowingsystem] ne "x11"} {
+ catch {
+ %W delete sel.first sel.last
+ }
+ }
+ %W insert insert [::tk::GetSelection %W CLIPBOARD]
+ ::tk::EntrySeeInsert %W
+ }
+}
+bind Spinbox <<Clear>> {
+ %W delete sel.first sel.last
+}
+bind Spinbox <<PasteSelection>> {
+ if {$tk_strictMotif || ![info exists tk::Priv(mouseMoved)]
+ || !$tk::Priv(mouseMoved)} {
+ ::tk::spinbox::Paste %W %x
+ }
+}
+
+# Standard Motif bindings:
+
+bind Spinbox <1> {
+ ::tk::spinbox::ButtonDown %W %x %y
+}
+bind Spinbox <B1-Motion> {
+ ::tk::spinbox::Motion %W %x %y
+}
+bind Spinbox <Double-1> {
+ set tk::Priv(selectMode) word
+ ::tk::spinbox::MouseSelect %W %x sel.first
+}
+bind Spinbox <Triple-1> {
+ set tk::Priv(selectMode) line
+ ::tk::spinbox::MouseSelect %W %x 0
+}
+bind Spinbox <Shift-1> {
+ set tk::Priv(selectMode) char
+ %W selection adjust @%x
+}
+bind Spinbox <Double-Shift-1> {
+ set tk::Priv(selectMode) word
+ ::tk::spinbox::MouseSelect %W %x
+}
+bind Spinbox <Triple-Shift-1> {
+ set tk::Priv(selectMode) line
+ ::tk::spinbox::MouseSelect %W %x
+}
+bind Spinbox <B1-Leave> {
+ set tk::Priv(x) %x
+ ::tk::spinbox::AutoScan %W
+}
+bind Spinbox <B1-Enter> {
+ tk::CancelRepeat
+}
+bind Spinbox <ButtonRelease-1> {
+ ::tk::spinbox::ButtonUp %W %x %y
+}
+bind Spinbox <Control-1> {
+ %W icursor @%x
+}
+
+bind Spinbox <Up> {
+ %W invoke buttonup
+}
+bind Spinbox <Down> {
+ %W invoke buttondown
+}
+
+bind Spinbox <Left> {
+ ::tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
+}
+bind Spinbox <Right> {
+ ::tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
+}
+bind Spinbox <Shift-Left> {
+ ::tk::EntryKeySelect %W [expr {[%W index insert] - 1}]
+ ::tk::EntrySeeInsert %W
+}
+bind Spinbox <Shift-Right> {
+ ::tk::EntryKeySelect %W [expr {[%W index insert] + 1}]
+ ::tk::EntrySeeInsert %W
+}
+bind Spinbox <Control-Left> {
+ ::tk::EntrySetCursor %W [::tk::EntryPreviousWord %W insert]
+}
+bind Spinbox <Control-Right> {
+ ::tk::EntrySetCursor %W [::tk::EntryNextWord %W insert]
+}
+bind Spinbox <Shift-Control-Left> {
+ ::tk::EntryKeySelect %W [::tk::EntryPreviousWord %W insert]
+ ::tk::EntrySeeInsert %W
+}
+bind Spinbox <Shift-Control-Right> {
+ ::tk::EntryKeySelect %W [::tk::EntryNextWord %W insert]
+ ::tk::EntrySeeInsert %W
+}
+bind Spinbox <Home> {
+ ::tk::EntrySetCursor %W 0
+}
+bind Spinbox <Shift-Home> {
+ ::tk::EntryKeySelect %W 0
+ ::tk::EntrySeeInsert %W
+}
+bind Spinbox <End> {
+ ::tk::EntrySetCursor %W end
+}
+bind Spinbox <Shift-End> {
+ ::tk::EntryKeySelect %W end
+ ::tk::EntrySeeInsert %W
+}
+
+bind Spinbox <Delete> {
+ if {[%W selection present]} {
+ %W delete sel.first sel.last
+ } else {
+ %W delete insert
+ }
+}
+bind Spinbox <BackSpace> {
+ ::tk::EntryBackspace %W
+}
+
+bind Spinbox <Control-space> {
+ %W selection from insert
+}
+bind Spinbox <Select> {
+ %W selection from insert
+}
+bind Spinbox <Control-Shift-space> {
+ %W selection adjust insert
+}
+bind Spinbox <Shift-Select> {
+ %W selection adjust insert
+}
+bind Spinbox <Control-slash> {
+ %W selection range 0 end
+}
+bind Spinbox <Control-backslash> {
+ %W selection clear
+}
+bind Spinbox <KeyPress> {
+ ::tk::EntryInsert %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 Spinbox <Alt-KeyPress> {# nothing}
+bind Spinbox <Meta-KeyPress> {# nothing}
+bind Spinbox <Control-KeyPress> {# nothing}
+bind Spinbox <Escape> {# nothing}
+bind Spinbox <Return> {# nothing}
+bind Spinbox <KP_Enter> {# nothing}
+bind Spinbox <Tab> {# nothing}
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
+ bind Spinbox <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"]} {
+ bind Spinbox <Insert> {
+ catch {::tk::EntryInsert %W [::tk::GetSelection %W PRIMARY]}
+ }
+}
+
+# Additional emacs-like bindings:
+
+bind Spinbox <Control-a> {
+ if {!$tk_strictMotif} {
+ ::tk::EntrySetCursor %W 0
+ }
+}
+bind Spinbox <Control-b> {
+ if {!$tk_strictMotif} {
+ ::tk::EntrySetCursor %W [expr {[%W index insert] - 1}]
+ }
+}
+bind Spinbox <Control-d> {
+ if {!$tk_strictMotif} {
+ %W delete insert
+ }
+}
+bind Spinbox <Control-e> {
+ if {!$tk_strictMotif} {
+ ::tk::EntrySetCursor %W end
+ }
+}
+bind Spinbox <Control-f> {
+ if {!$tk_strictMotif} {
+ ::tk::EntrySetCursor %W [expr {[%W index insert] + 1}]
+ }
+}
+bind Spinbox <Control-h> {
+ if {!$tk_strictMotif} {
+ ::tk::EntryBackspace %W
+ }
+}
+bind Spinbox <Control-k> {
+ if {!$tk_strictMotif} {
+ %W delete insert end
+ }
+}
+bind Spinbox <Control-t> {
+ if {!$tk_strictMotif} {
+ ::tk::EntryTranspose %W
+ }
+}
+bind Spinbox <Meta-b> {
+ if {!$tk_strictMotif} {
+ ::tk::EntrySetCursor %W [::tk::EntryPreviousWord %W insert]
+ }
+}
+bind Spinbox <Meta-d> {
+ if {!$tk_strictMotif} {
+ %W delete insert [::tk::EntryNextWord %W insert]
+ }
+}
+bind Spinbox <Meta-f> {
+ if {!$tk_strictMotif} {
+ ::tk::EntrySetCursor %W [::tk::EntryNextWord %W insert]
+ }
+}
+bind Spinbox <Meta-BackSpace> {
+ if {!$tk_strictMotif} {
+ %W delete [::tk::EntryPreviousWord %W insert] insert
+ }
+}
+bind Spinbox <Meta-Delete> {
+ if {!$tk_strictMotif} {
+ %W delete [::tk::EntryPreviousWord %W insert] insert
+ }
+}
+
+# A few additional bindings of my own.
+
+bind Spinbox <2> {
+ if {!$tk_strictMotif} {
+ ::tk::EntryScanMark %W %x
+ }
+}
+bind Spinbox <B2-Motion> {
+ if {!$tk_strictMotif} {
+ ::tk::EntryScanDrag %W %x
+ }
+}
+
+# ::tk::spinbox::Invoke --
+# Invoke an element of the spinbox
+#
+# Arguments:
+# w - The spinbox window.
+# elem - Element to invoke
+
+proc ::tk::spinbox::Invoke {w elem} {
+ variable ::tk::Priv
+
+ if {![info exists Priv(outsideElement)]} {
+ $w invoke $elem
+ incr Priv(repeated)
+ }
+ set delay [$w cget -repeatinterval]
+ if {$delay > 0} {
+ set Priv(afterId) [after $delay \
+ [list ::tk::spinbox::Invoke $w $elem]]
+ }
+}
+
+# ::tk::spinbox::ClosestGap --
+# Given x and y coordinates, this procedure finds the closest boundary
+# between characters to the given coordinates and returns the index
+# of the character just after the boundary.
+#
+# Arguments:
+# w - The spinbox window.
+# x - X-coordinate within the window.
+
+proc ::tk::spinbox::ClosestGap {w x} {
+ set pos [$w index @$x]
+ set bbox [$w bbox $pos]
+ if {($x - [lindex $bbox 0]) < ([lindex $bbox 2]/2)} {
+ return $pos
+ }
+ incr pos
+}
+
+# ::tk::spinbox::ButtonDown --
+# This procedure is invoked to handle button-1 presses in spinbox
+# widgets. It moves the insertion cursor, sets the selection anchor,
+# and claims the input focus.
+#
+# Arguments:
+# w - The spinbox window in which the button was pressed.
+# x - The x-coordinate of the button press.
+
+proc ::tk::spinbox::ButtonDown {w x y} {
+ variable ::tk::Priv
+
+ # Get the element that was clicked in. If we are not directly over
+ # the spinbox, default to entry. This is necessary for spinbox grabs.
+ #
+ set Priv(element) [$w identify $x $y]
+ if {$Priv(element) eq ""} {
+ set Priv(element) "entry"
+ }
+
+ switch -exact $Priv(element) {
+ "buttonup" - "buttondown" {
+ if {"disabled" ne [$w cget -state]} {
+ $w selection element $Priv(element)
+ set Priv(repeated) 0
+ set Priv(relief) [$w cget -$Priv(element)relief]
+ catch {after cancel $Priv(afterId)}
+ set delay [$w cget -repeatdelay]
+ if {$delay > 0} {
+ set Priv(afterId) [after $delay \
+ [list ::tk::spinbox::Invoke $w $Priv(element)]]
+ }
+ if {[info exists Priv(outsideElement)]} {
+ unset Priv(outsideElement)
+ }
+ }
+ }
+ "entry" {
+ set Priv(selectMode) char
+ set Priv(mouseMoved) 0
+ set Priv(pressX) $x
+ $w icursor [::tk::spinbox::ClosestGap $w $x]
+ $w selection from insert
+ if {"disabled" ne [$w cget -state]} {focus $w}
+ $w selection clear
+ }
+ default {
+ return -code error "unknown spinbox element \"$Priv(element)\""
+ }
+ }
+}
+
+# ::tk::spinbox::ButtonUp --
+# This procedure is invoked to handle button-1 releases in spinbox
+# widgets.
+#
+# Arguments:
+# w - The spinbox window in which the button was pressed.
+# x - The x-coordinate of the button press.
+
+proc ::tk::spinbox::ButtonUp {w x y} {
+ variable ::tk::Priv
+
+ ::tk::CancelRepeat
+
+ # Priv(relief) may not exist if the ButtonUp is not paired with
+ # a preceding ButtonDown
+ if {[info exists Priv(element)] && [info exists Priv(relief)] && \
+ [string match "button*" $Priv(element)]} {
+ if {[info exists Priv(repeated)] && !$Priv(repeated)} {
+ $w invoke $Priv(element)
+ }
+ $w configure -$Priv(element)relief $Priv(relief)
+ $w selection element none
+ }
+}
+
+# ::tk::spinbox::MouseSelect --
+# This procedure is invoked when dragging out a selection with
+# the mouse. Depending on the selection mode (character, word,
+# line) it selects in different-sized units. This procedure
+# ignores mouse motions initially until the mouse has moved from
+# one character to another or until there have been multiple clicks.
+#
+# Arguments:
+# w - The spinbox window in which the button was pressed.
+# x - The x-coordinate of the mouse.
+# cursor - optional place to set cursor.
+
+proc ::tk::spinbox::MouseSelect {w x {cursor {}}} {
+ variable ::tk::Priv
+
+ if {$Priv(element) ne "entry"} {
+ # The ButtonUp command triggered by ButtonRelease-1 handles
+ # invoking one of the spinbuttons.
+ return
+ }
+ set cur [::tk::spinbox::ClosestGap $w $x]
+ set anchor [$w index anchor]
+ if {($cur ne $anchor) || (abs($Priv(pressX) - $x) >= 3)} {
+ set Priv(mouseMoved) 1
+ }
+ switch $Priv(selectMode) {
+ char {
+ if {$Priv(mouseMoved)} {
+ if {$cur < $anchor} {
+ $w selection range $cur $anchor
+ } elseif {$cur > $anchor} {
+ $w selection range $anchor $cur
+ } else {
+ $w selection clear
+ }
+ }
+ }
+ word {
+ if {$cur < [$w index anchor]} {
+ set before [tcl_wordBreakBefore [$w get] $cur]
+ set after [tcl_wordBreakAfter [$w get] [expr {$anchor-1}]]
+ } else {
+ set before [tcl_wordBreakBefore [$w get] $anchor]
+ set after [tcl_wordBreakAfter [$w get] [expr {$cur - 1}]]
+ }
+ if {$before < 0} {
+ set before 0
+ }
+ if {$after < 0} {
+ set after end
+ }
+ $w selection range $before $after
+ }
+ line {
+ $w selection range 0 end
+ }
+ }
+ if {$cursor ne {} && $cursor ne "ignore"} {
+ catch {$w icursor $cursor}
+ }
+ update idletasks
+}
+
+# ::tk::spinbox::Paste --
+# This procedure sets the insertion cursor to the current mouse position,
+# pastes the selection there, and sets the focus to the window.
+#
+# Arguments:
+# w - The spinbox window.
+# x - X position of the mouse.
+
+proc ::tk::spinbox::Paste {w x} {
+ $w icursor [::tk::spinbox::ClosestGap $w $x]
+ catch {$w insert insert [::tk::GetSelection $w PRIMARY]}
+ if {[string equal "disabled" [$w cget -state]]} {focus $w}
+}
+
+# ::tk::spinbox::Motion --
+# This procedure is invoked when the mouse moves in a spinbox window
+# with button 1 down.
+#
+# Arguments:
+# w - The spinbox window.
+
+proc ::tk::spinbox::Motion {w x y} {
+ variable ::tk::Priv
+
+ if {![info exists Priv(element)]} {
+ set Priv(element) [$w identify $x $y]
+ }
+
+ set Priv(x) $x
+ if {"entry" eq $Priv(element)} {
+ ::tk::spinbox::MouseSelect $w $x ignore
+ } elseif {[$w identify $x $y] ne $Priv(element)} {
+ if {![info exists Priv(outsideElement)]} {
+ # We've wandered out of the spin button
+ # setting outside element will cause ::tk::spinbox::Invoke to
+ # loop without doing anything
+ set Priv(outsideElement) ""
+ $w selection element none
+ }
+ } elseif {[info exists Priv(outsideElement)]} {
+ unset Priv(outsideElement)
+ $w selection element $Priv(element)
+ }
+}
+
+# ::tk::spinbox::AutoScan --
+# This procedure is invoked when the mouse leaves an spinbox window
+# with button 1 down. It scrolls the window left or right,
+# depending on where the mouse is, and reschedules itself as an
+# "after" command so that the window continues to scroll until the
+# mouse moves back into the window or the mouse button is released.
+#
+# Arguments:
+# w - The spinbox window.
+
+proc ::tk::spinbox::AutoScan {w} {
+ variable ::tk::Priv
+
+ set x $Priv(x)
+ if {$x >= [winfo width $w]} {
+ $w xview scroll 2 units
+ ::tk::spinbox::MouseSelect $w $x ignore
+ } elseif {$x < 0} {
+ $w xview scroll -2 units
+ ::tk::spinbox::MouseSelect $w $x ignore
+ }
+ set Priv(afterId) [after 50 [list ::tk::spinbox::AutoScan $w]]
+}
+
+# ::tk::spinbox::GetSelection --
+#
+# Returns the selected text of the spinbox. Differs from entry in that
+# a spinbox has no -show option to obscure contents.
+#
+# Arguments:
+# w - The spinbox window from which the text to get
+
+proc ::tk::spinbox::GetSelection {w} {
+ return [string range [$w get] [$w index sel.first] \
+ [expr {[$w index sel.last] - 1}]]
+}
diff --git a/tk/library/tclIndex b/tk/library/tclIndex
index 659e0125e26..6b3547d579f 100644
--- a/tk/library/tclIndex
+++ b/tk/library/tclIndex
@@ -6,213 +6,239 @@
# element name is the name of a command and the value is
# a script that loads the command.
-set auto_index(tkButtonEnter) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonLeave) [list source [file join $dir button.tcl]]
-set auto_index(tkCheckRadioEnter) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonDown) [list source [file join $dir button.tcl]]
-set auto_index(tkCheckRadioDown) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonUp) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonEnter) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonLeave) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonDown) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonUp) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonEnter) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonLeave) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonDown) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonUp) [list source [file join $dir button.tcl]]
-set auto_index(tkButtonInvoke) [list source [file join $dir button.tcl]]
-set auto_index(tkCheckRadioInvoke) [list source [file join $dir button.tcl]]
+set auto_index(::tk::dialog::error::Return) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::Details) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::SaveToLog) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::Destroy) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::dialog::error::bgerror) [list source [file join $dir bgerror.tcl]]
+set auto_index(bgerror) [list source [file join $dir bgerror.tcl]]
+set auto_index(::tk::ButtonInvoke) [list source [file join $dir button.tcl]]
+set auto_index(::tk::ButtonAutoInvoke) [list source [file join $dir button.tcl]]
+set auto_index(::tk::CheckRadioInvoke) [list source [file join $dir button.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::Config) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::OkCmd) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::DblClick) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::ListBrowse) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::file::chooseDir::Done) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::dialog::color::) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::InitValues) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::Config) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::BuildDialog) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::SetRGBValue) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::XToRgb) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::RgbToX) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::DrawColorScale) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::CreateSelector) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::RedrawFinalColor) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::RedrawColorBars) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::StartMove) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::MoveSelector) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::ReleaseMouse) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::ResizeColorBars) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::HandleSelEntry) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::HandleRGBEntry) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::EnterColorBar) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::LeaveColorBar) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::OkCmd) [list source [file join $dir clrpick.tcl]]
+set auto_index(::tk::dialog::color::CancelCmd) [list source [file join $dir clrpick.tcl]]
+set auto_index(tclParseConfigSpec) [list source [file join $dir comdlg.tcl]]
+set auto_index(tclListValidFlags) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_Create) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_BindIn) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_BindOut) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_Destroy) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_In) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FocusGroup_Out) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::FDGetFileTypes) [list source [file join $dir comdlg.tcl]]
+set auto_index(::tk::ConsoleInit) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleSource) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleInvoke) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleHistory) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsolePrompt) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleBind) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleInsert) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleOutput) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleExit) [list source [file join $dir console.tcl]]
+set auto_index(::tk::ConsoleAbout) [list source [file join $dir console.tcl]]
set auto_index(tk_dialog) [list source [file join $dir dialog.tcl]]
-set auto_index(tkEntryClosestGap) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryButton1) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryMouseSelect) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryPaste) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryAutoScan) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryKeySelect) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryInsert) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryBackspace) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntrySeeInsert) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntrySetCursor) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryTranspose) [list source [file join $dir entry.tcl]]
-set auto_index(tkEntryPreviousWord) [list source [file join $dir entry.tcl]]
-set auto_index(tkListboxBeginSelect) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxMotion) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxBeginExtend) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxBeginToggle) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxAutoScan) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxUpDown) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxExtendUpDown) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxDataExtend) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxCancel) [list source [file join $dir listbox.tcl]]
-set auto_index(tkListboxSelectAll) [list source [file join $dir listbox.tcl]]
-set auto_index(tkMbEnter) [list source [file join $dir menu.tcl]]
-set auto_index(tkMbLeave) [list source [file join $dir menu.tcl]]
-set auto_index(tkMbPost) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuUnpost) [list source [file join $dir menu.tcl]]
-set auto_index(tkMbMotion) [list source [file join $dir menu.tcl]]
-set auto_index(tkMbButtonUp) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuMotion) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuButtonDown) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuLeave) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuInvoke) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuEscape) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuUpArrow) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuDownArrow) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuLeftArrow) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuRightArrow) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuNextMenu) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuNextEntry) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuFind) [list source [file join $dir menu.tcl]]
-set auto_index(tkTraverseToMenu) [list source [file join $dir menu.tcl]]
-set auto_index(tkFirstMenu) [list source [file join $dir menu.tcl]]
-set auto_index(tkTraverseWithinMenu) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuFirstEntry) [list source [file join $dir menu.tcl]]
-set auto_index(tkMenuFindName) [list source [file join $dir menu.tcl]]
-set auto_index(tkPostOverPoint) [list source [file join $dir menu.tcl]]
-set auto_index(tkSaveGrabInfo) [list source [file join $dir menu.tcl]]
-set auto_index(tkRestoreOldGrab) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::EntryClosestGap) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryButton1) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryMouseSelect) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryPaste) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryAutoScan) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryKeySelect) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryInsert) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryBackspace) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntrySeeInsert) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntrySetCursor) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryTranspose) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryPreviousWord) [list source [file join $dir entry.tcl]]
+set auto_index(::tk::EntryGetSelection) [list source [file join $dir entry.tcl]]
+set auto_index(tk_focusNext) [list source [file join $dir focus.tcl]]
+set auto_index(tk_focusPrev) [list source [file join $dir focus.tcl]]
+set auto_index(::tk::FocusOK) [list source [file join $dir focus.tcl]]
+set auto_index(tk_focusFollowsMouse) [list source [file join $dir focus.tcl]]
+set auto_index(::tk::ListboxBeginSelect) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxMotion) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxBeginExtend) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxBeginToggle) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxAutoScan) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxUpDown) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxExtendUpDown) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxDataExtend) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxCancel) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::ListboxSelectAll) [list source [file join $dir listbox.tcl]]
+set auto_index(::tk::MbEnter) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbLeave) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbPost) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuUnpost) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbMotion) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MbButtonUp) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuMotion) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuButtonDown) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuLeave) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuInvoke) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuEscape) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuUpArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuDownArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuLeftArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuRightArrow) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuNextMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuNextEntry) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuFind) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::TraverseToMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::FirstMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::TraverseWithinMenu) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuFirstEntry) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::MenuFindName) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::PostOverPoint) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::SaveGrabInfo) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::RestoreOldGrab) [list source [file join $dir menu.tcl]]
set auto_index(tk_menuSetFocus) [list source [file join $dir menu.tcl]]
-set auto_index(tkGenerateMenuSelect) [list source [file join $dir menu.tcl]]
+set auto_index(::tk::GenerateMenuSelect) [list source [file join $dir menu.tcl]]
set auto_index(tk_popup) [list source [file join $dir menu.tcl]]
-set auto_index(tkScrollButtonDown) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollButtonUp) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollSelect) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollStartDrag) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollDrag) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollEndDrag) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollByUnits) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollByPages) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollToPos) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollTopBottom) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkScrollButton2Down) [list source [file join $dir scrlbar.tcl]]
-set auto_index(tkTextClosestGap) [list source [file join $dir text.tcl]]
-set auto_index(tkTextButton1) [list source [file join $dir text.tcl]]
-set auto_index(tkTextSelectTo) [list source [file join $dir text.tcl]]
-set auto_index(tkTextKeyExtend) [list source [file join $dir text.tcl]]
-set auto_index(tkTextPaste) [list source [file join $dir text.tcl]]
-set auto_index(tkTextAutoScan) [list source [file join $dir text.tcl]]
-set auto_index(tkTextSetCursor) [list source [file join $dir text.tcl]]
-set auto_index(tkTextKeySelect) [list source [file join $dir text.tcl]]
-set auto_index(tkTextResetAnchor) [list source [file join $dir text.tcl]]
-set auto_index(tkTextInsert) [list source [file join $dir text.tcl]]
-set auto_index(tkTextUpDownLine) [list source [file join $dir text.tcl]]
-set auto_index(tkTextPrevPara) [list source [file join $dir text.tcl]]
-set auto_index(tkTextNextPara) [list source [file join $dir text.tcl]]
-set auto_index(tkTextScrollPages) [list source [file join $dir text.tcl]]
-set auto_index(tkTextTranspose) [list source [file join $dir text.tcl]]
-set auto_index(tk_textCopy) [list source [file join $dir text.tcl]]
-set auto_index(tk_textCut) [list source [file join $dir text.tcl]]
-set auto_index(tk_textPaste) [list source [file join $dir text.tcl]]
-set auto_index(tkTextNextPos) [list source [file join $dir text.tcl]]
-set auto_index(tkTextPrevPos) [list source [file join $dir text.tcl]]
-set auto_index(tkScreenChanged) [list source [file join $dir tk.tcl]]
-set auto_index(tkEventMotifBindings) [list source [file join $dir tk.tcl]]
-set auto_index(tkCancelRepeat) [list source [file join $dir tk.tcl]]
-set auto_index(tkTabToWindow) [list source [file join $dir tk.tcl]]
-set auto_index(bgerror) [list source [file join $dir bgerror.tcl]]
-set auto_index(tkScaleActivate) [list source [file join $dir scale.tcl]]
-set auto_index(tkScaleButtonDown) [list source [file join $dir scale.tcl]]
-set auto_index(tkScaleDrag) [list source [file join $dir scale.tcl]]
-set auto_index(tkScaleEndDrag) [list source [file join $dir scale.tcl]]
-set auto_index(tkScaleIncrement) [list source [file join $dir scale.tcl]]
-set auto_index(tkScaleControlPress) [list source [file join $dir scale.tcl]]
-set auto_index(tkScaleButton2Down) [list source [file join $dir scale.tcl]]
-set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]]
-set auto_index(tkTearOffMenu) [list source [file join $dir tearoff.tcl]]
-set auto_index(tkMenuDup) [list source [file join $dir tearoff.tcl]]
+set auto_index(::tk::ensure_psenc_is_loaded) [list source [file join $dir mkpsenc.tcl]]
+set auto_index(::tk::MessageBox) [list source [file join $dir msgbox.tcl]]
set auto_index(tk_menuBar) [list source [file join $dir obsolete.tcl]]
set auto_index(tk_bindForTraversal) [list source [file join $dir obsolete.tcl]]
-set auto_index(tk_focusNext) [list source [file join $dir focus.tcl]]
-set auto_index(tk_focusPrev) [list source [file join $dir focus.tcl]]
-set auto_index(tkFocusOK) [list source [file join $dir focus.tcl]]
-set auto_index(tk_focusFollowsMouse) [list source [file join $dir focus.tcl]]
-set auto_index(tkConsoleInit) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleSource) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleInvoke) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleHistory) [list source [file join $dir console.tcl]]
-set auto_index(tkConsolePrompt) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleBind) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleInsert) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleOutput) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleExit) [list source [file join $dir console.tcl]]
-set auto_index(tkConsoleAbout) [list source [file join $dir console.tcl]]
+set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]]
set auto_index(tk_setPalette) [list source [file join $dir palette.tcl]]
-set auto_index(tkRecolorTree) [list source [file join $dir palette.tcl]]
-set auto_index(tkDarken) [list source [file join $dir palette.tcl]]
+set auto_index(::tk::RecolorTree) [list source [file join $dir palette.tcl]]
+set auto_index(::tk::Darken) [list source [file join $dir palette.tcl]]
set auto_index(tk_bisque) [list source [file join $dir palette.tcl]]
-set auto_index(tkColorDialog) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_InitValues) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_Config) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_BuildDialog) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_SetRGBValue) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_XToRgb) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_RgbToX) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_DrawColorScale) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_CreateSelector) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_RedrawFinalColor) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_RedrawColorBars) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_StartMove) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_MoveSelector) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_ReleaseMouse) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_ResizeColorBars) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_HandleSelEntry) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_HandleRGBEntry) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_EnterColorBar) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_LeaveColorBar) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_OkCmd) [list source [file join $dir clrpick.tcl]]
-set auto_index(tkColorDialog_CancelCmd) [list source [file join $dir clrpick.tcl]]
-set auto_index(tclParseConfigSpec) [list source [file join $dir comdlg.tcl]]
-set auto_index(tclListValidFlags) [list source [file join $dir comdlg.tcl]]
-set auto_index(tclSortNoCase) [list source [file join $dir comdlg.tcl]]
-set auto_index(tclVerifyInteger) [list source [file join $dir comdlg.tcl]]
-set auto_index(tkFocusGroup_Create) [list source [file join $dir comdlg.tcl]]
-set auto_index(tkFocusGroup_BindIn) [list source [file join $dir comdlg.tcl]]
-set auto_index(tkFocusGroup_BindOut) [list source [file join $dir comdlg.tcl]]
-set auto_index(tkFocusGroup_Destroy) [list source [file join $dir comdlg.tcl]]
-set auto_index(tkFocusGroup_In) [list source [file join $dir comdlg.tcl]]
-set auto_index(tkFocusGroup_Out) [list source [file join $dir comdlg.tcl]]
-set auto_index(tkFDGetFileTypes) [list source [file join $dir comdlg.tcl]]
+set auto_index(::safe::tkInterpInit) [list source [file join $dir safetk.tcl]]
set auto_index(::safe::loadTk) [list source [file join $dir safetk.tcl]]
set auto_index(::safe::TkInit) [list source [file join $dir safetk.tcl]]
set auto_index(::safe::allowTk) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::disallowTk) [list source [file join $dir safetk.tcl]]
+set auto_index(::safe::tkDelete) [list source [file join $dir safetk.tcl]]
set auto_index(::safe::tkTopLevel) [list source [file join $dir safetk.tcl]]
-set auto_index(tkMessageBox) [list source [file join $dir msgbox.tcl]]
-set auto_index(tkIconList) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Config) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Create) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_AutoScan) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_DeleteAll) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Add) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Arrange) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Invoke) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_See) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_SelectAtXY) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Select) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Unselect) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Get) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Btn1) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Motion1) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Double1) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_ReturnKey) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Leave1) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_FocusIn) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_UpDown) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_LeftRight) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_KeyPress) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Goto) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkIconList_Reset) [list source [file join $dir tkfbox.tcl]]
-set auto_index(::tk::dialog::file::tkFDialog) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::ScaleActivate) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleButtonDown) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleDrag) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleEndDrag) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleIncrement) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleControlPress) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScaleButton2Down) [list source [file join $dir scale.tcl]]
+set auto_index(::tk::ScrollButtonDown) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollButtonUp) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollSelect) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollStartDrag) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollDrag) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollEndDrag) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollByUnits) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollByPages) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollToPos) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollTopBottom) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::ScrollButton2Down) [list source [file join $dir scrlbar.tcl]]
+set auto_index(::tk::spinbox::Invoke) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::ClosestGap) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::ButtonDown) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::ButtonUp) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::MouseSelect) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Paste) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Motion) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::AutoScan) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::KeySelect) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Insert) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Backspace) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::SeeInsert) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::SetCursor) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::Transpose) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::PreviousWord) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::spinbox::GetSelection) [list source [file join $dir spinbox.tcl]]
+set auto_index(::tk::TearOffMenu) [list source [file join $dir tearoff.tcl]]
+set auto_index(::tk::MenuDup) [list source [file join $dir tearoff.tcl]]
+set auto_index(::tk::TextClosestGap) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextButton1) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextSelectTo) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextKeyExtend) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextPaste) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextAutoScan) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextSetCursor) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextKeySelect) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextResetAnchor) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextInsert) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextUpDownLine) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextPrevPara) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextNextPara) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextScrollPages) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextTranspose) [list source [file join $dir text.tcl]]
+set auto_index(tk_textCopy) [list source [file join $dir text.tcl]]
+set auto_index(tk_textCut) [list source [file join $dir text.tcl]]
+set auto_index(tk_textPaste) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextNextPos) [list source [file join $dir text.tcl]]
+set auto_index(::tk::TextPrevPos) [list source [file join $dir text.tcl]]
+set auto_index(::tk::PlaceWindow) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::SetFocusGrab) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::RestoreFocusGrab) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::ScreenChanged) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::EventMotifBindings) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::CancelRepeat) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::TabToWindow) [list source [file join $dir tk.tcl]]
+set auto_index(::tk::IconList) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Index) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Selection) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Curselection) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_DrawSelection) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Get) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Config) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Create) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_AutoScan) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_DeleteAll) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Add) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Arrange) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Invoke) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_See) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Btn1) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_CtrlBtn1) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_ShiftBtn1) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Motion1) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Double1) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_ReturnKey) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Leave1) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_FocusIn) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_FocusOut) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_UpDown) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_LeftRight) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_KeyPress) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Goto) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::IconList_Reset) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::Config) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::Create) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::SetSelectMode) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::Update) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::SetPathSilently) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::SetPath) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::SetFilter) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkFDialogResolveFile) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::ResolveFile) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::EntFocusIn) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::EntFocusOut) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::ActivateEnt) [list source [file join $dir tkfbox.tcl]]
+set auto_index(::tk::dialog::file::VerifyFileName) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::InvokeBtn) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::UpDirCmd) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::JoinFile) [list source [file join $dir tkfbox.tcl]]
@@ -221,25 +247,31 @@ set auto_index(::tk::dialog::file::CancelCmd) [list source [file join $dir tkfbo
set auto_index(::tk::dialog::file::ListBrowse) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::ListInvoke) [list source [file join $dir tkfbox.tcl]]
set auto_index(::tk::dialog::file::Done) [list source [file join $dir tkfbox.tcl]]
-set auto_index(tkMotifFDialog) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_Config) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_Create) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_MakeSList) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_BrowseDList) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_ActivateDList) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_BrowseFList) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_ActivateFList) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_ActivateFEnt) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_InterpFilter) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_ActivateSEnt) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_OkCmd) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_FilterCmd) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_CancelCmd) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_Update) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkMotifFDialog_LoadFiles) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkListBoxKeyAccel_Set) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkListBoxKeyAccel_Unset) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkListBoxKeyAccel_Key) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkListBoxKeyAccel_Goto) [list source [file join $dir xmfbox.tcl]]
-set auto_index(tkListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.tcl]]
-set auto_index(::tk::dialog::file::chooseDir::tkChooseDirectory) [list source [file join $dir choosedir.tcl]]
+set auto_index(::tk::MotifFDialog) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_Create) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_FileTypes) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_SetFilter) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_Config) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_BuildUI) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_SetListMode) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_MakeSList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_InterpFilter) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_Update) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_LoadFiles) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_BrowseDList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateDList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_BrowseFList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateFList) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateFEnt) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_ActivateSEnt) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_OkCmd) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_FilterCmd) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::MotifFDialog_CancelCmd) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Set) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Unset) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Key) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Goto) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::ListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.tcl]]
+set auto_index(tk_getFileType) [list source [file join $dir xmfbox.tcl]]
+set auto_index(::tk::unsupported::ExposePrivateCommand) [list source [file join $dir unsupported.tcl]]
+set auto_index(::tk::unsupported::ExposePrivateVariable) [list source [file join $dir unsupported.tcl]]
diff --git a/tk/library/tearoff.tcl b/tk/library/tearoff.tcl
index e2e7204299a..c714a607a90 100644
--- a/tk/library/tearoff.tcl
+++ b/tk/library/tearoff.tcl
@@ -11,7 +11,7 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# tkTearoffMenu --
+# ::tk::TearoffMenu --
# Given the name of a menu, this procedure creates a torn-off menu
# that is identical to the given menu (including nested submenus).
# The new torn-off menu exists as a toplevel window managed by the
@@ -23,7 +23,7 @@
# x - x coordinate where window is created
# y - y coordinate where window is created
-proc tkTearOffMenu {w {x 0} {y 0}} {
+proc ::tk::TearOffMenu {w {x 0} {y 0}} {
# Find a unique name to use for the torn-off menu. Find the first
# ancestor of w that is a toplevel but not a menu, and use this as
# the parent of the new menu. This guarantees that the torn off
@@ -80,12 +80,12 @@ proc tkTearOffMenu {w {x 0} {y 0}} {
return ""
}
- # Set tkPriv(focus) on entry: otherwise the focus will get lost
+ # Set tk::Priv(focus) on entry: otherwise the focus will get lost
# after keyboard invocation of a sub-menu (it will stay on the
# submenu).
bind $menu <Enter> {
- set tkPriv(focus) %W
+ set tk::Priv(focus) %W
}
# If there is a -tearoffcommand option for the menu, invoke it
@@ -98,7 +98,7 @@ proc tkTearOffMenu {w {x 0} {y 0}} {
return $menu
}
-# tkMenuDup --
+# ::tk::MenuDup --
# Given a menu (hierarchy), create a duplicate menu (hierarchy)
# in a given window.
#
@@ -108,7 +108,7 @@ proc tkTearOffMenu {w {x 0} {y 0}} {
# dst - Name to use for topmost menu in duplicate
# hierarchy.
-proc tkMenuDup {src dst type} {
+proc ::tk::MenuDup {src dst type} {
set cmd [list menu $dst -type $type]
foreach option [$src configure] {
if {[llength $option] == 2} {
@@ -164,4 +164,3 @@ proc tkMenuDup {src dst type} {
bind $dst $event $x
}
}
-
diff --git a/tk/library/text.tcl b/tk/library/text.tcl
index 7e68e669499..70f6b8c74f0 100644
--- a/tk/library/text.tcl
+++ b/tk/library/text.tcl
@@ -14,7 +14,7 @@
#
#-------------------------------------------------------------------------
-# Elements of tkPriv that are used in this file:
+# Elements of ::tk::Priv that are used in this file:
#
# afterId - If non-null, it means that auto-scanning is underway
# and it gives the "after" id for the next auto-scan
@@ -36,118 +36,116 @@
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
-# The code below creates the default class bindings for entries.
+# The code below creates the default class bindings for text widgets.
#-------------------------------------------------------------------------
# Standard Motif bindings:
bind Text <1> {
- tkTextButton1 %W %x %y
+ tk::TextButton1 %W %x %y
%W tag remove sel 0.0 end
}
bind Text <B1-Motion> {
- set tkPriv(x) %x
- set tkPriv(y) %y
- tkTextSelectTo %W %x %y
+ set tk::Priv(x) %x
+ set tk::Priv(y) %y
+ tk::TextSelectTo %W %x %y
}
bind Text <Double-1> {
- set tkPriv(selectMode) word
- tkTextSelectTo %W %x %y
+ set tk::Priv(selectMode) word
+ tk::TextSelectTo %W %x %y
catch {%W mark set insert sel.last}
- catch {%W mark set anchor sel.first}
}
bind Text <Triple-1> {
- set tkPriv(selectMode) line
- tkTextSelectTo %W %x %y
+ set tk::Priv(selectMode) line
+ tk::TextSelectTo %W %x %y
catch {%W mark set insert sel.last}
- catch {%W mark set anchor sel.first}
}
bind Text <Shift-1> {
- tkTextResetAnchor %W @%x,%y
- set tkPriv(selectMode) char
- tkTextSelectTo %W %x %y
+ tk::TextResetAnchor %W @%x,%y
+ set tk::Priv(selectMode) char
+ tk::TextSelectTo %W %x %y
}
bind Text <Double-Shift-1> {
- set tkPriv(selectMode) word
- tkTextSelectTo %W %x %y 1
+ set tk::Priv(selectMode) word
+ tk::TextSelectTo %W %x %y 1
}
bind Text <Triple-Shift-1> {
- set tkPriv(selectMode) line
- tkTextSelectTo %W %x %y
+ set tk::Priv(selectMode) line
+ tk::TextSelectTo %W %x %y
}
bind Text <B1-Leave> {
- set tkPriv(x) %x
- set tkPriv(y) %y
- tkTextAutoScan %W
+ set tk::Priv(x) %x
+ set tk::Priv(y) %y
+ tk::TextAutoScan %W
}
bind Text <B1-Enter> {
- tkCancelRepeat
+ tk::CancelRepeat
}
bind Text <ButtonRelease-1> {
- tkCancelRepeat
+ tk::CancelRepeat
}
bind Text <Control-1> {
%W mark set insert @%x,%y
}
bind Text <Left> {
- tkTextSetCursor %W insert-1c
+ tk::TextSetCursor %W insert-1c
}
bind Text <Right> {
- tkTextSetCursor %W insert+1c
+ tk::TextSetCursor %W insert+1c
}
bind Text <Up> {
- tkTextSetCursor %W [tkTextUpDownLine %W -1]
+ tk::TextSetCursor %W [tk::TextUpDownLine %W -1]
}
bind Text <Down> {
- tkTextSetCursor %W [tkTextUpDownLine %W 1]
+ tk::TextSetCursor %W [tk::TextUpDownLine %W 1]
}
bind Text <Shift-Left> {
- tkTextKeySelect %W [%W index {insert - 1c}]
+ tk::TextKeySelect %W [%W index {insert - 1c}]
}
bind Text <Shift-Right> {
- tkTextKeySelect %W [%W index {insert + 1c}]
+ tk::TextKeySelect %W [%W index {insert + 1c}]
}
bind Text <Shift-Up> {
- tkTextKeySelect %W [tkTextUpDownLine %W -1]
+ tk::TextKeySelect %W [tk::TextUpDownLine %W -1]
}
bind Text <Shift-Down> {
- tkTextKeySelect %W [tkTextUpDownLine %W 1]
+ tk::TextKeySelect %W [tk::TextUpDownLine %W 1]
}
bind Text <Control-Left> {
- tkTextSetCursor %W [tkTextPrevPos %W insert tcl_startOfPreviousWord]
+ tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
}
bind Text <Control-Right> {
- tkTextSetCursor %W [tkTextNextWord %W insert]
+ tk::TextSetCursor %W [tk::TextNextWord %W insert]
}
bind Text <Control-Up> {
- tkTextSetCursor %W [tkTextPrevPara %W insert]
+ tk::TextSetCursor %W [tk::TextPrevPara %W insert]
}
bind Text <Control-Down> {
- tkTextSetCursor %W [tkTextNextPara %W insert]
+ tk::TextSetCursor %W [tk::TextNextPara %W insert]
}
bind Text <Shift-Control-Left> {
- tkTextKeySelect %W [tkTextPrevPos %W insert tcl_startOfPreviousWord]
+ tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
}
bind Text <Shift-Control-Right> {
- tkTextKeySelect %W [tkTextNextWord %W insert]
+ tk::TextKeySelect %W [tk::TextNextWord %W insert]
}
bind Text <Shift-Control-Up> {
- tkTextKeySelect %W [tkTextPrevPara %W insert]
+ tk::TextKeySelect %W [tk::TextPrevPara %W insert]
}
bind Text <Shift-Control-Down> {
- tkTextKeySelect %W [tkTextNextPara %W insert]
+ tk::TextKeySelect %W [tk::TextNextPara %W insert]
}
bind Text <Prior> {
- tkTextSetCursor %W [tkTextScrollPages %W -1]
+ tk::TextSetCursor %W [tk::TextScrollPages %W -1]
}
bind Text <Shift-Prior> {
- tkTextKeySelect %W [tkTextScrollPages %W -1]
+ tk::TextKeySelect %W [tk::TextScrollPages %W -1]
}
bind Text <Next> {
- tkTextSetCursor %W [tkTextScrollPages %W 1]
+ tk::TextSetCursor %W [tk::TextScrollPages %W 1]
}
bind Text <Shift-Next> {
- tkTextKeySelect %W [tkTextScrollPages %W 1]
+ tk::TextKeySelect %W [tk::TextScrollPages %W 1]
}
bind Text <Control-Prior> {
%W xview scroll -1 page
@@ -157,34 +155,36 @@ bind Text <Control-Next> {
}
bind Text <Home> {
- tkTextSetCursor %W {insert linestart}
+ tk::TextSetCursor %W {insert linestart}
}
bind Text <Shift-Home> {
- tkTextKeySelect %W {insert linestart}
+ tk::TextKeySelect %W {insert linestart}
}
bind Text <End> {
- tkTextSetCursor %W {insert lineend}
+ tk::TextSetCursor %W {insert lineend}
}
bind Text <Shift-End> {
- tkTextKeySelect %W {insert lineend}
+ tk::TextKeySelect %W {insert lineend}
}
bind Text <Control-Home> {
- tkTextSetCursor %W 1.0
+ tk::TextSetCursor %W 1.0
}
bind Text <Control-Shift-Home> {
- tkTextKeySelect %W 1.0
+ tk::TextKeySelect %W 1.0
}
bind Text <Control-End> {
- tkTextSetCursor %W {end - 1 char}
+ tk::TextSetCursor %W {end - 1 char}
}
bind Text <Control-Shift-End> {
- tkTextKeySelect %W {end - 1 char}
+ tk::TextKeySelect %W {end - 1 char}
}
bind Text <Tab> {
- tkTextInsert %W \t
- focus %W
- break
+ if { [string equal [%W cget -state] "normal"] } {
+ tk::TextInsert %W \t
+ focus %W
+ break
+ }
}
bind Text <Shift-Tab> {
# Needed only to keep <Tab> binding from triggering; doesn't
@@ -198,10 +198,11 @@ bind Text <Control-Shift-Tab> {
focus [tk_focusPrev %W]
}
bind Text <Control-i> {
- tkTextInsert %W \t
+ tk::TextInsert %W \t
}
bind Text <Return> {
- tkTextInsert %W \n
+ tk::TextInsert %W \n
+ if {[%W cget -autoseparators]} {%W edit separator}
}
bind Text <Delete> {
if {[string compare [%W tag nextrange sel 1.0 end] ""]} {
@@ -227,12 +228,12 @@ bind Text <Select> {
%W mark set anchor insert
}
bind Text <Control-Shift-space> {
- set tkPriv(selectMode) char
- tkTextKeyExtend %W insert
+ set tk::Priv(selectMode) char
+ tk::TextKeyExtend %W insert
}
bind Text <Shift-Select> {
- set tkPriv(selectMode) char
- tkTextKeyExtend %W insert
+ set tk::Priv(selectMode) char
+ tk::TextKeyExtend %W insert
}
bind Text <Control-slash> {
%W tag add sel 1.0 end
@@ -253,15 +254,16 @@ bind Text <<Clear>> {
catch {%W delete sel.first sel.last}
}
bind Text <<PasteSelection>> {
- if {!$tkPriv(mouseMoved) || $tk_strictMotif} {
- tkTextPaste %W %x %y
+ if {$tk_strictMotif || ![info exists tk::Priv(mouseMoved)]
+ || !$tk::Priv(mouseMoved)} {
+ tk::TextPasteSelection %W %x %y
}
}
bind Text <Insert> {
- catch {tkTextInsert %W [selection get -displayof %W]}
+ catch {tk::TextInsert %W [::tk::GetSelection %W PRIMARY]}
}
bind Text <KeyPress> {
- tkTextInsert %W %A
+ tk::TextInsert %W %A
}
# Ignore all Alt, Meta, and Control keypresses unless explicitly bound.
@@ -274,7 +276,8 @@ bind Text <Meta-KeyPress> {# nothing}
bind Text <Control-KeyPress> {# nothing}
bind Text <Escape> {# nothing}
bind Text <KP_Enter> {# nothing}
-if {[string equal $tcl_platform(platform) "macintosh"]} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
bind Text <Command-KeyPress> {# nothing}
}
@@ -282,12 +285,12 @@ if {[string equal $tcl_platform(platform) "macintosh"]} {
bind Text <Control-a> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W {insert linestart}
+ tk::TextSetCursor %W {insert linestart}
}
}
bind Text <Control-b> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W insert-1c
+ tk::TextSetCursor %W insert-1c
}
}
bind Text <Control-d> {
@@ -297,12 +300,12 @@ bind Text <Control-d> {
}
bind Text <Control-e> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W {insert lineend}
+ tk::TextSetCursor %W {insert lineend}
}
}
bind Text <Control-f> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W insert+1c
+ tk::TextSetCursor %W insert+1c
}
}
bind Text <Control-k> {
@@ -316,7 +319,7 @@ bind Text <Control-k> {
}
bind Text <Control-n> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W [tkTextUpDownLine %W 1]
+ tk::TextSetCursor %W [tk::TextUpDownLine %W 1]
}
}
bind Text <Control-o> {
@@ -327,63 +330,72 @@ bind Text <Control-o> {
}
bind Text <Control-p> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W [tkTextUpDownLine %W -1]
+ tk::TextSetCursor %W [tk::TextUpDownLine %W -1]
}
}
bind Text <Control-t> {
if {!$tk_strictMotif} {
- tkTextTranspose %W
+ tk::TextTranspose %W
}
}
+bind Text <<Undo>> {
+ catch { %W edit undo }
+}
+
+bind Text <<Redo>> {
+ catch { %W edit redo }
+}
+
if {[string compare $tcl_platform(platform) "windows"]} {
bind Text <Control-v> {
if {!$tk_strictMotif} {
- tkTextScrollPages %W 1
+ tk::TextScrollPages %W 1
}
}
}
bind Text <Meta-b> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W [tkTextPrevPos %W insert tcl_startOfPreviousWord]
+ tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
}
}
bind Text <Meta-d> {
if {!$tk_strictMotif} {
- %W delete insert [tkTextNextWord %W insert]
+ %W delete insert [tk::TextNextWord %W insert]
}
}
bind Text <Meta-f> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W [tkTextNextWord %W insert]
+ tk::TextSetCursor %W [tk::TextNextWord %W insert]
}
}
bind Text <Meta-less> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W 1.0
+ tk::TextSetCursor %W 1.0
}
}
bind Text <Meta-greater> {
if {!$tk_strictMotif} {
- tkTextSetCursor %W end-1c
+ tk::TextSetCursor %W end-1c
}
}
bind Text <Meta-BackSpace> {
if {!$tk_strictMotif} {
- %W delete [tkTextPrevPos %W insert tcl_startOfPreviousWord] insert
+ %W delete [tk::TextPrevPos %W insert tcl_startOfPreviousWord] insert
}
}
bind Text <Meta-Delete> {
if {!$tk_strictMotif} {
- %W delete [tkTextPrevPos %W insert tcl_startOfPreviousWord] insert
+ %W delete [tk::TextPrevPos %W insert tcl_startOfPreviousWord] insert
}
}
# Macintosh only bindings:
# if text black & highlight black -> text white, other text the same
-if {[string equal $tcl_platform(platform) "macintosh"]} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
bind Text <FocusIn> {
%W tag configure sel -borderwidth 0
%W configure -selectbackground systemHighlight -selectforeground systemHighlightText
@@ -393,28 +405,28 @@ bind Text <FocusOut> {
%W configure -selectbackground white -selectforeground black
}
bind Text <Option-Left> {
- tkTextSetCursor %W [tkTextPrevPos %W insert tcl_startOfPreviousWord]
+ tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
}
bind Text <Option-Right> {
- tkTextSetCursor %W [tkTextNextWord %W insert]
+ tk::TextSetCursor %W [tk::TextNextWord %W insert]
}
bind Text <Option-Up> {
- tkTextSetCursor %W [tkTextPrevPara %W insert]
+ tk::TextSetCursor %W [tk::TextPrevPara %W insert]
}
bind Text <Option-Down> {
- tkTextSetCursor %W [tkTextNextPara %W insert]
+ tk::TextSetCursor %W [tk::TextNextPara %W insert]
}
bind Text <Shift-Option-Left> {
- tkTextKeySelect %W [tkTextPrevPos %W insert tcl_startOfPreviousWord]
+ tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord]
}
bind Text <Shift-Option-Right> {
- tkTextKeySelect %W [tkTextNextWord %W insert]
+ tk::TextKeySelect %W [tk::TextNextWord %W insert]
}
bind Text <Shift-Option-Up> {
- tkTextKeySelect %W [tkTextPrevPara %W insert]
+ tk::TextKeySelect %W [tk::TextPrevPara %W insert]
}
bind Text <Shift-Option-Down> {
- tkTextKeySelect %W [tkTextNextPara %W insert]
+ tk::TextKeySelect %W [tk::TextNextPara %W insert]
}
# End of Mac only bindings
@@ -432,23 +444,15 @@ bind Text <Control-h> {
}
bind Text <2> {
if {!$tk_strictMotif} {
- %W scan mark %x %y
- set tkPriv(x) %x
- set tkPriv(y) %y
- set tkPriv(mouseMoved) 0
+ tk::TextScanMark %W %x %y
}
}
bind Text <B2-Motion> {
if {!$tk_strictMotif} {
- if {(%x != $tkPriv(x)) || (%y != $tkPriv(y))} {
- set tkPriv(mouseMoved) 1
- }
- if {$tkPriv(mouseMoved)} {
- %W scan dragto %x %y
- }
+ tk::TextScanDrag %W %x %y
}
}
-set tkPriv(prevPos) {}
+set ::tk::Priv(prevPos) {}
# The MouseWheel will typically only fire on Windows. However,
# someone could use the "event generate" command to produce one
@@ -458,7 +462,7 @@ bind Text <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}
-if {[string equal "unix" $tcl_platform(platform)]} {
+if {[string equal "x11" [tk windowingsystem]]} {
# Support for mousewheels on Linux/Unix commonly comes through mapping
# the wheel to the extended buttons. If you have a mousewheel, find
# Linux configuration info at:
@@ -475,7 +479,7 @@ if {[string equal "unix" $tcl_platform(platform)]} {
}
}
-# tkTextClosestGap --
+# ::tk::TextClosestGap --
# Given x and y coordinates, this procedure finds the closest boundary
# between characters to the given coordinates and returns the index
# of the character just after the boundary.
@@ -485,7 +489,7 @@ if {[string equal "unix" $tcl_platform(platform)]} {
# x - X-coordinate within the window.
# y - Y-coordinate within the window.
-proc tkTextClosestGap {w x y} {
+proc ::tk::TextClosestGap {w x y} {
set pos [$w index @$x,$y]
set bbox [$w bbox $pos]
if {[string equal $bbox ""]} {
@@ -497,7 +501,7 @@ proc tkTextClosestGap {w x y} {
$w index "$pos + 1 char"
}
-# tkTextButton1 --
+# ::tk::TextButton1 --
# This procedure is invoked to handle button-1 presses in text
# widgets. It moves the insertion cursor, sets the selection anchor,
# and claims the input focus.
@@ -507,18 +511,22 @@ proc tkTextClosestGap {w x y} {
# x - The x-coordinate of the button press.
# y - The x-coordinate of the button press.
-proc tkTextButton1 {w x y} {
- global tkPriv
+proc ::tk::TextButton1 {w x y} {
+ variable ::tk::Priv
- set tkPriv(selectMode) char
- set tkPriv(mouseMoved) 0
- set tkPriv(pressX) $x
- $w mark set insert [tkTextClosestGap $w $x $y]
+ set Priv(selectMode) char
+ set Priv(mouseMoved) 0
+ set Priv(pressX) $x
+ $w mark set insert [TextClosestGap $w $x $y]
$w mark set anchor insert
- if {[string equal [$w cget -state] "normal"]} {focus $w}
+ # Allow focus in any case on Windows, because that will let the
+ # selection be displayed even for state disabled text widgets.
+ if {[string equal $::tcl_platform(platform) "windows"] \
+ || [string equal [$w cget -state] "normal"]} {focus $w}
+ if {[$w cget -autoseparators]} {$w edit separator}
}
-# tkTextSelectTo --
+# ::tk::TextSelectTo --
# This procedure is invoked to extend the selection, typically when
# dragging it with the mouse. Depending on the selection mode (character,
# word, line) it selects in different-sized units. This procedure
@@ -530,18 +538,19 @@ proc tkTextButton1 {w x y} {
# x - Mouse x position.
# y - Mouse y position.
-proc tkTextSelectTo {w x y {extend 0}} {
- global tkPriv tcl_platform
+proc ::tk::TextSelectTo {w x y {extend 0}} {
+ global tcl_platform
+ variable ::tk::Priv
- set cur [tkTextClosestGap $w $x $y]
+ set cur [TextClosestGap $w $x $y]
if {[catch {$w index anchor}]} {
$w mark set anchor $cur
}
set anchor [$w index anchor]
- if {[$w compare $cur != $anchor] || (abs($tkPriv(pressX) - $x) >= 3)} {
- set tkPriv(mouseMoved) 1
+ if {[$w compare $cur != $anchor] || (abs($Priv(pressX) - $x) >= 3)} {
+ set Priv(mouseMoved) 1
}
- switch $tkPriv(selectMode) {
+ switch $Priv(selectMode) {
char {
if {[$w compare $cur < anchor]} {
set first $cur
@@ -553,16 +562,16 @@ proc tkTextSelectTo {w x y {extend 0}} {
}
word {
if {[$w compare $cur < anchor]} {
- set first [tkTextPrevPos $w "$cur + 1c" tcl_wordBreakBefore]
+ set first [TextPrevPos $w "$cur + 1c" tcl_wordBreakBefore]
if { !$extend } {
- set last [tkTextNextPos $w "anchor" tcl_wordBreakAfter]
+ set last [TextNextPos $w "anchor" tcl_wordBreakAfter]
} else {
set last anchor
}
} else {
- set last [tkTextNextPos $w "$cur - 1c" tcl_wordBreakAfter]
+ set last [TextNextPos $w "$cur - 1c" tcl_wordBreakAfter]
if { !$extend } {
- set first [tkTextPrevPos $w anchor tcl_wordBreakBefore]
+ set first [TextPrevPos $w anchor tcl_wordBreakBefore]
} else {
set first anchor
}
@@ -578,21 +587,16 @@ proc tkTextSelectTo {w x y {extend 0}} {
}
}
}
- if {$tkPriv(mouseMoved) || [string compare $tkPriv(selectMode) "char"]} {
- if {[string compare $tcl_platform(platform) "unix"] \
- && [$w compare $cur < anchor]} {
- $w mark set insert $first
- } else {
- $w mark set insert $last
- }
- $w tag remove sel 0.0 $first
+ if {$Priv(mouseMoved) || [string compare $Priv(selectMode) "char"]} {
+ $w tag remove sel 0.0 end
+ $w mark set insert $cur
$w tag add sel $first $last
$w tag remove sel $last end
update idletasks
}
}
-# tkTextKeyExtend --
+# ::tk::TextKeyExtend --
# This procedure handles extending the selection from the keyboard,
# where the point to extend to is really the boundary between two
# characters rather than a particular character.
@@ -601,8 +605,7 @@ proc tkTextSelectTo {w x y {extend 0}} {
# w - The text window.
# index - The point to which the selection is to be extended.
-proc tkTextKeyExtend {w index} {
- global tkPriv
+proc ::tk::TextKeyExtend {w index} {
set cur [$w index $index]
if {[catch {$w index anchor}]} {
@@ -621,7 +624,7 @@ proc tkTextKeyExtend {w index} {
$w tag remove sel $last end
}
-# tkTextPaste --
+# ::tk::TextPasteSelection --
# This procedure sets the insertion cursor to the mouse position,
# inserts the selection, and sets the focus to the window.
#
@@ -629,42 +632,53 @@ proc tkTextKeyExtend {w index} {
# w - The text window.
# x, y - Position of the mouse.
-proc tkTextPaste {w x y} {
- $w mark set insert [tkTextClosestGap $w $x $y]
- catch {$w insert insert [selection get -displayof $w]}
+proc ::tk::TextPasteSelection {w x y} {
+ $w mark set insert [TextClosestGap $w $x $y]
+ if {![catch {::tk::GetSelection $w PRIMARY} sel]} {
+ set oldSeparator [$w cget -autoseparators]
+ if {$oldSeparator} {
+ $w configure -autoseparators 0
+ $w edit separator
+ }
+ $w insert insert $sel
+ if {$oldSeparator} {
+ $w edit separator
+ $w configure -autoseparators 1
+ }
+ }
if {[string equal [$w cget -state] "normal"]} {focus $w}
}
-# tkTextAutoScan --
+# ::tk::TextAutoScan --
# This procedure is invoked when the mouse leaves a text window
# with button 1 down. It scrolls the window up, down, left, or right,
# depending on where the mouse is (this information was saved in
-# tkPriv(x) and tkPriv(y)), and reschedules itself as an "after"
+# ::tk::Priv(x) and ::tk::Priv(y)), and reschedules itself as an "after"
# command so that the window continues to scroll until the mouse
# moves back into the window or the mouse button is released.
#
# Arguments:
# w - The text window.
-proc tkTextAutoScan {w} {
- global tkPriv
+proc ::tk::TextAutoScan {w} {
+ variable ::tk::Priv
if {![winfo exists $w]} return
- if {$tkPriv(y) >= [winfo height $w]} {
+ if {$Priv(y) >= [winfo height $w]} {
$w yview scroll 2 units
- } elseif {$tkPriv(y) < 0} {
+ } elseif {$Priv(y) < 0} {
$w yview scroll -2 units
- } elseif {$tkPriv(x) >= [winfo width $w]} {
+ } elseif {$Priv(x) >= [winfo width $w]} {
$w xview scroll 2 units
- } elseif {$tkPriv(x) < 0} {
+ } elseif {$Priv(x) < 0} {
$w xview scroll -2 units
} else {
return
}
- tkTextSelectTo $w $tkPriv(x) $tkPriv(y)
- set tkPriv(afterId) [after 50 [list tkTextAutoScan $w]]
+ TextSelectTo $w $Priv(x) $Priv(y)
+ set Priv(afterId) [after 50 [list tk::TextAutoScan $w]]
}
-# tkTextSetCursor
+# ::tk::TextSetCursor
# Move the insertion cursor to a given position in a text. Also
# clears the selection, if there is one in the text, and makes sure
# that the insertion cursor is visible. Also, don't let the insertion
@@ -674,8 +688,7 @@ proc tkTextAutoScan {w} {
# w - The text window.
# pos - The desired new position for the cursor in the window.
-proc tkTextSetCursor {w pos} {
- global tkPriv
+proc ::tk::TextSetCursor {w pos} {
if {[$w compare $pos == end]} {
set pos {end - 1 chars}
@@ -683,9 +696,10 @@ proc tkTextSetCursor {w pos} {
$w mark set insert $pos
$w tag remove sel 1.0 end
$w see insert
+ if {[$w cget -autoseparators]} {$w edit separator}
}
-# tkTextKeySelect
+# ::tk::TextKeySelect
# This procedure is invoked when stroking out selections using the
# keyboard. It moves the cursor to a new position, then extends
# the selection to that position.
@@ -695,8 +709,7 @@ proc tkTextSetCursor {w pos} {
# new - A new position for the insertion cursor (the cursor hasn't
# actually been moved to this position yet).
-proc tkTextKeySelect {w new} {
- global tkPriv
+proc ::tk::TextKeySelect {w new} {
if {[string equal [$w tag nextrange sel 1.0 end] ""]} {
if {[$w compare $new < insert]} {
@@ -722,7 +735,7 @@ proc tkTextKeySelect {w new} {
update idletasks
}
-# tkTextResetAnchor --
+# ::tk::TextResetAnchor --
# Set the selection anchor to whichever end is farthest from the
# index argument. One special trick: if the selection has two or
# fewer characters, just leave the anchor where it is. In this
@@ -736,11 +749,13 @@ proc tkTextKeySelect {w new} {
# index - Position at which mouse button was pressed, which determines
# which end of selection should be used as anchor point.
-proc tkTextResetAnchor {w index} {
- global tkPriv
+proc ::tk::TextResetAnchor {w index} {
if {[string equal [$w tag ranges sel] ""]} {
- $w mark set anchor $index
+ # Don't move the anchor if there is no selection now; this makes
+ # the widget behave "correctly" when the user clicks once, then
+ # shift-clicks somewhere -- ie, the area between the two clicks will be
+ # selected. [Bug: 5929].
return
}
set a [$w index $index]
@@ -776,7 +791,7 @@ proc tkTextResetAnchor {w index} {
}
}
-# tkTextInsert --
+# ::tk::TextInsert --
# Insert a string into a text at the point of the insertion cursor.
# If there is a selection in the text, and it covers the point of the
# insertion cursor, then delete the selection before inserting.
@@ -785,21 +800,32 @@ proc tkTextResetAnchor {w index} {
# w - The text window in which to insert the string
# s - The string to insert (usually just a single character)
-proc tkTextInsert {w s} {
+proc ::tk::TextInsert {w s} {
if {[string equal $s ""] || [string equal [$w cget -state] "disabled"]} {
return
}
+ set compound 0
catch {
if {[$w compare sel.first <= insert] \
&& [$w compare sel.last >= insert]} {
+ set oldSeparator [$w cget -autoseparators]
+ if { $oldSeparator } {
+ $w configure -autoseparators 0
+ $w edit separator
+ set compound 1
+ }
$w delete sel.first sel.last
}
}
$w insert insert $s
$w see insert
+ if { $compound && $oldSeparator } {
+ $w edit separator
+ $w configure -autoseparators 1
+ }
}
-# tkTextUpDownLine --
+# ::tk::TextUpDownLine --
# Returns the index of the character one line above or below the
# insertion cursor. There are two tricky things here. First,
# we want to maintain the original column across repeated operations,
@@ -812,23 +838,23 @@ proc tkTextInsert {w s} {
# n - The number of lines to move: -1 for up one line,
# +1 for down one line.
-proc tkTextUpDownLine {w n} {
- global tkPriv
+proc ::tk::TextUpDownLine {w n} {
+ variable ::tk::Priv
set i [$w index insert]
scan $i "%d.%d" line char
- if {[string compare $tkPriv(prevPos) $i]} {
- set tkPriv(char) $char
+ if {[string compare $Priv(prevPos) $i]} {
+ set Priv(char) $char
}
- set new [$w index [expr {$line + $n}].$tkPriv(char)]
+ set new [$w index [expr {$line + $n}].$Priv(char)]
if {[$w compare $new == end] || [$w compare $new == "insert linestart"]} {
set new $i
}
- set tkPriv(prevPos) $new
+ set Priv(prevPos) $new
return $new
}
-# tkTextPrevPara --
+# ::tk::TextPrevPara --
# Returns the index of the beginning of the paragraph just before a given
# position in the text (the beginning of a paragraph is the first non-blank
# character after a blank line).
@@ -837,7 +863,7 @@ proc tkTextUpDownLine {w n} {
# w - The text window in which the cursor is to move.
# pos - Position at which to start search.
-proc tkTextPrevPara {w pos} {
+proc ::tk::TextPrevPara {w pos} {
set pos [$w index "$pos linestart"]
while {1} {
if {([string equal [$w get "$pos - 1 line"] "\n"] \
@@ -855,7 +881,7 @@ proc tkTextPrevPara {w pos} {
}
}
-# tkTextNextPara --
+# ::tk::TextNextPara --
# Returns the index of the beginning of the paragraph just after a given
# position in the text (the beginning of a paragraph is the first non-blank
# character after a blank line).
@@ -864,7 +890,7 @@ proc tkTextPrevPara {w pos} {
# w - The text window in which the cursor is to move.
# start - Position at which to start search.
-proc tkTextNextPara {w start} {
+proc ::tk::TextNextPara {w start} {
set pos [$w index "$start linestart + 1 line"]
while {[string compare [$w get $pos] "\n"]} {
if {[$w compare $pos == end]} {
@@ -885,7 +911,7 @@ proc tkTextNextPara {w start} {
return $pos
}
-# tkTextScrollPages --
+# ::tk::TextScrollPages --
# This is a utility procedure used in bindings for moving up and down
# pages and possibly extending the selection along the way. It scrolls
# the view in the widget by the number of pages, and it returns the
@@ -897,7 +923,7 @@ proc tkTextNextPara {w start} {
# count - Number of pages forward to scroll; may be negative
# to scroll backwards.
-proc tkTextScrollPages {w count} {
+proc ::tk::TextScrollPages {w count} {
set bbox [$w bbox insert]
$w yview scroll $count pages
if {[string equal $bbox ""]} {
@@ -906,7 +932,7 @@ proc tkTextScrollPages {w count} {
return [$w index @[lindex $bbox 0],[lindex $bbox 1]]
}
-# tkTextTranspose --
+# ::tk::TextTranspose --
# This procedure implements the "transpose" function for text 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
@@ -916,7 +942,7 @@ proc tkTextScrollPages {w count} {
# Arguments:
# w - Text window in which to transpose.
-proc tkTextTranspose w {
+proc ::tk::TextTranspose w {
set pos insert
if {[$w compare $pos != "$pos lineend"]} {
set pos [$w index "$pos + 1 char"]
@@ -930,21 +956,21 @@ proc tkTextTranspose w {
$w see insert
}
-# tk_textCopy --
+# ::tk_textCopy --
# This procedure copies the selection from a text widget into the
# clipboard.
#
# Arguments:
# w - Name of a text widget.
-proc tk_textCopy w {
+proc ::tk_textCopy w {
if {![catch {set data [$w get sel.first sel.last]}]} {
clipboard clear -displayof $w
clipboard append -displayof $w $data
}
}
-# tk_textCut --
+# ::tk_textCut --
# This procedure copies the selection from a text widget into the
# clipboard, then deletes the selection (if it exists in the given
# widget).
@@ -952,7 +978,7 @@ proc tk_textCopy w {
# Arguments:
# w - Name of a text widget.
-proc tk_textCut w {
+proc ::tk_textCut w {
if {![catch {set data [$w get sel.first sel.last]}]} {
clipboard clear -displayof $w
clipboard append -displayof $w $data
@@ -960,26 +986,33 @@ proc tk_textCut w {
}
}
-# tk_textPaste --
+# ::tk_textPaste --
# This procedure pastes the contents of the clipboard to the insertion
# point in a text widget.
#
# Arguments:
# w - Name of a text widget.
-proc tk_textPaste w {
+proc ::tk_textPaste w {
global tcl_platform
- catch {
- if {[string compare $tcl_platform(platform) "unix"]} {
- catch {
- $w delete sel.first sel.last
- }
+ if {![catch {::tk::GetSelection $w CLIPBOARD} sel]} {
+ set oldSeparator [$w cget -autoseparators]
+ if { $oldSeparator } {
+ $w configure -autoseparators 0
+ $w edit separator
+ }
+ if {[string compare [tk windowingsystem] "x11"]} {
+ catch { $w delete sel.first sel.last }
+ }
+ $w insert insert $sel
+ if { $oldSeparator } {
+ $w edit separator
+ $w configure -autoseparators 1
}
- $w insert insert [selection get -displayof $w -selection CLIPBOARD]
}
}
-# tkTextNextWord --
+# ::tk::TextNextWord --
# Returns the index of the next word position after a given position in the
# text. 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
@@ -990,17 +1023,17 @@ proc tk_textPaste w {
# start - Position at which to start search.
if {[string equal $tcl_platform(platform) "windows"]} {
- proc tkTextNextWord {w start} {
- tkTextNextPos $w [tkTextNextPos $w $start tcl_endOfWord] \
+ proc ::tk::TextNextWord {w start} {
+ TextNextPos $w [TextNextPos $w $start tcl_endOfWord] \
tcl_startOfNextWord
}
} else {
- proc tkTextNextWord {w start} {
- tkTextNextPos $w $start tcl_endOfWord
+ proc ::tk::TextNextWord {w start} {
+ TextNextPos $w $start tcl_endOfWord
}
}
-# tkTextNextPos --
+# ::tk::TextNextPos --
# Returns the index of the next position after the given starting
# position in the text as computed by a specified function.
#
@@ -1009,7 +1042,7 @@ if {[string equal $tcl_platform(platform) "windows"]} {
# start - Position at which to start search.
# op - Function to use to find next position.
-proc tkTextNextPos {w start op} {
+proc ::tk::TextNextPos {w start op} {
set text ""
set cur $start
while {[$w compare $cur < end]} {
@@ -1029,7 +1062,7 @@ proc tkTextNextPos {w start op} {
return end
}
-# tkTextPrevPos --
+# ::tk::TextPrevPos --
# Returns the index of the previous position before the given starting
# position in the text as computed by a specified function.
#
@@ -1038,7 +1071,7 @@ proc tkTextNextPos {w start op} {
# start - Position at which to start search.
# op - Function to use to find next position.
-proc tkTextPrevPos {w start op} {
+proc ::tk::TextPrevPos {w start op} {
set text ""
set cur $start
while {[$w compare $cur > 0.0]} {
@@ -1064,4 +1097,40 @@ proc tkTextPrevPos {w start op} {
return 0.0
}
+# ::tk::TextScanMark --
+#
+# Marks the start of a possible scan drag operation
+#
+# Arguments:
+# w - The text window from which the text to get
+# x - x location on screen
+# y - y location on screen
+proc ::tk::TextScanMark {w x y} {
+ $w scan mark $x $y
+ set ::tk::Priv(x) $x
+ set ::tk::Priv(y) $y
+ set ::tk::Priv(mouseMoved) 0
+}
+
+# ::tk::TextScanDrag --
+#
+# Marks the start of a possible scan drag operation
+#
+# Arguments:
+# w - The text window from which the text to get
+# x - x location on screen
+# y - y location on screen
+
+proc ::tk::TextScanDrag {w x y} {
+ # Make sure these exist, as some weird situations can trigger the
+ # motion binding without the initial press. [Bug #220269]
+ if {![info exists ::tk::Priv(x)]} { set ::tk::Priv(x) $x }
+ if {![info exists ::tk::Priv(y)]} { set ::tk::Priv(y) $y }
+ if {($x != $::tk::Priv(x)) || ($y != $::tk::Priv(y))} {
+ set ::tk::Priv(mouseMoved) 1
+ }
+ if {[info exists ::tk::Priv(mouseMoved)] && $::tk::Priv(mouseMoved)} {
+ $w scan dragto $x $y
+ }
+}
diff --git a/tk/library/tk.tcl b/tk/library/tk.tcl
index 37335cd23af..add0cd50878 100644
--- a/tk/library/tk.tcl
+++ b/tk/library/tk.tcl
@@ -7,32 +7,62 @@
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
-# Copyright (c) 1998-2000 Scriptics Corporation.
+# Copyright (c) 1998-2000 Ajuba Solutions.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# Insist on running with compatible versions of Tcl and Tk.
+package require -exact Tk 8.4
+package require -exact Tcl 8.4
-package require -exact Tk 8.3
-package require -exact Tcl 8.3
+# Create a ::tk namespace
+namespace eval ::tk {
+ # Set up the msgcat commands
+ namespace eval msgcat {
+ namespace export mc mcmax
+ if {[interp issafe] || [catch {package require msgcat}]} {
+ # The msgcat package is not available. Supply our own
+ # minimal replacement.
+ proc mc {src args} {
+ return [eval [list format $src] $args]
+ }
+ proc mcmax {args} {
+ set max 0
+ foreach string $args {
+ set len [string length $string]
+ if {$len>$max} {
+ set max $len
+ }
+ }
+ return $max
+ }
+ } else {
+ # Get the commands from the msgcat package that Tk uses.
+ namespace import ::msgcat::mc
+ namespace import ::msgcat::mcmax
+ ::msgcat::mcload [file join $::tk_library msgs]
+ }
+ }
+ namespace import ::tk::msgcat::*
+}
# Add Tk's directory to the end of the auto-load search path, if it
# isn't already on the path:
-if {[info exists auto_path] && [string compare {} $tk_library] && \
- [lsearch -exact $auto_path $tk_library] < 0} {
- lappend auto_path $tk_library
+if {[info exists ::auto_path] && [string compare {} $::tk_library] && \
+ [lsearch -exact $::auto_path $::tk_library] < 0} {
+ lappend ::auto_path $::tk_library
}
# Turn off strict Motif look and feel as a default.
-set tk_strictMotif 0
+set ::tk_strictMotif 0
-# Create a ::tk namespace
+# Turn on useinputmethods (X Input Methods) by default.
+# We catch this because safe interpreters may not allow the call.
-namespace eval ::tk {
-}
+catch {tk useinputmethods 1}
# ::tk::PlaceWindow --
# place a toplevel at a particular position
@@ -81,6 +111,11 @@ proc ::tk::PlaceWindow {w {place ""} {anchor ""}} {
} elseif {$y > ([winfo screenheight $w]-[winfo reqheight $w])} {
set y [expr {[winfo screenheight $w]-[winfo reqheight $w]}]
}
+ if {[tk windowingsystem] eq "macintosh" \
+ || [tk windowingsystem] eq "aqua"} {
+ # Avoid the native menu bar which sits on top of everything.
+ if {$y < 20} { set y 20 }
+ }
}
wm geometry $w +$x+$y
wm deiconify $w
@@ -104,7 +139,9 @@ proc ::tk::SetFocusGrab {grab {focus {}}} {
if {[winfo exists $oldGrab]} {
lappend data [grab status $oldGrab]
}
- grab $grab
+ # The "grab" command will fail if another application
+ # already holds the grab. So catch it.
+ catch {grab $grab}
if {[winfo exists $focus]} {
focus $focus
}
@@ -121,8 +158,12 @@ proc ::tk::SetFocusGrab {grab {focus {}}} {
#
proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} {
set index "$grab,$focus"
- foreach {oldFocus oldGrab oldStatus} $::tk::FocusGrab($index) { break }
- unset ::tk::FocusGrab($index)
+ if {[info exists ::tk::FocusGrab($index)]} {
+ foreach {oldFocus oldGrab oldStatus} $::tk::FocusGrab($index) { break }
+ unset ::tk::FocusGrab($index)
+ } else {
+ set oldGrab ""
+ }
catch {focus $oldFocus}
grab release $grab
@@ -140,17 +181,49 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} {
}
}
-# tkScreenChanged --
+# ::tk::GetSelection --
+# This tries to obtain the default selection. On Unix, we first try
+# and get a UTF8_STRING, a type supported by modern Unix apps for
+# passing Unicode data safely. We fall back on the default STRING
+# type otherwise. On Windows, only the STRING type is necessary.
+# Arguments:
+# w The widget for which the selection will be retrieved.
+# Important for the -displayof property.
+# sel The source of the selection (PRIMARY or CLIPBOARD)
+# Results:
+# Returns the selection, or an error if none could be found
+#
+if {[string equal $tcl_platform(platform) "unix"]} {
+ proc ::tk::GetSelection {w {sel PRIMARY}} {
+ if {[catch {selection get -displayof $w -selection $sel \
+ -type UTF8_STRING} txt] \
+ && [catch {selection get -displayof $w -selection $sel} txt]} {
+ return -code error "could not find default selection"
+ } else {
+ return $txt
+ }
+ }
+} else {
+ proc ::tk::GetSelection {w {sel PRIMARY}} {
+ if {[catch {selection get -displayof $w -selection $sel} txt]} {
+ return -code error "could not find default selection"
+ } else {
+ return $txt
+ }
+ }
+}
+
+# ::tk::ScreenChanged --
# This procedure is invoked by the binding mechanism whenever the
# "current" screen is changing. The procedure does two things.
-# First, it uses "upvar" to make global variable "tkPriv" point at an
+# First, it uses "upvar" to make variable "::tk::Priv" point at an
# array variable that holds state for the current display. Second,
# it initializes the array if it didn't already exist.
#
# Arguments:
# screen - The name of the new screen.
-proc tkScreenChanged screen {
+proc ::tk::ScreenChanged screen {
set x [string last . $screen]
if {$x > 0} {
set disp [string range $screen 0 [expr {$x - 1}]]
@@ -158,15 +231,15 @@ proc tkScreenChanged screen {
set disp $screen
}
- uplevel #0 upvar #0 tkPriv.$disp tkPriv
- global tkPriv
+ uplevel #0 upvar #0 ::tk::Priv.$disp ::tk::Priv
+ variable ::tk::Priv
global tcl_platform
- if {[info exists tkPriv]} {
- set tkPriv(screen) $screen
+ if {[info exists Priv]} {
+ set Priv(screen) $screen
return
}
- array set tkPriv {
+ array set Priv {
activeMenu {}
activeItem {}
afterId {}
@@ -188,26 +261,26 @@ proc tkScreenChanged screen {
prevPos 0
selectMode char
}
- set tkPriv(screen) $screen
- set tkPriv(tearoff) [string equal $tcl_platform(platform) "unix"]
- set tkPriv(window) {}
+ set Priv(screen) $screen
+ set Priv(tearoff) [string equal [tk windowingsystem] "x11"]
+ set Priv(window) {}
}
-# Do initial setup for tkPriv, so that it is always bound to something
+# Do initial setup for Priv, so that it is always bound to something
# (otherwise, if someone references it, it may get set to a non-upvar-ed
# value, which will cause trouble later).
-tkScreenChanged [winfo screen .]
+tk::ScreenChanged [winfo screen .]
-# tkEventMotifBindings --
-# This procedure is invoked as a trace whenever tk_strictMotif is
+# ::tk::EventMotifBindings --
+# This procedure is invoked as a trace whenever ::tk_strictMotif is
# changed. It is used to turn on or turn off the motif virtual
# bindings.
#
# Arguments:
-# n1 - the name of the variable being changed ("tk_strictMotif").
+# n1 - the name of the variable being changed ("::tk_strictMotif").
-proc tkEventMotifBindings {n1 dummy dummy} {
+proc ::tk::EventMotifBindings {n1 dummy dummy} {
upvar $n1 name
if {$name} {
@@ -219,6 +292,7 @@ proc tkEventMotifBindings {n1 dummy dummy} {
event $op <<Cut>> <Control-Key-w>
event $op <<Copy>> <Meta-Key-w>
event $op <<Paste>> <Control-Key-y>
+ event $op <<Undo>> <Control-underscore>
}
#----------------------------------------------------------------------
@@ -227,36 +301,36 @@ proc tkEventMotifBindings {n1 dummy dummy} {
#----------------------------------------------------------------------
if {[string equal [info commands tk_chooseColor] ""]} {
- proc tk_chooseColor {args} {
- return [eval tkColorDialog $args]
+ proc ::tk_chooseColor {args} {
+ return [eval tk::dialog::color:: $args]
}
}
if {[string equal [info commands tk_getOpenFile] ""]} {
- proc tk_getOpenFile {args} {
+ proc ::tk_getOpenFile {args} {
if {$::tk_strictMotif} {
- return [eval tkMotifFDialog open $args]
+ return [eval tk::MotifFDialog open $args]
} else {
- return [eval ::tk::dialog::file::tkFDialog open $args]
+ return [eval ::tk::dialog::file:: open $args]
}
}
}
if {[string equal [info commands tk_getSaveFile] ""]} {
- proc tk_getSaveFile {args} {
+ proc ::tk_getSaveFile {args} {
if {$::tk_strictMotif} {
- return [eval tkMotifFDialog save $args]
+ return [eval tk::MotifFDialog save $args]
} else {
- return [eval ::tk::dialog::file::tkFDialog save $args]
+ return [eval ::tk::dialog::file:: save $args]
}
}
}
if {[string equal [info commands tk_messageBox] ""]} {
- proc tk_messageBox {args} {
- return [eval tkMessageBox $args]
+ proc ::tk_messageBox {args} {
+ return [eval tk::MessageBox $args]
}
}
if {[string equal [info command tk_chooseDirectory] ""]} {
- proc tk_chooseDirectory {args} {
- return [eval ::tk::dialog::file::chooseDir::tkChooseDirectory $args]
+ proc ::tk_chooseDirectory {args} {
+ return [eval ::tk::dialog::file::chooseDir:: $args]
}
}
@@ -264,12 +338,14 @@ if {[string equal [info command tk_chooseDirectory] ""]} {
# Define the set of common virtual events.
#----------------------------------------------------------------------
-switch $tcl_platform(platform) {
- "unix" {
+switch [tk windowingsystem] {
+ "x11" {
event add <<Cut>> <Control-Key-x> <Key-F20>
event add <<Copy>> <Control-Key-c> <Key-F16>
event add <<Paste>> <Control-Key-v> <Key-F18>
event add <<PasteSelection>> <ButtonRelease-2>
+ event add <<Undo>> <Control-Key-z>
+ event add <<Redo>> <Control-Key-Z>
# Some OS's define a goofy (as in, not <Shift-Tab>) keysym
# that is returned when the user presses <Shift-Tab>. In order for
# tab traversal to work, we have to add these keysyms to the
@@ -280,73 +356,104 @@ switch $tcl_platform(platform) {
switch $tcl_platform(os) {
"IRIX" -
"Linux" { event add <<PrevWindow>> <ISO_Left_Tab> }
- "HP-UX" { event add <<PrevWindow>> <hpBackTab> }
+ "HP-UX" {
+ # This seems to be correct on *some* HP systems.
+ catch { event add <<PrevWindow>> <hpBackTab> }
+ }
}
}
- trace variable tk_strictMotif w tkEventMotifBindings
- set tk_strictMotif $tk_strictMotif
+ trace variable ::tk_strictMotif w ::tk::EventMotifBindings
+ set ::tk_strictMotif $::tk_strictMotif
}
- "windows" {
+ "win32" {
event add <<Cut>> <Control-Key-x> <Shift-Key-Delete>
event add <<Copy>> <Control-Key-c> <Control-Key-Insert>
event add <<Paste>> <Control-Key-v> <Shift-Key-Insert>
event add <<PasteSelection>> <ButtonRelease-2>
+ event add <<Undo>> <Control-Key-z>
+ event add <<Redo>> <Control-Key-y>
}
- "macintosh" {
+ "aqua" {
+ event add <<Cut>> <Command-Key-x> <Key-F2>
+ event add <<Copy>> <Command-Key-c> <Key-F3>
+ event add <<Paste>> <Command-Key-v> <Key-F4>
+ event add <<PasteSelection>> <ButtonRelease-2>
+ event add <<Clear>> <Clear>
+ event add <<Undo>> <Command-Key-z>
+ event add <<Redo>> <Command-Key-y>
+ }
+ "classic" {
event add <<Cut>> <Control-Key-x> <Key-F2>
event add <<Copy>> <Control-Key-c> <Key-F3>
event add <<Paste>> <Control-Key-v> <Key-F4>
event add <<PasteSelection>> <ButtonRelease-2>
event add <<Clear>> <Clear>
+ event add <<Undo>> <Control-Key-z> <Key-F1>
+ event add <<Redo>> <Control-Key-Z>
}
}
-
# ----------------------------------------------------------------------
# Read in files that define all of the class bindings.
# ----------------------------------------------------------------------
-if {[string compare $tcl_platform(platform) "macintosh"] && \
- [string compare {} $tk_library]} {
- source [file join $tk_library button.tcl]
- source [file join $tk_library entry.tcl]
- source [file join $tk_library listbox.tcl]
- source [file join $tk_library menu.tcl]
- source [file join $tk_library scale.tcl]
- source [file join $tk_library scrlbar.tcl]
- source [file join $tk_library text.tcl]
+if {$::tk_library ne ""} {
+ if {[string equal $tcl_platform(platform) "macintosh"]} {
+ proc ::tk::SourceLibFile {file} {
+ if {[catch {
+ namespace eval :: \
+ [list source [file join $::tk_library $file.tcl]]
+ }]} {
+ namespace eval :: [list source -rsrc $file]
+ }
+ }
+ } else {
+ proc ::tk::SourceLibFile {file} {
+ namespace eval :: [list source [file join $::tk_library $file.tcl]]
+ }
+ }
+ namespace eval ::tk {
+ SourceLibFile button
+ SourceLibFile entry
+ SourceLibFile listbox
+ SourceLibFile menu
+ SourceLibFile panedwindow
+ SourceLibFile scale
+ SourceLibFile scrlbar
+ SourceLibFile spinbox
+ SourceLibFile text
+ }
}
-
# ----------------------------------------------------------------------
# Default bindings for keyboard traversal.
# ----------------------------------------------------------------------
event add <<PrevWindow>> <Shift-Tab>
-bind all <Tab> {tkTabToWindow [tk_focusNext %W]}
-bind all <<PrevWindow>> {tkTabToWindow [tk_focusPrev %W]}
+bind all <Tab> {tk::TabToWindow [tk_focusNext %W]}
+bind all <<PrevWindow>> {tk::TabToWindow [tk_focusPrev %W]}
-# tkCancelRepeat --
+# ::tk::CancelRepeat --
# This procedure is invoked to cancel an auto-repeat action described
-# by tkPriv(afterId). It's used by several widgets to auto-scroll
+# by ::tk::Priv(afterId). It's used by several widgets to auto-scroll
# the widget when the mouse is dragged out of the widget with a
# button pressed.
#
# Arguments:
# None.
-proc tkCancelRepeat {} {
- global tkPriv
- after cancel $tkPriv(afterId)
- set tkPriv(afterId) {}
+proc ::tk::CancelRepeat {} {
+ variable ::tk::Priv
+ after cancel $Priv(afterId)
+ set Priv(afterId) {}
}
-# tkTabToWindow --
+# ::tk::TabToWindow --
# This procedure moves the focus to the given widget. If the widget
# is an entry, it selects the entire contents of the widget.
#
# Arguments:
# w - Window to which focus should be set.
-proc tkTabToWindow {w} {
+proc ::tk::TabToWindow {w} {
if {[string equal [winfo class $w] Entry]} {
$w selection range 0 end
$w icursor end
@@ -354,4 +461,120 @@ proc tkTabToWindow {w} {
focus $w
}
+# ::tk::UnderlineAmpersand --
+# This procedure takes some text with ampersand and returns
+# text w/o ampersand and position of the ampersand.
+# Double ampersands are converted to single ones.
+# Position returned is -1 when there is no ampersand.
+#
+proc ::tk::UnderlineAmpersand {text} {
+ set idx [string first "&" $text]
+ if {$idx >= 0} {
+ set underline $idx
+ # ignore "&&"
+ while {[string match "&" [string index $text [expr {$idx + 1}]]]} {
+ set base [expr {$idx + 2}]
+ set idx [string first "&" [string range $text $base end]]
+ if {$idx < 0} {
+ break
+ } else {
+ set underline [expr {$underline + $idx + 1}]
+ incr idx $base
+ }
+ }
+ }
+ if {$idx >= 0} {
+ regsub -all -- {&([^&])} $text {\1} text
+ }
+ return [list $text $idx]
+}
+
+# ::tk::SetAmpText --
+# Given widget path and text with "magic ampersands",
+# sets -text and -underline options for the widget
+#
+proc ::tk::SetAmpText {widget text} {
+ foreach {newtext under} [::tk::UnderlineAmpersand $text] {
+ $widget configure -text $newtext -underline $under
+ }
+}
+# ::tk::AmpWidget --
+# Creates new widget, turning -text option into -text and
+# -underline options, returned by ::tk::UnderlineAmpersand.
+#
+proc ::tk::AmpWidget {class path args} {
+ set wcmd [list $class $path]
+ foreach {opt val} $args {
+ if {[string equal $opt {-text}]} {
+ foreach {newtext under} [::tk::UnderlineAmpersand $val] {
+ lappend wcmd -text $newtext -underline $under
+ }
+ } else {
+ lappend wcmd $opt $val
+ }
+ }
+ eval $wcmd
+ if {$class=="button"} {
+ bind $path <<AltUnderlined>> [list $path invoke]
+ }
+ return $path
+}
+
+# ::tk::FindAltKeyTarget --
+# search recursively through the hierarchy of visible widgets
+# to find button or label which has $char as underlined character
+#
+proc ::tk::FindAltKeyTarget {path char} {
+ switch [winfo class $path] {
+ Button -
+ Label {
+ if {[string equal -nocase $char \
+ [string index [$path cget -text] \
+ [$path cget -underline]]]} {return $path} else {return {}}
+ }
+ default {
+ foreach child \
+ [concat [grid slaves $path] \
+ [pack slaves $path] \
+ [place slaves $path] ] {
+ if {""!=[set target [::tk::FindAltKeyTarget $child $char]]} {
+ return $target
+ }
+ }
+ }
+ }
+ return {}
+}
+
+# ::tk::AltKeyInDialog --
+# <Alt-Key> event handler for standard dialogs. Sends <<AltUnderlined>>
+# to button or label which has appropriate underlined character
+#
+proc ::tk::AltKeyInDialog {path key} {
+ set target [::tk::FindAltKeyTarget $path $key]
+ if { $target == ""} return
+ event generate $target <<AltUnderlined>>
+}
+
+# ::tk::mcmaxamp --
+# Replacement for mcmax, used for texts with "magic ampersand" in it.
+#
+
+proc ::tk::mcmaxamp {args} {
+ set maxlen 0
+ foreach arg $args {
+ set length [string length [lindex [::tk::UnderlineAmpersand [mc $arg]] 0]]
+ if {$length>$maxlen} {
+ set maxlen $length
+ }
+ }
+ return $maxlen
+}
+# For now, turn off the custom mdef proc for the mac:
+
+if {[string equal [tk windowingsystem] "aqua"]} {
+ namespace eval ::tk::mac {
+ set useCustomMDEF 0
+ }
+}
diff --git a/tk/library/tkfbox.tcl b/tk/library/tkfbox.tcl
index a0f48bcbc5a..256447abfb2 100644
--- a/tk/library/tkfbox.tcl
+++ b/tk/library/tkfbox.tcl
@@ -7,7 +7,7 @@
# The "TK" standard file selection dialog box is similar to the
# file selection dialog box on Win95(TM). The user can navigate
# the directories by clicking on the folder icons or by
-# selectinf the "Directory" option menu. The user can select
+# selecting the "Directory" option menu. The user can select
# files by clicking on the file icons or by entering a filename
# in the "Filename:" entry.
#
@@ -24,49 +24,197 @@
# I C O N L I S T
#
# This is a pseudo-widget that implements the icon list inside the
-# tkFDialog dialog box.
+# ::tk::dialog::file:: dialog box.
#
#----------------------------------------------------------------------
-# tkIconList --
+# ::tk::IconList --
#
# Creates an IconList widget.
#
-proc tkIconList {w args} {
- upvar #0 $w data
+proc ::tk::IconList {w args} {
+ IconList_Config $w $args
+ IconList_Create $w
+}
+
+proc ::tk::IconList_Index {w i} {
+ upvar #0 ::tk::$w data
+ upvar #0 ::tk::$w:itemList itemList
+ if {![info exists data(list)]} {set data(list) {}}
+ switch -regexp -- $i {
+ "^-?[0-9]+$" {
+ if { $i < 0 } {
+ set i 0
+ }
+ if { $i >= [llength $data(list)] } {
+ set i [expr {[llength $data(list)] - 1}]
+ }
+ return $i
+ }
+ "^active$" {
+ return $data(index,active)
+ }
+ "^anchor$" {
+ return $data(index,anchor)
+ }
+ "^end$" {
+ return [llength $data(list)]
+ }
+ "@-?[0-9]+,-?[0-9]+" {
+ foreach {x y} [scan $i "@%d,%d"] {
+ break
+ }
+ set item [$data(canvas) find closest $x $y]
+ return [lindex [$data(canvas) itemcget $item -tags] 1]
+ }
+ }
+}
+
+proc ::tk::IconList_Selection {w op args} {
+ upvar ::tk::$w data
+ switch -exact -- $op {
+ "anchor" {
+ if { [llength $args] == 1 } {
+ set data(index,anchor) [tk::IconList_Index $w [lindex $args 0]]
+ } else {
+ return $data(index,anchor)
+ }
+ }
+ "clear" {
+ if { [llength $args] == 2 } {
+ foreach {first last} $args {
+ break
+ }
+ } elseif { [llength $args] == 1 } {
+ set first [set last [lindex $args 0]]
+ } else {
+ error "wrong # args: should be [lindex [info level 0] 0] path\
+ clear first ?last?"
+ }
+ set first [IconList_Index $w $first]
+ set last [IconList_Index $w $last]
+ if { $first > $last } {
+ set tmp $first
+ set first $last
+ set last $tmp
+ }
+ set ind 0
+ foreach item $data(selection) {
+ if { $item >= $first } {
+ set first $ind
+ break
+ }
+ }
+ set ind [expr {[llength $data(selection)] - 1}]
+ for {} {$ind >= 0} {incr ind -1} {
+ set item [lindex $data(selection) $ind]
+ if { $item <= $last } {
+ set last $ind
+ break
+ }
+ }
+
+ if { $first > $last } {
+ return
+ }
+ set data(selection) [lreplace $data(selection) $first $last]
+ event generate $w <<ListboxSelect>>
+ IconList_DrawSelection $w
+ }
+ "includes" {
+ set index [lsearch -exact $data(selection) [lindex $args 0]]
+ return [expr {$index != -1}]
+ }
+ "set" {
+ if { [llength $args] == 2 } {
+ foreach {first last} $args {
+ break
+ }
+ } elseif { [llength $args] == 1 } {
+ set last [set first [lindex $args 0]]
+ } else {
+ error "wrong # args: should be [lindex [info level 0] 0] path\
+ set first ?last?"
+ }
- tkIconList_Config $w $args
- tkIconList_Create $w
+ set first [IconList_Index $w $first]
+ set last [IconList_Index $w $last]
+ if { $first > $last } {
+ set tmp $first
+ set first $last
+ set last $tmp
+ }
+ for {set i $first} {$i <= $last} {incr i} {
+ lappend data(selection) $i
+ }
+ set data(selection) [lsort -integer -unique $data(selection)]
+ event generate $w <<ListboxSelect>>
+ IconList_DrawSelection $w
+ }
+ }
+}
+
+proc ::tk::IconList_Curselection {w} {
+ upvar ::tk::$w data
+ return $data(selection)
}
-# tkIconList_Config --
+proc ::tk::IconList_DrawSelection {w} {
+ upvar ::tk::$w data
+ upvar ::tk::$w:itemList itemList
+
+ $data(canvas) delete selection
+ foreach item $data(selection) {
+ set rTag [lindex [lindex $data(list) $item] 2]
+ foreach {iTag tTag text serial} $itemList($rTag) {
+ break
+ }
+
+ set bbox [$data(canvas) bbox $tTag]
+ $data(canvas) create rect $bbox -fill \#a0a0ff -outline \#a0a0ff \
+ -tags selection
+ }
+ $data(canvas) lower selection
+ return
+}
+
+proc ::tk::IconList_Get {w item} {
+ upvar ::tk::$w data
+ upvar ::tk::$w:itemList itemList
+ set rTag [lindex [lindex $data(list) $item] 2]
+ foreach {iTag tTag text serial} $itemList($rTag) {
+ break
+ }
+ return $text
+}
+
+# ::tk::IconList_Config --
#
# Configure the widget variables of IconList, according to the command
# line arguments.
#
-proc tkIconList_Config {w argList} {
- upvar #0 $w data
+proc ::tk::IconList_Config {w argList} {
# 1: the configuration specs
#
set specs {
- {-browsecmd "" "" ""}
{-command "" "" ""}
+ {-multiple "" "" "0"}
}
# 2: parse the arguments
#
- tclParseConfigSpec $w $specs "" $argList
+ tclParseConfigSpec ::tk::$w $specs "" $argList
}
-# tkIconList_Create --
+# ::tk::IconList_Create --
#
# Creates an IconList widget by assembling a canvas widget and a
# scrollbar widget. Sets all the bindings necessary for the IconList's
# operations.
#
-proc tkIconList_Create {w} {
- upvar #0 $w data
+proc ::tk::IconList_Create {w} {
+ upvar ::tk::$w data
frame $w
set data(sbar) [scrollbar $w.sbar -orient horizontal \
@@ -88,34 +236,39 @@ proc tkIconList_Create {w} {
set data(numItems) 0
set data(curItem) {}
set data(noScroll) 1
+ set data(selection) {}
+ set data(index,anchor) ""
# Creates the event bindings.
#
- bind $data(canvas) <Configure> [list tkIconList_Arrange $w]
-
- bind $data(canvas) <1> [list tkIconList_Btn1 $w %x %y]
- bind $data(canvas) <B1-Motion> [list tkIconList_Motion1 $w %x %y]
- bind $data(canvas) <B1-Leave> [list tkIconList_Leave1 $w %x %y]
- bind $data(canvas) <B1-Enter> [list tkCancelRepeat]
- bind $data(canvas) <ButtonRelease-1> [list tkCancelRepeat]
+ bind $data(canvas) <Configure> [list tk::IconList_Arrange $w]
+
+ bind $data(canvas) <1> [list tk::IconList_Btn1 $w %x %y]
+ bind $data(canvas) <B1-Motion> [list tk::IconList_Motion1 $w %x %y]
+ bind $data(canvas) <B1-Leave> [list tk::IconList_Leave1 $w %x %y]
+ bind $data(canvas) <Control-1> [list tk::IconList_CtrlBtn1 $w %x %y]
+ bind $data(canvas) <Shift-1> [list tk::IconList_ShiftBtn1 $w %x %y]
+ bind $data(canvas) <B1-Enter> [list tk::CancelRepeat]
+ bind $data(canvas) <ButtonRelease-1> [list tk::CancelRepeat]
bind $data(canvas) <Double-ButtonRelease-1> \
- [list tkIconList_Double1 $w %x %y]
-
- bind $data(canvas) <Up> [list tkIconList_UpDown $w -1]
- bind $data(canvas) <Down> [list tkIconList_UpDown $w 1]
- bind $data(canvas) <Left> [list tkIconList_LeftRight $w -1]
- bind $data(canvas) <Right> [list tkIconList_LeftRight $w 1]
- bind $data(canvas) <Return> [list tkIconList_ReturnKey $w]
- bind $data(canvas) <KeyPress> [list tkIconList_KeyPress $w %A]
+ [list tk::IconList_Double1 $w %x %y]
+
+ bind $data(canvas) <Up> [list tk::IconList_UpDown $w -1]
+ bind $data(canvas) <Down> [list tk::IconList_UpDown $w 1]
+ bind $data(canvas) <Left> [list tk::IconList_LeftRight $w -1]
+ bind $data(canvas) <Right> [list tk::IconList_LeftRight $w 1]
+ bind $data(canvas) <Return> [list tk::IconList_ReturnKey $w]
+ bind $data(canvas) <KeyPress> [list tk::IconList_KeyPress $w %A]
bind $data(canvas) <Control-KeyPress> ";"
bind $data(canvas) <Alt-KeyPress> ";"
- bind $data(canvas) <FocusIn> [list tkIconList_FocusIn $w]
+ bind $data(canvas) <FocusIn> [list tk::IconList_FocusIn $w]
+ bind $data(canvas) <FocusOut> [list tk::IconList_FocusOut $w]
return $w
}
-# tkIconList_AutoScan --
+# ::tk::IconList_AutoScan --
#
# This procedure is invoked when the mouse leaves an entry window
# with button 1 down. It scrolls the window up, down, left, or
@@ -126,13 +279,13 @@ proc tkIconList_Create {w} {
# Arguments:
# w - The IconList window.
#
-proc tkIconList_AutoScan {w} {
- upvar #0 $w data
- global tkPriv
+proc ::tk::IconList_AutoScan {w} {
+ upvar ::tk::$w data
+ variable ::tk::Priv
if {![winfo exists $w]} return
- set x $tkPriv(x)
- set y $tkPriv(y)
+ set x $Priv(x)
+ set y $Priv(y)
if {$data(noScroll)} {
return
@@ -149,16 +302,16 @@ proc tkIconList_AutoScan {w} {
return
}
- tkIconList_Motion1 $w $x $y
- set tkPriv(afterId) [after 50 [list tkIconList_AutoScan $w]]
+ IconList_Motion1 $w $x $y
+ set Priv(afterId) [after 50 [list tk::IconList_AutoScan $w]]
}
# Deletes all the items inside the canvas subwidget and reset the IconList's
# state.
#
-proc tkIconList_DeleteAll {w} {
- upvar #0 $w data
- upvar #0 $w:itemList itemList
+proc ::tk::IconList_DeleteAll {w} {
+ upvar ::tk::$w data
+ upvar ::tk::$w:itemList itemList
$data(canvas) delete all
catch {unset data(selected)}
@@ -172,52 +325,64 @@ proc tkIconList_DeleteAll {w} {
set data(numItems) 0
set data(curItem) {}
set data(noScroll) 1
+ set data(selection) {}
+ set data(index,anchor) ""
$data(sbar) set 0.0 1.0
$data(canvas) xview moveto 0
}
# Adds an icon into the IconList with the designated image and text
#
-proc tkIconList_Add {w image text} {
- upvar #0 $w data
- upvar #0 $w:itemList itemList
- upvar #0 $w:textList textList
-
- set iTag [$data(canvas) create image 0 0 -image $image -anchor nw]
- set tTag [$data(canvas) create text 0 0 -text $text -anchor nw \
- -font $data(font)]
- set rTag [$data(canvas) create rect 0 0 0 0 -fill "" -outline ""]
+proc ::tk::IconList_Add {w image items} {
+ upvar ::tk::$w data
+ upvar ::tk::$w:itemList itemList
+ upvar ::tk::$w:textList textList
+
+ foreach text $items {
+ set iTag [$data(canvas) create image 0 0 -image $image -anchor nw \
+ -tags [list icon $data(numItems) item$data(numItems)]]
+ set tTag [$data(canvas) create text 0 0 -text $text -anchor nw \
+ -font $data(font) \
+ -tags [list text $data(numItems) item$data(numItems)]]
+ set rTag [$data(canvas) create rect 0 0 0 0 -fill "" -outline "" \
+ -tags [list rect $data(numItems) item$data(numItems)]]
+
+ foreach {x1 y1 x2 y2} [$data(canvas) bbox $iTag] {
+ break
+ }
+ set iW [expr {$x2 - $x1}]
+ set iH [expr {$y2 - $y1}]
+ if {$data(maxIW) < $iW} {
+ set data(maxIW) $iW
+ }
+ if {$data(maxIH) < $iH} {
+ set data(maxIH) $iH
+ }
- set b [$data(canvas) bbox $iTag]
- set iW [expr {[lindex $b 2]-[lindex $b 0]}]
- set iH [expr {[lindex $b 3]-[lindex $b 1]}]
- if {$data(maxIW) < $iW} {
- set data(maxIW) $iW
- }
- if {$data(maxIH) < $iH} {
- set data(maxIH) $iH
- }
+ foreach {x1 y1 x2 y2} [$data(canvas) bbox $tTag] {
+ break
+ }
+ set tW [expr {$x2 - $x1}]
+ set tH [expr {$y2 - $y1}]
+ if {$data(maxTW) < $tW} {
+ set data(maxTW) $tW
+ }
+ if {$data(maxTH) < $tH} {
+ set data(maxTH) $tH
+ }
- set b [$data(canvas) bbox $tTag]
- set tW [expr {[lindex $b 2]-[lindex $b 0]}]
- set tH [expr {[lindex $b 3]-[lindex $b 1]}]
- if {$data(maxTW) < $tW} {
- set data(maxTW) $tW
+ lappend data(list) [list $iTag $tTag $rTag $iW $iH $tW \
+ $tH $data(numItems)]
+ set itemList($rTag) [list $iTag $tTag $text $data(numItems)]
+ set textList($data(numItems)) [string tolower $text]
+ incr data(numItems)
}
- if {$data(maxTH) < $tH} {
- set data(maxTH) $tH
- }
-
- lappend data(list) [list $iTag $tTag $rTag $iW $iH $tW $tH $data(numItems)]
- set itemList($rTag) [list $iTag $tTag $text $data(numItems)]
- set textList($data(numItems)) [string tolower $text]
- incr data(numItems)
}
# Places the icons in a column-major arrangement.
#
-proc tkIconList_Arrange {w} {
- upvar #0 $w data
+proc ::tk::IconList_Arrange {w} {
+ upvar ::tk::$w data
if {![info exists data(list)]} {
if {[info exists data(canvas)] && [winfo exists $data(canvas)]} {
@@ -252,20 +417,15 @@ proc tkIconList_Arrange {w} {
set usedColumn 0
foreach sublist $data(list) {
set usedColumn 1
- set iTag [lindex $sublist 0]
- set tTag [lindex $sublist 1]
- set rTag [lindex $sublist 2]
- set iW [lindex $sublist 3]
- set iH [lindex $sublist 4]
- set tW [lindex $sublist 5]
- set tH [lindex $sublist 6]
+ foreach {iTag tTag rTag iW iH tW tH} $sublist {
+ break
+ }
set i_dy [expr {($dy - $iH)/2}]
set t_dy [expr {($dy - $tH)/2}]
$data(canvas) coords $iTag $x [expr {$y + $i_dy}]
$data(canvas) coords $tTag [expr {$x + $shift}] [expr {$y + $t_dy}]
- $data(canvas) coords $tTag [expr {$x + $shift}] [expr {$y + $t_dy}]
$data(canvas) coords $rTag $x $y [expr {$x+$dx}] [expr {$y+$dy}]
incr y $dy
@@ -299,28 +459,28 @@ proc tkIconList_Arrange {w} {
}
if {$data(curItem) != ""} {
- tkIconList_Select $w [lindex [lindex $data(list) $data(curItem)] 2] 0
+ IconList_Select $w [lindex [lindex $data(list) $data(curItem)] 2] 0
}
}
# Gets called when the user invokes the IconList (usually by double-clicking
# or pressing the Return key).
#
-proc tkIconList_Invoke {w} {
- upvar #0 $w data
+proc ::tk::IconList_Invoke {w} {
+ upvar ::tk::$w data
- if {$data(-command) != "" && [info exists data(selected)]} {
+ if {$data(-command) != "" && [llength $data(selection)]} {
uplevel #0 $data(-command)
}
}
-# tkIconList_See --
+# ::tk::IconList_See --
#
# If the item is not (completely) visible, scroll the canvas so that
# it becomes visible.
-proc tkIconList_See {w rTag} {
- upvar #0 $w data
- upvar #0 $w:itemList itemList
+proc ::tk::IconList_See {w rTag} {
+ upvar ::tk::$w data
+ upvar ::tk::$w:itemList itemList
if {$data(noScroll)} {
return
@@ -330,12 +490,11 @@ proc tkIconList_See {w rTag} {
return
}
- if {![info exists itemList($rTag)]} {
+ if { $rTag < 0 || $rTag >= [llength $data(list)] } {
return
}
-
- set bbox [$data(canvas) bbox $rTag]
+ set bbox [$data(canvas) bbox item$rTag]
set pad [expr {[$data(canvas) cget -highlightthickness] + \
[$data(canvas) cget -bd]}]
@@ -367,117 +526,107 @@ proc tkIconList_See {w rTag} {
}
}
-proc tkIconList_SelectAtXY {w x y} {
- upvar #0 $w data
-
- tkIconList_Select $w [$data(canvas) find closest \
- [$data(canvas) canvasx $x] [$data(canvas) canvasy $y]]
-}
+proc ::tk::IconList_Btn1 {w x y} {
+ upvar ::tk::$w data
-proc tkIconList_Select {w rTag {callBrowse 1}} {
- upvar #0 $w data
- upvar #0 $w:itemList itemList
-
- if {![info exists itemList($rTag)]} {
- return
- }
- set iTag [lindex $itemList($rTag) 0]
- set tTag [lindex $itemList($rTag) 1]
- set text [lindex $itemList($rTag) 2]
- set serial [lindex $itemList($rTag) 3]
-
- if {![info exists data(rect)]} {
- set data(rect) [$data(canvas) create rect 0 0 0 0 \
- -fill #a0a0ff -outline #a0a0ff]
- }
- $data(canvas) lower $data(rect)
- set bbox [$data(canvas) bbox $tTag]
- eval [list $data(canvas) coords $data(rect)] $bbox
-
- set data(curItem) $serial
- set data(selected) $text
-
- if {$callBrowse && $data(-browsecmd) != ""} {
- eval $data(-browsecmd) [list $text]
- }
+ focus $data(canvas)
+ set x [expr {int([$data(canvas) canvasx $x])}]
+ set y [expr {int([$data(canvas) canvasy $y])}]
+ set i [IconList_Index $w @${x},${y}]
+ if {$i==""} return
+ IconList_Selection $w clear 0 end
+ IconList_Selection $w set $i
+ IconList_Selection $w anchor $i
}
-proc tkIconList_Unselect {w} {
- upvar #0 $w data
-
- if {[info exists data(rect)]} {
- $data(canvas) delete $data(rect)
- unset data(rect)
- }
- if {[info exists data(selected)]} {
- unset data(selected)
+proc ::tk::IconList_CtrlBtn1 {w x y} {
+ upvar ::tk::$w data
+
+ if { $data(-multiple) } {
+ focus $data(canvas)
+ set x [expr {int([$data(canvas) canvasx $x])}]
+ set y [expr {int([$data(canvas) canvasy $y])}]
+ set i [IconList_Index $w @${x},${y}]
+ if {$i==""} return
+ if { [IconList_Selection $w includes $i] } {
+ IconList_Selection $w clear $i
+ } else {
+ IconList_Selection $w set $i
+ IconList_Selection $w anchor $i
+ }
}
- #set data(curItem) {}
}
-# Returns the selected item
-#
-proc tkIconList_Get {w} {
- upvar #0 $w data
-
- if {[info exists data(selected)]} {
- return $data(selected)
- } else {
- return ""
+proc ::tk::IconList_ShiftBtn1 {w x y} {
+ upvar ::tk::$w data
+
+ if { $data(-multiple) } {
+ focus $data(canvas)
+ set x [expr {int([$data(canvas) canvasx $x])}]
+ set y [expr {int([$data(canvas) canvasy $y])}]
+ set i [IconList_Index $w @${x},${y}]
+ if {$i==""} return
+ set a [IconList_Index $w anchor]
+ if { [string equal $a ""] } {
+ set a $i
+ }
+ IconList_Selection $w clear 0 end
+ IconList_Selection $w set $a $i
}
}
-
-proc tkIconList_Btn1 {w x y} {
- upvar #0 $w data
-
- focus $data(canvas)
- tkIconList_SelectAtXY $w $x $y
-}
-
# Gets called on button-1 motions
#
-proc tkIconList_Motion1 {w x y} {
- global tkPriv
- set tkPriv(x) $x
- set tkPriv(y) $y
-
- tkIconList_SelectAtXY $w $x $y
+proc ::tk::IconList_Motion1 {w x y} {
+ upvar ::tk::$w data
+ variable ::tk::Priv
+ set Priv(x) $x
+ set Priv(y) $y
+ set x [expr {int([$data(canvas) canvasx $x])}]
+ set y [expr {int([$data(canvas) canvasy $y])}]
+ set i [IconList_Index $w @${x},${y}]
+ if {$i==""} return
+ IconList_Selection $w clear 0 end
+ IconList_Selection $w set $i
}
-proc tkIconList_Double1 {w x y} {
- upvar #0 $w data
+proc ::tk::IconList_Double1 {w x y} {
+ upvar ::tk::$w data
- if {[string compare $data(curItem) {}]} {
- tkIconList_Invoke $w
+ if {[llength $data(selection)]} {
+ IconList_Invoke $w
}
}
-proc tkIconList_ReturnKey {w} {
- tkIconList_Invoke $w
+proc ::tk::IconList_ReturnKey {w} {
+ IconList_Invoke $w
}
-proc tkIconList_Leave1 {w x y} {
- global tkPriv
+proc ::tk::IconList_Leave1 {w x y} {
+ variable ::tk::Priv
- set tkPriv(x) $x
- set tkPriv(y) $y
- tkIconList_AutoScan $w
+ set Priv(x) $x
+ set Priv(y) $y
+ IconList_AutoScan $w
}
-proc tkIconList_FocusIn {w} {
- upvar #0 $w data
+proc ::tk::IconList_FocusIn {w} {
+ upvar ::tk::$w data
if {![info exists data(list)]} {
return
}
- if {[string compare $data(curItem) {}]} {
- tkIconList_Select $w [lindex [lindex $data(list) $data(curItem)] 2] 1
+ if {[llength $data(selection)]} {
+ IconList_DrawSelection $w
}
}
-# tkIconList_UpDown --
+proc ::tk::IconList_FocusOut {w} {
+ IconList_Selection $w clear 0 end
+}
+
+# ::tk::IconList_UpDown --
#
# Moves the active element up or down by one element
#
@@ -485,30 +634,28 @@ proc tkIconList_FocusIn {w} {
# w - The IconList widget.
# amount - +1 to move down one item, -1 to move back one item.
#
-proc tkIconList_UpDown {w amount} {
- upvar #0 $w data
+proc ::tk::IconList_UpDown {w amount} {
+ upvar ::tk::$w data
if {![info exists data(list)]} {
return
}
- if {[string equal $data(curItem) {}]} {
- set rTag [lindex [lindex $data(list) 0] 2]
+ set curr [tk::IconList_Curselection $w]
+ if { [llength $curr] == 0 } {
+ set i 0
} else {
- set oldRTag [lindex [lindex $data(list) $data(curItem)] 2]
- set rTag [lindex [lindex $data(list) [expr {$data(curItem)+$amount}]] 2]
- if {[string equal $rTag ""]} {
- set rTag $oldRTag
- }
- }
-
- if {[string compare $rTag ""]} {
- tkIconList_Select $w $rTag
- tkIconList_See $w $rTag
- }
+ set i [tk::IconList_Index $w anchor]
+ if {$i==""} return
+ incr i $amount
+ }
+ IconList_Selection $w clear 0 end
+ IconList_Selection $w set $i
+ IconList_Selection $w anchor $i
+ IconList_See $w $i
}
-# tkIconList_LeftRight --
+# ::tk::IconList_LeftRight --
#
# Moves the active element left or right by one column
#
@@ -516,52 +663,49 @@ proc tkIconList_UpDown {w amount} {
# w - The IconList widget.
# amount - +1 to move right one column, -1 to move left one column.
#
-proc tkIconList_LeftRight {w amount} {
- upvar #0 $w data
+proc ::tk::IconList_LeftRight {w amount} {
+ upvar ::tk::$w data
if {![info exists data(list)]} {
return
}
- if {[string equal $data(curItem) {}]} {
- set rTag [lindex [lindex $data(list) 0] 2]
- } else {
- set oldRTag [lindex [lindex $data(list) $data(curItem)] 2]
- set newItem [expr {$data(curItem)+($amount*$data(itemsPerColumn))}]
- set rTag [lindex [lindex $data(list) $newItem] 2]
- if {[string equal $rTag ""]} {
- set rTag $oldRTag
- }
- }
- if {[string compare $rTag ""]} {
- tkIconList_Select $w $rTag
- tkIconList_See $w $rTag
- }
+ set curr [IconList_Curselection $w]
+ if { [llength $curr] == 0 } {
+ set i 0
+ } else {
+ set i [IconList_Index $w anchor]
+ if {$i==""} return
+ incr i [expr {$amount*$data(itemsPerColumn)}]
+ }
+ IconList_Selection $w clear 0 end
+ IconList_Selection $w set $i
+ IconList_Selection $w anchor $i
+ IconList_See $w $i
}
#----------------------------------------------------------------------
# Accelerator key bindings
#----------------------------------------------------------------------
-# tkIconList_KeyPress --
+# ::tk::IconList_KeyPress --
#
# Gets called when user enters an arbitrary key in the listbox.
#
-proc tkIconList_KeyPress {w key} {
- global tkPriv
+proc ::tk::IconList_KeyPress {w key} {
+ variable ::tk::Priv
- append tkPriv(ILAccel,$w) $key
- tkIconList_Goto $w $tkPriv(ILAccel,$w)
+ append Priv(ILAccel,$w) $key
+ IconList_Goto $w $Priv(ILAccel,$w)
catch {
- after cancel $tkPriv(ILAccel,$w,afterId)
+ after cancel $Priv(ILAccel,$w,afterId)
}
- set tkPriv(ILAccel,$w,afterId) [after 500 [list tkIconList_Reset $w]]
+ set Priv(ILAccel,$w,afterId) [after 500 [list tk::IconList_Reset $w]]
}
-proc tkIconList_Goto {w text} {
- upvar #0 $w data
- upvar #0 $w:textList textList
- global tkPriv
+proc ::tk::IconList_Goto {w text} {
+ upvar ::tk::$w data
+ upvar ::tk::$w:textList textList
if {![info exists data(list)]} {
return
@@ -602,16 +746,17 @@ proc tkIconList_Goto {w text} {
}
if {$theIndex > -1} {
- set rTag [lindex [lindex $data(list) $theIndex] 2]
- tkIconList_Select $w $rTag
- tkIconList_See $w $rTag
+ IconList_Selection $w clear 0 end
+ IconList_Selection $w set $theIndex
+ IconList_Selection $w anchor $theIndex
+ IconList_See $w $theIndex
}
}
-proc tkIconList_Reset {w} {
- global tkPriv
+proc ::tk::IconList_Reset {w} {
+ variable ::tk::Priv
- catch {unset tkPriv(ILAccel,$w)}
+ catch {unset Priv(ILAccel,$w)}
}
#----------------------------------------------------------------------
@@ -621,9 +766,11 @@ proc tkIconList_Reset {w} {
#----------------------------------------------------------------------
namespace eval ::tk::dialog {}
-namespace eval ::tk::dialog::file {}
+namespace eval ::tk::dialog::file {
+ namespace import ::tk::msgcat::*
+}
-# ::tk::dialog::file::tkFDialog --
+# ::tk::dialog::file:: --
#
# Implements the TK file selection dialog. This dialog is used when
# the tk_strictMotif flag is set to false. This procedure shouldn't
@@ -634,8 +781,8 @@ namespace eval ::tk::dialog::file {}
# args Options parsed by the procedure.
#
-proc ::tk::dialog::file::tkFDialog {type args} {
- global tkPriv
+proc ::tk::dialog::file:: {type args} {
+ variable ::tk::Priv
set dataName __tk_filedialog
upvar ::tk::dialog::file::$dataName data
@@ -665,8 +812,19 @@ proc ::tk::dialog::file::tkFDialog {type args} {
set data(typeMenu) $data(typeMenuBtn).m
set data(okBtn) $w.f2.ok
set data(cancelBtn) $w.f3.cancel
+ ::tk::dialog::file::SetSelectMode $w $data(-multiple)
+ }
+
+ # Dialog boxes should be transient with respect to their parent,
+ # so that they will always stay on top of their parent window. However,
+ # some window managers will create the window as withdrawn if the parent
+ # window is withdrawn or iconified. Combined with the grab we put on the
+ # window, this can hang the entire application. Therefore we only make
+ # the dialog transient if the parent is viewable.
+
+ if {[winfo viewable [winfo toplevel $data(-parent)]] } {
+ wm transient $w $data(-parent)
}
- wm transient $w $data(-parent)
# Add traces on the selectPath variable
#
@@ -716,7 +874,7 @@ proc ::tk::dialog::file::tkFDialog {type args} {
# may take the focus away so we can't redirect it. Finally,
# restore any grab that was in effect.
- tkwait variable tkPriv(selectFilePath)
+ vwait ::tk::Priv(selectFilePath)
::tk::RestoreFocusGrab $w $data(ent) withdraw
@@ -728,7 +886,7 @@ proc ::tk::dialog::file::tkFDialog {type args} {
}
$data(dirMenuBtn) configure -textvariable {}
- return $tkPriv(selectFilePath)
+ return $Priv(selectFilePath)
}
# ::tk::dialog::file::Config --
@@ -759,6 +917,12 @@ proc ::tk::dialog::file::Config {dataName type argList} {
{-title "" "" ""}
}
+ # The "-multiple" option is only available for the "open" file dialog.
+ #
+ if { [string equal $type "open"] } {
+ lappend specs {-multiple "" "" "0"}
+ }
+
# 2: default values depending on the type of the dialog
#
if {![info exists data(selectPath)]} {
@@ -773,9 +937,9 @@ proc ::tk::dialog::file::Config {dataName type argList} {
if {$data(-title) == ""} {
if {[string equal $type "open"]} {
- set data(-title) "Open"
+ set data(-title) "[mc "Open"]"
} else {
- set data(-title) "Save As"
+ set data(-title) "[mc "Save As"]"
}
}
@@ -797,29 +961,42 @@ proc ::tk::dialog::file::Config {dataName type argList} {
# 5. Parse the -filetypes option
#
- set data(-filetypes) [tkFDGetFileTypes $data(-filetypes)]
+ set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)]
if {![winfo exists $data(-parent)]} {
error "bad window path name \"$data(-parent)\""
}
+
+ # Set -multiple to a one or zero value (not other boolean types
+ # like "yes") so we can use it in tests more easily.
+ if {![string compare $type save]} {
+ set data(-multiple) 0
+ } elseif {$data(-multiple)} {
+ set data(-multiple) 1
+ } else {
+ set data(-multiple) 0
+ }
}
proc ::tk::dialog::file::Create {w class} {
set dataName [lindex [split $w .] end]
upvar ::tk::dialog::file::$dataName data
- global tk_library tkPriv
+ variable ::tk::Priv
+ global tk_library
toplevel $w -class $class
# f1: the frame with the directory option menu
#
set f1 [frame $w.f1]
- label $f1.lab -text "Directory:" -under 0
+ bind [::tk::AmpWidget label $f1.lab -text "[mc "&Directory:"]" ] \
+ <<AltUnderlined>> [list focus $f1.menu]
+
set data(dirMenuBtn) $f1.menu
set data(dirMenu) [tk_optionMenu $f1.menu [format %s(selectPath) ::tk::dialog::file::$dataName] ""]
set data(upBtn) [button $f1.up]
- if {![info exists tkPriv(updirImage)]} {
- set tkPriv(updirImage) [image create bitmap -data {
+ if {![info exists Priv(updirImage)]} {
+ set Priv(updirImage) [image create bitmap -data {
#define updir_width 28
#define updir_height 16
static char updir_bits[] = {
@@ -830,7 +1007,7 @@ static char updir_bits[] = {
0x10, 0xfe, 0x07, 0x01, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01,
0xf0, 0xff, 0xff, 0x01};}]
}
- $data(upBtn) config -image $tkPriv(updirImage)
+ $data(upBtn) config -image $Priv(updirImage)
$f1.menu config -takefocus 1 -highlightthickness 2
@@ -841,29 +1018,36 @@ static char updir_bits[] = {
# data(icons): the IconList that list the files and directories.
#
if { [string equal $class TkFDialog] } {
- set fNameCaption "File name:"
- set fNameUnder 5
+ if { $data(-multiple) } {
+ set fNameCaption "[mc {File &names:}]"
+ } else {
+ set fNameCaption "[mc {File &name:}]"
+ }
+ set fTypeCaption [mc "Files of &type:"]
+ set fCaptionWidth [::tk::mcmaxamp $fNameCaption $fTypeCaption]
+ set fCaptionWidth [expr {$fCaptionWidth<14?14:$fCaptionWidth}]
set iconListCommand [list ::tk::dialog::file::OkCmd $w]
} else {
- set fNameCaption "Selection:"
- set fNameUnder 0
+ set fNameCaption [mc "&Selection:"]
+ set fCaptionWidth [string length $fNameCaption]
set iconListCommand [list ::tk::dialog::file::chooseDir::DblClick $w]
}
- set data(icons) [tkIconList $w.icons \
- -browsecmd [list ::tk::dialog::file::ListBrowse $w] \
- -command $iconListCommand]
+ set data(icons) [::tk::IconList $w.icons \
+ -command $iconListCommand \
+ -multiple $data(-multiple)]
+ bind $data(icons) <<ListboxSelect>> \
+ [list ::tk::dialog::file::ListBrowse $w]
# f2: the frame with the OK button and the "file name" field
#
set f2 [frame $w.f2 -bd 0]
- label $f2.lab -text $fNameCaption -anchor e -width 14 \
- -under $fNameUnder -pady 0
+ bind [::tk::AmpWidget label $f2.lab -text $fNameCaption -anchor e -width $fCaptionWidth \
+ -pady 0] <<AltUnderlined>> [list focus $f2.ent]
set data(ent) [entry $f2.ent]
# The font to use for the icons. The default Canvas font on Unix
# is just deviant.
- global $w.icons
- set $w.icons(font) [$data(ent) cget -font]
+ set ::tk::$w.icons(font) [$data(ent) cget -font]
# f3: the frame with the cancel button and the file types field
#
@@ -877,8 +1061,8 @@ static char updir_bits[] = {
# use a button widget to emulate a label widget (by setting its
# bindtags)
- set data(typeMenuLab) [button $f3.lab -text "Files of type:" \
- -anchor e -width 14 -under 9 \
+ set data(typeMenuLab) [::tk::AmpWidget button $f3.lab -text $fTypeCaption \
+ -anchor e -width $fCaptionWidth \
-bd [$f2.lab cget -bd] \
-highlightthickness [$f2.lab cget -highlightthickness] \
-relief [$f2.lab cget -relief] \
@@ -886,20 +1070,23 @@ static char updir_bits[] = {
-pady [$f2.lab cget -pady]]
bindtags $data(typeMenuLab) [list $data(typeMenuLab) Label \
[winfo toplevel $data(typeMenuLab)] all]
-
set data(typeMenuBtn) [menubutton $f3.menu -indicatoron 1 \
-menu $f3.menu.m]
set data(typeMenu) [menu $data(typeMenuBtn).m -tearoff 0]
$data(typeMenuBtn) config -takefocus 1 -highlightthickness 2 \
-relief raised -bd 2 -anchor w
+ bind $data(typeMenuLab) <<AltUnderlined>> [list focus \
+ $data(typeMenuBtn)]
}
# the okBtn is created after the typeMenu so that the keyboard traversal
# is in the right order
- set data(okBtn) [button $f2.ok -text OK -under 0 -width 6 \
- -default active -pady 3]
- set data(cancelBtn) [button $f3.cancel -text Cancel -under 0 -width 6\
- -default normal -pady 3]
+ set maxWidth [::tk::mcmaxamp &OK &Cancel]
+ set maxWidth [expr {$maxWidth<6?6:$maxWidth}]
+ set data(okBtn) [::tk::AmpWidget button $f2.ok -text "[mc "&OK"]" \
+ -width $maxWidth -default active -pady 3]
+ set data(cancelBtn) [::tk::AmpWidget button $f3.cancel -text "[mc "&Cancel"]" \
+ -width $maxWidth -default normal -pady 3]
# pack the widgets in f2 and f3
#
@@ -926,10 +1113,8 @@ static char updir_bits[] = {
wm protocol $w WM_DELETE_WINDOW [list ::tk::dialog::file::CancelCmd $w]
$data(upBtn) config -command [list ::tk::dialog::file::UpDirCmd $w]
$data(cancelBtn) config -command [list ::tk::dialog::file::CancelCmd $w]
- bind $w <KeyPress-Escape> [list tkButtonInvoke $data(cancelBtn)]
- bind $w <Alt-c> [list tkButtonInvoke $data(cancelBtn)]
- bind $w <Alt-d> [list focus $data(dirMenuBtn)]
-
+ bind $w <KeyPress-Escape> [list tk::ButtonInvoke $data(cancelBtn)]
+ bind $w <Alt-Key> [list tk::AltKeyInDialog $w %A]
# Set up event handlers specific to File or Directory Dialogs
#
@@ -941,22 +1126,45 @@ static char updir_bits[] = {
focus %s
}
} $data(typeMenuBtn) $data(typeMenuBtn)]
- bind $w <Alt-n> [list focus $data(ent)]
- bind $w <Alt-o> [list ::tk::dialog::file::InvokeBtn $w Open]
- bind $w <Alt-s> [list ::tk::dialog::file::InvokeBtn $w Save]
} else {
set okCmd [list ::tk::dialog::file::chooseDir::OkCmd $w]
bind $data(ent) <Return> $okCmd
$data(okBtn) config -command $okCmd
bind $w <Alt-s> [list focus $data(ent)]
- bind $w <Alt-o> [list tkButtonInvoke $data(okBtn)]
+ bind $w <Alt-o> [list tk::ButtonInvoke $data(okBtn)]
}
# Build the focus group for all the entries
#
- tkFocusGroup_Create $w
- tkFocusGroup_BindIn $w $data(ent) [list ::tk::dialog::file::EntFocusIn $w]
- tkFocusGroup_BindOut $w $data(ent) [list ::tk::dialog::file::EntFocusOut $w]
+ ::tk::FocusGroup_Create $w
+ ::tk::FocusGroup_BindIn $w $data(ent) [list ::tk::dialog::file::EntFocusIn $w]
+ ::tk::FocusGroup_BindOut $w $data(ent) [list ::tk::dialog::file::EntFocusOut $w]
+}
+
+# ::tk::dialog::file::SetSelectMode --
+#
+# Set the select mode of the dialog to single select or multi-select.
+#
+# Arguments:
+# w The dialog path.
+# multi 1 if the dialog is multi-select; 0 otherwise.
+#
+# Results:
+# None.
+
+proc ::tk::dialog::file::SetSelectMode {w multi} {
+ set dataName __tk_filedialog
+ upvar ::tk::dialog::file::$dataName data
+ if { $multi } {
+ set fNameCaption "[mc {File &names:}]"
+ } else {
+ set fNameCaption "[mc {File &name:}]"
+ }
+ set iconListCommand [list ::tk::dialog::file::OkCmd $w]
+ ::tk::SetAmpText $w.f2.lab $fNameCaption
+ ::tk::IconList_Config $data(icons) \
+ [list -multiple $multi -command $iconListCommand]
+ return
}
# ::tk::dialog::file::UpdateWhenIdle --
@@ -997,19 +1205,20 @@ proc ::tk::dialog::file::Update {w} {
set dataName [winfo name $w]
upvar ::tk::dialog::file::$dataName data
- global tk_library tkPriv
+ variable ::tk::Priv
+ global tk_library
catch {unset data(updateId)}
- if {![info exists tkPriv(folderImage)]} {
- set tkPriv(folderImage) [image create photo -data {
+ if {![info exists Priv(folderImage)]} {
+ set Priv(folderImage) [image create photo -data {
R0lGODlhEAAMAKEAAAD//wAAAPD/gAAAACH5BAEAAAAALAAAAAAQAAwAAAIghINhyycvVFsB
QtmS3rjaH1Hg141WaT5ouprt2HHcUgAAOw==}]
- set tkPriv(fileImage) [image create photo -data {
+ set Priv(fileImage) [image create photo -data {
R0lGODlhDAAMAKEAALLA3AAAAP//8wAAACH5BAEAAAAALAAAAAAMAAwAAAIgRI4Ha+IfWHsO
rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
}
- set folder $tkPriv(folderImage)
- set file $tkPriv(fileImage)
+ set folder $Priv(folderImage)
+ set file $Priv(fileImage)
set appPWD [pwd]
if {[catch {
@@ -1020,7 +1229,7 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
# we normally won't come to here. Anyways, give an error and abort
# action.
tk_messageBox -type ok -parent $w -message \
- "Cannot change to the directory \"$data(selectPath)\".\nPermission denied."\
+ "[mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $data(selectPath)]"\
-icon warning
cd $appPWD
return
@@ -1035,11 +1244,13 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
$w config -cursor watch
update idletasks
- tkIconList_DeleteAll $data(icons)
+ ::tk::IconList_DeleteAll $data(icons)
# Make the dir list
#
- foreach f [lsort -dictionary [glob -nocomplain .* *]] {
+ set completeFileList [lsort -dictionary -unique [glob -nocomplain .* *]]
+ set dirList {}
+ foreach f $completeFileList {
if {[string equal $f .]} {
continue
}
@@ -1047,34 +1258,36 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
continue
}
if {[file isdir ./$f]} {
- if {![info exists hasDoneDir($f)]} {
- tkIconList_Add $data(icons) $folder $f
- set hasDoneDir($f) 1
- }
+ lappend dirList $f
}
}
+ ::tk::IconList_Add $data(icons) $folder $dirList
if { [string equal $class TkFDialog] } {
# Make the file list if this is a File Dialog
#
if {[string equal $data(filter) *]} {
- set files [lsort -dictionary \
- [glob -nocomplain .* *]]
+ set files $completeFileList
} else {
- set files [lsort -dictionary \
- [eval glob -nocomplain $data(filter)]]
+ set files {}
+ foreach f $completeFileList {
+ foreach pat $data(filter) {
+ if { [string match $pat $f] } {
+ lappend files $f
+ break
+ }
+ }
+ }
}
-
+ set fileList {}
foreach f $files {
if {![file isdir ./$f]} {
- if {![info exists hasDoneFile($f)]} {
- tkIconList_Add $data(icons) $file $f
- set hasDoneFile($f) 1
- }
+ lappend fileList $f
}
}
+ ::tk::IconList_Add $data(icons) $file $fileList
}
- tkIconList_Arrange $data(icons)
+ ::tk::IconList_Arrange $data(icons)
# Update the Directory: option menu
#
@@ -1099,9 +1312,19 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}]
# Restore the Open/Save Button if this is a File Dialog
#
if {[string equal $data(type) open]} {
- $data(okBtn) config -text "Open"
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
+ set maxWidth [::tk::mcmaxamp [mc "&Open"]]
+ if {$maxWidth>[$data(okBtn) cget -width]} {
+ $data(okBtn) config -width $maxWidth
+ $data(cancelBtn) config -width $maxWidth
+ }
} else {
- $data(okBtn) config -text "Save"
+ ::tk::SetAmpText $data(okBtn) [mc "&Save"]
+ set maxWidth [::tk::mcmaxamp [mc "&Save"]]
+ if {$maxWidth>[$data(okBtn) cget -width]} {
+ $data(okBtn) config -width $maxWidth
+ $data(cancelBtn) config -width $maxWidth
+ }
}
}
@@ -1142,11 +1365,34 @@ proc ::tk::dialog::file::SetPath {w name1 name2 op} {
#
proc ::tk::dialog::file::SetFilter {w type} {
upvar ::tk::dialog::file::[winfo name $w] data
- upvar \#0 $data(icons) icons
+ upvar ::tk::$data(icons) icons
set data(filter) [lindex $type 1]
$data(typeMenuBtn) config -text [lindex $type 0] -indicatoron 1
+ # If we aren't using a default extension, use the one suppled
+ # by the filter.
+ if {![info exists data(extUsed)]} {
+ if {[string length $data(-defaultextension)]} {
+ set data(extUsed) 1
+ } else {
+ set data(extUsed) 0
+ }
+ }
+
+ if {!$data(extUsed)} {
+ # Get the first extension in the list that matches {^\*\.\w+$}
+ # and remove all * from the filter.
+ set index [lsearch -regexp $data(filter) {^\*\.\w+$}]
+ if {$index >= 0} {
+ set data(-defaultextension) \
+ [string trimleft [lindex $data(filter) $index] "*"]
+ } else {
+ # Couldn't find anything! Reset to a safe default...
+ set data(-defaultextension) ""
+ }
+ }
+
$icons(sbar) set 0.0 0.0
::tk::dialog::file::UpdateWhenIdle $w
@@ -1264,14 +1510,12 @@ proc ::tk::dialog::file::EntFocusIn {w} {
$data(ent) selection clear
}
- tkIconList_Unselect $data(icons)
-
if { [string equal [winfo class $w] TkFDialog] } {
# If this is a File Dialog, make sure the buttons are labeled right.
if {[string equal $data(type) open]} {
- $data(okBtn) config -text "Open"
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
} else {
- $data(okBtn) config -text "Save"
+ ::tk::SetAmpText $data(okBtn) [mc "&Save"]
}
}
}
@@ -1288,12 +1532,32 @@ proc ::tk::dialog::file::EntFocusOut {w} {
proc ::tk::dialog::file::ActivateEnt {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- set text [string trim [$data(ent) get]]
- set list [::tk::dialog::file::ResolveFile $data(selectPath) $text \
- $data(-defaultextension)]
- set flag [lindex $list 0]
- set path [lindex $list 1]
- set file [lindex $list 2]
+ set text [$data(ent) get]
+ if {$data(-multiple)} {
+ # For the multiple case we have to be careful to get the file
+ # names as a true list, watching out for a single file with a
+ # space in the name. Thus we query the IconList directly.
+
+ set data(selectFile) ""
+ foreach item [::tk::IconList_Curselection $data(icons)] {
+ ::tk::dialog::file::VerifyFileName $w \
+ [::tk::IconList_Get $data(icons) $item]
+ }
+ } else {
+ ::tk::dialog::file::VerifyFileName $w $text
+ }
+}
+
+# Verification procedure
+#
+proc ::tk::dialog::file::VerifyFileName {w filename} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set list [::tk::dialog::file::ResolveFile $data(selectPath) $filename \
+ $data(-defaultextension)]
+ foreach {flag path file} $list {
+ break
+ }
switch -- $flag {
OK {
@@ -1303,7 +1567,11 @@ proc ::tk::dialog::file::ActivateEnt {w} {
$data(ent) delete 0 end
} else {
::tk::dialog::file::SetPathSilently $w $path
- set data(selectFile) $file
+ if {$data(-multiple)} {
+ lappend data(selectFile) $file
+ } else {
+ set data(selectFile) $file
+ }
::tk::dialog::file::Done $w
}
}
@@ -1314,31 +1582,35 @@ proc ::tk::dialog::file::ActivateEnt {w} {
FILE {
if {[string equal $data(type) open]} {
tk_messageBox -icon warning -type ok -parent $w \
- -message "File \"[file join $path $file]\" does not exist."
+ -message "[mc "File \"%1\$s\" does not exist." [file join $path $file]]"
$data(ent) selection range 0 end
$data(ent) icursor end
} else {
::tk::dialog::file::SetPathSilently $w $path
- set data(selectFile) $file
+ if {$data(-multiple)} {
+ lappend data(selectFile) $file
+ } else {
+ set data(selectFile) $file
+ }
::tk::dialog::file::Done $w
}
}
PATH {
tk_messageBox -icon warning -type ok -parent $w \
- -message "Directory \"$path\" does not exist."
+ -message "[mc "Directory \"%1\$s\" does not exist." $path]"
$data(ent) selection range 0 end
$data(ent) icursor end
}
CHDIR {
tk_messageBox -type ok -parent $w -message \
- "Cannot change to the directory \"$path\".\nPermission denied."\
+ "[mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $path]"\
-icon warning
$data(ent) selection range 0 end
$data(ent) icursor end
}
ERROR {
tk_messageBox -type ok -parent $w -message \
- "Invalid file name \"$path\"."\
+ "[mc "Invalid file name \"%1\$s\"." $path]"\
-icon warning
$data(ent) selection range 0 end
$data(ent) icursor end
@@ -1352,7 +1624,7 @@ proc ::tk::dialog::file::InvokeBtn {w key} {
upvar ::tk::dialog::file::[winfo name $w] data
if {[string equal [$data(okBtn) cget -text] $key]} {
- tkButtonInvoke $data(okBtn)
+ ::tk::ButtonInvoke $data(okBtn)
}
}
@@ -1377,18 +1649,22 @@ proc ::tk::dialog::file::JoinFile {path file} {
}
}
-
-
# Gets called when user presses the "OK" button
#
proc ::tk::dialog::file::OkCmd {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- set text [tkIconList_Get $data(icons)]
- if {[string compare $text ""]} {
- set file [::tk::dialog::file::JoinFile $data(selectPath) $text]
+ set filenames {}
+ foreach item [::tk::IconList_Curselection $data(icons)] {
+ lappend filenames [::tk::IconList_Get $data(icons) $item]
+ }
+
+ if {([llength $filenames] && !$data(-multiple)) || \
+ ($data(-multiple) && ([llength $filenames] == 1))} {
+ set filename [lindex $filenames 0]
+ set file [::tk::dialog::file::JoinFile $data(selectPath) $filename]
if {[file isdirectory $file]} {
- ::tk::dialog::file::ListInvoke $w $text
+ ::tk::dialog::file::ListInvoke $w [list $filename]
return
}
}
@@ -1400,36 +1676,53 @@ proc ::tk::dialog::file::OkCmd {w} {
#
proc ::tk::dialog::file::CancelCmd {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- global tkPriv
+ variable ::tk::Priv
- set tkPriv(selectFilePath) ""
+ set Priv(selectFilePath) ""
}
# Gets called when user browses the IconList widget (dragging mouse, arrow
# keys, etc)
#
-proc ::tk::dialog::file::ListBrowse {w text} {
+proc ::tk::dialog::file::ListBrowse {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- if {[string equal $text ""]} {
+ set text {}
+ foreach item [::tk::IconList_Curselection $data(icons)] {
+ lappend text [::tk::IconList_Get $data(icons) $item]
+ }
+ if {[llength $text] == 0} {
return
}
-
- set file [::tk::dialog::file::JoinFile $data(selectPath) $text]
- if {![file isdirectory $file]} {
+ if { [llength $text] > 1 } {
+ set newtext {}
+ foreach file $text {
+ set fullfile [::tk::dialog::file::JoinFile $data(selectPath) $file]
+ if { ![file isdirectory $fullfile] } {
+ lappend newtext $file
+ }
+ }
+ set text $newtext
+ set isDir 0
+ } else {
+ set text [lindex $text 0]
+ set file [::tk::dialog::file::JoinFile $data(selectPath) $text]
+ set isDir [file isdirectory $file]
+ }
+ if {!$isDir} {
$data(ent) delete 0 end
$data(ent) insert 0 $text
if { [string equal [winfo class $w] TkFDialog] } {
if {[string equal $data(type) open]} {
- $data(okBtn) config -text "Open"
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
} else {
- $data(okBtn) config -text "Save"
+ ::tk::SetAmpText $data(okBtn) [mc "&Save"]
}
}
} else {
if { [string equal [winfo class $w] TkFDialog] } {
- $data(okBtn) config -text "Open"
+ ::tk::SetAmpText $data(okBtn) [mc "&Open"]
}
}
}
@@ -1437,27 +1730,33 @@ proc ::tk::dialog::file::ListBrowse {w text} {
# Gets called when user invokes the IconList widget (double-click,
# Return key, etc)
#
-proc ::tk::dialog::file::ListInvoke {w text} {
+proc ::tk::dialog::file::ListInvoke {w filenames} {
upvar ::tk::dialog::file::[winfo name $w] data
- if {[string equal $text ""]} {
+ if {[llength $filenames] == 0} {
return
}
- set file [::tk::dialog::file::JoinFile $data(selectPath) $text]
+ set file [::tk::dialog::file::JoinFile $data(selectPath) \
+ [lindex $filenames 0]]
+
set class [winfo class $w]
if {[string equal $class TkChooseDir] || [file isdirectory $file]} {
set appPWD [pwd]
if {[catch {cd $file}]} {
tk_messageBox -type ok -parent $w -message \
- "Cannot change to the directory \"$file\".\nPermission denied."\
+ "[mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $file]"\
-icon warning
} else {
cd $appPWD
set data(selectPath) $file
}
} else {
- set data(selectFile) $file
+ if {$data(-multiple)} {
+ set data(selectFile) $filenames
+ } else {
+ set data(selectFile) $file
+ }
::tk::dialog::file::Done $w
}
}
@@ -1466,30 +1765,39 @@ proc ::tk::dialog::file::ListInvoke {w text} {
#
# Gets called when user has input a valid filename. Pops up a
# dialog box to confirm selection when necessary. Sets the
-# tkPriv(selectFilePath) variable, which will break the "tkwait"
-# loop in tkFDialog and return the selected filename to the
+# tk::Priv(selectFilePath) variable, which will break the "vwait"
+# loop in ::tk::dialog::file:: and return the selected filename to the
# script that calls tk_getOpenFile or tk_getSaveFile
#
proc ::tk::dialog::file::Done {w {selectFilePath ""}} {
upvar ::tk::dialog::file::[winfo name $w] data
- global tkPriv
+ variable ::tk::Priv
if {[string equal $selectFilePath ""]} {
- set selectFilePath [::tk::dialog::file::JoinFile $data(selectPath) \
- $data(selectFile)]
- set tkPriv(selectFile) $data(selectFile)
- set tkPriv(selectPath) $data(selectPath)
+ if {$data(-multiple)} {
+ set selectFilePath {}
+ foreach f $data(selectFile) {
+ lappend selectFilePath [::tk::dialog::file::JoinFile \
+ $data(selectPath) $f]
+ }
+ } else {
+ set selectFilePath [::tk::dialog::file::JoinFile \
+ $data(selectPath) $data(selectFile)]
+ }
+
+ set Priv(selectFile) $data(selectFile)
+ set Priv(selectPath) $data(selectPath)
- if {[file exists $selectFilePath] && [string equal $data(type) save]} {
+ if {[string equal $data(type) save]} {
+ if {[file exists $selectFilePath]} {
set reply [tk_messageBox -icon warning -type yesno\
- -parent $w -message "File\
- \"$selectFilePath\" already exists.\nDo\
- you want to overwrite it?"]
+ -parent $w -message \
+ "[mc "File \"%1\$s\" already exists.\nDo you want to overwrite it?" $selectFilePath]"]
if {[string equal $reply "no"]} {
return
+ }
}
}
}
- set tkPriv(selectFilePath) $selectFilePath
+ set Priv(selectFilePath) $selectFilePath
}
-
diff --git a/tk/library/unsupported.tcl b/tk/library/unsupported.tcl
new file mode 100644
index 00000000000..0db34bc8e07
--- /dev/null
+++ b/tk/library/unsupported.tcl
@@ -0,0 +1,297 @@
+# unsupported.tcl --
+#
+# Commands provided by Tk without official support. Use them at your
+# own risk. They may change or go away without notice.
+#
+# RCS: @(#) $Id$
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+# ----------------------------------------------------------------------
+# Unsupported compatibility interface for folks accessing Tk's private
+# commands and variable against recommended usage.
+# ----------------------------------------------------------------------
+
+namespace eval ::tk::unsupported {
+
+ # Map from the old global names of Tk private commands to their
+ # new namespace-encapsulated names.
+
+ variable PrivateCommands
+ array set PrivateCommands {
+ tkButtonAutoInvoke ::tk::ButtonAutoInvoke
+ tkButtonDown ::tk::ButtonDown
+ tkButtonEnter ::tk::ButtonEnter
+ tkButtonInvoke ::tk::ButtonInvoke
+ tkButtonLeave ::tk::ButtonLeave
+ tkButtonUp ::tk::ButtonUp
+ tkCancelRepeat ::tk::CancelRepeat
+ tkCheckRadioDown ::tk::CheckRadioDown
+ tkCheckRadioEnter ::tk::CheckRadioEnter
+ tkCheckRadioInvoke ::tk::CheckRadioInvoke
+ tkColorDialog ::tk::dialog::color::
+ tkColorDialog_BuildDialog ::tk::dialog::color::BuildDialog
+ tkColorDialog_CancelCmd ::tk::dialog::color::CancelCmd
+ tkColorDialog_Config ::tk::dialog::color::Config
+ tkColorDialog_CreateSelector ::tk::dialog::color::CreateSelector
+ tkColorDialog_DrawColorScale ::tk::dialog::color::DrawColorScale
+ tkColorDialog_EnterColorBar ::tk::dialog::color::EnterColorBar
+ tkColorDialog_InitValues ::tk::dialog::color::InitValues
+ tkColorDialog_HandleRGBEntry ::tk::dialog::color::HandleRGBEntry
+ tkColorDialog_HandleSelEntry ::tk::dialog::color::HandleSelEntry
+ tkColorDialog_LeaveColorBar ::tk::dialog::color::LeaveColorBar
+ tkColorDialog_MoveSelector ::tk::dialog::color::MoveSelector
+ tkColorDialog_OkCmd ::tk::dialog::color::OkCmd
+ tkColorDialog_RedrawColorBars ::tk::dialog::color::RedrawColorBars
+ tkColorDialog_RedrawFinalColor ::tk::dialog::color::RedrawFinalColor
+ tkColorDialog_ReleaseMouse ::tk::dialog::color::ReleaseMouse
+ tkColorDialog_ResizeColorBars ::tk::dialog::color::ResizeColorBars
+ tkColorDialog_RgbToX ::tk::dialog::color::RgbToX
+ tkColorDialog_SetRGBValue ::tk::dialog::color::SetRGBValue
+ tkColorDialog_StartMove ::tk::dialog::color::StartMove
+ tkColorDialog_XToRgb ::tk::dialog::color::XToRGB
+ tkConsoleAbout ::tk::ConsoleAbout
+ tkConsoleBind ::tk::ConsoleBind
+ tkConsoleExit ::tk::ConsoleExit
+ tkConsoleHistory ::tk::ConsoleHistory
+ tkConsoleInit ::tk::ConsoleInit
+ tkConsoleInsert ::tk::ConsoleInsert
+ tkConsoleInvoke ::tk::ConsoleInvoke
+ tkConsoleOutput ::tk::ConsoleOutput
+ tkConsolePrompt ::tk::ConsolePrompt
+ tkConsoleSource ::tk::ConsoleSource
+ tkDarken ::tk::Darken
+ tkEntryAutoScan ::tk::EntryAutoScan
+ tkEntryBackspace ::tk::EntryBackspace
+ tkEntryButton1 ::tk::EntryButton1
+ tkEntryClosestGap ::tk::EntryClosestGap
+ tkEntryGetSelection ::tk::EntryGetSelection
+ tkEntryInsert ::tk::EntryInsert
+ tkEntryKeySelect ::tk::EntryKeySelect
+ tkEntryMouseSelect ::tk::EntryMouseSelect
+ tkEntryNextWord ::tk::EntryNextWord
+ tkEntryPaste ::tk::EntryPaste
+ tkEntryPreviousWord ::tk::EntryPreviousWord
+ tkEntrySeeInsert ::tk::EntrySeeInsert
+ tkEntrySetCursor ::tk::EntrySetCursor
+ tkEntryTranspose ::tk::EntryTranspose
+ tkEventMotifBindings ::tk::EventMotifBindings
+ tkFDGetFileTypes ::tk::FDGetFileTypes
+ tkFirstMenu ::tk::FirstMenu
+ tkFocusGroup_BindIn ::tk::FocusGroup_BindIn
+ tkFocusGroup_BindOut ::tk::FocusGroup_BindOut
+ tkFocusGroup_Create ::tk::FocusGroup_Create
+ tkFocusGroup_Destroy ::tk::FocusGroup_Destroy
+ tkFocusGroup_In ::tk::FocusGroup_In
+ tkFocusGroup_Out ::tk::FocusGroup_Out
+ tkFocusOK ::tk::FocusOK
+ tkGenerateMenuSelect ::tk::GenerateMenuSelect
+ tkIconList ::tk::IconList
+ tkIconList_Add ::tk::IconList_Add
+ tkIconList_Arrange ::tk::IconList_Arrange
+ tkIconList_AutoScan ::tk::IconList_AutoScan
+ tkIconList_Btn1 ::tk::IconList_Btn1
+ tkIconList_Config ::tk::IconList_Config
+ tkIconList_Create ::tk::IconList_Create
+ tkIconList_CtrlBtn1 ::tk::IconList_CtrlBtn1
+ tkIconList_Curselection ::tk::IconList_Curselection
+ tkIconList_DeleteAll ::tk::IconList_DeleteAll
+ tkIconList_Double1 ::tk::IconList_Double1
+ tkIconList_DrawSelection ::tk::IconList_DrawSelection
+ tkIconList_FocusIn ::tk::IconList_FocusIn
+ tkIconList_FocusOut ::tk::IconList_FocusOut
+ tkIconList_Get ::tk::IconList_Get
+ tkIconList_Goto ::tk::IconList_Goto
+ tkIconList_Index ::tk::IconList_Index
+ tkIconList_Invoke ::tk::IconList_Invoke
+ tkIconList_KeyPress ::tk::IconList_KeyPress
+ tkIconList_Leave1 ::tk::IconList_Leave1
+ tkIconList_LeftRight ::tk::IconList_LeftRight
+ tkIconList_Motion1 ::tk::IconList_Motion1
+ tkIconList_Reset ::tk::IconList_Reset
+ tkIconList_ReturnKey ::tk::IconList_ReturnKey
+ tkIconList_See ::tk::IconList_See
+ tkIconList_Select ::tk::IconList_Select
+ tkIconList_Selection ::tk::IconList_Selection
+ tkIconList_ShiftBtn1 ::tk::IconList_ShiftBtn1
+ tkIconList_UpDown ::tk::IconList_UpDown
+ tkListbox ::tk::Listbox
+ tkListboxAutoScan ::tk::ListboxAutoScan
+ tkListboxBeginExtend ::tk::ListboxBeginExtend
+ tkListboxBeginSelect ::tk::ListboxBeginSelect
+ tkListboxBeginToggle ::tk::ListboxBeginToggle
+ tkListboxCancel ::tk::ListboxCancel
+ tkListboxDataExtend ::tk::ListboxDataExtend
+ tkListboxExtendUpDown ::tk::ListboxExtendUpDown
+ tkListboxKeyAccel_Goto ::tk::ListboxKeyAccel_Goto
+ tkListboxKeyAccel_Key ::tk::ListboxKeyAccel_Key
+ tkListboxKeyAccel_Reset ::tk::ListboxKeyAccel_Reset
+ tkListboxKeyAccel_Set ::tk::ListboxKeyAccel_Set
+ tkListboxKeyAccel_Unset ::tk::ListboxKeyAccel_Unxet
+ tkListboxMotion ::tk::ListboxMotion
+ tkListboxSelectAll ::tk::ListboxSelectAll
+ tkListboxUpDown ::tk::ListboxUpDown
+ tkListboxBeginToggle ::tk::ListboxBeginToggle
+ tkMbButtonUp ::tk::MbButtonUp
+ tkMbEnter ::tk::MbEnter
+ tkMbLeave ::tk::MbLeave
+ tkMbMotion ::tk::MbMotion
+ tkMbPost ::tk::MbPost
+ tkMenuButtonDown ::tk::MenuButtonDown
+ tkMenuDownArrow ::tk::MenuDownArrow
+ tkMenuDup ::tk::MenuDup
+ tkMenuEscape ::tk::MenuEscape
+ tkMenuFind ::tk::MenuFind
+ tkMenuFindName ::tk::MenuFindName
+ tkMenuFirstEntry ::tk::MenuFirstEntry
+ tkMenuInvoke ::tk::MenuInvoke
+ tkMenuLeave ::tk::MenuLeave
+ tkMenuLeftArrow ::tk::MenuLeftArrow
+ tkMenuMotion ::tk::MenuMotion
+ tkMenuNextEntry ::tk::MenuNextEntry
+ tkMenuNextMenu ::tk::MenuNextMenu
+ tkMenuRightArrow ::tk::MenuRightArrow
+ tkMenuUnpost ::tk::MenuUnpost
+ tkMenuUpArrow ::tk::MenuUpArrow
+ tkMessageBox ::tk::MessageBox
+ tkMotifFDialog ::tk::MotifFDialog
+ tkMotifFDialog_ActivateDList ::tk::MotifFDialog_ActivateDList
+ tkMotifFDialog_ActivateFList ::tk::MotifFDialog_ActivateFList
+ tkMotifFDialog_ActivateFEnt ::tk::MotifFDialog_ActivateFEnt
+ tkMotifFDialog_ActivateSEnt ::tk::MotifFDialog_ActivateSEnt
+ tkMotifFDialog ::tk::MotifFDialog
+ tkMotifFDialog_BrowseDList ::tk::MotifFDialog_BrowseDList
+ tkMotifFDialog_BrowseFList ::tk::MotifFDialog_BrowseFList
+ tkMotifFDialog_BuildUI ::tk::MotifFDialog_BuildUI
+ tkMotifFDialog_CancelCmd ::tk::MotifFDialog_CancelCmd
+ tkMotifFDialog_Config ::tk::MotifFDialog_Config
+ tkMotifFDialog_Create ::tk::MotifFDialog_Create
+ tkMotifFDialog_FileTypes ::tk::MotifFDialog_FileTypes
+ tkMotifFDialog_FilterCmd ::tk::MotifFDialog_FilterCmd
+ tkMotifFDialog_InterpFilter ::tk::MotifFDialog_InterpFilter
+ tkMotifFDialog_LoadFiles ::tk::MotifFDialog_LoadFiles
+ tkMotifFDialog_MakeSList ::tk::MotifFDialog_MakeSList
+ tkMotifFDialog_OkCmd ::tk::MotifFDialog_OkCmd
+ tkMotifFDialog_SetFilter ::tk::MotifFDialog_SetFilter
+ tkMotifFDialog_SetListMode ::tk::MotifFDialog_SetListMode
+ tkMotifFDialog_Update ::tk::MotifFDialog_Update
+ tkPostOverPoint ::tk::PostOverPoint
+ tkRecolorTree ::tk::RecolorTree
+ tkRestoreOldGrab ::tk::RestoreOldGrab
+ tkSaveGrabInfo ::tk::SaveGrabInfo
+ tkScaleActivate ::tk::ScaleActivate
+ tkScaleButtonDown ::tk::ScaleButtonDown
+ tkScaleButton2Down ::tk::ScaleButton2Down
+ tkScaleControlPress ::tk::ScaleControlPress
+ tkScaleDrag ::tk::ScaleDrag
+ tkScaleEndDrag ::tk::ScaleEndDrag
+ tkScaleIncrement ::tk::ScaleIncrement
+ tkScreenChanged ::tk::ScreenChanged
+ tkScrollButtonDown ::tk::ScrollButtonDown
+ tkScrollButton2Down ::tk::ScrollButton2Down
+ tkScrollButtonDrag ::tk::ScrollButtonDrag
+ tkScrollButtonUp ::tk::ScrollButtonUp
+ tkScrollByPages ::tk::ScrollByPages
+ tkScrollByUnits ::tk::ScrollByUnits
+ tkScrollEndDrag ::tk::ScrollEndDrag
+ tkScrollSelect ::tk::ScrollSelect
+ tkScrollStartDrag ::tk::ScrollStartDrag
+ tkScrollTopBottom ::tk::ScrollTopBottom
+ tkScrollToPos ::tk::ScrollToPos
+ tkTabToWindow ::tk::TabToWindow
+ tkTearOffMenu ::tk::TearOffMenu
+ tkTextAutoScan ::tk::TextAutoScan
+ tkTextButton1 ::tk::TextButton1
+ tkTextClosestGap ::tk::TextClosestGap
+ tkTextInsert ::tk::TextInsert
+ tkTextKeyExtend ::tk::TextKeyExtend
+ tkTextKeySelect ::tk::TextKeySelect
+ tkTextNextPara ::tk::TextNextPara
+ tkTextNextPos ::tk::TextNextPos
+ tkTextNextWord ::tk::TextNextWord
+ tkTextPaste ::tk::TextPaste
+ tkTextPrevPara ::tk::TextPrevPara
+ tkTextPrevPos ::tk::TextPrevPos
+ tkTextPrevWord ::tk::TextPrevWord
+ tkTextResetAnchor ::tk::TextResetAnchor
+ tkTextScrollPages ::tk::TextScrollPages
+ tkTextSelectTo ::tk::TextSelectTo
+ tkTextSetCursor ::tk::TextSetCursor
+ tkTextTranspose ::tk::TextTranspose
+ tkTextUpDownLine ::tk::TextUpDownLine
+ tkTraverseToMenu ::tk::TraverseToMenu
+ tkTraverseWithinMenu ::tk::TraverseWithinMenu
+ unsupported1 ::tk::unsupported::MacWindowStyle
+ }
+
+ # Map from the old global names of Tk private variable to their
+ # new namespace-encapsulated names.
+
+ variable PrivateVariables
+ array set PrivateVariables {
+ droped_to_start ::tk::mac::Droped_to_start
+ histNum ::tk::HistNum
+ stub_location ::tk::mac::Stub_location
+ tkFocusIn ::tk::FocusIn
+ tkFocusOut ::tk::FocusOut
+ tkPalette ::tk::Palette
+ tkPriv ::tk::Priv
+ tkPrivMsgBox ::tk::PrivMsgBox
+ }
+}
+
+# ::tk::unsupported::ExposePrivateCommand --
+#
+# Expose one of Tk's private commands to be visible under its
+# old global name
+#
+# Arguments:
+# cmd Global name by which the command was once known,
+# or a glob-style pattern.
+#
+# Results:
+# None.
+#
+# Side effects:
+# The old command name in the global namespace is aliased to the
+# new private name.
+
+proc ::tk::unsupported::ExposePrivateCommand {cmd} {
+ variable PrivateCommands
+ set cmds [array get PrivateCommands $cmd]
+ if {[llength $cmds] == 0} {
+ return -code error "No compatibility support for \[$cmd]"
+ }
+ foreach {old new} $cmds {
+ namespace eval :: [list interp alias {} $old {}] $new
+ }
+}
+
+# ::tk::unsupported::ExposePrivateVariable --
+#
+# Expose one of Tk's private variables to be visible under its
+# old global name
+#
+# Arguments:
+# var Global name by which the variable was once known,
+# or a glob-style pattern.
+#
+# Results:
+# None.
+#
+# Side effects:
+# The old variable name in the global namespace is aliased to the
+# new private name.
+
+proc ::tk::unsupported::ExposePrivateVariable {var} {
+ variable PrivateVariables
+ set vars [array get PrivateVariables $var]
+ if {[llength $vars] == 0} {
+ return -code error "No compatibility support for \$$var"
+ }
+ namespace eval ::tk::mac {}
+ foreach {old new} $vars {
+ namespace eval :: [list upvar "#0" $new $old]
+ }
+}
diff --git a/tk/library/xmfbox.tcl b/tk/library/xmfbox.tcl
index 67ec66782df..31b02efe557 100644
--- a/tk/library/xmfbox.tcl
+++ b/tk/library/xmfbox.tcl
@@ -2,7 +2,7 @@
#
# Implements the "Motif" style file selection dialog for the
# Unix platform. This implementation is used only if the
-# "tk_strictMotif" flag is set.
+# "::tk_strictMotif" flag is set.
#
# RCS: @(#) $Id$
#
@@ -16,7 +16,7 @@ namespace eval ::tk::dialog {}
namespace eval ::tk::dialog::file {}
-# tkMotifFDialog --
+# ::tk::MotifFDialog --
#
# Implements a file dialog similar to the standard Motif file
# selection box.
@@ -26,17 +26,21 @@ namespace eval ::tk::dialog::file {}
# args Options parsed by the procedure.
#
# Results:
-# A list of two members. The first member is the absolute
-# pathname of the selected file or "" if user hits cancel. The
-# second member is the name of the selected file type, or ""
-# which stands for "default file type"
-
-proc tkMotifFDialog {type args} {
- global tkPriv
+# When -multiple is set to 0, this returns the absolute pathname
+# of the selected file. (NOTE: This is not the same as a single
+# element list.)
+#
+# When -multiple is set to > 0, this returns a Tcl list of absolute
+# pathnames. The argument for -multiple is ignored, but for consistency
+# with Windows it defines the maximum amount of memory to allocate for
+# the returned filenames.
+
+proc ::tk::MotifFDialog {type args} {
+ variable ::tk::Priv
set dataName __tk_filedialog
upvar ::tk::dialog::file::$dataName data
- set w [tkMotifFDialog_Create $dataName $type $args]
+ set w [MotifFDialog_Create $dataName $type $args]
# Set a grab and claim the focus too.
@@ -49,19 +53,19 @@ proc tkMotifFDialog {type args} {
# may take the focus away so we can't redirect it. Finally,
# restore any grab that was in effect.
- tkwait variable tkPriv(selectFilePath)
+ vwait ::tk::Priv(selectFilePath)
::tk::RestoreFocusGrab $w $data(sEnt) withdraw
- return $tkPriv(selectFilePath)
+ return $Priv(selectFilePath)
}
-# tkMotifFDialog_Create --
+# ::tk::MotifFDialog_Create --
#
# Creates the Motif file dialog (if it doesn't exist yet) and
# initialize the internal data structure associated with the
# dialog.
#
-# This procedure is used by tkMotifFDialog to create the
+# This procedure is used by ::tk::MotifFDialog to create the
# dialog. It's also used by the test suite to test the Motif
# file dialog implementation. User code shouldn't call this
# procedure directly.
@@ -74,11 +78,10 @@ proc tkMotifFDialog {type args} {
# Results:
# Pathname of the file dialog.
-proc tkMotifFDialog_Create {dataName type argList} {
- global tkPriv
+proc ::tk::MotifFDialog_Create {dataName type argList} {
upvar ::tk::dialog::file::$dataName data
- tkMotifFDialog_Config $dataName $type $argList
+ MotifFDialog_Config $dataName $type $argList
if {[string equal $data(-parent) .]} {
set w .$dataName
@@ -89,10 +92,10 @@ proc tkMotifFDialog_Create {dataName type argList} {
# (re)create the dialog box if necessary
#
if {![winfo exists $w]} {
- tkMotifFDialog_BuildUI $w
+ MotifFDialog_BuildUI $w
} elseif {[string compare [winfo class $w] TkMotifFDialog]} {
destroy $w
- tkMotifFDialog_BuildUI $w
+ MotifFDialog_BuildUI $w
} else {
set data(fEnt) $w.top.f1.ent
set data(dList) $w.top.f2.a.l
@@ -102,10 +105,21 @@ proc tkMotifFDialog_Create {dataName type argList} {
set data(filterBtn) $w.bot.filter
set data(cancelBtn) $w.bot.cancel
}
+ MotifFDialog_SetListMode $w
+
+ # Dialog boxes should be transient with respect to their parent,
+ # so that they will always stay on top of their parent window. However,
+ # some window managers will create the window as withdrawn if the parent
+ # window is withdrawn or iconified. Combined with the grab we put on the
+ # window, this can hang the entire application. Therefore we only make
+ # the dialog transient if the parent is viewable.
- wm transient $w $data(-parent)
+ if {[winfo viewable [winfo toplevel $data(-parent)]] } {
+ wm transient $w $data(-parent)
+ }
- tkMotifFDialog_Update $w
+ MotifFDialog_FileTypes $w
+ MotifFDialog_Update $w
# Withdraw the window, then update all the geometry information
# so we know how big it wants to be, then center the window in the
@@ -117,7 +131,75 @@ proc tkMotifFDialog_Create {dataName type argList} {
return $w
}
-# tkMotifFDialog_Config --
+# ::tk::MotifFDialog_FileTypes --
+#
+# Checks the -filetypes option. If present this adds a list of radio-
+# buttons to pick the file types from.
+#
+# Arguments:
+# w Pathname of the tk_get*File dialogue.
+#
+# Results:
+# none
+
+proc ::tk::MotifFDialog_FileTypes {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+
+ set f $w.top.f3.types
+ catch {destroy $f}
+
+ # No file types: use "*" as the filter and display no radio-buttons
+ if {$data(-filetypes) == ""} {
+ set data(filter) *
+ return
+ }
+
+ # The filetypes radiobuttons
+ # set data(fileType) $data(-defaulttype)
+ set data(fileType) 0
+
+ MotifFDialog_SetFilter $w [lindex $data(-filetypes) $data(fileType)]
+
+ #don't produce radiobuttons for only one filetype
+ if {[llength $data(-filetypes)] == 1} {
+ return
+ }
+
+ frame $f
+ set cnt 0
+ if {$data(-filetypes) != {}} {
+ foreach type $data(-filetypes) {
+ set title [lindex [lindex $type 0] 0]
+ set filter [lindex $type 1]
+ radiobutton $f.b$cnt \
+ -text $title \
+ -variable ::tk::dialog::file::[winfo name $w](fileType) \
+ -value $cnt \
+ -command "[list tk::MotifFDialog_SetFilter $w $type]"
+ pack $f.b$cnt -side left
+ incr cnt
+ }
+ }
+ $f.b$data(fileType) invoke
+
+ pack $f -side bottom -fill both
+
+ return
+}
+
+# This proc gets called whenever data(filter) is set
+#
+proc ::tk::MotifFDialog_SetFilter {w type} {
+ upvar ::tk::dialog::file::[winfo name $w] data
+ variable ::tk::Priv
+
+ set data(filter) [lindex $type 1]
+ set Priv(selectFileType) [lindex [lindex $type 0] 0]
+
+ MotifFDialog_Update $w
+}
+
+# ::tk::MotifFDialog_Config --
#
# Iterates over the optional arguments to determine the option
# values for the Motif file dialog; gives default values to
@@ -129,7 +211,7 @@ proc tkMotifFDialog_Create {dataName type argList} {
# type "Save" or "Open"
# argList Options parsed by the procedure.
-proc tkMotifFDialog_Config {dataName type argList} {
+proc ::tk::MotifFDialog_Config {dataName type argList} {
upvar ::tk::dialog::file::$dataName data
set data(type) $type
@@ -144,7 +226,11 @@ proc tkMotifFDialog_Config {dataName type argList} {
{-parent "" "" "."}
{-title "" "" ""}
}
+ if { [string equal $type "open"] } {
+ lappend specs {-multiple "" "" "0"}
+ }
+ set data(-multiple) 0
# 2: default values depending on the type of the dialog
#
if {![info exists data(selectPath)]} {
@@ -159,9 +245,13 @@ proc tkMotifFDialog_Config {dataName type argList} {
if {[string equal $data(-title) ""]} {
if {[string equal $type "open"]} {
- set data(-title) "Open"
+ if {$data(-multiple) != 0} {
+ set data(-title) "[mc {Open Multiple Files}]"
+ } else {
+ set data(-title) [mc "Open"]
+ }
} else {
- set data(-title) "Save As"
+ set data(-title) [mc "Save As"]
}
}
@@ -170,7 +260,7 @@ proc tkMotifFDialog_Config {dataName type argList} {
#
if {[string compare $data(-initialdir) ""]} {
if {[file isdirectory $data(-initialdir)]} {
- set data(selectPath) [glob $data(-initialdir)]
+ set data(selectPath) [lindex [glob $data(-initialdir)] 0]
} else {
set data(selectPath) [pwd]
}
@@ -188,7 +278,7 @@ proc tkMotifFDialog_Config {dataName type argList} {
# file dialog, but we check for validity of the value to make sure
# the application code also runs fine with the TK file dialog.
#
- set data(-filetypes) [tkFDGetFileTypes $data(-filetypes)]
+ set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)]
if {![info exists data(filter)]} {
set data(filter) *
@@ -198,7 +288,7 @@ proc tkMotifFDialog_Config {dataName type argList} {
}
}
-# tkMotifFDialog_BuildUI --
+# ::tk::MotifFDialog_BuildUI --
#
# Builds the UI components of the Motif file dialog.
#
@@ -208,7 +298,7 @@ proc tkMotifFDialog_Config {dataName type argList} {
# Results:
# None.
-proc tkMotifFDialog_BuildUI {w} {
+proc ::tk::MotifFDialog_BuildUI {w} {
set dataName [lindex [split $w .] end]
upvar ::tk::dialog::file::$dataName data
@@ -242,7 +332,8 @@ proc tkMotifFDialog_BuildUI {w} {
# The Filter box
#
- label $f1.lab -text "Filter:" -under 3 -anchor w
+ bind [::tk::AmpWidget label $f1.lab -text [mc "Fil&ter:"] -anchor w] \
+ <<AltUnderlined>> [list focus $f1.ent]
entry $f1.ent
pack $f1.lab -side top -fill x -padx 6 -pady 4
pack $f1.ent -side top -fill x -padx 4 -pady 0
@@ -250,12 +341,15 @@ proc tkMotifFDialog_BuildUI {w} {
# The file and directory lists
#
- set data(dList) [tkMotifFDialog_MakeSList $w $f2a Directory: 0 DList]
- set data(fList) [tkMotifFDialog_MakeSList $w $f2b Files: 2 FList]
+ set data(dList) [MotifFDialog_MakeSList $w $f2a \
+ [mc "&Directory:"] DList]
+ set data(fList) [MotifFDialog_MakeSList $w $f2b \
+ [mc "Fi&les:"] FList]
# The Selection box
#
- label $f3.lab -text "Selection:" -under 0 -anchor w
+ bind [::tk::AmpWidget label $f3.lab -text [mc "&Selection:"] -anchor w] \
+ <<AltUnderlined>> [list focus $f3.ent]
entry $f3.ent
pack $f3.lab -side top -fill x -padx 6 -pady 0
pack $f3.ent -side top -fill x -padx 4 -pady 4
@@ -263,34 +357,44 @@ proc tkMotifFDialog_BuildUI {w} {
# The buttons
#
- set data(okBtn) [button $bot.ok -text OK -width 6 -under 0 \
- -command [list tkMotifFDialog_OkCmd $w]]
- set data(filterBtn) [button $bot.filter -text Filter -width 6 -under 0 \
- -command [list tkMotifFDialog_FilterCmd $w]]
- set data(cancelBtn) [button $bot.cancel -text Cancel -width 6 -under 0 \
- -command [list tkMotifFDialog_CancelCmd $w]]
+ set maxWidth [::tk::mcmaxamp &OK &Filter &Cancel]
+ set maxWidth [expr {$maxWidth<6?6:$maxWidth}]
+ set data(okBtn) [::tk::AmpWidget button $bot.ok -text [mc "&OK"] \
+ -width $maxWidth \
+ -command [list tk::MotifFDialog_OkCmd $w]]
+ set data(filterBtn) [::tk::AmpWidget button $bot.filter -text [mc "&Filter"] \
+ -width $maxWidth \
+ -command [list tk::MotifFDialog_FilterCmd $w]]
+ set data(cancelBtn) [::tk::AmpWidget button $bot.cancel -text [mc "&Cancel"] \
+ -width $maxWidth \
+ -command [list tk::MotifFDialog_CancelCmd $w]]
pack $bot.ok $bot.filter $bot.cancel -padx 10 -pady 10 -expand yes \
-side left
# Create the bindings:
#
- bind $w <Alt-t> [list focus $data(fEnt)]
- bind $w <Alt-d> [list focus $data(dList)]
- bind $w <Alt-l> [list focus $data(fList)]
- bind $w <Alt-s> [list focus $data(sEnt)]
+ bind $w <Alt-Key> [list ::tk::AltKeyInDialog $w %A]
+
+ bind $data(fEnt) <Return> [list tk::MotifFDialog_ActivateFEnt $w]
+ bind $data(sEnt) <Return> [list tk::MotifFDialog_ActivateSEnt $w]
- bind $w <Alt-o> [list tkButtonInvoke $bot.ok]
- bind $w <Alt-f> [list tkButtonInvoke $bot.filter]
- bind $w <Alt-c> [list tkButtonInvoke $bot.cancel]
+ wm protocol $w WM_DELETE_WINDOW [list tk::MotifFDialog_CancelCmd $w]
+}
- bind $data(fEnt) <Return> [list tkMotifFDialog_ActivateFEnt $w]
- bind $data(sEnt) <Return> [list tkMotifFDialog_ActivateSEnt $w]
+proc ::tk::MotifFDialog_SetListMode {w} {
+ upvar ::tk::dialog::file::[winfo name $w] data
- wm protocol $w WM_DELETE_WINDOW [list tkMotifFDialog_CancelCmd $w]
+ if {$data(-multiple) != 0} {
+ set selectmode extended
+ } else {
+ set selectmode browse
+ }
+ set f $w.top.f2.b
+ $f.l configure -selectmode $selectmode
}
-# tkMotifFDialog_MakeSList --
+# ::tk::MotifFDialog_MakeSList --
#
# Create a scrolled-listbox and set the keyboard accelerator
# bindings so that the list selection follows what the user
@@ -305,9 +409,10 @@ proc tkMotifFDialog_BuildUI {w} {
# cmdPrefix Specifies procedures to call when the listbox is
# browsed or activated.
-proc tkMotifFDialog_MakeSList {w f label under cmdPrefix} {
- label $f.lab -text $label -under $under -anchor w
- listbox $f.l -width 12 -height 5 -selectmode browse -exportselection 0\
+proc ::tk::MotifFDialog_MakeSList {w f label cmdPrefix} {
+ bind [::tk::AmpWidget label $f.lab -text $label -anchor w] \
+ <<AltUnderlined>> [list focus $f.l]
+ listbox $f.l -width 12 -height 5 -exportselection 0\
-xscrollcommand [list $f.h set] -yscrollcommand [list $f.v set]
scrollbar $f.v -orient vertical -takefocus 0 -command [list $f.l yview]
scrollbar $f.h -orient horizontal -takefocus 0 -command [list $f.l xview]
@@ -324,23 +429,19 @@ proc tkMotifFDialog_MakeSList {w f label under cmdPrefix} {
# bindings for the listboxes
#
set list $f.l
- bind $list <Up> [list tkMotifFDialog_Browse$cmdPrefix $w]
- bind $list <Down> [list tkMotifFDialog_Browse$cmdPrefix $w]
- bind $list <space> [list tkMotifFDialog_Browse$cmdPrefix $w]
- bind $list <1> [list tkMotifFDialog_Browse$cmdPrefix $w]
- bind $list <B1-Motion> [list tkMotifFDialog_Browse$cmdPrefix $w]
+ bind $list <<ListboxSelect>> [list tk::MotifFDialog_Browse$cmdPrefix $w]
bind $list <Double-ButtonRelease-1> \
- [list tkMotifFDialog_Activate$cmdPrefix $w]
- bind $list <Return> "tkMotifFDialog_Browse$cmdPrefix [list $w]; \
- tkMotifFDialog_Activate$cmdPrefix [list $w]"
+ [list tk::MotifFDialog_Activate$cmdPrefix $w]
+ bind $list <Return> "tk::MotifFDialog_Browse$cmdPrefix [list $w]; \
+ tk::MotifFDialog_Activate$cmdPrefix [list $w]"
bindtags $list [list Listbox $list [winfo toplevel $list] all]
- tkListBoxKeyAccel_Set $list
+ ListBoxKeyAccel_Set $list
return $f.l
}
-# tkMotifFDialog_InterpFilter --
+# ::tk::MotifFDialog_InterpFilter --
#
# Interpret the string in the filter entry into two components:
# the directory and the pattern. If the string is a relative
@@ -355,7 +456,7 @@ proc tkMotifFDialog_MakeSList {w f label under cmdPrefix} {
# specified # by the filter. The second element is the filter
# pattern itself.
-proc tkMotifFDialog_InterpFilter {w} {
+proc ::tk::MotifFDialog_InterpFilter {w} {
upvar ::tk::dialog::file::[winfo name $w] data
set text [string trim [$data(fEnt) get]]
@@ -407,7 +508,7 @@ proc tkMotifFDialog_InterpFilter {w} {
return [list $dir $fil]
}
-# tkMotifFDialog_Update
+# ::tk::MotifFDialog_Update
#
# Load the files and synchronize the "filter" and "selection" fields
# boxes.
@@ -418,19 +519,20 @@ proc tkMotifFDialog_InterpFilter {w} {
# Results:
# None.
-proc tkMotifFDialog_Update {w} {
+proc ::tk::MotifFDialog_Update {w} {
upvar ::tk::dialog::file::[winfo name $w] data
$data(fEnt) delete 0 end
- $data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) $data(filter)]
+ $data(fEnt) insert 0 \
+ [::tk::dialog::file::JoinFile $data(selectPath) $data(filter)]
$data(sEnt) delete 0 end
$data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
$data(selectFile)]
- tkMotifFDialog_LoadFiles $w
+ MotifFDialog_LoadFiles $w
}
-# tkMotifFDialog_LoadFiles --
+# ::tk::MotifFDialog_LoadFiles --
#
# Loads the files and directories into the two listboxes according
# to the filter setting.
@@ -441,7 +543,7 @@ proc tkMotifFDialog_Update {w} {
# Results:
# None.
-proc tkMotifFDialog_LoadFiles {w} {
+proc ::tk::MotifFDialog_LoadFiles {w} {
upvar ::tk::dialog::file::[winfo name $w] data
$data(dList) delete 0 end
@@ -455,32 +557,34 @@ proc tkMotifFDialog_LoadFiles {w} {
return
}
- # Make the dir list
+ # Make the dir and file lists
#
- foreach f [lsort -dictionary [glob -nocomplain .* *]] {
- if {[file isdir ./$f]} {
- $data(dList) insert end $f
- }
- }
- # Make the file list
+ # For speed we only have one glob, which reduces the file system
+ # calls (good for slow NFS networks).
+ #
+ # We also do two smaller sorts (files + dirs) instead of one large sort,
+ # which gives a small speed increase.
#
- if {[string equal $data(filter) *]} {
- set files [lsort -dictionary [glob -nocomplain .* *]]
- } else {
- set files [lsort -dictionary \
- [glob -nocomplain $data(filter)]]
- }
-
set top 0
- foreach f $files {
- if {![file isdir ./$f]} {
- regsub {^[.]/} $f "" f
- $data(fList) insert end $f
- if {[string match .* $f]} {
- incr top
+ set dlist ""
+ set flist ""
+ foreach f [glob -nocomplain .* *] {
+ if {[file isdir ./$f]} {
+ lappend dlist $f
+ } else {
+ foreach pat $data(filter) {
+ if {[string match $pat $f]} {
+ if {[string match .* $f]} {
+ incr top
+ }
+ lappend flist $f
+ break
}
+ }
}
}
+ eval [list $data(dList) insert end] [lsort -dictionary $dlist]
+ eval [list $data(fList) insert end] [lsort -dictionary $flist]
# The user probably doesn't want to see the . files. We adjust the view
# so that the listbox displays all the non-dot files
@@ -489,7 +593,7 @@ proc tkMotifFDialog_LoadFiles {w} {
cd $appPWD
}
-# tkMotifFDialog_BrowseFList --
+# ::tk::MotifFDialog_BrowseDList --
#
# This procedure is called when the directory list is browsed
# (clicked-over) by the user.
@@ -500,7 +604,7 @@ proc tkMotifFDialog_LoadFiles {w} {
# Results:
# None.
-proc tkMotifFDialog_BrowseDList {w} {
+proc ::tk::MotifFDialog_BrowseDList {w} {
upvar ::tk::dialog::file::[winfo name $w] data
focus $data(dList)
@@ -514,7 +618,7 @@ proc tkMotifFDialog_BrowseDList {w} {
$data(fList) selection clear 0 end
- set list [tkMotifFDialog_InterpFilter $w]
+ set list [MotifFDialog_InterpFilter $w]
set data(filter) [lindex $list 1]
switch -- $subdir {
@@ -535,7 +639,7 @@ proc tkMotifFDialog_BrowseDList {w} {
$data(fEnt) insert 0 $newSpec
}
-# tkMotifFDialog_ActivateDList --
+# ::tk::MotifFDialog_ActivateDList --
#
# This procedure is called when the directory list is activated
# (double-clicked) by the user.
@@ -546,7 +650,7 @@ proc tkMotifFDialog_BrowseDList {w} {
# Results:
# None.
-proc tkMotifFDialog_ActivateDList {w} {
+proc ::tk::MotifFDialog_ActivateDList {w} {
upvar ::tk::dialog::file::[winfo name $w] data
if {[string equal [$data(dList) curselection] ""]} {
@@ -572,7 +676,7 @@ proc tkMotifFDialog_ActivateDList {w} {
}
set data(selectPath) $newDir
- tkMotifFDialog_Update $w
+ MotifFDialog_Update $w
if {[string compare $subdir ..]} {
$data(dList) selection set 0
@@ -583,7 +687,7 @@ proc tkMotifFDialog_ActivateDList {w} {
}
}
-# tkMotifFDialog_BrowseFList --
+# ::tk::MotifFDialog_BrowseFList --
#
# This procedure is called when the file list is browsed
# (clicked-over) by the user.
@@ -594,31 +698,38 @@ proc tkMotifFDialog_ActivateDList {w} {
# Results:
# None.
-proc tkMotifFDialog_BrowseFList {w} {
+proc ::tk::MotifFDialog_BrowseFList {w} {
upvar ::tk::dialog::file::[winfo name $w] data
focus $data(fList)
- if {[string equal [$data(fList) curselection] ""]} {
- return
+ set data(selectFile) ""
+ foreach item [$data(fList) curselection] {
+ lappend data(selectFile) [$data(fList) get $item]
}
- set data(selectFile) [$data(fList) get [$data(fList) curselection]]
- if {[string equal $data(selectFile) ""]} {
+ if {[llength $data(selectFile)] == 0} {
return
}
$data(dList) selection clear 0 end
$data(fEnt) delete 0 end
- $data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) $data(filter)]
+ $data(fEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
+ $data(filter)]
$data(fEnt) xview end
+ # if it's a multiple selection box, just put in the filenames
+ # otherwise put in the full path as usual
$data(sEnt) delete 0 end
- $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
- $data(selectFile)]
+ if {$data(-multiple) != 0} {
+ $data(sEnt) insert 0 $data(selectFile)
+ } else {
+ $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \
+ [lindex $data(selectFile) 0]]
+ }
$data(sEnt) xview end
}
-# tkMotifFDialog_ActivateFList --
+# ::tk::MotifFDialog_ActivateFList --
#
# This procedure is called when the file list is activated
# (double-clicked) by the user.
@@ -629,7 +740,7 @@ proc tkMotifFDialog_BrowseFList {w} {
# Results:
# None.
-proc tkMotifFDialog_ActivateFList {w} {
+proc ::tk::MotifFDialog_ActivateFList {w} {
upvar ::tk::dialog::file::[winfo name $w] data
if {[string equal [$data(fList) curselection] ""]} {
@@ -639,11 +750,11 @@ proc tkMotifFDialog_ActivateFList {w} {
if {[string equal $data(selectFile) ""]} {
return
} else {
- tkMotifFDialog_ActivateSEnt $w
+ MotifFDialog_ActivateSEnt $w
}
}
-# tkMotifFDialog_ActivateFEnt --
+# ::tk::MotifFDialog_ActivateFEnt --
#
# This procedure is called when the user presses Return inside
# the "filter" entry. It updates the dialog according to the
@@ -655,21 +766,21 @@ proc tkMotifFDialog_ActivateFList {w} {
# Results:
# None.
-proc tkMotifFDialog_ActivateFEnt {w} {
+proc ::tk::MotifFDialog_ActivateFEnt {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- set list [tkMotifFDialog_InterpFilter $w]
+ set list [MotifFDialog_InterpFilter $w]
set data(selectPath) [lindex $list 0]
set data(filter) [lindex $list 1]
- tkMotifFDialog_Update $w
+ MotifFDialog_Update $w
}
-# tkMotifFDialog_ActivateSEnt --
+# ::tk::MotifFDialog_ActivateSEnt --
#
# This procedure is called when the user presses Return inside
-# the "selection" entry. It sets the tkPriv(selectFilePath) global
-# variable so that the vwait loop in tkMotifFDialog will be
+# the "selection" entry. It sets the ::tk::Priv(selectFilePath)
+# variable so that the vwait loop in tk::MotifFDialog will be
# terminated.
#
# Arguments:
@@ -678,98 +789,109 @@ proc tkMotifFDialog_ActivateFEnt {w} {
# Results:
# None.
-proc tkMotifFDialog_ActivateSEnt {w} {
- global tkPriv
+proc ::tk::MotifFDialog_ActivateSEnt {w} {
+ variable ::tk::Priv
upvar ::tk::dialog::file::[winfo name $w] data
set selectFilePath [string trim [$data(sEnt) get]]
- set selectFile [file tail $selectFilePath]
- set selectPath [file dirname $selectFilePath]
if {[string equal $selectFilePath ""]} {
- tkMotifFDialog_FilterCmd $w
+ MotifFDialog_FilterCmd $w
return
}
- if {[file isdirectory $selectFilePath]} {
- set data(selectPath) [glob $selectFilePath]
- set data(selectFile) ""
- tkMotifFDialog_Update $w
- return
+ if {$data(-multiple) == 0} {
+ set selectFilePath [list $selectFilePath]
}
- if {[string compare [file pathtype $selectFilePath] "absolute"]} {
- tk_messageBox -icon warning -type ok \
- -message "\"$selectFilePath\" must be an absolute pathname"
- return
- }
-
- if {![file exists $selectPath]} {
- tk_messageBox -icon warning -type ok \
- -message "Directory \"$selectPath\" does not exist."
+ if {[file isdirectory [lindex $selectFilePath 0]]} {
+ set data(selectPath) [lindex [glob $selectFilePath] 0]
+ set data(selectFile) ""
+ MotifFDialog_Update $w
return
}
- if {![file exists $selectFilePath]} {
- if {[string equal $data(type) open]} {
+ set newFileList ""
+ foreach item $selectFilePath {
+ if {[string compare [file pathtype $item] "absolute"]} {
+ set item [file join $data(selectPath) $item]
+ } elseif {![file exists [file dirname $item]]} {
tk_messageBox -icon warning -type ok \
- -message "File \"$selectFilePath\" does not exist."
+ -message [mc {Directory "%1$s" does not exist.} \
+ [file dirname $item]]
return
}
- } else {
- if {[string equal $data(type) save]} {
- set message [format %s%s \
- "File \"$selectFilePath\" already exists.\n\n" \
- "Replace existing file?"]
- set answer [tk_messageBox -icon warning -type yesno \
- -message $message]
- if {[string equal $answer "no"]} {
+
+ if {![file exists $item]} {
+ if {[string equal $data(type) open]} {
+ tk_messageBox -icon warning -type ok \
+ -message [mc {File "%1$s" does not exist.} $item]
return
}
+ } else {
+ if {[string equal $data(type) save]} {
+ set message [format %s%s \
+ [mc {File "%1$s" already exists.\n\n} \
+ $selectFilePath] \
+ [mc {Replace existing file?}]]
+ set answer [tk_messageBox -icon warning -type yesno \
+ -message $message]
+ if {[string equal $answer "no"]} {
+ return
+ }
+ }
}
+
+ lappend newFileList $item
}
- set tkPriv(selectFilePath) $selectFilePath
- set tkPriv(selectFile) $selectFile
- set tkPriv(selectPath) $selectPath
+ if {$data(-multiple) != 0} {
+ set Priv(selectFilePath) $newFileList
+ } else {
+ set Priv(selectFilePath) [lindex $newFileList 0]
+ }
+
+ # Set selectFile and selectPath to first item in list
+ set Priv(selectFile) [file tail [lindex $newFileList 0]]
+ set Priv(selectPath) [file dirname [lindex $newFileList 0]]
}
-proc tkMotifFDialog_OkCmd {w} {
+proc ::tk::MotifFDialog_OkCmd {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- tkMotifFDialog_ActivateSEnt $w
+ MotifFDialog_ActivateSEnt $w
}
-proc tkMotifFDialog_FilterCmd {w} {
+proc ::tk::MotifFDialog_FilterCmd {w} {
upvar ::tk::dialog::file::[winfo name $w] data
- tkMotifFDialog_ActivateFEnt $w
+ MotifFDialog_ActivateFEnt $w
}
-proc tkMotifFDialog_CancelCmd {w} {
- global tkPriv
+proc ::tk::MotifFDialog_CancelCmd {w} {
+ variable ::tk::Priv
- set tkPriv(selectFilePath) ""
- set tkPriv(selectFile) ""
- set tkPriv(selectPath) ""
+ set Priv(selectFilePath) ""
+ set Priv(selectFile) ""
+ set Priv(selectPath) ""
}
-proc tkListBoxKeyAccel_Set {w} {
+proc ::tk::ListBoxKeyAccel_Set {w} {
bind Listbox <Any-KeyPress> ""
- bind $w <Destroy> [list tkListBoxKeyAccel_Unset $w]
- bind $w <Any-KeyPress> [list tkListBoxKeyAccel_Key $w %A]
+ bind $w <Destroy> [list tk::ListBoxKeyAccel_Unset $w]
+ bind $w <Any-KeyPress> [list tk::ListBoxKeyAccel_Key $w %A]
}
-proc tkListBoxKeyAccel_Unset {w} {
- global tkPriv
+proc ::tk::ListBoxKeyAccel_Unset {w} {
+ variable ::tk::Priv
- catch {after cancel $tkPriv(lbAccel,$w,afterId)}
- catch {unset tkPriv(lbAccel,$w)}
- catch {unset tkPriv(lbAccel,$w,afterId)}
+ catch {after cancel $Priv(lbAccel,$w,afterId)}
+ catch {unset Priv(lbAccel,$w)}
+ catch {unset Priv(lbAccel,$w,afterId)}
}
-# tkListBoxKeyAccel_Key--
+# ::tk::ListBoxKeyAccel_Key--
#
# This procedure maintains a list of recently entered keystrokes
# over a listbox widget. It arranges an idle event to move the
@@ -783,20 +905,23 @@ proc tkListBoxKeyAccel_Unset {w} {
# Results:
# None.
-proc tkListBoxKeyAccel_Key {w key} {
- global tkPriv
+proc ::tk::ListBoxKeyAccel_Key {w key} {
+ variable ::tk::Priv
- append tkPriv(lbAccel,$w) $key
- tkListBoxKeyAccel_Goto $w $tkPriv(lbAccel,$w)
+ if { $key == "" } {
+ return
+ }
+ append Priv(lbAccel,$w) $key
+ ListBoxKeyAccel_Goto $w $Priv(lbAccel,$w)
catch {
- after cancel $tkPriv(lbAccel,$w,afterId)
+ after cancel $Priv(lbAccel,$w,afterId)
}
- set tkPriv(lbAccel,$w,afterId) [after 500 \
- [list tkListBoxKeyAccel_Reset $w]]
+ set Priv(lbAccel,$w,afterId) [after 500 \
+ [list tk::ListBoxKeyAccel_Reset $w]]
}
-proc tkListBoxKeyAccel_Goto {w string} {
- global tkPriv
+proc ::tk::ListBoxKeyAccel_Goto {w string} {
+ variable ::tk::Priv
set string [string tolower $string]
set end [$w index end]
@@ -818,14 +943,19 @@ proc tkListBoxKeyAccel_Goto {w string} {
$w selection set $theIndex $theIndex
$w activate $theIndex
$w see $theIndex
+ event generate $w <<ListboxSelect>>
}
}
-proc tkListBoxKeyAccel_Reset {w} {
- global tkPriv
+proc ::tk::ListBoxKeyAccel_Reset {w} {
+ variable ::tk::Priv
- catch {unset tkPriv(lbAccel,$w)}
+ catch {unset Priv(lbAccel,$w)}
}
+proc ::tk_getFileType {} {
+ variable ::tk::Priv
+ return $Priv(selectFileType)
+}
diff --git a/tk/mac/MW_TkBuildLibHeader.h b/tk/mac/MW_TkBuildLibHeader.h
new file mode 100644
index 00000000000..cbca0c26896
--- /dev/null
+++ b/tk/mac/MW_TkBuildLibHeader.h
@@ -0,0 +1,7 @@
+#if __POWERPC__
+#include "MW_TkBuildLibHeaderPPC"
+#elif __CFM68K__
+#include "MW_TkBuildLibHeaderCFM68K"
+#else
+#include "MW_TkBuildLibHeader68K"
+#endif
diff --git a/tk/mac/MW_TkBuildLibHeader.pch b/tk/mac/MW_TkBuildLibHeader.pch
new file mode 100644
index 00000000000..727d7b95148
--- /dev/null
+++ b/tk/mac/MW_TkBuildLibHeader.pch
@@ -0,0 +1,36 @@
+/*
+ * MW_TkBuildLibHeader.pch --
+ *
+ * This file is the source for a pre-compilied header that gets used
+ * for all files in the Tk projects. This make compilies go a bit
+ * faster. This file is only intended to be used in the MetroWerks
+ * CodeWarrior environment. It essentially acts as a place to set
+ * compiler flags. See MetroWerks documention for more details.
+ *
+ * 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.
+ *
+ * RCS: @(#) $Id$
+ */
+
+/*
+ * To use the compilied header you need to set the "Prefix file" in
+ * the "C/C++ Language" preference panel to point to the created
+ * compilied header. The name of the header depends on the
+ * architecture we are compiling for (see the code below). For
+ * example, for a 68k app the prefix file should be: MW_TclHeader68K.
+ */
+
+#if __POWERPC__
+#pragma precompile_target "MW_TkBuildLibHeaderPPC"
+#elif __CFM68K__
+#pragma precompile_target "MW_TkBuildLibHeaderCFM68K"
+#else
+#pragma precompile_target "MW_TkBuildLibHeader68K"
+#endif
+
+#define BUILD_tk 1
+
+#include "MW_TkHeaderCommon.h"
diff --git a/tk/mac/MW_TkHeader.h b/tk/mac/MW_TkHeader.h
index 8d2b252b01b..a5ee4642cca 100644
--- a/tk/mac/MW_TkHeader.h
+++ b/tk/mac/MW_TkHeader.h
@@ -1,45 +1,7 @@
-/*
- * MW_TkHeader.h --
- *
- * This file is a global header file for the MetroWerks CodeWarrior
- * environment. It essentially acts as a place to set compiler
- * flags. See MetroWerks documention for more details.
- *
- * 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: @(#) MW_TkHeader.h 1.10 96/03/04 11:37:47
- */
-
-#define MAC_TCL
-#define TK_LIBRARY ":library"
-
-#define NO_GETTOD 1
-#define NO_UNION_WAIT 1
-#define HAVE_UNISTD_H 1
-#define HAS_STDARG 1
-#define HAVE_LIMITS_H
-#define REDO_KEYSYM_LOOKUP
-
-/*
- * The following two defines are used to prepare for the coming
- * of Copland.
- */
-
-#define STRICT_CONTROLS 0
-#define STRICT_WINDOWS 0
-
-/*
- * Define the following symbol if you want
- * comprehensive debugging turned on.
- */
-
-/* #define TCL_DEBUG */
-
-#ifdef TCL_DEBUG
-# define TCL_MEM_DEBUG
-# define TK_TEST
+#if __POWERPC__
+#include "MW_TkHeaderPPC"
+#elif __CFM68K__
+#include "MW_TkHeaderCFM68K"
+#else
+#include "MW_TkHeader68K"
#endif
-
diff --git a/tk/mac/MW_TkHeader.pch b/tk/mac/MW_TkHeader.pch
index 6eb9461d5c6..f0c624afc01 100644
--- a/tk/mac/MW_TkHeader.pch
+++ b/tk/mac/MW_TkHeader.pch
@@ -31,30 +31,4 @@
#pragma precompile_target "MW_TkHeader68K"
#endif
-#include "tclMacCommonPch.h"
-
-#ifdef TCL_DEBUG
- #define TK_TEST
-#endif
-
-/*
- * The following defines are for the Xlib.h file to force
- * it to generate prototypes in the way we need it. This is
- * defined here in case X.h & company are ever included before
- * tk.h.
- */
-
-#define NeedFunctionPrototypes 1
-#define NeedWidePrototypes 0
-
-/*
- * Place any includes below that will are needed by the majority of the
- * and is OK to be in any file in the system.
- */
-
-#include <tcl.h>
-#pragma export on
-#include "tk.h"
-#include "tkInt.h"
-#pragma export off
-
+#include "MW_TkHeaderCommon.h"
diff --git a/tk/mac/MW_TkHeaderCommon.h b/tk/mac/MW_TkHeaderCommon.h
new file mode 100644
index 00000000000..ab43eb566ff
--- /dev/null
+++ b/tk/mac/MW_TkHeaderCommon.h
@@ -0,0 +1,40 @@
+/*
+ * MW_TkHeaderCommon.h --
+ *
+ * Common includes for precompiled headers
+ *
+ * Copyright (c) 1998 by Scriptics Corporation.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#pragma once
+
+#include "tclMacCommonPch.h"
+
+#ifdef TCL_DEBUG
+ #define TK_TEST
+#endif
+
+/*
+ * The following defines are for the Xlib.h file to force
+ * it to generate prototypes in the way we need it. This is
+ * defined here in case X.h & company are ever included before
+ * tk.h.
+ */
+
+#define NeedFunctionPrototypes 1
+#define NeedWidePrototypes 0
+
+/*
+ * Place any includes below that will are needed by the majority of the
+ * and is OK to be in any file in the system.
+ */
+
+#include "tcl.h"
+
+#include "tk.h"
+#include "tkInt.h"
diff --git a/tk/mac/MW_TkOldImgHeader.h b/tk/mac/MW_TkOldImgHeader.h
index d0b3194b738..309ca2020e7 100644
--- a/tk/mac/MW_TkOldImgHeader.h
+++ b/tk/mac/MW_TkOldImgHeader.h
@@ -1,3 +1,3 @@
#define USE_OLD_IMAGE
-#include "MW_TkHeader.pch"
+#include "MW_TkBuildLibHeader.pch"
diff --git a/tk/mac/MW_TkOldImgStaticHeader.h b/tk/mac/MW_TkOldImgStaticHeader.h
new file mode 100644
index 00000000000..967b763d03e
--- /dev/null
+++ b/tk/mac/MW_TkOldImgStaticHeader.h
@@ -0,0 +1,3 @@
+#define USE_OLD_IMAGE
+
+#include "MW_TkStaticHeader.pch"
diff --git a/tk/mac/MW_TkStaticHeader.h b/tk/mac/MW_TkStaticHeader.h
new file mode 100644
index 00000000000..b381c226de8
--- /dev/null
+++ b/tk/mac/MW_TkStaticHeader.h
@@ -0,0 +1,7 @@
+#if __POWERPC__
+#include "MW_TkStaticHeaderPPC"
+#elif __CFM68K__
+#include "MW_TkStaticHeaderCFM68K"
+#else
+#include "MW_TkStaticHeader68K"
+#endif
diff --git a/tk/mac/MW_TkStaticHeader.pch b/tk/mac/MW_TkStaticHeader.pch
new file mode 100644
index 00000000000..e6f749436ce
--- /dev/null
+++ b/tk/mac/MW_TkStaticHeader.pch
@@ -0,0 +1,36 @@
+/*
+ * MW_TkStaticHeader.pch --
+ *
+ * This file is the source for a pre-compilied header that gets used
+ * for all files in the Tk projects. This make compilies go a bit
+ * faster. This file is only intended to be used in the MetroWerks
+ * CodeWarrior environment. It essentially acts as a place to set
+ * compiler flags. See MetroWerks documention for more details.
+ *
+ * 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.
+ *
+ * RCS: @(#) $Id$
+ */
+
+/*
+ * To use the compilied header you need to set the "Prefix file" in
+ * the "C/C++ Language" preference panel to point to the created
+ * compilied header. The name of the header depends on the
+ * architecture we are compiling for (see the code below). For
+ * example, for a 68k app the prefix file should be: MW_TclHeader68K.
+ */
+
+#if __POWERPC__
+#pragma precompile_target "MW_TkStaticHeaderPPC"
+#elif __CFM68K__
+#pragma precompile_target "MW_TkStaticHeaderCFM68K"
+#else
+#pragma precompile_target "MW_TkStaticHeader68K"
+#endif
+
+#define STATIC_BUILD 1
+
+#include "MW_TkHeaderCommon.h"
diff --git a/tk/mac/MW_TkTestHeader.pch b/tk/mac/MW_TkTestHeader.pch
index 5073c6a55f1..91efb4350e2 100644
--- a/tk/mac/MW_TkTestHeader.pch
+++ b/tk/mac/MW_TkTestHeader.pch
@@ -1,5 +1,5 @@
/*
- * MW_TkHeader.pch --
+ * MW_TkTestHeader.pch --
*
* This file is the source for a pre-compilied header that gets used
* for all files in the Tk projects. This make compilies go a bit
@@ -31,34 +31,12 @@
#pragma precompile_target "MW_TkTestHeader68K"
#endif
-#define TCL_DEBUG 1
-
-/*#define TCL_THREADS 1*/
-
-#include "tclMacCommonPch.h"
+#define BUILD_tk 1
-#ifdef TCL_DEBUG
- #define TK_TEST
-#endif
+#define STATIC_BUILD 1
-/*
- * The following defines are for the Xlib.h file to force
- * it to generate prototypes in the way we need it. This is
- * defined here in case X.h & company are ever included before
- * tk.h.
- */
-
-#define NeedFunctionPrototypes 1
-#define NeedWidePrototypes 0
-
-/*
- * Place any includes below that will are needed by the majority of the
- * and is OK to be in any file in the system.
- */
+#define TCL_DEBUG 1
-#include <tcl.h>
-#pragma export on
-#include "tk.h"
-#include "tkInt.h"
-#pragma export off
+#define TCL_THREADS 1
+#include "MW_TkHeaderCommon.h"
diff --git a/tk/mac/README b/tk/mac/README
index be73dc9e009..42db19e1297 100644
--- a/tk/mac/README
+++ b/tk/mac/README
@@ -1,12 +1,7 @@
-Tk 8.3 for Macintosh
+Tk 8.4 for Macintosh
-by Ray Johnson
-Scriptics Corporation
-rjohnson@scriptics.com
-with major help from
-Jim Ingham
-Cygnus Solutions
-jingham@cygnus.com
+Originally by Ray Johnson while at Sun Microsystems Labs
+with major help from Jim Ingham while at Cygnus Solutions
RCS: @(#) $Id$
@@ -25,7 +20,7 @@ directory.
There are several features or enhancements in Tk that are unique to
the Macintosh version of Tk. The list of these features is
maintained at
- http://dev.scriptics.com/software/mac/features.html
+ http://www.tcl.tk/software/mac/features.html
4. The Distribution
-------------------
@@ -83,5 +78,4 @@ Special notes:
If you have comments or Bug reports, use our on-line database at
- http://dev.scriptics.com/ticket/
-
+ http://tcl.sourceforge.net/
diff --git a/tk/mac/tclets.r b/tk/mac/tclets.r
index ce68db49657..e4553aef54b 100644
--- a/tk/mac/tclets.r
+++ b/tk/mac/tclets.r
@@ -25,148 +25,148 @@ read 'TEXT' (TK_LIBRARY_RESOURCES+114, "tclshrc", purgeable)
"::mac:tclets.tcl";
data 'icns' (-16455) {
- $"6963 6E73 0000 08F8 6963 7323 0000 0048" /* icns...øics#...H */
- $"0100 02EE 05CE 09EE 13DE 23FF 47CE 86C6" /* ...î.ÎÆî.Þ#ÿG렮 */
- $"4681 22C2 12C4 0888 0410 0220 0140 0080" /* F"Â.Ä.ˆ... .@.€ */
- $"0100 03EE 07CE 0FEE 1FFE 3FFF 7FFE FFFE" /* ...î.Î.î.þ?ÿ.þÿþ */
- $"7FFF 3FFE 1FFC 0FF8 07F0 03E0 01C0 0080" /* .ÿ?þ.ü.ø.ð.à.À.€ */
- $"6963 7334 0000 0088 0000 000F 0000 0000" /* ics4...ˆ........ */
- $"0000 00FC F6D0 FFF0 0000 0FC5 DD00 F6F0" /* ...üöÐÿð...ÅÝ.öð */
- $"0000 FCCD 66F0 F6F0 000F CC6E 66CE F6F0" /* ..üÍfðöð..ÌnfÎöð */
- $"00FC CC6E 67EF F6FF 0FCC CD66 66CC F6F0" /* .üÌngïöÿ.ÌÍffÌöð */
- $"FCCC CDDC 66CC CFA0 0FCC CD6C EDCC CC0F" /* üÌÍÜfÌÏ .ÌÍlíÌÌ. */
- $"00FC CC6C E6CC CCF0 000F CC6C 66CC CF00" /* .üÌlæÌÌð..ÌlfÌÏ. */
- $"0000 FCCC 6CCC F000 0000 0FCC DCCF 0000" /* ..üÌlÌð....ÌÜÏ.. */
- $"0000 00FD DCF0 0000 0000 000F CF00 0000" /* ...ýÜð......Ï... */
- $"0000 0000 F000 0000 6963 7338 0000 0108" /* ....ð...ics8.... */
- $"0000 0000 0000 00FF 0000 0000 0000 0000" /* .......ÿ........ */
- $"0000 0000 0000 FF2B FFEC 7F00 FFFF FF00" /* ......ÿ+ÿì..ÿÿÿ. */
- $"0000 0000 00FF 2BB0 7F7F 0000 FFEC FF00" /* .....ÿ+°....ÿìÿ. */
- $"0000 0000 FF2B 2B7F ECEC FF00 FFEC FF00" /* ....ÿ++.ììÿ.ÿìÿ. */
- $"0000 00FF 2B2B ECFC ECEC 2BFB FFEC FF00" /* ...ÿ++ìüìì+ûÿìÿ. */
- $"0000 FF2B 2B2B ECFC ECC0 FBFF FFEC FFFF" /* ..ÿ+++ìüìÀûÿÿìÿÿ */
- $"00FF 2B2B 2B7F ECEC ECEC 2B2B FFEC FF00" /* .ÿ+++.ìììì++ÿìÿ. */
- $"FF2B 2B2B 2B7F 7FF6 ECEC 2B2B 2BFF FD00" /* ÿ++++..öìì+++ÿý. */
- $"00FF 2B2B 2B7F ECF6 FCF9 2B2B 2B2B 00FF" /* .ÿ+++.ìöüù++++.ÿ */
- $"0000 FF2B 2B2B ECF6 FCEC 2B2B 2B2B FF00" /* ..ÿ+++ìöüì++++ÿ. */
- $"0000 00FF 2B2B ECF6 ECEC 2B2B 2BFF 0000" /* ...ÿ++ìöìì+++ÿ.. */
- $"0000 0000 FF2B 2BF6 EC2B 2B2B FF00 0000" /* ....ÿ++öì+++ÿ... */
- $"0000 0000 00FF 2BF6 F92B 2BFF 0000 0000" /* .....ÿ+öù++ÿ.... */
- $"0000 0000 0000 FFF9 F92B FF00 0000 0000" /* ......ÿùù+ÿ..... */
- $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......ÿ+ÿ...... */
- $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ........ÿ....... */
- $"4943 4E23 0000 0108 0001 0000 0002 8000" /* ICN#..........€. */
- $"0004 78F8 0008 70F8 0010 F0F8 0021 E8F8" /* ..xø..pø..ðø.!èø */
- $"0043 C4F8 0081 FAF8 0107 F1F8 0207 F0F8" /* .CÄø.úø..ñø..ðø */
- $"0407 F7FF 0807 E3FE 1007 E1FC 200E E0F8" /* ..÷ÿ..ãþ..áü .àø */
- $"4002 E074 800E E022 400E E001 200E C002" /* @.àt€.à"@.à. .À. */
- $"1006 E004 0806 C008 0406 E010 0202 C020" /* ..à...À...à...À */
- $"0102 C040 0080 8080 0040 0100 0020 0200" /* ..À@.€€€.@... .. */
+ $"6963 6E73 0000 08F8 6963 7323 0000 0048" /* icns...¯ics#...H */
+ $"0100 02EE 05CE 09EE 13DE 23FF 47CE 86C6" /* ...Ó.‘Ó.Þ#G‘Ü */
+ $"4681 22C2 12C4 0888 0410 0220 0140 0080" /* FÅ"¬.Ÿ.à... .@.Ä */
+ $"0100 03EE 07CE 0FEE 1FFE 3FFF 7FFE FFFE" /* ...Ó.‘.Ó.œ?.œœ */
+ $"7FFF 3FFE 1FFC 0FF8 07F0 03E0 01C0 0080" /* .?œ.¸.¯.•.ý.¿.Ä */
+ $"6963 7334 0000 0088 0000 000F 0000 0000" /* ics4...à........ */
+ $"0000 00FC F6D0 FFF0 0000 0FC5 DD00 F6F0" /* ...¸–­•...‰ð.–• */
+ $"0000 FCCD 66F0 F6F0 000F CC6E 66CE F6F0" /* ..¸Õf•–•..Ãnf‘–• */
+ $"00FC CC6E 67EF F6FF 0FCC CD66 66CC F6F0" /* .¸ÃngÔ–.ÃÕffÖ• */
+ $"FCCC CDDC 66CC CFA0 0FCC CD6C EDCC CC0F" /* ¸ÃÕÐfæÝ.ÃÕlÌÃÃ. */
+ $"00FC CC6C E6CC CCF0 000F CC6C 66CC CF00" /* .¸ÃlÊÃÕ..Ãlfæ. */
+ $"0000 FCCC 6CCC F000 0000 0FCC DCCF 0000" /* ..¸ÃlÕ....ÃЦ.. */
+ $"0000 00FD DCF0 0000 0000 000F CF00 0000" /* ...›Ð•......¦... */
+ $"0000 0000 F000 0000 6963 7338 0000 0108" /* ....•...ics8.... */
+ $"0000 0000 0000 00FF 0000 0000 0000 0000" /* ............... */
+ $"0000 0000 0000 FF2B FFEC 7F00 FFFF FF00" /* ......+Ï... */
+ $"0000 0000 00FF 2BB0 7F7F 0000 FFEC FF00" /* .....+ƒ....Ï. */
+ $"0000 0000 FF2B 2B7F ECEC FF00 FFEC FF00" /* ....++.ÏÏ.Ï. */
+ $"0000 00FF 2B2B ECFC ECEC 2BFB FFEC FF00" /* ...++ϸÏÏ+šÏ. */
+ $"0000 FF2B 2B2B ECFC ECC0 FBFF FFEC FFFF" /* ..+++ϸϿšÏ */
+ $"00FF 2B2B 2B7F ECEC ECEC 2B2B FFEC FF00" /* .+++.ÏÏÏÏ++Ï. */
+ $"FF2B 2B2B 2B7F 7FF6 ECEC 2B2B 2BFF FD00" /* ++++..–ÏÏ+++›. */
+ $"00FF 2B2B 2B7F ECF6 FCF9 2B2B 2B2B 00FF" /* .+++.Ï–¸˜++++. */
+ $"0000 FF2B 2B2B ECF6 FCEC 2B2B 2B2B FF00" /* ..+++Ï–¸Ï++++. */
+ $"0000 00FF 2B2B ECF6 ECEC 2B2B 2BFF 0000" /* ...++Ï–ÏÏ+++.. */
+ $"0000 0000 FF2B 2BF6 EC2B 2B2B FF00 0000" /* ....++–Ï+++... */
+ $"0000 0000 00FF 2BF6 F92B 2BFF 0000 0000" /* .....+–˜++.... */
+ $"0000 0000 0000 FFF9 F92B FF00 0000 0000" /* ......˜˜+..... */
+ $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......+...... */
+ $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ............... */
+ $"4943 4E23 0000 0108 0001 0000 0002 8000" /* ICN#..........Ä. */
+ $"0004 78F8 0008 70F8 0010 F0F8 0021 E8F8" /* ..x¯..p¯..•¯.!˯ */
+ $"0043 C4F8 0081 FAF8 0107 F1F8 0207 F0F8" /* .CŸ¯.Å™¯..Ò¯..•¯ */
+ $"0407 F7FF 0807 E3FE 1007 E1FC 200E E0F8" /* ..—..“œ..·¸ .ý¯ */
+ $"4002 E074 800E E022 400E E001 200E C002" /* @.ýtÄ.ý"@.ý. .¿. */
+ $"1006 E004 0806 C008 0406 E010 0202 C020" /* ..ý...¿...ý...¿ */
+ $"0102 C040 0080 8080 0040 0100 0020 0200" /* ..¿@.ÄÄÄ.@... .. */
$"0010 0400 0008 0800 0004 1000 0002 2000" /* .............. . */
- $"0001 4000 0000 8000 0001 0000 0003 8000" /* ..@...€.......€. */
- $"0007 F8F8 000F F0F8 001F F0F8 003F F8F8" /* ..øø..ðø..ðø.?øø */
- $"007F FCF8 00FF FEF8 01FF FFF8 03FF FFF8" /* ..üø.ÿþø.ÿÿø.ÿÿø */
- $"07FF FFFF 0FFF FFFE 1FFF FFFC 3FFF FFF8" /* .ÿÿÿ.ÿÿþ.ÿÿü?ÿÿø */
- $"7FFF FFFC FFFF FFFE 7FFF FFFF 3FFF FFFE" /* .ÿÿüÿÿÿþ.ÿÿÿ?ÿÿþ */
- $"1FFF FFFC 0FFF FFF8 07FF FFF0 03FF FFE0" /* .ÿÿü.ÿÿø.ÿÿð.ÿÿà */
- $"01FF FFC0 00FF FF80 007F FF00 003F FE00" /* .ÿÿÀ.ÿÿ€..ÿ..?þ. */
- $"001F FC00 000F F800 0007 F000 0003 E000" /* ..ü...ø...ð...à. */
- $"0001 C000 0000 8000 6963 6C34 0000 0208" /* ..À...€.icl4.... */
+ $"0001 4000 0000 8000 0001 0000 0003 8000" /* ..@...Ä.......Ä. */
+ $"0007 F8F8 000F F0F8 001F F0F8 003F F8F8" /* ..¯¯..•¯..•¯.?¯¯ */
+ $"007F FCF8 00FF FEF8 01FF FFF8 03FF FFF8" /* ..¸¯.œ¯.¯.¯ */
+ $"07FF FFFF 0FFF FFFE 1FFF FFFC 3FFF FFF8" /* ..œ.¸?¯ */
+ $"7FFF FFFC FFFF FFFE 7FFF FFFF 3FFF FFFE" /* .¸œ.?œ */
+ $"1FFF FFFC 0FFF FFF8 07FF FFF0 03FF FFE0" /* .¸.¯.•.ý */
+ $"01FF FFC0 00FF FF80 007F FF00 003F FE00" /* .¿.Ä....?œ. */
+ $"001F FC00 000F F800 0007 F000 0003 E000" /* ..¸...¯...•...ý. */
+ $"0001 C000 0000 8000 6963 6C34 0000 0208" /* ..¿...Ä.icl4.... */
$"0000 0000 0000 000F 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 00FC F000 0000 0000 0000" /* .......üð....... */
- $"0000 0000 0000 0FCC CFD6 D000 FFFF F000" /* .......ÌÏÖÐ.ÿÿð. */
- $"0000 0000 0000 FCCC C556 0000 F767 F000" /* ......üÌÅV..÷gð. */
- $"0000 0000 000F CCCC 566F 0000 F676 F000" /* ......ÌÌVo..övð. */
- $"0000 0000 00FC CCC5 6F5C F000 F767 F000" /* .....üÌÅo\ð.÷gð. */
- $"0000 0000 0FCC CC66 66CC 0F00 F676 F000" /* .....ÌÌffÌ..övð. */
- $"0000 0000 FCCC CCD5 5666 FCF0 F767 F000" /* ....üÌÌÕVfüð÷gð. */
- $"0000 000F CCCC C656 5667 CCCF F676 F000" /* ....ÌÌÆVVgÌÏövð. */
- $"0000 00FC CCCC C6E5 5566 CCCC F767 F000" /* ...üÌÌÆåUfÌÌ÷gð. */
- $"0000 0FCC CCCC C656 5657 CFFF F676 FFFF" /* ...ÌÌÌÆVVWÏÿövÿÿ */
- $"0000 FCCC CCCC C6E5 565C CCF7 6767 67F0" /* ..üÌÌÌÆåV\Ì÷gggð */
- $"000F CCCC CCCC C655 565C CCCF 7676 7F00" /* ..ÌÌÌÌÆUV\ÌÏvv.. */
- $"00FC CCCC CCCC 7660 556C CCCC F767 F000" /* .üÌÌÌÌv`UlÌÌ÷gð. */
- $"0FCC CCCC CCCC CD5D 567C CCCC CF7F CF00" /* .ÌÌÌÌÌÍ]V|ÌÌÏ.Ï. */
- $"FCCC CCCC CCCC 6660 556C CCCC CCFC CCF0" /* üÌÌÌÌÌf`UlÌÌÌüÌð */
- $"0FCC CCCC CCCC 665C 565C CCCC CCCC CCCF" /* .ÌÌÌÌÌf\V\ÌÌÌÌÌÏ */
- $"00FC CCCC CCCC 6660 E6DC CCCC CCCC CCF0" /* .üÌÌÌÌf`æÜÌÌÌÌÌð */
- $"000F CCCC CCCC C650 656C CCCC CCCC CF00" /* ..ÌÌÌÌÆPelÌÌÌÌÏ. */
- $"0000 FCCC CCCC C6EC 5ECC CCCC CCCC F000" /* ..üÌÌÌÆì^ÌÌÌÌÌð. */
- $"0000 0FCC CCCC C650 566C CCCC CCCF 0000" /* ...ÌÌÌÆPVlÌÌÌÏ.. */
- $"0000 00FC CCCC CC50 D5CC CCCC CCF0 0000" /* ...üÌÌÌPÕÌÌÌÌð.. */
- $"0000 000F CCCC CC50 56CC CCCC CF00 0000" /* ....ÌÌÌPVÌÌÌÏ... */
- $"0000 0000 FCCC CCD0 5CCC CCCC F000 0000" /* ....üÌÌÐ\ÌÌÌð... */
- $"0000 0000 0FCC CCD0 DCCC CCCF 0000 0000" /* .....ÌÌÐÜÌÌÏ.... */
- $"0000 0000 00FC CCD0 DCCC CCF0 0000 0000" /* .....üÌÐÜÌÌð.... */
- $"0000 0000 000F CCD0 DCCC CF00 0000 0000" /* ......ÌÐÜÌÏ..... */
- $"0000 0000 0000 FCC0 CCCC F000 0000 0000" /* ......üÀÌÌð..... */
- $"0000 0000 0000 0FCD CCCF 0000 0000 0000" /* .......ÍÌÏ...... */
- $"0000 0000 0000 00FC CCF0 0000 0000 0000" /* .......üÌð...... */
- $"0000 0000 0000 000F CF00 0000 0000 0000" /* ........Ï....... */
- $"0000 0000 0000 0000 F000 0000 0000 0000" /* ........ð....... */
+ $"0000 0000 0000 00FC F000 0000 0000 0000" /* .......¸•....... */
+ $"0000 0000 0000 0FCC CFD6 D000 FFFF F000" /* .......æ÷­.•. */
+ $"0000 0000 0000 FCCC C556 0000 F767 F000" /* ......¸Ã‰V..—g•. */
+ $"0000 0000 000F CCCC 566F 0000 F676 F000" /* ......ÃÃVo..–v•. */
+ $"0000 0000 00FC CCC5 6F5C F000 F767 F000" /* .....¸Ã‰o\•.—g•. */
+ $"0000 0000 0FCC CC66 66CC 0F00 F676 F000" /* .....ÃÃffÃ..–v•. */
+ $"0000 0000 FCCC CCD5 5666 FCF0 F767 F000" /* ....¸ÃùVf¸•—g•. */
+ $"0000 000F CCCC C656 5667 CCCF F676 F000" /* ....ÃÃVVgæ–v•. */
+ $"0000 00FC CCCC C6E5 5566 CCCC F767 F000" /* ...¸ÃÃÂUfÃ×g•. */
+ $"0000 0FCC CCCC C656 5657 CFFF F676 FFFF" /* ...ÃÃÃVVW¦–v */
+ $"0000 FCCC CCCC C6E5 565C CCF7 6767 67F0" /* ..¸ÃÃÃÂV\×ggg• */
+ $"000F CCCC CCCC C655 565C CCCF 7676 7F00" /* ..ÃÃÃÃUV\ævv.. */
+ $"00FC CCCC CCCC 7660 556C CCCC F767 F000" /* .¸ÃÃÃÃv`UlÃ×g•. */
+ $"0FCC CCCC CCCC CD5D 567C CCCC CF7F CF00" /* .ÃÃÃÃÃÕ]V|Ãæ.¦. */
+ $"FCCC CCCC CCCC 6660 556C CCCC CCFC CCF0" /* ¸ÃÃÃÃÃf`UlÃÃøÕ */
+ $"0FCC CCCC CCCC 665C 565C CCCC CCCC CCCF" /* .ÃÃÃÃÃf\V\ÃÃÃÃæ */
+ $"00FC CCCC CCCC 6660 E6DC CCCC CCCC CCF0" /* .¸ÃÃÃÃf`ÊÐÃÃÃÃÕ */
+ $"000F CCCC CCCC C650 656C CCCC CCCC CF00" /* ..ÃÃÃÃPelÃÃÃæ. */
+ $"0000 FCCC CCCC C6EC 5ECC CCCC CCCC F000" /* ..¸ÃÃÃÏ^ÃÃÃÃÕ. */
+ $"0000 0FCC CCCC C650 566C CCCC CCCF 0000" /* ...ÃÃÃPVlÃÃæ.. */
+ $"0000 00FC CCCC CC50 D5CC CCCC CCF0 0000" /* ...¸ÃÃÃP¹ÃÃÃÕ.. */
+ $"0000 000F CCCC CC50 56CC CCCC CF00 0000" /* ....ÃÃÃPVÃÃæ... */
+ $"0000 0000 FCCC CCD0 5CCC CCCC F000 0000" /* ....¸Ãí\ÃÃÕ... */
+ $"0000 0000 0FCC CCD0 DCCC CCCF 0000 0000" /* .....ÃíÐÃæ.... */
+ $"0000 0000 00FC CCD0 DCCC CCF0 0000 0000" /* .....¸Ã­ÐÃÕ.... */
+ $"0000 0000 000F CCD0 DCCC CF00 0000 0000" /* ......íÐæ..... */
+ $"0000 0000 0000 FCC0 CCCC F000 0000 0000" /* ......¸¿ÃÕ..... */
+ $"0000 0000 0000 0FCD CCCF 0000 0000 0000" /* .......Õæ...... */
+ $"0000 0000 0000 00FC CCF0 0000 0000 0000" /* .......¸Ã•...... */
+ $"0000 0000 0000 000F CF00 0000 0000 0000" /* ........¦....... */
+ $"0000 0000 0000 0000 F000 0000 0000 0000" /* ........•....... */
$"6963 6C38 0000 0408 0000 0000 0000 0000" /* icl8............ */
- $"0000 0000 0000 00FF 0000 0000 0000 0000" /* .......ÿ........ */
+ $"0000 0000 0000 00FF 0000 0000 0000 0000" /* ............... */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 FF2B FF00 0000 0000 0000" /* ......ÿ+ÿ....... */
+ $"0000 0000 0000 FF2B FF00 0000 0000 0000" /* ......+....... */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 00FF 2B2B 2BFF 7FEC 7F00 0000" /* .....ÿ+++ÿ.ì.... */
- $"FFFF FFFF FF00 0000 0000 0000 0000 0000" /* ÿÿÿÿÿ........... */
- $"0000 0000 FF2B 2B2B 2BB0 B0EC 0000 0000" /* ....ÿ++++°°ì.... */
- $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* ÿÀìÀÿ........... */
- $"0000 00FF 2B2B 2B2B B0EC ECFF 0000 0000" /* ...ÿ++++°ììÿ.... */
- $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* ÿìÀìÿ........... */
- $"0000 FF2B 2B2B 2BB0 ECFF B02B FF00 0000" /* ..ÿ++++°ìÿ°+ÿ... */
- $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* ÿÀìÀÿ........... */
- $"00FF 2B2B 2B2B ECEC ECEC 2B2B 00FF 0000" /* .ÿ++++ìììì++.ÿ.. */
- $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* ÿìÀìÿ........... */
- $"FF2B 2B2B 2B2B F9B0 B0EC ECEC FF2B FF00" /* ÿ+++++ù°°ìììÿ+ÿ. */
- $"FFC0 ECC0 FF00 0000 0000 0000 0000 00FF" /* ÿÀìÀÿ..........ÿ */
- $"2B2B 2B2B 2BEC B0EC B0EC ECC0 2B2B 2BFF" /* +++++ì°ì°ììÀ+++ÿ */
- $"FFEC C0EC FF00 0000 0000 0000 0000 FF2B" /* ÿìÀìÿ.........ÿ+ */
- $"2B2B 2B2B 2BEC FCB0 B0B0 ECEC 2B2B 2B2B" /* +++++ìü°°°ìì++++ */
- $"FFC0 ECC0 FF00 0000 0000 0000 00FF 2B2B" /* ÿÀìÀÿ........ÿ++ */
- $"2B2B 2B2B 2BEC B0EC B0EC B0C0 2BFF FFFF" /* +++++ì°ì°ì°À+ÿÿÿ */
- $"FFEC C0EC FFFF FFFF 0000 0000 FF2B 2B2B" /* ÿìÀìÿÿÿÿ....ÿ+++ */
- $"2B2B 2B2B 2BEC FCB0 B0EC B02B 2B2B FFC0" /* +++++ìü°°ì°+++ÿÀ */
- $"ECC0 ECC0 ECC0 FF00 0000 00FF 2B2B 2B2B" /* ìÀìÀìÀÿ....ÿ++++ */
- $"2B2B 2B2B 2BEC B0B0 B0EC B02B 2B2B 2BFF" /* +++++ì°°°ì°++++ÿ */
- $"C0EC C0EC C0FF 0000 0000 FF2B 2B2B 2B2B" /* ÀìÀìÀÿ....ÿ+++++ */
- $"2B2B 2B2B C0EC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++Àìì.°°ì+++++ */
- $"FFC0 ECC0 FF00 0000 00FF 2B2B 2B2B 2B2B" /* ÿÀìÀÿ....ÿ++++++ */
- $"2B2B 2B2B 2BF9 B0F9 B0EC C02B 2B2B 2B2B" /* +++++ù°ù°ìÀ+++++ */
- $"2BFF C0FF 2BFF 0000 FF2B 2B2B 2B2B 2B2B" /* +ÿÀÿ+ÿ..ÿ+++++++ */
- $"2B2B 2B2B ECEC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++ììì.°°ì+++++ */
- $"2B2B FF2B 2B2B FF00 00FF 2B2B 2B2B 2B2B" /* ++ÿ+++ÿ..ÿ++++++ */
- $"2B2B 2B2B ECEC B02B B0EC B02B 2B2B 2B2B" /* ++++ìì°+°ì°+++++ */
- $"2B2B 2B2B 2B2B 2BFF 0000 FF2B 2B2B 2B2B" /* +++++++ÿ..ÿ+++++ */
- $"2B2B 2B2B ECEC EC00 FCEC F92B 2B2B 2B2B" /* ++++ììì.üìù+++++ */
- $"2B2B 2B2B 2B2B FF00 0000 00FF 2B2B 2B2B" /* ++++++ÿ....ÿ++++ */
- $"2B2B 2B2B 2BEC B000 ECB0 EC2B 2B2B 2B2B" /* +++++ì°.ì°ì+++++ */
- $"2B2B 2B2B 2BFF 0000 0000 0000 FF2B 2B2B" /* +++++ÿ......ÿ+++ */
- $"2B2B 2B2B 2BEC FC2B B0FC 2B2B 2B2B 2B2B" /* +++++ìü+°ü++++++ */
- $"2B2B 2B2B FF00 0000 0000 0000 00FF 2B2B" /* ++++ÿ........ÿ++ */
- $"2B2B 2B2B 2BEC B000 B0EC EC2B 2B2B 2B2B" /* +++++ì°.°ìì+++++ */
- $"2B2B 2BFF 0000 0000 0000 0000 0000 FF2B" /* +++ÿ..........ÿ+ */
- $"2B2B 2B2B 2B2B B000 7FB0 2B2B 2B2B 2B2B" /* ++++++°..°++++++ */
- $"2B2B FF00 0000 0000 0000 0000 0000 00FF" /* ++ÿ............ÿ */
- $"2B2B 2B2B 2B2B B000 B0EC 2B2B 2B2B 2B2B" /* ++++++°.°ì++++++ */
- $"2BFF 0000 0000 0000 0000 0000 0000 0000" /* +ÿ.............. */
- $"FF2B 2B2B 2B2B F900 B02B 2B2B 2B2B 2B2B" /* ÿ+++++ù.°+++++++ */
- $"FF00 0000 0000 0000 0000 0000 0000 0000" /* ÿ............... */
- $"00FF 2B2B 2B2B F900 F92B 2B2B 2B2B 2BFF" /* .ÿ++++ù.ù++++++ÿ */
+ $"0000 0000 00FF 2B2B 2BFF 7FEC 7F00 0000" /* .....+++.Ï.... */
+ $"FFFF FFFF FF00 0000 0000 0000 0000 0000" /* ........... */
+ $"0000 0000 FF2B 2B2B 2BB0 B0EC 0000 0000" /* ....++++ƒƒÏ.... */
+ $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* ¿Ï¿........... */
+ $"0000 00FF 2B2B 2B2B B0EC ECFF 0000 0000" /* ...++++ƒÏÏ.... */
+ $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* Ï¿Ï........... */
+ $"0000 FF2B 2B2B 2BB0 ECFF B02B FF00 0000" /* ..++++ƒÏƒ+... */
+ $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* ¿Ï¿........... */
+ $"00FF 2B2B 2B2B ECEC ECEC 2B2B 00FF 0000" /* .++++ÏÏÏÏ++... */
+ $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* Ï¿Ï........... */
+ $"FF2B 2B2B 2B2B F9B0 B0EC ECEC FF2B FF00" /* +++++˜ƒƒÏÏÏ+. */
+ $"FFC0 ECC0 FF00 0000 0000 0000 0000 00FF" /* ¿Ï¿.......... */
+ $"2B2B 2B2B 2BEC B0EC B0EC ECC0 2B2B 2BFF" /* +++++σσÏÏ¿+++ */
+ $"FFEC C0EC FF00 0000 0000 0000 0000 FF2B" /* Ï¿Ï.........+ */
+ $"2B2B 2B2B 2BEC FCB0 B0B0 ECEC 2B2B 2B2B" /* +++++ϸƒƒƒÏÏ++++ */
+ $"FFC0 ECC0 FF00 0000 0000 0000 00FF 2B2B" /* ¿Ï¿........++ */
+ $"2B2B 2B2B 2BEC B0EC B0EC B0C0 2BFF FFFF" /* +++++σσσ¿+ */
+ $"FFEC C0EC FFFF FFFF 0000 0000 FF2B 2B2B" /* Ï¿Ï....+++ */
+ $"2B2B 2B2B 2BEC FCB0 B0EC B02B 2B2B FFC0" /* +++++ϸƒƒÏƒ+++¿ */
+ $"ECC0 ECC0 ECC0 FF00 0000 00FF 2B2B 2B2B" /* Ï¿Ï¿Ï¿....++++ */
+ $"2B2B 2B2B 2BEC B0B0 B0EC B02B 2B2B 2BFF" /* +++++σƒƒÏƒ++++ */
+ $"C0EC C0EC C0FF 0000 0000 FF2B 2B2B 2B2B" /* ¿Ï¿Ï¿....+++++ */
+ $"2B2B 2B2B C0EC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++¿ÏÏ.ƒƒÏ+++++ */
+ $"FFC0 ECC0 FF00 0000 00FF 2B2B 2B2B 2B2B" /* ¿Ï¿....++++++ */
+ $"2B2B 2B2B 2BF9 B0F9 B0EC C02B 2B2B 2B2B" /* +++++˜ƒ˜ƒÏ¿+++++ */
+ $"2BFF C0FF 2BFF 0000 FF2B 2B2B 2B2B 2B2B" /* +¿+..+++++++ */
+ $"2B2B 2B2B ECEC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++ÏÏÏ.ƒƒÏ+++++ */
+ $"2B2B FF2B 2B2B FF00 00FF 2B2B 2B2B 2B2B" /* +++++..++++++ */
+ $"2B2B 2B2B ECEC B02B B0EC B02B 2B2B 2B2B" /* ++++Ïσ+ƒÏƒ+++++ */
+ $"2B2B 2B2B 2B2B 2BFF 0000 FF2B 2B2B 2B2B" /* +++++++..+++++ */
+ $"2B2B 2B2B ECEC EC00 FCEC F92B 2B2B 2B2B" /* ++++ÏÏÏ.¸Ï˜+++++ */
+ $"2B2B 2B2B 2B2B FF00 0000 00FF 2B2B 2B2B" /* ++++++....++++ */
+ $"2B2B 2B2B 2BEC B000 ECB0 EC2B 2B2B 2B2B" /* +++++σ.σÏ+++++ */
+ $"2B2B 2B2B 2BFF 0000 0000 0000 FF2B 2B2B" /* +++++......+++ */
+ $"2B2B 2B2B 2BEC FC2B B0FC 2B2B 2B2B 2B2B" /* +++++ϸ+ƒ¸++++++ */
+ $"2B2B 2B2B FF00 0000 0000 0000 00FF 2B2B" /* ++++........++ */
+ $"2B2B 2B2B 2BEC B000 B0EC EC2B 2B2B 2B2B" /* +++++σ.ƒÏÏ+++++ */
+ $"2B2B 2BFF 0000 0000 0000 0000 0000 FF2B" /* +++..........+ */
+ $"2B2B 2B2B 2B2B B000 7FB0 2B2B 2B2B 2B2B" /* ++++++ƒ..ƒ++++++ */
+ $"2B2B FF00 0000 0000 0000 0000 0000 00FF" /* ++............ */
+ $"2B2B 2B2B 2B2B B000 B0EC 2B2B 2B2B 2B2B" /* ++++++ƒ.ƒÏ++++++ */
+ $"2BFF 0000 0000 0000 0000 0000 0000 0000" /* +.............. */
+ $"FF2B 2B2B 2B2B F900 B02B 2B2B 2B2B 2B2B" /* +++++˜.ƒ+++++++ */
+ $"FF00 0000 0000 0000 0000 0000 0000 0000" /* ............... */
+ $"00FF 2B2B 2B2B F900 F92B 2B2B 2B2B 2BFF" /* .++++˜.˜++++++ */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 FF2B 2B2B F900 F92B 2B2B 2B2B FF00" /* ..ÿ+++ù.ù+++++ÿ. */
+ $"0000 FF2B 2B2B F900 F92B 2B2B 2B2B FF00" /* ..+++˜.˜+++++. */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 00FF 2B2B F900 F92B 2B2B 2BFF 0000" /* ...ÿ++ù.ù++++ÿ.. */
+ $"0000 00FF 2B2B F900 F92B 2B2B 2BFF 0000" /* ...++˜.˜++++.. */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 FF2B 2B00 2B2B 2B2B FF00 0000" /* ....ÿ++.++++ÿ... */
+ $"0000 0000 FF2B 2B00 2B2B 2B2B FF00 0000" /* ....++.++++... */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 00FF 2BF9 2B2B 2BFF 0000 0000" /* .....ÿ+ù+++ÿ.... */
+ $"0000 0000 00FF 2BF9 2B2B 2BFF 0000 0000" /* .....+˜+++.... */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 FF2B 2B2B FF00 0000 0000" /* ......ÿ+++ÿ..... */
+ $"0000 0000 0000 FF2B 2B2B FF00 0000 0000" /* ......+++..... */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......ÿ+ÿ...... */
+ $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......+...... */
$"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
- $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ........ÿ....... */
+ $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ............... */
$"0000 0000 0000 0000" /* ........ */
};
diff --git a/tk/mac/tclets.tcl b/tk/mac/tclets.tcl
index 9acb5c786cf..fa147e82819 100644
--- a/tk/mac/tclets.tcl
+++ b/tk/mac/tclets.tcl
@@ -3,9 +3,10 @@
# Drag & Drop Tclets
# by Ray Johnson
#
-# A simple way to create Tcl applications. This applications will copy a droped Tcl file
-# into a copy of a stub application (the user can pick). The file is placed into the
-# TEXT resource named "tclshrc" which is automatically executed on startup.
+# A simple way to create Tcl applications. This applications will copy a
+# droped Tcl file into a copy of a stub application (the user can pick).
+# The file is placed into the TEXT resource named "tclshrc" which is
+# automatically executed on startup.
#
# RCS: @(#) $Id$
#
@@ -15,13 +16,17 @@
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# tkOpenDocument --
+namespace eval ::tk {}
+namespace eval ::tk::mac {}
+
+# ::tk::mac::OpenDocument --
#
# This procedure is a called whenever Wish recieves an "Open" event. The
-# procedure must be named tkOpenDocument for this to work. Passed in files
-# are assumed to be Tcl files that the user wants to be made into Tclets.
-# (Only the first one is used.) The procedure then creates a copy of the
-# stub app and places the Tcl file in the new application's resource fork.
+# procedure must be named ::tk::mac::OpenDocument for this to work.
+# Passed in files are assumed to be Tcl files that the user wants to be
+# made into Tclets. (Only the first one is used.) The procedure then
+# creates a copy of the stub app and places the Tcl file in the new
+# application's resource fork.
#
# Parameters:
# args List of files
@@ -29,8 +34,8 @@
# Results:
# One success a new Tclet is created.
-proc tkOpenDocument {args} {
- global droped_to_start
+proc ::tk::mac::OpenDocument {args} {
+ variable Droped_to_start
# We only deal with the one file droped on the App
set tclFile [lindex $args 0]
@@ -38,7 +43,7 @@ proc tkOpenDocument {args} {
# Give a helper screen to guide user
toplevel .helper -menu .bar
- unsupported1 style .helper dBoxProc
+ ::tk::unsupported::MacWindowStyle style .helper dBoxProc
message .helper.m -aspect 300 -text \
"Select the name & location of your target Tcl application."
pack .helper.m
@@ -59,10 +64,10 @@ proc tkOpenDocument {args} {
close $id
# This is a hint to the start-up code - always set to true
- set droped_to_start true
+ set Droped_to_start true
}
-# GetStub --
+# ::tk::mac::GetStub --
#
# Get the location of our stub application. The value may be cached,
# in the preferences file, or we may need to ask the user.
@@ -73,11 +78,12 @@ proc tkOpenDocument {args} {
# Results:
# A path to the stub application.
-proc GetStub {} {
- global env stub_location
+proc ::tk::mac::GetStub {} {
+ global env
+ variable Stub_location
- if {[info exists stub_location]} {
- return $stub_location
+ if {[info exists Stub_location]} {
+ return $Stub_location
}
set file $env(PREF_FOLDER)
@@ -86,21 +92,21 @@ proc GetStub {} {
if {[file exists $file]} {
uplevel #0 [list source $file]
- if {[info exists stub_location] && [file exists $stub_location]} {
- return $stub_location
+ if {[info exists Stub_location] && [file exists $Stub_location]} {
+ return $Stub_location
}
}
SelectStub
- if {[info exists stub_location]} {
- return $stub_location
+ if {[info exists Stub_location]} {
+ return $Stub_location
} else {
exit
}
}
-# SelectStub --
+# ::tk::mac::SelectStub --
#
# This procedure uses tk_getOpenFile to allow the user to select
# the copy of "Wish" that is used as the basis for Tclets. The
@@ -112,12 +118,13 @@ proc GetStub {} {
# Results:
# None. The prefernce file is updated.
-proc SelectStub {} {
- global env stub_location
+proc ::tk::mac::SelectStub {} {
+ global env
+ variable Stub_location
# Give a helper screen to guide user
toplevel .helper -menu .bar
- unsupported1 style .helper dBoxProc
+ ::tk::unsupported::MacWindowStyle style .helper dBoxProc
message .helper.m -aspect 300 -text \
"Select \"Wish\" stub to clone. A copy of this application will be made to create your Tclet." \
@@ -128,16 +135,17 @@ proc SelectStub {} {
set new_location [tk_getOpenFile]
destroy .helper
if {$new_location != ""} {
- set stub_location $new_location
+ set Stub_location $new_location
set file [file join $env(PREF_FOLDER) "D&D Tclet Preferences"]
set id [open $file w]
- puts $id [list set stub_location $stub_location]
+ puts $id [list set [namespace which -variable Stub_location] \
+ $Stub_location]
close $id
}
}
-# CreateMenus --
+# ::tk::mac::CreateMenus --
#
# Create the menubar for this application.
#
@@ -147,23 +155,25 @@ proc SelectStub {} {
# Results:
# None.
-proc CreateMenus {} {
+proc ::tk::mac::CreateMenus {} {
menu .bar
.bar add cascade -menu .bar.file -label File
.bar add cascade -menu .bar.apple
. configure -menu .bar
menu .bar.apple -tearoff 0
- .bar.apple add command -label "About Drag & Drop Tclets..." -command {ShowAbout}
+ .bar.apple add command -label "About Drag & Drop Tclets..." \
+ -command [namespace code ShowAbout]
menu .bar.file -tearoff 0
.bar.file add command -label "Show Console..." -command {console show}
- .bar.file add command -label "Select Wish Stub..." -command {SelectStub}
+ .bar.file add command -label "Select Wish Stub..." \
+ -command [namespace code SelectStub]
.bar.file add separator
.bar.file add command -label "Quit" -accel Command-Q -command exit
}
-# ShowAbout --
+# ::tk::mac::ShowAbout --
#
# Show the about box for Drag & Drop Tclets.
#
@@ -173,14 +183,14 @@ proc CreateMenus {} {
# Results:
# None.
-proc ShowAbout {} {
+proc ::tk::mac::ShowAbout {} {
tk_messageBox -icon info -type ok -message \
"Drag & Drop Tclets
by Ray Johnson\n\n\
Copyright (c) 1997 Sun Microsystems, Inc."
}
-# Start --
+# ::tk::mac::Start --
#
# This procedure provides the main start-up code for the application.
# It should be run first thing on start up. It will create the UI
@@ -192,8 +202,8 @@ Copyright (c) 1997 Sun Microsystems, Inc."
# Results:
# None.
-proc Start {} {
- global droped_to_start
+proc ::tk::mac::Start {} {
+ variable Droped_to_start
# Hide . & console - see if we ran as a droped item
wm geometry . 1x1-25000-25000
@@ -201,9 +211,9 @@ proc Start {} {
# Run update - if we get any drop events we know that we were
# started by a drag & drop - if so, we quit automatically when done
- set droped_to_start false
+ set Droped_to_start false
update
- if {$droped_to_start == "true"} {
+ if {$Droped_to_start == "true"} {
exit
}
@@ -212,5 +222,4 @@ proc Start {} {
}
# Now that everything is defined, lets start the app!
-Start
-
+::tk::mac::Start
diff --git a/tk/mac/tkMac.h b/tk/mac/tkMac.h
index c6b3044ac84..362f6f9a3d9 100644
--- a/tk/mac/tkMac.h
+++ b/tk/mac/tkMac.h
@@ -14,17 +14,21 @@
#ifndef _TKMAC
#define _TKMAC
+#ifndef _TK
+#include <tk.h>
+#endif
+
+#ifndef _TKINT
+#include "tkInt.h"
+#endif
+
#include <Windows.h>
#include <QDOffscreen.h>
-#include "tkInt.h"
-/*
- * "export" is a MetroWerks specific pragma. It flags the linker that
- * any symbols that are defined when this pragma is on will be exported
- * to shared libraries that link with this library.
- */
-
-#pragma export on
+#ifdef BUILD_tk
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLEXPORT
+#endif
/*
* This variable is exported and can be used by extensions. It is the
@@ -44,14 +48,9 @@ typedef int (Tk_MacEmbedMakeContainerExistProc) (Tk_Window window);
typedef void (Tk_MacEmbedGetClipProc) (Tk_Window window, RgnHandle rgn);
typedef void (Tk_MacEmbedGetOffsetInParentProc) (Tk_Window window, Point *ulCorner);
-/*
- * These functions are currently in tkMacInt.h. They are just copied over here
- * so they can be exported.
- */
-
#include "tkPlatDecls.h"
-#pragma export reset
+# undef TCL_STORAGE_CLASS
+# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKMAC */
-
diff --git a/tk/mac/tkMacAppInit.c b/tk/mac/tkMacAppInit.c
index e57649aa09d..11cfccfba48 100644
--- a/tk/mac/tkMacAppInit.c
+++ b/tk/mac/tkMacAppInit.c
@@ -25,6 +25,7 @@
#include "tkMacInt.h"
#include "tclInt.h"
#include "tclMac.h"
+#include "tclMacInt.h"
#ifdef TK_TEST
extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
@@ -49,20 +50,21 @@ void RemoveConsole _ANSI_ARGS_((void));
long WriteCharsToConsole _ANSI_ARGS_((char *buff, long n));
long ReadCharsFromConsole _ANSI_ARGS_((char *buff, long n));
extern char * __ttyname _ANSI_ARGS_((long fildes));
+int kbhit _ANSI_ARGS_((void));
+int getch _ANSI_ARGS_((void));
+void clrscr _ANSI_ARGS_((void));
short SIOUXHandleOneEvent _ANSI_ARGS_((EventRecord *event));
/*
- * Prototypes for functions from the tkConsole.c file.
- */
-
-EXTERN void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
- int devId, char *buffer, long size));
-/*
* Forward declarations for procedures defined later in this file:
*/
static int MacintoshInit _ANSI_ARGS_((void));
static int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
+static void SetupSIOUX _ANSI_ARGS_((void));
+
+static int inMacExit = 0;
+static pascal void NoMoreOutput() { inMacExit = 1; }
/*
*----------------------------------------------------------------------
@@ -325,6 +327,8 @@ SetupMainInterp(
if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
goto error;
}
+ SetupSIOUX();
+ TclMacInstallExitToShellPatch(NoMoreOutput);
}
/*
@@ -374,8 +378,15 @@ RemoveConsole(void)
long
WriteCharsToConsole(char *buffer, long n)
{
- TkConsolePrint(gStdoutInterp, TCL_STDOUT, buffer, n);
- return n;
+ if (!inMacExit) {
+ Tcl_DString ds;
+ Tcl_ExternalToUtfDString(NULL, buffer, n, &ds);
+ TkConsolePrint(gStdoutInterp, TCL_STDOUT, Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
+ return n;
+ } else {
+ return 0;
+ }
}
long
@@ -396,9 +407,37 @@ __ttyname(long fildes)
return (0L);
}
+int kbhit(void)
+{
+ return 0;
+}
+
+int getch(void)
+{
+ return 0;
+}
+
+void clrscr(void)
+{
+ return;
+}
+
short
SIOUXHandleOneEvent(EventRecord *event)
{
return 0;
}
-
+static void SetupSIOUX(void) {
+#ifndef STATIC_BUILD
+ extern DLLIMPORT void SetupConsolePlugins(void*, void*, void*, void*,
+ void*, void*, void*, void*);
+ SetupConsolePlugins( &InstallConsole,
+ &RemoveConsole,
+ &WriteCharsToConsole,
+ &ReadCharsFromConsole,
+ &__ttyname,
+ &kbhit,
+ &getch,
+ &clrscr);
+#endif
+}
diff --git a/tk/mac/tkMacAppearanceStubs.c b/tk/mac/tkMacAppearanceStubs.c
index 0c44864c102..0fd0feeddb6 100644
--- a/tk/mac/tkMacAppearanceStubs.c
+++ b/tk/mac/tkMacAppearanceStubs.c
@@ -23,7 +23,6 @@
* them in shell calls.
*/
-#pragma export on
pascal OSStatus
MoveWindowStructure(
WindowPtr window,
@@ -103,4 +102,3 @@ IsValidWindowPtr(GrafPtr grafPort)
return true;
}
-#pragma export reset
diff --git a/tk/mac/tkMacApplication.r b/tk/mac/tkMacApplication.r
index b73e1eaa300..51f0f7038c1 100644
--- a/tk/mac/tkMacApplication.r
+++ b/tk/mac/tkMacApplication.r
@@ -35,24 +35,24 @@
#if (TK_RELEASE_LEVEL == 2)
# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+# define RELEASE_CODE 0x00
#else
# define MINOR_VERSION TK_MINOR_VERSION * 16
+# define RELEASE_CODE TK_RELEASE_SERIAL
#endif
-#define RELEASE_CODE 0x00
-
resource 'vers' (1) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
- TK_PATCH_LEVEL ", by Ray Johnson & Jim Ingham" "\n" "© 1993-1997 Sun Microsystems" "\n" "1998-2000 Scriptics Inc."
+ TK_PATCH_LEVEL ", by Ray Johnson & Jim Ingham" "\n" "© 2001 Tcl Core Team"
};
resource 'vers' (2) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
- "Wish " TK_PATCH_LEVEL " © 1993-1999"
+ "Wish " TK_PATCH_LEVEL " © 1993-2001"
};
#define TK_APP_RESOURCES 128
@@ -94,7 +94,7 @@ resource 'FREF' (TK_APP_RESOURCES+1, purgeable)
type TK_APP_CREATOR as 'STR ';
resource TK_APP_CREATOR (0, purgeable) {
- "Wish " TK_PATCH_LEVEL " © 1996"
+ "Wish " TK_PATCH_LEVEL " © 1993-2001"
};
/*
@@ -277,5 +277,41 @@ data 'ics4' (TK_APP_RESOURCES, "Tk App", purgeable) {
$"0000 000F CF00 0000 0000 0000 F000 0000"
};
+/*
+ * The following resource is used when creating the 'env' variable in
+ * the Macintosh environment. The creation mechanisim looks for the
+ * 'STR#' resource named "Tcl Environment Variables" rather than a
+ * specific resource number. (In other words, feel free to change the
+ * resource id if it conflicts with your application.) Each string in
+ * the resource must be of the form "KEYWORD=SOME STRING". See Tcl
+ * documentation for futher information about the env variable.
+ */
+
+/* A good example of something you may want to set is:
+ * "TCL_LIBRARY=My disk:etc."
+ */
+
+resource 'STR#' (128, "Tcl Environment Variables") {
+ {
+ /*
+ "SCHEDULE_NAME=Agent Controller Schedule",
+ "SCHEDULE_PATH=Lozoya:System Folder:Tcl Lib:Tcl-Scheduler"
+ */
+ };
+};
+data 'alis' (1000, "Library Folder") {
+ $"0000 0000 00BA 0002 0001 012F 0000 0000" /* .....†...../.... */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 0000 985C FB00 4244 0000 0000" /* ......ò\š.BD.... */
+ $"0002 1328 5375 7070 6F72 7420 4C69 6272" /* ...(Support Libr */
+ $"6172 6965 7329 0000 0000 0000 0000 0000" /* aries).......... */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0076 8504 B617 A796 003D 0027 025B" /* ...vÖ..ßñ.=.'.[ */
+ $"01E4 0001 0001 0000 0000 0000 0000 0000" /* .”.............. */
+ $"0000 0000 0000 0000 0001 2F00 0002 0015" /* ........../..... */
+ $"2F3A 2853 7570 706F 7274 204C 6962 7261" /* /:(Support Libra */
+ $"7269 6573 2900 FFFF 0000" /* ries)... */
+};
diff --git a/tk/mac/tkMacBitmap.c b/tk/mac/tkMacBitmap.c
index 3626b9794b8..ccbf2b2296c 100644
--- a/tk/mac/tkMacBitmap.c
+++ b/tk/mac/tkMacBitmap.c
@@ -142,7 +142,7 @@ TkpDefineNativeBitmaps()
Pixmap
TkpCreateNativeBitmap(
Display *display,
- char * source) /* Info about the icon to build. */
+ CONST char * source) /* Info about the icon to build. */
{
Pixmap pix;
GWorldPtr destPort;
@@ -277,4 +277,3 @@ TkpGetNativeAppBitmap(
SetGWorld(saveWorld, saveDevice);
return pix;
}
-
diff --git a/tk/mac/tkMacButton.c b/tk/mac/tkMacButton.c
index 76daa72bccd..effd3e17546 100644
--- a/tk/mac/tkMacButton.c
+++ b/tk/mac/tkMacButton.c
@@ -15,6 +15,7 @@
#include "tkButton.h"
#include "tkMacInt.h"
#include <Controls.h>
+#include <ControlDefinitions.h>
#include <LowMem.h>
#include <Appearance.h>
@@ -104,10 +105,9 @@ static void ButtonExitProc _ANSI_ARGS_((ClientData clientData));
* The class procedure table for the button widgets.
*/
-TkClassProcs tkpButtonProcs = {
- NULL, /* createProc. */
- TkButtonWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+Tk_ClassProcs tkpButtonProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkButtonWorldChanged, /* worldChangedProc */
};
/*
@@ -167,7 +167,9 @@ TkpDisplayButton(
* compiler warning. */
int y, relief;
register Tk_Window tkwin = butPtr->tkwin;
- int width, height;
+ int width, height, fullWidth, fullHeight;
+ int imageXOffset, imageYOffset, textXOffset, textYOffset;
+ int haveImage = 0, haveText = 0;
int offset; /* 0 means this is a normal widget. 1 means
* it is an image button, so we offset the
* image to make the button appear to move
@@ -225,8 +227,11 @@ TkpDisplayButton(
if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) {
if (!TkMacHaveAppearance() || !hasImageOrBitmap) {
- relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN
- : TK_RELIEF_RAISED;
+ if (butPtr->flags & SELECTED) {
+ relief = TK_RELIEF_SUNKEN;
+ } else if (butPtr->overRelief != relief) {
+ relief = butPtr->offRelief;
+ }
}
}
@@ -326,51 +331,157 @@ TkpDisplayButton(
if ((drawType == DRAW_BEVEL) && TkMacHaveAppearance()) {
/* Empty Body */
- } else if (butPtr->image != None) {
- Tk_SizeOfImage(butPtr->image, &width, &height);
-
- imageOrBitmap:
- TkComputeAnchor(butPtr->anchor, tkwin, 0, 0,
- 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) {
+ } else {
+ if (butPtr->image != None) {
+ Tk_SizeOfImage(butPtr->image, &width, &height);
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
+ haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
+
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ imageXOffset = 0;
+ imageYOffset = 0;
+ textXOffset = 0;
+ textYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
+
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ if (butPtr->compound == COMPOUND_TOP) {
+ textYOffset = height + butPtr->padY;
+ } else {
+ imageYOffset = butPtr->textHeight + butPtr->padY;
+ }
+ fullHeight = height + butPtr->textHeight + butPtr->padY;
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ if (butPtr->compound == COMPOUND_LEFT) {
+ textXOffset = width + butPtr->padX;
+ } else {
+ imageXOffset = butPtr->textWidth + butPtr->padX;
+ }
+ fullWidth = butPtr->textWidth + butPtr->padX + width;
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ butPtr->indicatorSpace + fullWidth, fullHeight, &x, &y);
+
+ x += butPtr->indicatorSpace;
+
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);
+ 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 + imageXOffset,
+ y + imageYOffset);
+ } else {
+ Tk_RedrawImage(butPtr->image, 0, 0, width,
+ height, pixmap, x + imageXOffset,
+ y + imageYOffset);
+ }
} else {
- Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap,
- x, y);
+ XSetClipOrigin(butPtr->display, gc, x + imageXOffset,
+ y + imageYOffset);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc,
+ 0, 0, (unsigned int) width,
+ (unsigned int) height, x + imageXOffset,
+ y + imageYOffset, 1);
+ XSetClipOrigin(butPtr->display, gc, 0, 0);
}
+
+ Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
+ x + textXOffset, y + textYOffset, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x + textXOffset, y + textYOffset,
+ butPtr->underline);
+ y += fullHeight/2;
} 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);
+ if (haveImage) {
+ TkComputeAnchor(butPtr->anchor, tkwin, 0, 0,
+ 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 {
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX,
+ butPtr->padY,
+ butPtr->indicatorSpace + butPtr->textWidth,
+ butPtr->textHeight, &x, &y);
+
+ x += butPtr->indicatorSpace;
+
+ Tk_DrawTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x, y, 0, -1);
+ y += butPtr->textHeight/2;
+ }
}
- y += height/2;
- } else if (butPtr->bitmap != None) {
- Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- goto imageOrBitmap;
- } else {
- TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
- butPtr->indicatorSpace + butPtr->textWidth, butPtr->textHeight,
- &x, &y);
-
- x += butPtr->indicatorSpace;
-
- Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
- x, y, 0, -1);
- y += butPtr->textHeight/2;
}
/*
@@ -445,9 +556,15 @@ void
TkpComputeButtonGeometry(
TkButton *butPtr) /* Button whose geometry may have changed. */
{
- int width, height, avgWidth;
+ int width, height, avgWidth, haveImage = 0, haveText = 0;
+ int txtWidth, txtHeight;
Tk_FontMetrics fm;
+ width = 0;
+ height = 0;
+ txtWidth = 0;
+ txtHeight = 0;
+ avgWidth = 0;
/*
* First figure out the size of the contents of the button.
@@ -456,47 +573,108 @@ TkpComputeButtonGeometry(
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;
- }
- }
+ haveImage = 1;
} else if (butPtr->bitmap != None) {
Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- goto imageOrBitmap;
- } else {
+ haveImage = 1;
+ }
+
+ if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) {
Tk_FreeTextLayout(butPtr->textLayout);
butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
- width = butPtr->textWidth;
- height = butPtr->textHeight;
+ txtWidth = butPtr->textWidth;
+ txtHeight = butPtr->textHeight;
avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ haveText = (txtWidth != 0 && txtHeight != 0);
+ }
+
+ /*
+ * If the button is compound (ie, it shows both an image and text),
+ * the new geometry is a combination of the image and text geometry.
+ * We only honor the compound bit if the button has both text and an
+ * image, because otherwise it is not really a compound button.
+ */
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ height += txtHeight + butPtr->padY;
+ width = (width > txtWidth ? width : txtWidth);
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ width += txtWidth + butPtr->padX;
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ width = (width > txtWidth ? width : txtWidth);
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
if (butPtr->width > 0) {
- width = butPtr->width * avgWidth;
+ width = butPtr->width;
}
if (butPtr->height > 0) {
- height = butPtr->height * fm.linespace;
+ height = butPtr->height;
}
+
if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) {
- butPtr->indicatorDiameter = fm.linespace;
+ butPtr->indicatorSpace = height;
if (butPtr->type == TYPE_CHECK_BUTTON) {
- butPtr->indicatorDiameter = (80*butPtr->indicatorDiameter)/100;
+ butPtr->indicatorDiameter = (65*height)/100;
+ } else {
+ butPtr->indicatorDiameter = (75*height)/100;
+ }
+ }
+
+ width += 2*butPtr->padX;
+ height += 2*butPtr->padY;
+
+ } else {
+ if (haveImage) {
+ 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 {
+ width = txtWidth;
+ height = txtHeight;
+ 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 =
+ (80*butPtr->indicatorDiameter)/100;
+ }
+ butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth;
}
- butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth;
}
}
@@ -1519,5 +1697,3 @@ ButtonExitProc(clientData)
DisposeWindow(windowRef);
windowRef = NULL;
}
-
-
diff --git a/tk/mac/tkMacClipboard.c b/tk/mac/tkMacClipboard.c
index ebc4c33c5aa..06979ad6620 100644
--- a/tk/mac/tkMacClipboard.c
+++ b/tk/mac/tkMacClipboard.c
@@ -301,4 +301,3 @@ TkSuspendClipboard()
return;
}
-
diff --git a/tk/mac/tkMacColor.c b/tk/mac/tkMacColor.c
index 055121b2ac8..ada360f2974 100644
--- a/tk/mac/tkMacColor.c
+++ b/tk/mac/tkMacColor.c
@@ -502,4 +502,3 @@ GetMenuPartColor(
return false;
}
}
-
diff --git a/tk/mac/tkMacConfig.c b/tk/mac/tkMacConfig.c
index cf5ba083282..ead3692f57f 100644
--- a/tk/mac/tkMacConfig.c
+++ b/tk/mac/tkMacConfig.c
@@ -38,9 +38,8 @@
Tcl_Obj *
TkpGetSystemDefault(
Tk_Window tkwin, /* A window to use. */
- char *dbName, /* The option database name. */
- char *className) /* The name of the option class. */
+ CONST char *dbName, /* The option database name. */
+ CONST char *className) /* The name of the option class. */
{
return NULL;
}
-
diff --git a/tk/mac/tkMacCursor.c b/tk/mac/tkMacCursor.c
index 58729c42e24..05bd5fd1439 100644
--- a/tk/mac/tkMacCursor.c
+++ b/tk/mac/tkMacCursor.c
@@ -80,7 +80,7 @@ static int gTkOwnsCursor = true; /* A boolean indicating whether
*/
static void FindCursorByName _ANSI_ARGS_ ((TkMacCursor *macCursorPtr,
- char *string));
+ CONST char *string));
/*
*----------------------------------------------------------------------
@@ -105,7 +105,7 @@ static void FindCursorByName _ANSI_ARGS_ ((TkMacCursor *macCursorPtr,
void
FindCursorByName(
TkMacCursor *macCursorPtr,
- char *string)
+ CONST char *string)
{
Handle resource;
Str255 curName;
@@ -200,7 +200,7 @@ TkGetCursorByName(
FindCursorByName(macCursorPtr, string);
if (macCursorPtr->macCursor == NULL) {
- char **argv;
+ CONST char **argv;
int argc, err;
/*
@@ -249,8 +249,8 @@ TkGetCursorByName(
TkCursor *
TkCreateCursorFromData(
Tk_Window tkwin, /* Window in which cursor will be used. */
- char *source, /* Bitmap data for cursor shape. */
- char *mask, /* Bitmap data for cursor mask. */
+ CONST char *source, /* Bitmap data for cursor shape. */
+ CONST char *mask, /* Bitmap data for cursor mask. */
int width, int height, /* Dimensions of cursor. */
int xHot, int yHot, /* Location of hot-spot in cursor. */
XColor fgColor, /* Foreground color for cursor. */
@@ -399,4 +399,3 @@ Tk_MacTkOwnsCursor(
{
gTkOwnsCursor = tkOwnsIt;
}
-
diff --git a/tk/mac/tkMacCursors.r b/tk/mac/tkMacCursors.r
index 6453645b544..0c5b6cb83f8 100644
--- a/tk/mac/tkMacCursors.r
+++ b/tk/mac/tkMacCursors.r
@@ -128,4 +128,3 @@ data 'crsr' (1001, "fist") {
$"0000"
};
-
diff --git a/tk/mac/tkMacDefault.h b/tk/mac/tkMacDefault.h
index bd4dfaf8a13..947b0dc4c0c 100644
--- a/tk/mac/tkMacDefault.h
+++ b/tk/mac/tkMacDefault.h
@@ -54,6 +54,7 @@
#define DEF_BUTTON_BORDER_WIDTH "2"
#define DEF_BUTTON_CURSOR ""
#define DEF_BUTTON_COMMAND ""
+#define DEF_BUTTON_COMPOUND "none"
#define DEF_BUTTON_DEFAULT "disabled"
#define DEF_BUTTON_DISABLED_FG_COLOR DISABLED
#define DEF_BUTTON_DISABLED_FG_MONO ""
@@ -71,12 +72,15 @@
#define DEF_BUTTON_JUSTIFY "center"
#define DEF_BUTTON_OFF_VALUE "0"
#define DEF_BUTTON_ON_VALUE "1"
+#define DEF_BUTTON_OVER_RELIEF ""
#define DEF_BUTTON_PADX "7"
#define DEF_LABCHKRAD_PADX "1"
#define DEF_BUTTON_PADY "3"
#define DEF_LABCHKRAD_PADY "1"
#define DEF_BUTTON_RELIEF "flat"
#define DEF_LABCHKRAD_RELIEF "flat"
+#define DEF_BUTTON_REPEAT_DELAY "0"
+#define DEF_BUTTON_REPEAT_INTERVAL "0"
#define DEF_BUTTON_SELECT_COLOR INDICATOR
#define DEF_BUTTON_SELECT_MONO BLACK
#define DEF_BUTTON_SELECT_IMAGE (char *) NULL
@@ -136,6 +140,9 @@
/* #define DEF_ENTRY_BORDER_WIDTH "2" */
#define DEF_ENTRY_BORDER_WIDTH "1"
#define DEF_ENTRY_CURSOR "xterm"
+#define DEF_ENTRY_DISABLED_BG_COLOR NORMAL_BG
+#define DEF_ENTRY_DISABLED_BG_MONO WHITE
+#define DEF_ENTRY_DISABLED_FG DISABLED
#define DEF_ENTRY_EXPORT_SELECTION "1"
#define DEF_ENTRY_FONT "Helvetica 12"
#define DEF_ENTRY_FG BLACK
@@ -151,6 +158,8 @@
/* #define DEF_ENTRY_INSERT_WIDTH "2" */
#define DEF_ENTRY_INSERT_WIDTH "1"
#define DEF_ENTRY_JUSTIFY "left"
+#define DEF_ENTRY_READONLY_BG_COLOR NORMAL_BG
+#define DEF_ENTRY_READONLY_BG_MONO WHITE
/* #define DEF_ENTRY_RELIEF "sunken" */
#define DEF_ENTRY_RELIEF "solid"
#define DEF_ENTRY_SCROLL_COMMAND ""
@@ -181,20 +190,35 @@
#define DEF_FRAME_HIGHLIGHT_BG NORMAL_BG
#define DEF_FRAME_HIGHLIGHT BLACK
#define DEF_FRAME_HIGHLIGHT_WIDTH "0"
+#define DEF_FRAME_PADX "0"
+#define DEF_FRAME_PADY "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 labelframes:
+ */
+
+#define DEF_LABELFRAME_BORDER_WIDTH "2"
+#define DEF_LABELFRAME_CLASS "Labelframe"
+#define DEF_LABELFRAME_RELIEF "groove"
+#define DEF_LABELFRAME_FG "systemButtonText"
+#define DEF_LABELFRAME_FONT "system"
+#define DEF_LABELFRAME_TEXT ""
+#define DEF_LABELFRAME_LABELANCHOR "nw"
+
+/*
* Defaults for listboxes:
*/
+#define DEF_LISTBOX_ACTIVE_STYLE "underline"
#define DEF_LISTBOX_BG_COLOR NORMAL_BG
#define DEF_LISTBOX_BG_MONO WHITE
#define DEF_LISTBOX_BORDER_WIDTH "1"
#define DEF_LISTBOX_CURSOR ""
+#define DEF_LISTBOX_DISABLED_FG DISABLED
#define DEF_LISTBOX_EXPORT_SELECTION "1"
#define DEF_LISTBOX_FONT "application"
#define DEF_LISTBOX_FG BLACK
@@ -212,6 +236,7 @@
#define DEF_LISTBOX_SELECT_FG_MONO WHITE
#define DEF_LISTBOX_SELECT_MODE "browse"
#define DEF_LISTBOX_SET_GRID "0"
+#define DEF_LISTBOX_STATE "normal"
#define DEF_LISTBOX_TAKE_FOCUS (char *) NULL
#define DEF_LISTBOX_WIDTH "20"
@@ -226,6 +251,7 @@
#define DEF_MENU_ENTRY_BITMAP None
#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
#define DEF_MENU_ENTRY_COMMAND (char *) NULL
+#define DEF_MENU_ENTRY_COMPOUND "none"
#define DEF_MENU_ENTRY_FG (char *) NULL
#define DEF_MENU_ENTRY_FONT (char *) NULL
#define DEF_MENU_ENTRY_HIDE_MARGIN "0"
@@ -335,6 +361,40 @@
#define DEF_MESSAGE_WIDTH "0"
/*
+ * Defaults for panedwindows
+ */
+
+#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG
+#define DEF_PANEDWINDOW_BG_MONO WHITE
+#define DEF_PANEDWINDOW_BORDERWIDTH "2"
+#define DEF_PANEDWINDOW_CURSOR ""
+#define DEF_PANEDWINDOW_HANDLEPAD "8"
+#define DEF_PANEDWINDOW_HANDLESIZE "8"
+#define DEF_PANEDWINDOW_HEIGHT ""
+#define DEF_PANEDWINDOW_OPAQUERESIZE "0"
+#define DEF_PANEDWINDOW_ORIENT "horizontal"
+#define DEF_PANEDWINDOW_RELIEF "flat"
+#define DEF_PANEDWINDOW_SASHCURSOR ""
+#define DEF_PANEDWINDOW_SASHPAD "2"
+#define DEF_PANEDWINDOW_SASHRELIEF "raised"
+#define DEF_PANEDWINDOW_SASHWIDTH "2"
+#define DEF_PANEDWINDOW_SHOWHANDLE "0"
+#define DEF_PANEDWINDOW_WIDTH ""
+
+/*
+ * Defaults for panedwindow panes
+ */
+
+#define DEF_PANEDWINDOW_PANE_AFTER ""
+#define DEF_PANEDWINDOW_PANE_BEFORE ""
+#define DEF_PANEDWINDOW_PANE_HEIGHT ""
+#define DEF_PANEDWINDOW_PANE_MINSIZE "0"
+#define DEF_PANEDWINDOW_PANE_PADX "0"
+#define DEF_PANEDWINDOW_PANE_PADY "0"
+#define DEF_PANEDWINDOW_PANE_STICKY "nsew"
+#define DEF_PANEDWINDOW_PANE_WIDTH ""
+
+/*
* Defaults for scales:
*/
@@ -408,6 +468,7 @@
* Defaults for texts:
*/
+#define DEF_TEXT_AUTO_SEPARATORS "1"
#define DEF_TEXT_BG_COLOR NORMAL_BG
#define DEF_TEXT_BG_MONO WHITE
#define DEF_TEXT_BORDER_WIDTH "0"
@@ -425,6 +486,7 @@
#define DEF_TEXT_INSERT_OFF_TIME "300"
#define DEF_TEXT_INSERT_ON_TIME "600"
#define DEF_TEXT_INSERT_WIDTH "1"
+#define DEF_TEXT_MAX_UNDO "0"
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "flat"
@@ -442,11 +504,11 @@
#define DEF_TEXT_STATE "normal"
#define DEF_TEXT_TABS ""
#define DEF_TEXT_TAKE_FOCUS (char *) NULL
+#define DEF_TEXT_UNDO "0"
#define DEF_TEXT_WIDTH "80"
#define DEF_TEXT_WRAP "char"
#define DEF_TEXT_XSCROLL_COMMAND ""
#define DEF_TEXT_YSCROLL_COMMAND ""
-#define DEF_TEXT_TAB_SIZE "8"
/*
* Defaults for canvas text:
@@ -462,6 +524,6 @@
#define DEF_TOPLEVEL_CLASS "Toplevel"
#define DEF_TOPLEVEL_MENU ""
#define DEF_TOPLEVEL_SCREEN ""
+#define DEF_TOPLEVEL_USE ""
#endif /* _TKMACDEFAULT */
-
diff --git a/tk/mac/tkMacDialog.c b/tk/mac/tkMacDialog.c
index d401039a005..060b45f4a44 100644
--- a/tk/mac/tkMacDialog.c
+++ b/tk/mac/tkMacDialog.c
@@ -141,7 +141,7 @@ Tk_ChooseColorObjCmd(
OSErr err;
static inited = 0;
static RGBColor in;
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-initialcolor", "-parent", "-title", NULL
};
enum options {
@@ -228,7 +228,7 @@ Tk_ChooseColorObjCmd(
cpinfo.theColor.color.rgb.green = in.green;
cpinfo.theColor.color.rgb.blue = in.blue;
cpinfo.dstProfile = 0L;
- cpinfo.flags = CanModifyPalette | CanAnimatePalette;
+ cpinfo.flags = kColorPickerCanModifyPalette | kColorPickerCanAnimatePalette;
cpinfo.placeWhere = kDeepestColorScreen;
cpinfo.pickerType = 0L;
cpinfo.eventProc = NULL;
@@ -304,7 +304,7 @@ Tk_GetOpenFileObjCmd(
Str255 message, title;
AEDesc initialDesc = {typeNull, NULL};
FSSpec dirSpec;
- static char *openOptionStrings[] = {
+ static CONST char *openOptionStrings[] = {
"-defaultextension", "-filetypes",
"-initialdir", "-initialfile",
"-message", "-multiple",
@@ -453,12 +453,12 @@ Tk_GetSaveFileObjCmd(
FSSpec dirSpec;
Str255 title, message;
OpenFileData ofd;
- static char *saveOptionStrings[] = {
- "-defaultextension", "-initialdir", "-initialfile",
+ static CONST char *saveOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
"-message", "-parent", "-title", NULL
};
enum saveOptions {
- SAVE_DEFAULT, SAVE_INITDIR, SAVE_INITFILE,
+ SAVE_DEFAULT, SAVE_TYPES, SAVE_INITDIR, SAVE_INITFILE,
SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE
};
@@ -493,6 +493,8 @@ Tk_GetSaveFileObjCmd(
switch (index) {
case SAVE_DEFAULT:
break;
+ case SAVE_TYPES:
+ break;
case SAVE_INITDIR:
choice = Tcl_GetStringFromObj(objv[i + 1], NULL);
if (HandleInitialDirectory(interp, choice, &dirSpec,
@@ -593,7 +595,7 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
Str255 message, title;
int srcRead, dstWrote;
OpenFileData ofd;
- static char *chooseOptionStrings[] = {
+ static CONST char *chooseOptionStrings[] = {
"-initialdir", "-message", "-mustexist", "-parent", "-title", NULL
};
enum chooseOptions {
@@ -712,7 +714,7 @@ HandleInitialDirectory (
Tcl_AppendResult(interp, "bad directory \"", initialDir, "\"", NULL);
return TCL_ERROR;
}
- err = FSpGetDirectoryID(dirSpec, &dirID, &isDirectory);
+ err = FSpGetDirectoryIDTcl(dirSpec, &dirID, &isDirectory);
if ((err != noErr) || !isDirectory) {
Tcl_AppendResult(interp, "bad directory \"", initialDir, "\"", NULL);
return TCL_ERROR;
@@ -1048,16 +1050,17 @@ OpenEventProc(
{
NavMenuItemSpec *chosenItem;
OpenFileData *ofd = (OpenFileData *) callBackUD;
- static SInt32 otherEvent = ~(kNavCBCustomize|kNavCBStart|kNavCBTerminate
- |kNavCBNewLocation|kNavCBShowDesktop|kNavCBSelectEntry|kNavCBAccept
- |kNavCBCancel|kNavCBAdjustPreview);
if (callBackSelector == kNavCBPopupMenuSelect) {
chosenItem = (NavMenuItemSpec *) callBackParams->eventData.eventDataParms.param;
ofd->curType = chosenItem->menuType;
- } else if (callBackSelector == kNavCBAdjustRect || callBackSelector & otherEvent != 0) {
- while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT|TCL_WINDOW_EVENTS)) {
- /* Empty Body */
+ } else if (callBackSelector == kNavCBEvent) {
+ if (callBackParams->eventData.eventDataParms.event->what == updateEvt) {
+ if (TkMacConvertEvent( callBackParams->eventData.eventDataParms.event)) {
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS|TCL_DONT_WAIT|TCL_WINDOW_EVENTS)) {
+ /* Empty Body */
+ }
+ }
}
}
}
@@ -1121,7 +1124,7 @@ StdGetFile(
if (isOpen == OPEN_FILE) {
if (ofd != NULL && ofd->usePopup) {
CustomGetFile(openFilter, (short) -1, NULL, &reply, OPEN_BOX,
- mypoint, openHook, NULL, NULL, NULL, (void*) &ofd);
+ mypoint, openHook, NULL, NULL, NULL, (void*) ofd);
} else {
StandardGetFile(NULL, -1, NULL, &reply);
}
@@ -1213,7 +1216,7 @@ OpenHookProc(
if (ofdPtr->usePopup) {
GetDialogItem(theDialog, ofdPtr->popupItem,
&ignore, &handle, &rect);
- newType = GetCtlValue((ControlRef) handle) - 1;
+ newType = GetControlValue((ControlRef) handle) - 1;
if (ofdPtr->curType != newType) {
if (newType<0 || newType>ofdPtr->fl.numFilters) {
/*
diff --git a/tk/mac/tkMacDraw.c b/tk/mac/tkMacDraw.c
index 0b4a130c28c..8e659e9c1eb 100644
--- a/tk/mac/tkMacDraw.c
+++ b/tk/mac/tkMacDraw.c
@@ -370,6 +370,9 @@ TkPutImage(
pixmap.pmTable = NULL;
pixmap.pmReserved = 0;
pixmap.baseAddr = image->data;
+ if (image->bytes_per_line >= 0x4000) {
+ panic("TkImage too wide!");
+ }
pixmap.rowBytes = image->bytes_per_line | 0x8000;
CopyBits((BitMap *) &pixmap, &((GrafPtr) destPort)->portBits,
@@ -1191,4 +1194,3 @@ TkpDrawHighlightBorder (
}
}
}
-
diff --git a/tk/mac/tkMacEmbed.c b/tk/mac/tkMacEmbed.c
index 72afb1a1856..f15d709c1f5 100644
--- a/tk/mac/tkMacEmbed.c
+++ b/tk/mac/tkMacEmbed.c
@@ -232,7 +232,7 @@ TkpUseWindow(
* if string is bogus. */
Tk_Window tkwin, /* Tk window that does not yet have an
* associated X window. */
- char *string) /* String identifying an X window to use
+ CONST char *string) /* String identifying an X window to use
* for tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
@@ -620,7 +620,7 @@ TkpTestembedCmd(
ClientData clientData, /* Main window for application. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- char **argv) /* Argument strings. */
+ CONST char **argv) /* Argument strings. */
{
int all;
Container *containerPtr;
@@ -1190,4 +1190,3 @@ EmbedWindowDeleted(winPtr)
}
}
-
diff --git a/tk/mac/tkMacFont.c b/tk/mac/tkMacFont.c
index 7a1314f3887..fd98d650fad 100644
--- a/tk/mac/tkMacFont.c
+++ b/tk/mac/tkMacFont.c
@@ -257,7 +257,7 @@ static void ReleaseFont(MacFont *fontPtr);
static void ReleaseSubFont(SubFont *subFontPtr);
static int SeenName(CONST char *name, Tcl_DString *dsPtr);
-static char * BreakLine(FontFamily *familyPtr, int flags,
+static CONST char * BreakLine(FontFamily *familyPtr, int flags,
CONST char *source, int numBytes, int *widthPtr);
static int GetFamilyNum(CONST char *faceName, short *familyPtr);
static int GetFamilyOrAliasNum(CONST char *faceName,
@@ -326,7 +326,7 @@ TkpFontPkgInit(mainPtr)
*/
fontMenu = NewMenu('FT', "\px");
- AddResMenu(fontMenu, 'FONT');
+ AppendResMenu(fontMenu, 'FONT');
numFonts = CountMItems(fontMenu);
tmpFontNameMap = (FontNameMap *) ckalloc(sizeof(FontNameMap) * numFonts);
@@ -761,7 +761,7 @@ Tk_MeasureChars(
int widthLeft;
FontFamily *thisFamilyPtr;
Tcl_UniChar ch;
- char *rest;
+ CONST char *rest;
/*
* How many chars will fit in the space allotted?
@@ -835,7 +835,7 @@ Tk_MeasureChars(
*---------------------------------------------------------------------------
*/
-static char *
+static CONST char *
BreakLine(
FontFamily *familyPtr, /* FontFamily that describes the font values
* that are already selected into the graphics
@@ -2149,4 +2149,3 @@ GetFontEncoding(
}
return Tcl_GetEncoding(NULL, name);
}
-
diff --git a/tk/mac/tkMacHLEvents.c b/tk/mac/tkMacHLEvents.c
index 69d1610ab33..40758dc34b0 100644
--- a/tk/mac/tkMacHLEvents.c
+++ b/tk/mac/tkMacHLEvents.c
@@ -202,7 +202,7 @@ OdocHandler(
*/
if ((interp == NULL) ||
- (Tcl_GetCommandInfo(interp, "tkOpenDocument", &dummy)) == 0) {
+ (Tcl_GetCommandInfo(interp, "::tk::mac::OpenDocument", &dummy)) == 0) {
return noErr;
}
@@ -228,7 +228,7 @@ OdocHandler(
}
Tcl_DStringInit(&command);
- Tcl_DStringAppend(&command, "tkOpenDocument", -1);
+ Tcl_DStringAppend(&command, "::tk::mac::OpenDocument", -1);
for (index = 1; index <= count; index++) {
int length;
Handle fullPath;
@@ -439,4 +439,3 @@ MissedAnyParameters(
return (err != errAEDescNotFound);
}
-
diff --git a/tk/mac/tkMacInit.c b/tk/mac/tkMacInit.c
index d0af8ac3685..c79ef140a19 100644
--- a/tk/mac/tkMacInit.c
+++ b/tk/mac/tkMacInit.c
@@ -54,35 +54,43 @@ int
TkpInit(
Tcl_Interp *interp) /* Interp to initialize. */
{
- char *libDir, *tempPath;
- Tcl_DString path;
+ CONST char *libDir, *tempPath;
+ Tcl_DString path, ds;
int result;
- /*
- * The following does not work with
- * safe interps because file exists is restricted.
- * to be fixed using [interp issafe] like in Unix & Windows.
- */
- static char initCmd[] =
- "if [file exists $tk_library:tk.tcl] {\n\
- source $tk_library:tk.tcl\n\
- source $tk_library:button.tcl\n\
- source $tk_library:entry.tcl\n\
- source $tk_library:listbox.tcl\n\
- source $tk_library:menu.tcl\n\
- source $tk_library:scale.tcl\n\
- source $tk_library:scrlbar.tcl\n\
- source $tk_library:text.tcl\n\
- source $tk_library:comdlg.tcl\n\
- source $tk_library:msgbox.tcl\n\
- } else {\n\
- set msg \"can't find tk resource or $tk_library:tk.tcl;\"\n\
- append msg \" perhaps you need to\\ninstall Tk or set your \"\n\
- append msg \"TK_LIBRARY environment variable?\"\n\
- error $msg\n\
- }";
+ static char initCmd[] = "if {[info proc tkInit]==\"\"} {\n\
+proc tkInit {} {\n\
+proc sourcePath {file} {\n\
+ global tk_library\n\
+ if {[catch {uplevel #0 [list source [file join $tk_library $file.tcl]]}] == 0} {\n\
+ return\n\
+ }\n\
+ if {[catch {uplevel #0 [list source -rsrc $file]}] == 0} {\n\
+ return\n\
+ }\n\
+ rename sourcePath {}\n\
+ set msg \"Can't find $file resource or a usable $file.tcl file\"\n\
+ append msg \" perhaps you need to install Tk or set your\"\n\
+ append msg \" TK_LIBRARY environment variable?\"\n\
+ error $msg\n\
+}\n\
+sourcePath tk\n\
+sourcePath dialog\n\
+sourcePath focus\n\
+sourcePath optMenu\n\
+sourcePath palette\n\
+sourcePath tearoff\n\
+if {[catch {package require msgcat}]} {sourcePath msgcat}\n\
+sourcePath bgerror\n\
+sourcePath msgbox\n\
+sourcePath comdlg\n\
+rename sourcePath {}\n\
+rename tkInit {}\n\
+} }\n\
+tkInit";
Tcl_DStringInit(&path);
+ Tcl_DStringInit(&ds);
/*
* The tk_library path can be found in several places. Here is the order
@@ -94,21 +102,21 @@ TkpInit(
libDir = Tcl_GetVar(interp, "tk_library", TCL_GLOBAL_ONLY);
if (libDir == NULL) {
- libDir = Tcl_GetVar2(interp, "env", "TK_LIBRARY", TCL_GLOBAL_ONLY);
+ libDir = TclGetEnv("TK_LIBRARY", &ds);
}
- if (libDir == NULL) {
- tempPath = Tcl_GetVar2(interp, "env", "EXT_FOLDER", TCL_GLOBAL_ONLY);
- if (tempPath != NULL) {
+ if ((libDir == NULL) || (libDir[0] == '\0')) {
+ tempPath = TclGetEnv("EXT_FOLDER", &ds);
+ if ((tempPath != NULL) && (tempPath[0] != '\0')) {
Tcl_DString libPath;
+ CONST char *argv[3];
- Tcl_JoinPath(1, &tempPath, &path);
-
+ argv[0] = tempPath;
+ argv[1] = "Tool Command Language";
Tcl_DStringInit(&libPath);
- Tcl_DStringAppend(&libPath, ":Tool Command Language:tk", -1);
- Tcl_DStringAppend(&libPath, TK_VERSION, -1);
- Tcl_JoinPath(1, &libPath.string, &path);
+ Tcl_DStringAppend(&libPath, "tk", -1);
+ argv[2] = Tcl_DStringAppend(&libPath, TK_VERSION, -1);
+ libDir = Tcl_JoinPath(3, argv, &path);
Tcl_DStringFree(&libPath);
- libDir = path.string;
}
}
if (libDir == NULL) {
@@ -120,31 +128,9 @@ TkpInit(
*/
Tcl_SetVar(interp, "tk_library", libDir, TCL_GLOBAL_ONLY);
Tcl_DStringFree(&path);
+ Tcl_DStringFree(&ds);
- /*
- * Source the needed Tk libraries from the resource
- * fork of the application.
- */
- result = Tcl_MacEvalResource(interp, "tk", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "button", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "entry", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "listbox", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "menu", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "scale", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "scrollbar", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "text", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "dialog", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "focus", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "optionMenu", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "palette", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "tearoff", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "tkerror", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "comdlg", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "msgbox", 0, NULL);
-
- if (result != TCL_OK) {
result = Tcl_Eval(interp, initCmd);
- }
return result;
}
@@ -174,7 +160,8 @@ TkpGetAppName(
Tcl_DString *namePtr) /* A previously initialized Tcl_DString. */
{
int argc;
- char **argv = NULL, *name, *p;
+ CONST char **argv = NULL, *name, *p;
+ int nameLength = -1;
Handle h = NULL;
h = GetNamedResource('STR ', "\pTk App Name");
@@ -193,16 +180,17 @@ TkpGetAppName(
name = argv[argc-1];
p = strrchr(name, '.');
if (p != NULL) {
- *p = '\0';
+ nameLength = p - name;
}
} else {
name = NULL;
}
}
- if ((name == NULL) || (*name == 0)) {
+ if ((name == NULL) || (*name == 0) || (nameLength == 0)) {
name = "tk";
+ nameLength = -1;
}
- Tcl_DStringAppend(namePtr, name, -1);
+ Tcl_DStringAppend(namePtr, name, nameLength);
if (argv != NULL) {
ckfree((char *)argv);
}
@@ -227,8 +215,8 @@ TkpGetAppName(
void
TkpDisplayWarning(
- char *msg, /* Message to be displayed. */
- char *title) /* Title of warning. */
+ CONST char *msg, /* Message to be displayed. */
+ CONST char *title) /* Title of warning. */
{
Tcl_DString ds;
Tcl_DStringInit(&ds);
@@ -238,4 +226,3 @@ TkpDisplayWarning(
panic(Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
}
-
diff --git a/tk/mac/tkMacInt.h b/tk/mac/tkMacInt.h
index ab664787a72..5d8eedd0c9b 100644
--- a/tk/mac/tkMacInt.h
+++ b/tk/mac/tkMacInt.h
@@ -14,9 +14,21 @@
#ifndef _TKMACINT
#define _TKMACINT
+#ifndef _TKINT
#include "tkInt.h"
+#endif
+
+/*
+ * Include platform specific public interfaces.
+ */
+#ifndef _TKMAC
#include "tkMac.h"
+#endif
+
+#ifndef _TKPORT
+#include "tkPort.h"
+#endif
#include <AppleEvents.h>
#include <Windows.h>
@@ -73,7 +85,7 @@ typedef struct TkMacWindowList {
* embedding where Tk does not control the top-level. It contains
* various functions that are needed by Mac specific routines, like
* TkMacGetDrawablePort. The definitions of the function types
- * are in tclMac.h.
+ * are in tkMac.h.
*/
typedef struct {
@@ -206,9 +218,16 @@ typedef TkMenuDefProcPtr TkMenuDefUPP;
#include "tkIntPlatDecls.h"
-/* FIXME - This has to go in the tkInt.decls!!! */
+#ifdef BUILD_tk
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLEXPORT
+#endif
+
+/*
+ * mac specific procedures exported from the DLL
+ */
-int TkpIsWindowFloating _ANSI_ARGS_((WindowRef window));
+#undef TCL_STORAGE_CLASS
+#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKMACINT */
-
diff --git a/tk/mac/tkMacKeyboard.c b/tk/mac/tkMacKeyboard.c
index 635e2c70deb..381272a0c34 100644
--- a/tk/mac/tkMacKeyboard.c
+++ b/tk/mac/tkMacKeyboard.c
@@ -646,5 +646,3 @@ TkpInitKeymapInfo(dispPtr)
}
XFreeModifiermap(modMapPtr);
}
-
-
diff --git a/tk/mac/tkMacLibrary.r b/tk/mac/tkMacLibrary.r
index b5776dc893f..7cc5a77026b 100644
--- a/tk/mac/tkMacLibrary.r
+++ b/tk/mac/tkMacLibrary.r
@@ -13,14 +13,6 @@
* RCS: @(#) $Id$
*/
-/*
- * New style DLOG templates have an extra field for the positioning
- * options for the Dialog Box. We will not use this, for now, so we
- * turn it off here.
- */
-
-#define DLOG_RezTemplateVersion 0
-
#include <Types.r>
#include <SysTypes.r>
#include <AEUserTermTypes.r>
@@ -44,27 +36,28 @@
#if (TK_RELEASE_LEVEL == 2)
# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+# define RELEASE_CODE 0x00
#else
# define MINOR_VERSION TK_MINOR_VERSION * 16
+# define RELEASE_CODE TK_RELEASE_SERIAL
#endif
#define RELEASE_CODE 0x00
resource 'vers' (1) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
- TK_PATCH_LEVEL ",by Ray Johnson & Jim Ingham" "\n" "© 1993-1997 Sun Microsystems" "\n" "1998-2000 Scriptics Inc."
+ TK_PATCH_LEVEL ", by Ray Johnson & Jim Ingham" "\n" "© 2001 Tcl Core Team"
};
resource 'vers' (2) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
- "Tk Library " TK_PATCH_LEVEL " © 1993-1999"
+ "Tk Library " TK_PATCH_LEVEL " © 1993-2001"
};
-#define TK_LIBRARY_RESOURCES 3000
/*
* The -16397 string will be displayed by Finder when a user
* tries to open the shared library. The string should
@@ -78,432 +71,3 @@ resource 'STR ' (-16397, purgeable) {
"To work properly, it should be placed in the Tool Command Language folder "
"within the Extensions folder."
};
-
-
-/*
- * We now load the Tk library into the resource fork of the library.
- */
-
-read 'TEXT' (TK_LIBRARY_RESOURCES+1, "tk", purgeable)
- "::library:tk.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+2, "button", purgeable)
- "::library:button.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+3, "dialog", purgeable)
- "::library:dialog.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+4, "entry", purgeable)
- "::library:entry.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+5, "focus", purgeable)
- "::library:focus.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+6, "listbox", purgeable)
- "::library:listbox.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+7, "menu", purgeable)
- "::library:menu.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+8, "optionMenu", purgeable)
- "::library:optMenu.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+9, "palette", purgeable)
- "::library:palette.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+10, "scale", purgeable)
- "::library:scale.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+11, "scrollbar", purgeable)
- "::library:scrlbar.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+12, "tearoff", purgeable)
- "::library:tearoff.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+13, "text", purgeable)
- "::library:text.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+14, "tkerror", purgeable)
- "::library:bgerror.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+15, "Console", purgeable)
- "::library:console.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+16, "msgbox", purgeable, preload)
- "::library:msgbox.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+17, "comdlg", purgeable, preload)
- "::library:comdlg.tcl";
-
-/*
- * The following two resources define the default "About Box" for Mac Tk.
- * This dialog appears if the "About Tk..." menu item is selected from
- * the Apple menu. This dialog may be overridden by defining a Tcl procedure
- * with the name of "tkAboutDialog". If this procedure is defined the
- * default dialog will not be shown and the Tcl procedure is expected to
- * create and manage an About Dialog box.
- */
-
-data 'DLOG' (128, "Default About Box", purgeable) {
- $"0055 006B 00F3 0196 0001 0100 0100 0000"
- $"0000 0081 0000 280A"
-};
-
-resource 'DITL' (129, "About Box", purgeable) {
- {
- {128, 128, 148, 186}, Button {enabled, "Ok"},
- { 14, 108, 117, 298}, StaticText {disabled,
- "Wish - Windowing Shell" "\n" "based on Tcl "
- TCL_PATCH_LEVEL " & Tk " TK_PATCH_LEVEL "\n\n" "Jim Ingham & Ray Johnson"
- "Scriptics Inc." "\n" "jingham@cygnus.com"},
- { 11, 24, 111, 92}, Picture {enabled, 128}
- }
-};
-
-data 'PICT' (128, purgeable) {
- $"13A4 0000 0000 0064 0044 0011 02FF 0C00"
- $"FFFE 0000 0048 0000 0048 0000 0000 0000"
- $"0064 0044 0000 0000 0001 000A 0000 0000"
- $"0064 0044 0099 8044 0000 0000 0064 0044"
- $"0000 0000 0000 0000 0048 0000 0048 0000"
- $"0000 0008 0001 0008 0000 0000 0108 00D8"
- $"0000 0000 0001 5A5A 8000 00FF 3736 FF00"
- $"FF00 FF00 3535 FF00 FF00 CC00 3434 FF00"
- $"FF00 9900 3333 FF00 FF00 6600 3736 FF00"
- $"FF00 3300 3535 FF00 FF00 0000 3434 FF00"
- $"CC00 FF00 3333 FF00 CC00 CC00 3736 FF00"
- $"CC00 9900 3535 FF00 CC00 6600 FAFA FF00"
- $"CC00 3300 3333 FF00 CC00 0000 3130 FF00"
- $"9900 FF00 2F2F FF00 9900 CC00 FAFA FF00"
- $"9900 9900 F9F9 FF00 9900 6600 3130 FF00"
- $"9900 3300 2F2F FF00 9900 0000 2E2E FF00"
- $"6600 FF00 F9F9 FF00 6600 CC00 3130 FF00"
- $"6600 9900 2F2F FF00 6600 6600 2E2E FF00"
- $"6600 3300 2D2D FF00 6600 0000 3130 FF00"
- $"3300 FF00 2F2F FF00 3300 CC00 2E2E FF00"
- $"3300 9900 2D2D FF00 3300 6600 3130 FF00"
- $"3300 3300 2F2F FF00 3300 0000 2E2E FF00"
- $"0000 FF00 2D2D FF00 0000 CC00 3130 FF00"
- $"0000 9900 2F2F FF00 0000 6600 2E2E FF00"
- $"0000 3300 2DF8 FF00 0000 0000 2B2A CC00"
- $"FF00 FF00 2929 CC00 FF00 CC00 2828 CC00"
- $"FF00 9900 27F8 CC00 FF00 6600 2B2A CC00"
- $"FF00 3300 2929 CC00 FF00 0000 2828 CC00"
- $"CC00 FF00 2727 CC00 CC00 CC00 2B2A CC00"
- $"CC00 9900 2929 CC00 CC00 6600 2828 CC00"
- $"CC00 3300 2727 CC00 CC00 0000 2B2A CC00"
- $"9900 FF00 2929 CC00 9900 CC00 2828 CC00"
- $"9900 9900 2727 CC00 9900 6600 DBDB CC00"
- $"9900 3300 4747 CC00 9900 0000 4646 CC00"
- $"6600 FF00 4545 CC00 6600 CC00 DBDB CC00"
- $"6600 9900 4747 CC00 6600 6600 4646 CC00"
- $"6600 3300 4545 CC00 6600 0000 DBDB CC00"
- $"3300 FF00 4747 CC00 3300 CC00 4646 CC00"
- $"3300 9900 4545 CC00 3300 6600 DBDB CC00"
- $"3300 3300 4141 CC00 3300 0000 4040 CC00"
- $"0000 FF00 3F3F CC00 0000 CC00 4342 CC00"
- $"0000 9900 4141 CC00 0000 6600 4040 CC00"
- $"0000 3300 3F3F CC00 0000 0000 4342 9900"
- $"FF00 FF00 4141 9900 FF00 CC00 4040 9900"
- $"FF00 9900 3F3F 9900 FF00 6600 4342 9900"
- $"FF00 3300 4141 9900 FF00 0000 4040 9900"
- $"CC00 FF00 3F3F 9900 CC00 CC00 4342 9900"
- $"CC00 9900 4141 9900 CC00 6600 4040 9900"
- $"CC00 3300 3F3F 9900 CC00 0000 4342 9900"
- $"9900 FF00 4141 9900 9900 CC00 4040 9900"
- $"9900 9900 3F3F 9900 9900 6600 3D3C 9900"
- $"9900 3300 3B3B 9900 9900 0000 3A3A 9900"
- $"6600 FF00 3939 9900 6600 CC00 3D3C 9900"
- $"6600 9900 3B3B 9900 6600 6600 3A3A 9900"
- $"6600 3300 3939 9900 6600 0000 3D3C 9900"
- $"3300 FF00 3B3B 9900 3300 CC00 3A3A 9900"
- $"3300 9900 3939 9900 3300 6600 3D3C 9900"
- $"3300 3300 3B3B 9900 3300 0000 3A3A 9900"
- $"0000 FF00 3939 9900 0000 CC00 3D3C 9900"
- $"0000 9900 3B3B 9900 0000 6600 3A3A 9900"
- $"0000 3300 3939 9900 0000 0000 3D3C 6600"
- $"FF00 FF00 3B3B 6600 FF00 CC00 3A3A 6600"
- $"FF00 9900 3939 6600 FF00 6600 3D3C 6600"
- $"FF00 3300 3B3B 6600 FF00 0000 3A3A 6600"
- $"CC00 FF00 3939 6600 CC00 CC00 3736 6600"
- $"CC00 9900 3535 6600 CC00 6600 3434 6600"
- $"CC00 3300 3333 6600 CC00 0000 3736 6600"
- $"9900 FF00 3535 6600 9900 CC00 3434 6600"
- $"9900 9900 3333 6600 9900 6600 3736 6600"
- $"9900 3300 3535 6600 9900 0000 3434 6600"
- $"6600 FF00 3333 6600 6600 CC00 3736 6600"
- $"6600 9900 3535 6600 6600 6600 3434 6600"
- $"6600 3300 3333 6600 6600 0000 3736 6600"
- $"3300 FF00 3535 6600 3300 CC00 3434 6600"
- $"3300 9900 3333 6600 3300 6600 3736 6600"
- $"3300 3300 3535 6600 3300 0000 3434 6600"
- $"0000 FF00 3333 6600 0000 CC00 3130 6600"
- $"0000 9900 2F2F 6600 0000 6600 2E2E 6600"
- $"0000 3300 F9F9 6600 0000 0000 3130 3300"
- $"FF00 FF00 2F2F 3300 FF00 CC00 2E2E 3300"
- $"FF00 9900 F9F9 3300 FF00 6600 3130 3300"
- $"FF00 3300 2F2F 3300 FF00 0000 2E2E 3300"
- $"CC00 FF00 2D2D 3300 CC00 CC00 3130 3300"
- $"CC00 9900 2F2F 3300 CC00 6600 2E2E 3300"
- $"CC00 3300 2D2D 3300 CC00 0000 3130 3300"
- $"9900 FF00 2F2F 3300 9900 CC00 2E2E 3300"
- $"9900 9900 2D2D 3300 9900 6600 3130 3300"
- $"9900 3300 2F2F 3300 9900 0000 2E2E 3300"
- $"6600 FF00 2DF8 3300 6600 CC00 2B2A 3300"
- $"6600 9900 2929 3300 6600 6600 2828 3300"
- $"6600 3300 27F8 3300 6600 0000 2B2A 3300"
- $"3300 FF00 2929 3300 3300 CC00 2828 3300"
- $"3300 9900 2727 3300 3300 6600 2B2A 3300"
- $"3300 3300 2929 3300 3300 0000 2828 3300"
- $"0000 FF00 2727 3300 0000 CC00 2B2A 3300"
- $"0000 9900 2929 3300 0000 6600 2828 3300"
- $"0000 3300 2727 3300 0000 0000 4948 0000"
- $"FF00 FF00 4747 0000 FF00 CC00 4646 0000"
- $"FF00 9900 4545 0000 FF00 6600 4948 0000"
- $"FF00 3300 4747 0000 FF00 0000 4646 0000"
- $"CC00 FF00 4545 0000 CC00 CC00 4948 0000"
- $"CC00 9900 4747 0000 CC00 6600 4646 0000"
- $"CC00 3300 4545 0000 CC00 0000 4342 0000"
- $"9900 FF00 4141 0000 9900 CC00 4040 0000"
- $"9900 9900 3F3F 0000 9900 6600 4342 0000"
- $"9900 3300 4141 0000 9900 0000 4040 0000"
- $"6600 FF00 3F3F 0000 6600 CC00 4342 0000"
- $"6600 9900 4141 0000 6600 6600 4040 0000"
- $"6600 3300 3F3F 0000 6600 0000 4342 0000"
- $"3300 FF00 4141 0000 3300 CC00 4040 0000"
- $"3300 9900 3F3F 0000 3300 6600 4342 0000"
- $"3300 3300 4141 0000 3300 0000 4040 0000"
- $"0000 FF00 3F3F 0000 0000 CC00 4342 0000"
- $"0000 9900 4141 0000 0000 6600 4040 0000"
- $"0000 3300 3F3F EE00 0000 0000 3D3C DD00"
- $"0000 0000 3B3B BB00 0000 0000 3A3A AA00"
- $"0000 0000 3939 8800 0000 0000 3D3C 7700"
- $"0000 0000 3B3B 5500 0000 0000 3A3A 4400"
- $"0000 0000 3939 2200 0000 0000 3D3C 1100"
- $"0000 0000 3B3B 0000 EE00 0000 3A3A 0000"
- $"DD00 0000 3939 0000 BB00 0000 3D3C 0000"
- $"AA00 0000 3B3B 0000 8800 0000 3A3A 0000"
- $"7700 0000 3939 0000 5500 0000 3D3C 0000"
- $"4400 0000 3B3B 0000 2200 0000 3A3A 0000"
- $"1100 0000 3939 0000 0000 EE00 3D3C 0000"
- $"0000 DD00 3B3B 0000 0000 BB00 3A3A 0000"
- $"0000 AA00 3939 0000 0000 8800 3D3C 0000"
- $"0000 7700 3B3B 0000 0000 5500 3A3A 0000"
- $"0000 4400 3939 0000 0000 2200 3736 0000"
- $"0000 1100 3535 EE00 EE00 EE00 3434 DD00"
- $"DD00 DD00 3333 BB00 BB00 BB00 3736 AA00"
- $"AA00 AA00 3535 8800 8800 8800 3434 7700"
- $"7700 7700 3333 5500 5500 5500 3736 4400"
- $"4400 4400 3535 2200 2200 2200 3434 1100"
- $"1100 1100 3333 0000 0000 0000 0000 0000"
- $"0064 0044 0000 0000 0064 0044 0000 000A"
- $"0000 0000 0064 0044 02BD 0013 E800 01F5"
- $"F6FE 07FE 0E02 3232 33FD 3900 0EE6 001D"
- $"FC00 01F5 F5FE 0700 08FE 0E02 3232 33FE"
- $"3900 3AFC 40F2 4102 4033 07E9 0017 0100"
- $"0EFC 40DC 4102 390E F5F5 0002 F5F5 F6FE"
- $"0702 0E07 0016 0100 32D5 4104 4039 0E32"
- $"33FD 3900 3AFC 40FC 4101 3200 0801 000E"
- $"C141 010E 0008 0100 0EC1 4101 0800 0801"
- $"000E C141 0107 0008 0100 0EC1 4101 0700"
- $"0901 0007 C241 0240 F500 0E01 0007 E841"
- $"0147 47DD 4102 4000 0012 0100 07F0 4100"
- $"47FA 4101 3B3B DD41 0240 0000 1901 0007"
- $"F141 0C47 3B0B 3B47 4141 4711 0505 3B47"
- $"DF41 023A 0000 1701 00F6 F041 010B 0BFE"
- $"4105 473B 0505 113B DE41 0239 0000 1A02"
- $"00F5 40F3 410C 473B 053B 4741 4741 0B0B"
- $"3B47 47DE 4102 3900 0018 0200 F540 F341"
- $"0247 110B FE41 0447 1105 4147 DC41 0233"
- $"0000 1B02 0000 40F3 4103 4711 1147 FE41"
- $"0205 3547 F741 FD47 E941 0232 0000 1E02"
- $"0000 40F2 4106 113B 4741 4735 0BF7 4106"
- $"4741 390E 0E40 47EA 4102 0E00 0021 0200"
- $"0040 F241 0711 3B47 4141 0B35 47F9 4102"
- $"4740 07FE 0002 F640 47EB 4102 0E00 0023"
- $"0200 0040 F341 0847 3541 4147 3B05 4147"
- $"FA41 0947 3AF6 00F5 4F55 F50E 47EB 4102"
- $"0700 0022 0200 003A F341 0147 3BFE 4101"
- $"0B0B F941 0547 3AF5 0055 C8FE CE01 5640"
- $"EB41 0207 0000 1F02 0000 39F0 4104 4741"
- $"053B 47FB 4104 4740 F5F5 A4FC CE01 C85D"
- $"EB41 02F6 0000 1F02 0000 39F0 4104 473B"
- $"0541 47FC 4104 4740 07F6 C8FA CE00 64EC"
- $"4103 40F5 0000 1C02 0000 39F0 4102 4711"
- $"0BFA 4103 4708 2AC8 FACE 0164 D8EC 4100"
- $"40FE 0025 0200 0039 EF41 020B 3B47 FC41"
- $"0347 0FF5 A4FB CE02 C887 D8FC 41FE 47FC"
- $"4100 47F9 4100 3AFE 0028 0200 0039 EF41"
- $"020B 3B47 FD41 0347 3900 A4FA CE00 ABFA"
- $"4109 3B11 3B41 4147 3B0B 3B47 FA41 0039"
- $"FE00 2402 0000 33F1 4102 4741 0BFA 4101"
- $"0779 F9CE 0064 FA41 0235 050B FD41 010B"
- $"0BF9 4100 39FE 0028 0200 0032 F141 0247"
- $"3B0B FC41 0247 39F6 F9CE 0187 D8FB 4103"
- $"4741 050B FE41 0247 110B F941 0039 FE00"
- $"2C02 0000 32F1 4102 473B 11FB 4101 0879"
- $"FACE 05AA 4041 4147 47FE 410A 4741 0511"
- $"4741 4147 3511 47FA 4100 32FE 002F 0200"
- $"000E F141 0347 3B11 47FE 4103 4740 F6C8"
- $"FACE 0564 D841 4039 39FE 4104 473B 053B"
- $"47FE 4102 3541 47FA 4100 0EFE 0027 0200"
- $"000E F141 0347 3B3B 47FE 4102 470F 79FA"
- $"CE0C 8741 4032 F500 003A 4741 473B 05F2"
- $"4100 0EFE 0027 0200 000E F141 0347 3B3B"
- $"47FD 4101 0EA4 FACE 01AB AAFE C808 7900"
- $"3947 4147 110B 47F3 4100 07FE 001C 0200"
- $"000E EA41 0240 2BC8 F5CE 0881 0033 4741"
- $"410B 3B47 F341 0007 FE00 1A02 0000 08EB"
- $"4102 473A 55F4 CE06 5D00 3947 4741 0BF1"
- $"4100 F6FE 001C 0200 0007 EB41 0247 3979"
- $"F4CE 0739 0039 4747 3511 47F3 4101 40F5"
- $"FE00 1C02 0000 07EB 4102 4739 A4F5 CE08"
- $"AB0E 0040 4741 1141 47F3 4100 40FD 001B"
- $"0200 0007 EB41 0247 39A4 F5CE 0787 0707"
- $"4147 4111 47F2 4100 40FD 001B 0200 0007"
- $"EB41 0247 39C8 F5CE 0763 F532 4747 3B3B"
- $"47F2 4100 3AFD 001A 0300 00F6 40EC 4102"
- $"4739 C8F5 CE05 39F5 4047 413B F041 0039"
- $"FD00 1C03 0000 F540 EB41 0140 C8FD CE01"
- $"C8A4 FCCE 03AB 080E 47ED 4100 39FD 001A"
- $"FE00 0040 EB41 0040 FCCE 01A4 C8FC CE03"
- $"FA07 4047 ED41 0032 FD00 1AFE 0000 40EA"
- $"4100 AAFE CE02 87F9 C8FC CE02 560F 47EC"
- $"4100 32FD 0019 FE00 0040 EA41 00AB FECE"
- $"0264 56C8 FDCE 01C8 32EA 4100 0EFD 001B"
- $"FE00 0040 ED41 030E 4047 87FE CE01 4055"
- $"FCCE 01FA 40EA 4100 08FD 001A FE00 003A"
- $"ED41 0807 0740 FBCE CEAB 3979 FDCE 00AB"
- $"E841 0007 FD00 1CFE 0000 3AED 4108 0700"
- $"F6A4 CECE 8733 79FD CE02 4147 47EA 4100"
- $"07FD 001E FE00 0039 ED41 0807 2AA4 C8CE"
- $"CE88 0E9D FECE 0364 1C39 39EB 4101 40F5"
- $"FD00 1CFE 0000 39ED 4101 074F FDCE 0264"
- $"F7A4 FECE 03AB 80F6 07EB 4100 40FC 001C"
- $"FE00 0039 ED41 0108 79FE CE03 AB40 2BA4"
- $"FCCE 02F7 0E47 EC41 0040 FC00 1CFE 0000"
- $"39ED 4101 0879 FECE 03AB 40F6 C8FC CE02"
- $"F615 47EC 4100 40FC 001E FE00 003A EE41"
- $"0247 0E79 FECE 03AB 40F5 C8FD CE03 A4F5"
- $"3A47 EC41 0040 FC00 1EFE 0000 3AEE 4102"
- $"470E 56FE CE03 FB3A F6C8 FDCE 0280 F540"
- $"EB41 0140 F5FD 001E FE00 0040 EE41 0947"
- $"0F56 CECE C888 39F6 C8FD CE02 5601 40EB"
- $"4101 40F5 FD00 1CFE 0000 40EE 4109 4739"
- $"32CE CEC8 8839 2AC8 FDCE 0156 07E9 4100"
- $"F6FD 001B FE00 0040 EE41 0847 3A32 CECE"
- $"C864 152A FCCE 0132 07E9 4100 07FD 001A"
- $"FE00 0040 ED41 0740 32AB CEC8 6439 4EFC"
- $"CE01 3A07 E941 0007 FD00 1D03 0000 F540"
- $"ED41 0740 0EAB CECE 640F 4EFD CE03 AB40"
- $"0840 EA41 0007 FD00 1B03 0000 F540 EC41"
- $"060F 81CE CE64 334E FDCE 02AB 400E E941"
- $"000E FD00 1C02 0000 F6EC 4107 4715 FACE"
- $"CE64 334E FDCE 0387 0F0E 47EA 4100 0EFD"
- $"001C 0200 0007 EC41 0747 16F9 CEC8 6433"
- $"4EFD CE03 6308 4047 EA41 000E FD00 1A02"
- $"0000 07EB 4106 40F9 CEC8 6439 4EFD CE02"
- $"3940 47E9 4100 32FD 001B 0200 0007 EA41"
- $"0539 CECE 8839 F6FE CE04 AB41 4139 40EA"
- $"4100 32FD 001C 0200 0007 EB41 0E47 3AC8"
- $"CE88 39F6 C8CE CE64 15F6 F540 EA41 0033"
- $"FD00 1A02 0000 07EA 410C 40A4 CE87 392A"
- $"C8CE AB41 40F8 F6E9 4100 39FD 001B 0200"
- $"000E EB41 0D47 41AB C887 39F5 C8CE ABAB"
- $"CEA4 07E9 4100 39FD 001C 0200 000E ED41"
- $"0947 3939 4787 C8AB 40F5 C8FD CE01 A40E"
- $"E941 0039 FD00 1D02 0000 0EED 4109 473A"
- $"0007 80CE AB40 F5C8 FDCE 0255 0E47 EA41"
- $"0039 FD00 1B02 0000 0EEB 4107 0779 C8CE"
- $"CE40 F6A4 FDCE 022B 3947 EA41 003A FD00"
- $"1C02 0000 0EEC 4102 4739 79FE CE02 6407"
- $"A4FE CE02 A407 40E9 4100 40FD 001A 0200"
- $"0032 EA41 0632 A4CE CE88 0879 FECE 02F9"
- $"0F47 E941 0040 FD00 1A02 0000 32EB 4107"
- $"4740 F7C8 CE87 0E79 FECE 0132 40E8 4100"
- $"40FD 0019 0200 0033 EA41 0B47 40F8 C8AB"
- $"0E55 CECE 8015 47E8 4100 40FD 0017 0200"
- $"0033 E941 0847 40F9 A439 4FCE CE5D E641"
- $"0140 F5FE 0014 0200 0039 E841 0647 64FB"
- $"392B C8AB E441 00F6 FE00 1102 0000 39E5"
- $"4103 40F6 8764 E441 0007 FE00 1E02 0000"
- $"39EB 4102 3A0E 0EFD 4102 0740 47F6 4104"
- $"400F 0839 47F4 4100 07FE 0027 0200 0039"
- $"FB41 0147 47F2 4102 0800 40FE 4102 0839"
- $"47FC 4101 4747 FC41 0339 0039 47F4 4100"
- $"07FE 0029 0200 0039 FB41 0140 39F3 4109"
- $"470E F540 4141 470E 3347 FC41 0139 3AFD"
- $"4104 4739 0039 47F4 4100 08FE 0036 0200"
- $"003A FC41 0347 0E00 40FC 4102 4741 40FC"
- $"4109 470E F540 4141 4733 0E47 FE41 0447"
- $"4000 0E47 FE41 0447 3900 3941 FE40 F741"
- $"000E FE00 3A02 0000 3AFD 410E 4740 0700"
- $"0E40 4741 4147 390E 390E 40FE 4108 470E"
- $"F540 4141 4739 0EFC 4103 0F00 0739 FE41"
- $"0747 3900 3940 080F 39F7 4100 0EFE 0035"
- $"0200 0040 FB41 020E 0040 FE41 0D47 4000"
- $"3941 0032 4741 4147 0EF5 40FE 4101 4008"
- $"FC41 023A 000E FD41 0547 3900 3939 33F5"
- $"4100 0EFE 0039 0200 0040 FC41 0347 0E00"
- $"40FE 4106 4732 0040 4139 40FE 4103 470E"
- $"F540 FD41 0108 40FE 4104 4740 000E 47FE"
- $"4106 4739 0007 F540 47F6 4100 32FE 003A"
- $"0200 0040 FC41 0C47 0E00 4047 4141 470E"
- $"0040 4747 FD41 0347 0EF5 40FE 410A 470E"
- $"3947 4141 4740 000E 47FE 4107 4739 000E"
- $"0007 4147 F741 0032 FE00 3802 0000 40FC"
- $"4102 470E 00FD 4106 4739 003A 4740 39FE"
- $"4102 470E F5FD 410A 4733 3347 4141 4740"
- $"000E 47FE 4106 4739 0039 3900 0EF6 4100"
- $"33FE 003A 0200 F540 FC41 0447 3200 0E39"
- $"FD41 0B0E 0E40 333A 4741 413A 07F5 39FE"
- $"4102 473A 0EFD 410F 40F5 0733 4041 4140"
- $"0E00 0E40 0700 0E40 F841 0039 FE00 2902"
- $"00F5 40FA 4101 3939 FB41 023A 3A40 FD41"
- $"FD40 FD41 0240 0E40 FD41 0240 3940 FD41"
- $"FA40 F741 0039 FE00 2A01 00F6 F941 0147"
- $"47FB 4101 4747 FB41 0147 47FB 4101 3940"
- $"FD41 0147 47FB 4100 47FE 4100 47F6 4100"
- $"39FE 000D 0100 07E1 4100 40E4 4100 3AFE"
- $"0009 0100 07C3 4100 3AFE 0009 0100 07C3"
- $"4100 40FE 0009 0100 07C3 4100 40FE 0009"
- $"0100 07C3 4100 40FE 000A 0100 0EC3 4103"
- $"40F5 0000 0901 000E C241 02F6 0000 0901"
- $"000E C241 0207 0000 0901 000E C241 0207"
- $"0000 1101 000E ED41 FE40 003A F940 E241"
- $"0207 0000 2B01 0032 F941 FE40 FE39 0632"
- $"0E0E 0707 F6F5 F800 02F5 F5F6 FB07 FB0E"
- $"0332 3233 33FB 3901 3A3A FB40 0207 0000"
- $"0E0A 000E 3939 320E 0E07 07F6 F5C8 0002"
- $"BD00 00FF"
-};
-
-/*
- * Here is the custom file open dialog. This dialog is used instead of
- * the default file dialog if the -filetypes flag is specified.
- */
-
-#define DLOG_RezTemplateVersion 0
-
-resource 'DLOG' (130, purgeable) {
- {0, 0, 195, 344}, dBoxProc, invisible, noGoAway, 0,
- 130, ""
-};
-
-resource 'DITL' (130, "File Open Box", purgeable) {
- {
- {135, 252, 155, 332}, Button {enabled, "Open"},
- {104, 252, 124, 332}, Button {enabled, "Cancel"},
- { 0, 0, 0, 0}, HelpItem {disabled, HMScanhdlg {130}},
- { 8, 235, 24, 337}, UserItem {enabled},
- { 32, 252, 52, 332}, Button {enabled, "Eject"},
- { 60, 252, 80, 332}, Button {enabled, "Desktop"},
- { 29, 12, 159, 230}, UserItem {enabled},
- { 6, 12, 25, 230}, UserItem {enabled},
- { 91, 251, 92, 333}, Picture {disabled, 11},
- {168, 20, 187, 300}, Control {enabled, 131}
- }
-};
-
-resource 'CNTL' (131, "File Types menu", purgeable) {
- {168, 20, 187, 300},
- popupTitleLeftJust,
- visible,
- 80,
- 132,
- popupMenuCDEFProc,
- 0,
- "File Type:"
-};
-
-
-resource 'MENU' (132, preload) {
- 132,
- textMenuProc,
- 0xFFFF, enabled, "", {}
-};
-
diff --git a/tk/mac/tkMacMDEF.c b/tk/mac/tkMacMDEF.c
index 6f4299c0907..136f1ba8cab 100644
--- a/tk/mac/tkMacMDEF.c
+++ b/tk/mac/tkMacMDEF.c
@@ -114,4 +114,3 @@ main(
SELECTRECT = globals.itemRect;
}
}
-
diff --git a/tk/mac/tkMacMDEF.r b/tk/mac/tkMacMDEF.r
index 104f7bee450..a38927468d0 100644
--- a/tk/mac/tkMacMDEF.r
+++ b/tk/mac/tkMacMDEF.r
@@ -27,20 +27,19 @@
*/
data 'MDEF' (591, preload) {
- $"600A 0000 4D44 4546 024F 0000 4EFA 0004" /* `...MDEF.O..Nú.. */
- $"4E75 4E56 FFEE 48E7 1830 362E 0018 246E" /* NuNVÿîHç.06...$n */
- $"0008 267C 4D44 4546 594F 2EB8 0B54 201F" /* ..&|MDEFYO.¸.T . */
- $"2D40 FFEE 554F 3EB8 0A0A 301F 3D40 FFF2" /* -@ÿîUO>¸..0.=@ÿò */
- $"554F 3EB8 0A0C 301F 3D40 FFF4 0C78 FFFF" /* UO>¸..0.=@ÿô.xÿÿ */
- $"0B5C 6612 2078 0B5C 2050 2D68 0006 FFF6" /* .\f. x.\ P-h..ÿö */
- $"2D68 000A FFFA 0C43 0001 6602 3812 3F03" /* -h..ÿú.C..f.8.?. */
- $"2F2E 0014 2F2E 0010 2F2E 000C 2F0A 486E" /* /.../.../.../.Hn */
- $"FFEE 4E93 2F2E FFEE 21DF 0B54 3F2E FFF2" /* ÿîN“/.ÿî!ß.T?.ÿò */
- $"31DF 0A0A 3F2E FFF4 31DF 0A0C 0C43 0001" /* 1ß..?.ÿô1ß...C.. */
- $"662A B852 6726 0C78 FFFF 0B5C 671E 2078" /* f*¸Rg&.xÿÿ.\g. x */
- $"0B5C 2050 216E FFF6 0006 216E FFFA 000A" /* .\ P!nÿö..!nÿú.. */
- $"21EE FFF6 09FA 21EE FFFA 09FE 4CDF 0C18" /* !îÿöÆú!îÿúÆþLß.. */
- $"4E5E 205F 4FEF 0012 4ED0 846D 6169 6E00" /* N^ _Oï..NЄmain. */
- $"0000" /* .. */
+ $"600A 0000 4D44 4546 024F 0000 4EFA 0004" /* `...MDEF.O..N™.. */
+ $"4E75 48E7 1030 4FEF FFEE 266F 0022 247C" /* NuHÁ.0OÔÓ&o."$| */
+ $"4D44 4546 594F 2EB8 0B54 2E9F 554F 3EB8" /* MDEFYO.½.T.üUO>½ */
+ $"0A0A 3F5F 0004 554F 3EB8 0A0C 3F5F 0006" /* ..?_..UO>½..?_.. */
+ $"3038 0B5C 48C0 0C80 FFFF FFFF 6612 2078" /* 08.\H¿.Äf. x */
+ $"0B5C 2050 2F68 0006 0008 2F68 000A 000C" /* .\ P/h..../h.... */
+ $"302F 0032 48C0 0C80 0000 0001 6602 3613" /* 0/.2H¿.Ä....f.6. */
+ $"3F2F 0032 2F2F 0030 2F2F 0030 2F2F 0030" /* ?/.2//.0//.0//.0 */
+ $"2F0B 486F 0012 4E92 2F17 21DF 0B54 3F2F" /* /.Ho..Ní/.!þ.T?/ */
+ $"0004 31DF 0A0A 3F2F 0006 31DF 0A0C 302F" /* ..1þ..?/..1þ..0/ */
+ $"0032 48C0 0C80 0000 0001 6638 3013 48C0" /* .2H¿.Ä....f80.H¿ */
+ $"3203 48C1 B280 672C 3038 0B5C 48C0 0C80" /* 2.H¡¾Äg,08.\H¿.Ä */
+ $"FFFF FFFF 671E 2078 0B5C 2050 216F 0008" /* g. x.\ P!o.. */
+ $"0006 216F 000C 000A 21EF 0008 09FA 21EF" /* ..!o....!Ô..™!Ô */
+ $"000C 09FE 4FEF 0012 4CDF 0C08 4E74 0012" /* ..œOÔ..Lþ..Nt.. */
};
-
diff --git a/tk/mac/tkMacMenu.c b/tk/mac/tkMacMenu.c
index b4cf8e2324f..c75d0985377 100644
--- a/tk/mac/tkMacMenu.c
+++ b/tk/mac/tkMacMenu.c
@@ -12,8 +12,8 @@
*/
#include "tkMacInt.h"
-#include "tkMenuButton.h"
#include "tkMenu.h"
+#include "tkMenuButton.h"
#include "tkColor.h"
#include "tkMacInt.h"
#undef Status
@@ -178,7 +178,7 @@ static char *currentMenuBarName;
static Tk_Window currentMenuBarOwner;
/* Which window owns the current menu bar. */
static char elipsisString[TCL_UTF_MAX + 1];
- /* The UTF representation of the elipsis (ƒ)
+ /* The UTF representation of the elipsis (Š)
* character. */
static int helpItemCount; /* The number of items in the help menu.
* -1 means that the help menu is
@@ -529,7 +529,7 @@ TkpNewMenu(
(length > 230) ? 230 : length);
itemText[0] = (length > 230) ? 230 : length;
macMenuHdl = NewMenu(menuID, itemText);
-#ifdef GENERATINGCFM
+#if GENERATINGCFM
{
Handle mdefProc = FixMDEF();
if ((mdefProc != NULL)) {
@@ -687,7 +687,7 @@ TkpDestroyMenuEntry(
* Given a menu entry, gives back the text that should go in it.
* Separators should be done by the caller, as they have to be
* handled specially. This is primarily used to do a substitution
- * between "..." and "ƒ".
+ * between "..." and "Š".
*
* Results:
* itemText points to the new text for the item.
@@ -707,9 +707,9 @@ GetEntryText(
Tcl_DStringInit(dStringPtr);
if (mePtr->type == TEAROFF_ENTRY) {
Tcl_DStringAppend(dStringPtr, "(Tear-off)", -1);
- } else if (mePtr->imagePtr != NULL) {
+ } else if ((mePtr->imagePtr != NULL) && (mePtr->compound == COMPOUND_NONE)) {
Tcl_DStringAppend(dStringPtr, "(Image)", -1);
- } else if (mePtr->bitmapPtr != NULL) {
+ } else if ((mePtr->bitmapPtr != NULL) && (mePtr->compound == COMPOUND_NONE)) {
Tcl_DStringAppend(dStringPtr, "(Pixmap)", -1);
} else if (mePtr->labelPtr == NULL || mePtr->labelLength == 0) {
/*
@@ -752,10 +752,10 @@ GetEntryText(
* We try the following special mac characters. If none of them
* are present, just use the check mark.
* '' - Check mark character (\022)
- * '¥' - Mac Bullet character (\245)
+ * '€' - Mac Bullet character (\245)
* '' - Filled diamond (\023)
* '×' - Hollow diamond (\327)
- * 'Ñ' = Mac Long dash ("em dash") (\321)
+ * '‹' = Mac Long dash ("em dash") (\321)
* '-' = short dash (minus, "en dash");
*
* Results:
@@ -1223,7 +1223,7 @@ ReconfigureMacintoshMenu(
ReconfigureIndividualMenu(menuPtr, macMenuHdl, 0);
if (menuPtr->menuFlags & MENU_APPLE_MENU) {
- AddResMenu(macMenuHdl, 'DRVR');
+ AppendResMenu(macMenuHdl, 'DRVR');
}
if ((*macMenuHdl)->menuID == currentHelpMenuID) {
@@ -3340,7 +3340,7 @@ TkMacHandleTearoffMenu(void)
if (windowPart != inMenuBar) {
Tcl_DStringInit(&tearoffCmdStr);
- Tcl_DStringAppendElement(&tearoffCmdStr, "tkTearOffMenu");
+ Tcl_DStringAppendElement(&tearoffCmdStr, "tk::TearOffMenu");
Tcl_DStringAppendElement(&tearoffCmdStr,
Tk_PathName(tearoffStruct.menuPtr->tkwin));
sprintf(intString, "%d", tearoffStruct.point.h);
@@ -3945,39 +3945,117 @@ DrawMenuEntryLabel(
int width, /* width of entry */
int height) /* height of entry */
{
- int baseline;
int indicatorSpace = mePtr->indicatorSpace;
int leftEdge = x + indicatorSpace;
int imageHeight, imageWidth;
+ int textHeight, textWidth;
+ int haveImage = 0, haveText = 0;
+ int imageXOffset = 0, imageYOffset = 0;
+ int textXOffset = 0, textYOffset = 0;
+
+ /*
+ * Work out what we will need to draw first.
+ */
+
+ if (mePtr->image != NULL) {
+ Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight);
+ haveImage = 1;
+ } else if (mePtr->bitmapPtr != NULL) {
+ Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
+ Tk_SizeOfBitmap(menuPtr->display, bitmap, &imageWidth, &imageHeight);
+ haveImage = 1;
+ }
+ if (!haveImage || (mePtr->compound != COMPOUND_NONE)) {
+ if (mePtr->labelLength > 0) {
+ Tcl_DString itemTextDString;
+ textHeight = fmPtr->linespace;
+ GetEntryText(mePtr, &itemTextDString);
+ textWidth = Tk_TextWidth(tkfont,
+ Tcl_DStringValue(&itemTextDString),
+ Tcl_DStringLength(&itemTextDString));
+ Tcl_DStringFree(&itemTextDString);
+ haveText = 1;
+ }
+ }
+
+ /*
+ * Now work out what the relative positions are.
+ */
+
+ if (haveImage && haveText) {
+ int fullWidth = (imageWidth > textWidth ? imageWidth : textWidth);
+ switch ((enum compound) mePtr->compound) {
+ case COMPOUND_TOP: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = imageHeight/2 + 2;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = -textHeight/2;
+ break;
+ }
+ case COMPOUND_BOTTOM: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = -imageHeight/2;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = textHeight/2 + 2;
+ break;
+ }
+ case COMPOUND_LEFT: {
+ textXOffset = imageWidth + 2;
+ textYOffset = 0;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_RIGHT: {
+ textXOffset = 0;
+ textYOffset = 0;
+ imageXOffset = textWidth + 2;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = 0;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+ } else {
+ textXOffset = 0;
+ textYOffset = 0;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ }
/*
- * Draw label or bitmap or image for entry.
+ * Draw label and/or bitmap or image for entry.
*/
- baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
if (mePtr->image != NULL) {
Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight);
if ((mePtr->selectImage != NULL)
&& (mePtr->entryFlags & ENTRY_SELECTED)) {
Tk_RedrawImage(mePtr->selectImage, 0, 0,
- imageWidth, imageHeight, d, leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2));
+ imageWidth, imageHeight, d, leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset));
} else {
Tk_RedrawImage(mePtr->image, 0, 0, imageWidth,
- imageHeight, d, leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2));
+ imageHeight, d, leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset));
}
} else if (mePtr->bitmapPtr != NULL) {
- int width, height;
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
- Tk_SizeOfBitmap(menuPtr->display,
- bitmap, &width, &height);
XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0,
- (unsigned) width, (unsigned) height, leftEdge,
- (int) (y + (mePtr->height - height)/2), 1);
- } else {
+ (unsigned) imageWidth, (unsigned) imageHeight,
+ leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset), 1);
+ }
+ if ((mePtr->compound != COMPOUND_NONE) || !haveImage) {
if (mePtr->labelLength > 0) {
Tcl_DString itemTextDString, convertedTextDString;
+ int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
GetEntryText(mePtr, &itemTextDString);
@@ -3987,7 +4065,8 @@ DrawMenuEntryLabel(
exactly is going on, this will have to do: */
TkMacSetUpGraphicsPort(gc);
- MoveTo((short) leftEdge, (short) baseline);
+ MoveTo((short) leftEdge + textXOffset,
+ (short) baseline + textYOffset);
Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&itemTextDString),
Tcl_DStringLength(&itemTextDString), &convertedTextDString);
DrawText(Tcl_DStringValue(&convertedTextDString), 0,
@@ -4011,8 +4090,8 @@ DrawMenuEntryLabel(
} else if ((mePtr->image != NULL)
&& (menuPtr->disabledImageGC != None)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
- leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2),
+ leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
(unsigned) imageWidth, (unsigned) imageHeight);
}
}
@@ -4090,25 +4169,72 @@ GetMenuLabelGeometry(
* portion */
{
TkMenu *menuPtr = mePtr->menuPtr;
+ int haveImage = 0, haveText = 0;
if (mePtr->image != NULL) {
Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr);
+ haveImage = 1;
} else if (mePtr->bitmapPtr != NULL) {
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr);
+ haveImage = 1;
} else {
- *heightPtr = fmPtr->linespace;
+ *heightPtr = 0;
+ *widthPtr = 0;
+ }
+ if (haveImage && (mePtr->compound == COMPOUND_NONE)) {
+ /* We don't care about the text in this case */
+ } else {
+ /* Either it is compound or we don't have an image */
if (mePtr->labelPtr != NULL) {
Tcl_DString itemTextDString;
-
+ int textWidth;
GetEntryText(mePtr, &itemTextDString);
- *widthPtr = Tk_TextWidth(tkfont,
+ textWidth = Tk_TextWidth(tkfont,
Tcl_DStringValue(&itemTextDString),
Tcl_DStringLength(&itemTextDString));
Tcl_DStringFree(&itemTextDString);
+
+ if ((mePtr->compound != COMPOUND_NONE) && haveImage) {
+ switch ((enum compound) mePtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ /* Add text and padding */
+ *heightPtr += fmPtr->linespace + 2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ if (fmPtr->linespace > *heightPtr) {
+ *heightPtr = fmPtr->linespace;
+ }
+ /* Add text and padding */
+ *widthPtr += textWidth + 2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ if (fmPtr->linespace > *heightPtr) {
+ *heightPtr = fmPtr->linespace;
+ }
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
} else {
- *widthPtr = 0;
+ /* We don't have an image or we're not compound */
+ *heightPtr = fmPtr->linespace;
+ *widthPtr = textWidth;
+ }
+ } else {
+ /* An empty entry still has this height */
+ *heightPtr = fmPtr->linespace;
}
}
*heightPtr += 1;
@@ -4336,10 +4462,16 @@ TkpMenuNotifyToplevelCreate(
*----------------------------------------------------------------------
*/
+#if __MWERKS__ != 0x2400
+#define MDEF_PROC_OFFSET 0x24
+#else
+#define MDEF_PROC_OFFSET 0x20
+#endif
+
static Handle
FixMDEF(void)
{
-#ifdef GENERATINGCFM
+#if GENERATINGCFM
Handle MDEFHandle = GetResource('MDEF', 591);
Handle SICNHandle = GetResource('SICN', SICN_RESOURCE_NUMBER);
if ((MDEFHandle != NULL) && (SICNHandle != NULL)) {
@@ -4348,7 +4480,7 @@ FixMDEF(void)
if (menuDefProc == NULL) {
menuDefProc = TkNewMenuDefProc(MenuDefProc);
}
- memmove((void *) (((long) (*MDEFHandle)) + 0x24), &menuDefProc, 4);
+ memmove((void *) (((long) (*MDEFHandle)) + MDEF_PROC_OFFSET), &menuDefProc, 4);
return MDEFHandle;
} else {
return NULL;
@@ -4405,7 +4537,7 @@ TkpMenuInit(void)
}
FixMDEF();
- Tcl_ExternalToUtf(NULL, NULL, "\311", /* É */
+ Tcl_ExternalToUtf(NULL, NULL, "\311", /* Š */
-1, 0, NULL, elipsisString,
TCL_UTF_MAX + 1, NULL, NULL, NULL);
}
@@ -4473,4 +4605,3 @@ TkMacPreprocessMenu()
}
}
}
-
diff --git a/tk/mac/tkMacMenu.r b/tk/mac/tkMacMenu.r
index 58434300343..feb3a5f05ee 100644
--- a/tk/mac/tkMacMenu.r
+++ b/tk/mac/tkMacMenu.r
@@ -45,4 +45,3 @@ resource 'SICN' (128, preload, locked) {
$"0FE0 1FF0 3FF8"
}
};
-
diff --git a/tk/mac/tkMacMenubutton.c b/tk/mac/tkMacMenubutton.c
index b7ffe5d2898..75396fc6952 100644
--- a/tk/mac/tkMacMenubutton.c
+++ b/tk/mac/tkMacMenubutton.c
@@ -34,10 +34,9 @@ typedef struct MacMenuButton {
* procedures that can be invoked from generic window code.
*/
-TkClassProcs tkpMenubuttonClass = {
- NULL, /* createProc. */
- TkMenuButtonWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+Tk_ClassProcs tkpMenubuttonClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkMenuButtonWorldChanged, /* worldChangedProc */
};
/*
@@ -93,7 +92,9 @@ TkpDisplayMenuButton(
* compiler warning. */
int y;
Tk_Window tkwin = mbPtr->tkwin;
- int width, height;
+ int width, height, fullWidth, fullHeight;
+ int imageXOffset, imageYOffset, textXOffset, textYOffset;
+ int haveImage = 0, haveText = 0;
MacMenuButton * macMBPtr = (MacMenuButton *) mbPtr;
GWorldPtr destPort;
CGrafPtr saveWorld;
@@ -120,6 +121,15 @@ TkpDisplayMenuButton(
}
border = mbPtr->normalBorder;
+ if (mbPtr->image != None) {
+ Tk_SizeOfImage(mbPtr->image, &width, &height);
+ haveImage = 1;
+ } else if (mbPtr->bitmap != None) {
+ Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
+ haveText = (mbPtr->textWidth != 0 && mbPtr->textHeight != 0);
+
/*
* In order to avoid screen flashes, this procedure redraws
* the menu button in a pixmap, then copies the pixmap to the
@@ -130,6 +140,108 @@ TkpDisplayMenuButton(
Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), border, 0, 0,
Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+ imageXOffset = 0;
+ imageYOffset = 0;
+ textXOffset = 0;
+ textYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
+
+ if (mbPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ switch ((enum compound) mbPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ if (mbPtr->compound == COMPOUND_TOP) {
+ textYOffset = height + mbPtr->padY;
+ } else {
+ imageYOffset = mbPtr->textHeight + mbPtr->padY;
+ }
+ fullHeight = height + mbPtr->textHeight + mbPtr->padY;
+ fullWidth = (width > mbPtr->textWidth ? width :
+ mbPtr->textWidth);
+ textXOffset = (fullWidth - mbPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ if (mbPtr->compound == COMPOUND_LEFT) {
+ textXOffset = width + mbPtr->padX;
+ } else {
+ imageXOffset = mbPtr->textWidth + mbPtr->padX;
+ }
+ fullWidth = mbPtr->textWidth + mbPtr->padX + width;
+ fullHeight = (height > mbPtr->textHeight ? height :
+ mbPtr->textHeight);
+ textYOffset = (fullHeight - mbPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ fullWidth = (width > mbPtr->textWidth ? width :
+ mbPtr->textWidth);
+ fullHeight = (height > mbPtr->textHeight ? height :
+ mbPtr->textHeight);
+ textXOffset = (fullWidth - mbPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ textYOffset = (fullHeight - mbPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+
+
+ TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,
+ mbPtr->indicatorWidth + fullWidth, fullHeight,
+ &x, &y);
+
+ if (mbPtr->image != NULL) {
+ Tk_RedrawImage(mbPtr->image, 0, 0, width, height, Tk_WindowId(tkwin),
+ x + imageXOffset, y + imageYOffset);
+ }
+ if (mbPtr->bitmap != None) {
+ XCopyPlane(mbPtr->display, mbPtr->bitmap, Tk_WindowId(tkwin),
+ gc, 0, 0, (unsigned) width, (unsigned) height,
+ x + imageXOffset, y + imageYOffset, 1);
+ }
+ if (haveText) {
+ Tk_DrawTextLayout(mbPtr->display, Tk_WindowId(tkwin), gc,
+ mbPtr->textLayout, x + textXOffset, y + textYOffset ,
+ 0, -1);
+ Tk_UnderlineTextLayout(mbPtr->display, Tk_WindowId(tkwin), gc,
+ mbPtr->textLayout, x + textXOffset, y + textYOffset ,
+ mbPtr->underline);
+ }
+ } else {
+ if (mbPtr->image != NULL) {
+ TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,
+ width + mbPtr->indicatorWidth, height, &x, &y);
+ Tk_RedrawImage(mbPtr->image, 0, 0, width, height, Tk_WindowId(tkwin),
+ x + imageXOffset, y + imageYOffset);
+ } else if (mbPtr->bitmap != None) {
+ TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,
+ width + mbPtr->indicatorWidth, height, &x, &y);
+ XCopyPlane(mbPtr->display, mbPtr->bitmap, Tk_WindowId(tkwin),
+ gc, 0, 0, (unsigned) width, (unsigned) height,
+ x + imageXOffset, y + imageYOffset, 1);
+ } else {
+ TkComputeAnchor(mbPtr->anchor, tkwin, mbPtr->padX, mbPtr->padY,
+ mbPtr->textWidth + mbPtr->indicatorWidth,
+ mbPtr->textHeight, &x, &y);
+ Tk_DrawTextLayout(mbPtr->display, Tk_WindowId(tkwin), gc,
+ mbPtr->textLayout, x + textXOffset, y + textYOffset,
+ 0, -1);
+ Tk_UnderlineTextLayout(mbPtr->display, Tk_WindowId(tkwin), gc,
+ mbPtr->textLayout, x + textXOffset, y + textYOffset ,
+ mbPtr->underline);
+ }
+ }
+
+#if 0 /* this is the original code */
/*
* Display image or bitmap or text for button.
*/
@@ -157,6 +269,7 @@ TkpDisplayMenuButton(
Tk_DrawTextLayout(mbPtr->display, Tk_WindowId(tkwin), gc,
mbPtr->textLayout, x, y, 0, -1);
}
+#endif
/*
* If the menu button is disabled with a stipple rather than a special
@@ -283,7 +396,7 @@ void
TkpComputeMenuButtonGeometry(mbPtr)
register TkMenuButton *mbPtr; /* Widget record for menu button. */
{
- int width, height, mm, pixels;
+ int width=0, height=0, textwidth=0, textheight=0, mm, pixels, noimage=0;
mbPtr->inset = mbPtr->highlightWidth + mbPtr->borderWidth;
if (mbPtr->image != None) {
@@ -303,23 +416,54 @@ TkpComputeMenuButtonGeometry(mbPtr)
height = mbPtr->height;
}
} else {
+ noimage=1;
+ }
+
+ if ( noimage || mbPtr->compound != COMPOUND_NONE ) {
Tk_FreeTextLayout(mbPtr->textLayout);
mbPtr->textLayout = Tk_ComputeTextLayout(mbPtr->tkfont, mbPtr->text,
-1, mbPtr->wrapLength, mbPtr->justify, 0, &mbPtr->textWidth,
&mbPtr->textHeight);
- width = mbPtr->textWidth;
- height = mbPtr->textHeight;
+ textwidth = mbPtr->textWidth;
+ textheight = mbPtr->textHeight;
if (mbPtr->width > 0) {
- width = mbPtr->width * Tk_TextWidth(mbPtr->tkfont, "0", 1);
+ textwidth = mbPtr->width * Tk_TextWidth(mbPtr->tkfont, "0", 1);
}
if (mbPtr->height > 0) {
Tk_FontMetrics fm;
Tk_GetFontMetrics(mbPtr->tkfont, &fm);
- height = mbPtr->height * fm.linespace;
+ textheight = mbPtr->height * fm.linespace;
+ }
+ textwidth += 2*mbPtr->padX;
+ textheight += 2*mbPtr->padY;
+ }
+
+ switch ((enum compound) mbPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ height += textheight + mbPtr->padY;
+ width = (width > textwidth ? width : textwidth);
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ height = (height > textheight ? height : textheight);
+ width += textwidth + mbPtr->padX;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ height = (height > textheight ? height : textheight);
+ width = (width > textwidth ? width : textwidth);
+ break;
+ }
+ case COMPOUND_NONE: {
+ if (noimage) {
+ height = textheight;
+ width = textwidth;
+ }
+ break;
}
- width += 2*mbPtr->padX;
- height += 2*mbPtr->padY;
}
if (mbPtr->indicatorOn) {
@@ -337,4 +481,3 @@ TkpComputeMenuButtonGeometry(mbPtr)
(int) (height + 2*mbPtr->inset));
Tk_SetInternalBorder(mbPtr->tkwin, mbPtr->inset);
}
-
diff --git a/tk/mac/tkMacMenus.c b/tk/mac/tkMacMenus.c
index 2c38c8f1477..83209c6a1a5 100644
--- a/tk/mac/tkMacMenus.c
+++ b/tk/mac/tkMacMenus.c
@@ -106,7 +106,7 @@ TkMacHandleMenuSelect(
break;
}
default:
- GetItem(tkAppleMenu, theItem, name);
+ GetMenuItemText(tkAppleMenu, theItem, name);
HiliteMenu(0);
OpenDeskAcc(name);
return;
@@ -193,9 +193,9 @@ TkMacInitMenus(
panic("memory - menus");
}
InsertMenu(tkAppleMenu, 0);
- AppendMenu(tkAppleMenu, "\pAbout Tcl & TkÉ");
+ AppendMenu(tkAppleMenu, "\pAbout Tcl & TkŠ");
AppendMenu(tkAppleMenu, "\p(-");
- AddResMenu(tkAppleMenu, 'DRVR');
+ AppendResMenu(tkAppleMenu, 'DRVR');
if (TkMacUseMenuID(kFileMenu) != TCL_OK) {
panic("Menu ID %d is already in use!", kFileMenu);
@@ -205,7 +205,7 @@ TkMacInitMenus(
panic("memory - menus");
}
InsertMenu(tkFileMenu, 0);
- AppendMenu(tkFileMenu, "\pSourceÉ");
+ AppendMenu(tkFileMenu, "\pSourceŠ");
AppendMenu(tkFileMenu, "\pClose/W");
AppendMenu(tkFileMenu, "\p(-");
AppendMenu(tkFileMenu, "\pQuit/Q");
@@ -330,7 +330,7 @@ static void
SourceDialog()
{
int result;
- char *path;
+ CONST char *path;
char openCmd[] = "tk_getOpenFile -filetypes {\
{{TCL Scripts} {.tcl} TEXT} {{Text Files} {} TEXT}}";
@@ -353,5 +353,3 @@ SourceDialog()
Tcl_BackgroundError(gInterp);
}
}
-
-
diff --git a/tk/mac/tkMacPort.h b/tk/mac/tkMacPort.h
index 739d311ec44..024dc8223c5 100644
--- a/tk/mac/tkMacPort.h
+++ b/tk/mac/tkMacPort.h
@@ -71,14 +71,14 @@ extern int errno;
*/
#ifndef panic /* In a stubs-aware setting, this could confuse the #define */
-extern void panic _ANSI_ARGS_(TCL_VARARGS(char *, string));
+EXTERN void panic _ANSI_ARGS_(TCL_VARARGS(char *, string));
#endif
#ifndef strcasecmp
-extern int strcasecmp _ANSI_ARGS_((CONST char *s1,
+EXTERN int strcasecmp _ANSI_ARGS_((CONST char *s1,
CONST char *s2));
#endif
#ifndef strncasecmp
-extern int strncasecmp _ANSI_ARGS_((CONST char *s1,
+EXTERN int strncasecmp _ANSI_ARGS_((CONST char *s1,
CONST char *s2, size_t n));
#endif
/*
@@ -120,17 +120,18 @@ extern int strncasecmp _ANSI_ARGS_((CONST char *s1,
/*
* This macro stores a representation of the window handle in a string.
+ * This should perhaps use the real size of an XID.
*/
#define TkpPrintWindowId(buf,w) \
sprintf((buf), "0x%x", (unsigned int) (w))
-
+
/*
* TkpScanWindowId is just an alias for Tcl_GetInt on Unix.
*/
#define TkpScanWindowId(i,s,wp) \
- Tcl_GetInt((i),(s),(wp))
+ Tcl_GetInt((i),(s),(int *)(wp))
/*
* Magic pixel values for dynamic (or active) colors.
@@ -149,6 +150,13 @@ extern int strncasecmp _ANSI_ARGS_((CONST char *s1,
#define MENU_TEXT_PIXEL 51
#define APPEARANCE_PIXEL 52
-#endif /* _TKMACPORT */
+/*
+ * The following declaration is used to get access to a private Tcl interface
+ * that is needed for portability reasons.
+ */
+#ifndef _TCLINT
+#include <tclInt.h>
+#endif
+#endif /* _TKMACPORT */
diff --git a/tk/mac/tkMacProjects.sea.hqx b/tk/mac/tkMacProjects.sea.hqx
index 56c4c86375e..209db471743 100644
--- a/tk/mac/tkMacProjects.sea.hqx
+++ b/tk/mac/tkMacProjects.sea.hqx
@@ -1,2792 +1,3590 @@
(This file must be converted with BinHex 4.0)
-:"R4V,R0PB3""8&"-BA9cG#!!N!1@&3!"P3mV5&0dG@CQ5A3J+'-T-6Nj0bda16N
-i)%&XB@4ND@iJ8hPcG'9YFb`J5@jM,L`JD(4dF$S[,hH3!bjKE'&NC'PZFhPc,Q0
-[E5p6G(9QCNPd,`d+'J!&%!!!PK8!N!0b!!%!N!0brcJ0TD95CA0PFRCPC+@P!+@
-3"!%!!$)!3,3GFADeGBBE!*!0!P2P!*!$b!!+bj!!!!#963!$G'X!!&9d!%i!$!'
-!!Ed$i!#3!i%$"rrirr$$3!!!J!#3"k@3"!%!!$S!!,5Kk8#eGBB3!*!$FJ!!$"N
-!N!0b!!T4MJ!!Ge3!!!Vc!*!%$`"8Dep04%9',Xq!!!#A[%e08(*$9dP&!3#3$i!
-!N!G#`G5k3PH`5A9,6'dL5XCiri8jld(5Ui8@CKHM[(RT9G-i*ZpVPpC`6-pSFT9
-S)fkfe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!
+%!!&lmJ#3"!)!!!FJ!"G#!*!%!J%!$L!!&e)!N!@!rrm!!"GH!*!(FJ!!)0)!N!@
+%rrm!!#%Y!*!%"%[rr`3!)6%"!#-B!3Arr`!!&ji!N!3"#2rr!!!L9`#3"!%&!"F
+!!"I2!*!%!3J!J3!!)SX!N!@%rrm!!#+9!*!&!Irr)!!Af3#3"3,rrb!!'"`!N!3
+'8h4KG(9c"R"bEfe`G!M%)(0eCQCTH!C6G'&dGA-16hGZCA)JFQ9cEh9bBf8,5@j
+cCA*d)%4TFfX34AKTFh4TEQG3BA0cGfpbC"Y&H'PcG'PZCe"KFh0hEh*N,8&`F'9
+KFQ&ZBf8,5@jcCA*d)%4TFfX16hGZCA)JFQ9cEh9bBf8E4AKTFh4TEQG3BA0cGfp
+bC#e"F("PBA*KEQ0P#90PCfePER3J-3P6C@GYC@jd)$)*8f9RE@9ZG#!c#90PCfe
+PER3J03P6C@GYC@jd)$B*8f9RE@9ZG#!fUl3:
diff --git a/tk/mac/tkMacRegion.c b/tk/mac/tkMacRegion.c
index e724996c680..4582456c6c4 100644
--- a/tk/mac/tkMacRegion.c
+++ b/tk/mac/tkMacRegion.c
@@ -216,4 +216,33 @@ TkClipBox(
rect_return->width = (**rgn).rgnBBox.right - (**rgn).rgnBBox.left;
rect_return->height = (**rgn).rgnBBox.bottom - (**rgn).rgnBBox.top;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSubtractRegion --
+ *
+ * Implements the equivilent of the X window function
+ * XSubtractRegion. See X window documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkSubtractRegion(
+ TkRegion sra,
+ TkRegion srb,
+ TkRegion dr_return)
+{
+ RgnHandle srcRgnA = (RgnHandle) sra;
+ RgnHandle srcRgnB = (RgnHandle) srb;
+ RgnHandle destRgn = (RgnHandle) dr_return;
+ DiffRgn(srcRgnA, srcRgnB, destRgn);
+}
diff --git a/tk/mac/tkMacResource.r b/tk/mac/tkMacResource.r
index 02c277b1e9a..742e0852c98 100644
--- a/tk/mac/tkMacResource.r
+++ b/tk/mac/tkMacResource.r
@@ -32,35 +32,6 @@
#include "tcl.h"
#include "tk.h"
-#if (TK_RELEASE_LEVEL == 0)
-# define RELEASE_LEVEL alpha
-#elif (TK_RELEASE_LEVEL == 1)
-# define RELEASE_LEVEL beta
-#elif (TK_RELEASE_LEVEL == 2)
-# define RELEASE_LEVEL final
-#endif
-
-#if (TK_RELEASE_LEVEL == 2)
-# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
-#else
-# define MINOR_VERSION TK_MINOR_VERSION * 16
-#endif
-
-resource 'vers' (1) {
- TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
- TK_PATCH_LEVEL,
- TK_PATCH_LEVEL ", by Ray Johnson & Jim Ingham " "\n" "© 1993-1997 Sun Microsystems" "\n" "© 1998-1999 Scriptics Inc."
-};
-
-resource 'vers' (2) {
- TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
- TK_PATCH_LEVEL,
- "Wish " TK_PATCH_LEVEL " © 1993-1999"
-};
-
-
/*
* The mechanisim below loads Tcl source into the resource fork of the
* application. The example below creates a TEXT resource named
@@ -73,45 +44,9 @@ resource 'vers' (2) {
* will load the TEXT resource named "Init".
*/
-#include "tclMacTclCode.r"
-
-read 'TEXT' (10, "tk", purgeable, preload) "::library:tk.tcl";
-read 'TEXT' (11, "button", purgeable, preload) "::library:button.tcl";
-read 'TEXT' (12, "dialog", purgeable, preload) "::library:dialog.tcl";
-read 'TEXT' (13, "entry", purgeable, preload) "::library:entry.tcl";
-read 'TEXT' (14, "focus", purgeable, preload) "::library:focus.tcl";
-read 'TEXT' (15, "listbox", purgeable, preload) "::library:listbox.tcl";
-read 'TEXT' (16, "menu", purgeable, preload) "::library:menu.tcl";
-read 'TEXT' (17, "optionMenu", purgeable, preload) "::library:optMenu.tcl";
-read 'TEXT' (18, "palette", purgeable, preload) "::library:palette.tcl";
-read 'TEXT' (19, "scale", purgeable, preload) "::library:scale.tcl";
-read 'TEXT' (20, "scrollbar", purgeable, preload) "::library:scrlbar.tcl";
-read 'TEXT' (21, "tearoff", purgeable, preload) "::library:tearoff.tcl";
-read 'TEXT' (22, "text", purgeable, preload) "::library:text.tcl";
-read 'TEXT' (23, "tkerror", purgeable, preload) "::library:bgerror.tcl";
-read 'TEXT' (24, "Console", purgeable, preload) "::library:console.tcl";
-read 'TEXT' (25, "msgbox", purgeable, preload) "::library:msgbox.tcl";
-read 'TEXT' (26, "comdlg", purgeable, preload) "::library:comdlg.tcl";
-
-/*
- * The following resource is used when creating the 'env' variable in
- * the Macintosh environment. The creation mechanisim looks for the
- * 'STR#' resource named "Tcl Environment Variables" rather than a
- * specific resource number. (In other words, feel free to change the
- * resource id if it conflicts with your application.) Each string in
- * the resource must be of the form "KEYWORD=SOME STRING". See Tcl
- * documentation for futher information about the env variable.
- */
-
-/* A good example of something you may want to set is:
- * "TCL_LIBRARY=My disk:etc."
- */
-
-resource 'STR#' (128, "Tcl Environment Variables") {
- { "SCHEDULE_NAME=Agent Controller Schedule",
- "SCHEDULE_PATH=Lozoya:System Folder:Tcl Lib:Tcl-Scheduler"
- };
-};
+#ifndef TCLTK_NO_LIBRARY_TEXT_RESOURCES
+#include "tkMacTclCode.r"
+#endif
/*
* The following two resources define the default "About Box" for Mac Tk.
@@ -133,9 +68,9 @@ resource 'DITL' (128, "About Box", purgeable) {
{ 14, 108, 137, 314}, StaticText {disabled,
"Wish - Windowing Shell" "\n" "based on Tcl "
TCL_PATCH_LEVEL " & Tk " TK_PATCH_LEVEL "\n\n"
- "Ray Johnson & Jim Ingham" "\n"
- "Scriptics Inc." "\n"
- "jim.ingham@cygnus.com"},
+ "Jim Ingham & Ray Johnson" "\n"
+ "© 2001 Tcl Core Team" "\n"
+ "jingham@apple.com"},
{ 19, 24, 119, 92}, Picture {enabled, 128}
}
};
@@ -500,4 +435,3 @@ resource 'MENU' (132, preload) {
textMenuProc,
0xFFFF, enabled, "", {}
};
-
diff --git a/tk/mac/tkMacScale.c b/tk/mac/tkMacScale.c
index 04bdc462b73..ef214fd3df8 100644
--- a/tk/mac/tkMacScale.c
+++ b/tk/mac/tkMacScale.c
@@ -437,5 +437,3 @@ ScaleActionProc(ControlRef theControl, ControlPartCode partCode)
Tcl_Release((ClientData) scalePtr);
}
-
-
diff --git a/tk/mac/tkMacScrlbr.c b/tk/mac/tkMacScrlbr.c
index e4e973a242c..ce91a43012c 100644
--- a/tk/mac/tkMacScrlbr.c
+++ b/tk/mac/tkMacScrlbr.c
@@ -16,6 +16,7 @@
#include "tkScrollbar.h"
#include "tkMacInt.h"
#include <Controls.h>
+#include <ControlDefinitions.h>
/*
* The following definitions should really be in MacOS
@@ -113,13 +114,13 @@ static pascal void ThumbActionProc _ANSI_ARGS_((void));
static void UpdateControlValues _ANSI_ARGS_((MacScrollbar *macScrollPtr));
/*
- * The class procedure table for the scrollbar widget.
+ * The class procedure table for the scrollbar widget. Leave the proc fields
+ * initialized to NULL, which should happen automatically because of the scope
+ * at which the variable is declared.
*/
-TkClassProcs tkpScrollbarProcs = {
- NULL, /* createProc. */
- NULL, /* geometryProc. */
- NULL /* modalProc */
+Tk_ClassProcs tkpScrollbarProcs = {
+ sizeof(Tk_ClassProcs) /* size */
};
/*
@@ -516,15 +517,15 @@ TkpScrollbarPosition(
(**macScrollPtr->sbHandle).contrlHilite = 255;
}
switch (part) {
- case inUpButton:
+ case kControlUpButtonPart:
return TOP_ARROW;
- case inPageUp:
+ case kControlPageUpPart:
return TOP_GAP;
- case inThumb:
+ case kControlIndicatorPart:
return SLIDER;
- case inPageDown:
+ case kControlPageDownPart:
return BOTTOM_GAP;
- case inDownButton:
+ case kControlDownButtonPart:
return BOTTOM_ARROW;
default:
return OUTSIDE;
@@ -687,22 +688,22 @@ ScrollbarActionProc(
ControlRef theControl, /* Handle to scrollbat control */
ControlPartCode partCode) /* Part of scrollbar that was "hit" */
{
- register TkScrollbar *scrollPtr = (TkScrollbar *) GetCRefCon(theControl);
+ register TkScrollbar *scrollPtr = (TkScrollbar *) GetControlReference(theControl);
Tcl_DString cmdString;
Tcl_DStringInit(&cmdString);
Tcl_DStringAppend(&cmdString, scrollPtr->command,
scrollPtr->commandSize);
- if (partCode == inUpButton || partCode == inDownButton) {
+ if (partCode == kControlUpButtonPart || partCode == kControlDownButtonPart) {
Tcl_DStringAppendElement(&cmdString, "scroll");
Tcl_DStringAppendElement(&cmdString,
- (partCode == inUpButton ) ? "-1" : "1");
+ (partCode == kControlUpButtonPart ) ? "-1" : "1");
Tcl_DStringAppendElement(&cmdString, "unit");
- } else if (partCode == inPageUp || partCode == inPageDown) {
+ } else if (partCode == kControlPageUpPart || partCode == kControlPageDownPart) {
Tcl_DStringAppendElement(&cmdString, "scroll");
Tcl_DStringAppendElement(&cmdString,
- (partCode == inPageUp ) ? "-1" : "1");
+ (partCode == kControlPageUpPart ) ? "-1" : "1");
Tcl_DStringAppendElement(&cmdString, "page");
}
Tcl_Preserve((ClientData) scrollPtr->interp);
@@ -770,7 +771,7 @@ ScrollbarBindProc(
where.h = eventPtr->xbutton.x + bounds.left;
where.v = eventPtr->xbutton.y + bounds.top;
part = TestControl(macScrollPtr->sbHandle, where);
- if (part == inThumb && scrollPtr->jump == false) {
+ if (part == kControlIndicatorPart && scrollPtr->jump == false) {
/*
* Case 1: In thumb, no jump scrolling. Call track control
* with the thumb action proc which will do most of the work.
@@ -781,14 +782,14 @@ ScrollbarBindProc(
part = TrackControl(macScrollPtr->sbHandle, where,
(ControlActionUPP) thumbActionProc);
activeScrollPtr = NULL;
- } else if (part == inThumb) {
+ } else if (part == kControlIndicatorPart) {
/*
* Case 2: in thumb with jump scrolling. Call TrackControl
* with a NULL action proc. Use the new value of the control
* to set update the control.
*/
part = TrackControl(macScrollPtr->sbHandle, where, NULL);
- if (part == inThumb) {
+ if (part == kControlIndicatorPart) {
double newFirstFraction, thumbWidth;
Tcl_DString cmdString;
char vauleString[TCL_DOUBLE_SPACE];
@@ -1066,4 +1067,3 @@ UpdateControlValues(
(**macScrollPtr->sbHandle).contrlVis = 255;
}
}
-
diff --git a/tk/mac/tkMacSend.c b/tk/mac/tkMacSend.c
index 611436ee041..e470536eac7 100644
--- a/tk/mac/tkMacSend.c
+++ b/tk/mac/tkMacSend.c
@@ -234,12 +234,12 @@ static int ValidateName _ANSI_ARGS_((TkDisplay *dispPtr,
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_SetAppName(
Tk_Window tkwin, /* Token for any window in the application
* to be named: it is just used to identify
* the application and the display. */
- char *name) /* The name that will be used to
+ CONST char *name) /* The name that will be used to
* refer to the interpreter in later
* "send" commands. Must be globally
* unique. */
@@ -361,7 +361,7 @@ Tk_SendObjCmd(
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[]) /* The arguments */
{
- static char *sendOptions[] = {"-async", "-displayof", "-", (char *) NULL};
+ static CONST char *sendOptions[] = {"-async", "-displayof", "-", (char *) NULL};
char *stringRep, *destName;
int async = 0;
int i, index, firstArg;
@@ -546,4 +546,3 @@ SendInit(
{
return TCL_OK;
}
-
diff --git a/tk/mac/tkMacSubwindows.c b/tk/mac/tkMacSubwindows.c
index e422ca82d79..4b179d78ce7 100644
--- a/tk/mac/tkMacSubwindows.c
+++ b/tk/mac/tkMacSubwindows.c
@@ -724,14 +724,14 @@ TkMacUpdateClipRgn(
* This is not currently enforced, however.
*/
- if (!Tk_IsTopLevel(winPtr)) {
+ if (!Tk_TopWinHierarchy(winPtr)) {
TkMacUpdateClipRgn(winPtr->parentPtr);
SectRgn(rgn,
winPtr->parentPtr->privatePtr->aboveClipRgn, rgn);
win2Ptr = winPtr->nextPtr;
while (win2Ptr != NULL) {
- if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ if (Tk_TopWinHierarchy(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
win2Ptr = win2Ptr->nextPtr;
continue;
}
@@ -776,7 +776,7 @@ TkMacUpdateClipRgn(
win2Ptr = winPtr->childList;
while (win2Ptr != NULL) {
- if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ if (Tk_TopWinHierarchy(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
win2Ptr = win2Ptr->nextPtr;
continue;
}
@@ -1000,7 +1000,7 @@ TkMacInvalClipRgns(
*/
childPtr = winPtr->childList;
while (childPtr != NULL) {
- if (!Tk_IsTopLevel(childPtr) && Tk_IsMapped(childPtr)) {
+ if (!Tk_TopWinHierarchy(childPtr) && Tk_IsMapped(childPtr)) {
TkMacInvalClipRgns(childPtr);
}
childPtr = childPtr->nextPtr;
@@ -1133,7 +1133,7 @@ UpdateOffsets(
childPtr = winPtr->childList;
while (childPtr != NULL) {
- if (!Tk_IsTopLevel(childPtr)) {
+ if (!Tk_TopWinHierarchy(childPtr)) {
UpdateOffsets(childPtr, deltaX, deltaY);
}
childPtr = childPtr->nextPtr;
@@ -1256,4 +1256,3 @@ Tk_FreePixmap(
ckfree((char *) macPix);
}
-
diff --git a/tk/mac/tkMacTclCode.r b/tk/mac/tkMacTclCode.r
new file mode 100644
index 00000000000..adbd0f66a02
--- /dev/null
+++ b/tk/mac/tkMacTclCode.r
@@ -0,0 +1,71 @@
+/*
+ * tkMacTclCode.r --
+ *
+ * This file creates resources from the Tcl code that is
+ * usually stored in the TCL_LIBRARY
+ *
+ * Copyright (c) 1996-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.
+ *
+ * SCCS: @(#) tkMacTclCode.r 1.1 98/01/21 22:22:38
+ */
+
+#include <Types.r>
+#include <SysTypes.r>
+
+#define TK_LIBRARY_RESOURCES 3000
+
+/*
+ * The mechanisim below loads Tcl source into the resource fork of the
+ * application. The example below creates a TEXT resource named
+ * "Init" from the file "init.tcl". This allows applications to use
+ * Tcl to define the behavior of the application without having to
+ * require some predetermined file structure - all needed Tcl "files"
+ * are located within the application. To source a file for the
+ * resource fork the source command has been modified to support
+ * sourcing from resources. In the below case "source -rsrc {Init}"
+ * will load the TEXT resource named "Init".
+ */
+
+read 'TEXT' (TK_LIBRARY_RESOURCES+1, "tk", purgeable,preload)
+ "::library:tk.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+2, "button", purgeable)
+ "::library:button.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+3, "dialog", purgeable)
+ "::library:dialog.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+4, "entry", purgeable)
+ "::library:entry.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+5, "focus", purgeable)
+ "::library:focus.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+6, "listbox", purgeable)
+ "::library:listbox.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+7, "menu", purgeable)
+ "::library:menu.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+8, "optMenu", purgeable)
+ "::library:optMenu.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+9, "palette", purgeable)
+ "::library:palette.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+10, "scale", purgeable)
+ "::library:scale.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+11, "scrlbar", purgeable)
+ "::library:scrlbar.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+12, "tearoff", purgeable)
+ "::library:tearoff.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+13, "text", purgeable)
+ "::library:text.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+14, "bgerror", purgeable)
+ "::library:bgerror.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+15, "console", purgeable)
+ "::library:console.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+16, "msgbox", purgeable)
+ "::library:msgbox.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+17, "comdlg", purgeable)
+ "::library:comdlg.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+18, "spinbox", purgeable)
+ "::library:spinbox.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+19, "panedwindow", purgeable)
+ "::library:panedwindow.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+20, "msgcat", purgeable)
+ ":::tcl:library:msgcat:msgcat.tcl";
diff --git a/tk/mac/tkMacTest.c b/tk/mac/tkMacTest.c
index 5ab1b5f12b3..7df886f25c0 100644
--- a/tk/mac/tkMacTest.c
+++ b/tk/mac/tkMacTest.c
@@ -80,4 +80,3 @@ DebuggerCmd(
Debugger();
return TCL_OK;
}
-
diff --git a/tk/mac/tkMacWindowMgr.c b/tk/mac/tkMacWindowMgr.c
index 58cd4a7ec7d..cfc61d6b589 100644
--- a/tk/mac/tkMacWindowMgr.c
+++ b/tk/mac/tkMacWindowMgr.c
@@ -273,13 +273,13 @@ TkAboutDlg()
while (itemHit != 1) {
ModalDialog( NULL, &itemHit);
}
- DisposDialog(aboutDlog);
+ DisposeDialog(aboutDlog);
aboutDlog = NULL;
if (TkMacHaveAppearance() >= 0x110) {
- SelectWindow(FrontWindow());
- } else {
SelectWindow(FrontNonFloatingWindow());
+ } else {
+ SelectWindow(FrontWindow());
}
return;
@@ -426,7 +426,7 @@ GenerateUpdates(
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
- if (!Tk_IsMapped(childPtr) || Tk_IsTopLevel(childPtr)) {
+ if (!Tk_IsMapped(childPtr) || Tk_TopWinHierarchy(childPtr)) {
continue;
}
@@ -1234,7 +1234,11 @@ TkMacConvertEvent(
/* fall through */
case keyUp:
+ if (TkMacHaveAppearance() >= 0x110) {
whichWindow = FrontNonFloatingWindow();
+ } else {
+ whichWindow = FrontWindow();
+ }
if (whichWindow == NULL) {
/*
* This happens if we get a key event before Tk has had a
@@ -1542,7 +1546,7 @@ void
TkpSetCapture(
TkWindow *winPtr) /* Capture window, or NULL. */
{
- while ((winPtr != NULL) && !Tk_IsTopLevel(winPtr)) {
+ while ((winPtr != NULL) && !Tk_TopWinHierarchy(winPtr)) {
winPtr = winPtr->parentPtr;
}
gGrabWinPtr = (Tk_Window) winPtr;
@@ -1715,7 +1719,7 @@ BringWindowForward(
WindowRef wRef)
{
if (!TkpIsWindowFloating(wRef)) {
- if (IsValidWindowPtr(wRef))
+ if ((TkMacHaveAppearance() < 0x110) || IsValidWindowPtr(wRef))
SelectWindow(wRef);
}
}
@@ -1785,5 +1789,3 @@ TkpIsWindowFloating(WindowRef wRef)
return (class == kFloatingWindowClass);
}
-
-
diff --git a/tk/mac/tkMacWm.c b/tk/mac/tkMacWm.c
index 888f02945c8..91a33dd623e 100644
--- a/tk/mac/tkMacWm.c
+++ b/tk/mac/tkMacWm.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkMacWm.c --
*
* This module takes care of the interactions between a Tk-based
@@ -28,10 +28,10 @@
/*
* We now require the Appearance headers. They come with CodeWarrior Pro,
- * and are on the SDK CD. However, we do not require the Appearance
+ * and are on the SDK CD. However, we do not require the Appearance
* extension
*/
-
+
#include <Appearance.h>
/*
@@ -49,7 +49,7 @@ typedef struct ProtocolHandler {
* end of list. */
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
char command[4]; /* Tcl command to invoke when a client
- * message for this protocol arrives.
+ * message for this protocol arrives.
* The actual size of the structure varies
* to accommodate the needs of the actual
* command. THIS MUST BE THE LAST FIELD OF
@@ -73,9 +73,9 @@ typedef struct TkWmInfo {
* not be window's immediate parent). If
* the window isn't reparented, this has the
* value None. */
- Tk_Uid titleUid; /* Title to display in window caption. If
- * NULL, use name of widget. */
- Tk_Uid iconName; /* Name to display in icon. */
+ char *title; /* Title to display in window caption. If
+ * NULL, use name of widget. Malloced. */
+ char *iconName; /* Name to display in icon. Malloced. */
Window master; /* Master window for TRANSIENT_FOR property,
* or None. */
XWMHints hints; /* Various pieces of information for
@@ -194,7 +194,7 @@ typedef struct TkWmInfo {
ProtocolHandler *protPtr; /* First in list of protocol handlers for
* this window (NULL means none). */
int cmdArgc; /* Number of elements in cmdArgv below. */
- char **cmdArgv; /* Array of strings to store in the
+ CONST char **cmdArgv; /* Array of strings to store in the
* WM_COMMAND property. NULL means nothing
* available. */
char *clientMachine; /* String to store in WM_CLIENT_MACHINE
@@ -314,18 +314,110 @@ void tkMacMoveWindow(WindowRef window, int x, int y);
* Forward declarations for procedures defined in this file:
*/
-static void InitialWindowBounds _ANSI_ARGS_((TkWindow *winPtr,
+static void InitialWindowBounds _ANSI_ARGS_((TkWindow *winPtr,
Rect *geometry));
static int ParseGeometry _ANSI_ARGS_((Tcl_Interp *interp,
char *string, TkWindow *winPtr));
static void TopLevelEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
+static void TkWmStackorderToplevelWrapperMap _ANSI_ARGS_((
+ TkWindow *winPtr,
+ Tcl_HashTable *reparentTable));
static void TopLevelReqProc _ANSI_ARGS_((ClientData dummy,
Tk_Window tkwin));
static void UpdateGeometryInfo _ANSI_ARGS_((
ClientData clientData));
static void UpdateSizeHints _ANSI_ARGS_((TkWindow *winPtr));
static void UpdateVRootGeometry _ANSI_ARGS_((WmInfo *wmPtr));
+static int WmAspectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmAttributesCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmClientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmColormapwindowsCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmCommandCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmDeiconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFocusmodelCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFrameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGeometryCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGridCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGroupCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconbitmapCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconmaskCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconnameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconpositionCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconwindowCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMaxsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMinsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmOverrideredirectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmPositionfromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmProtocolCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmResizableCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmSizefromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStackorderCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStateCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTitleCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTransientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmWithdrawCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static void WmUpdateGeom _ANSI_ARGS_((WmInfo *wmPtr,
+ TkWindow *winPtr));
/*
*--------------------------------------------------------------
@@ -350,11 +442,11 @@ TkWmNewWindow(
TkWindow *winPtr) /* Newly-created top-level window. */
{
register WmInfo *wmPtr;
-
+
wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
wmPtr->winPtr = winPtr;
wmPtr->reparent = None;
- wmPtr->titleUid = NULL;
+ wmPtr->title = NULL;
wmPtr->iconName = NULL;
wmPtr->master = None;
wmPtr->hints.flags = InputHint | StateHint;
@@ -462,7 +554,7 @@ TkWmMapWindow(
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
Point where = {0, 0};
- int xOffset, yOffset;
+ int xOffset, yOffset;
int firstMap = false;
MacDrawable *macWin;
@@ -477,7 +569,7 @@ TkWmMapWindow(
if (!TkMacHostToplevelExists(winPtr)) {
TkMacMakeRealWindowExist(winPtr);
}
-
+
/*
* Generate configure event when we first map the window.
*/
@@ -486,35 +578,32 @@ TkWmMapWindow(
&xOffset, &yOffset);
where.h -= xOffset;
where.v -= yOffset;
- TkGenWMConfigureEvent((Tk_Window) winPtr,
+ TkGenWMConfigureEvent((Tk_Window) winPtr,
where.h, where.v, -1, -1, TK_LOCATION_CHANGED);
-
+
/*
* This is the first time this window has ever been mapped.
* Store all the window-manager-related information for the
* window.
*/
- if (wmPtr->titleUid == NULL) {
- wmPtr->titleUid = winPtr->nameUid;
- }
-
if (!Tk_IsEmbedded(winPtr)) {
- TkSetWMName(winPtr, wmPtr->titleUid);
+ TkSetWMName(winPtr, ((wmPtr->title != NULL) ?
+ wmPtr->title : winPtr->nameUid);
}
TkWmSetClass(winPtr);
-
+
if (wmPtr->iconName != NULL) {
XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
}
-
+
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
}
if (wmPtr->hints.initial_state == WithdrawnState) {
return;
}
-
+
/*
* TODO: we need to display a window if it's iconic on creation.
*/
@@ -522,7 +611,7 @@ TkWmMapWindow(
if (wmPtr->hints.initial_state == IconicState) {
return;
}
-
+
/*
* Update geometry information.
*/
@@ -538,13 +627,13 @@ TkWmMapWindow(
*/
XMapWindow(winPtr->display, winPtr->window);
-
+
/*
* Now that the window is visable we can determine the offset
* from the window's content orgin to the window's decorative
* orgin (structure orgin).
*/
- TkMacWindowOffset((WindowRef) TkMacGetDrawablePort(Tk_WindowId(winPtr)),
+ TkMacWindowOffset((WindowRef) TkMacGetDrawablePort(Tk_WindowId(winPtr)),
&wmPtr->xInParent, &wmPtr->yInParent);
}
@@ -601,6 +690,12 @@ TkWmDeadWindow(winPtr)
if (wmPtr == NULL) {
return;
}
+ if (wmPtr->title != NULL) {
+ ckfree(wmPtr->title);
+ }
+ if (wmPtr->iconName != NULL) {
+ ckfree(wmPtr->iconName);
+ }
if (wmPtr->hints.flags & IconPixmapHint) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
}
@@ -672,7 +767,7 @@ TkWmSetClass(
/*
*----------------------------------------------------------------------
*
- * Tk_WmCmd --
+ * Tk_WmObjCmd --
*
* This procedure is invoked to process the "wm" Tcl command.
* See the user documentation for details on what it does.
@@ -688,1028 +783,2023 @@ TkWmSetClass(
/* ARGSUSED */
int
-Tk_WmCmd(
+Tk_WmObjCmd(
ClientData clientData, /* Main window associated with
* interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
+ static CONST char *optionStrings[] = {
+ "aspect", "attributes", "client", "colormapwindows",
+ "command", "deiconify", "focusmodel", "frame",
+ "geometry", "grid", "group", "iconbitmap",
+ "iconify", "iconmask", "iconname", "iconposition",
+ "iconwindow", "maxsize", "minsize", "overrideredirect",
+ "positionfrom", "protocol", "resizable", "sizefrom",
+ "stackorder", "state", "title", "transient",
+ "withdraw", (char *) NULL };
+ enum options {
+ WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS,
+ WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FRAME,
+ WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBITMAP,
+ WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME, WMOPT_ICONPOSITION,
+ WMOPT_ICONWINDOW, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT,
+ WMOPT_POSITIONFROM, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM,
+ WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT,
+ WMOPT_WITHDRAW };
+ int index, length;
+ char *argv1;
TkWindow *winPtr;
- register WmInfo *wmPtr;
- int c;
- size_t length;
+ TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (argc < 2) {
+ if (objc < 2) {
wrongNumArgs:
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " option window ?arg ...?\"", (char *) NULL);
+ Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 't') && (strncmp(argv[1], "tracing", length) == 0)
+
+ argv1 = Tcl_GetStringFromObj(objv[1], &length);
+ if ((argv1[0] == 't') && (strncmp(argv1, "tracing", length) == 0)
&& (length >= 3)) {
- if ((argc != 2) && (argc != 3)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " tracing ?boolean?\"", (char *) NULL);
+ if ((objc != 2) && (objc != 3)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
return TCL_ERROR;
}
- if (argc == 2) {
+ if (objc == 2) {
Tcl_SetResult(interp, ((wmTracing) ? "on" : "off"), TCL_STATIC);
return TCL_OK;
}
- return Tcl_GetBoolean(interp, argv[2], &wmTracing);
+ return Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing);
}
- if (argc < 3) {
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (objc < 3) {
goto wrongNumArgs;
}
- winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[2], tkwin);
- if (winPtr == NULL) {
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], (Tk_Window *) &winPtr)
+ != TCL_OK) {
return TCL_ERROR;
}
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!Tk_IsTopLevel(winPtr)) {
Tcl_AppendResult(interp, "window \"", winPtr->pathName,
"\" isn't a top-level window", (char *) NULL);
return TCL_ERROR;
}
- wmPtr = winPtr->wmInfoPtr;
- if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)) {
- int numer1, denom1, numer2, denom2;
- if ((argc != 3) && (argc != 7)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " aspect window ?minNumer minDenom ",
- "maxNumer maxDenom?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & PAspect) {
- char buf[TCL_INTEGER_SPACE * 4];
+ switch ((enum options) index) {
+ case WMOPT_ASPECT:
+ return WmAspectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ATTRIBUTES:
+ return WmAttributesCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_CLIENT:
+ return WmClientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COLORMAPWINDOWS:
+ return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COMMAND:
+ return WmCommandCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_DEICONIFY:
+ return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FOCUSMODEL:
+ return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FRAME:
+ return WmFrameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GEOMETRY:
+ return WmGeometryCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GRID:
+ return WmGridCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GROUP:
+ return WmGroupCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONBITMAP:
+ return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONIFY:
+ return WmIconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONMASK:
+ return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONNAME:
+ return WmIconnameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONPOSITION:
+ return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONWINDOW:
+ return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MAXSIZE:
+ return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MINSIZE:
+ return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_OVERRIDEREDIRECT:
+ return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_POSITIONFROM:
+ return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_PROTOCOL:
+ return WmProtocolCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_RESIZABLE:
+ return WmResizableCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_SIZEFROM:
+ return WmSizefromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STACKORDER:
+ return WmStackorderCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STATE:
+ return WmStateCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TITLE:
+ return WmTitleCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TRANSIENT:
+ return WmTransientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_WITHDRAW:
+ return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv);
+ }
- sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
- wmPtr->minAspect.y, wmPtr->maxAspect.x,
- wmPtr->maxAspect.y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~PAspect;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &numer1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &denom1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[5], &numer2) != TCL_OK)
- || (Tcl_GetInt(interp, argv[6], &denom2) != TCL_OK)) {
- return TCL_ERROR;
- }
- if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
- (denom2 <= 0)) {
- Tcl_SetResult(interp, "aspect number can't be <= 0",
- TCL_STATIC);
- return TCL_ERROR;
- }
- wmPtr->minAspect.x = numer1;
- wmPtr->minAspect.y = denom1;
- wmPtr->maxAspect.x = numer2;
- wmPtr->maxAspect.y = denom2;
- wmPtr->sizeHintsFlags |= PAspect;
+ /* This should not happen */
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAspectCmd --
+ *
+ * This procedure is invoked to process the "wm aspect" 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
+WmAspectCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int numer1, denom1, numer2, denom2;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?minNumer minDenom maxNumer maxDenom?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PAspect) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
+ wmPtr->minAspect.y, wmPtr->maxAspect.x,
+ wmPtr->maxAspect.y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'c') && (strncmp(argv[1], "client", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " client window ?name?\"",
- (char *) NULL);
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~PAspect;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &numer1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->clientMachine != NULL) {
- Tcl_SetResult(interp, wmPtr->clientMachine, TCL_STATIC);
- }
- return TCL_OK;
+ if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
+ (denom2 <= 0)) {
+ Tcl_SetResult(interp, "aspect number can't be <= 0",
+ TCL_STATIC);
+ return TCL_ERROR;
}
- if (argv[3][0] == 0) {
- if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
- wmPtr->clientMachine = NULL;
- }
- return TCL_OK;
+ wmPtr->minAspect.x = numer1;
+ wmPtr->minAspect.y = denom1;
+ wmPtr->maxAspect.x = numer2;
+ wmPtr->maxAspect.y = denom2;
+ wmPtr->sizeHintsFlags |= PAspect;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAttributesCmd --
+ *
+ * This procedure is invoked to process the "wm attributes" 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
+WmAttributesCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmClientCmd --
+ *
+ * This procedure is invoked to process the "wm client" 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
+WmClientCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->clientMachine != NULL) {
+ Tcl_SetResult(interp, wmPtr->clientMachine, TCL_STATIC);
}
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (argv3[0] == 0) {
if (wmPtr->clientMachine != NULL) {
ckfree((char *) wmPtr->clientMachine);
+ wmPtr->clientMachine = NULL;
}
- wmPtr->clientMachine = (char *)
- ckalloc((unsigned) (strlen(argv[3]) + 1));
- strcpy(wmPtr->clientMachine, argv[3]);
- } else if ((c == 'c') && (strncmp(argv[1], "colormapwindows", length) == 0)
- && (length >= 3)) {
- TkWindow **cmapList;
- TkWindow *winPtr2;
- int i, windowArgc, gotToplevel = 0;
- char **windowArgv;
+ return TCL_OK;
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ }
+ wmPtr->clientMachine = (char *)
+ ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->clientMachine, argv3);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmColormapwindowsCmd --
+ *
+ * This procedure is invoked to process the "wm colormapwindows"
+ * Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " colormapwindows window ?windowList?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
- for (i = 0; i < wmPtr->cmapCount; i++) {
- if ((i == (wmPtr->cmapCount-1))
- && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
- break;
- }
- Tcl_AppendElement(interp, wmPtr->cmapList[i]->pathName);
+static int
+WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ TkWindow **cmapList;
+ TkWindow *winPtr2;
+ int i, windowObjc, gotToplevel = 0;
+ Tcl_Obj **windowObjv;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?windowList?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ for (i = 0; i < wmPtr->cmapCount; i++) {
+ if ((i == (wmPtr->cmapCount-1))
+ && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
+ break;
}
- return TCL_OK;
+ Tcl_AppendElement(interp, wmPtr->cmapList[i]->pathName);
}
- if (Tcl_SplitList(interp, argv[3], &windowArgc, &windowArgv)
- != TCL_OK) {
+ return TCL_OK;
+ }
+ if (Tcl_ListObjGetElements(interp, objv[3], &windowObjc, &windowObjv)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ cmapList = (TkWindow **) ckalloc((unsigned)
+ ((windowObjc+1)*sizeof(TkWindow*)));
+ for (i = 0; i < windowObjc; i++) {
+ if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
+ (Tk_Window *) &winPtr2) != TCL_OK)
+ {
+ ckfree((char *) cmapList);
return TCL_ERROR;
}
- cmapList = (TkWindow **) ckalloc((unsigned)
- ((windowArgc+1)*sizeof(TkWindow*)));
- for (i = 0; i < windowArgc; i++) {
- winPtr2 = (TkWindow *) Tk_NameToWindow(interp, windowArgv[i],
- tkwin);
- if (winPtr2 == NULL) {
- ckfree((char *) cmapList);
- ckfree((char *) windowArgv);
- return TCL_ERROR;
- }
- if (winPtr2 == winPtr) {
- gotToplevel = 1;
- }
- if (winPtr2->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr2);
- }
- cmapList[i] = winPtr2;
+ if (winPtr2 == winPtr) {
+ gotToplevel = 1;
}
- if (!gotToplevel) {
- wmPtr->flags |= WM_ADDED_TOPLEVEL_COLORMAP;
- cmapList[windowArgc] = winPtr;
- windowArgc++;
- } else {
- wmPtr->flags &= ~WM_ADDED_TOPLEVEL_COLORMAP;
+ if (winPtr2->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr2);
+ }
+ cmapList[i] = winPtr2;
+ }
+ if (!gotToplevel) {
+ wmPtr->flags |= WM_ADDED_TOPLEVEL_COLORMAP;
+ cmapList[windowObjc] = winPtr;
+ windowObjc++;
+ } else {
+ wmPtr->flags &= ~WM_ADDED_TOPLEVEL_COLORMAP;
+ }
+ wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
+ if (wmPtr->cmapList != NULL) {
+ ckfree((char *)wmPtr->cmapList);
+ }
+ wmPtr->cmapList = cmapList;
+ wmPtr->cmapCount = windowObjc;
+
+ /*
+ * On the Macintosh all of this is just an excercise
+ * in compatability as we don't support colormaps. If
+ * we did they would be installed here.
+ */
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmCommandCmd --
+ *
+ * This procedure is invoked to process the "wm command" 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
+WmCommandCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int cmdArgc;
+ CONST char **cmdArgv;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->cmdArgv != NULL) {
+ Tcl_SetResult(interp,
+ Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
+ TCL_DYNAMIC);
}
- wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
- if (wmPtr->cmapList != NULL) {
- ckfree((char *)wmPtr->cmapList);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (argv3[0] == 0) {
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ wmPtr->cmdArgv = NULL;
}
- wmPtr->cmapList = cmapList;
- wmPtr->cmapCount = windowArgc;
- ckfree((char *) windowArgv);
+ return TCL_OK;
+ }
+ if (Tcl_SplitList(interp, argv3, &cmdArgc, &cmdArgv) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ }
+ wmPtr->cmdArgc = cmdArgc;
+ wmPtr->cmdArgv = cmdArgv;
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmDeiconifyCmd --
+ *
+ * This procedure is invoked to process the "wm deiconify" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * On the Macintosh all of this is just an excercise
- * in compatability as we don't support colormaps. If
- * we did they would be installed here.
- */
+static int
+WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't deiconify ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * TODO: may not want to call this function - look at Map events gened.
+ */
+ TkpWmSetState(winPtr, NormalState);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFocusmodelCmd --
+ *
+ * This procedure is invoked to process the "wm focusmodel" 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
+WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "active", "passive", (char *) NULL };
+ enum options {
+ OPT_ACTIVE, OPT_PASSIVE };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?active|passive?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp, (wmPtr->hints.input ? "passive" : "active"),
+ TCL_STATIC);
return TCL_OK;
- } else if ((c == 'c') && (strncmp(argv[1], "command", length) == 0)
- && (length >= 3)) {
- int cmdArgc;
- char **cmdArgv;
+ }
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " command window ?value?\"",
- (char *) NULL);
- return TCL_ERROR;
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == OPT_ACTIVE) {
+ wmPtr->hints.input = False;
+ } else { /* OPT_PASSIVE */
+ wmPtr->hints.input = True;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFrameCmd --
+ *
+ * This procedure is invoked to process the "wm frame" 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
+WmFrameCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Window window;
+ char buf[TCL_INTEGER_SPACE];
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ window = wmPtr->reparent;
+ if (window == None) {
+ window = Tk_WindowId((Tk_Window) winPtr);
+ }
+ sprintf(buf, "0x%x", (unsigned int) window);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGeometryCmd --
+ *
+ * This procedure is invoked to process the "wm geometry" 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
+WmGeometryCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char xSign, ySign;
+ int width, height;
+ char *argv3;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[16 + TCL_INTEGER_SPACE * 4];
+
+ xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
+ ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
+ if (wmPtr->gridWin != NULL) {
+ width = wmPtr->reqGridWidth + (winPtr->changes.width
+ - winPtr->reqWidth)/wmPtr->widthInc;
+ height = wmPtr->reqGridHeight + (winPtr->changes.height
+ - winPtr->reqHeight)/wmPtr->heightInc;
+ } else {
+ width = winPtr->changes.width;
+ height = winPtr->changes.height;
}
- if (argc == 3) {
- if (wmPtr->cmdArgv != NULL) {
- Tcl_SetResult(interp,
- Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
- TCL_DYNAMIC);
- }
- return TCL_OK;
+ sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
+ ySign, wmPtr->y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ wmPtr->width = -1;
+ wmPtr->height = -1;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+ }
+ return ParseGeometry(interp, argv3, winPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGridCmd --
+ *
+ * This procedure is invoked to process the "wm grid" 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
+WmGridCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int reqWidth, reqHeight, widthInc, heightInc;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?baseWidth baseHeight widthInc heightInc?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PBaseSize) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->reqGridWidth,
+ wmPtr->reqGridHeight, wmPtr->widthInc,
+ wmPtr->heightInc);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- if (argv[3][0] == 0) {
- if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
- wmPtr->cmdArgv = NULL;
- }
- return TCL_OK;
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ /*
+ * Turn off gridding and reset the width and height
+ * to make sense as ungridded numbers.
+ */
+
+ wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
+ if (wmPtr->width != -1) {
+ wmPtr->width = winPtr->reqWidth + (wmPtr->width
+ - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ wmPtr->height = winPtr->reqHeight + (wmPtr->height
+ - wmPtr->reqGridHeight)*wmPtr->heightInc;
}
- if (Tcl_SplitList(interp, argv[3], &cmdArgc, &cmdArgv) != TCL_OK) {
+ wmPtr->widthInc = 1;
+ wmPtr->heightInc = 1;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &reqWidth) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &heightInc) != TCL_OK)) {
return TCL_ERROR;
}
- if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
- }
- wmPtr->cmdArgc = cmdArgc;
- wmPtr->cmdArgv = cmdArgv;
- } else if ((c == 'd') && (strncmp(argv[1], "deiconify", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " deiconify window\"", (char *) NULL);
+ if (reqWidth < 0) {
+ Tcl_SetResult(interp, "baseWidth can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't deiconify ", argv[2],
- ": it is an icon for ", winPtr->pathName, (char *) NULL);
+ if (reqHeight < 0) {
+ Tcl_SetResult(interp, "baseHeight can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- if (winPtr->flags & TK_EMBEDDED) {
- Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,
- ": it is an embedded window", (char *) NULL);
- return TCL_ERROR;
- }
-
- /*
- * TODO: may not want to call this function - look at Map events gened.
- */
-
- TkpWmSetState(winPtr, NormalState);
- } else if ((c == 'f') && (strncmp(argv[1], "focusmodel", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " focusmodel window ?active|passive?\"",
- (char *) NULL);
+ if (widthInc < 0) {
+ Tcl_SetResult(interp, "widthInc can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- if (argc == 3) {
- Tcl_SetResult(interp, (wmPtr->hints.input ? "passive" : "active"),
- TCL_STATIC);
- return TCL_OK;
- }
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'a') && (strncmp(argv[3], "active", length) == 0)) {
- wmPtr->hints.input = False;
- } else if ((c == 'p') && (strncmp(argv[3], "passive", length) == 0)) {
- wmPtr->hints.input = True;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be active or passive", (char *) NULL);
+ if (heightInc < 0) {
+ Tcl_SetResult(interp, "heightInc can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- } else if ((c == 'f') && (strncmp(argv[1], "frame", length) == 0)
- && (length >= 2)) {
- Window window;
- char buf[TCL_INTEGER_SPACE];
+ Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
+ heightInc);
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGroupCmd --
+ *
+ * This procedure is invoked to process the "wm group" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " frame window\"", (char *) NULL);
- return TCL_ERROR;
+static int
+WmGroupCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & WindowGroupHint) {
+ Tcl_SetResult(interp, wmPtr->leaderName, TCL_STATIC);
}
- window = wmPtr->reparent;
- if (window == None) {
- window = Tk_WindowId((Tk_Window) winPtr);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (*argv3 == '\0') {
+ wmPtr->hints.flags &= ~WindowGroupHint;
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
}
- sprintf(buf, "0x%x", (unsigned int) window);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if ((c == 'g') && (strncmp(argv[1], "geometry", length) == 0)
- && (length >= 2)) {
- char xSign, ySign;
- int width, height;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " geometry window ?newGeometry?\"",
- (char *) NULL);
+ wmPtr->leaderName = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
- if (argc == 3) {
- char buf[16 + TCL_INTEGER_SPACE * 4];
-
- xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
- ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
- if (wmPtr->gridWin != NULL) {
- width = wmPtr->reqGridWidth + (winPtr->changes.width
- - winPtr->reqWidth)/wmPtr->widthInc;
- height = wmPtr->reqGridHeight + (winPtr->changes.height
- - winPtr->reqHeight)/wmPtr->heightInc;
- } else {
- width = winPtr->changes.width;
- height = winPtr->changes.height;
- }
- sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
- ySign, wmPtr->y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->width = -1;
- wmPtr->height = -1;
- goto updateGeom;
+ Tk_MakeWindowExist(tkwin2);
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
}
- return ParseGeometry(interp, argv[3], winPtr);
- } else if ((c == 'g') && (strncmp(argv[1], "grid", length) == 0)
- && (length >= 3)) {
- int reqWidth, reqHeight, widthInc, heightInc;
+ wmPtr->hints.window_group = Tk_WindowId(tkwin2);
+ wmPtr->hints.flags |= WindowGroupHint;
+ wmPtr->leaderName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->leaderName, argv3);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconbitmapCmd --
+ *
+ * This procedure is invoked to process the "wm iconbitmap" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 7)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " grid window ?baseWidth baseHeight ",
- "widthInc heightInc?\"", (char *) NULL);
+static int
+WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ Pixmap pixmap;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconPixmapHint) {
+ Tcl_SetResult(interp,
+ Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
+ TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ if (wmPtr->hints.icon_pixmap != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
+ wmPtr->hints.icon_pixmap = None;
+ }
+ wmPtr->hints.flags &= ~IconPixmapHint;
+ } else {
+ pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr, argv3);
+ if (pixmap == None) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & PBaseSize) {
- char buf[TCL_INTEGER_SPACE * 4];
+ wmPtr->hints.icon_pixmap = pixmap;
+ wmPtr->hints.flags |= IconPixmapHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconifyCmd --
+ *
+ * This procedure is invoked to process the "wm iconify" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- sprintf(buf, "%d %d %d %d", wmPtr->reqGridWidth,
- wmPtr->reqGridHeight, wmPtr->widthInc,
- wmPtr->heightInc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- /*
- * Turn off gridding and reset the width and height
- * to make sense as ungridded numbers.
- */
+static int
+WmIconifyCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": override-redirect flag is set", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->master != None) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+ TkpWmSetState(winPtr, IconicState);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconmaskCmd --
+ *
+ * This procedure is invoked to process the "wm iconmask" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
- if (wmPtr->width != -1) {
- wmPtr->width = winPtr->reqWidth + (wmPtr->width
- - wmPtr->reqGridWidth)*wmPtr->widthInc;
- wmPtr->height = winPtr->reqHeight + (wmPtr->height
- - wmPtr->reqGridHeight)*wmPtr->heightInc;
- }
- wmPtr->widthInc = 1;
- wmPtr->heightInc = 1;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &reqWidth) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &reqHeight) != TCL_OK)
- || (Tcl_GetInt(interp, argv[5], &widthInc) != TCL_OK)
- || (Tcl_GetInt(interp, argv[6], &heightInc) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (reqWidth < 0) {
- Tcl_SetResult(interp, "baseWidth can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (reqHeight < 0) {
- Tcl_SetResult(interp, "baseHeight can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (widthInc < 0) {
- Tcl_SetResult(interp, "widthInc can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (heightInc < 0) {
- Tcl_SetResult(interp, "heightInc can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
- heightInc);
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'g') && (strncmp(argv[1], "group", length) == 0)
- && (length >= 3)) {
- Tk_Window tkwin2;
+static int
+WmIconmaskCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Pixmap pixmap;
+ char *argv3;
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " group window ?pathName?\"",
- (char *) NULL);
- return TCL_ERROR;
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconMaskHint) {
+ Tcl_SetResult(interp,
+ Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
+ TCL_STATIC);
}
- if (argc == 3) {
- if (wmPtr->hints.flags & WindowGroupHint) {
- Tcl_SetResult(interp, wmPtr->leaderName, TCL_STATIC);
- }
- return TCL_OK;
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ if (wmPtr->hints.icon_mask != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~WindowGroupHint;
- if (wmPtr->leaderName != NULL) {
- ckfree(wmPtr->leaderName);
- }
- wmPtr->leaderName = NULL;
- } else {
- tkwin2 = Tk_NameToWindow(interp, argv[3], tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- Tk_MakeWindowExist(tkwin2);
- wmPtr->hints.window_group = Tk_WindowId(tkwin2);
- wmPtr->hints.flags |= WindowGroupHint;
- wmPtr->leaderName = ckalloc((unsigned) (strlen(argv[3])+1));
- strcpy(wmPtr->leaderName, argv[3]);
+ wmPtr->hints.flags &= ~IconMaskHint;
+ } else {
+ pixmap = Tk_GetBitmap(interp, tkwin, argv3);
+ if (pixmap == None) {
+ return TCL_ERROR;
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconbitmap", length) == 0)
- && (length >= 5)) {
- Pixmap pixmap;
+ wmPtr->hints.icon_mask = pixmap;
+ wmPtr->hints.flags |= IconMaskHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconnameCmd --
+ *
+ * This procedure is invoked to process the "wm iconname" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconbitmap window ?bitmap?\"",
- (char *) NULL);
- return TCL_ERROR;
+static int
+WmIconnameCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp,
+ ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ if (wmPtr->iconName != NULL) {
+ ckfree((char *) wmPtr->iconName);
}
- if (argc == 3) {
- if (wmPtr->hints.flags & IconPixmapHint) {
- Tcl_SetResult(interp,
- Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
- TCL_STATIC);
- }
- return TCL_OK;
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->iconName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->iconName, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
}
- if (*argv[3] == '\0') {
- if (wmPtr->hints.icon_pixmap != None) {
- Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
- }
- wmPtr->hints.flags &= ~IconPixmapHint;
- } else {
- pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr,
- Tk_GetUid(argv[3]));
- if (pixmap == None) {
- return TCL_ERROR;
- }
- wmPtr->hints.icon_pixmap = pixmap;
- wmPtr->hints.flags |= IconPixmapHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconpositionCmd --
+ *
+ * This procedure is invoked to process the "wm iconposition"
+ * 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
+WmIconpositionCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int x, y;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?x y?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconPositionHint) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->hints.icon_x,
+ wmPtr->hints.icon_y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconify", length) == 0)
- && (length >= 5)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconify window\"", (char *) NULL);
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconPositionHint;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)){
return TCL_ERROR;
}
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
- Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
- "\": override-redirect flag is set", (char *) NULL);
- return TCL_ERROR;
+ wmPtr->hints.icon_x = x;
+ wmPtr->hints.icon_y = y;
+ wmPtr->hints.flags |= IconPositionHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconwindowCmd --
+ *
+ * This procedure is invoked to process the "wm iconwindow" 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
+WmIconwindowCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ WmInfo *wmPtr2;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->icon != NULL) {
+ Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
}
- if (wmPtr->master != None) {
- Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
- "\": it is a transient", (char *) NULL);
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconWindowHint;
+ if (wmPtr->icon != NULL) {
+ wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr2->iconFor = NULL;
+ wmPtr2->hints.initial_state = WithdrawnState;
+ }
+ wmPtr->icon = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't iconify ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
- (char *) NULL);
+ if (!Tk_IsTopLevel(tkwin2)) {
+ Tcl_AppendResult(interp, "can't use ", Tcl_GetString(objv[3]),
+ " as icon window: not at top level", (char *) NULL);
return TCL_ERROR;
}
- if (winPtr->flags & TK_EMBEDDED) {
- Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
- ": it is an embedded window", (char *) NULL);
- return TCL_ERROR;
- }
- TkpWmSetState(winPtr, IconicState);
- } else if ((c == 'i') && (strncmp(argv[1], "iconmask", length) == 0)
- && (length >= 5)) {
- Pixmap pixmap;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconmask window ?bitmap?\"",
- (char *) NULL);
+ wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
+ if (wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[3]),
+ " is already an icon for ",
+ Tk_PathName(wmPtr2->iconFor), (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->hints.flags & IconMaskHint) {
- Tcl_SetResult(interp,
- Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
- TCL_STATIC);
- }
- return TCL_OK;
+ if (wmPtr->icon != NULL) {
+ WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr3->iconFor = NULL;
}
- if (*argv[3] == '\0') {
- if (wmPtr->hints.icon_mask != None) {
- Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
- }
- wmPtr->hints.flags &= ~IconMaskHint;
- } else {
- pixmap = Tk_GetBitmap(interp, tkwin, Tk_GetUid(argv[3]));
- if (pixmap == None) {
- return TCL_ERROR;
- }
- wmPtr->hints.icon_mask = pixmap;
- wmPtr->hints.flags |= IconMaskHint;
- }
- } else if ((c == 'i') && (strncmp(argv[1], "iconname", length) == 0)
- && (length >= 5)) {
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconname window ?newName?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- Tcl_SetResult(interp,
- ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""),
- TCL_STATIC);
- return TCL_OK;
- } else {
- wmPtr->iconName = Tk_GetUid(argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
- }
+ Tk_MakeWindowExist(tkwin2);
+ wmPtr->hints.icon_window = Tk_WindowId(tkwin2);
+ wmPtr->hints.flags |= IconWindowHint;
+ wmPtr->icon = tkwin2;
+ wmPtr2->iconFor = (Tk_Window) winPtr;
+ if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
+ /*
+ * Don't have iconwindows on the Mac. We just withdraw.
+ */
+
+ Tk_UnmapWindow(tkwin2);
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconposition", length) == 0)
- && (length >= 5)) {
- int x, y;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMaxsizeCmd --
+ *
+ * This procedure is invoked to process the "wm maxsize" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconposition window ?x y?\"",
- (char *) NULL);
- return TCL_ERROR;
+static int
+WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->maxWidth, wmPtr->maxHeight);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->maxWidth = width;
+ wmPtr->maxHeight = height;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMinsizeCmd --
+ *
+ * This procedure is invoked to process the "wm minsize" 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
+WmMinsizeCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->minWidth, wmPtr->minHeight);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->minWidth = width;
+ wmPtr->minHeight = height;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmOverrideredirectCmd --
+ *
+ * This procedure is invoked to process the "wm overrideredirect"
+ * 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
+WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int boolean;
+ XSetWindowAttributes atts;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
+ Tk_Attributes((Tk_Window) winPtr)->override_redirect);
+ return TCL_OK;
+ }
+ if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ atts.override_redirect = (boolean) ? True : False;
+ Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
+ &atts);
+ wmPtr->style = (boolean) ? plainDBox : documentProc;
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmPositionfromCmd --
+ *
+ * This procedure is invoked to process the "wm positionfrom"
+ * 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
+WmPositionfromCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user/program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USPosition) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PPosition) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
}
- if (argc == 3) {
- if (wmPtr->hints.flags & IconPositionHint) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- sprintf(buf, "%d %d", wmPtr->hints.icon_x,
- wmPtr->hints.icon_y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~IconPositionHint;
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PPosition;
+ wmPtr->sizeHintsFlags |= USPosition;
} else {
- if ((Tcl_GetInt(interp, argv[3], &x) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &y) != TCL_OK)){
- return TCL_ERROR;
- }
- wmPtr->hints.icon_x = x;
- wmPtr->hints.icon_y = y;
- wmPtr->hints.flags |= IconPositionHint;
+ wmPtr->sizeHintsFlags &= ~USPosition;
+ wmPtr->sizeHintsFlags |= PPosition;
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconwindow", length) == 0)
- && (length >= 5)) {
- Tk_Window tkwin2;
- WmInfo *wmPtr2;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconwindow window ?pathName?\"",
- (char *) NULL);
- return TCL_ERROR;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmProtocolCmd --
+ *
+ * This procedure is invoked to process the "wm protocol" 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
+WmProtocolCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ register ProtocolHandler *protPtr, *prevPtr;
+ Atom protocol;
+ char *cmd;
+ int cmdLength;
+
+ if ((objc < 3) || (objc > 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ /*
+ * Return a list of all defined protocols for the window.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ Tcl_AppendElement(interp,
+ Tk_GetAtomName((Tk_Window) winPtr, protPtr->protocol));
}
- if (argc == 3) {
- if (wmPtr->icon != NULL) {
- Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
+ return TCL_OK;
+ }
+ protocol = Tk_InternAtom((Tk_Window) winPtr, Tcl_GetString(objv[3]));
+ if (objc == 4) {
+ /*
+ * Return the command to handle a given protocol.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ Tcl_SetResult(interp, protPtr->command, TCL_STATIC);
+ return TCL_OK;
}
- return TCL_OK;
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~IconWindowHint;
- if (wmPtr->icon != NULL) {
- wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
- wmPtr2->iconFor = NULL;
- wmPtr2->hints.initial_state = WithdrawnState;
- }
- wmPtr->icon = NULL;
- } else {
- tkwin2 = Tk_NameToWindow(interp, argv[3], tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- if (!Tk_IsTopLevel(tkwin2)) {
- Tcl_AppendResult(interp, "can't use ", argv[3],
- " as icon window: not at top level", (char *) NULL);
- return TCL_ERROR;
- }
- wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
- if (wmPtr2->iconFor != NULL) {
- Tcl_AppendResult(interp, argv[3], " is already an icon for ",
- Tk_PathName(wmPtr2->iconFor), (char *) NULL);
- return TCL_ERROR;
- }
- if (wmPtr->icon != NULL) {
- WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
- wmPtr3->iconFor = NULL;
- }
- Tk_MakeWindowExist(tkwin2);
- wmPtr->hints.icon_window = Tk_WindowId(tkwin2);
- wmPtr->hints.flags |= IconWindowHint;
- wmPtr->icon = tkwin2;
- wmPtr2->iconFor = (Tk_Window) winPtr;
- if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
- /*
- * Don't have iconwindows on the Mac. We just withdraw.
- */
+ return TCL_OK;
+ }
+
+ /*
+ * Delete any current protocol handler, then create a new
+ * one with the specified command, unless the command is
+ * empty.
+ */
- Tk_UnmapWindow(tkwin2);
+ for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
+ prevPtr = protPtr, protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ if (prevPtr == NULL) {
+ wmPtr->protPtr = protPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = protPtr->nextPtr;
}
+ Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ break;
}
- } else if ((c == 'm') && (strncmp(argv[1], "maxsize", length) == 0)
- && (length >= 2)) {
- int width, height;
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " maxsize window ?width height?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- sprintf(buf, "%d %d", wmPtr->maxWidth, wmPtr->maxHeight);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
- }
- if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &height) != TCL_OK)) {
- return TCL_ERROR;
- }
- wmPtr->maxWidth = width;
- wmPtr->maxHeight = height;
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'm') && (strncmp(argv[1], "minsize", length) == 0)
- && (length >= 2)) {
- int width, height;
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " minsize window ?width height?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- sprintf(buf, "%d %d", wmPtr->minWidth, wmPtr->minHeight);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
+ }
+ cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
+ if (cmdLength > 0) {
+ protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr->protocol = protocol;
+ protPtr->nextPtr = wmPtr->protPtr;
+ wmPtr->protPtr = protPtr;
+ protPtr->interp = interp;
+ strcpy(protPtr->command, cmd);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmResizableCmd --
+ *
+ * This procedure is invoked to process the "wm resizable" 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
+WmResizableCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d",
+ (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetBooleanFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetBooleanFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if (width) {
+ wmPtr->flags &= ~WM_WIDTH_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
+ }
+ if (height) {
+ wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ if (wmPtr->scrollWinPtr != NULL) {
+ TkScrollbarEventuallyRedraw(
+ (TkScrollbar *) wmPtr->scrollWinPtr->instanceData);
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmSizefromCmd --
+ *
+ * This procedure is invoked to process the "wm sizefrom" 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
+WmSizefromCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user|program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USSize) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PSize) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
}
- if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &height) != TCL_OK)) {
+ return TCL_OK;
+ }
+
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USSize|PSize);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- wmPtr->minWidth = width;
- wmPtr->minHeight = height;
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'o')
- && (strncmp(argv[1], "overrideredirect", length) == 0)) {
- int boolean;
- XSetWindowAttributes atts;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " overrideredirect window ?boolean?\"",
- (char *) NULL);
- return TCL_ERROR;
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PSize;
+ wmPtr->sizeHintsFlags |= USSize;
+ } else { /* OPT_PROGRAM */
+ wmPtr->sizeHintsFlags &= ~USSize;
+ wmPtr->sizeHintsFlags |= PSize;
}
- if (argc == 3) {
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
- Tcl_SetResult(interp, "1", TCL_STATIC);
- } else {
- Tcl_SetResult(interp, "0", TCL_STATIC);
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStackorderCmd --
+ *
+ * This procedure is invoked to process the "wm stackorder" 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
+WmStackorderCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ TkWindow **windows, **window_ptr;
+ static CONST char *optionStrings[] = {
+ "isabove", "isbelow", (char *) NULL };
+ enum options {
+ OPT_ISABOVE, OPT_ISBELOW };
+ int index;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?isabove|isbelow window?");
+ return TCL_ERROR;
+ }
+
+ if (objc == 3) {
+ windows = TkWmStackorderToplevel(winPtr);
+ if (windows == NULL) {
+ panic("TkWmStackorderToplevel failed");
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ Tcl_AppendElement(interp, (*window_ptr)->pathName);
}
+ ckfree((char *) windows);
return TCL_OK;
}
- if (Tcl_GetBoolean(interp, argv[3], &boolean) != TCL_OK) {
+ } else {
+ TkWindow *winPtr2;
+ int index1=-1, index2=-1, result;
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[4], (Tk_Window *) &winPtr2)
+ != TCL_OK) {
return TCL_ERROR;
}
- atts.override_redirect = (boolean) ? True : False;
- Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
- &atts);
- wmPtr->style = (boolean) ? plainDBox : documentProc;
- } else if ((c == 'p') && (strncmp(argv[1], "positionfrom", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " positionfrom window ?user/program?\"",
- (char *) NULL);
+
+ if (!Tk_IsTopLevel(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't a top-level window", (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & USPosition) {
- Tcl_SetResult(interp, "user", TCL_STATIC);
- } else if (wmPtr->sizeHintsFlags & PPosition) {
- Tcl_SetResult(interp, "program", TCL_STATIC);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
- } else {
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'u') && (strncmp(argv[3], "user", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~PPosition;
- wmPtr->sizeHintsFlags |= USPosition;
- } else if ((c == 'p') &&
- (strncmp(argv[3], "program", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~USPosition;
- wmPtr->sizeHintsFlags |= PPosition;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be program or user", (char *) NULL);
- return TCL_ERROR;
- }
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'p') && (strncmp(argv[1], "protocol", length) == 0)
- && (length >= 2)) {
- register ProtocolHandler *protPtr, *prevPtr;
- Atom protocol;
- int cmdLength;
-
- if ((argc < 3) || (argc > 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " protocol window ?name? ?command?\"",
- (char *) NULL);
+
+ if (!Tk_IsMapped(winPtr)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't mapped", (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- /*
- * Return a list of all defined protocols for the window.
- */
- for (protPtr = wmPtr->protPtr; protPtr != NULL;
- protPtr = protPtr->nextPtr) {
- Tcl_AppendElement(interp,
- Tk_GetAtomName((Tk_Window) winPtr, protPtr->protocol));
- }
- return TCL_OK;
- }
- protocol = Tk_InternAtom((Tk_Window) winPtr, argv[3]);
- if (argc == 4) {
- /*
- * Return the command to handle a given protocol.
- */
- for (protPtr = wmPtr->protPtr; protPtr != NULL;
- protPtr = protPtr->nextPtr) {
- if (protPtr->protocol == protocol) {
- Tcl_SetResult(interp, protPtr->command, TCL_STATIC);
- return TCL_OK;
- }
- }
- return TCL_OK;
+
+ if (!Tk_IsMapped(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't mapped", (char *) NULL);
+ return TCL_ERROR;
}
/*
- * Delete any current protocol handler, then create a new
- * one with the specified command, unless the command is
- * empty.
+ * Lookup stacking order of all toplevels that are children
+ * of "." and find the position of winPtr and winPtr2
+ * in the stacking order.
*/
- for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
- prevPtr = protPtr, protPtr = protPtr->nextPtr) {
- if (protPtr->protocol == protocol) {
- if (prevPtr == NULL) {
- wmPtr->protPtr = protPtr->nextPtr;
- } else {
- prevPtr->nextPtr = protPtr->nextPtr;
- }
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
- break;
- }
- }
- cmdLength = strlen(argv[4]);
- if (cmdLength > 0) {
- protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
- protPtr->protocol = protocol;
- protPtr->nextPtr = wmPtr->protPtr;
- wmPtr->protPtr = protPtr;
- protPtr->interp = interp;
- strcpy(protPtr->command, argv[4]);
- }
- } else if ((c == 'r') && (strncmp(argv[1], "resizable", length) == 0)) {
- int width, height;
+ windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " resizable window ?width height?\"",
- (char *) NULL);
+ if (windows == NULL) {
+ Tcl_AppendResult(interp, "TkWmStackorderToplevel failed",
+ (char *) NULL);
return TCL_ERROR;
- }
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ if (*window_ptr == winPtr)
+ index1 = (window_ptr - windows);
+ if (*window_ptr == winPtr2)
+ index2 = (window_ptr - windows);
+ }
+ if (index1 == -1)
+ panic("winPtr window not found");
+ if (index2 == -1)
+ panic("winPtr2 window not found");
- sprintf(buf, "%d %d",
- (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
- (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
+ ckfree((char *) windows);
}
- if ((Tcl_GetBoolean(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetBoolean(interp, argv[4], &height) != TCL_OK)) {
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- if (width) {
- wmPtr->flags &= ~WM_WIDTH_NOT_RESIZABLE;
- } else {
- wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
- }
- if (height) {
- wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
- } else {
- wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- if (wmPtr->scrollWinPtr != NULL) {
- TkScrollbarEventuallyRedraw(
- (TkScrollbar *) wmPtr->scrollWinPtr->instanceData);
+ if (index == OPT_ISABOVE) {
+ result = index1 > index2;
+ } else { /* OPT_ISBELOW */
+ result = index1 < index2;
}
- goto updateGeom;
- } else if ((c == 's') && (strncmp(argv[1], "sizefrom", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " sizefrom window ?user|program?\"",
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
+ return TCL_OK;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStateCmd --
+ *
+ * This procedure is invoked to process the "wm state" 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
+WmStateCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "normal", "iconic", "withdrawn", "zoomed", (char *) NULL };
+ enum options {
+ OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED };
+ int index;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?state?");
+ return TCL_ERROR;
+ }
+ if (objc == 4) {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
(char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & USSize) {
- Tcl_SetResult(interp, "user", TCL_STATIC);
- } else if (wmPtr->sizeHintsFlags & PSize) {
- Tcl_SetResult(interp, "program", TCL_STATIC);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~(USSize|PSize);
- } else {
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'u') && (strncmp(argv[3], "user", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~PSize;
- wmPtr->sizeHintsFlags |= USSize;
- } else if ((c == 'p')
- && (strncmp(argv[3], "program", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~USSize;
- wmPtr->sizeHintsFlags |= PSize;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be program or user", (char *) NULL);
- return TCL_ERROR;
- }
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 's') && (strncmp(argv[1], "state", length) == 0)
- && (length >= 2)) {
- if ((argc < 3) || (argc > 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " state window ?state?\"", (char *) NULL);
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ winPtr->pathName, ": it is an embedded window",
+ (char *) NULL);
return TCL_ERROR;
}
- if (argc == 4) {
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't change state of ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
- (char *) NULL);
- return TCL_ERROR;
- }
- if (winPtr->flags & TK_EMBEDDED) {
- Tcl_AppendResult(interp, "can't change state of ",
- winPtr->pathName, ": it is an embedded window",
- (char *) NULL);
- return TCL_ERROR;
- }
- c = argv[3][0];
- length = strlen(argv[3]);
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
- if ((c == 'n') && (strncmp(argv[3], "normal", length) == 0)) {
- TkpWmSetState(winPtr, NormalState);
- /*
- * This varies from 'wm deiconify' because it does not
- * force the window to be raised and receive focus
- */
- } else if ((c == 'i')
- && (strncmp(argv[3], "iconic", length) == 0)) {
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
- Tcl_AppendResult(interp, "can't iconify \"",
- winPtr->pathName,
- "\": override-redirect flag is set",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (wmPtr->master != NULL) {
- Tcl_AppendResult(interp, "can't iconify \"",
- winPtr->pathName,
- "\": it is a transient", (char *) NULL);
- return TCL_ERROR;
- }
- TkpWmSetState(winPtr, IconicState);
- } else if ((c == 'w')
- && (strncmp(argv[3], "withdrawn", length) == 0)) {
- TkpWmSetState(winPtr, WithdrawnState);
- } else if ((c == 'z')
- && (strncmp(argv[3], "zoomed", length) == 0)) {
- TkpWmSetState(winPtr, ZoomState);
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be normal, iconic, withdrawn or zoomed",
+ if (index == OPT_NORMAL) {
+ TkpWmSetState(winPtr, NormalState);
+ /*
+ * This varies from 'wm deiconify' because it does not
+ * force the window to be raised and receive focus
+ */
+ } else if (index == OPT_ICONIC) {
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": override-redirect flag is set",
(char *) NULL);
return TCL_ERROR;
}
- } else {
- if (wmPtr->iconFor != NULL) {
- Tcl_SetResult(interp, "icon", TCL_STATIC);
- } else {
- switch (wmPtr->hints.initial_state) {
- case NormalState:
- Tcl_SetResult(interp, "normal", TCL_STATIC);
- break;
- case IconicState:
- Tcl_SetResult(interp, "iconic", TCL_STATIC);
- break;
- case WithdrawnState:
- Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
- break;
- case ZoomState:
- Tcl_SetResult(interp, "zoomed", TCL_STATIC);
- break;
- }
+ if (wmPtr->master != NULL) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
+ return TCL_ERROR;
}
+ TkpWmSetState(winPtr, IconicState);
+ } else if (index == OPT_WITHDRAWN) {
+ TkpWmSetState(winPtr, WithdrawnState);
+ } else { /* OPT_ZOOMED */
+ TkpWmSetState(winPtr, ZoomState);
}
- } else if ((c == 't') && (strncmp(argv[1], "title", length) == 0)
- && (length >= 2)) {
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " title window ?newTitle?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- Tcl_SetResult(interp,
- ((wmPtr->titleUid != NULL) ? wmPtr->titleUid : winPtr->nameUid),
- TCL_STATIC);
- return TCL_OK;
+ } else {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_SetResult(interp, "icon", TCL_STATIC);
} else {
- wmPtr->titleUid = Tk_GetUid(argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED) && !Tk_IsEmbedded(winPtr)) {
- TkSetWMName(winPtr, wmPtr->titleUid);
+ switch (wmPtr->hints.initial_state) {
+ case NormalState:
+ Tcl_SetResult(interp, "normal", TCL_STATIC);
+ break;
+ case IconicState:
+ Tcl_SetResult(interp, "iconic", TCL_STATIC);
+ break;
+ case WithdrawnState:
+ Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
+ break;
+ case ZoomState:
+ Tcl_SetResult(interp, "zoomed", TCL_STATIC);
+ break;
}
}
- } else if ((c == 't') && (strncmp(argv[1], "transient", length) == 0)
- && (length >= 3)) {
- Tk_Window master;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTitleCmd --
+ *
+ * This procedure is invoked to process the "wm title" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " transient window ?master?\"", (char *) NULL);
- return TCL_ERROR;
+static int
+WmTitleCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp,
+ ((wmPtr->title != NULL) ? wmPtr->title : winPtr->nameUid),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ if (wmPtr->title != NULL) {
+ ckfree((char *) wmPtr->title);
}
- if (argc == 3) {
- if (wmPtr->master != None) {
- Tcl_SetResult(interp, wmPtr->masterWindowName, TCL_STATIC);
- }
- return TCL_OK;
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->title = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->title, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED) && !Tk_IsEmbedded(winPtr)) {
+ TkSetWMName(winPtr, wmPtr->title);
}
- if (argv[3][0] == '\0') {
- wmPtr->master = None;
- if (wmPtr->masterWindowName != NULL) {
- ckfree(wmPtr->masterWindowName);
- }
- wmPtr->masterWindowName = NULL;
- wmPtr->style = documentProc;
- } else {
- master = Tk_NameToWindow(interp, argv[3], tkwin);
- if (master == NULL) {
- return TCL_ERROR;
- }
- Tk_MakeWindowExist(master);
- wmPtr->master = Tk_WindowId(master);
- wmPtr->masterWindowName = ckalloc((unsigned) (strlen(argv[3])+1));
- strcpy(wmPtr->masterWindowName, argv[3]);
- wmPtr->style = plainDBox;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTransientCmd --
+ *
+ * This procedure is invoked to process the "wm transient" 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
+WmTransientCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window master;
+ WmInfo *wmPtr2;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?master?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->master != None) {
+ Tcl_SetResult(interp, wmPtr->masterWindowName, TCL_STATIC);
}
- } else if ((c == 'w') && (strncmp(argv[1], "withdraw", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " withdraw window\"", (char *) NULL);
+ return TCL_OK;
+ }
+ if (Tcl_GetString(objv[3])[0] == '\0') {
+ wmPtr->master = None;
+ if (wmPtr->masterWindowName != NULL) {
+ ckfree(wmPtr->masterWindowName);
+ }
+ wmPtr->masterWindowName = NULL;
+ wmPtr->style = documentProc;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &master) != TCL_OK) {
return TCL_ERROR;
}
+ Tk_MakeWindowExist(master);
+
if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't withdraw ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[2]),
+ "\" a transient: it is an icon for ",
+ Tk_PathName(wmPtr->iconFor),
(char *) NULL);
return TCL_ERROR;
}
- TkpWmSetState(winPtr, WithdrawnState);
- } else {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
- "\": must be aspect, client, command, deiconify, ",
- "focusmodel, frame, geometry, grid, group, iconbitmap, ",
- "iconify, iconmask, iconname, iconposition, ",
- "iconwindow, maxsize, minsize, overrideredirect, ",
- "positionfrom, protocol, resizable, sizefrom, state, title, ",
- "transient, or withdraw",
+
+ wmPtr2 = ((TkWindow *) master)->wmInfoPtr;
+
+ if (wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[3]),
+ "\" a master: it is an icon for ",
+ Tk_PathName(wmPtr2->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->master = Tk_WindowId(master);
+ wmPtr->masterWindowName = ckalloc((unsigned) length+1);
+ strcpy(wmPtr->masterWindowName, argv3);
+ wmPtr->style = plainDBox;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmWithdrawCmd --
+ *
+ * This procedure is invoked to process the "wm withdraw" 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
+WmWithdrawCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't withdraw ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
(char *) NULL);
return TCL_ERROR;
}
+ TkpWmSetState(winPtr, WithdrawnState);
return TCL_OK;
+}
- updateGeom:
+/*
+ * Invoked by those wm subcommands that affect geometry.
+ * Schedules a geometry update.
+ */
+static void
+WmUpdateGeom(wmPtr, winPtr)
+ WmInfo *wmPtr;
+ TkWindow *winPtr;
+{
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
Tk_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
- return TCL_OK;
}
/*
@@ -1754,10 +2844,13 @@ Tk_SetGrid(
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
if ((wmPtr->gridWin != NULL) && (wmPtr->gridWin != tkwin)) {
return;
@@ -1789,7 +2882,7 @@ Tk_SetGrid(
wmPtr->height = -1;
}
- /*
+ /*
* Set the new gridding information, and start the process of passing
* all of this information to the window manager.
*/
@@ -1839,10 +2932,14 @@ Tk_UnsetGrid(
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
+
if (tkwin != wmPtr->gridWin) {
return;
}
@@ -1902,7 +2999,7 @@ TopLevelEventProc(
* Tk_DestroyWindow will try to destroy the window, but of course
* it's already gone.
*/
-
+
handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
(Tk_ErrorProc *) NULL, (ClientData) NULL);
Tk_DestroyWindow((Tk_Window) winPtr);
@@ -2079,12 +3176,12 @@ UpdateGeometryInfo(
TkWindow *contWinPtr;
contWinPtr = TkpGetOtherWindow(winPtr);
-
+
/*
* NOTE: Here we should handle out of process embedding.
*/
- if (contWinPtr != NULL) {
+ if (contWinPtr != NULL) {
/*
* This window is embedded and the container is also in this
* process, so we don't need to do anything special about the
@@ -2395,14 +3492,14 @@ Tk_GetRootCoords(
while (1) {
x += winPtr->changes.x + winPtr->changes.border_width;
y += winPtr->changes.y + winPtr->changes.border_width;
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
if (!(Tk_IsEmbedded(winPtr))) {
x += winPtr->wmInfoPtr->xInParent;
y += winPtr->wmInfoPtr->yInParent;
- break;
+ break;
} else {
TkWindow *otherPtr;
-
+
otherPtr = TkpGetOtherWindow(winPtr);
if (otherPtr != NULL) {
/*
@@ -2410,34 +3507,34 @@ Tk_GetRootCoords(
* Query its coordinates.
*/
winPtr = otherPtr;
-
+
/*
* Remember to offset by the container window here,
* since at the end of this if branch, we will
* pop out to the container's parent...
*/
-
+
x += winPtr->changes.x + winPtr->changes.border_width;
y += winPtr->changes.y + winPtr->changes.border_width;
-
+
} else {
Point theOffset;
-
+
if (gMacEmbedHandler->getOffsetProc != NULL) {
/*
- * We do not require that the changes.x & changes.y for
+ * We do not require that the changes.x & changes.y for
* a non-Tk master window be kept up to date. So we
* first subtract off the possibly bogus values that have
* been added on at the top of this pass through the loop,
* and then call out to the getOffsetProc to give us
* the correct offset.
*/
-
+
x -= winPtr->changes.x + winPtr->changes.border_width;
y -= winPtr->changes.y + winPtr->changes.border_width;
-
+
gMacEmbedHandler->getOffsetProc((Tk_Window) winPtr, &theOffset);
-
+
x += theOffset.h;
y += theOffset.v;
}
@@ -2445,6 +3542,9 @@ Tk_GetRootCoords(
}
}
}
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
+ break; /* Punt */
+ }
winPtr = winPtr->parentPtr;
}
*xPtr = x;
@@ -2494,7 +3594,7 @@ Tk_CoordsToWindow(
/*
* Step 1: find the top-level window that contains the desired point.
*/
-
+
where.h = rootX;
where.v = rootY;
FindWindow(where, &whichWin);
@@ -2521,12 +3621,12 @@ Tk_CoordsToWindow(
x -= winPtr->changes.x;
y -= winPtr->changes.y;
nextPtr = NULL;
-
+
/*
* Container windows cannot have children. So if it is a container,
* look there, otherwise inspect the children.
*/
-
+
if (Tk_IsContainer(winPtr)) {
childPtr = TkpGetOtherWindow(winPtr);
if (childPtr != NULL) {
@@ -2534,7 +3634,7 @@ Tk_CoordsToWindow(
tmpx = x - childPtr->changes.x;
tmpy = y - childPtr->changes.y;
bd = childPtr->changes.border_width;
-
+
if ((tmpx >= -bd) && (tmpy >= -bd)
&& (tmpx < (childPtr->changes.width + bd))
&& (tmpy < (childPtr->changes.height + bd))) {
@@ -2542,17 +3642,17 @@ Tk_CoordsToWindow(
}
}
}
-
+
/*
* NOTE: Here we should handle out of process embedding.
*/
-
+
} else {
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
if (!Tk_IsMapped(childPtr) ||
- (childPtr->flags & TK_TOP_LEVEL)) {
+ (childPtr->flags & TK_TOP_HIERARCHY)) {
continue;
}
tmpx = x - childPtr->changes.x;
@@ -2622,17 +3722,17 @@ Tk_TopCoordsToWindow(
* Container windows cannot have children. So if it is a container,
* look there, otherwise inspect the children.
*/
-
+
if (Tk_IsContainer(winPtr)) {
childPtr = TkpGetOtherWindow(winPtr);
if (childPtr != NULL) {
- if (Tk_IsMapped(childPtr) &&
- (x > childPtr->changes.x &&
+ if (Tk_IsMapped(childPtr) &&
+ (x > childPtr->changes.x &&
x < childPtr->changes.x +
childPtr->changes.width) &&
(y > childPtr->changes.y &&
y < childPtr->changes.y +
- childPtr->changes.height)) {
+ childPtr->changes.height)) {
nextPtr = childPtr;
}
}
@@ -2640,13 +3740,13 @@ Tk_TopCoordsToWindow(
/*
* NOTE: Here we should handle out of process embedding.
*/
-
+
} else {
-
+
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
if (!Tk_IsMapped(childPtr) ||
- (childPtr->flags & TK_TOP_LEVEL)) {
+ (childPtr->flags & TK_TOP_HIERARCHY)) {
continue;
}
if (x < childPtr->changes.x || y < childPtr->changes.y) {
@@ -2779,10 +3879,13 @@ Tk_GetVRootGeometry(
* information for that window.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return; /* Punt */
+ }
/*
* Make sure that the geometry information is up-to-date, then copy
@@ -2924,6 +4027,133 @@ TkWmProtocolEventProc(
/*
*----------------------------------------------------------------------
*
+ * TkWmStackorderToplevelWrapperMap --
+ *
+ * This procedure will create a table that maps the reparent wrapper
+ * X id for a toplevel to the TkWindow structure that is wraps.
+ * Tk keeps track of a mapping from the window X id to the TkWindow
+ * structure but that does us no good here since we only get the X
+ * id of the wrapper window. Only those toplevel windows that are
+ * mapped have a position in the stacking order.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Adds entries to the passed hashtable.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+TkWmStackorderToplevelWrapperMap(winPtr, table)
+ TkWindow *winPtr; /* TkWindow to recurse on */
+ Tcl_HashTable *table; /* Maps mac window to TkWindow */
+{
+ TkWindow *childPtr;
+ Tcl_HashEntry *hPtr;
+ WindowPeek wrapper;
+ int newEntry;
+
+ if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) &&
+ !Tk_IsEmbedded(winPtr)) {
+ wrapper = (WindowPeek) TkMacGetDrawablePort(winPtr->window);
+
+ hPtr = Tcl_CreateHashEntry(table,
+ (char *) wrapper, &newEntry);
+ Tcl_SetHashValue(hPtr, winPtr);
+ }
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ TkWmStackorderToplevelWrapperMap(childPtr, table);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmStackorderToplevel --
+ *
+ * This procedure returns the stack order of toplevel windows.
+ *
+ * Results:
+ * An array of pointers to tk window objects in stacking order
+ * or else NULL if there was an error.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow **
+TkWmStackorderToplevel(parentPtr)
+ TkWindow *parentPtr; /* Parent toplevel window. */
+{
+ WindowPeek frontWindow;
+ TkWindow *childWinPtr, **windows, **window_ptr;
+ Tcl_HashTable table;
+ Tcl_HashEntry *hPtr;
+ Tcl_HashSearch search;
+
+ /*
+ * Map mac windows to a TkWindow of the wrapped toplevel.
+ */
+
+ Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
+ TkWmStackorderToplevelWrapperMap(parentPtr, &table);
+
+ windows = (TkWindow **) ckalloc((table.numEntries+1)
+ * sizeof(TkWindow *));
+
+ /*
+ * Special cases: If zero or one toplevels were mapped
+ * there is no need to enumerate Windows.
+ */
+
+ switch (table.numEntries) {
+ case 0:
+ windows[0] = NULL;
+ goto done;
+ case 1:
+ hPtr = Tcl_FirstHashEntry(&table, &search);
+ windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr);
+ windows[1] = NULL;
+ goto done;
+ }
+
+ if (TkMacHaveAppearance() >= 0x110) {
+ frontWindow = (WindowPeek) FrontNonFloatingWindow();
+ } else {
+ frontWindow = (WindowPeek) FrontWindow();
+ }
+
+ if (frontWindow == NULL) {
+ ckfree((char *) windows);
+ windows = NULL;
+ } else {
+ window_ptr = windows + table.numEntries;
+ *window_ptr-- = NULL;
+ while (frontWindow != NULL) {
+ hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow);
+ if (hPtr != NULL) {
+ childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
+ *window_ptr-- = childWinPtr;
+ }
+ frontWindow = frontWindow->nextWindow;
+ }
+ if (window_ptr != (windows-1))
+ panic("num matched toplevel windows does not equal num children");
+ }
+
+ done:
+ Tcl_DeleteHashTable(&table);
+ return windows;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkWmRestackToplevel --
*
* This procedure restacks a top-level window.
@@ -2952,11 +4182,11 @@ TkWmRestackToplevel(
WindowPeek macWindow, otherMacWindow, frontWindow;
wmPtr = winPtr->wmInfoPtr;
-
+
/*
* Get the mac window. Make sure it exists & is mapped.
*/
-
+
if (winPtr->window == None) {
Tk_MakeWindowExist((Tk_Window) winPtr);
}
@@ -2971,7 +4201,7 @@ TkWmRestackToplevel(
TkWmMapWindow(winPtr);
}
macWindow = (WindowPeek) TkMacGetDrawablePort(winPtr->window);
-
+
/*
* Get the window in which a raise or lower is in relation to.
*/
@@ -2986,16 +4216,16 @@ TkWmRestackToplevel(
} else {
otherMacWindow = NULL;
}
-
+
if (TkMacHaveAppearance() >= 0x110) {
frontWindow = (WindowPeek) FrontNonFloatingWindow();
- } else {
+ } else {
frontWindow = (WindowPeek) FrontWindow();
}
-
+
if (aboveBelow == Above) {
if (macWindow == frontWindow) {
- /*
+ /*
* Do nothing - it's already at the top.
*/
} else if (otherMacWindow == frontWindow || otherMacWindow == NULL) {
@@ -3079,10 +4309,14 @@ TkWmAddToColormapWindows(
return;
}
- if (topPtr->flags & TK_TOP_LEVEL) {
+ if (topPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
if (topPtr->wmInfoPtr->flags & WM_COLORMAPS_EXPLICIT) {
return;
}
@@ -3124,7 +4358,7 @@ TkWmAddToColormapWindows(
/*
* On the Macintosh all of this is just an excercise
- * in compatability as we don't support colormaps. If
+ * in compatability as we don't support colormaps. If
* we did they would be installed here.
*/
}
@@ -3169,7 +4403,7 @@ TkWmRemoveFromColormapWindows(
return;
}
- if (topPtr->flags & TK_TOP_LEVEL) {
+ if (topPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
@@ -3187,6 +4421,10 @@ TkWmRemoveFromColormapWindows(
* it up.
*/
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
count = topPtr->wmInfoPtr->cmapCount;
oldPtr = topPtr->wmInfoPtr->cmapList;
for (i = 0; i < count; i++) {
@@ -3260,13 +4498,13 @@ InitialWindowBounds(
int x, y;
static int defaultX = 5;
static int defaultY = 45;
-
+
if (!(winPtr->wmInfoPtr->sizeHintsFlags & (USPosition | PPosition))) {
- /*
+ /*
* We will override the program & hopefully place the
* window in a "better" location.
*/
-
+
if (((tcl_macQdPtr->screenBits.bounds.right - defaultX) < 30) ||
((tcl_macQdPtr->screenBits.bounds.bottom - defaultY) < 30)) {
defaultX = 5;
@@ -3280,7 +4518,7 @@ InitialWindowBounds(
x = winPtr->wmInfoPtr->x;
y = winPtr->wmInfoPtr->y;
}
-
+
geometry->left = x;
geometry->top = y;
geometry->right = x + winPtr->changes.width;
@@ -3293,7 +4531,7 @@ InitialWindowBounds(
* TkMacResizable --
*
* This function determines if the passed in window is part of
- * a toplevel window that is resizable. If the window is
+ * a toplevel window that is resizable. If the window is
* resizable in the x, y or both directions, true is returned.
*
* Results:
@@ -3317,7 +4555,7 @@ TkMacResizable(
while (winPtr->wmInfoPtr == NULL) {
winPtr = winPtr->parentPtr;
}
-
+
wmPtr = winPtr->wmInfoPtr;
if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
(wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
@@ -3357,7 +4595,7 @@ TkMacGrowToplevel(
GlobalToLocal(&where);
if (where.h > (whichWindow->portRect.right - 16) &&
where.v > (whichWindow->portRect.bottom - 16)) {
-
+
Window window;
TkWindow *winPtr;
WmInfo *wmPtr;
@@ -3368,7 +4606,7 @@ TkMacGrowToplevel(
dispPtr = TkGetDisplayList();
winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
wmPtr = winPtr->wmInfoPtr;
-
+
/* TODO: handle grid size options. */
if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
(wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
@@ -3386,7 +4624,7 @@ TkMacGrowToplevel(
bounds.top = (wmPtr->minHeight < 64) ? 64 : wmPtr->minHeight;
bounds.bottom = (wmPtr->maxHeight < 64) ? 64 : wmPtr->maxHeight;
}
-
+
growResult = GrowWindow(whichWindow, start, &bounds);
if (growResult != 0) {
@@ -3395,7 +4633,7 @@ TkMacGrowToplevel(
SetPort(whichWindow);
InvalRect(&whichWindow->portRect); /* TODO: may not be needed */
TkMacInvalClipRgns(winPtr);
- TkGenWMConfigureEvent((Tk_Window) winPtr, -1, -1,
+ TkGenWMConfigureEvent((Tk_Window) winPtr, -1, -1,
(int) LoWord(growResult), (int) HiWord(growResult),
TK_SIZE_CHANGED);
return true;
@@ -3410,7 +4648,7 @@ TkMacGrowToplevel(
*
* TkSetWMName --
*
- * Set the title for a toplevel window. If the window is embedded,
+ * Set the title for a toplevel window. If the window is embedded,
* do not change the window title.
*
* Results:
@@ -3425,21 +4663,21 @@ TkMacGrowToplevel(
void
TkSetWMName(
TkWindow *winPtr,
- Tk_Uid titleUid)
+ char *title)
{
Str255 pTitle;
GWorldPtr macWin;
int destWrote;
-
+
if (Tk_IsEmbedded(winPtr)) {
return;
}
- Tcl_UtfToExternal(NULL, NULL, titleUid,
- strlen(titleUid), 0, NULL,
+ Tcl_UtfToExternal(NULL, NULL, title,
+ strlen(title), 0, NULL,
(char *) &pTitle[1],
255, NULL, &destWrote, NULL); /* Internalize native */
pTitle[0] = destWrote;
-
+
macWin = TkMacGetDrawablePort(winPtr->window);
SetWTitle((WindowPtr) macWin, pTitle);
@@ -3450,11 +4688,11 @@ TkGenWMDestroyEvent(
Tk_Window tkwin)
{
XEvent event;
-
+
event.xany.serial = Tk_Display(tkwin)->request;
event.xany.send_event = False;
event.xany.display = Tk_Display(tkwin);
-
+
event.xclient.window = Tk_WindowId(tkwin);
event.xclient.type = ClientMessage;
event.xclient.message_type = Tk_InternAtom(tkwin, "WM_PROTOCOLS");
@@ -3468,7 +4706,7 @@ TkGenWMDestroyEvent(
*
* TkGenWMConfigureEvent --
*
- * Generate a ConfigureNotify event for Tk. Depending on the
+ * Generate a ConfigureNotify event for Tk. Depending on the
* value of flag the values of width/height, x/y, or both may
* be changed.
*
@@ -3493,11 +4731,11 @@ TkGenWMConfigureEvent(
XEvent event;
WmInfo *wmPtr;
TkWindow *winPtr = (TkWindow *) tkwin;
-
+
if (tkwin == NULL) {
return;
}
-
+
event.type = ConfigureNotify;
event.xconfigure.serial = Tk_Display(tkwin)->request;
event.xconfigure.send_event = False;
@@ -3530,9 +4768,9 @@ TkGenWMConfigureEvent(
width = Tk_Width(tkwin);
height = Tk_Height(tkwin);
}
-
+
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
-
+
/*
* Update window manager information.
*/
@@ -3543,7 +4781,7 @@ TkGenWMConfigureEvent(
wmPtr->y = y;
wmPtr->flags &= ~(WM_NEGATIVE_X | WM_NEGATIVE_Y);
}
- if ((flags & TK_SIZE_CHANGED) &&
+ if ((flags & TK_SIZE_CHANGED) &&
((width != Tk_Width(tkwin)) || (height != Tk_Height(tkwin)))) {
if ((wmPtr->width == -1) && (width == winPtr->reqWidth)) {
/*
@@ -3581,7 +4819,7 @@ TkGenWMConfigureEvent(
wmPtr->configHeight = height;
}
}
-
+
/*
* Now set up the changes structure. Under X we wait for the
* ConfigureNotify to set these values. On the Mac we know imediatly that
@@ -3694,8 +4932,8 @@ TkMacZoomToplevel(
}
/*
- * We should now zoom the window (as long as it's one of ours). We
- * also need to generate an event to let Tk know that the window size
+ * We should now zoom the window (as long as it's one of ours). We
+ * also need to generate an event to let Tk know that the window size
* has changed.
*/
window = TkMacGetXWindow(whichWindow);
@@ -3723,7 +4961,7 @@ TkMacZoomToplevel(
zoomPart = inZoomIn;
}
}
-
+
ZoomWindow(whichWindow, zoomPart, false);
InvalRect(&whichWindow->portRect);
TkMacInvalClipRgns((TkWindow *) tkwin);
@@ -3732,7 +4970,7 @@ TkMacZoomToplevel(
TkMacWindowOffset(whichWindow, &xOffset, &yOffset);
location.h -= xOffset;
location.v -= yOffset;
- TkGenWMConfigureEvent(tkwin, location.h, location.v,
+ TkGenWMConfigureEvent(tkwin, location.h, location.v,
whichWindow->portRect.right - whichWindow->portRect.left,
whichWindow->portRect.bottom - whichWindow->portRect.top,
TK_BOTH_CHANGED);
@@ -3744,9 +4982,9 @@ TkMacZoomToplevel(
*
* TkUnsupported1Cmd --
*
- * This procedure is invoked to process the "unsupported1" Tcl
- * command. This command allows you to set the style of decoration
- * for a Macintosh window.
+ * This procedure is invoked to process the
+ * "::tk::unsupported::MacWindowStyle" Tcl command. This command
+ * allows you to set the style of decoration for a Macintosh window.
*
* Results:
* A standard Tcl result.
@@ -3764,7 +5002,7 @@ TkUnsupported1Cmd(
* interpreter. */
Tcl_Interp *interp, /* Current interpreter. */
int argc, /* Number of arguments. */
- char **argv) /* Argument strings. */
+ CONST char **argv) /* Argument strings. */
{
Tk_Window tkwin = (Tk_Window) clientData;
TkWindow *winPtr;
@@ -3783,7 +5021,7 @@ TkUnsupported1Cmd(
if (winPtr == NULL) {
return TCL_ERROR;
}
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!Tk_IsTopLevel(winPtr)) {
Tcl_AppendResult(interp, "window \"", winPtr->pathName,
"\" isn't a top-level window", (char *) NULL);
return TCL_ERROR;
@@ -3808,10 +5046,10 @@ TkUnsupported1Cmd(
return TCL_ERROR;
}
}
-
+
if (argc == 3) {
int appearanceSpec = 0;
-
+
switch (wmPtr->style) {
case -1:
appearanceSpec = 1;
@@ -3856,11 +5094,11 @@ TkUnsupported1Cmd(
Tcl_SetResult(interp, "floatSideZoomProc", TCL_STATIC);
break;
default:
- panic("invalid style");
+ panic("invalid style");
}
if (appearanceSpec) {
Tcl_Obj *attributeList, *newResult;
-
+
switch (wmPtr->macClass) {
case kAlertWindowClass:
newResult = Tcl_NewStringObj("alert", -1);
@@ -3886,99 +5124,99 @@ TkUnsupported1Cmd(
attributeList = Tcl_NewListObj(0, NULL);
if (wmPtr->attributes == kWindowNoAttributes) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("none", -1));
} else if (wmPtr->attributes == kWindowStandardDocumentAttributes) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("standardDocument", -1));
} else if (wmPtr->attributes == kWindowStandardFloatingAttributes) {
- Tcl_ListObjAppendElement(interp, attributeList,
- Tcl_NewStringObj("standardFloating", -1));
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("standardFloating", -1));
} else {
if (wmPtr->attributes & kWindowCloseBoxAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("closeBox", -1));
}
if (wmPtr->attributes & kWindowHorizontalZoomAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("horizontalZoom", -1));
}
if (wmPtr->attributes & kWindowVerticalZoomAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("verticalZoom", -1));
}
if (wmPtr->attributes & kWindowCollapseBoxAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("collapseBox", -1));
}
if (wmPtr->attributes & kWindowResizableAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("resizable", -1));
}
if (wmPtr->attributes & kWindowSideTitlebarAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("sideTitlebar", -1));
}
if (wmPtr->attributes & kWindowNoUpdatesAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("noUpdates", -1));
}
if (wmPtr->attributes & kWindowNoActivatesAttribute) {
- Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_ListObjAppendElement(interp, attributeList,
Tcl_NewStringObj("noActivates", -1));
}
}
Tcl_ListObjAppendElement(interp, newResult, attributeList);
- Tcl_SetObjResult(interp, newResult);
+ Tcl_SetObjResult(interp, newResult);
}
return TCL_OK;
} else if (argc == 4) {
- if (strcmp(argv[3], "documentProc") == 0) {
- wmPtr->style = documentProc;
- } else if (strcmp(argv[3], "noGrowDocProc") == 0) {
- wmPtr->style = documentProc;
- } else if (strcmp(argv[3], "dBoxProc") == 0) {
- wmPtr->style = dBoxProc;
- } else if (strcmp(argv[3], "plainDBox") == 0) {
- wmPtr->style = plainDBox;
- } else if (strcmp(argv[3], "altDBoxProc") == 0) {
- wmPtr->style = altDBoxProc;
- } else if (strcmp(argv[3], "movableDBoxProc") == 0) {
- wmPtr->style = movableDBoxProc;
- } else if (strcmp(argv[3], "zoomDocProc") == 0) {
- wmPtr->style = zoomDocProc;
- } else if (strcmp(argv[3], "zoomNoGrow") == 0) {
- wmPtr->style = zoomNoGrow;
- } else if (strcmp(argv[3], "rDocProc") == 0) {
- wmPtr->style = rDocProc;
- } else if (strcmp(argv[3], "floatProc") == 0) {
- wmPtr->style = floatGrowProc;
- } else if (strcmp(argv[3], "floatGrowProc") == 0) {
- wmPtr->style = floatGrowProc;
- } else if (strcmp(argv[3], "floatZoomProc") == 0) {
- wmPtr->style = floatZoomGrowProc;
- } else if (strcmp(argv[3], "floatZoomGrowProc") == 0) {
- wmPtr->style = floatZoomGrowProc;
- } else if (strcmp(argv[3], "floatSideProc") == 0) {
- wmPtr->style = floatSideGrowProc;
- } else if (strcmp(argv[3], "floatSideGrowProc") == 0) {
- wmPtr->style = floatSideGrowProc;
- } else if (strcmp(argv[3], "floatSideZoomProc") == 0) {
- wmPtr->style = floatSideZoomGrowProc;
- } else if (strcmp(argv[3], "floatSideZoomGrowProc") == 0) {
- wmPtr->style = floatSideZoomGrowProc;
- } else {
- Tcl_AppendResult(interp, "bad style: should be documentProc, ",
- "dBoxProc, plainDBox, altDBoxProc, movableDBoxProc, ",
- "zoomDocProc, rDocProc, floatProc, floatZoomProc, ",
- "floatSideProc, or floatSideZoomProc",
- (char *) NULL);
- return TCL_ERROR;
- }
+ if (strcmp(argv[3], "documentProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "noGrowDocProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "dBoxProc") == 0) {
+ wmPtr->style = dBoxProc;
+ } else if (strcmp(argv[3], "plainDBox") == 0) {
+ wmPtr->style = plainDBox;
+ } else if (strcmp(argv[3], "altDBoxProc") == 0) {
+ wmPtr->style = altDBoxProc;
+ } else if (strcmp(argv[3], "movableDBoxProc") == 0) {
+ wmPtr->style = movableDBoxProc;
+ } else if (strcmp(argv[3], "zoomDocProc") == 0) {
+ wmPtr->style = zoomDocProc;
+ } else if (strcmp(argv[3], "zoomNoGrow") == 0) {
+ wmPtr->style = zoomNoGrow;
+ } else if (strcmp(argv[3], "rDocProc") == 0) {
+ wmPtr->style = rDocProc;
+ } else if (strcmp(argv[3], "floatProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatGrowProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatZoomProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatZoomGrowProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideGrowProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomGrowProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else {
+ Tcl_AppendResult(interp, "bad style: should be documentProc, ",
+ "dBoxProc, plainDBox, altDBoxProc, movableDBoxProc, ",
+ "zoomDocProc, rDocProc, floatProc, floatZoomProc, ",
+ "floatSideProc, or floatSideZoomProc",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
} else if (argc == 5) {
int oldClass = wmPtr->macClass;
int oldAttributes = wmPtr->attributes;
-
+
if (strcmp(argv[3], "alert") == 0) {
wmPtr->macClass = kAlertWindowClass;
} else if (strcmp(argv[3], "moveableAlert") == 0) {
@@ -3999,7 +5237,7 @@ TkUnsupported1Cmd(
(char *) NULL);
return TCL_ERROR;
}
-
+
if (strcmp(argv[4], "none") == 0) {
wmPtr->attributes = kWindowNoAttributes;
} else if (strcmp(argv[4], "standardDocument") == 0) {
@@ -4009,39 +5247,39 @@ TkUnsupported1Cmd(
} else {
int foundOne = 0;
int attrArgc, i;
- char **attrArgv = NULL;
-
+ CONST char **attrArgv = NULL;
+
if (Tcl_SplitList(interp, argv[4], &attrArgc, &attrArgv) != TCL_OK) {
wmPtr->macClass = oldClass;
Tcl_AppendResult(interp, "Ill-formed attributes list: \"",
- argv[4], "\".", (char *) NULL);
+ argv[4], "\".", (char *) NULL);
return TCL_ERROR;
}
-
+
wmPtr->attributes = kWindowNoAttributes;
-
+
for (i = 0; i < attrArgc; i++) {
- if ((*attrArgv[i] == 'c')
+ if ((*attrArgv[i] == 'c')
&& (strcmp(attrArgv[i], "closeBox") == 0)) {
wmPtr->attributes |= kWindowCloseBoxAttribute;
foundOne = 1;
- } else if ((*attrArgv[i] == 'h')
+ } else if ((*attrArgv[i] == 'h')
&& (strcmp(attrArgv[i], "horizontalZoom") == 0)) {
wmPtr->attributes |= kWindowHorizontalZoomAttribute;
foundOne = 1;
- } else if ((*attrArgv[i] == 'v')
+ } else if ((*attrArgv[i] == 'v')
&& (strcmp(attrArgv[i], "verticalZoom") == 0)) {
wmPtr->attributes |= kWindowVerticalZoomAttribute;
foundOne = 1;
- } else if ((*attrArgv[i] == 'c')
+ } else if ((*attrArgv[i] == 'c')
&& (strcmp(attrArgv[i], "collapseBox") == 0)) {
wmPtr->attributes |= kWindowCollapseBoxAttribute;
foundOne = 1;
- } else if ((*attrArgv[i] == 'r')
+ } else if ((*attrArgv[i] == 'r')
&& (strcmp(attrArgv[i], "resizable") == 0)) {
wmPtr->attributes |= kWindowResizableAttribute;
foundOne = 1;
- } else if ((*attrArgv[i] == 's')
+ } else if ((*attrArgv[i] == 's')
&& (strcmp(attrArgv[i], "sideTitlebar") == 0)) {
wmPtr->attributes |= kWindowSideTitlebarAttribute;
foundOne = 1;
@@ -4050,16 +5288,16 @@ TkUnsupported1Cmd(
break;
}
}
-
+
if (attrArgv != NULL) {
ckfree ((char *) attrArgv);
}
-
+
if (foundOne != 1) {
wmPtr->macClass = oldClass;
wmPtr->attributes = oldAttributes;
-
- Tcl_AppendResult(interp, "bad attribute: \"", argv[4],
+
+ Tcl_AppendResult(interp, "bad attribute: \"", argv[4],
"\", should be standardDocument, ",
"standardFloating, or some combination of ",
"closeBox, horizontalZoom, verticalZoom, ",
@@ -4068,7 +5306,7 @@ TkUnsupported1Cmd(
return TCL_ERROR;
}
}
-
+
wmPtr->style = -1;
}
} else {
@@ -4077,7 +5315,7 @@ TkUnsupported1Cmd(
(char *) NULL);
return TCL_ERROR;
}
-
+
return TCL_OK;
}
@@ -4086,7 +5324,7 @@ TkUnsupported1Cmd(
*
* TkpMakeMenuWindow --
*
- * Configure the window to be either a undecorated pull-down
+ * Configure the window to be either a undecorated pull-down
* (or pop-up) menu, or as a toplevel floating menu (palette).
*
* Results:
@@ -4103,7 +5341,7 @@ TkpMakeMenuWindow(
Tk_Window tkwin, /* New window. */
int transient) /* 1 means menu is only posted briefly as
* a popup or pulldown or cascade. 0 means
- * menu is always visible, e.g. as a
+ * menu is always visible, e.g. as a
* floating menu. */
{
if (transient) {
@@ -4121,7 +5359,7 @@ TkpMakeMenuWindow(
* TkMacMakeRealWindowExist --
*
* This function finally creates the real Macintosh window that
- * the Mac actually understands.
+ * the Mac actually understands.
*
* Results:
* None.
@@ -4132,7 +5370,7 @@ TkpMakeMenuWindow(
*----------------------------------------------------------------------
*/
-void
+void
TkMacMakeRealWindowExist(
TkWindow *winPtr) /* Tk window. */
{
@@ -4147,14 +5385,14 @@ TkMacMakeRealWindowExist(
if (TkMacHostToplevelExists(winPtr)) {
return;
}
-
+
macWin = (MacDrawable *) winPtr->window;
/*
* If this is embedded, make sure its container's toplevel exists,
- * then return...
+ * then return...
*/
-
+
if (Tk_IsEmbedded(winPtr)) {
TkWindow *contWinPtr;
@@ -4177,13 +5415,13 @@ TkMacMakeRealWindowExist(
/*
* NOTE: Here we should handle out of process embedding.
*/
-
+
}
-
+
InitialWindowBounds(winPtr, &geometry);
-
+
if (TkMacHaveAppearance() >= 0x110 && wmPtr->style == -1) {
- OSStatus err;
+ OSStatus err;
/*
* There seems to be a bug in CreateNewWindow: If I set the
* window geometry to be the too small for the structure region,
@@ -4191,37 +5429,37 @@ TkMacMakeRealWindowExist(
* Adding this here makes the positioning work, and the size will
* get overwritten when you actually map the contents of the window.
*/
-
+
geometry.right += 64;
geometry.bottom += 24;
- err = CreateNewWindow(wmPtr->macClass, wmPtr->attributes,
+ err = CreateNewWindow(wmPtr->macClass, wmPtr->attributes,
&geometry, &newWindow);
if (err != noErr) {
newWindow = NULL;
}
-
+
} else {
- newWindow = NewCWindow(NULL, &geometry, "\ptemp", false,
+ newWindow = NewCWindow(NULL, &geometry, "\ptemp", false,
(short) wmPtr->style, (WindowRef) -1, true, 0);
}
-
+
if (newWindow == NULL) {
panic("couldn't allocate new Mac window");
}
-
+
/*
* Add this window to the list of toplevel windows.
*/
-
+
listPtr = (TkMacWindowList *) ckalloc(sizeof(TkMacWindowList));
listPtr->nextPtr = tkMacWindowListPtr;
listPtr->winPtr = winPtr;
tkMacWindowListPtr = listPtr;
-
+
macWin->portPtr = (GWorldPtr) newWindow;
tkMacMoveWindow(newWindow, (int) geometry.left, (int) geometry.top);
SetPort((GrafPtr) newWindow);
-
+
if (!windowHashInit) {
Tcl_InitHashTable(&windowTable, TCL_ONE_WORD_KEYS);
windowHashInit = true;
@@ -4232,7 +5470,7 @@ TkMacMakeRealWindowExist(
panic("same macintosh window allocated twice!");
}
Tcl_SetHashValue(valueHashPtr, macWin);
-
+
macWin->flags |= TK_HOST_EXISTS;
}
@@ -4242,7 +5480,7 @@ TkMacMakeRealWindowExist(
* TkMacRegisterOffScreenWindow --
*
* This function adds the passed in Off Screen Port to the
- * hash table that maps Mac windows to root X windows.
+ * hash table that maps Mac windows to root X windows.
*
* Results:
* None.
@@ -4253,7 +5491,7 @@ TkMacMakeRealWindowExist(
*----------------------------------------------------------------------
*/
-void
+void
TkMacRegisterOffScreenWindow(
Window window, /* Window structure. */
GWorldPtr portPtr) /* Pointer to a Mac GWorld. */
@@ -4281,9 +5519,9 @@ TkMacRegisterOffScreenWindow(
*
* TkMacUnregisterMacWindow --
*
- * Given a macintosh port window, this function removes the
+ * Given a macintosh port window, this function removes the
* association between this window and the root X window that
- * Tk cares about.
+ * Tk cares about.
*
* Results:
* None.
@@ -4294,7 +5532,7 @@ TkMacRegisterOffScreenWindow(
*----------------------------------------------------------------------
*/
-void
+void
TkMacUnregisterMacWindow(
GWorldPtr portPtr) /* Pointer to a Mac GWorld. */
{
@@ -4311,7 +5549,7 @@ TkMacUnregisterMacWindow(
* TkMacSetScrollbarGrow --
*
* Sets a flag for a toplevel window indicating that the passed
- * Tk scrollbar window will display the grow region for the
+ * Tk scrollbar window will display the grow region for the
* toplevel window.
*
* Results:
@@ -4323,7 +5561,7 @@ TkMacUnregisterMacWindow(
*----------------------------------------------------------------------
*/
-void
+void
TkMacSetScrollbarGrow(
TkWindow *winPtr, /* Tk scrollbar window. */
int flag) /* Boolean value true or false. */
@@ -4355,12 +5593,12 @@ TkMacSetScrollbarGrow(
*----------------------------------------------------------------------
*/
-TkWindow *
+TkWindow *
TkMacGetScrollbarGrowWindow(
TkWindow *winPtr) /* Tk window. */
{
TkWindow *scrollWinPtr;
-
+
if (winPtr == NULL) {
return NULL;
}
@@ -4405,7 +5643,7 @@ TkWmFocusToplevel(
TkWindow *winPtr) /* Window that received a focus-related
* event. */
{
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!(winPtr->flags & TK_TOP_HIERARCHY)) {
return NULL;
}
return winPtr;
@@ -4466,7 +5704,7 @@ TkpWmSetState(winPtr, state)
{
WmInfo *wmPtr = winPtr->wmInfoPtr;
GWorldPtr macWin;
-
+
wmPtr->hints.initial_state = state;
if (wmPtr->flags & WM_NEVER_MAPPED) {
return;
@@ -4528,13 +5766,18 @@ TkMacHaveAppearance()
static int TkMacHaveAppearance = 0;
long response = 0;
OSErr err = noErr;
-
+
if (!initialized) {
err = Gestalt(gestaltAppearanceAttr, &response);
if (err == noErr) {
TkMacHaveAppearance = 1;
}
+/* even if AppearanceManager 1.1 routines are present,
+we can't call them from 68K code, so we pretend
+to be running Apperarance Mgr 1.0 */
+#if !(GENERATING68K && !GENERATINGCFM)
err = Gestalt(gestaltAppearanceVersion, &response);
+#endif
if (err == noErr) {
TkMacHaveAppearance = (int) response;
}
@@ -4542,5 +5785,3 @@ TkMacHaveAppearance()
return TkMacHaveAppearance;
}
-
-
diff --git a/tk/mac/tkMacXCursors.r b/tk/mac/tkMacXCursors.r
index 1476be2cd3e..18176d1ada3 100644
--- a/tk/mac/tkMacXCursors.r
+++ b/tk/mac/tkMacXCursors.r
@@ -959,4 +959,3 @@ data 'crsr' (3075, "watch", purgeable) {
$"0000"
};
-
diff --git a/tk/mac/tkMacXStubs.c b/tk/mac/tkMacXStubs.c
index 25b7662c480..53ee5a91fbd 100644
--- a/tk/mac/tkMacXStubs.c
+++ b/tk/mac/tkMacXStubs.c
@@ -90,7 +90,7 @@ int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image));
TkDisplay *
TkpOpenDisplay(
- char *display_name)
+ CONST char *display_name)
{
Display *display;
Screen *screen;
@@ -106,6 +106,7 @@ TkpOpenDisplay(
graphicsDevice = GetMainDevice();
display = (Display *) ckalloc(sizeof(Display));
+ memset(display, 0, sizeof(Display));
display->resource_alloc = MacXIdAlloc;
screen = (Screen *) ckalloc(sizeof(Screen) * 2);
display->default_screen = 0;
@@ -138,6 +139,7 @@ TkpOpenDisplay(
screen->root_visual->map_entries = 2 ^ 8;
gMacDisplay = (TkDisplay *) ckalloc(sizeof(TkDisplay));
+ memset(gMacDisplay, 0, sizeof(TkDisplay));
gMacDisplay->display = display;
return gMacDisplay;
}
@@ -182,7 +184,6 @@ TkpCloseDisplay(
ckfree((char *) display->screens);
}
ckfree((char *) display);
- ckfree((char *) displayPtr);
}
/*
@@ -793,14 +794,35 @@ XCreateIC(
*----------------------------------------------------------------------
*/
-char *
+CONST char *
TkGetDefaultScreenName(
Tcl_Interp *interp, /* Not used. */
- char *screenName) /* If NULL, use default string. */
+ CONST char *screenName) /* If NULL, use default string. */
{
if ((screenName == NULL) || (screenName[0] == '\0')) {
screenName = macScreenName;
}
return screenName;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_SetCaretPos --
+ *
+ * This indicates the cursor position to Tk.
+ * This is currently a noop stub for MacX.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height)
+{
+ TkCaret *caretPtr = &(((TkWindow *) tkwin)->dispPtr->caret);
+ caretPtr->winPtr = ((TkWindow *) tkwin);
+ caretPtr->x = x;
+ caretPtr->y = y;
+ caretPtr->height = height;
+}
diff --git a/tk/mac/widget.r b/tk/mac/widget.r
new file mode 100644
index 00000000000..d28cadcfba3
--- /dev/null
+++ b/tk/mac/widget.r
@@ -0,0 +1,18 @@
+/*
+ * widget.r --
+ *
+ */
+
+type 'TEXT'
+{
+ string;
+};
+
+#define TK_LIBRARY_RESOURCES 3000
+
+resource 'TEXT' (TK_LIBRARY_RESOURCES+114, "tclshrc", purgeable)
+{
+"# read widgets demo script\n"
+"console hide\n"
+"source [file join $tk_library demos widget]\n"
+}; \ No newline at end of file
diff --git a/tk/macosx/Makefile b/tk/macosx/Makefile
new file mode 100644
index 00000000000..8bd8befc713
--- /dev/null
+++ b/tk/macosx/Makefile
@@ -0,0 +1,86 @@
+################################################################################
+#
+# Simple makefile for building on Mac OS X with the
+# Project Builder command line tool 'pbxbuild'
+#
+# RCS: @(#) $Id$
+#
+################################################################################
+
+INSTALL_ROOT =
+
+BUILD_DIR = ../../build
+
+TARGET = Wish
+
+DEVBUILDSTYLE = Development
+DEPBUILDSTYLE = Deployment
+
+PBXBUILD = /usr/bin/pbxbuild
+
+BUILD = ${PBXBUILD} SYMROOT="${BUILD_DIR}" -target "${TARGET}"
+
+DEVBUILD = ${BUILD} -buildstyle "${DEVBUILDSTYLE}"
+DEPBUILD = ${BUILD} -buildstyle "${DEPBUILDSTYLE}"
+
+INSTALLOPTS = INSTALL_ROOT="${INSTALL_ROOT}"
+
+EMBEDDEDOPTS = DYLIB_INSTALL_PATH="@executable_path/../Frameworks"
+
+################################################################################
+
+all: develop deploy
+
+install: install-develop install-deploy
+
+embedded: embedded-develop embedded-deploy
+
+install-embedded: install-embedded-develop install-embedded-deploy cleanup-embedded
+
+clean: clean-develop clean-deploy
+
+################################################################################
+
+develop:
+ ${DEVBUILD}
+
+deploy:
+ ${DEPBUILD}
+
+install-develop:
+ ${DEVBUILD} install ${INSTALLOPTS}
+
+install-deploy:
+ ${DEPBUILD} install ${INSTALLOPTS}
+
+embedded-develop:
+ ${DEVBUILD} ${EMBEDDEDOPTS}
+
+embedded-deploy:
+ ${DEPBUILD} ${EMBEDDEDOPTS}
+
+install-embedded-develop:
+ ${DEVBUILD} install ${INSTALLOPTS} ${EMBEDDEDOPTS}
+
+install-embedded-deploy:
+ ${DEPBUILD} install ${INSTALLOPTS} ${EMBEDDEDOPTS}
+
+clean-develop:
+ ${DEVBUILD} clean
+
+clean-deploy:
+ ${DEPBUILD} clean
+
+################################################################################
+
+cleanup-embedded:
+ @( \
+ cd ${INSTALL_ROOT}; \
+ rm -f Frameworks; \
+ rm -rf @executable_path; \
+ rm -rf Library/Frameworks/Tcl.framework; \
+ rm -rf Library/Frameworks/Tk.framework; \
+ if [ -d Library/Frameworks ]; then rmdir -p Library/Frameworks; fi; \
+ )
+
+################################################################################
diff --git a/tk/macosx/Wish.icns b/tk/macosx/Wish.icns
new file mode 100644
index 00000000000..060bfbd4502
--- /dev/null
+++ b/tk/macosx/Wish.icns
Binary files differ
diff --git a/tk/macosx/Wish.pbproj/jingham.pbxuser b/tk/macosx/Wish.pbproj/jingham.pbxuser
new file mode 100644
index 00000000000..72932e79a82
--- /dev/null
+++ b/tk/macosx/Wish.pbproj/jingham.pbxuser
@@ -0,0 +1,1502 @@
+// !$*UTF8*$!
+{
+ 005751A902FB00920AC916F0 = {
+ fRef = F5375568016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXXStubs.c: TkpCloseDisplay";
+ rLen = 0;
+ rLoc = 5311;
+ rType = 0;
+ vrLen = 417;
+ vrLoc = 4894;
+ };
+ F50D961501961F0201DC9062 = {
+ fileReference = F5375551016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 902;
+ state = 2;
+ };
+ F537552A016C352C01DC9062 = {
+ activeBuildStyle = F537552C016C352C01DC9062;
+ activeExecutable = F53756AB016C4DD401DC9062;
+ activeTarget = F53756A0016C4DD401DC9062;
+ addToTargets = (
+ F53755DF016C38D201DC9062,
+ );
+ breakpoints = (
+ F5B2CDC10175829501DC9062,
+ F571FE470179562E01DC9062,
+ F571FE4A0179695001DC9062,
+ F571FE4C01796B1101DC9062,
+ F571FE4D01796CAF01DC9062,
+ F571FE4E01796F9201DC9062,
+ F571FE4F0179702301DC9062,
+ F571FE500179702301DC9062,
+ F583DC0E018D092D01DC9062,
+ F583DC0F018D0CB501DC9062,
+ F583DC13018D2B4A01DC9062,
+ F58907BE018DCE8F01DC9062,
+ F58907C5018DD1C301DC9062,
+ F50D961501961F0201DC9062,
+ F566083B0197283B01DC9062,
+ F566083C0197823801DC9062,
+ F5A5146F01D05DC201DC9062,
+ F5A5147001D0758C01DC9062,
+ F5A852D6020F6C6C01DC9062,
+ F5A439C0029B609C01DC9064,
+ F5A439C2029B60ED01DC9064,
+ F5A439CA029B620901DC9064,
+ F55BC4B602B2DFB901DC9062,
+ F5978FD602B3190701DC9062,
+ );
+ executables = (
+ F53756AB016C4DD401DC9062,
+ );
+ perUserDictionary = {
+ PBXPerProjectTemplateStateSaveDate = 49921092;
+ "PBXTemplateGeometry-F5314676015831810DCA290F" = {
+ ContentSize = "{716, 618}";
+ LeftSlideOut = {
+ Collapsed = NO;
+ Frame = "{{0, 23}, {716, 595}}";
+ Split0 = {
+ ActiveTab = 2;
+ Collapsed = NO;
+ Frame = "{{0, 0}, {716, 595}}";
+ Split0 = {
+ Frame = "{{0, 249}, {716, 346}}";
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Debugger = {
+ Collapsed = NO;
+ Frame = "{{0, 0}, {952, 321}}";
+ Split0 = {
+ Frame = "{{0, 24}, {952, 297}}";
+ Split0 = {
+ Frame = "{{0, 0}, {468, 297}}";
+ };
+ Split1 = {
+ DebugVariablesTableConfiguration = (
+ Name,
+ 126.803,
+ Value,
+ 150.074,
+ Summary,
+ 172.123,
+ );
+ Frame = "{{477, 0}, {475, 297}}";
+ };
+ SplitCount = 2;
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Frame = "{{0, 0}, {100, 50}}";
+ };
+ Tab1 = {
+ Frame = "{{0, 0}, {100, 50}}";
+ };
+ TabCount = 2;
+ TabsVisible = YES;
+ };
+ Frame = "{{0, 0}, {952, 321}}";
+ LauncherConfigVersion = 7;
+ };
+ Tab1 = {
+ Frame = "{{0, 0}, {781, 452}}";
+ LauncherConfigVersion = 3;
+ Runner = {
+ Frame = "{{0, 0}, {781, 452}}";
+ };
+ };
+ Tab2 = {
+ BuildMessageFrame = "{{0, 0}, {718, 0}}";
+ BuildTranscriptFrame = "{{0, 9}, {718, 236}}";
+ Frame = "{{0, 0}, {716, 243}}";
+ };
+ Tab3 = {
+ Frame = "{{0, 0}, {612, 295}}";
+ };
+ TabCount = 4;
+ TabsVisible = NO;
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Frame = "{{0, 0}, {300, 533}}";
+ GroupTreeTableConfiguration = (
+ SCMStatusColumn,
+ 22,
+ TargetStatusColumn,
+ 18,
+ MainColumn,
+ 245,
+ );
+ };
+ Tab1 = {
+ ClassesFrame = "{{0, 0}, {280, 398}}";
+ ClassesTreeTableConfiguration = (
+ PBXBookColumnIdentifier,
+ 20,
+ PBXClassColumnIdentifier,
+ 237,
+ );
+ Frame = "{{0, 0}, {278, 659}}";
+ MembersFrame = "{{0, 407}, {280, 252}}";
+ MembersTreeTableConfiguration = (
+ PBXBookColumnIdentifier,
+ 20,
+ PBXMethodColumnIdentifier,
+ 236,
+ );
+ };
+ Tab2 = {
+ Frame = "{{0, 0}, {200, 100}}";
+ };
+ Tab3 = {
+ Frame = "{{0, 0}, {200, 100}}";
+ TargetTableConfiguration = (
+ ActiveObject,
+ 16,
+ ObjectNames,
+ 202.296,
+ );
+ };
+ Tab4 = {
+ BreakpointsTreeTableConfiguration = (
+ breakpointColumn,
+ 197,
+ enabledColumn,
+ 31,
+ );
+ Frame = "{{0, 0}, {250, 100}}";
+ };
+ TabCount = 5;
+ TabsVisible = NO;
+ };
+ StatusViewVisible = YES;
+ Template = F5314676015831810DCA290F;
+ ToolbarVisible = YES;
+ WindowLocation = "{49, 213}";
+ };
+ "PBXTemplateGeometry-F5CA7ECB015C094F0DCA290F" = {
+ ContentSize = "{690, 721}";
+ LeftSlideOut = {
+ Collapsed = NO;
+ Frame = "{{0, 0}, {690, 721}}";
+ Split0 = {
+ Collapsed = NO;
+ Frame = "{{0, 0}, {690, 721}}";
+ Split0 = {
+ Frame = "{{0, 0}, {690, 721}}";
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Debugger = {
+ Collapsed = NO;
+ Frame = "{{0, 0}, {484, 208}}";
+ Split0 = {
+ Frame = "{{0, 24}, {484, 184}}";
+ Split0 = {
+ Frame = "{{0, 0}, {236, 184}}";
+ };
+ Split1 = {
+ DebugVariablesTableConfiguration = (
+ Name,
+ 123,
+ Value,
+ 85,
+ Summary,
+ 62.123,
+ );
+ Frame = "{{245, 0}, {239, 184}}";
+ };
+ SplitCount = 2;
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Frame = "{{0, 0}, {100, 50}}";
+ };
+ Tab1 = {
+ Frame = "{{0, 0}, {100, 50}}";
+ };
+ TabCount = 2;
+ TabsVisible = YES;
+ };
+ Frame = "{{0, 0}, {484, 208}}";
+ LauncherConfigVersion = 7;
+ };
+ Tab1 = {
+ Frame = "{{0, 0}, {664, 208}}";
+ LauncherConfigVersion = 3;
+ Runner = {
+ Frame = "{{0, 0}, {664, 208}}";
+ };
+ };
+ Tab2 = {
+ BuildMessageFrame = "{{0, 0}, {666, 43}}";
+ BuildTranscriptFrame = "{{0, 52}, {666, 0}}";
+ Frame = "{{0, 0}, {664, 50}}";
+ };
+ Tab3 = {
+ Frame = "{{0, 0}, {612, 295}}";
+ };
+ TabCount = 4;
+ TabsVisible = NO;
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Frame = "{{0, 0}, {313, 531}}";
+ GroupTreeTableConfiguration = (
+ SCMStatusColumn,
+ 22,
+ TargetStatusColumn,
+ 18,
+ MainColumn,
+ 258,
+ );
+ };
+ Tab1 = {
+ ClassesFrame = "{{0, 0}, {280, 398}}";
+ ClassesTreeTableConfiguration = (
+ PBXBookColumnIdentifier,
+ 20,
+ PBXClassColumnIdentifier,
+ 237,
+ );
+ Frame = "{{0, 0}, {278, 659}}";
+ MembersFrame = "{{0, 407}, {280, 252}}";
+ MembersTreeTableConfiguration = (
+ PBXBookColumnIdentifier,
+ 20,
+ PBXMethodColumnIdentifier,
+ 236,
+ );
+ };
+ Tab2 = {
+ Frame = "{{0, 0}, {200, 100}}";
+ };
+ Tab3 = {
+ Frame = "{{0, 0}, {200, 557}}";
+ TargetTableConfiguration = (
+ ActiveObject,
+ 16,
+ ObjectNames,
+ 202.296,
+ );
+ };
+ Tab4 = {
+ BreakpointsTreeTableConfiguration = (
+ breakpointColumn,
+ 197,
+ enabledColumn,
+ 31,
+ );
+ Frame = "{{0, 0}, {250, 100}}";
+ };
+ TabCount = 5;
+ TabsVisible = NO;
+ };
+ StatusViewVisible = NO;
+ Template = F5CA7ECB015C094F0DCA290F;
+ ToolbarVisible = NO;
+ WindowLocation = "{48, 3}";
+ };
+ PBXWorkspaceContents = (
+ {
+ LeftSlideOut = {
+ Split0 = {
+ Split0 = {
+ NavContent0 = {
+ history = (
+ F5A439D1029B6B5501DC9064,
+ F5A439D2029B6B5501DC9064,
+ F5A439D3029B6B5501DC9064,
+ F5A439D4029B6B5501DC9064,
+ F5A439D5029B6B5501DC9064,
+ F5A439D6029B6B5501DC9064,
+ F5A439D7029B6B5501DC9064,
+ F5BE671E029B6FEE01DC9064,
+ F55BC4B902B2E09101DC9062,
+ F55BC4BA02B2E09101DC9062,
+ F55BC4BD02B2E09101DC9062,
+ F5BFE59402F984FA01DC9062,
+ F5BFE59502F984FA01DC9062,
+ F5BFE59602F984FA01DC9062,
+ F5BFE59702F984FA01DC9062,
+ F5BFE59802F984FA01DC9062,
+ F5BFE59902F984FA01DC9062,
+ F5BFE59B02F984FA01DC9062,
+ F5BFE59C02F984FA01DC9062,
+ F5BFE59D02F984FA01DC9062,
+ F5BFE59E02F984FA01DC9062,
+ F5BFE59F02F984FA01DC9062,
+ F5BFE5A002F984FA01DC9062,
+ F5BFE5A102F984FA01DC9062,
+ F5BFE5A202F984FA01DC9062,
+ F5BFE5A402F984FA01DC9062,
+ F5BFE5A502F984FA01DC9062,
+ F5BFE5A602F984FA01DC9062,
+ F5BFE5A702F984FA01DC9062,
+ F5BFE5A802F984FA01DC9062,
+ );
+ prevStack = (
+ F5A439DA029B6B5501DC9064,
+ F5A439DB029B6B5501DC9064,
+ F5A439DE029B6B5501DC9064,
+ F5A439DF029B6B5501DC9064,
+ F5A439E0029B6B5501DC9064,
+ F5A439E1029B6B5501DC9064,
+ F5A439E2029B6B5501DC9064,
+ F5A439E3029B6B5501DC9064,
+ F5A439E4029B6B5501DC9064,
+ F5A439E5029B6B5501DC9064,
+ F5A439E6029B6B5501DC9064,
+ F5A439E7029B6B5501DC9064,
+ F5A439E8029B6B5501DC9064,
+ F5BE671F029B6FEE01DC9064,
+ F55BC4BF02B2E09101DC9062,
+ F55BC4C002B2E09101DC9062,
+ F55BC4C102B2E09101DC9062,
+ F55BC4C202B2E09101DC9062,
+ F55BC4C302B2E09101DC9062,
+ F55BC4C402B2E09101DC9062,
+ F55BC4C702B2E09101DC9062,
+ F5BFE5AA02F984FA01DC9062,
+ F5BFE5AB02F984FA01DC9062,
+ F5BFE5AC02F984FA01DC9062,
+ F5BFE5AD02F984FA01DC9062,
+ F5BFE5AE02F984FA01DC9062,
+ F5BFE5AF02F984FA01DC9062,
+ F5BFE5B002F984FA01DC9062,
+ F5BFE5B202F984FA01DC9062,
+ F5BFE5B302F984FA01DC9062,
+ F5BFE5B402F984FA01DC9062,
+ F5BFE5B502F984FA01DC9062,
+ F5BFE5B702F984FA01DC9062,
+ F5BFE5B802F984FA01DC9062,
+ F5BFE5B902F984FA01DC9062,
+ F5BFE5BB02F984FA01DC9062,
+ F5BFE5BC02F984FA01DC9062,
+ F5BFE5BD02F984FA01DC9062,
+ F5BFE5BE02F984FA01DC9062,
+ F5BFE5BF02F984FA01DC9062,
+ F5BFE5C002F984FA01DC9062,
+ F5BFE5C102F984FA01DC9062,
+ );
+ };
+ NavContent1 = {
+ bookmark = 005751A902FB00920AC916F0;
+ history = (
+ F5BFE5C402F984FA01DC9062,
+ );
+ };
+ NavCount = 2;
+ NavGeometry0 = {
+ Frame = "{{0, 0}, {645, 321}}";
+ NavBarVisible = YES;
+ };
+ NavGeometry1 = {
+ Frame = "{{0, 330}, {645, 321}}";
+ NavBarVisible = YES;
+ };
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Debugger = {
+ Split0 = {
+ SplitCount = 2;
+ };
+ SplitCount = 1;
+ TabCount = 2;
+ };
+ LauncherConfigVersion = 7;
+ };
+ Tab1 = {
+ LauncherConfigVersion = 3;
+ Runner = {
+ };
+ };
+ TabCount = 4;
+ };
+ SplitCount = 1;
+ Tab1 = {
+ OptionsSetName = "Default Options";
+ };
+ TabCount = 5;
+ };
+ },
+ );
+ PBXWorkspaceGeometries = (
+ {
+ ContentSize = "{929, 674}";
+ LeftSlideOut = {
+ ActiveTab = 0;
+ Collapsed = NO;
+ Frame = "{{0, 23}, {929, 651}}";
+ Split0 = {
+ Collapsed = NO;
+ Frame = "{{284, 0}, {645, 651}}";
+ Split0 = {
+ Frame = "{{0, 0}, {645, 651}}";
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Debugger = {
+ Collapsed = NO;
+ Frame = "{{0, 0}, {681, 289}}";
+ Split0 = {
+ Frame = "{{0, 24}, {681, 265}}";
+ Split0 = {
+ Frame = "{{0, 0}, {333, 265}}";
+ };
+ Split1 = {
+ DebugVariablesTableConfiguration = (
+ Name,
+ 82.80298,
+ Value,
+ 104.074,
+ Summary,
+ 126.123,
+ );
+ Frame = "{{342, 0}, {339, 265}}";
+ };
+ SplitCount = 2;
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Frame = "{{0, 0}, {100, 50}}";
+ };
+ Tab1 = {
+ Frame = "{{0, 0}, {100, 50}}";
+ };
+ TabCount = 2;
+ TabsVisible = YES;
+ };
+ Frame = "{{0, 0}, {681, 289}}";
+ LauncherConfigVersion = 7;
+ };
+ Tab1 = {
+ Frame = "{{0, 0}, {681, 120}}";
+ LauncherConfigVersion = 3;
+ Runner = {
+ Frame = "{{0, 0}, {681, 120}}";
+ };
+ };
+ Tab2 = {
+ BuildMessageFrame = "{{0, 0}, {683, 127}}";
+ BuildTranscriptFrame = "{{0, 136}, {683, 100}}";
+ Frame = "{{0, 0}, {681, 234}}";
+ };
+ Tab3 = {
+ Frame = "{{0, 0}, {681, 238}}";
+ };
+ TabCount = 4;
+ TabsVisible = NO;
+ };
+ SplitCount = 1;
+ Tab0 = {
+ Frame = "{{0, 0}, {260, 651}}";
+ GroupTreeTableConfiguration = (
+ SCMStatusColumn,
+ 22,
+ TargetStatusColumn,
+ 18,
+ MainColumn,
+ 205,
+ );
+ };
+ Tab1 = {
+ ClassesFrame = "{{0, 0}, {250, 333}}";
+ ClassesTreeTableConfiguration = (
+ PBXBookColumnIdentifier,
+ 20,
+ PBXClassColumnIdentifier,
+ 207,
+ );
+ Frame = "{{0, 0}, {248, 554}}";
+ MembersFrame = "{{0, 342}, {250, 212}}";
+ MembersTreeTableConfiguration = (
+ PBXBookColumnIdentifier,
+ 20,
+ PBXMethodColumnIdentifier,
+ 206,
+ );
+ };
+ Tab2 = {
+ Frame = "{{0, 0}, {217, 554}}";
+ };
+ Tab3 = {
+ Frame = "{{0, 0}, {239, 651}}";
+ TargetTableConfiguration = (
+ ActiveObject,
+ 16,
+ ObjectNames,
+ 206.296,
+ );
+ };
+ Tab4 = {
+ BreakpointsTreeTableConfiguration = (
+ breakpointColumn,
+ 197,
+ enabledColumn,
+ 31,
+ );
+ Frame = "{{0, 0}, {250, 554}}";
+ };
+ TabCount = 5;
+ TabsVisible = YES;
+ };
+ StatusViewVisible = YES;
+ Template = 64ABBB4501FA494900185B06;
+ ToolbarVisible = YES;
+ WindowLocation = "{165, 176}";
+ },
+ );
+ PBXWorkspaceStateSaveDate = 49921092;
+ };
+ perUserProjectItems = {
+ 005751A902FB00920AC916F0 = 005751A902FB00920AC916F0;
+ F55BC4B902B2E09101DC9062 = F55BC4B902B2E09101DC9062;
+ F55BC4BA02B2E09101DC9062 = F55BC4BA02B2E09101DC9062;
+ F55BC4BD02B2E09101DC9062 = F55BC4BD02B2E09101DC9062;
+ F55BC4BF02B2E09101DC9062 = F55BC4BF02B2E09101DC9062;
+ F55BC4C002B2E09101DC9062 = F55BC4C002B2E09101DC9062;
+ F55BC4C102B2E09101DC9062 = F55BC4C102B2E09101DC9062;
+ F55BC4C202B2E09101DC9062 = F55BC4C202B2E09101DC9062;
+ F55BC4C302B2E09101DC9062 = F55BC4C302B2E09101DC9062;
+ F55BC4C402B2E09101DC9062 = F55BC4C402B2E09101DC9062;
+ F55BC4C702B2E09101DC9062 = F55BC4C702B2E09101DC9062;
+ F5A439D1029B6B5501DC9064 = F5A439D1029B6B5501DC9064;
+ F5A439D2029B6B5501DC9064 = F5A439D2029B6B5501DC9064;
+ F5A439D3029B6B5501DC9064 = F5A439D3029B6B5501DC9064;
+ F5A439D4029B6B5501DC9064 = F5A439D4029B6B5501DC9064;
+ F5A439D5029B6B5501DC9064 = F5A439D5029B6B5501DC9064;
+ F5A439D6029B6B5501DC9064 = F5A439D6029B6B5501DC9064;
+ F5A439D7029B6B5501DC9064 = F5A439D7029B6B5501DC9064;
+ F5A439DA029B6B5501DC9064 = F5A439DA029B6B5501DC9064;
+ F5A439DB029B6B5501DC9064 = F5A439DB029B6B5501DC9064;
+ F5A439DE029B6B5501DC9064 = F5A439DE029B6B5501DC9064;
+ F5A439DF029B6B5501DC9064 = F5A439DF029B6B5501DC9064;
+ F5A439E0029B6B5501DC9064 = F5A439E0029B6B5501DC9064;
+ F5A439E1029B6B5501DC9064 = F5A439E1029B6B5501DC9064;
+ F5A439E2029B6B5501DC9064 = F5A439E2029B6B5501DC9064;
+ F5A439E3029B6B5501DC9064 = F5A439E3029B6B5501DC9064;
+ F5A439E4029B6B5501DC9064 = F5A439E4029B6B5501DC9064;
+ F5A439E5029B6B5501DC9064 = F5A439E5029B6B5501DC9064;
+ F5A439E6029B6B5501DC9064 = F5A439E6029B6B5501DC9064;
+ F5A439E7029B6B5501DC9064 = F5A439E7029B6B5501DC9064;
+ F5A439E8029B6B5501DC9064 = F5A439E8029B6B5501DC9064;
+ F5BE671E029B6FEE01DC9064 = F5BE671E029B6FEE01DC9064;
+ F5BE671F029B6FEE01DC9064 = F5BE671F029B6FEE01DC9064;
+ F5BFE59402F984FA01DC9062 = F5BFE59402F984FA01DC9062;
+ F5BFE59502F984FA01DC9062 = F5BFE59502F984FA01DC9062;
+ F5BFE59602F984FA01DC9062 = F5BFE59602F984FA01DC9062;
+ F5BFE59702F984FA01DC9062 = F5BFE59702F984FA01DC9062;
+ F5BFE59802F984FA01DC9062 = F5BFE59802F984FA01DC9062;
+ F5BFE59902F984FA01DC9062 = F5BFE59902F984FA01DC9062;
+ F5BFE59B02F984FA01DC9062 = F5BFE59B02F984FA01DC9062;
+ F5BFE59C02F984FA01DC9062 = F5BFE59C02F984FA01DC9062;
+ F5BFE59D02F984FA01DC9062 = F5BFE59D02F984FA01DC9062;
+ F5BFE59E02F984FA01DC9062 = F5BFE59E02F984FA01DC9062;
+ F5BFE59F02F984FA01DC9062 = F5BFE59F02F984FA01DC9062;
+ F5BFE5A002F984FA01DC9062 = F5BFE5A002F984FA01DC9062;
+ F5BFE5A102F984FA01DC9062 = F5BFE5A102F984FA01DC9062;
+ F5BFE5A202F984FA01DC9062 = F5BFE5A202F984FA01DC9062;
+ F5BFE5A402F984FA01DC9062 = F5BFE5A402F984FA01DC9062;
+ F5BFE5A502F984FA01DC9062 = F5BFE5A502F984FA01DC9062;
+ F5BFE5A602F984FA01DC9062 = F5BFE5A602F984FA01DC9062;
+ F5BFE5A702F984FA01DC9062 = F5BFE5A702F984FA01DC9062;
+ F5BFE5A802F984FA01DC9062 = F5BFE5A802F984FA01DC9062;
+ F5BFE5AA02F984FA01DC9062 = F5BFE5AA02F984FA01DC9062;
+ F5BFE5AB02F984FA01DC9062 = F5BFE5AB02F984FA01DC9062;
+ F5BFE5AC02F984FA01DC9062 = F5BFE5AC02F984FA01DC9062;
+ F5BFE5AD02F984FA01DC9062 = F5BFE5AD02F984FA01DC9062;
+ F5BFE5AE02F984FA01DC9062 = F5BFE5AE02F984FA01DC9062;
+ F5BFE5AF02F984FA01DC9062 = F5BFE5AF02F984FA01DC9062;
+ F5BFE5B002F984FA01DC9062 = F5BFE5B002F984FA01DC9062;
+ F5BFE5B202F984FA01DC9062 = F5BFE5B202F984FA01DC9062;
+ F5BFE5B302F984FA01DC9062 = F5BFE5B302F984FA01DC9062;
+ F5BFE5B402F984FA01DC9062 = F5BFE5B402F984FA01DC9062;
+ F5BFE5B502F984FA01DC9062 = F5BFE5B502F984FA01DC9062;
+ F5BFE5B702F984FA01DC9062 = F5BFE5B702F984FA01DC9062;
+ F5BFE5B802F984FA01DC9062 = F5BFE5B802F984FA01DC9062;
+ F5BFE5B902F984FA01DC9062 = F5BFE5B902F984FA01DC9062;
+ F5BFE5BB02F984FA01DC9062 = F5BFE5BB02F984FA01DC9062;
+ F5BFE5BC02F984FA01DC9062 = F5BFE5BC02F984FA01DC9062;
+ F5BFE5BD02F984FA01DC9062 = F5BFE5BD02F984FA01DC9062;
+ F5BFE5BE02F984FA01DC9062 = F5BFE5BE02F984FA01DC9062;
+ F5BFE5BF02F984FA01DC9062 = F5BFE5BF02F984FA01DC9062;
+ F5BFE5C002F984FA01DC9062 = F5BFE5C002F984FA01DC9062;
+ F5BFE5C102F984FA01DC9062 = F5BFE5C102F984FA01DC9062;
+ F5BFE5C402F984FA01DC9062 = F5BFE5C402F984FA01DC9062;
+ };
+ projectwideBuildSettings = {
+ OBJROOT = "/Volumes/TheCloset/jingham/tcl-tk/source/tcl-merge/Objects";
+ SYMROOT = "/Volumes/TheCloset/jingham/tcl-tk/source/tcl-merge/Products";
+ };
+ wantsIndex = 1;
+ wantsSCM = -1;
+ };
+ F53755DF016C38D201DC9062 = {
+ activeExec = 0;
+ };
+ F53756A0016C4DD401DC9062 = {
+ activeExec = 0;
+ executables = (
+ F53756AB016C4DD401DC9062,
+ );
+ };
+ F53756AB016C4DD401DC9062 = {
+ activeArgIndex = 2147483647;
+ argumentStrings = (
+ );
+ debuggerPlugin = GDBDebugging;
+ dylibVariantSuffix = "";
+ enableDebugStr = 1;
+ environmentEntries = (
+ );
+ isa = PBXExecutable;
+ name = "Wish Shell";
+ shlibInfoDictList = (
+ );
+ sourceDirectories = (
+ );
+ };
+ F55BC4B602B2DFB901DC9062 = {
+ fileReference = F5375580016C389901DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 201;
+ state = 2;
+ };
+ F55BC4B902B2E09101DC9062 = {
+ fRef = F5375553016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXEvent.c: 242";
+ rLen = 0;
+ rLoc = 6185;
+ rType = 0;
+ vrLen = 1438;
+ vrLoc = 5937;
+ };
+ F55BC4BA02B2E09101DC9062 = {
+ fRef = F55BC46A02B2D3F301DC9062;
+ isa = PBXTextBookmark;
+ name = "panedwindow.tcl: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1395;
+ vrLoc = 0;
+ };
+ F55BC4BD02B2E09101DC9062 = {
+ bstl = F537552C016C352C01DC9062;
+ isa = PBXBuildStyleBookmark;
+ };
+ F55BC4BF02B2E09101DC9062 = {
+ fRef = F5375553016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXEvent.c: 242";
+ rLen = 0;
+ rLoc = 6185;
+ rType = 0;
+ vrLen = 1438;
+ vrLoc = 5937;
+ };
+ F55BC4C002B2E09101DC9062 = {
+ isa = PBXTargetBookmark;
+ trg = F53755DF016C38D201DC9062;
+ };
+ F55BC4C102B2E09101DC9062 = {
+ fRef = F55BC46A02B2D3F301DC9062;
+ isa = PBXTextBookmark;
+ name = "panedwindow.tcl: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1395;
+ vrLoc = 0;
+ };
+ F55BC4C202B2E09101DC9062 = {
+ isa = PBXTargetBookmark;
+ trg = F53755DF016C38D201DC9062;
+ };
+ F55BC4C302B2E09101DC9062 = {
+ fRef = F55BC46A02B2D3F301DC9062;
+ isa = PBXTextBookmark;
+ name = "panedwindow.tcl: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1395;
+ vrLoc = 0;
+ };
+ F55BC4C402B2E09101DC9062 = {
+ isa = PBXTargetBookmark;
+ trg = F53755DF016C38D201DC9062;
+ };
+ F55BC4C702B2E09101DC9062 = {
+ bstl = F537552C016C352C01DC9062;
+ isa = PBXBuildStyleBookmark;
+ };
+ F566083B0197283B01DC9062 = {
+ fileReference = F5375548016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 214;
+ state = 2;
+ };
+ F566083C0197823801DC9062 = {
+ isa = PBXSymbolicBreakpoint;
+ state = 2;
+ symbolName = Tcl_CreateObjCommand;
+ };
+ F571FE470179562E01DC9062 = {
+ fileReference = F5375583016C389901DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 1711;
+ state = 2;
+ };
+ F571FE4A0179695001DC9062 = {
+ fileReference = F5375558016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 175;
+ state = 2;
+ };
+ F571FE4C01796B1101DC9062 = {
+ fileReference = F5375558016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 172;
+ state = 2;
+ };
+ F571FE4D01796CAF01DC9062 = {
+ fileReference = F5375558016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 229;
+ state = 2;
+ };
+ F571FE4E01796F9201DC9062 = {
+ fileReference = F53755C8016C389901DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 408;
+ state = 2;
+ };
+ F571FE4F0179702301DC9062 = {
+ fileReference = F537559A016C389901DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 444;
+ state = 2;
+ };
+ F571FE500179702301DC9062 = {
+ fileReference = F537559A016C389901DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 469;
+ state = 2;
+ };
+ F583DC0E018D092D01DC9062 = {
+ fileReference = F5375551016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 531;
+ state = 2;
+ };
+ F583DC0F018D0CB501DC9062 = {
+ fileReference = F5375551016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 547;
+ state = 2;
+ };
+ F583DC13018D2B4A01DC9062 = {
+ fileReference = F5375551016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 1478;
+ state = 2;
+ };
+ F58907BE018DCE8F01DC9062 = {
+ fileReference = F5375548016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 196;
+ state = 2;
+ };
+ F58907C5018DD1C301DC9062 = {
+ fileReference = F5375551016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 502;
+ state = 2;
+ };
+ F5978FD602B3190701DC9062 = {
+ fileReference = F5375580016C389901DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 224;
+ state = 2;
+ };
+ F5A439C0029B609C01DC9064 = {
+ fileReference = F5375548016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 74;
+ state = 1;
+ };
+ F5A439C2029B60ED01DC9064 = {
+ fileReference = F5375548016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 155;
+ state = 1;
+ };
+ F5A439CA029B620901DC9064 = {
+ fileReference = F5375548016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 306;
+ state = 1;
+ };
+ F5A439D1029B6B5501DC9064 = {
+ fRef = F5A439F3029B6B5601DC9064;
+ isa = PBXTextBookmark;
+ name = "CarbonEvents.h: 4483";
+ rLen = 19;
+ rLoc = 173576;
+ rType = 0;
+ vrLen = 804;
+ vrLoc = 173125;
+ };
+ F5A439D2029B6B5501DC9064 = {
+ fRef = F5375548016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXAppInit.c: Tcl_AppInit";
+ rLen = 0;
+ rLoc = 9908;
+ rType = 0;
+ vrLen = 1370;
+ vrLoc = 8362;
+ };
+ F5A439D3029B6B5501DC9064 = {
+ fRef = F5A439F4029B6B5601DC9064;
+ isa = PBXTextBookmark;
+ name = "MacWindows.h: 1410";
+ rLen = 105;
+ rLoc = 57285;
+ rType = 0;
+ vrLen = 1155;
+ vrLoc = 56795;
+ };
+ F5A439D4029B6B5501DC9064 = {
+ fRef = F5A439F5029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439D5029B6B5501DC9064 = {
+ fRef = F5A439F6029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439D6029B6B5501DC9064 = {
+ fRef = F5A439F7029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439D7029B6B5501DC9064 = {
+ fRef = F5A439F8029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439DA029B6B5501DC9064 = {
+ fRef = F5375553016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXEvent.c: TkMacOSXProcessEvent";
+ rLen = 25;
+ rLoc = 4656;
+ rType = 0;
+ vrLen = 1260;
+ vrLoc = 4407;
+ };
+ F5A439DB029B6B5501DC9064 = {
+ fRef = F537555C016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXMouseEvent.c: TkMacOSXProcessMouseEvent";
+ rLen = 0;
+ rLoc = 6037;
+ rType = 0;
+ vrLen = 1438;
+ vrLoc = 5075;
+ };
+ F5A439DE029B6B5501DC9064 = {
+ fRef = F5375553016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXEvent.c: ReceiveAndProcessEvent";
+ rLen = 0;
+ rLoc = 7098;
+ rType = 0;
+ vrLen = 1455;
+ vrLoc = 5920;
+ };
+ F5A439DF029B6B5501DC9064 = {
+ fRef = F5375548016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXAppInit.c: Tcl_AppInit";
+ rLen = 0;
+ rLoc = 9908;
+ rType = 0;
+ vrLen = 673;
+ vrLoc = 7806;
+ };
+ F5A439E0029B6B5501DC9064 = {
+ fRef = F5375567016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXWm.c: TkMacOSXMakeRealWindowExist";
+ rLen = 15;
+ rLoc = 148454;
+ rType = 0;
+ vrLen = 695;
+ vrLoc = 112860;
+ };
+ F5A439E1029B6B5501DC9064 = {
+ fRef = F5A439FB029B6B5601DC9064;
+ isa = PBXTextBookmark;
+ name = "MacWindows.h: 1410";
+ rLen = 0;
+ rLoc = 57304;
+ rType = 0;
+ vrLen = 659;
+ vrLoc = 56953;
+ };
+ F5A439E2029B6B5501DC9064 = {
+ fRef = F5375548016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXAppInit.c: Tcl_AppInit";
+ rLen = 0;
+ rLoc = 9908;
+ rType = 0;
+ vrLen = 1370;
+ vrLoc = 8362;
+ };
+ F5A439E3029B6B5501DC9064 = {
+ fRef = F5A439EF029B6B5601DC9064;
+ isa = PBXTextBookmark;
+ name = "MacWindows.h: 1410";
+ rLen = 105;
+ rLoc = 57285;
+ rType = 0;
+ vrLen = 1155;
+ vrLoc = 56795;
+ };
+ F5A439E4029B6B5501DC9064 = {
+ fRef = F5A439F1029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439E5029B6B5501DC9064 = {
+ fRef = F5A439FD029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439E6029B6B5501DC9064 = {
+ fRef = F5A439FE029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439E7029B6B5501DC9064 = {
+ fRef = F5A439EE029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439E8029B6B5501DC9064 = {
+ fRef = F5A439F2029B6B5601DC9064;
+ isa = PBXBookmark;
+ };
+ F5A439EE029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = Carbon.html;
+ path = /Developer/Documentation/Carbon/Carbon.html;
+ refType = 0;
+ };
+ F5A439EF029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = MacWindows.h;
+ path = /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/MacWindows.h;
+ refType = 0;
+ };
+ F5A439F1029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = Carbon.html;
+ path = /Developer/Documentation/Carbon/Carbon.html;
+ refType = 0;
+ };
+ F5A439F2029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = carboneventmanager.html;
+ path = /Developer/Documentation/Carbon/oss/CarbonEventManager/carboneventmanager.html;
+ refType = 0;
+ };
+ F5A439F3029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = CarbonEvents.h;
+ path = /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/CarbonEvents.h;
+ refType = 0;
+ };
+ F5A439F4029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = MacWindows.h;
+ path = /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/MacWindows.h;
+ refType = 0;
+ };
+ F5A439F5029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = windowmanager.html;
+ path = /Developer/Documentation/Carbon/HumanInterfaceToolbox/WindowManager/windowmanager.html;
+ refType = 0;
+ };
+ F5A439F6029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = index.html;
+ path = /Developer/Documentation/Carbon/HumanInterfaceToolbox/WindowManager/Window_Manager/index.html;
+ refType = 0;
+ };
+ F5A439F7029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = Carbon.html;
+ path = /Developer/Documentation/Carbon/Carbon.html;
+ refType = 0;
+ };
+ F5A439F8029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = carboneventmanager.html;
+ path = /Developer/Documentation/Carbon/oss/CarbonEventManager/carboneventmanager.html;
+ refType = 0;
+ };
+ F5A439FB029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = MacWindows.h;
+ path = /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/MacWindows.h;
+ refType = 0;
+ };
+ F5A439FD029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = windowmanager.html;
+ path = /Developer/Documentation/Carbon/HumanInterfaceToolbox/WindowManager/windowmanager.html;
+ refType = 0;
+ };
+ F5A439FE029B6B5601DC9064 = {
+ isa = PBXFileReference;
+ name = index.html;
+ path = /Developer/Documentation/Carbon/HumanInterfaceToolbox/WindowManager/Window_Manager/index.html;
+ refType = 0;
+ };
+ F5A5146F01D05DC201DC9062 = {
+ fileReference = F5375550016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 651;
+ state = 1;
+ };
+ F5A5147001D0758C01DC9062 = {
+ fileReference = F5375550016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 838;
+ state = 1;
+ };
+ F5A852D6020F6C6C01DC9062 = {
+ fileReference = F5375550016C376E01DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 277;
+ state = 1;
+ };
+ F5B2CDC10175829501DC9062 = {
+ fileReference = F5375583016C389901DC9062;
+ isa = PBXFileBreakpoint;
+ lineNumber = 2584;
+ state = 2;
+ };
+ F5BE671E029B6FEE01DC9064 = {
+ fRef = F5BE6723029B6FEE01DC9064;
+ isa = PBXBookmark;
+ };
+ F5BE671F029B6FEE01DC9064 = {
+ fRef = F5BE6722029B6FEE01DC9064;
+ isa = PBXBookmark;
+ };
+ F5BE6722029B6FEE01DC9064 = {
+ isa = PBXFileReference;
+ name = index.html;
+ path = /Developer/Documentation/Carbon/oss/CarbonEventManager/Carbon_Event_Manager_Ref/index.html;
+ refType = 0;
+ };
+ F5BE6723029B6FEE01DC9064 = {
+ isa = PBXFileReference;
+ name = index.html;
+ path = /Developer/Documentation/Carbon/oss/CarbonEventManager/Carbon_Event_Manager_Ref/index.html;
+ refType = 0;
+ };
+ F5BFE59402F984FA01DC9062 = {
+ isa = PBXTargetBookmark;
+ trg = F53755DF016C38D201DC9062;
+ };
+ F5BFE59502F984FA01DC9062 = {
+ fRef = F53755BC016C389901DC9062;
+ isa = PBXTextBookmark;
+ name = "tkTest.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1168;
+ vrLoc = 0;
+ };
+ F5BFE59602F984FA01DC9062 = {
+ fRef = F5BFE58C02F8C41501DC9062;
+ isa = PBXTextBookmark;
+ name = "tkUndo.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 723;
+ vrLoc = 0;
+ };
+ F5BFE59702F984FA01DC9062 = {
+ fRef = F5BFE58F02F8C45B01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkUndo.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1028;
+ vrLoc = 0;
+ };
+ F5BFE59802F984FA01DC9062 = {
+ fRef = F5375575016C37A601DC9062;
+ isa = PBXTextBookmark;
+ name = "tkIntDecls.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 959;
+ vrLoc = 52384;
+ };
+ F5BFE59902F984FA01DC9062 = {
+ fRef = F537556A016C37A601DC9062;
+ isa = PBXTextBookmark;
+ name = "ks_names.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 963;
+ vrLoc = 0;
+ };
+ F5BFE59B02F984FA01DC9062 = {
+ fRef = F537559F016C389901DC9062;
+ isa = PBXTextBookmark;
+ name = "tkGet.c: Tk_GetUid";
+ rLen = 50;
+ rLoc = 13445;
+ rType = 0;
+ vrLen = 1360;
+ vrLoc = 12671;
+ };
+ F5BFE59C02F984FA01DC9062 = {
+ fRef = F5375545016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXWm.h: 104";
+ rLen = 6;
+ rLoc = 4294;
+ rType = 0;
+ vrLen = 1558;
+ vrLoc = 8742;
+ };
+ F5BFE59D02F984FA01DC9062 = {
+ fRef = F537556B016C37A601DC9062;
+ isa = PBXTextBookmark;
+ name = "tk.h: 1606";
+ rLen = 0;
+ rLoc = 56812;
+ rType = 0;
+ vrLen = 897;
+ vrLoc = 55983;
+ };
+ F5BFE59E02F984FA01DC9062 = {
+ exec = F53756AB016C4DD401DC9062;
+ isa = PBXExecutableBookmark;
+ };
+ F5BFE59F02F984FA01DC9062 = {
+ fRef = F5BFE5E102F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5A002F984FA01DC9062 = {
+ fRef = F5BFE5DA02F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5A102F984FA01DC9062 = {
+ fRef = F5BFE5DC02F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5A202F984FA01DC9062 = {
+ fRef = F5BFE5DB02F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5A402F984FA01DC9062 = {
+ fRef = F5BFE5DD02F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5A502F984FA01DC9062 = {
+ fRef = F5375567016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXWm.c: TkUnsupported1Cmd";
+ rLen = 15;
+ rLoc = 148454;
+ rType = 0;
+ vrLen = 1386;
+ vrLoc = 112609;
+ };
+ F5BFE5A602F984FA01DC9062 = {
+ fRef = F5375568016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXXStubs.c: TkpCloseDisplay";
+ rLen = 0;
+ rLoc = 5311;
+ rType = 0;
+ vrLen = 437;
+ vrLoc = 4370;
+ };
+ F5BFE5A702F984FA01DC9062 = {
+ fRef = F53755C8016C389901DC9062;
+ isa = PBXTextBookmark;
+ name = "tkWindow.c: TkCloseDisplay";
+ rLen = 0;
+ rLoc = 9153;
+ rType = 0;
+ vrLen = 453;
+ vrLoc = 8833;
+ };
+ F5BFE5A802F984FA01DC9062 = {
+ fRef = F537555C016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXMouseEvent.c: TkMacOSXProcessMouseEvent";
+ rLen = 0;
+ rLoc = 6187;
+ rType = 0;
+ vrLen = 742;
+ vrLoc = 11312;
+ };
+ F5BFE5AA02F984FA01DC9062 = {
+ isa = PBXTargetBookmark;
+ trg = F53755DF016C38D201DC9062;
+ };
+ F5BFE5AB02F984FA01DC9062 = {
+ fRef = F53755BC016C389901DC9062;
+ isa = PBXTextBookmark;
+ name = "tkTest.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1168;
+ vrLoc = 0;
+ };
+ F5BFE5AC02F984FA01DC9062 = {
+ fRef = F5BFE58C02F8C41501DC9062;
+ isa = PBXTextBookmark;
+ name = "tkUndo.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 723;
+ vrLoc = 0;
+ };
+ F5BFE5AD02F984FA01DC9062 = {
+ fRef = F5BFE58F02F8C45B01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkUndo.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1028;
+ vrLoc = 0;
+ };
+ F5BFE5AE02F984FA01DC9062 = {
+ fRef = F5375575016C37A601DC9062;
+ isa = PBXTextBookmark;
+ name = "tkIntDecls.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 959;
+ vrLoc = 52384;
+ };
+ F5BFE5AF02F984FA01DC9062 = {
+ fRef = F537556A016C37A601DC9062;
+ isa = PBXTextBookmark;
+ name = "ks_names.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 963;
+ vrLoc = 0;
+ };
+ F5BFE5B002F984FA01DC9062 = {
+ fRef = F537556B016C37A601DC9062;
+ isa = PBXTextBookmark;
+ name = "tk.h: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 882;
+ vrLoc = 55769;
+ };
+ F5BFE5B202F984FA01DC9062 = {
+ fRef = F537559F016C389901DC9062;
+ isa = PBXTextBookmark;
+ name = "tkGet.c: Tk_GetUid";
+ rLen = 50;
+ rLoc = 13445;
+ rType = 0;
+ vrLen = 1360;
+ vrLoc = 12671;
+ };
+ F5BFE5B302F984FA01DC9062 = {
+ fRef = F5375545016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXWm.h: 104";
+ rLen = 6;
+ rLoc = 4294;
+ rType = 0;
+ vrLen = 1558;
+ vrLoc = 8742;
+ };
+ F5BFE5B402F984FA01DC9062 = {
+ fRef = F537556B016C37A601DC9062;
+ isa = PBXTextBookmark;
+ name = "tk.h: 1606";
+ rLen = 0;
+ rLoc = 56812;
+ rType = 0;
+ vrLen = 897;
+ vrLoc = 55983;
+ };
+ F5BFE5B502F984FA01DC9062 = {
+ exec = F53756AB016C4DD401DC9062;
+ isa = PBXExecutableBookmark;
+ };
+ F5BFE5B702F984FA01DC9062 = {
+ fRef = F5BFE5DF02F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5B802F984FA01DC9062 = {
+ fRef = F5BFE5D902F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5B902F984FA01DC9062 = {
+ fRef = F5BFE5E502F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5BB02F984FA01DC9062 = {
+ fRef = F5BFE5D802F984FA01DC9062;
+ isa = PBXBookmark;
+ };
+ F5BFE5BC02F984FA01DC9062 = {
+ fRef = F5375567016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXWm.c: TkUnsupported1Cmd";
+ rLen = 15;
+ rLoc = 148454;
+ rType = 0;
+ vrLen = 1386;
+ vrLoc = 112609;
+ };
+ F5BFE5BD02F984FA01DC9062 = {
+ fRef = F5375568016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXXStubs.c: 92";
+ rLen = 14;
+ rLoc = 2403;
+ rType = 0;
+ vrLen = 1501;
+ vrLoc = 2945;
+ };
+ F5BFE5BE02F984FA01DC9062 = {
+ fRef = F53755C8016C389901DC9062;
+ isa = PBXTextBookmark;
+ name = "tkWindow.c: DeleteWindowsExitProc";
+ rLen = 0;
+ rLoc = 79080;
+ rType = 0;
+ vrLen = 1549;
+ vrLoc = 78212;
+ };
+ F5BFE5BF02F984FA01DC9062 = {
+ fRef = F5375568016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXXStubs.c: TkpCloseDisplay";
+ rLen = 0;
+ rLoc = 5311;
+ rType = 0;
+ vrLen = 437;
+ vrLoc = 4370;
+ };
+ F5BFE5C002F984FA01DC9062 = {
+ fRef = F53755C8016C389901DC9062;
+ isa = PBXTextBookmark;
+ name = "tkWindow.c: TkCloseDisplay";
+ rLen = 0;
+ rLoc = 9153;
+ rType = 0;
+ vrLen = 453;
+ vrLoc = 8833;
+ };
+ F5BFE5C102F984FA01DC9062 = {
+ fRef = F537555C016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXMouseEvent.c: TkMacOSXProcessMouseEvent";
+ rLen = 0;
+ rLoc = 6187;
+ rType = 0;
+ vrLen = 742;
+ vrLoc = 11312;
+ };
+ F5BFE5C402F984FA01DC9062 = {
+ fRef = F5375568016C376E01DC9062;
+ isa = PBXTextBookmark;
+ name = "tkMacOSXXStubs.c: TkpCloseDisplay";
+ rLen = 0;
+ rLoc = 5311;
+ rType = 0;
+ vrLen = 500;
+ vrLoc = 4894;
+ };
+ F5BFE5D802F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = README.html;
+ path = /Developer/Documentation/Help/README/README.html;
+ refType = 0;
+ };
+ F5BFE5D902F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = index.html;
+ path = /Developer/Documentation/ReleaseNotes/index.html;
+ refType = 0;
+ };
+ F5BFE5DA02F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = devessentials.html;
+ path = /Developer/Documentation/Essentials/devessentials.html;
+ refType = 0;
+ };
+ F5BFE5DB02F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = index.html;
+ path = /Developer/Documentation/ReleaseNotes/index.html;
+ refType = 0;
+ };
+ F5BFE5DC02F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = MallocOptions.html;
+ path = /Developer/Documentation/ReleaseNotes/MallocOptions.html;
+ refType = 0;
+ };
+ F5BFE5DD02F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = README.html;
+ path = /Developer/Documentation/Help/README/README.html;
+ refType = 0;
+ };
+ F5BFE5DF02F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = devessentials.html;
+ path = /Developer/Documentation/Essentials/devessentials.html;
+ refType = 0;
+ };
+ F5BFE5E102F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = devtools.html;
+ path = /Developer/Documentation/DeveloperTools/devtools.html;
+ refType = 0;
+ };
+ F5BFE5E502F984FA01DC9062 = {
+ isa = PBXFileReference;
+ name = README.html;
+ path = /Developer/Documentation/Help/README/README.html;
+ refType = 0;
+ };
+}
diff --git a/tk/macosx/Wish.pbproj/project.pbxproj b/tk/macosx/Wish.pbproj/project.pbxproj
new file mode 100644
index 00000000000..035f7f003b8
--- /dev/null
+++ b/tk/macosx/Wish.pbproj/project.pbxproj
@@ -0,0 +1,3619 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 38;
+ objects = {
+ F50D96120196176E01DC9062 = {
+ isa = PBXFrameworkReference;
+ name = ApplicationServices.framework;
+ path = /System/Library/Frameworks/ApplicationServices.framework;
+ refType = 0;
+ };
+ F50D96130196176E01DC9062 = {
+ fileRef = F50D96120196176E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F50D96140196176E01DC9062 = {
+ fileRef = F50D96120196176E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D903E0181474301DC9062 = {
+ fileRef = F5875C7B016FEF1D01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D903F018149BD01DC9062 = {
+ buildActionMask = 2147483647;
+ dstPath = "Versions/$(FRAMEWORK_VERSION)/Headers/X11";
+ dstSubfolderSpec = 1;
+ files = (
+ F51D9040018149FD01DC9062,
+ F51D9041018149FD01DC9062,
+ F51D9042018149FD01DC9062,
+ F51D9043018149FD01DC9062,
+ F51D9044018149FD01DC9062,
+ F51D9045018149FD01DC9062,
+ F51D9046018149FD01DC9062,
+ F51D9047018149FD01DC9062,
+ F51D9048018149FD01DC9062,
+ );
+ isa = PBXCopyFilesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F51D9040018149FD01DC9062 = {
+ fileRef = F53755CE016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9041018149FD01DC9062 = {
+ fileRef = F53755CF016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9042018149FD01DC9062 = {
+ fileRef = F53755D0016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9043018149FD01DC9062 = {
+ fileRef = F53755D1016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9044018149FD01DC9062 = {
+ fileRef = F53755D2016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9045018149FD01DC9062 = {
+ fileRef = F53755D3016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9046018149FD01DC9062 = {
+ fileRef = F53755D4016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9047018149FD01DC9062 = {
+ fileRef = F53755D5016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F51D9048018149FD01DC9062 = {
+ fileRef = F53755D6016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F52D38C5031F4259016F146B = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ \"${BUILD_STYLE}\" = \"Development\" ]; then\n\t# keep copy of debug library around, so that\n\t# Deployment build can be installed on top\n\t# of Development build without overwriting it\n\tcd \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/Versions/${FRAMEWORK_VERSION}\"\n\tcp -fp \"${PRODUCT_NAME}\" \"${PRODUCT_NAME}_debug\"\n\n\t# force Deployment build to be relinked next time\n\tif [ -f \"${OBJROOT}/Deployment.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\" ]; then\n\t touch -t `date -r \\`expr \\\\\\`date +\"%s\"\\\\\\` + 30\\` +\"%Y%m%d%H%M.%S\"` \"${OBJROOT}/Deployment.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\"\n\tfi\nelse\n\t# force Development build to be relinked next time\n\tif [ -f \"${OBJROOT}/Development.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\" ]; then\n\t touch -t `date -r \\`expr \\\\\\`date +\"%s\"\\\\\\` + 30\\` +\"%Y%m%d%H%M.%S\"` \"${OBJROOT}/Development.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\"\n\tfi\nfi";
+ };
+ F537552A016C352C01DC9062 = {
+ buildStyles = (
+ F537552C016C352C01DC9062,
+ F537552D016C352C01DC9062,
+ );
+ isa = PBXProject;
+ mainGroup = F537552B016C352C01DC9062;
+ productRefGroup = F53755DD016C38D201DC9062;
+ projectDirPath = "";
+ targets = (
+ F53756A0016C4DD401DC9062,
+ F53755DF016C38D201DC9062,
+ F548F8CE0313CEF0016F146B,
+ );
+ };
+ F537552B016C352C01DC9062 = {
+ children = (
+ F5C88659017D625C01DC9062,
+ F5DF07A7016CD03801DC9062,
+ F5375688016C3F1001DC9062,
+ F5375531016C376E01DC9062,
+ F537552E016C376E01DC9062,
+ F537553C016C376E01DC9062,
+ F53755C9016C389901DC9062,
+ F53755CC016C389901DC9062,
+ F537567C016C3ADB01DC9062,
+ F53755DD016C38D201DC9062,
+ );
+ isa = PBXGroup;
+ refType = 4;
+ };
+ F537552C016C352C01DC9062 = {
+ buildRules = (
+ );
+ buildSettings = {
+ TEMP_DIR = "${OBJROOT}/Development.build/$(PROJECT_NAME).build/$(TARGET_NAME).build";
+ UNSTRIPPED_PRODUCT = YES;
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ F537552D016C352C01DC9062 = {
+ buildRules = (
+ );
+ buildSettings = {
+ DEBUGGING_SYMBOLS = NO;
+ OPTIMIZATION_CFLAGS = "-Os";
+ TEMP_DIR = "${OBJROOT}/Deployment.build/$(PROJECT_NAME).build/$(TARGET_NAME).build";
+ };
+ isa = PBXBuildStyle;
+ name = Deployment;
+ };
+ F537552E016C376E01DC9062 = {
+ children = (
+ F537552F016C376E01DC9062,
+ F5375530016C376E01DC9062,
+ );
+ isa = PBXGroup;
+ name = Generic;
+ refType = 4;
+ };
+ F537552F016C376E01DC9062 = {
+ children = (
+ F5375569016C37A601DC9062,
+ F537556A016C37A601DC9062,
+ F537556B016C37A601DC9062,
+ F537556C016C37A601DC9062,
+ F537556D016C37A601DC9062,
+ F537556E016C37A601DC9062,
+ F537556F016C37A601DC9062,
+ F5375570016C37A601DC9062,
+ F5375571016C37A601DC9062,
+ F5375572016C37A601DC9062,
+ F5375573016C37A601DC9062,
+ F5375574016C37A601DC9062,
+ F5375575016C37A601DC9062,
+ F5375576016C37A601DC9062,
+ F5375577016C37A601DC9062,
+ F5375578016C37A601DC9062,
+ F5375579016C37A601DC9062,
+ F537557A016C37A601DC9062,
+ F537557B016C37A601DC9062,
+ F537557C016C37A601DC9062,
+ F537557D016C37A601DC9062,
+ F537557E016C37A601DC9062,
+ F537557F016C37A601DC9062,
+ F5BFE58F02F8C45B01DC9062,
+ );
+ isa = PBXGroup;
+ name = Headers;
+ refType = 4;
+ };
+ F5375530016C376E01DC9062 = {
+ children = (
+ F5375580016C389901DC9062,
+ F5375581016C389901DC9062,
+ F5375582016C389901DC9062,
+ F5375583016C389901DC9062,
+ F5375584016C389901DC9062,
+ F5375585016C389901DC9062,
+ F5375586016C389901DC9062,
+ F5375587016C389901DC9062,
+ F5375588016C389901DC9062,
+ F5375589016C389901DC9062,
+ F537558A016C389901DC9062,
+ F537558B016C389901DC9062,
+ F537558C016C389901DC9062,
+ F537558D016C389901DC9062,
+ F537558E016C389901DC9062,
+ F537558F016C389901DC9062,
+ F5375590016C389901DC9062,
+ F5375591016C389901DC9062,
+ F5375592016C389901DC9062,
+ F5375593016C389901DC9062,
+ F5375594016C389901DC9062,
+ F5375595016C389901DC9062,
+ F5375596016C389901DC9062,
+ F5375597016C389901DC9062,
+ F5375598016C389901DC9062,
+ F5375599016C389901DC9062,
+ F537559A016C389901DC9062,
+ F537559B016C389901DC9062,
+ F537559C016C389901DC9062,
+ F537559D016C389901DC9062,
+ F537559E016C389901DC9062,
+ F537559F016C389901DC9062,
+ F53755A0016C389901DC9062,
+ F53755A1016C389901DC9062,
+ F53755A2016C389901DC9062,
+ F53755A3016C389901DC9062,
+ F53755A4016C389901DC9062,
+ F53755A5016C389901DC9062,
+ F53755A6016C389901DC9062,
+ F53755A7016C389901DC9062,
+ F53755A8016C389901DC9062,
+ F53755A9016C389901DC9062,
+ F53755AA016C389901DC9062,
+ F53755AB016C389901DC9062,
+ F53755AC016C389901DC9062,
+ F53755AD016C389901DC9062,
+ F53755AE016C389901DC9062,
+ F53755AF016C389901DC9062,
+ F53755B0016C389901DC9062,
+ F53755B1016C389901DC9062,
+ F53755B2016C389901DC9062,
+ F55BC46802B2D38B01DC9062,
+ F53755B3016C389901DC9062,
+ F53755B4016C389901DC9062,
+ F53755B5016C389901DC9062,
+ F53755B6016C389901DC9062,
+ F53755B7016C389901DC9062,
+ F53755B8016C389901DC9062,
+ F53755B9016C389901DC9062,
+ F53755BA016C389901DC9062,
+ F53755BB016C389901DC9062,
+ F5BFE58B02F8C41501DC9062,
+ F53755BC016C389901DC9062,
+ F53755BD016C389901DC9062,
+ F53755BE016C389901DC9062,
+ F53755BF016C389901DC9062,
+ F53755C0016C389901DC9062,
+ F53755C1016C389901DC9062,
+ F53755C2016C389901DC9062,
+ F53755C3016C389901DC9062,
+ F53755C4016C389901DC9062,
+ F53755C5016C389901DC9062,
+ F5BFE58C02F8C41501DC9062,
+ F53755C6016C389901DC9062,
+ F53755C7016C389901DC9062,
+ F53755C8016C389901DC9062,
+ );
+ isa = PBXGroup;
+ name = Source;
+ refType = 4;
+ };
+ F5375531016C376E01DC9062 = {
+ children = (
+ F5375532016C376E01DC9062,
+ F537553B016C376E01DC9062,
+ );
+ isa = PBXGroup;
+ name = Resources;
+ refType = 4;
+ };
+ F5375532016C376E01DC9062 = {
+ children = (
+ F5375533016C376E01DC9062,
+ F5375534016C376E01DC9062,
+ F5375535016C376E01DC9062,
+ F5375536016C376E01DC9062,
+ F5375538016C376E01DC9062,
+ F5375539016C376E01DC9062,
+ F537553A016C376E01DC9062,
+ );
+ isa = PBXGroup;
+ name = "Resource Manager Resources";
+ refType = 4;
+ };
+ F5375533016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkAboutDlg.r;
+ refType = 4;
+ };
+ F5375534016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXApplication.r;
+ refType = 4;
+ };
+ F5375535016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXCursors.r;
+ refType = 4;
+ };
+ F5375536016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXLibrary.r;
+ refType = 4;
+ };
+ F5375538016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXMenu.r;
+ refType = 4;
+ };
+ F5375539016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXResource.r;
+ refType = 4;
+ };
+ F537553A016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXXCursors.r;
+ refType = 4;
+ };
+ F537553B016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = Wish.icns;
+ refType = 4;
+ };
+ F537553C016C376E01DC9062 = {
+ children = (
+ F537553D016C376E01DC9062,
+ F5375546016C376E01DC9062,
+ );
+ isa = PBXGroup;
+ name = "MacOS X";
+ refType = 4;
+ };
+ F537553D016C376E01DC9062 = {
+ children = (
+ F537553E016C376E01DC9062,
+ F537553F016C376E01DC9062,
+ F5375540016C376E01DC9062,
+ F5375541016C376E01DC9062,
+ F5375542016C376E01DC9062,
+ F5375543016C376E01DC9062,
+ F5375544016C376E01DC9062,
+ F5375545016C376E01DC9062,
+ );
+ isa = PBXGroup;
+ name = Headers;
+ refType = 4;
+ };
+ F537553E016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSX.h;
+ refType = 2;
+ };
+ F537553F016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXDebug.h;
+ refType = 2;
+ };
+ F5375540016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXDefault.h;
+ refType = 2;
+ };
+ F5375541016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXEvent.h;
+ refType = 2;
+ };
+ F5375542016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXInt.h;
+ refType = 2;
+ };
+ F5375543016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXPort.h;
+ refType = 2;
+ };
+ F5375544016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXUtil.h;
+ refType = 2;
+ };
+ F5375545016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXWm.h;
+ refType = 2;
+ };
+ F5375546016C376E01DC9062 = {
+ children = (
+ F5375548016C376E01DC9062,
+ F5375549016C376E01DC9062,
+ F537554A016C376E01DC9062,
+ F537554B016C376E01DC9062,
+ F537554C016C376E01DC9062,
+ F537554D016C376E01DC9062,
+ F537554E016C376E01DC9062,
+ F537554F016C376E01DC9062,
+ F5375550016C376E01DC9062,
+ F5375551016C376E01DC9062,
+ F5375552016C376E01DC9062,
+ F5375553016C376E01DC9062,
+ F5375554016C376E01DC9062,
+ F5375555016C376E01DC9062,
+ F5375556016C376E01DC9062,
+ F5375557016C376E01DC9062,
+ F5375558016C376E01DC9062,
+ F5375559016C376E01DC9062,
+ F537555A016C376E01DC9062,
+ F537555B016C376E01DC9062,
+ F537555C016C376E01DC9062,
+ F537555D016C376E01DC9062,
+ F537555E016C376E01DC9062,
+ F5375560016C376E01DC9062,
+ F5375561016C376E01DC9062,
+ F5375562016C376E01DC9062,
+ F5375563016C376E01DC9062,
+ F5375564016C376E01DC9062,
+ F5375565016C376E01DC9062,
+ F5375567016C376E01DC9062,
+ F5375568016C376E01DC9062,
+ );
+ isa = PBXGroup;
+ name = Source;
+ refType = 4;
+ };
+ F5375548016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXAppInit.c;
+ refType = 4;
+ };
+ F5375549016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXBitmap.c;
+ refType = 4;
+ };
+ F537554A016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXButton.c;
+ refType = 4;
+ };
+ F537554B016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXClipboard.c;
+ refType = 4;
+ };
+ F537554C016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXColor.c;
+ refType = 4;
+ };
+ F537554D016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXConfig.c;
+ refType = 4;
+ };
+ F537554E016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXCursor.c;
+ refType = 4;
+ };
+ F537554F016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXDebug.c;
+ refType = 4;
+ };
+ F5375550016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXDialog.c;
+ refType = 4;
+ };
+ F5375551016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXDraw.c;
+ refType = 4;
+ };
+ F5375552016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXEmbed.c;
+ refType = 4;
+ };
+ F5375553016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXEvent.c;
+ refType = 4;
+ };
+ F5375554016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXFont.c;
+ refType = 4;
+ };
+ F5375555016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXHLEvents.c;
+ refType = 4;
+ };
+ F5375556016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXInit.c;
+ refType = 4;
+ };
+ F5375557016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXKeyboard.c;
+ refType = 4;
+ };
+ F5375558016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXKeyEvent.c;
+ refType = 4;
+ };
+ F5375559016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXMenu.c;
+ refType = 4;
+ };
+ F537555A016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXMenubutton.c;
+ refType = 4;
+ };
+ F537555B016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXMenus.c;
+ refType = 4;
+ };
+ F537555C016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXMouseEvent.c;
+ refType = 4;
+ };
+ F537555D016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXNotify.c;
+ refType = 4;
+ };
+ F537555E016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXRegion.c;
+ refType = 4;
+ };
+ F5375560016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXScrlbr.c;
+ refType = 4;
+ };
+ F5375561016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXSend.c;
+ refType = 4;
+ };
+ F5375562016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXSubwindows.c;
+ refType = 4;
+ };
+ F5375563016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXTest.c;
+ refType = 4;
+ };
+ F5375564016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXUtil.c;
+ refType = 4;
+ };
+ F5375565016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXWindowEvent.c;
+ refType = 4;
+ };
+ F5375567016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXWm.c;
+ refType = 4;
+ };
+ F5375568016C376E01DC9062 = {
+ isa = PBXFileReference;
+ path = tkMacOSXXStubs.c;
+ refType = 4;
+ };
+ F5375569016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = default.h;
+ path = ../generic/default.h;
+ refType = 2;
+ };
+ F537556A016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = ks_names.h;
+ path = ../generic/ks_names.h;
+ refType = 2;
+ };
+ F537556B016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tk.h;
+ path = ../generic/tk.h;
+ refType = 2;
+ };
+ F537556C016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tk3d.h;
+ path = ../generic/tk3d.h;
+ refType = 2;
+ };
+ F537556D016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkButton.h;
+ path = ../generic/tkButton.h;
+ refType = 2;
+ };
+ F537556E016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvas.h;
+ path = ../generic/tkCanvas.h;
+ refType = 2;
+ };
+ F537556F016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkColor.h;
+ path = ../generic/tkColor.h;
+ refType = 2;
+ };
+ F5375570016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkDecls.h;
+ path = ../generic/tkDecls.h;
+ refType = 2;
+ };
+ F5375571016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkFileFilter.h;
+ path = ../generic/tkFileFilter.h;
+ refType = 2;
+ };
+ F5375572016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkFont.h;
+ path = ../generic/tkFont.h;
+ refType = 2;
+ };
+ F5375573016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkInitScript.h;
+ path = ../generic/tkInitScript.h;
+ refType = 2;
+ };
+ F5375574016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkInt.h;
+ path = ../generic/tkInt.h;
+ refType = 2;
+ };
+ F5375575016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkIntDecls.h;
+ path = ../generic/tkIntDecls.h;
+ refType = 2;
+ };
+ F5375576016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkIntPlatDecls.h;
+ path = ../generic/tkIntPlatDecls.h;
+ refType = 2;
+ };
+ F5375577016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkIntXlibDecls.h;
+ path = ../generic/tkIntXlibDecls.h;
+ refType = 2;
+ };
+ F5375578016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkMenu.h;
+ path = ../generic/tkMenu.h;
+ refType = 2;
+ };
+ F5375579016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkMenubutton.h;
+ path = ../generic/tkMenubutton.h;
+ refType = 2;
+ };
+ F537557A016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkPlatDecls.h;
+ path = ../generic/tkPlatDecls.h;
+ refType = 2;
+ };
+ F537557B016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkPort.h;
+ path = ../generic/tkPort.h;
+ refType = 2;
+ };
+ F537557C016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkScale.h;
+ path = ../generic/tkScale.h;
+ refType = 2;
+ };
+ F537557D016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkScrollbar.h;
+ path = ../generic/tkScrollbar.h;
+ refType = 2;
+ };
+ F537557E016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkSelect.h;
+ path = ../generic/tkSelect.h;
+ refType = 2;
+ };
+ F537557F016C37A601DC9062 = {
+ isa = PBXFileReference;
+ name = tkText.h;
+ path = ../generic/tkText.h;
+ refType = 2;
+ };
+ F5375580016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tk3d.c;
+ path = ../generic/tk3d.c;
+ refType = 2;
+ };
+ F5375581016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkArgv.c;
+ path = ../generic/tkArgv.c;
+ refType = 2;
+ };
+ F5375582016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkAtom.c;
+ path = ../generic/tkAtom.c;
+ refType = 2;
+ };
+ F5375583016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkBind.c;
+ path = ../generic/tkBind.c;
+ refType = 2;
+ };
+ F5375584016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkBitmap.c;
+ path = ../generic/tkBitmap.c;
+ refType = 2;
+ };
+ F5375585016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkButton.c;
+ path = ../generic/tkButton.c;
+ refType = 2;
+ };
+ F5375586016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvArc.c;
+ path = ../generic/tkCanvArc.c;
+ refType = 2;
+ };
+ F5375587016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvas.c;
+ path = ../generic/tkCanvas.c;
+ refType = 2;
+ };
+ F5375588016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvBmap.c;
+ path = ../generic/tkCanvBmap.c;
+ refType = 2;
+ };
+ F5375589016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvImg.c;
+ path = ../generic/tkCanvImg.c;
+ refType = 2;
+ };
+ F537558A016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvLine.c;
+ path = ../generic/tkCanvLine.c;
+ refType = 2;
+ };
+ F537558B016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvPoly.c;
+ path = ../generic/tkCanvPoly.c;
+ refType = 2;
+ };
+ F537558C016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvPs.c;
+ path = ../generic/tkCanvPs.c;
+ refType = 2;
+ };
+ F537558D016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvText.c;
+ path = ../generic/tkCanvText.c;
+ refType = 2;
+ };
+ F537558E016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvUtil.c;
+ path = ../generic/tkCanvUtil.c;
+ refType = 2;
+ };
+ F537558F016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCanvWind.c;
+ path = ../generic/tkCanvWind.c;
+ refType = 2;
+ };
+ F5375590016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkClipboard.c;
+ path = ../generic/tkClipboard.c;
+ refType = 2;
+ };
+ F5375591016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCmds.c;
+ path = ../generic/tkCmds.c;
+ refType = 2;
+ };
+ F5375592016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkColor.c;
+ path = ../generic/tkColor.c;
+ refType = 2;
+ };
+ F5375593016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkConfig.c;
+ path = ../generic/tkConfig.c;
+ refType = 2;
+ };
+ F5375594016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkConsole.c;
+ path = ../generic/tkConsole.c;
+ refType = 2;
+ };
+ F5375595016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkCursor.c;
+ path = ../generic/tkCursor.c;
+ refType = 2;
+ };
+ F5375596016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkEntry.c;
+ path = ../generic/tkEntry.c;
+ refType = 2;
+ };
+ F5375597016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkError.c;
+ path = ../generic/tkError.c;
+ refType = 2;
+ };
+ F5375598016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkEvent.c;
+ path = ../generic/tkEvent.c;
+ refType = 2;
+ };
+ F5375599016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkFileFilter.c;
+ path = ../generic/tkFileFilter.c;
+ refType = 2;
+ };
+ F537559A016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkFocus.c;
+ path = ../generic/tkFocus.c;
+ refType = 2;
+ };
+ F537559B016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkFont.c;
+ path = ../generic/tkFont.c;
+ refType = 2;
+ };
+ F537559C016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkFrame.c;
+ path = ../generic/tkFrame.c;
+ refType = 2;
+ };
+ F537559D016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkGC.c;
+ path = ../generic/tkGC.c;
+ refType = 2;
+ };
+ F537559E016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkGeometry.c;
+ path = ../generic/tkGeometry.c;
+ refType = 2;
+ };
+ F537559F016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkGet.c;
+ path = ../generic/tkGet.c;
+ refType = 2;
+ };
+ F53755A0016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkGrab.c;
+ path = ../generic/tkGrab.c;
+ refType = 2;
+ };
+ F53755A1016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkGrid.c;
+ path = ../generic/tkGrid.c;
+ refType = 2;
+ };
+ F53755A2016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkImage.c;
+ path = ../generic/tkImage.c;
+ refType = 2;
+ };
+ F53755A3016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkImgBmap.c;
+ path = ../generic/tkImgBmap.c;
+ refType = 2;
+ };
+ F53755A4016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkImgGIF.c;
+ path = ../generic/tkImgGIF.c;
+ refType = 2;
+ };
+ F53755A5016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkImgPhoto.c;
+ path = ../generic/tkImgPhoto.c;
+ refType = 2;
+ };
+ F53755A6016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkImgPPM.c;
+ path = ../generic/tkImgPPM.c;
+ refType = 2;
+ };
+ F53755A7016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkImgUtil.c;
+ path = ../generic/tkImgUtil.c;
+ refType = 2;
+ };
+ F53755A8016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkListbox.c;
+ path = ../generic/tkListbox.c;
+ refType = 2;
+ };
+ F53755A9016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkMacWinMenu.c;
+ path = ../generic/tkMacWinMenu.c;
+ refType = 2;
+ };
+ F53755AA016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkMain.c;
+ path = ../generic/tkMain.c;
+ refType = 2;
+ };
+ F53755AB016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkMenu.c;
+ path = ../generic/tkMenu.c;
+ refType = 2;
+ };
+ F53755AC016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkMenubutton.c;
+ path = ../generic/tkMenubutton.c;
+ refType = 2;
+ };
+ F53755AD016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkMenuDraw.c;
+ path = ../generic/tkMenuDraw.c;
+ refType = 2;
+ };
+ F53755AE016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkMessage.c;
+ path = ../generic/tkMessage.c;
+ refType = 2;
+ };
+ F53755AF016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkObj.c;
+ path = ../generic/tkObj.c;
+ refType = 2;
+ };
+ F53755B0016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkOldConfig.c;
+ path = ../generic/tkOldConfig.c;
+ refType = 2;
+ };
+ F53755B1016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkOption.c;
+ path = ../generic/tkOption.c;
+ refType = 2;
+ };
+ F53755B2016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkPack.c;
+ path = ../generic/tkPack.c;
+ refType = 2;
+ };
+ F53755B3016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkPlace.c;
+ path = ../generic/tkPlace.c;
+ refType = 2;
+ };
+ F53755B4016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkPointer.c;
+ path = ../generic/tkPointer.c;
+ refType = 2;
+ };
+ F53755B5016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkRectOval.c;
+ path = ../generic/tkRectOval.c;
+ refType = 2;
+ };
+ F53755B6016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkScale.c;
+ path = ../generic/tkScale.c;
+ refType = 2;
+ };
+ F53755B7016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkScrollbar.c;
+ path = ../generic/tkScrollbar.c;
+ refType = 2;
+ };
+ F53755B8016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkSelect.c;
+ path = ../generic/tkSelect.c;
+ refType = 2;
+ };
+ F53755B9016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkStubImg.c;
+ path = ../generic/tkStubImg.c;
+ refType = 2;
+ };
+ F53755BA016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkStubInit.c;
+ path = ../generic/tkStubInit.c;
+ refType = 2;
+ };
+ F53755BB016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkStubLib.c;
+ path = ../generic/tkStubLib.c;
+ refType = 2;
+ };
+ F53755BC016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTest.c;
+ path = ../generic/tkTest.c;
+ refType = 2;
+ };
+ F53755BD016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkText.c;
+ path = ../generic/tkText.c;
+ refType = 2;
+ };
+ F53755BE016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTextBTree.c;
+ path = ../generic/tkTextBTree.c;
+ refType = 2;
+ };
+ F53755BF016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTextDisp.c;
+ path = ../generic/tkTextDisp.c;
+ refType = 2;
+ };
+ F53755C0016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTextImage.c;
+ path = ../generic/tkTextImage.c;
+ refType = 2;
+ };
+ F53755C1016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTextIndex.c;
+ path = ../generic/tkTextIndex.c;
+ refType = 2;
+ };
+ F53755C2016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTextMark.c;
+ path = ../generic/tkTextMark.c;
+ refType = 2;
+ };
+ F53755C3016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTextTag.c;
+ path = ../generic/tkTextTag.c;
+ refType = 2;
+ };
+ F53755C4016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTextWind.c;
+ path = ../generic/tkTextWind.c;
+ refType = 2;
+ };
+ F53755C5016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkTrig.c;
+ path = ../generic/tkTrig.c;
+ refType = 2;
+ };
+ F53755C6016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkUtil.c;
+ path = ../generic/tkUtil.c;
+ refType = 2;
+ };
+ F53755C7016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkVisual.c;
+ path = ../generic/tkVisual.c;
+ refType = 2;
+ };
+ F53755C8016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkWindow.c;
+ path = ../generic/tkWindow.c;
+ refType = 2;
+ };
+ F53755C9016C389901DC9062 = {
+ children = (
+ F53755CA016C389901DC9062,
+ F53755CB016C389901DC9062,
+ );
+ isa = PBXGroup;
+ name = Unix;
+ refType = 4;
+ };
+ F53755CA016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkUnix3d.c;
+ path = ../unix/tkUnix3d.c;
+ refType = 2;
+ };
+ F53755CB016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = tkUnixScale.c;
+ path = ../unix/tkUnixScale.c;
+ refType = 2;
+ };
+ F53755CC016C389901DC9062 = {
+ children = (
+ F53755CD016C389901DC9062,
+ F53755D7016C389901DC9062,
+ );
+ isa = PBXGroup;
+ name = "X Emulation";
+ refType = 4;
+ };
+ F53755CD016C389901DC9062 = {
+ children = (
+ F53755CE016C389901DC9062,
+ F53755CF016C389901DC9062,
+ F53755D0016C389901DC9062,
+ F53755D1016C389901DC9062,
+ F53755D2016C389901DC9062,
+ F53755D3016C389901DC9062,
+ F53755D4016C389901DC9062,
+ F53755D5016C389901DC9062,
+ F53755D6016C389901DC9062,
+ );
+ isa = PBXGroup;
+ name = Headers;
+ refType = 4;
+ };
+ F53755CE016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = xbytes.h;
+ path = ../xlib/xbytes.h;
+ refType = 2;
+ };
+ F53755CF016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = cursorfont.h;
+ path = ../xlib/X11/cursorfont.h;
+ refType = 2;
+ };
+ F53755D0016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = keysym.h;
+ path = ../xlib/X11/keysym.h;
+ refType = 2;
+ };
+ F53755D1016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = keysymdef.h;
+ path = ../xlib/X11/keysymdef.h;
+ refType = 2;
+ };
+ F53755D2016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = X.h;
+ path = ../xlib/X11/X.h;
+ refType = 2;
+ };
+ F53755D3016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = Xatom.h;
+ path = ../xlib/X11/Xatom.h;
+ refType = 2;
+ };
+ F53755D4016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = Xfuncproto.h;
+ path = ../xlib/X11/Xfuncproto.h;
+ refType = 2;
+ };
+ F53755D5016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = Xlib.h;
+ path = ../xlib/X11/Xlib.h;
+ refType = 2;
+ };
+ F53755D6016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = Xutil.h;
+ path = ../xlib/X11/Xutil.h;
+ refType = 2;
+ };
+ F53755D7016C389901DC9062 = {
+ children = (
+ F53755D8016C389901DC9062,
+ F53755D9016C389901DC9062,
+ F53755DA016C389901DC9062,
+ F53755DB016C389901DC9062,
+ F53755DC016C389901DC9062,
+ );
+ isa = PBXGroup;
+ name = Source;
+ refType = 4;
+ };
+ F53755D8016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = xcolors.c;
+ path = ../xlib/xcolors.c;
+ refType = 2;
+ };
+ F53755D9016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = xdraw.c;
+ path = ../xlib/xdraw.c;
+ refType = 2;
+ };
+ F53755DA016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = xgc.c;
+ path = ../xlib/xgc.c;
+ refType = 2;
+ };
+ F53755DB016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = ximage.c;
+ path = ../xlib/ximage.c;
+ refType = 2;
+ };
+ F53755DC016C389901DC9062 = {
+ isa = PBXFileReference;
+ name = xutil.c;
+ path = ../xlib/xutil.c;
+ refType = 2;
+ };
+ F53755DD016C38D201DC9062 = {
+ children = (
+ F53755DE016C38D201DC9062,
+ F537569F016C4DD401DC9062,
+ F548F8CF0313CEF0016F146B,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ };
+ F53755DE016C38D201DC9062 = {
+ isa = PBXFrameworkReference;
+ path = Tk.framework;
+ refType = 3;
+ };
+ F53755DF016C38D201DC9062 = {
+ buildPhases = (
+ F5877FB7031F97ED016F146B,
+ F53755E0016C38D201DC9062,
+ F53755E1016C38D301DC9062,
+ F53755E2016C38D301DC9062,
+ F53755E3016C38D301DC9062,
+ F53755E4016C38D301DC9062,
+ F5B1FC08016FFE3501DC9062,
+ F51D903F018149BD01DC9062,
+ F548F8C80313C9E0016F146B,
+ F52D38C5031F4259016F146B,
+ F5877FBC031FA968016F146B,
+ F5C1D51901B88F9A01DC9062,
+ );
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 8.4;
+ DYLIB_CURRENT_VERSION = 8.4;
+ DYLIB_INSTALL_PATH = /Library/Frameworks;
+ FRAMEWORK_SEARCH_PATHS = "\"$(SYMROOT)\"";
+ FRAMEWORK_VERSION = 8.4;
+ GLOBAL_CFLAGS = "`source \"${SYMROOT}/Tcl.framework/Resources/tclConfig.sh\"; echo $${}{TCL_EXTRA_CFLAGS} $${}{TCL_DEFS} | sed -e 's|\\\\\\\\\\\\\\\"|\\\"|g' | sed -e 's| -DTCL_WIDE_INT_TYPE=long. long||'` -U_REENTRANT";
+ HEADER_SEARCH_PATHS = "../../tcl/generic ../../tcl/unix ../bitmaps ../generic ../xlib";
+ INSTALL_PATH = "${DYLIB_INSTALL_PATH}";
+ LIBRARY_SEARCH_PATHS = "";
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "-DMAC_OSX_TK -DTCL_WIDE_INT_TYPE=\"long long\"";
+ OTHER_LDFLAGS = "-seg1addr 0xb000000";
+ OTHER_LIBTOOL_FLAGS = "";
+ OTHER_REZFLAGS = "-i \"../../tcl/generic\" -i \"../generic\"";
+ PRINCIPAL_CLASS = "";
+ PRODUCT_NAME = Tk;
+ SECTORDER_FLAGS = "";
+ TK_MAJOR_VERSION = 8;
+ TK_MINOR_VERSION = 4;
+ TK_PATCH_LEVEL = .0;
+ TK_VERSION = 8.4;
+ USE_GCC3_PFE_SUPPORT = NO;
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = framework;
+ };
+ dependencies = (
+ F548F8D20313CF93016F146B,
+ );
+ isa = PBXFrameworkTarget;
+ name = TkLibrary;
+ productInstallPath = /Library/Frameworks;
+ productName = TkLibrary;
+ productReference = F53755DE016C38D201DC9062;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Tk</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Tk Library 8.4, Copyright © 2002 Tcl Core Team.
+MacOS X Port by Jim Ingham &lt;jingham@apple.com&gt; &amp; Ian Reid, Copyright © 2001-2002, Apple Computer, Inc.</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.tcltk.tklibrary</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Tk Library 8.4</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>8.4.0</string>
+ <key>CFBundleSignature</key>
+ <string>WiSH</string>
+ <key>CFBundleVersion</key>
+ <string>8.4.0</string>
+</dict>
+</plist>
+";
+ shouldUseHeadermap = 0;
+ };
+ F53755E0016C38D201DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F53755E5016C390401DC9062,
+ F53755E6016C390401DC9062,
+ F53755E7016C390401DC9062,
+ F53755E8016C390401DC9062,
+ F53755E9016C390401DC9062,
+ F53755EA016C390401DC9062,
+ F53755EB016C390401DC9062,
+ F53755EC016C390401DC9062,
+ F53755ED016C390401DC9062,
+ F53755EE016C390401DC9062,
+ F53755EF016C390401DC9062,
+ F53755F0016C390401DC9062,
+ F53755F1016C390401DC9062,
+ F53755F2016C390401DC9062,
+ F53755F3016C390401DC9062,
+ F53755F4016C390401DC9062,
+ F53755F5016C390401DC9062,
+ F53755F6016C390401DC9062,
+ F53755F7016C390401DC9062,
+ F53755F8016C390401DC9062,
+ F53755F9016C390401DC9062,
+ F53755FA016C390401DC9062,
+ F53755FB016C390401DC9062,
+ F53755FC016C397D01DC9062,
+ F53755FD016C397D01DC9062,
+ F53755FE016C397D01DC9062,
+ F53755FF016C397D01DC9062,
+ F5375600016C397D01DC9062,
+ F5375601016C397D01DC9062,
+ F5375602016C397D01DC9062,
+ F5375603016C397D01DC9062,
+ F537566E016C3A1F01DC9062,
+ F537566F016C3A1F01DC9062,
+ F5375670016C3A1F01DC9062,
+ F5375671016C3A1F01DC9062,
+ F5375672016C3A1F01DC9062,
+ F5375673016C3A1F01DC9062,
+ F5375674016C3A1F01DC9062,
+ F5375675016C3A1F01DC9062,
+ F5375676016C3A1F01DC9062,
+ F5375693016C3F1001DC9062,
+ F5375694016C3F1001DC9062,
+ F5375695016C3F1001DC9062,
+ F5375696016C3F1001DC9062,
+ F5375697016C3F1001DC9062,
+ F5375698016C3F1001DC9062,
+ F5375699016C3F1001DC9062,
+ F537569A016C3F1001DC9062,
+ F537569B016C3F1001DC9062,
+ F537569C016C3F1001DC9062,
+ F5BFE59002F8C45B01DC9062,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53755E1016C38D301DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53755E2016C38D301DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F5375604016C397D01DC9062,
+ F5375605016C397D01DC9062,
+ F5375606016C397D01DC9062,
+ F5375607016C397D01DC9062,
+ F5375608016C397D01DC9062,
+ F5375609016C397D01DC9062,
+ F537560A016C397D01DC9062,
+ F537560B016C397D01DC9062,
+ F537560C016C397D01DC9062,
+ F537560D016C397D01DC9062,
+ F537560E016C397D01DC9062,
+ F537560F016C397D01DC9062,
+ F5375610016C397D01DC9062,
+ F5375611016C397D01DC9062,
+ F5375612016C397D01DC9062,
+ F5375613016C397D01DC9062,
+ F5375614016C397D01DC9062,
+ F5375615016C397D01DC9062,
+ F5375616016C397D01DC9062,
+ F5375617016C397D01DC9062,
+ F5375618016C397D01DC9062,
+ F5375619016C397D01DC9062,
+ F537561A016C397D01DC9062,
+ F537561B016C397D01DC9062,
+ F537561C016C397D01DC9062,
+ F537561D016C397D01DC9062,
+ F537561E016C397D01DC9062,
+ F537561F016C397D01DC9062,
+ F5375620016C397D01DC9062,
+ F5375621016C397D01DC9062,
+ F5375622016C397D01DC9062,
+ F5375623016C397D01DC9062,
+ F5375624016C397D01DC9062,
+ F5375625016C397D01DC9062,
+ F5375626016C397D01DC9062,
+ F5375627016C397D01DC9062,
+ F5375628016C397D01DC9062,
+ F5375629016C397D01DC9062,
+ F537562A016C397D01DC9062,
+ F537562B016C397D01DC9062,
+ F537562C016C397D01DC9062,
+ F537562D016C397D01DC9062,
+ F537562E016C397D01DC9062,
+ F537562F016C397D01DC9062,
+ F5375630016C397D01DC9062,
+ F5375631016C397D01DC9062,
+ F5375632016C397D01DC9062,
+ F5375633016C397D01DC9062,
+ F5375634016C397D01DC9062,
+ F5375635016C397D01DC9062,
+ F5375636016C397D01DC9062,
+ F5375637016C397D01DC9062,
+ F5375638016C397D01DC9062,
+ F5375639016C397D01DC9062,
+ F537563A016C397D01DC9062,
+ F537563B016C397D01DC9062,
+ F537563C016C397D01DC9062,
+ F537563D016C397D01DC9062,
+ F537563F016C397D01DC9062,
+ F5375640016C397D01DC9062,
+ F5375641016C397D01DC9062,
+ F5375642016C397D01DC9062,
+ F5375643016C397D01DC9062,
+ F5375644016C397D01DC9062,
+ F5375645016C397D01DC9062,
+ F5375646016C397D01DC9062,
+ F5375647016C397D01DC9062,
+ F5375648016C397D01DC9062,
+ F5375649016C397D01DC9062,
+ F537564A016C397D01DC9062,
+ F537564D016C39A101DC9062,
+ F537564E016C39A101DC9062,
+ F537564F016C39A101DC9062,
+ F5375650016C39A101DC9062,
+ F5375651016C39A101DC9062,
+ F5375652016C39A101DC9062,
+ F5375653016C39A101DC9062,
+ F5375654016C39A101DC9062,
+ F5375655016C39A101DC9062,
+ F5375656016C39A101DC9062,
+ F5375657016C39A101DC9062,
+ F5375658016C39A101DC9062,
+ F5375659016C39A101DC9062,
+ F537565A016C39A101DC9062,
+ F537565B016C39A101DC9062,
+ F537565C016C39A101DC9062,
+ F537565D016C39A101DC9062,
+ F537565E016C39A101DC9062,
+ F537565F016C39A101DC9062,
+ F5375660016C39A101DC9062,
+ F5375661016C39A101DC9062,
+ F5375662016C39A101DC9062,
+ F5375664016C39A101DC9062,
+ F5375665016C39A101DC9062,
+ F5375666016C39A101DC9062,
+ F5375667016C39A101DC9062,
+ F5375668016C39A101DC9062,
+ F537566A016C39A101DC9062,
+ F537566B016C39A101DC9062,
+ F537566C016C39F201DC9062,
+ F537566D016C39F201DC9062,
+ F5375677016C3A6D01DC9062,
+ F5375678016C3A6D01DC9062,
+ F5375679016C3A6D01DC9062,
+ F537567A016C3A6D01DC9062,
+ F537567B016C3A6D01DC9062,
+ F537569E016C49C301DC9062,
+ F55BC46902B2D38B01DC9062,
+ F5BFE58D02F8C41501DC9062,
+ F5BFE58E02F8C41501DC9062,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53755E3016C38D301DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F51D903E0181474301DC9062,
+ F537567E016C3ADB01DC9062,
+ F50D96130196176E01DC9062,
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53755E4016C38D301DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F537567F016C3ADB01DC9062,
+ F5375680016C3ADB01DC9062,
+ F5375681016C3ADB01DC9062,
+ F5375682016C3ADB01DC9062,
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53755E5016C390401DC9062 = {
+ fileRef = F5375569016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755E6016C390401DC9062 = {
+ fileRef = F537556A016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755E7016C390401DC9062 = {
+ fileRef = F537556B016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ F53755E8016C390401DC9062 = {
+ fileRef = F537556C016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755E9016C390401DC9062 = {
+ fileRef = F537556D016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755EA016C390401DC9062 = {
+ fileRef = F537556E016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755EB016C390401DC9062 = {
+ fileRef = F537556F016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755EC016C390401DC9062 = {
+ fileRef = F5375570016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ F53755ED016C390401DC9062 = {
+ fileRef = F5375571016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755EE016C390401DC9062 = {
+ fileRef = F5375572016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755EF016C390401DC9062 = {
+ fileRef = F5375573016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755F0016C390401DC9062 = {
+ fileRef = F5375574016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ F53755F1016C390401DC9062 = {
+ fileRef = F5375575016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ F53755F2016C390401DC9062 = {
+ fileRef = F5375576016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ F53755F3016C390401DC9062 = {
+ fileRef = F5375577016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ F53755F4016C390401DC9062 = {
+ fileRef = F5375578016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755F5016C390401DC9062 = {
+ fileRef = F5375579016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755F6016C390401DC9062 = {
+ fileRef = F537557A016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ F53755F7016C390401DC9062 = {
+ fileRef = F537557B016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755F8016C390401DC9062 = {
+ fileRef = F537557C016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755F9016C390401DC9062 = {
+ fileRef = F537557D016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755FA016C390401DC9062 = {
+ fileRef = F537557E016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755FB016C390401DC9062 = {
+ fileRef = F537557F016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755FC016C397D01DC9062 = {
+ fileRef = F537553E016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ F53755FD016C397D01DC9062 = {
+ fileRef = F537553F016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755FE016C397D01DC9062 = {
+ fileRef = F5375540016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53755FF016C397D01DC9062 = {
+ fileRef = F5375541016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375600016C397D01DC9062 = {
+ fileRef = F5375542016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ F5375601016C397D01DC9062 = {
+ fileRef = F5375543016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375602016C397D01DC9062 = {
+ fileRef = F5375544016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375603016C397D01DC9062 = {
+ fileRef = F5375545016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375604016C397D01DC9062 = {
+ fileRef = F5375580016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375605016C397D01DC9062 = {
+ fileRef = F5375581016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375606016C397D01DC9062 = {
+ fileRef = F5375582016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375607016C397D01DC9062 = {
+ fileRef = F5375583016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375608016C397D01DC9062 = {
+ fileRef = F5375584016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375609016C397D01DC9062 = {
+ fileRef = F5375585016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537560A016C397D01DC9062 = {
+ fileRef = F5375586016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537560B016C397D01DC9062 = {
+ fileRef = F5375587016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537560C016C397D01DC9062 = {
+ fileRef = F5375588016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537560D016C397D01DC9062 = {
+ fileRef = F5375589016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537560E016C397D01DC9062 = {
+ fileRef = F537558A016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537560F016C397D01DC9062 = {
+ fileRef = F537558B016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375610016C397D01DC9062 = {
+ fileRef = F537558C016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375611016C397D01DC9062 = {
+ fileRef = F537558D016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375612016C397D01DC9062 = {
+ fileRef = F537558E016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375613016C397D01DC9062 = {
+ fileRef = F537558F016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375614016C397D01DC9062 = {
+ fileRef = F5375590016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375615016C397D01DC9062 = {
+ fileRef = F5375591016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375616016C397D01DC9062 = {
+ fileRef = F5375592016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375617016C397D01DC9062 = {
+ fileRef = F5375593016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375618016C397D01DC9062 = {
+ fileRef = F5375594016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375619016C397D01DC9062 = {
+ fileRef = F5375595016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537561A016C397D01DC9062 = {
+ fileRef = F5375596016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537561B016C397D01DC9062 = {
+ fileRef = F5375597016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537561C016C397D01DC9062 = {
+ fileRef = F5375598016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537561D016C397D01DC9062 = {
+ fileRef = F5375599016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537561E016C397D01DC9062 = {
+ fileRef = F537559A016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537561F016C397D01DC9062 = {
+ fileRef = F537559B016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375620016C397D01DC9062 = {
+ fileRef = F537559C016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375621016C397D01DC9062 = {
+ fileRef = F537559D016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375622016C397D01DC9062 = {
+ fileRef = F537559E016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375623016C397D01DC9062 = {
+ fileRef = F537559F016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375624016C397D01DC9062 = {
+ fileRef = F53755A0016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375625016C397D01DC9062 = {
+ fileRef = F53755A1016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375626016C397D01DC9062 = {
+ fileRef = F53755A2016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375627016C397D01DC9062 = {
+ fileRef = F53755A3016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375628016C397D01DC9062 = {
+ fileRef = F53755A4016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375629016C397D01DC9062 = {
+ fileRef = F53755A5016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537562A016C397D01DC9062 = {
+ fileRef = F53755A6016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537562B016C397D01DC9062 = {
+ fileRef = F53755A7016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537562C016C397D01DC9062 = {
+ fileRef = F53755A8016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537562D016C397D01DC9062 = {
+ fileRef = F53755A9016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537562E016C397D01DC9062 = {
+ fileRef = F53755AA016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537562F016C397D01DC9062 = {
+ fileRef = F53755AB016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375630016C397D01DC9062 = {
+ fileRef = F53755AC016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375631016C397D01DC9062 = {
+ fileRef = F53755AD016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375632016C397D01DC9062 = {
+ fileRef = F53755AE016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375633016C397D01DC9062 = {
+ fileRef = F53755AF016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375634016C397D01DC9062 = {
+ fileRef = F53755B0016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375635016C397D01DC9062 = {
+ fileRef = F53755B1016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375636016C397D01DC9062 = {
+ fileRef = F53755B2016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375637016C397D01DC9062 = {
+ fileRef = F53755B3016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375638016C397D01DC9062 = {
+ fileRef = F53755B4016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375639016C397D01DC9062 = {
+ fileRef = F53755B5016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537563A016C397D01DC9062 = {
+ fileRef = F53755B6016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537563B016C397D01DC9062 = {
+ fileRef = F53755B7016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537563C016C397D01DC9062 = {
+ fileRef = F53755B8016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537563D016C397D01DC9062 = {
+ fileRef = F53755BA016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537563F016C397D01DC9062 = {
+ fileRef = F53755BD016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375640016C397D01DC9062 = {
+ fileRef = F53755BE016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375641016C397D01DC9062 = {
+ fileRef = F53755BF016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375642016C397D01DC9062 = {
+ fileRef = F53755C0016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375643016C397D01DC9062 = {
+ fileRef = F53755C1016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375644016C397D01DC9062 = {
+ fileRef = F53755C2016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375645016C397D01DC9062 = {
+ fileRef = F53755C3016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375646016C397D01DC9062 = {
+ fileRef = F53755C4016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375647016C397D01DC9062 = {
+ fileRef = F53755C5016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375648016C397D01DC9062 = {
+ fileRef = F53755C6016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375649016C397D01DC9062 = {
+ fileRef = F53755C7016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537564A016C397D01DC9062 = {
+ fileRef = F53755C8016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537564D016C39A101DC9062 = {
+ fileRef = F5375549016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537564E016C39A101DC9062 = {
+ fileRef = F537554A016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537564F016C39A101DC9062 = {
+ fileRef = F537554B016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375650016C39A101DC9062 = {
+ fileRef = F537554C016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375651016C39A101DC9062 = {
+ fileRef = F537554D016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375652016C39A101DC9062 = {
+ fileRef = F537554E016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375653016C39A101DC9062 = {
+ fileRef = F537554F016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375654016C39A101DC9062 = {
+ fileRef = F5375550016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375655016C39A101DC9062 = {
+ fileRef = F5375551016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375656016C39A101DC9062 = {
+ fileRef = F5375552016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375657016C39A101DC9062 = {
+ fileRef = F5375553016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375658016C39A101DC9062 = {
+ fileRef = F5375554016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375659016C39A101DC9062 = {
+ fileRef = F5375555016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537565A016C39A101DC9062 = {
+ fileRef = F5375556016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537565B016C39A101DC9062 = {
+ fileRef = F5375557016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537565C016C39A101DC9062 = {
+ fileRef = F5375558016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537565D016C39A101DC9062 = {
+ fileRef = F5375559016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537565E016C39A101DC9062 = {
+ fileRef = F537555A016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537565F016C39A101DC9062 = {
+ fileRef = F537555B016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375660016C39A101DC9062 = {
+ fileRef = F537555C016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375661016C39A101DC9062 = {
+ fileRef = F537555D016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375662016C39A101DC9062 = {
+ fileRef = F537555E016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375664016C39A101DC9062 = {
+ fileRef = F5375560016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375665016C39A101DC9062 = {
+ fileRef = F5375561016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375666016C39A101DC9062 = {
+ fileRef = F5375562016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375667016C39A101DC9062 = {
+ fileRef = F5375564016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375668016C39A101DC9062 = {
+ fileRef = F5375565016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537566A016C39A101DC9062 = {
+ fileRef = F5375567016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537566B016C39A101DC9062 = {
+ fileRef = F5375568016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537566C016C39F201DC9062 = {
+ fileRef = F53755CA016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537566D016C39F201DC9062 = {
+ fileRef = F53755CB016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537566E016C3A1F01DC9062 = {
+ fileRef = F53755CE016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ );
+ };
+ };
+ F537566F016C3A1F01DC9062 = {
+ fileRef = F53755CF016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ );
+ };
+ };
+ F5375670016C3A1F01DC9062 = {
+ fileRef = F53755D0016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ );
+ };
+ };
+ F5375671016C3A1F01DC9062 = {
+ fileRef = F53755D1016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375672016C3A1F01DC9062 = {
+ fileRef = F53755D2016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375673016C3A1F01DC9062 = {
+ fileRef = F53755D3016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375674016C3A1F01DC9062 = {
+ fileRef = F53755D4016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375675016C3A1F01DC9062 = {
+ fileRef = F53755D5016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375676016C3A1F01DC9062 = {
+ fileRef = F53755D6016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375677016C3A6D01DC9062 = {
+ fileRef = F53755D8016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375678016C3A6D01DC9062 = {
+ fileRef = F53755D9016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375679016C3A6D01DC9062 = {
+ fileRef = F53755DA016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537567A016C3A6D01DC9062 = {
+ fileRef = F53755DB016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537567B016C3A6D01DC9062 = {
+ fileRef = F53755DC016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537567C016C3ADB01DC9062 = {
+ children = (
+ F50D96120196176E01DC9062,
+ F5875C7B016FEF1D01DC9062,
+ F537567D016C3ADB01DC9062,
+ );
+ isa = PBXGroup;
+ name = "External Frameworks";
+ refType = 4;
+ };
+ F537567D016C3ADB01DC9062 = {
+ isa = PBXFrameworkReference;
+ name = Carbon.framework;
+ path = /System/Library/Frameworks/Carbon.framework;
+ refType = 0;
+ };
+ F537567E016C3ADB01DC9062 = {
+ fileRef = F537567D016C3ADB01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537567F016C3ADB01DC9062 = {
+ fileRef = F5375533016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375680016C3ADB01DC9062 = {
+ fileRef = F5375535016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375681016C3ADB01DC9062 = {
+ fileRef = F5375538016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375682016C3ADB01DC9062 = {
+ fileRef = F537553A016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375688016C3F1001DC9062 = {
+ children = (
+ F5375689016C3F1001DC9062,
+ F537568A016C3F1001DC9062,
+ F537568B016C3F1001DC9062,
+ F537568C016C3F1001DC9062,
+ F537568D016C3F1001DC9062,
+ F537568E016C3F1001DC9062,
+ F537568F016C3F1001DC9062,
+ F5375690016C3F1001DC9062,
+ F5375691016C3F1001DC9062,
+ F5375692016C3F1001DC9062,
+ );
+ isa = PBXGroup;
+ name = Bitmaps;
+ refType = 4;
+ };
+ F5375689016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = error.bmp;
+ path = ../bitmaps/error.bmp;
+ refType = 2;
+ };
+ F537568A016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = gray12.bmp;
+ path = ../bitmaps/gray12.bmp;
+ refType = 2;
+ };
+ F537568B016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = gray25.bmp;
+ path = ../bitmaps/gray25.bmp;
+ refType = 2;
+ };
+ F537568C016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = gray50.bmp;
+ path = ../bitmaps/gray50.bmp;
+ refType = 2;
+ };
+ F537568D016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = gray75.bmp;
+ path = ../bitmaps/gray75.bmp;
+ refType = 2;
+ };
+ F537568E016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = hourglass.bmp;
+ path = ../bitmaps/hourglass.bmp;
+ refType = 2;
+ };
+ F537568F016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = info.bmp;
+ path = ../bitmaps/info.bmp;
+ refType = 2;
+ };
+ F5375690016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = questhead.bmp;
+ path = ../bitmaps/questhead.bmp;
+ refType = 2;
+ };
+ F5375691016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = question.bmp;
+ path = ../bitmaps/question.bmp;
+ refType = 2;
+ };
+ F5375692016C3F1001DC9062 = {
+ isa = PBXFileReference;
+ name = warning.bmp;
+ path = ../bitmaps/warning.bmp;
+ refType = 2;
+ };
+ F5375693016C3F1001DC9062 = {
+ fileRef = F5375689016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375694016C3F1001DC9062 = {
+ fileRef = F537568A016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375695016C3F1001DC9062 = {
+ fileRef = F537568B016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375696016C3F1001DC9062 = {
+ fileRef = F537568C016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375697016C3F1001DC9062 = {
+ fileRef = F537568D016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375698016C3F1001DC9062 = {
+ fileRef = F537568E016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5375699016C3F1001DC9062 = {
+ fileRef = F537568F016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537569A016C3F1001DC9062 = {
+ fileRef = F5375690016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537569B016C3F1001DC9062 = {
+ fileRef = F5375691016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537569C016C3F1001DC9062 = {
+ fileRef = F5375692016C3F1001DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537569E016C49C301DC9062 = {
+ fileRef = F53755BB016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F537569F016C4DD401DC9062 = {
+ isa = PBXApplicationReference;
+ path = "Wish Shell.app";
+ refType = 3;
+ };
+ F53756A0016C4DD401DC9062 = {
+ buildPhases = (
+ F5877FB8031F982D016F146B,
+ F53756A1016C4DD401DC9062,
+ F53756A2016C4DD401DC9062,
+ F53756A4016C4DD401DC9062,
+ F53756A6016C4DD401DC9062,
+ F53756AA016C4DD401DC9062,
+ F5EEA7050324680B016F146B,
+ F55A164E032A11B1016F146B,
+ F5877FBD031FAC6A016F146B,
+ );
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "\"$(SYMROOT)\"";
+ GLOBAL_CFLAGS = "`source \"${SYMROOT}/Tcl.framework/Resources/tclConfig.sh\"; echo $${}{TCL_EXTRA_CFLAGS} $${}{TCL_DEFS} | sed -e 's|\\\\\\\\\\\\\\\"|\\\"|g' | sed -e 's| -DTCL_WIDE_INT_TYPE=long. long||'` -U_REENTRANT";
+ HEADER_SEARCH_PATHS = "../../tcl/generic ../../tcl/unix ../generic ../xlib";
+ INSTALL_PATH = /Applications/Utilities;
+ LIBRARY_SEARCH_PATHS = "";
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "-DMAC_OSX_TK -DTCL_WIDE_INT_TYPE=\"long long\"";
+ OTHER_LDFLAGS = "-sectcreate __TEXT __info_plist \"$TEMP_DIR/Info.plist\"";
+ OTHER_REZFLAGS = "-i \"../../tcl/generic\" -i \"../generic\"";
+ PRODUCT_NAME = "Wish Shell";
+ SECTORDER_FLAGS = "";
+ USE_GCC3_PFE_SUPPORT = NO;
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = app;
+ };
+ dependencies = (
+ F53756B2016C525F01DC9062,
+ );
+ isa = PBXApplicationTarget;
+ name = Wish;
+ productInstallPath = /Applications/Utilities;
+ productName = "Wish Shell";
+ productReference = F537569F016C4DD401DC9062;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>Wish Shell</string>
+ <key>CFBundleGetInfoString</key>
+ <string>Wish Shell 8.4, Copyright © 2002 Tcl Core Team.
+MacOS X Port by Jim Ingham &lt;jingham@apple.com&gt; &amp; Ian Reid, Copyright © 2001-2002, Apple Computer, Inc.</string>
+ <key>CFBundleIconFile</key>
+ <string>Wish.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.tcltk.wish</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Wish</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>8.4.0</string>
+ <key>CFBundleSignature</key>
+ <string>WiSH</string>
+ <key>CFBundleVersion</key>
+ <string>8.4.0</string>
+</dict>
+</plist>
+";
+ shouldUseHeadermap = 0;
+ };
+ F53756A1016C4DD401DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F53756AC016C4E1D01DC9062,
+ F53756AD016C4E1D01DC9062,
+ F53756AE016C4E1D01DC9062,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53756A2016C4DD401DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F53756A3016C4DD401DC9062,
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53756A3016C4DD401DC9062 = {
+ fileRef = F537553B016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53756A4016C4DD401DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F53756A5016C4DD401DC9062,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53756A5016C4DD401DC9062 = {
+ fileRef = F5375548016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53756A6016C4DD401DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ F53756A8016C4DD401DC9062,
+ F5875C7D016FEF1D01DC9062,
+ F53756A7016C4DD401DC9062,
+ F50D96140196176E01DC9062,
+ F5877FB9031F9F49016F146B,
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53756A7016C4DD401DC9062 = {
+ fileRef = F53755DE016C38D201DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53756A8016C4DD401DC9062 = {
+ fileRef = F537567D016C3ADB01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53756AA016C4DD401DC9062 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F53756AC016C4E1D01DC9062 = {
+ fileRef = F537556B016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53756AD016C4E1D01DC9062 = {
+ fileRef = F5375570016C37A601DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53756AE016C4E1D01DC9062 = {
+ fileRef = F537553E016C376E01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F53756B2016C525F01DC9062 = {
+ isa = PBXTargetDependency;
+ target = F53755DF016C38D201DC9062;
+ };
+ F548F8C80313C9E0016F146B = {
+ buildActionMask = 2147483647;
+ dstPath = "Versions/$(FRAMEWORK_VERSION)";
+ dstSubfolderSpec = 1;
+ files = (
+ F5877FBA031F9F4B016F146B,
+ );
+ isa = PBXCopyFilesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F548F8CA0313CEF0016F146B = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F548F8CB0313CEF0016F146B = {
+ buildActionMask = 2147483647;
+ files = (
+ F548F8D10313CF14016F146B,
+ F548F8D00313CF11016F146B,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F548F8CC0313CEF0016F146B = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F548F8CD0313CEF0016F146B = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F548F8CE0313CEF0016F146B = {
+ buildPhases = (
+ F548F8CA0313CEF0016F146B,
+ F548F8CB0313CEF0016F146B,
+ F548F8CC0313CEF0016F146B,
+ F548F8CD0313CEF0016F146B,
+ );
+ buildSettings = {
+ GLOBAL_CFLAGS = "`source \"${SYMROOT}/Tcl.framework/Resources/tclConfig.sh\"; echo $${}{TCL_EXTRA_CFLAGS} $${}{TCL_DEFS} | sed -e 's|\\\\\\\\\\\\\\\"|\\\"|g' | sed -e 's| -DTCL_WIDE_INT_TYPE=long. long||'` -U_REENTRANT";
+ HEADER_SEARCH_PATHS = "../../tcl/generic ../../tcl/unix ../generic ../xlib";
+ LIBRARY_STYLE = STATIC;
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "-DMAC_OSX_TK -DTCL_WIDE_INT_TYPE=\"long long\"";
+ OTHER_LDFLAGS = "";
+ OTHER_LIBTOOL_FLAGS = "";
+ PRODUCT_NAME = libtkstub8.4.a;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXLibraryTarget;
+ name = TkStubLibrary;
+ productInstallPath = /usr/local/lib;
+ productName = TkStub;
+ productReference = F548F8CF0313CEF0016F146B;
+ shouldUseHeadermap = 0;
+ };
+ F548F8CF0313CEF0016F146B = {
+ isa = PBXLibraryReference;
+ path = libtkstub8.4.a;
+ refType = 3;
+ };
+ F548F8D00313CF11016F146B = {
+ fileRef = F53755B9016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F548F8D10313CF14016F146B = {
+ fileRef = F53755BB016C389901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F548F8D20313CF93016F146B = {
+ isa = PBXTargetDependency;
+ target = F548F8CE0313CEF0016F146B;
+ };
+ F55A164E032A11B1016F146B = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# if we are embedding frameworks, copy them into the app\nif [ `echo \"${DYLIB_INSTALL_PATH:-}\" | grep -c \"@executable_path\"` -gt 0 ]; then\nrm -rf \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/Contents/Frameworks\"\nmkdir -p \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/Contents/Frameworks\"\nif [ \"${DEPLOYMENT_LOCATION:-}\" = \"YES\" ]; then\n FWKDIR=\"${INSTALL_ROOT}/Library/Frameworks\"\nelse\n FWKDIR=\"${TARGET_BUILD_DIR}\"\nfi\ncp -fRP \"${FWKDIR}/Tcl.framework\" \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/Contents/Frameworks\"\ncp -fRP \"${FWKDIR}/Tk.framework\" \"${TARGET_BUILD_DIR}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/Contents/Frameworks\"\nfi";
+ };
+ F55BC46802B2D38B01DC9062 = {
+ isa = PBXFileReference;
+ name = tkPanedWindow.c;
+ path = ../generic/tkPanedWindow.c;
+ refType = 2;
+ };
+ F55BC46902B2D38B01DC9062 = {
+ fileRef = F55BC46802B2D38B01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F55BC46A02B2D3F301DC9062 = {
+ isa = PBXFileReference;
+ name = panedwindow.tcl;
+ path = ../library/panedwindow.tcl;
+ refType = 2;
+ };
+ F55BC46B02B2D3F301DC9062 = {
+ fileRef = F55BC46A02B2D3F301DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5875C7B016FEF1D01DC9062 = {
+ isa = PBXFrameworkReference;
+ path = Tcl.framework;
+ refType = 3;
+ };
+ F5875C7D016FEF1D01DC9062 = {
+ fileRef = F5875C7B016FEF1D01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5877FB7031F97ED016F146B = {
+ buildActionMask = 8;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "# ensure we can overwrite a previous install\nif [ -d \"${INSTALL_ROOT}/${INSTALL_PATH}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}\" ]; then\n chmod -RH u+w \"${INSTALL_ROOT}/${INSTALL_PATH}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}\"\nfi\n\n# if we are embedding frameworks, fix things so that install works with the embedding INSTALL_PATH\nif [ `echo \"${DYLIB_INSTALL_PATH:-}\" | grep -c \"@executable_path\"` -gt 0 ]; then\n cd \"${INSTALL_ROOT}\"\n if [ ! -d \"Library/Frameworks/${PRODUCT_NAME}.${WRAPPER_EXTENSION}\" ]; then\n mkdir -p Library/Frameworks\n mv \"Frameworks/${PRODUCT_NAME}.${WRAPPER_EXTENSION}\" Library/Frameworks\n fi\n rm -r Frameworks\n ln -fs Library/Frameworks\nfi";
+ };
+ F5877FB8031F982D016F146B = {
+ buildActionMask = 8;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "# ensure we can overwrite a previous install\nif [ -d \"${INSTALL_ROOT}${INSTALL_PATH}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}\" ]; then\n chmod -RH u+w \"${INSTALL_ROOT}${INSTALL_PATH}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}\"\nfi";
+ };
+ F5877FB9031F9F49016F146B = {
+ fileRef = F548F8CF0313CEF0016F146B;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5877FBA031F9F4B016F146B = {
+ fileRef = F548F8CF0313CEF0016F146B;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5877FBC031FA968016F146B = {
+ buildActionMask = 8;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "# redo prebinding\ncd \"${INSTALL_ROOT}\"\nif [ ! -d usr/lib ]; then mkdir -p usr; ln -fs /usr/lib usr/; RM_USRLIB=1; fi\nif [ ! -d System ]; then ln -fs /System .; RM_SYSTEM=1; fi\nredo_prebinding -r . \"./${INSTALL_PATH}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/Versions/${FRAMEWORK_VERSION}/${PRODUCT_NAME}\"\nif [ -n \"${RM_USRLIB:-}\" ]; then rm -f usr/lib; rmdir -p usr; fi\nif [ -n \"${RM_SYSTEM:-}\" ]; then rm -f System; fi";
+ };
+ F5877FBD031FAC6A016F146B = {
+ buildActionMask = 8;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "# redo prebinding\ncd \"${INSTALL_ROOT}\"\nif [ ! -d usr/lib ]; then mkdir -p usr; ln -fs /usr/lib usr/; RM_USRLIB=1; fi\nif [ ! -d System ]; then ln -fs /System .; RM_SYSTEM=1; fi\nredo_prebinding -r . \"./${INSTALL_PATH}/${PRODUCT_NAME}.${WRAPPER_EXTENSION}/Contents/MacOS/${PRODUCT_NAME}\"\nif [ -n \"${RM_USRLIB:-}\" ]; then rm -f usr/lib; rmdir -p usr; fi\nif [ -n \"${RM_SYSTEM:-}\" ]; then rm -f System; fi";
+ };
+ F5B1FC08016FFE3501DC9062 = {
+ buildActionMask = 2147483647;
+ dstPath = "Versions/$(FRAMEWORK_VERSION)/Resources/Scripts";
+ dstSubfolderSpec = 1;
+ files = (
+ F5B1FC09016FFE3501DC9062,
+ F5B1FC0A016FFE3501DC9062,
+ F5B1FC0B016FFE3501DC9062,
+ F5B1FC0C016FFE3501DC9062,
+ F5B1FC0D016FFE3501DC9062,
+ F5B1FC0E016FFE3501DC9062,
+ F5B1FC0F016FFE3501DC9062,
+ F5B1FC10016FFE3501DC9062,
+ F5B1FC11016FFE3501DC9062,
+ F5B1FC12016FFE3501DC9062,
+ F5B1FC13016FFE3501DC9062,
+ F5B1FC14016FFE3501DC9062,
+ F5B1FC15016FFE3501DC9062,
+ F5B1FC16016FFE3501DC9062,
+ F5B1FC17016FFE3501DC9062,
+ F5B1FC18016FFE3501DC9062,
+ F5B1FC19016FFE3501DC9062,
+ F5B1FC1A016FFE3501DC9062,
+ F55BC46B02B2D3F301DC9062,
+ F5B1FC1B016FFE3501DC9062,
+ F5B1FC1C016FFE3501DC9062,
+ F5B1FC1D016FFE3501DC9062,
+ F5B1FC1E016FFE3501DC9062,
+ F5B1FC1F016FFE3501DC9062,
+ F5B1FC20016FFE3501DC9062,
+ F5B1FC21016FFE3501DC9062,
+ F5B1FC22016FFE3501DC9062,
+ F5B1FC23016FFE3501DC9062,
+ F5B1FC24016FFE3501DC9062,
+ F5B1FC25016FFE3501DC9062,
+ F5B1FC26016FFE3501DC9062,
+ );
+ isa = PBXCopyFilesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ F5B1FC09016FFE3501DC9062 = {
+ fileRef = F5DF0928016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC0A016FFE3501DC9062 = {
+ fileRef = F5DF0929016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC0B016FFE3501DC9062 = {
+ fileRef = F5DF092A016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC0C016FFE3501DC9062 = {
+ fileRef = F5DF092B016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC0D016FFE3501DC9062 = {
+ fileRef = F5DF092C016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC0E016FFE3501DC9062 = {
+ fileRef = F5DF092D016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC0F016FFE3501DC9062 = {
+ fileRef = F5DF092E016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC10016FFE3501DC9062 = {
+ fileRef = F5DF092F016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC11016FFE3501DC9062 = {
+ fileRef = F5DF0930016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC12016FFE3501DC9062 = {
+ fileRef = F5DF0931016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC13016FFE3501DC9062 = {
+ fileRef = F5DF0932016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC14016FFE3501DC9062 = {
+ fileRef = F5DF0933016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC15016FFE3501DC9062 = {
+ fileRef = F5DF0934016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC16016FFE3501DC9062 = {
+ fileRef = F5DF0935016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC17016FFE3501DC9062 = {
+ fileRef = F5DF0936016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC18016FFE3501DC9062 = {
+ fileRef = F5DF0937016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC19016FFE3501DC9062 = {
+ fileRef = F5DF0938016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC1A016FFE3501DC9062 = {
+ fileRef = F5DF0939016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC1B016FFE3501DC9062 = {
+ fileRef = F5DF093A016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC1C016FFE3501DC9062 = {
+ fileRef = F5DF093B016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC1D016FFE3501DC9062 = {
+ fileRef = F5DF093C016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC1E016FFE3501DC9062 = {
+ fileRef = F5DF093D016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC1F016FFE3501DC9062 = {
+ fileRef = F5DF093E016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC20016FFE3501DC9062 = {
+ fileRef = F5DF093F016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC21016FFE3501DC9062 = {
+ fileRef = F5DF0940016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC22016FFE3501DC9062 = {
+ fileRef = F5DF0941016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC23016FFE3501DC9062 = {
+ fileRef = F5DF0942016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC24016FFE3501DC9062 = {
+ fileRef = F5DF0943016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC25016FFE3501DC9062 = {
+ fileRef = F5DF0944016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5B1FC26016FFE3501DC9062 = {
+ fileRef = F5DF0945016CD3F901DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5BFE58B02F8C41501DC9062 = {
+ isa = PBXFileReference;
+ name = tkStyle.c;
+ path = ../generic/tkStyle.c;
+ refType = 2;
+ };
+ F5BFE58C02F8C41501DC9062 = {
+ isa = PBXFileReference;
+ name = tkUndo.c;
+ path = ../generic/tkUndo.c;
+ refType = 2;
+ };
+ F5BFE58D02F8C41501DC9062 = {
+ fileRef = F5BFE58B02F8C41501DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5BFE58E02F8C41501DC9062 = {
+ fileRef = F5BFE58C02F8C41501DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5BFE58F02F8C45B01DC9062 = {
+ isa = PBXFileReference;
+ name = tkUndo.h;
+ path = ../generic/tkUndo.h;
+ refType = 2;
+ };
+ F5BFE59002F8C45B01DC9062 = {
+ fileRef = F5BFE58F02F8C45B01DC9062;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5C1D51901B88F9A01DC9062 = {
+ buildActionMask = 8;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ shellPath = /bin/sh;
+ shellScript = "#source buildConfig";
+ };
+ F5C88659017D625C01DC9062 = {
+ children = (
+ F5C8865A017D625C01DC9062,
+ F5C8865B017D625C01DC9062,
+ );
+ isa = PBXGroup;
+ name = "Header Tools";
+ refType = 4;
+ };
+ F5C8865A017D625C01DC9062 = {
+ isa = PBXFileReference;
+ name = tk.decls;
+ path = ../generic/tk.decls;
+ refType = 2;
+ };
+ F5C8865B017D625C01DC9062 = {
+ isa = PBXFileReference;
+ name = tkInt.decls;
+ path = ../generic/tkInt.decls;
+ refType = 2;
+ };
+ F5DF07A7016CD03801DC9062 = {
+ children = (
+ F5DF0928016CD3F901DC9062,
+ F5DF0929016CD3F901DC9062,
+ F5DF092A016CD3F901DC9062,
+ F5DF092B016CD3F901DC9062,
+ F5DF092C016CD3F901DC9062,
+ F5DF092D016CD3F901DC9062,
+ F5DF092E016CD3F901DC9062,
+ F5DF092F016CD3F901DC9062,
+ F5DF0930016CD3F901DC9062,
+ F5DF0931016CD3F901DC9062,
+ F5DF0932016CD3F901DC9062,
+ F5DF0933016CD3F901DC9062,
+ F5DF0934016CD3F901DC9062,
+ F5DF0935016CD3F901DC9062,
+ F5DF0936016CD3F901DC9062,
+ F5DF0937016CD3F901DC9062,
+ F5DF0938016CD3F901DC9062,
+ F5DF0939016CD3F901DC9062,
+ F55BC46A02B2D3F301DC9062,
+ F5DF093A016CD3F901DC9062,
+ F5DF093B016CD3F901DC9062,
+ F5DF093C016CD3F901DC9062,
+ F5DF093D016CD3F901DC9062,
+ F5DF093E016CD3F901DC9062,
+ F5DF093F016CD3F901DC9062,
+ F5DF0940016CD3F901DC9062,
+ F5DF0941016CD3F901DC9062,
+ F5DF0942016CD3F901DC9062,
+ F5DF0943016CD3F901DC9062,
+ F5DF0944016CD3F901DC9062,
+ F5DF0945016CD3F901DC9062,
+ );
+ isa = PBXGroup;
+ name = Scripts;
+ refType = 4;
+ };
+ F5DF0928016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = bgerror.tcl;
+ path = ../library/bgerror.tcl;
+ refType = 2;
+ };
+ F5DF0929016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = button.tcl;
+ path = ../library/button.tcl;
+ refType = 2;
+ };
+ F5DF092A016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = choosedir.tcl;
+ path = ../library/choosedir.tcl;
+ refType = 2;
+ };
+ F5DF092B016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = clrpick.tcl;
+ path = ../library/clrpick.tcl;
+ refType = 2;
+ };
+ F5DF092C016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = comdlg.tcl;
+ path = ../library/comdlg.tcl;
+ refType = 2;
+ };
+ F5DF092D016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = console.tcl;
+ path = ../library/console.tcl;
+ refType = 2;
+ };
+ F5DF092E016CD3F901DC9062 = {
+ includeInIndex = 0;
+ isa = PBXFolderReference;
+ name = demos;
+ path = ../library/demos;
+ refType = 2;
+ };
+ F5DF092F016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = dialog.tcl;
+ path = ../library/dialog.tcl;
+ refType = 2;
+ };
+ F5DF0930016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = entry.tcl;
+ path = ../library/entry.tcl;
+ refType = 2;
+ };
+ F5DF0931016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = focus.tcl;
+ path = ../library/focus.tcl;
+ refType = 2;
+ };
+ F5DF0932016CD3F901DC9062 = {
+ includeInIndex = 0;
+ isa = PBXFolderReference;
+ name = images;
+ path = ../library/images;
+ refType = 2;
+ };
+ F5DF0933016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = listbox.tcl;
+ path = ../library/listbox.tcl;
+ refType = 2;
+ };
+ F5DF0934016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = menu.tcl;
+ path = ../library/menu.tcl;
+ refType = 2;
+ };
+ F5DF0935016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = msgbox.tcl;
+ path = ../library/msgbox.tcl;
+ refType = 2;
+ };
+ F5DF0936016CD3F901DC9062 = {
+ includeInIndex = 0;
+ isa = PBXFolderReference;
+ name = msgs;
+ path = ../library/msgs;
+ refType = 2;
+ };
+ F5DF0937016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = obsolete.tcl;
+ path = ../library/obsolete.tcl;
+ refType = 2;
+ };
+ F5DF0938016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = optMenu.tcl;
+ path = ../library/optMenu.tcl;
+ refType = 2;
+ };
+ F5DF0939016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = palette.tcl;
+ path = ../library/palette.tcl;
+ refType = 2;
+ };
+ F5DF093A016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = prolog.ps;
+ path = ../library/prolog.ps;
+ refType = 2;
+ };
+ F5DF093B016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = safetk.tcl;
+ path = ../library/safetk.tcl;
+ refType = 2;
+ };
+ F5DF093C016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = scale.tcl;
+ path = ../library/scale.tcl;
+ refType = 2;
+ };
+ F5DF093D016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = scrlbar.tcl;
+ path = ../library/scrlbar.tcl;
+ refType = 2;
+ };
+ F5DF093E016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = spinbox.tcl;
+ path = ../library/spinbox.tcl;
+ refType = 2;
+ };
+ F5DF093F016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = tclIndex;
+ path = ../library/tclIndex;
+ refType = 2;
+ };
+ F5DF0940016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = tearoff.tcl;
+ path = ../library/tearoff.tcl;
+ refType = 2;
+ };
+ F5DF0941016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = text.tcl;
+ path = ../library/text.tcl;
+ refType = 2;
+ };
+ F5DF0942016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = tk.tcl;
+ path = ../library/tk.tcl;
+ refType = 2;
+ };
+ F5DF0943016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = tkfbox.tcl;
+ path = ../library/tkfbox.tcl;
+ refType = 2;
+ };
+ F5DF0944016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = unsupported.tcl;
+ path = ../library/unsupported.tcl;
+ refType = 2;
+ };
+ F5DF0945016CD3F901DC9062 = {
+ isa = PBXFileReference;
+ name = xmfbox.tcl;
+ path = ../library/xmfbox.tcl;
+ refType = 2;
+ };
+ F5EEA7050324680B016F146B = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ generatedFileNames = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ neededFileNames = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "if [ \"${BUILD_STYLE}\" = \"Development\" ]; then\n\t# force Deployment build to be relinked next time\n\tif [ -f \"${OBJROOT}/Deployment.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\" ]; then\n\t touch -t `date -r \\`expr \\\\\\`date +\"%s\"\\\\\\` + 30\\` +\"%Y%m%d%H%M.%S\"` \"${OBJROOT}/Deployment.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\"\n\tfi\nelse\n\t# force Development build to be relinked next time\n\tif [ -f \"${OBJROOT}/Development.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\" ]; then\n\t touch -t `date -r \\`expr \\\\\\`date +\"%s\"\\\\\\` + 30\\` +\"%Y%m%d%H%M.%S\"` \"${OBJROOT}/Development.build/${PROJECT_NAME}.build/${TARGET_NAME}.build/Objects-normal/LinkFileList\"\n\tfi\nfi";
+ };
+ };
+ rootObject = F537552A016C352C01DC9062;
+}
diff --git a/tk/macosx/tclets.r b/tk/macosx/tclets.r
new file mode 100644
index 00000000000..ce68db49657
--- /dev/null
+++ b/tk/macosx/tclets.r
@@ -0,0 +1,172 @@
+/*
+ * tclets.r --
+ *
+ */
+
+/*
+ * New style DLOG templates have an extra field for the positioning
+ * options for the Dialog Box. We will not use this, for now, so we
+ * turn it off here.
+ */
+
+#define DLOG_RezTemplateVersion 0
+
+#include <Types.r>
+#include <SysTypes.r>
+#include <AEUserTermTypes.r>
+
+/*
+ * We now load the Tclets code into the resource fork
+ */
+
+#define TK_LIBRARY_RESOURCES 3000
+
+read 'TEXT' (TK_LIBRARY_RESOURCES+114, "tclshrc", purgeable)
+ "::mac:tclets.tcl";
+
+data 'icns' (-16455) {
+ $"6963 6E73 0000 08F8 6963 7323 0000 0048" /* icns...øics#...H */
+ $"0100 02EE 05CE 09EE 13DE 23FF 47CE 86C6" /* ...î.ÎÆî.Þ#ÿG렮 */
+ $"4681 22C2 12C4 0888 0410 0220 0140 0080" /* F"Â.Ä.ˆ... .@.€ */
+ $"0100 03EE 07CE 0FEE 1FFE 3FFF 7FFE FFFE" /* ...î.Î.î.þ?ÿ.þÿþ */
+ $"7FFF 3FFE 1FFC 0FF8 07F0 03E0 01C0 0080" /* .ÿ?þ.ü.ø.ð.à.À.€ */
+ $"6963 7334 0000 0088 0000 000F 0000 0000" /* ics4...ˆ........ */
+ $"0000 00FC F6D0 FFF0 0000 0FC5 DD00 F6F0" /* ...üöÐÿð...ÅÝ.öð */
+ $"0000 FCCD 66F0 F6F0 000F CC6E 66CE F6F0" /* ..üÍfðöð..ÌnfÎöð */
+ $"00FC CC6E 67EF F6FF 0FCC CD66 66CC F6F0" /* .üÌngïöÿ.ÌÍffÌöð */
+ $"FCCC CDDC 66CC CFA0 0FCC CD6C EDCC CC0F" /* üÌÍÜfÌÏ .ÌÍlíÌÌ. */
+ $"00FC CC6C E6CC CCF0 000F CC6C 66CC CF00" /* .üÌlæÌÌð..ÌlfÌÏ. */
+ $"0000 FCCC 6CCC F000 0000 0FCC DCCF 0000" /* ..üÌlÌð....ÌÜÏ.. */
+ $"0000 00FD DCF0 0000 0000 000F CF00 0000" /* ...ýÜð......Ï... */
+ $"0000 0000 F000 0000 6963 7338 0000 0108" /* ....ð...ics8.... */
+ $"0000 0000 0000 00FF 0000 0000 0000 0000" /* .......ÿ........ */
+ $"0000 0000 0000 FF2B FFEC 7F00 FFFF FF00" /* ......ÿ+ÿì..ÿÿÿ. */
+ $"0000 0000 00FF 2BB0 7F7F 0000 FFEC FF00" /* .....ÿ+°....ÿìÿ. */
+ $"0000 0000 FF2B 2B7F ECEC FF00 FFEC FF00" /* ....ÿ++.ììÿ.ÿìÿ. */
+ $"0000 00FF 2B2B ECFC ECEC 2BFB FFEC FF00" /* ...ÿ++ìüìì+ûÿìÿ. */
+ $"0000 FF2B 2B2B ECFC ECC0 FBFF FFEC FFFF" /* ..ÿ+++ìüìÀûÿÿìÿÿ */
+ $"00FF 2B2B 2B7F ECEC ECEC 2B2B FFEC FF00" /* .ÿ+++.ìììì++ÿìÿ. */
+ $"FF2B 2B2B 2B7F 7FF6 ECEC 2B2B 2BFF FD00" /* ÿ++++..öìì+++ÿý. */
+ $"00FF 2B2B 2B7F ECF6 FCF9 2B2B 2B2B 00FF" /* .ÿ+++.ìöüù++++.ÿ */
+ $"0000 FF2B 2B2B ECF6 FCEC 2B2B 2B2B FF00" /* ..ÿ+++ìöüì++++ÿ. */
+ $"0000 00FF 2B2B ECF6 ECEC 2B2B 2BFF 0000" /* ...ÿ++ìöìì+++ÿ.. */
+ $"0000 0000 FF2B 2BF6 EC2B 2B2B FF00 0000" /* ....ÿ++öì+++ÿ... */
+ $"0000 0000 00FF 2BF6 F92B 2BFF 0000 0000" /* .....ÿ+öù++ÿ.... */
+ $"0000 0000 0000 FFF9 F92B FF00 0000 0000" /* ......ÿùù+ÿ..... */
+ $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......ÿ+ÿ...... */
+ $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ........ÿ....... */
+ $"4943 4E23 0000 0108 0001 0000 0002 8000" /* ICN#..........€. */
+ $"0004 78F8 0008 70F8 0010 F0F8 0021 E8F8" /* ..xø..pø..ðø.!èø */
+ $"0043 C4F8 0081 FAF8 0107 F1F8 0207 F0F8" /* .CÄø.úø..ñø..ðø */
+ $"0407 F7FF 0807 E3FE 1007 E1FC 200E E0F8" /* ..÷ÿ..ãþ..áü .àø */
+ $"4002 E074 800E E022 400E E001 200E C002" /* @.àt€.à"@.à. .À. */
+ $"1006 E004 0806 C008 0406 E010 0202 C020" /* ..à...À...à...À */
+ $"0102 C040 0080 8080 0040 0100 0020 0200" /* ..À@.€€€.@... .. */
+ $"0010 0400 0008 0800 0004 1000 0002 2000" /* .............. . */
+ $"0001 4000 0000 8000 0001 0000 0003 8000" /* ..@...€.......€. */
+ $"0007 F8F8 000F F0F8 001F F0F8 003F F8F8" /* ..øø..ðø..ðø.?øø */
+ $"007F FCF8 00FF FEF8 01FF FFF8 03FF FFF8" /* ..üø.ÿþø.ÿÿø.ÿÿø */
+ $"07FF FFFF 0FFF FFFE 1FFF FFFC 3FFF FFF8" /* .ÿÿÿ.ÿÿþ.ÿÿü?ÿÿø */
+ $"7FFF FFFC FFFF FFFE 7FFF FFFF 3FFF FFFE" /* .ÿÿüÿÿÿþ.ÿÿÿ?ÿÿþ */
+ $"1FFF FFFC 0FFF FFF8 07FF FFF0 03FF FFE0" /* .ÿÿü.ÿÿø.ÿÿð.ÿÿà */
+ $"01FF FFC0 00FF FF80 007F FF00 003F FE00" /* .ÿÿÀ.ÿÿ€..ÿ..?þ. */
+ $"001F FC00 000F F800 0007 F000 0003 E000" /* ..ü...ø...ð...à. */
+ $"0001 C000 0000 8000 6963 6C34 0000 0208" /* ..À...€.icl4.... */
+ $"0000 0000 0000 000F 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 0000 00FC F000 0000 0000 0000" /* .......üð....... */
+ $"0000 0000 0000 0FCC CFD6 D000 FFFF F000" /* .......ÌÏÖÐ.ÿÿð. */
+ $"0000 0000 0000 FCCC C556 0000 F767 F000" /* ......üÌÅV..÷gð. */
+ $"0000 0000 000F CCCC 566F 0000 F676 F000" /* ......ÌÌVo..övð. */
+ $"0000 0000 00FC CCC5 6F5C F000 F767 F000" /* .....üÌÅo\ð.÷gð. */
+ $"0000 0000 0FCC CC66 66CC 0F00 F676 F000" /* .....ÌÌffÌ..övð. */
+ $"0000 0000 FCCC CCD5 5666 FCF0 F767 F000" /* ....üÌÌÕVfüð÷gð. */
+ $"0000 000F CCCC C656 5667 CCCF F676 F000" /* ....ÌÌÆVVgÌÏövð. */
+ $"0000 00FC CCCC C6E5 5566 CCCC F767 F000" /* ...üÌÌÆåUfÌÌ÷gð. */
+ $"0000 0FCC CCCC C656 5657 CFFF F676 FFFF" /* ...ÌÌÌÆVVWÏÿövÿÿ */
+ $"0000 FCCC CCCC C6E5 565C CCF7 6767 67F0" /* ..üÌÌÌÆåV\Ì÷gggð */
+ $"000F CCCC CCCC C655 565C CCCF 7676 7F00" /* ..ÌÌÌÌÆUV\ÌÏvv.. */
+ $"00FC CCCC CCCC 7660 556C CCCC F767 F000" /* .üÌÌÌÌv`UlÌÌ÷gð. */
+ $"0FCC CCCC CCCC CD5D 567C CCCC CF7F CF00" /* .ÌÌÌÌÌÍ]V|ÌÌÏ.Ï. */
+ $"FCCC CCCC CCCC 6660 556C CCCC CCFC CCF0" /* üÌÌÌÌÌf`UlÌÌÌüÌð */
+ $"0FCC CCCC CCCC 665C 565C CCCC CCCC CCCF" /* .ÌÌÌÌÌf\V\ÌÌÌÌÌÏ */
+ $"00FC CCCC CCCC 6660 E6DC CCCC CCCC CCF0" /* .üÌÌÌÌf`æÜÌÌÌÌÌð */
+ $"000F CCCC CCCC C650 656C CCCC CCCC CF00" /* ..ÌÌÌÌÆPelÌÌÌÌÏ. */
+ $"0000 FCCC CCCC C6EC 5ECC CCCC CCCC F000" /* ..üÌÌÌÆì^ÌÌÌÌÌð. */
+ $"0000 0FCC CCCC C650 566C CCCC CCCF 0000" /* ...ÌÌÌÆPVlÌÌÌÏ.. */
+ $"0000 00FC CCCC CC50 D5CC CCCC CCF0 0000" /* ...üÌÌÌPÕÌÌÌÌð.. */
+ $"0000 000F CCCC CC50 56CC CCCC CF00 0000" /* ....ÌÌÌPVÌÌÌÏ... */
+ $"0000 0000 FCCC CCD0 5CCC CCCC F000 0000" /* ....üÌÌÐ\ÌÌÌð... */
+ $"0000 0000 0FCC CCD0 DCCC CCCF 0000 0000" /* .....ÌÌÐÜÌÌÏ.... */
+ $"0000 0000 00FC CCD0 DCCC CCF0 0000 0000" /* .....üÌÐÜÌÌð.... */
+ $"0000 0000 000F CCD0 DCCC CF00 0000 0000" /* ......ÌÐÜÌÏ..... */
+ $"0000 0000 0000 FCC0 CCCC F000 0000 0000" /* ......üÀÌÌð..... */
+ $"0000 0000 0000 0FCD CCCF 0000 0000 0000" /* .......ÍÌÏ...... */
+ $"0000 0000 0000 00FC CCF0 0000 0000 0000" /* .......üÌð...... */
+ $"0000 0000 0000 000F CF00 0000 0000 0000" /* ........Ï....... */
+ $"0000 0000 0000 0000 F000 0000 0000 0000" /* ........ð....... */
+ $"6963 6C38 0000 0408 0000 0000 0000 0000" /* icl8............ */
+ $"0000 0000 0000 00FF 0000 0000 0000 0000" /* .......ÿ........ */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 0000 FF2B FF00 0000 0000 0000" /* ......ÿ+ÿ....... */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 00FF 2B2B 2BFF 7FEC 7F00 0000" /* .....ÿ+++ÿ.ì.... */
+ $"FFFF FFFF FF00 0000 0000 0000 0000 0000" /* ÿÿÿÿÿ........... */
+ $"0000 0000 FF2B 2B2B 2BB0 B0EC 0000 0000" /* ....ÿ++++°°ì.... */
+ $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* ÿÀìÀÿ........... */
+ $"0000 00FF 2B2B 2B2B B0EC ECFF 0000 0000" /* ...ÿ++++°ììÿ.... */
+ $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* ÿìÀìÿ........... */
+ $"0000 FF2B 2B2B 2BB0 ECFF B02B FF00 0000" /* ..ÿ++++°ìÿ°+ÿ... */
+ $"FFC0 ECC0 FF00 0000 0000 0000 0000 0000" /* ÿÀìÀÿ........... */
+ $"00FF 2B2B 2B2B ECEC ECEC 2B2B 00FF 0000" /* .ÿ++++ìììì++.ÿ.. */
+ $"FFEC C0EC FF00 0000 0000 0000 0000 0000" /* ÿìÀìÿ........... */
+ $"FF2B 2B2B 2B2B F9B0 B0EC ECEC FF2B FF00" /* ÿ+++++ù°°ìììÿ+ÿ. */
+ $"FFC0 ECC0 FF00 0000 0000 0000 0000 00FF" /* ÿÀìÀÿ..........ÿ */
+ $"2B2B 2B2B 2BEC B0EC B0EC ECC0 2B2B 2BFF" /* +++++ì°ì°ììÀ+++ÿ */
+ $"FFEC C0EC FF00 0000 0000 0000 0000 FF2B" /* ÿìÀìÿ.........ÿ+ */
+ $"2B2B 2B2B 2BEC FCB0 B0B0 ECEC 2B2B 2B2B" /* +++++ìü°°°ìì++++ */
+ $"FFC0 ECC0 FF00 0000 0000 0000 00FF 2B2B" /* ÿÀìÀÿ........ÿ++ */
+ $"2B2B 2B2B 2BEC B0EC B0EC B0C0 2BFF FFFF" /* +++++ì°ì°ì°À+ÿÿÿ */
+ $"FFEC C0EC FFFF FFFF 0000 0000 FF2B 2B2B" /* ÿìÀìÿÿÿÿ....ÿ+++ */
+ $"2B2B 2B2B 2BEC FCB0 B0EC B02B 2B2B FFC0" /* +++++ìü°°ì°+++ÿÀ */
+ $"ECC0 ECC0 ECC0 FF00 0000 00FF 2B2B 2B2B" /* ìÀìÀìÀÿ....ÿ++++ */
+ $"2B2B 2B2B 2BEC B0B0 B0EC B02B 2B2B 2BFF" /* +++++ì°°°ì°++++ÿ */
+ $"C0EC C0EC C0FF 0000 0000 FF2B 2B2B 2B2B" /* ÀìÀìÀÿ....ÿ+++++ */
+ $"2B2B 2B2B C0EC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++Àìì.°°ì+++++ */
+ $"FFC0 ECC0 FF00 0000 00FF 2B2B 2B2B 2B2B" /* ÿÀìÀÿ....ÿ++++++ */
+ $"2B2B 2B2B 2BF9 B0F9 B0EC C02B 2B2B 2B2B" /* +++++ù°ù°ìÀ+++++ */
+ $"2BFF C0FF 2BFF 0000 FF2B 2B2B 2B2B 2B2B" /* +ÿÀÿ+ÿ..ÿ+++++++ */
+ $"2B2B 2B2B ECEC EC00 B0B0 EC2B 2B2B 2B2B" /* ++++ììì.°°ì+++++ */
+ $"2B2B FF2B 2B2B FF00 00FF 2B2B 2B2B 2B2B" /* ++ÿ+++ÿ..ÿ++++++ */
+ $"2B2B 2B2B ECEC B02B B0EC B02B 2B2B 2B2B" /* ++++ìì°+°ì°+++++ */
+ $"2B2B 2B2B 2B2B 2BFF 0000 FF2B 2B2B 2B2B" /* +++++++ÿ..ÿ+++++ */
+ $"2B2B 2B2B ECEC EC00 FCEC F92B 2B2B 2B2B" /* ++++ììì.üìù+++++ */
+ $"2B2B 2B2B 2B2B FF00 0000 00FF 2B2B 2B2B" /* ++++++ÿ....ÿ++++ */
+ $"2B2B 2B2B 2BEC B000 ECB0 EC2B 2B2B 2B2B" /* +++++ì°.ì°ì+++++ */
+ $"2B2B 2B2B 2BFF 0000 0000 0000 FF2B 2B2B" /* +++++ÿ......ÿ+++ */
+ $"2B2B 2B2B 2BEC FC2B B0FC 2B2B 2B2B 2B2B" /* +++++ìü+°ü++++++ */
+ $"2B2B 2B2B FF00 0000 0000 0000 00FF 2B2B" /* ++++ÿ........ÿ++ */
+ $"2B2B 2B2B 2BEC B000 B0EC EC2B 2B2B 2B2B" /* +++++ì°.°ìì+++++ */
+ $"2B2B 2BFF 0000 0000 0000 0000 0000 FF2B" /* +++ÿ..........ÿ+ */
+ $"2B2B 2B2B 2B2B B000 7FB0 2B2B 2B2B 2B2B" /* ++++++°..°++++++ */
+ $"2B2B FF00 0000 0000 0000 0000 0000 00FF" /* ++ÿ............ÿ */
+ $"2B2B 2B2B 2B2B B000 B0EC 2B2B 2B2B 2B2B" /* ++++++°.°ì++++++ */
+ $"2BFF 0000 0000 0000 0000 0000 0000 0000" /* +ÿ.............. */
+ $"FF2B 2B2B 2B2B F900 B02B 2B2B 2B2B 2B2B" /* ÿ+++++ù.°+++++++ */
+ $"FF00 0000 0000 0000 0000 0000 0000 0000" /* ÿ............... */
+ $"00FF 2B2B 2B2B F900 F92B 2B2B 2B2B 2BFF" /* .ÿ++++ù.ù++++++ÿ */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 FF2B 2B2B F900 F92B 2B2B 2B2B FF00" /* ..ÿ+++ù.ù+++++ÿ. */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 00FF 2B2B F900 F92B 2B2B 2BFF 0000" /* ...ÿ++ù.ù++++ÿ.. */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 FF2B 2B00 2B2B 2B2B FF00 0000" /* ....ÿ++.++++ÿ... */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 00FF 2BF9 2B2B 2BFF 0000 0000" /* .....ÿ+ù+++ÿ.... */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 0000 FF2B 2B2B FF00 0000 0000" /* ......ÿ+++ÿ..... */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 0000 00FF 2BFF 0000 0000 0000" /* .......ÿ+ÿ...... */
+ $"0000 0000 0000 0000 0000 0000 0000 0000" /* ................ */
+ $"0000 0000 0000 0000 FF00 0000 0000 0000" /* ........ÿ....... */
+ $"0000 0000 0000 0000" /* ........ */
+};
diff --git a/tk/macosx/tkAboutDlg.r b/tk/macosx/tkAboutDlg.r
new file mode 100644
index 00000000000..ae04ecdf655
--- /dev/null
+++ b/tk/macosx/tkAboutDlg.r
@@ -0,0 +1,393 @@
+/*
+ * tkAboutDlg.r --
+ *
+ * This file creates resources for use in most Tk applications.
+ * This is designed to be an example of using the Tcl/Tk
+ * libraries in a Macintosh Application.
+ *
+ * Copyright (c) 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$
+ */
+
+
+
+/*
+ * New style DLOG templates have an extra field for the positioning
+ * options for the Dialog Box. We will not use this, for now, so we
+ * turn it off here.
+ */
+
+#define DLOG_RezTemplateVersion 0
+
+/*
+ * The folowing include and defines help construct
+ * the version string for Tcl.
+ */
+
+#define RESOURCE_INCLUDED
+#include <Carbon.r>
+#include <tcl.h>
+#include "tk.h"
+
+#if (TK_RELEASE_LEVEL == 0)
+# define RELEASE_LEVEL alpha
+#elif (TK_RELEASE_LEVEL == 1)
+# define RELEASE_LEVEL beta
+#elif (TK_RELEASE_LEVEL == 2)
+# define RELEASE_LEVEL final
+#endif
+
+#if (TK_RELEASE_LEVEL == 2)
+# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+#else
+# define MINOR_VERSION TK_MINOR_VERSION * 16
+#endif
+
+#define RELEASE_CODE 0x00
+
+/*
+ * The following two resources define the default "About Box" for Mac Tk.
+ * This dialog appears if the "About Tk..." menu item is selected from
+ * the Apple menu. This dialog may be overridden by defining a Tcl procedure
+ * with the name of "tkAboutDialog". If this procedure is defined the
+ * default dialog will not be shown and the Tcl procedure is expected to
+ * create and manage an About Dialog box.
+ */
+
+data 'DLOG' (128, "Default About Box", purgeable) {
+ $"0055 006B 00F3 0196 0001 0100 0100 0000"
+ $"0000 0081 0000 280A"
+};
+
+resource 'DITL' (129, "About Box", purgeable) {
+ {
+ {128, 128, 148, 186}, Button {enabled, "Ok"},
+ { 14, 108, 117, 298}, StaticText {disabled,
+ "Wish - Windowing Shell" "\n" "based on Tcl "
+ TCL_PATCH_LEVEL " & Tk " TK_PATCH_LEVEL "\n\n" "Jim Ingham & Ray Johnson"
+ "Scriptics Inc." "\n" "jingham@cygnus.com"},
+ { 11, 24, 111, 92}, Picture {enabled, 128}
+ }
+};
+
+data 'PICT' (128, purgeable) {
+ $"13A4 0000 0000 0064 0044 0011 02FF 0C00"
+ $"FFFE 0000 0048 0000 0048 0000 0000 0000"
+ $"0064 0044 0000 0000 0001 000A 0000 0000"
+ $"0064 0044 0099 8044 0000 0000 0064 0044"
+ $"0000 0000 0000 0000 0048 0000 0048 0000"
+ $"0000 0008 0001 0008 0000 0000 0108 00D8"
+ $"0000 0000 0001 5A5A 8000 00FF 3736 FF00"
+ $"FF00 FF00 3535 FF00 FF00 CC00 3434 FF00"
+ $"FF00 9900 3333 FF00 FF00 6600 3736 FF00"
+ $"FF00 3300 3535 FF00 FF00 0000 3434 FF00"
+ $"CC00 FF00 3333 FF00 CC00 CC00 3736 FF00"
+ $"CC00 9900 3535 FF00 CC00 6600 FAFA FF00"
+ $"CC00 3300 3333 FF00 CC00 0000 3130 FF00"
+ $"9900 FF00 2F2F FF00 9900 CC00 FAFA FF00"
+ $"9900 9900 F9F9 FF00 9900 6600 3130 FF00"
+ $"9900 3300 2F2F FF00 9900 0000 2E2E FF00"
+ $"6600 FF00 F9F9 FF00 6600 CC00 3130 FF00"
+ $"6600 9900 2F2F FF00 6600 6600 2E2E FF00"
+ $"6600 3300 2D2D FF00 6600 0000 3130 FF00"
+ $"3300 FF00 2F2F FF00 3300 CC00 2E2E FF00"
+ $"3300 9900 2D2D FF00 3300 6600 3130 FF00"
+ $"3300 3300 2F2F FF00 3300 0000 2E2E FF00"
+ $"0000 FF00 2D2D FF00 0000 CC00 3130 FF00"
+ $"0000 9900 2F2F FF00 0000 6600 2E2E FF00"
+ $"0000 3300 2DF8 FF00 0000 0000 2B2A CC00"
+ $"FF00 FF00 2929 CC00 FF00 CC00 2828 CC00"
+ $"FF00 9900 27F8 CC00 FF00 6600 2B2A CC00"
+ $"FF00 3300 2929 CC00 FF00 0000 2828 CC00"
+ $"CC00 FF00 2727 CC00 CC00 CC00 2B2A CC00"
+ $"CC00 9900 2929 CC00 CC00 6600 2828 CC00"
+ $"CC00 3300 2727 CC00 CC00 0000 2B2A CC00"
+ $"9900 FF00 2929 CC00 9900 CC00 2828 CC00"
+ $"9900 9900 2727 CC00 9900 6600 DBDB CC00"
+ $"9900 3300 4747 CC00 9900 0000 4646 CC00"
+ $"6600 FF00 4545 CC00 6600 CC00 DBDB CC00"
+ $"6600 9900 4747 CC00 6600 6600 4646 CC00"
+ $"6600 3300 4545 CC00 6600 0000 DBDB CC00"
+ $"3300 FF00 4747 CC00 3300 CC00 4646 CC00"
+ $"3300 9900 4545 CC00 3300 6600 DBDB CC00"
+ $"3300 3300 4141 CC00 3300 0000 4040 CC00"
+ $"0000 FF00 3F3F CC00 0000 CC00 4342 CC00"
+ $"0000 9900 4141 CC00 0000 6600 4040 CC00"
+ $"0000 3300 3F3F CC00 0000 0000 4342 9900"
+ $"FF00 FF00 4141 9900 FF00 CC00 4040 9900"
+ $"FF00 9900 3F3F 9900 FF00 6600 4342 9900"
+ $"FF00 3300 4141 9900 FF00 0000 4040 9900"
+ $"CC00 FF00 3F3F 9900 CC00 CC00 4342 9900"
+ $"CC00 9900 4141 9900 CC00 6600 4040 9900"
+ $"CC00 3300 3F3F 9900 CC00 0000 4342 9900"
+ $"9900 FF00 4141 9900 9900 CC00 4040 9900"
+ $"9900 9900 3F3F 9900 9900 6600 3D3C 9900"
+ $"9900 3300 3B3B 9900 9900 0000 3A3A 9900"
+ $"6600 FF00 3939 9900 6600 CC00 3D3C 9900"
+ $"6600 9900 3B3B 9900 6600 6600 3A3A 9900"
+ $"6600 3300 3939 9900 6600 0000 3D3C 9900"
+ $"3300 FF00 3B3B 9900 3300 CC00 3A3A 9900"
+ $"3300 9900 3939 9900 3300 6600 3D3C 9900"
+ $"3300 3300 3B3B 9900 3300 0000 3A3A 9900"
+ $"0000 FF00 3939 9900 0000 CC00 3D3C 9900"
+ $"0000 9900 3B3B 9900 0000 6600 3A3A 9900"
+ $"0000 3300 3939 9900 0000 0000 3D3C 6600"
+ $"FF00 FF00 3B3B 6600 FF00 CC00 3A3A 6600"
+ $"FF00 9900 3939 6600 FF00 6600 3D3C 6600"
+ $"FF00 3300 3B3B 6600 FF00 0000 3A3A 6600"
+ $"CC00 FF00 3939 6600 CC00 CC00 3736 6600"
+ $"CC00 9900 3535 6600 CC00 6600 3434 6600"
+ $"CC00 3300 3333 6600 CC00 0000 3736 6600"
+ $"9900 FF00 3535 6600 9900 CC00 3434 6600"
+ $"9900 9900 3333 6600 9900 6600 3736 6600"
+ $"9900 3300 3535 6600 9900 0000 3434 6600"
+ $"6600 FF00 3333 6600 6600 CC00 3736 6600"
+ $"6600 9900 3535 6600 6600 6600 3434 6600"
+ $"6600 3300 3333 6600 6600 0000 3736 6600"
+ $"3300 FF00 3535 6600 3300 CC00 3434 6600"
+ $"3300 9900 3333 6600 3300 6600 3736 6600"
+ $"3300 3300 3535 6600 3300 0000 3434 6600"
+ $"0000 FF00 3333 6600 0000 CC00 3130 6600"
+ $"0000 9900 2F2F 6600 0000 6600 2E2E 6600"
+ $"0000 3300 F9F9 6600 0000 0000 3130 3300"
+ $"FF00 FF00 2F2F 3300 FF00 CC00 2E2E 3300"
+ $"FF00 9900 F9F9 3300 FF00 6600 3130 3300"
+ $"FF00 3300 2F2F 3300 FF00 0000 2E2E 3300"
+ $"CC00 FF00 2D2D 3300 CC00 CC00 3130 3300"
+ $"CC00 9900 2F2F 3300 CC00 6600 2E2E 3300"
+ $"CC00 3300 2D2D 3300 CC00 0000 3130 3300"
+ $"9900 FF00 2F2F 3300 9900 CC00 2E2E 3300"
+ $"9900 9900 2D2D 3300 9900 6600 3130 3300"
+ $"9900 3300 2F2F 3300 9900 0000 2E2E 3300"
+ $"6600 FF00 2DF8 3300 6600 CC00 2B2A 3300"
+ $"6600 9900 2929 3300 6600 6600 2828 3300"
+ $"6600 3300 27F8 3300 6600 0000 2B2A 3300"
+ $"3300 FF00 2929 3300 3300 CC00 2828 3300"
+ $"3300 9900 2727 3300 3300 6600 2B2A 3300"
+ $"3300 3300 2929 3300 3300 0000 2828 3300"
+ $"0000 FF00 2727 3300 0000 CC00 2B2A 3300"
+ $"0000 9900 2929 3300 0000 6600 2828 3300"
+ $"0000 3300 2727 3300 0000 0000 4948 0000"
+ $"FF00 FF00 4747 0000 FF00 CC00 4646 0000"
+ $"FF00 9900 4545 0000 FF00 6600 4948 0000"
+ $"FF00 3300 4747 0000 FF00 0000 4646 0000"
+ $"CC00 FF00 4545 0000 CC00 CC00 4948 0000"
+ $"CC00 9900 4747 0000 CC00 6600 4646 0000"
+ $"CC00 3300 4545 0000 CC00 0000 4342 0000"
+ $"9900 FF00 4141 0000 9900 CC00 4040 0000"
+ $"9900 9900 3F3F 0000 9900 6600 4342 0000"
+ $"9900 3300 4141 0000 9900 0000 4040 0000"
+ $"6600 FF00 3F3F 0000 6600 CC00 4342 0000"
+ $"6600 9900 4141 0000 6600 6600 4040 0000"
+ $"6600 3300 3F3F 0000 6600 0000 4342 0000"
+ $"3300 FF00 4141 0000 3300 CC00 4040 0000"
+ $"3300 9900 3F3F 0000 3300 6600 4342 0000"
+ $"3300 3300 4141 0000 3300 0000 4040 0000"
+ $"0000 FF00 3F3F 0000 0000 CC00 4342 0000"
+ $"0000 9900 4141 0000 0000 6600 4040 0000"
+ $"0000 3300 3F3F EE00 0000 0000 3D3C DD00"
+ $"0000 0000 3B3B BB00 0000 0000 3A3A AA00"
+ $"0000 0000 3939 8800 0000 0000 3D3C 7700"
+ $"0000 0000 3B3B 5500 0000 0000 3A3A 4400"
+ $"0000 0000 3939 2200 0000 0000 3D3C 1100"
+ $"0000 0000 3B3B 0000 EE00 0000 3A3A 0000"
+ $"DD00 0000 3939 0000 BB00 0000 3D3C 0000"
+ $"AA00 0000 3B3B 0000 8800 0000 3A3A 0000"
+ $"7700 0000 3939 0000 5500 0000 3D3C 0000"
+ $"4400 0000 3B3B 0000 2200 0000 3A3A 0000"
+ $"1100 0000 3939 0000 0000 EE00 3D3C 0000"
+ $"0000 DD00 3B3B 0000 0000 BB00 3A3A 0000"
+ $"0000 AA00 3939 0000 0000 8800 3D3C 0000"
+ $"0000 7700 3B3B 0000 0000 5500 3A3A 0000"
+ $"0000 4400 3939 0000 0000 2200 3736 0000"
+ $"0000 1100 3535 EE00 EE00 EE00 3434 DD00"
+ $"DD00 DD00 3333 BB00 BB00 BB00 3736 AA00"
+ $"AA00 AA00 3535 8800 8800 8800 3434 7700"
+ $"7700 7700 3333 5500 5500 5500 3736 4400"
+ $"4400 4400 3535 2200 2200 2200 3434 1100"
+ $"1100 1100 3333 0000 0000 0000 0000 0000"
+ $"0064 0044 0000 0000 0064 0044 0000 000A"
+ $"0000 0000 0064 0044 02BD 0013 E800 01F5"
+ $"F6FE 07FE 0E02 3232 33FD 3900 0EE6 001D"
+ $"FC00 01F5 F5FE 0700 08FE 0E02 3232 33FE"
+ $"3900 3AFC 40F2 4102 4033 07E9 0017 0100"
+ $"0EFC 40DC 4102 390E F5F5 0002 F5F5 F6FE"
+ $"0702 0E07 0016 0100 32D5 4104 4039 0E32"
+ $"33FD 3900 3AFC 40FC 4101 3200 0801 000E"
+ $"C141 010E 0008 0100 0EC1 4101 0800 0801"
+ $"000E C141 0107 0008 0100 0EC1 4101 0700"
+ $"0901 0007 C241 0240 F500 0E01 0007 E841"
+ $"0147 47DD 4102 4000 0012 0100 07F0 4100"
+ $"47FA 4101 3B3B DD41 0240 0000 1901 0007"
+ $"F141 0C47 3B0B 3B47 4141 4711 0505 3B47"
+ $"DF41 023A 0000 1701 00F6 F041 010B 0BFE"
+ $"4105 473B 0505 113B DE41 0239 0000 1A02"
+ $"00F5 40F3 410C 473B 053B 4741 4741 0B0B"
+ $"3B47 47DE 4102 3900 0018 0200 F540 F341"
+ $"0247 110B FE41 0447 1105 4147 DC41 0233"
+ $"0000 1B02 0000 40F3 4103 4711 1147 FE41"
+ $"0205 3547 F741 FD47 E941 0232 0000 1E02"
+ $"0000 40F2 4106 113B 4741 4735 0BF7 4106"
+ $"4741 390E 0E40 47EA 4102 0E00 0021 0200"
+ $"0040 F241 0711 3B47 4141 0B35 47F9 4102"
+ $"4740 07FE 0002 F640 47EB 4102 0E00 0023"
+ $"0200 0040 F341 0847 3541 4147 3B05 4147"
+ $"FA41 0947 3AF6 00F5 4F55 F50E 47EB 4102"
+ $"0700 0022 0200 003A F341 0147 3BFE 4101"
+ $"0B0B F941 0547 3AF5 0055 C8FE CE01 5640"
+ $"EB41 0207 0000 1F02 0000 39F0 4104 4741"
+ $"053B 47FB 4104 4740 F5F5 A4FC CE01 C85D"
+ $"EB41 02F6 0000 1F02 0000 39F0 4104 473B"
+ $"0541 47FC 4104 4740 07F6 C8FA CE00 64EC"
+ $"4103 40F5 0000 1C02 0000 39F0 4102 4711"
+ $"0BFA 4103 4708 2AC8 FACE 0164 D8EC 4100"
+ $"40FE 0025 0200 0039 EF41 020B 3B47 FC41"
+ $"0347 0FF5 A4FB CE02 C887 D8FC 41FE 47FC"
+ $"4100 47F9 4100 3AFE 0028 0200 0039 EF41"
+ $"020B 3B47 FD41 0347 3900 A4FA CE00 ABFA"
+ $"4109 3B11 3B41 4147 3B0B 3B47 FA41 0039"
+ $"FE00 2402 0000 33F1 4102 4741 0BFA 4101"
+ $"0779 F9CE 0064 FA41 0235 050B FD41 010B"
+ $"0BF9 4100 39FE 0028 0200 0032 F141 0247"
+ $"3B0B FC41 0247 39F6 F9CE 0187 D8FB 4103"
+ $"4741 050B FE41 0247 110B F941 0039 FE00"
+ $"2C02 0000 32F1 4102 473B 11FB 4101 0879"
+ $"FACE 05AA 4041 4147 47FE 410A 4741 0511"
+ $"4741 4147 3511 47FA 4100 32FE 002F 0200"
+ $"000E F141 0347 3B11 47FE 4103 4740 F6C8"
+ $"FACE 0564 D841 4039 39FE 4104 473B 053B"
+ $"47FE 4102 3541 47FA 4100 0EFE 0027 0200"
+ $"000E F141 0347 3B3B 47FE 4102 470F 79FA"
+ $"CE0C 8741 4032 F500 003A 4741 473B 05F2"
+ $"4100 0EFE 0027 0200 000E F141 0347 3B3B"
+ $"47FD 4101 0EA4 FACE 01AB AAFE C808 7900"
+ $"3947 4147 110B 47F3 4100 07FE 001C 0200"
+ $"000E EA41 0240 2BC8 F5CE 0881 0033 4741"
+ $"410B 3B47 F341 0007 FE00 1A02 0000 08EB"
+ $"4102 473A 55F4 CE06 5D00 3947 4741 0BF1"
+ $"4100 F6FE 001C 0200 0007 EB41 0247 3979"
+ $"F4CE 0739 0039 4747 3511 47F3 4101 40F5"
+ $"FE00 1C02 0000 07EB 4102 4739 A4F5 CE08"
+ $"AB0E 0040 4741 1141 47F3 4100 40FD 001B"
+ $"0200 0007 EB41 0247 39A4 F5CE 0787 0707"
+ $"4147 4111 47F2 4100 40FD 001B 0200 0007"
+ $"EB41 0247 39C8 F5CE 0763 F532 4747 3B3B"
+ $"47F2 4100 3AFD 001A 0300 00F6 40EC 4102"
+ $"4739 C8F5 CE05 39F5 4047 413B F041 0039"
+ $"FD00 1C03 0000 F540 EB41 0140 C8FD CE01"
+ $"C8A4 FCCE 03AB 080E 47ED 4100 39FD 001A"
+ $"FE00 0040 EB41 0040 FCCE 01A4 C8FC CE03"
+ $"FA07 4047 ED41 0032 FD00 1AFE 0000 40EA"
+ $"4100 AAFE CE02 87F9 C8FC CE02 560F 47EC"
+ $"4100 32FD 0019 FE00 0040 EA41 00AB FECE"
+ $"0264 56C8 FDCE 01C8 32EA 4100 0EFD 001B"
+ $"FE00 0040 ED41 030E 4047 87FE CE01 4055"
+ $"FCCE 01FA 40EA 4100 08FD 001A FE00 003A"
+ $"ED41 0807 0740 FBCE CEAB 3979 FDCE 00AB"
+ $"E841 0007 FD00 1CFE 0000 3AED 4108 0700"
+ $"F6A4 CECE 8733 79FD CE02 4147 47EA 4100"
+ $"07FD 001E FE00 0039 ED41 0807 2AA4 C8CE"
+ $"CE88 0E9D FECE 0364 1C39 39EB 4101 40F5"
+ $"FD00 1CFE 0000 39ED 4101 074F FDCE 0264"
+ $"F7A4 FECE 03AB 80F6 07EB 4100 40FC 001C"
+ $"FE00 0039 ED41 0108 79FE CE03 AB40 2BA4"
+ $"FCCE 02F7 0E47 EC41 0040 FC00 1CFE 0000"
+ $"39ED 4101 0879 FECE 03AB 40F6 C8FC CE02"
+ $"F615 47EC 4100 40FC 001E FE00 003A EE41"
+ $"0247 0E79 FECE 03AB 40F5 C8FD CE03 A4F5"
+ $"3A47 EC41 0040 FC00 1EFE 0000 3AEE 4102"
+ $"470E 56FE CE03 FB3A F6C8 FDCE 0280 F540"
+ $"EB41 0140 F5FD 001E FE00 0040 EE41 0947"
+ $"0F56 CECE C888 39F6 C8FD CE02 5601 40EB"
+ $"4101 40F5 FD00 1CFE 0000 40EE 4109 4739"
+ $"32CE CEC8 8839 2AC8 FDCE 0156 07E9 4100"
+ $"F6FD 001B FE00 0040 EE41 0847 3A32 CECE"
+ $"C864 152A FCCE 0132 07E9 4100 07FD 001A"
+ $"FE00 0040 ED41 0740 32AB CEC8 6439 4EFC"
+ $"CE01 3A07 E941 0007 FD00 1D03 0000 F540"
+ $"ED41 0740 0EAB CECE 640F 4EFD CE03 AB40"
+ $"0840 EA41 0007 FD00 1B03 0000 F540 EC41"
+ $"060F 81CE CE64 334E FDCE 02AB 400E E941"
+ $"000E FD00 1C02 0000 F6EC 4107 4715 FACE"
+ $"CE64 334E FDCE 0387 0F0E 47EA 4100 0EFD"
+ $"001C 0200 0007 EC41 0747 16F9 CEC8 6433"
+ $"4EFD CE03 6308 4047 EA41 000E FD00 1A02"
+ $"0000 07EB 4106 40F9 CEC8 6439 4EFD CE02"
+ $"3940 47E9 4100 32FD 001B 0200 0007 EA41"
+ $"0539 CECE 8839 F6FE CE04 AB41 4139 40EA"
+ $"4100 32FD 001C 0200 0007 EB41 0E47 3AC8"
+ $"CE88 39F6 C8CE CE64 15F6 F540 EA41 0033"
+ $"FD00 1A02 0000 07EA 410C 40A4 CE87 392A"
+ $"C8CE AB41 40F8 F6E9 4100 39FD 001B 0200"
+ $"000E EB41 0D47 41AB C887 39F5 C8CE ABAB"
+ $"CEA4 07E9 4100 39FD 001C 0200 000E ED41"
+ $"0947 3939 4787 C8AB 40F5 C8FD CE01 A40E"
+ $"E941 0039 FD00 1D02 0000 0EED 4109 473A"
+ $"0007 80CE AB40 F5C8 FDCE 0255 0E47 EA41"
+ $"0039 FD00 1B02 0000 0EEB 4107 0779 C8CE"
+ $"CE40 F6A4 FDCE 022B 3947 EA41 003A FD00"
+ $"1C02 0000 0EEC 4102 4739 79FE CE02 6407"
+ $"A4FE CE02 A407 40E9 4100 40FD 001A 0200"
+ $"0032 EA41 0632 A4CE CE88 0879 FECE 02F9"
+ $"0F47 E941 0040 FD00 1A02 0000 32EB 4107"
+ $"4740 F7C8 CE87 0E79 FECE 0132 40E8 4100"
+ $"40FD 0019 0200 0033 EA41 0B47 40F8 C8AB"
+ $"0E55 CECE 8015 47E8 4100 40FD 0017 0200"
+ $"0033 E941 0847 40F9 A439 4FCE CE5D E641"
+ $"0140 F5FE 0014 0200 0039 E841 0647 64FB"
+ $"392B C8AB E441 00F6 FE00 1102 0000 39E5"
+ $"4103 40F6 8764 E441 0007 FE00 1E02 0000"
+ $"39EB 4102 3A0E 0EFD 4102 0740 47F6 4104"
+ $"400F 0839 47F4 4100 07FE 0027 0200 0039"
+ $"FB41 0147 47F2 4102 0800 40FE 4102 0839"
+ $"47FC 4101 4747 FC41 0339 0039 47F4 4100"
+ $"07FE 0029 0200 0039 FB41 0140 39F3 4109"
+ $"470E F540 4141 470E 3347 FC41 0139 3AFD"
+ $"4104 4739 0039 47F4 4100 08FE 0036 0200"
+ $"003A FC41 0347 0E00 40FC 4102 4741 40FC"
+ $"4109 470E F540 4141 4733 0E47 FE41 0447"
+ $"4000 0E47 FE41 0447 3900 3941 FE40 F741"
+ $"000E FE00 3A02 0000 3AFD 410E 4740 0700"
+ $"0E40 4741 4147 390E 390E 40FE 4108 470E"
+ $"F540 4141 4739 0EFC 4103 0F00 0739 FE41"
+ $"0747 3900 3940 080F 39F7 4100 0EFE 0035"
+ $"0200 0040 FB41 020E 0040 FE41 0D47 4000"
+ $"3941 0032 4741 4147 0EF5 40FE 4101 4008"
+ $"FC41 023A 000E FD41 0547 3900 3939 33F5"
+ $"4100 0EFE 0039 0200 0040 FC41 0347 0E00"
+ $"40FE 4106 4732 0040 4139 40FE 4103 470E"
+ $"F540 FD41 0108 40FE 4104 4740 000E 47FE"
+ $"4106 4739 0007 F540 47F6 4100 32FE 003A"
+ $"0200 0040 FC41 0C47 0E00 4047 4141 470E"
+ $"0040 4747 FD41 0347 0EF5 40FE 410A 470E"
+ $"3947 4141 4740 000E 47FE 4107 4739 000E"
+ $"0007 4147 F741 0032 FE00 3802 0000 40FC"
+ $"4102 470E 00FD 4106 4739 003A 4740 39FE"
+ $"4102 470E F5FD 410A 4733 3347 4141 4740"
+ $"000E 47FE 4106 4739 0039 3900 0EF6 4100"
+ $"33FE 003A 0200 F540 FC41 0447 3200 0E39"
+ $"FD41 0B0E 0E40 333A 4741 413A 07F5 39FE"
+ $"4102 473A 0EFD 410F 40F5 0733 4041 4140"
+ $"0E00 0E40 0700 0E40 F841 0039 FE00 2902"
+ $"00F5 40FA 4101 3939 FB41 023A 3A40 FD41"
+ $"FD40 FD41 0240 0E40 FD41 0240 3940 FD41"
+ $"FA40 F741 0039 FE00 2A01 00F6 F941 0147"
+ $"47FB 4101 4747 FB41 0147 47FB 4101 3940"
+ $"FD41 0147 47FB 4100 47FE 4100 47F6 4100"
+ $"39FE 000D 0100 07E1 4100 40E4 4100 3AFE"
+ $"0009 0100 07C3 4100 3AFE 0009 0100 07C3"
+ $"4100 40FE 0009 0100 07C3 4100 40FE 0009"
+ $"0100 07C3 4100 40FE 000A 0100 0EC3 4103"
+ $"40F5 0000 0901 000E C241 02F6 0000 0901"
+ $"000E C241 0207 0000 0901 000E C241 0207"
+ $"0000 1101 000E ED41 FE40 003A F940 E241"
+ $"0207 0000 2B01 0032 F941 FE40 FE39 0632"
+ $"0E0E 0707 F6F5 F800 02F5 F5F6 FB07 FB0E"
+ $"0332 3233 33FB 3901 3A3A FB40 0207 0000"
+ $"0E0A 000E 3939 320E 0E07 07F6 F5C8 0002"
+ $"BD00 00FF"
+};
diff --git a/tk/macosx/tkMacOSX.h b/tk/macosx/tkMacOSX.h
new file mode 100644
index 00000000000..581bf304b4b
--- /dev/null
+++ b/tk/macosx/tkMacOSX.h
@@ -0,0 +1,34 @@
+/*
+ * tkMacOSXInt.h --
+ *
+ * Declarations of Macintosh specific exported variables and procedures.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#ifndef _TKMAC
+#define _TKMAC
+
+#include <Carbon/Carbon.h>
+#include "tkInt.h"
+
+/*
+ * Structures and function types for handling Netscape-type in process
+ * embedding where Tk does not control the top-level
+ */
+
+typedef int (Tk_MacOSXEmbedRegisterWinProc) (int winID, Tk_Window window);
+typedef GWorldPtr (Tk_MacOSXEmbedGetGrafPortProc) (Tk_Window window);
+typedef int (Tk_MacOSXEmbedMakeContainerExistProc) (Tk_Window window);
+typedef void (Tk_MacOSXEmbedGetClipProc) (Tk_Window window, RgnHandle rgn);
+typedef void (Tk_MacOSXEmbedGetOffsetInParentProc) (Tk_Window window, Point *ulCorner);
+
+#include "tkPlatDecls.h"
+
+#endif /* _TKMAC */
diff --git a/tk/macosx/tkMacOSXAppInit.c b/tk/macosx/tkMacOSXAppInit.c
new file mode 100644
index 00000000000..b088faace24
--- /dev/null
+++ b/tk/macosx/tkMacOSXAppInit.c
@@ -0,0 +1,241 @@
+/*
+ * tkAppInit.c --
+ *
+ * Provides a default version of the Tcl_AppInit procedure for
+ * use in wish and similar Tk-based applications.
+ *
+ * Copyright (c) 1993 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+#include <pthread.h>
+#include "tk.h"
+#include "tclInt.h"
+#include "locale.h"
+
+#include <Carbon/Carbon.h>
+#include "tkMacOSX.h"
+#include "tkMacOSXEvent.h"
+
+#ifndef MAX_PATH_LEN
+ #define MAX_PATH_LEN 1024
+#endif
+
+/*
+ * If the App is in an App package, then we want to add the Scripts
+ * directory to the auto_path. But we have to wait till after the
+ * Tcl_Init is run, or it gets blown away. This stores what we
+ * figured out in main.
+ */
+
+char scriptPath[MAX_PATH_LEN + 1];
+
+extern Tcl_Interp *gStdoutInterp;
+
+#ifdef TK_TEST
+extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
+#endif /* TK_TEST */
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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(argc, argv)
+ int argc; /* Number of command-line arguments. */
+ char **argv; /* Values of command-line arguments. */
+{
+ int textEncoding; /*
+ * Variable used to take care of
+ * lazy font initialization
+ */
+ CFBundleRef bundleRef;
+
+ /*
+ * The following #if block allows you to change the AppInit
+ * function by using a #define of TCL_LOCAL_APPINIT instead
+ * of rewriting this entire file. The #if checks for that
+ * #define and uses Tcl_AppInit if it doesn't exist.
+ */
+
+#ifndef TK_LOCAL_APPINIT
+#define TK_LOCAL_APPINIT Tcl_AppInit
+#endif
+ extern int TK_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));
+
+ scriptPath[0] = '\0';
+
+ /*
+ * The following #if block allows you to change how Tcl finds the startup
+ * script, prime the library or encoding paths, fiddle with the argv,
+ * etc., without needing to rewrite Tk_Main(). Note, if you use this
+ * hook, then I won't do the CFBundle lookup, since if you are messing
+ * around at this level, you probably don't want me to do this for you...
+ */
+
+#ifdef TK_LOCAL_MAIN_HOOK
+ extern int TK_LOCAL_MAIN_HOOK _ANSI_ARGS_((int *argc, char ***argv));
+ TK_LOCAL_MAIN_HOOK(&argc, &argv);
+#else
+
+ /*
+ * On MacOS X, we look for a file in the Resources/Scripts directory
+ * called AppMain.tcl and if found, we set argv[1] to that, so that
+ * the rest of the code will find it, and add the Scripts folder to
+ * the auto_path. If we don't find the startup script, we just bag
+ * it, assuming the user is starting up some other way.
+ */
+
+ bundleRef = CFBundleGetMainBundle();
+
+ if (bundleRef != NULL) {
+ CFURLRef appMainURL;
+ appMainURL = CFBundleCopyResourceURL(bundleRef,
+ CFSTR("AppMain"),
+ CFSTR("tcl"),
+ CFSTR("Scripts"));
+
+ if (appMainURL != NULL) {
+ CFURLRef scriptFldrURL;
+ char *startupScript = malloc(MAX_PATH_LEN + 1);
+
+ if (CFURLGetFileSystemRepresentation (appMainURL, true,
+ startupScript, MAX_PATH_LEN)) {
+ TclSetStartupScriptFileName(startupScript);
+ scriptFldrURL = CFBundleCopyResourceURL(bundleRef,
+ CFSTR("Scripts"),
+ NULL,
+ NULL);
+ CFURLGetFileSystemRepresentation(scriptFldrURL,
+ true, scriptPath, MAX_PATH_LEN);
+ CFRelease(scriptFldrURL);
+ } else {
+ free(startupScript);
+ }
+ CFRelease(appMainURL);
+ }
+ }
+
+#endif
+ textEncoding=GetApplicationTextEncoding();
+
+ /*
+ * Now add the scripts folder to the auto_path.
+ */
+
+ Tk_Main(argc,argv,TK_LOCAL_APPINIT);
+ return 0; /* Needed only to prevent compiler warning. */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_AppInit --
+ *
+ * This procedure performs application-specific initialization.
+ * Most applications, especially those that incorporate additional
+ * packages, will have their own version of this procedure.
+ *
+ * Results:
+ * Returns a standard Tcl completion code, and leaves an error
+ * message in the interp's result if an error occurs.
+ *
+ * Side effects:
+ * Depends on the startup script.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tcl_AppInit(interp)
+ Tcl_Interp *interp; /* Interpreter for application. */
+{
+ if (Tcl_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ if (Tk_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
+
+ if (scriptPath[0] != '\0') {
+ Tcl_SetVar(interp, "auto_path", scriptPath,
+ TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
+ }
+
+#ifdef TK_TEST
+ if (Tktest_Init(interp) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
+ Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
+ (Tcl_PackageInitProc *) NULL);
+#endif /* TK_TEST */
+
+ /*
+ * If we don't have a TTY, then use the Tk based console
+ * interpreter instead.
+ */
+
+ if (ttyname(0) == NULL) {
+ Tk_InitConsoleChannels(interp);
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDIN));
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDOUT));
+ Tcl_RegisterChannel(interp, Tcl_GetStdChannel(TCL_STDERR));
+ if (Tk_CreateConsoleWindow(interp) == TCL_ERROR) {
+ goto error;
+ }
+ /* Only show the console if we don't have a startup script */
+ if (TclGetStartupScriptPath() == NULL) {
+ Tcl_Eval(interp, "console show");
+ }
+ }
+
+ /*
+ * 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.
+ */
+
+ /*
+ * Call Tcl_CreateCommand for application-specific commands, if
+ * they weren't already created by the init procedures called above.
+ */
+
+
+ /*
+ * Specify a user-specific startup file to invoke if the application
+ * is run interactively. Typically the startup file is "~/.apprc"
+ * where "app" is the name of the application. If this line is deleted
+ * then no user-specific startup file will be run under any conditions.
+ */
+
+ Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
+
+ return TCL_OK;
+
+ error:
+ return TCL_ERROR;
+}
diff --git a/tk/macosx/tkMacOSXApplication.r b/tk/macosx/tkMacOSXApplication.r
new file mode 100644
index 00000000000..150ede963aa
--- /dev/null
+++ b/tk/macosx/tkMacOSXApplication.r
@@ -0,0 +1,276 @@
+/*
+ * tkMacOSXApplication.r --
+ *
+ * This file creates resources for use in the Wish application.
+ *
+ * Copyright (c) 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$
+ */
+
+#include <Carbon/Carbon.r>
+
+/*
+ * The folowing include and defines help construct
+ * the version string for Tcl.
+ */
+
+#define RESOURCE_INCLUDED
+#include "tk.h"
+
+#if (TK_RELEASE_LEVEL == 0)
+# define RELEASE_LEVEL alpha
+#elif (TK_RELEASE_LEVEL == 1)
+# define RELEASE_LEVEL beta
+#elif (TK_RELEASE_LEVEL == 2)
+# define RELEASE_LEVEL final
+#endif
+
+#if (TK_RELEASE_LEVEL == 2)
+# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+#else
+# define MINOR_VERSION TK_MINOR_VERSION * 16
+#endif
+
+#define RELEASE_CODE 0x00
+
+resource 'vers' (1) {
+ TK_MAJOR_VERSION, MINOR_VERSION,
+ RELEASE_LEVEL, 0x00, verUS,
+ TK_PATCH_LEVEL,
+ TK_PATCH_LEVEL ", by Jim Ingham & Ian Reid" "\n" "© 2001 Apple Computer, Inc" "\n" "1998-2000 Scriptics Inc." "\n" "1996-1997 Sun Microsystems Inc."
+};
+
+resource 'vers' (2) {
+ TK_MAJOR_VERSION, MINOR_VERSION,
+ RELEASE_LEVEL, 0x00, verUS,
+ TK_PATCH_LEVEL,
+ "Wish " TK_PATCH_LEVEL " © 1993-1999"
+};
+
+#define TK_APP_RESOURCES 128
+#define TK_APP_CREATOR 'WIsH'
+
+/*
+ * The 'BNDL' resource is the primary link between a file's
+ * creator/type and its icon. This resource acts for all Tcl shared
+ * libraries; other libraries will not need one and ought to use
+ * custom icons rather than new file types for a different appearance.
+ */
+
+resource 'BNDL' (TK_APP_RESOURCES, "Tk app bundle", purgeable)
+{
+ TK_APP_CREATOR,
+ 0,
+ {
+ 'FREF',
+ {
+ 0, TK_APP_RESOURCES,
+ 1, TK_APP_RESOURCES+1
+ },
+ 'ICN#',
+ {
+ 0, TK_APP_RESOURCES,
+ 1, TK_APP_RESOURCES+1
+ }
+ }
+};
+
+resource 'FREF' (TK_APP_RESOURCES, purgeable)
+{
+ 'APPL', 0, ""
+};
+resource 'FREF' (TK_APP_RESOURCES+1, purgeable)
+{
+ 'TEXT', 1, ""
+};
+
+type TK_APP_CREATOR as 'STR ';
+resource TK_APP_CREATOR (0, purgeable) {
+ "Wish " TK_PATCH_LEVEL " © 1996"
+};
+
+/*
+ * The 'kind' resource works with a 'BNDL' in Macintosh Easy Open
+ * to affect the text the Finder displays in the "kind" column and
+ * file info dialog. This information will be applied to all files
+ * with the listed creator and type.
+ */
+resource 'kind' (TK_APP_RESOURCES, "Tcl kind", purgeable) {
+ TK_APP_CREATOR,
+ 0, /* region = USA */
+ {
+ 'APPL', "Wish",
+ 'TEXT', "Tcl/Tk Script"
+ }
+};
+
+#define kIconHelpString 256
+
+resource 'hfdr' (-5696, purgeable) {
+ HelpMgrVersion, hmDefaultOptions, 0, 0,
+ {HMSTRResItem {kIconHelpString}}
+};
+resource 'STR ' (kIconHelpString, purgeable) {
+ "This is the interpreter for Tcl & Tk scripts"
+ " running on Macintosh computers."
+};
+
+/*
+ * The following resource define the icon used by Tcl scripts. Any
+ * TEXT file with the creator of WIsH will get this icon.
+ */
+
+data 'icl4' (TK_APP_RESOURCES + 1, "Tk Doc", purgeable) {
+ $"000F FFFF FFFF FFFF FFFF FFF0 0000 0000"
+ $"000F 3333 3333 3333 3333 33FF 0000 0000"
+ $"000F 3333 3333 3333 3433 33F2 F000 0000"
+ $"000F 3333 3333 3333 7D43 33F2 2F00 0000"
+ $"000F 3333 3333 3335 5623 33F2 22F0 0000"
+ $"000F 3333 3333 3356 6343 33FF FFFF 0000"
+ $"000F 3333 3333 256F 5223 3333 333F 0000"
+ $"000F 3333 3333 D666 2433 3333 333F 0000"
+ $"000F 3333 3333 D5F6 6633 3333 333F 0000"
+ $"000F 3333 3332 5666 6733 3333 333F 0000"
+ $"000F 3333 3336 E56F 6633 3333 333F 0000"
+ $"000F 3333 3336 5656 5733 3333 333F 0000"
+ $"000F 3333 3336 E5B6 5233 3333 333F 0000"
+ $"000F 3333 3336 5ED6 3333 3333 333F 0000"
+ $"000F 3333 3376 6475 6233 3333 333F 0000"
+ $"000F 3333 333D 5D56 7333 3333 333F 0000"
+ $"000F 3333 3336 6C55 6333 3333 333F 0000"
+ $"000F 3333 3336 5C56 7333 3333 333F 0000"
+ $"000F 3333 3362 6CE6 D333 3333 333F 0000"
+ $"000F 3333 3336 5C65 6333 3333 333F 0000"
+ $"000F 3333 3336 EC5E 3333 3333 333F 0000"
+ $"000F 3333 3336 5C56 6333 3333 333F 0000"
+ $"000F 3333 3333 5C75 3333 3333 333F 0000"
+ $"000F 3333 3333 5DD6 3333 3333 333F 0000"
+ $"000F 3333 3333 3CDD 3333 3333 333F 0000"
+ $"000F 3333 3333 3303 3333 3333 333F 0000"
+ $"000F 3333 3333 3C33 3333 3333 333F 0000"
+ $"000F 3333 3333 3C33 3333 3333 333F 0000"
+ $"000F 3333 3333 3C33 3333 3333 333F 0000"
+ $"000F 3333 3333 3333 3333 3333 333F 0000"
+ $"000F 3333 3333 3333 3333 3333 333F 0000"
+ $"000F FFFF FFFF FFFF FFFF FFFF FFFF 0000"
+};
+
+data 'ICN#' (TK_APP_RESOURCES + 1, "Tk Doc", purgeable) {
+ $"1FFF FE00 1000 0300 1000 F280 1003 F240"
+ $"1003 E220 1007 E3F0 100F C010 100F C010"
+ $"100F C010 101F F010 101F F010 101F F010"
+ $"101F F010 101F F010 101D E010 101D E010"
+ $"101D E010 101D C010 101D C010 101D C010"
+ $"101D C010 100D 8010 100D 8010 100D 8010"
+ $"1005 8010 1002 0010 1002 0010 1002 0010"
+ $"1002 0010 1002 0010 1000 0010 1FFF FFF0"
+ $"1FFF FE00 1FFF FF00 1FFF FF80 1FFF FFC0"
+ $"1FFF FFE0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
+ $"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
+ $"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
+ $"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
+ $"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
+ $"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
+ $"1FFF FFF0 1FFF FFF0 1FFF FFF0 1FFF FFF0"
+};
+
+data 'ics#' (TK_APP_RESOURCES + 1, "Tk Doc", purgeable) {
+ $"7FF0 41D8 419C 4384 43C4 47C4 47C4 4784"
+ $"4684 4684 4284 4284 4104 4104 4104 7FFC"
+ $"7FE0 7FF0 7FF8 7FFC 7FFC 7FFC 7FFC 7FFC"
+ $"7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC"
+};
+
+data 'ics4' (TK_APP_RESOURCES + 1, "Tk Doc", purgeable) {
+ $"0FFF FFFF FFFF 0000 0F33 3333 53F2 F000"
+ $"0F33 3335 52FF FF00 0F33 33E6 3333 3F00"
+ $"0F33 3256 6333 3F00 0F33 3556 6333 3F00"
+ $"0F33 3A5E 3333 3F00 0F33 65D6 D333 3F00"
+ $"0F33 3655 5333 3F00 0F33 65C6 3333 3F00"
+ $"0F33 3EC5 E333 3F00 0F33 36C6 3333 3F00"
+ $"0F33 33CD 3333 3F00 0F33 33C3 3333 3F00"
+ $"0F33 33C3 3333 3F00 0FFF FFFF FFFF FF00"
+};
+
+/*
+ * The following resources define the icons for the Wish
+ * application.
+ */
+
+data 'icl4' (TK_APP_RESOURCES, "Tk App", purgeable) {
+ $"0000 0000 0000 000F 0000 0000 0000 0000"
+ $"0000 0000 0000 00FC F000 0000 0000 0000"
+ $"0000 0000 0000 0FCC CF66 0000 0000 0000"
+ $"0000 0000 0000 FCCC C556 0000 0000 0000"
+ $"0000 0000 000F CCCC 566F 0000 0000 0000"
+ $"0000 0000 00FC CCC5 6F5C F000 0000 0000"
+ $"0000 0000 0FCC CC66 66CC CF00 0000 0000"
+ $"0000 0000 FCCC CCD5 5666 CCF0 0000 0000"
+ $"0000 000F CCCC C656 5667 CCCF 0000 0000"
+ $"0000 00FC CCCC C6E5 5566 CCCC F000 0000"
+ $"0000 0FCC CCCC C656 5657 CCCC CF00 0000"
+ $"0000 FCCC CCCC C6E5 565C CCCC CCF0 0000"
+ $"000F CCCC CCCC C655 565C CCCC CCCF 0000"
+ $"00FC CCCC CCCC 7660 556C CCCC CCCC F000"
+ $"0FCC CCCC CCCC CD5D 567C CCCC CCCC CF00"
+ $"FCCC CCCC CCCC 6660 556C CCCC CCCC CCF0"
+ $"0FCC CCCC CCCC 665C 565C CCCC CCCC C0CF"
+ $"00FC CCCC CCCC 6660 E6DC CCCC CCCC CCF0"
+ $"000F CCCC CCCC C650 656C CCCC CCCC CF00"
+ $"0000 FCCC CCCC C6EC 5ECC CCCC CCCC F000"
+ $"0000 0FCC CCCC C650 566C CCCC CCCF 0000"
+ $"0000 00FC CCCC CC50 75CC CCCC CCF0 0000"
+ $"0000 000F CCCC CC50 56CC CCCC CF00 0000"
+ $"0000 0000 FCCC CCC0 5CCC CCCC F000 0000"
+ $"0000 0000 0FCC CCC0 CCCC CCCF 0000 0000"
+ $"0000 0000 00FC CCC0 CCCC CCF0 0000 0000"
+ $"0000 0000 000F CCC0 CCCC CF00 0000 0000"
+ $"0000 0000 0000 FCCC CCCC F000 0000 0000"
+ $"0000 0000 0000 0FCC CCCF 0000 0000 0000"
+ $"0000 0000 0000 00FC CCF0 0000 0000 0000"
+ $"0000 0000 0000 000F CF00 0000 0000 0000"
+ $"0000 0000 0000 0000 F000 0000 0000 0000"
+};
+
+data 'ICN#' (TK_APP_RESOURCES, "Tk App", purgeable) {
+ $"0001 0000 0002 8000 0004 7000 0008 7000"
+ $"0010 F000 0021 E800 0043 C400 0081 F200"
+ $"0107 F100 0207 F080 0407 F040 0807 E020"
+ $"1007 E010 200E E008 4002 E004 800E E002"
+ $"400E E001 200E C002 1006 E004 0806 C008"
+ $"0406 E010 0202 C020 0102 C040 0080 8080"
+ $"0041 0100 0021 0200 0011 0400 0009 0800"
+ $"0004 1000 0002 2000 0001 4000 0000 8000"
+ $"0001 0000 0003 8000 0007 F000 000F F000"
+ $"001F F000 003F F800 007F FC00 00FF FE00"
+ $"01FF FF00 03FF FF80 07FF FFC0 0FFF FFE0"
+ $"1FFF FFF0 3FFF FFF8 7FFF FFFC FFFF FFFE"
+ $"7FFF FFFF 3FFF FFFE 1FFF FFFC 0FFF FFF8"
+ $"07FF FFF0 03FF FFE0 01FF FFC0 00FF FF80"
+ $"007F FF00 003F FE00 001F FC00 000F F800"
+ $"0007 F000 0003 E000 0001 C000 0000 8000"
+};
+
+data 'ics#' (TK_APP_RESOURCES, "Tk App", purgeable) {
+ $"01C0 0260 04E0 09D0 1388 23C4 43C2 8281"
+ $"8282 4284 2188 1190 0920 0540 0280 0100"
+ $"01C0 03E0 07E0 0FF0 1FF8 3FFC 7FFE FFFF"
+ $"FFFE 7FFC 3FF8 1FF0 0FE0 07C0 0380 0100"
+};
+
+data 'ics4' (TK_APP_RESOURCES, "Tk App", purgeable) {
+ $"0000 000F C000 0000 0000 00FC 6600 0000"
+ $"0000 0FCC 6600 0000 0000 FCC6 66F0 0000"
+ $"000F CCD5 56CF 0000 00FC CC66 57CC F000"
+ $"0FCC CC65 56CC CF00 FCCC CC56 57CC CCF0"
+ $"0FCC CCC6 6CCC CCCF 00FC CCC6 5CCC CCF0"
+ $"000F CCC6 6CCC CF00 0000 FCCC 5CCC F000"
+ $"0000 0FCC CCCF 0000 0000 00FC CCF0 0000"
+ $"0000 000F CF00 0000 0000 0000 F000 0000"
+};
+
+
diff --git a/tk/macosx/tkMacOSXBitmap.c b/tk/macosx/tkMacOSXBitmap.c
new file mode 100644
index 00000000000..723c7d970b5
--- /dev/null
+++ b/tk/macosx/tkMacOSXBitmap.c
@@ -0,0 +1,283 @@
+/*
+ * tkMacOSXBitmap.c --
+ *
+ * This file handles the implementation of native bitmaps.
+ *
+ * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkPort.h"
+#include "tk.h"
+#include "tkMacOSXInt.h"
+
+#include <Carbon/Carbon.h>
+/*
+#include <Icons.h>
+#include <Dialogs.h>
+#include <Resources.h>
+#include <Strings.h>
+*/
+
+/*
+ * Depending on the resource type there are different ways to
+ * draw native icons.
+ */
+#define TYPE1 0 /* Family icon suite. */
+#define TYPE2 1 /* ICON resource. */
+#define TYPE3 2 /* cicn resource. */
+
+/*
+ * This data structure describes the id and type of a given icon.
+ * It is used as the source for native icons.
+ */
+typedef struct {
+ int id; /* Resource Id for Icon. */
+ long int type; /* Type of icon. */
+} NativeIcon;
+
+/*
+ * This structure holds information about native bitmaps.
+ */
+
+typedef struct {
+ char *name; /* Name of icon. */
+ long int type; /* Type of icon. */
+ int id; /* Id of icon. */
+ int size; /* Size of icon. */
+} BuiltInIcon;
+
+/*
+ * This array mapps a string name to the supported builtin icons
+ * on the Macintosh.
+ */
+
+static BuiltInIcon builtInIcons[] = {
+ {"document", TYPE1, kGenericDocumentIconResource, 32},
+ {"stationery", TYPE1, kGenericStationeryIconResource, 32},
+ {"edition", TYPE1, kGenericEditionFileIconResource, 32},
+ {"application", TYPE1, kGenericApplicationIconResource, 32},
+ {"accessory", TYPE1, kGenericDeskAccessoryIconResource, 32},
+ {"folder", TYPE1, kGenericFolderIconResource, 32},
+ {"pfolder", TYPE1, kPrivateFolderIconResource, 32},
+ {"trash", TYPE1, kTrashIconResource, 32},
+ {"floppy", TYPE1, kFloppyIconResource, 32},
+ {"ramdisk", TYPE1, kGenericRAMDiskIconResource, 32},
+ {"cdrom", TYPE1, kGenericCDROMIconResource, 32},
+ {"preferences", TYPE1, kGenericPreferencesIconResource, 32},
+ {"querydoc", TYPE1, kGenericQueryDocumentIconResource, 32},
+ {"stop", TYPE2, kStopIcon, 32},
+ {"note", TYPE2, kNoteIcon, 32},
+ {"caution", TYPE2, kCautionIcon, 32},
+ {(char *) NULL, 0, 0, 0}
+};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDefineNativeBitmaps --
+ *
+ * Add native bitmaps.
+ *
+ * Results:
+ * A standard Tcl result. If an error occurs then TCL_ERROR is
+ * returned and a message is left in the interp's result.
+ *
+ * Side effects:
+ * "Name" is entered into the bitmap table and may be used from
+ * here on to refer to the given bitmap.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDefineNativeBitmaps()
+{
+ int new;
+ Tcl_HashEntry *predefHashPtr;
+ TkPredefBitmap *predefPtr;
+ CONST char * name;
+ BuiltInIcon *builtInPtr;
+ NativeIcon *nativeIconPtr;
+ Tcl_HashTable *tablePtr;
+
+ for (builtInPtr = builtInIcons; builtInPtr->name != NULL; builtInPtr++) {
+ name = Tk_GetUid(builtInPtr->name);
+ tablePtr = TkGetBitmapPredefTable();
+ predefHashPtr = Tcl_CreateHashEntry(tablePtr, name, &new);
+ if (!new) {
+ continue;
+ }
+ predefPtr = (TkPredefBitmap *) ckalloc(sizeof(TkPredefBitmap));
+ nativeIconPtr = (NativeIcon *) ckalloc(sizeof(NativeIcon));
+ nativeIconPtr->id = builtInPtr->id;
+ nativeIconPtr->type = builtInPtr->type;
+ predefPtr->source = (char *) nativeIconPtr;
+ predefPtr->width = builtInPtr->size;
+ predefPtr->height = builtInPtr->size;
+ predefPtr->native = 1;
+ Tcl_SetHashValue(predefHashPtr, predefPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateNativeBitmap --
+ *
+ * Add native bitmaps.
+ *
+ * Results:
+ * A standard Tcl result. If an error occurs then TCL_ERROR is
+ * returned and a message is left in the interp's result.
+ *
+ * Side effects:
+ * "Name" is entered into the bitmap table and may be used from
+ * here on to refer to the given bitmap.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Pixmap
+TkpCreateNativeBitmap(
+ Display *display,
+ CONST char * source) /* Info about the icon to build. */
+{
+ Pixmap pix;
+ GWorldPtr destPort;
+ Rect destRect;
+ Handle icon;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ NativeIcon *nativeIconPtr;
+
+ pix = Tk_GetPixmap(display, None, 32, 32, 0);
+ destPort = TkMacOSXGetDrawablePort(pix);
+
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ nativeIconPtr = (NativeIcon *) source;
+ SetRect(&destRect, 0, 0, 32, 32);
+ if (nativeIconPtr->type == TYPE1) {
+ RGBColor white = {0xFFFF, 0xFFFF, 0xFFFF};
+
+ RGBForeColor(&white);
+ PaintRect(&destRect);
+ PlotIconID(&destRect, atAbsoluteCenter, ttNone, nativeIconPtr->id);
+ } else if (nativeIconPtr->type == TYPE2) {
+ icon = GetIcon(nativeIconPtr->id);
+ if (icon != NULL) {
+ RGBColor black = {0, 0, 0};
+
+ RGBForeColor(&black);
+ PlotIcon(&destRect, icon);
+ ReleaseResource(icon);
+ }
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+ return pix;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetNativeAppBitmap --
+ *
+ * Add native bitmaps.
+ *
+ * Results:
+ * A standard Tcl result. If an error occurs then TCL_ERROR is
+ * returned and a message is left in the interp's result.
+ *
+ * Side effects:
+ * "Name" is entered into the bitmap table and may be used from
+ * here on to refer to the given bitmap.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Pixmap
+TkpGetNativeAppBitmap(
+ Display *display, /* The display. */
+ CONST char *name, /* The name of the bitmap. */
+ int *width, /* The width & height of the bitmap. */
+ int *height)
+{
+ Pixmap pix;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ Rect destRect;
+ Handle resource;
+ int type = -1, destWrote;
+ Str255 nativeName;
+
+ /*
+ * macRoman is the encoding that the resource fork uses.
+ */
+
+ Tcl_UtfToExternal(NULL, Tcl_GetEncoding(NULL, "macRoman"), name,
+ strlen(name), 0, NULL,
+ (char *) &nativeName[1],
+ 255, NULL, &destWrote, NULL); /* Internalize native */
+ nativeName[0] = destWrote;
+
+ resource = GetNamedResource('cicn', nativeName);
+ if (resource != NULL) {
+ type = TYPE3;
+ } else {
+ resource = GetNamedResource('ICON', nativeName);
+ if (resource != NULL) {
+ type = TYPE2;
+ }
+ }
+
+ if (resource == NULL) {
+ return NULL;
+ }
+
+ pix = Tk_GetPixmap(display, None, 32, 32, 0);
+ destPort = TkMacOSXGetDrawablePort(pix);
+
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ SetRect(&destRect, 0, 0, 32, 32);
+ if (type == TYPE2) {
+ RGBColor black = {0, 0, 0};
+
+ RGBForeColor(&black);
+ PlotIcon(&destRect, resource);
+ ReleaseResource(resource);
+ } else if (type == TYPE3) {
+ RGBColor white = {0xFFFF, 0xFFFF, 0xFFFF};
+ short id;
+ ResType theType;
+ Str255 dummy;
+
+ /*
+ * We need to first paint the background white. Also, for
+ * some reason we *must* use GetCIcon instead of GetNamedResource
+ * for PlotCIcon to work - so we use GetResInfo to get the id.
+ */
+ RGBForeColor(&white);
+ PaintRect(&destRect);
+ GetResInfo(resource, &id, &theType, dummy);
+ ReleaseResource(resource);
+ resource = (Handle) GetCIcon(id);
+ PlotCIcon(&destRect, (CIconHandle) resource);
+ DisposeCIcon((CIconHandle) resource);
+ }
+
+ *width = 32;
+ *height = 32;
+ SetGWorld(saveWorld, saveDevice);
+ return pix;
+}
diff --git a/tk/macosx/tkMacOSXButton.c b/tk/macosx/tkMacOSXButton.c
new file mode 100644
index 00000000000..a1ec7b7ab66
--- /dev/null
+++ b/tk/macosx/tkMacOSXButton.c
@@ -0,0 +1,1580 @@
+/*
+ * tkMacOSXButton.c --
+ *
+ * This file implements the Macintosh specific portion of the
+ * button widgets.
+ *
+ * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkButton.h"
+#include "tkMacOSXInt.h"
+#include "tkMacOSXDebug.h"
+
+#define DEFAULT_USE_TK_TEXT 0
+
+/*
+ * Default insets for controls
+ */
+#define DEF_INSET_LEFT 2
+#define DEF_INSET_RIGHT 2
+#define DEF_INSET_TOP 2
+#define DEF_INSET_BOTTOM 4
+
+#include <Carbon/Carbon.h>
+
+/*
+ * Some defines used to control what type of control is drawn.
+ */
+
+#define DRAW_LABEL 0 /* Labels are treated genericly. */
+#define DRAW_CONTROL 1 /* Draw using the Native control. */
+#define DRAW_CUSTOM 2 /* Make our own button drawing. */
+#define DRAW_BEVEL 3
+
+/*
+ * Declaration of Mac specific button structure.
+ */
+
+typedef struct {
+ SInt16 initialValue;
+ SInt16 minValue;
+ SInt16 maxValue;
+ SInt16 procID;
+ int isBevel;
+} MacControlParams;
+
+typedef struct {
+ int drawType;
+ Tk_3DBorder border;
+ int relief;
+ int offset; /* 0 means this is a normal widget. 1 means
+ * it is an image button, so we offset the
+ * image to make the button appear to move
+ * up and down as the relief changes. */
+ GC gc;
+ int hasImageOrBitmap;
+} DrawParams;
+
+
+typedef struct {
+ TkButton info; /* generic button info */
+ int id;
+ int usingControl;
+ int useTkText;
+ int flags; /* initialisation status */
+ MacControlParams params;
+ WindowRef windowRef;
+ RGBColor userPaneBackground;
+ ControlRef userPane; /* Carbon control */
+ ControlRef control; /* Carbon control */
+ Str255 controlTitle;
+ ControlFontStyleRec fontStyle;
+ /*
+ * the following are used to store the image content for
+ * beveled buttons - i.e. buttons with images.
+ */
+ CCTabHandle tabHandle;
+ ControlButtonContentInfo bevelButtonContent;
+ OpenCPicParams picParams;
+ Pixmap picPixmap;
+} MacButton;
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+
+static OSErr SetUserPaneDrawProc(ControlRef control,
+ ControlUserPaneDrawProcPtr upp);
+static OSErr SetUserPaneSetUpSpecialBackgroundProc(ControlRef control,
+ ControlUserPaneBackgroundProcPtr upp);
+static void UserPaneDraw(ControlRef control, ControlPartCode cpc);
+static void UserPaneBackgroundProc(ControlHandle,
+ ControlBackgroundPtr info);
+
+static void ButtonEventProc _ANSI_ARGS_(( ClientData clientData, XEvent *eventPtr));
+static int UpdateControlColors _ANSI_ARGS_((MacButton *mbPtr ));
+static void TkMacOSXComputeControlParams _ANSI_ARGS_((TkButton * butPtr, MacControlParams * paramsPtr));
+static int TkMacOSXComputeDrawParams _ANSI_ARGS_((TkButton * butPtr, DrawParams * dpPtr));
+static void TkMacOSXDrawControl _ANSI_ARGS_((MacButton *butPtr,
+ GWorldPtr destPort, GC gc, Pixmap pixmap));
+static void SetupBevelButton _ANSI_ARGS_((MacButton *butPtr,
+ ControlRef controlHandle,
+ GWorldPtr destPort, GC gc, Pixmap pixmap));
+
+extern int TkFontGetFirstTextLayout(Tk_TextLayout layout, Tk_Font * font, char * dst);
+extern void TkMacOSXInitControlFontStyle(Tk_Font tkfont,ControlFontStylePtr fsPtr);
+
+/*
+ * The class procedure table for the button widgets.
+ */
+
+Tk_ClassProcs tkpButtonProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkButtonWorldChanged, /* worldChangedProc */
+};
+
+static int bCount;
+
+int tkPictureIsOpen;
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateButton --
+ *
+ * Allocate a new TkButton structure.
+ *
+ * Results:
+ * Returns a newly allocated TkButton structure.
+ *
+ * Side effects:
+ * Registers an event handler for the widget.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkButton *
+TkpCreateButton(
+ Tk_Window tkwin)
+{
+ MacButton *macButtonPtr;
+ macButtonPtr = (MacButton *) ckalloc(sizeof(MacButton));
+ Tk_CreateEventHandler(tkwin, ActivateMask,
+ ButtonEventProc, (ClientData) macButtonPtr);
+ macButtonPtr->id=bCount++;
+ macButtonPtr->usingControl=0;
+ macButtonPtr->flags=0;
+ macButtonPtr->userPaneBackground.red=0;
+ macButtonPtr->userPaneBackground.green=0;
+ macButtonPtr->userPaneBackground.blue=~0;
+ macButtonPtr->userPane=NULL;
+ macButtonPtr->control=NULL;
+ macButtonPtr->controlTitle[0]=
+ macButtonPtr->controlTitle[1]=0;
+ macButtonPtr->picParams.version = -2;
+ macButtonPtr->picParams.hRes = 0x00480000;
+ macButtonPtr->picParams.vRes = 0x00480000;
+ macButtonPtr->picParams.srcRect.top = 0;
+ macButtonPtr->picParams.srcRect.left = 0;
+ macButtonPtr->picParams.reserved1 = 0;
+ macButtonPtr->picParams.reserved2 = 0;
+ macButtonPtr->bevelButtonContent.contentType = kControlContentPictHandle;
+ bzero(&macButtonPtr->params, sizeof(macButtonPtr->params));
+ bzero(&macButtonPtr->fontStyle,sizeof(macButtonPtr->fontStyle));
+ return (TkButton *)macButtonPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDisplayButton --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDisplayButton(
+ ClientData clientData) /* Information about widget. */
+{
+ MacButton *macButtonPtr = (MacButton *)clientData;
+ TkButton *butPtr = (TkButton *) clientData;
+ Tk_Window tkwin = butPtr->tkwin;
+ int x = 0; /* Initialization only needed to stop
+ * compiler warning. */
+ int y;
+ int width, height, fullWidth, fullHeight;
+ int imageXOffset, imageYOffset, textXOffset, textYOffset;
+ int haveImage = 0, haveText = 0;
+ GWorldPtr destPort;
+ int borderWidth;
+ Pixmap pixmap;
+ int wasUsingControl;
+ DrawParams drawParams, * dpPtr = &drawParams;
+
+ butPtr->flags &= ~REDRAW_PENDING;
+ if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ return;
+ }
+
+ pixmap = (Pixmap) Tk_WindowId(tkwin);
+ wasUsingControl = macButtonPtr->usingControl;
+
+ if (TkMacOSXComputeDrawParams(butPtr, &drawParams) ) {
+ macButtonPtr->usingControl=1;
+ macButtonPtr->useTkText=DEFAULT_USE_TK_TEXT;
+ } else {
+ macButtonPtr->usingControl=0;
+ macButtonPtr->useTkText=1;
+ }
+
+ /*
+ * set up clipping region
+ */
+
+ TkMacOSXSetUpClippingRgn(pixmap);
+
+ /*
+ * See the comment in UpdateControlColors as to why we use the
+ * highlightbackground for the border of Macintosh buttons.
+ */
+
+ if (macButtonPtr->useTkText) {
+ if (butPtr->type == TYPE_BUTTON) {
+ Tk_Fill3DRectangle(tkwin, pixmap, butPtr->highlightBorder, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+ } else {
+ Tk_Fill3DRectangle(tkwin, pixmap, butPtr->normalBorder, 0, 0,
+ Tk_Width(tkwin), Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
+ }
+ }
+
+ /*
+ * Draw the native portion of the buttons. Start by creating the control
+ * if it doesn't already exist. Then configure the Macintosh control from
+ * the Tk info. Finally, we call Draw1Control to draw to the screen.
+ */
+
+ if (macButtonPtr->usingControl) {
+ borderWidth = 0;
+ /*
+ * This part uses Macintosh rather than Tk calls to draw
+ * to the screen. Make sure the ports etc. are set correctly.
+ */
+
+ destPort = TkMacOSXGetDrawablePort(pixmap);
+ SetGWorld(destPort, NULL);
+ TkMacOSXDrawControl(macButtonPtr, destPort, dpPtr->gc, pixmap);
+ } else {
+ if (wasUsingControl && macButtonPtr->userPane) {
+ DisposeControl(macButtonPtr->userPane);
+ macButtonPtr->userPane = NULL;
+ macButtonPtr->control = NULL;
+ macButtonPtr->flags = 0;
+ }
+ }
+
+ if ((dpPtr->drawType == DRAW_CUSTOM) || (dpPtr->drawType == DRAW_LABEL)) {
+ borderWidth = butPtr->borderWidth;
+ }
+
+ /*
+ * Display image or bitmap or text for button. This has
+ * already been done under Appearance with the Bevel
+ * button types.
+ */
+
+ if (dpPtr->drawType == DRAW_BEVEL) {
+ /* Empty Body */
+ } else {
+ if (butPtr->image != None) {
+ Tk_SizeOfImage(butPtr->image, &width, &height);
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
+ haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ imageXOffset = 0;
+ imageYOffset = 0;
+ textXOffset = 0;
+ textYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
+
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ if (butPtr->compound == COMPOUND_TOP) {
+ textYOffset = height + butPtr->padY;
+ } else {
+ imageYOffset = butPtr->textHeight + butPtr->padY;
+ }
+ fullHeight = height + butPtr->textHeight + butPtr->padY;
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /*
+ * Image is left or right of text
+ */
+
+ if (butPtr->compound == COMPOUND_LEFT) {
+ textXOffset = width + butPtr->padX;
+ } else {
+ imageXOffset = butPtr->textWidth + butPtr->padX;
+ }
+ fullWidth = butPtr->textWidth + butPtr->padX + width;
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /*
+ * Image and text are superimposed
+ */
+
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ butPtr->indicatorSpace + fullWidth, fullHeight, &x, &y);
+
+ x += butPtr->indicatorSpace;
+
+ x += dpPtr->offset;
+ y += dpPtr->offset;
+ if (dpPtr->relief == TK_RELIEF_RAISED) {
+ x -= dpPtr->offset;
+ y -= dpPtr->offset;
+ } else if (dpPtr->relief == TK_RELIEF_SUNKEN) {
+ x += dpPtr->offset;
+ y += dpPtr->offset;
+ }
+
+ if (butPtr->image != NULL) {
+ if ((butPtr->selectImage != NULL) &&
+ (butPtr->flags & SELECTED)) {
+ Tk_RedrawImage(butPtr->selectImage, 0, 0,
+ width, height, pixmap, x + imageXOffset,
+ y + imageYOffset);
+ } else {
+ Tk_RedrawImage(butPtr->image, 0, 0, width,
+ height, pixmap, x + imageXOffset,
+ y + imageYOffset);
+ }
+ } else {
+ XSetClipOrigin(butPtr->display, dpPtr->gc, x + imageXOffset,
+ y + imageYOffset);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, dpPtr->gc,
+ 0, 0, (unsigned int) width,
+ (unsigned int) height, x + imageXOffset,
+ y + imageYOffset, 1);
+ XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
+ }
+
+ if (macButtonPtr->useTkText ) {
+ Tk_DrawTextLayout(butPtr->display, pixmap,
+ dpPtr->gc, butPtr->textLayout,
+ x + textXOffset, y + textYOffset, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, dpPtr->gc,
+ butPtr->textLayout,
+ x + textXOffset, y + textYOffset,
+ butPtr->underline);
+ }
+ y += fullHeight/2;
+ } else {
+ if (haveImage) {
+ TkComputeAnchor(butPtr->anchor, tkwin, 0, 0,
+ butPtr->indicatorSpace + width, height, &x, &y);
+ x += butPtr->indicatorSpace;
+
+ x += dpPtr->offset;
+ y += dpPtr->offset;
+ if (dpPtr->relief == TK_RELIEF_RAISED) {
+ x -= dpPtr->offset;
+ y -= dpPtr->offset;
+ } else if (dpPtr->relief == TK_RELIEF_SUNKEN) {
+ x += dpPtr->offset;
+ y += dpPtr->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, dpPtr->gc, x, y);
+ XCopyPlane(butPtr->display, butPtr->bitmap,
+ pixmap, dpPtr->gc,
+ 0, 0, (unsigned int) width,
+ (unsigned int) height, x, y, 1);
+ XSetClipOrigin(butPtr->display, dpPtr->gc, 0, 0);
+ }
+ y += height/2;
+ } else {
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX,
+ butPtr->padY,
+ butPtr->indicatorSpace + butPtr->textWidth,
+ butPtr->textHeight, &x, &y);
+
+ x += butPtr->indicatorSpace;
+
+ if (macButtonPtr->useTkText) {
+ Tk_DrawTextLayout(butPtr->display, pixmap, dpPtr->gc,
+ butPtr->textLayout, x, y, 0, -1);
+ }
+ y += butPtr->textHeight/2;
+ }
+ }
+ }
+
+ /*
+ * 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 (macButtonPtr->useTkText) {
+ if ((butPtr->state == STATE_DISABLED)
+ && ((butPtr->disabledFg == NULL) || (butPtr->image != NULL))) {
+ if ((butPtr->flags & SELECTED) && !butPtr->indicatorOn
+ && (butPtr->selectBorder != NULL)) {
+ XSetForeground(butPtr->display, butPtr->disabledGC,
+ Tk_3DBorderColor(butPtr->selectBorder)->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->selectBorder != NULL)) {
+ XSetForeground(butPtr->display, butPtr->disabledGC,
+ Tk_3DBorderColor(butPtr->normalBorder)->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 (dpPtr->relief != TK_RELIEF_FLAT) {
+ int inset = butPtr->highlightWidth;
+ Tk_Draw3DRectangle(tkwin, pixmap, dpPtr->border, inset, inset,
+ Tk_Width(tkwin) - 2*inset, Tk_Height(tkwin) - 2*inset,
+ butPtr->borderWidth, dpPtr->relief);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpComputeButtonGeometry --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpComputeButtonGeometry(
+ TkButton *butPtr) /* Button whose geometry may have changed. */
+{
+ int width, height, avgWidth, haveImage = 0, haveText = 0;
+ int xInset, yInset;
+ int txtWidth, txtHeight;
+ Tk_FontMetrics fm;
+ DrawParams drawParams;
+
+ /*
+ * First figure out the size of the contents of the button.
+ */
+
+ width = 0;
+ height = 0;
+ txtWidth = 0;
+ txtHeight = 0;
+ avgWidth = 0;
+
+
+ butPtr->indicatorSpace = 0;
+ if (butPtr->image != NULL) {
+ Tk_SizeOfImage(butPtr->image, &width, &height);
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
+
+ if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) {
+ Tk_FreeTextLayout(butPtr->textLayout);
+ butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
+ Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
+ butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
+
+ txtWidth = butPtr->textWidth;
+ txtHeight = butPtr->textHeight;
+ avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ haveText = (txtWidth != 0 && txtHeight != 0);
+ }
+
+ /*
+ * If the button is compound (ie, it shows both an image and text),
+ * the new geometry is a combination of the image and text geometry.
+ * We only honor the compound bit if the button has both text and an
+ * image, because otherwise it is not really a compound button.
+ */
+
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /*
+ * Image is above or below text
+ */
+
+ height += txtHeight + butPtr->padY;
+ width = (width > txtWidth ? width : txtWidth);
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /*
+ * Image is left or right of text
+ */
+
+ width += txtWidth + butPtr->padX;
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /*
+ * Image and text are superimposed
+ */
+
+ width = (width > txtWidth ? width : txtWidth);
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+ 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;
+ }
+ }
+
+ width += 2 * butPtr->padX;
+ height += 2 * butPtr->padY;
+
+ } else {
+ if (haveImage) {
+ 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 {
+ width = txtWidth;
+ height = txtHeight;
+ 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 =
+ (80 * butPtr->indicatorDiameter)/100;
+ }
+ butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth;
+ }
+ }
+ }
+
+ /*
+ * Now figure out the size of the border decorations for the button.
+ */
+
+ if (butPtr->highlightWidth < 0) {
+ butPtr->highlightWidth = 0;
+ }
+
+ /*
+ * The width and height calculation for Appearance buttons with images &
+ * non-Appearance buttons with images is different. In the latter case,
+ * we add the borderwidth to the inset, since we are going to stamp a
+ * 3-D border over the image. In the former, we add it to the height,
+ * directly, since Appearance will draw the border as part of our control.
+ *
+ * When issuing the geometry request, add extra space for the indicator,
+ * if any, and for the border and padding, plus if this is an image two
+ * extra pixels so the display can be offset by 1 pixel in either
+ * direction for the raised or lowered effect.
+ *
+ * The highlight width corresponds to the default ring on the Macintosh.
+ * As such, the highlight width is only added if the button is the default
+ * button. The actual width of the default ring is one less than the
+ * highlight width as there is also one pixel of spacing.
+ * Appearance buttons with images do not have a highlight ring, because the
+ * Bevel button type does not support one.
+ */
+
+ if ((butPtr->image == None) && (butPtr->bitmap == None)) {
+ width += 2*butPtr->padX;
+ height += 2*butPtr->padY;
+ }
+
+ if ((butPtr->type == TYPE_BUTTON)) {
+ if ((butPtr->image == None) && (butPtr->bitmap == None)) {
+ butPtr->inset = 0;
+ if (butPtr->defaultState != STATE_DISABLED) {
+ butPtr->inset += butPtr->highlightWidth;
+ }
+ } else {
+ butPtr->inset = 0;
+ width += (2 * butPtr->borderWidth + 4);
+ height += (2 * butPtr->borderWidth + 4);
+ }
+ } else if ((butPtr->type != TYPE_LABEL)) {
+ if (butPtr->indicatorOn) {
+ butPtr->inset = 0;
+ } else {
+ /*
+ * Under Appearance, the Checkbutton or radiobutton with an image
+ * is represented by a BevelButton with the Sticky defProc...
+ * So we must set its height in the same way as the Button
+ * with an image or bitmap.
+ */
+
+ if ( (butPtr->image != None) || (butPtr->bitmap != None)) {
+ int border;
+ butPtr->inset = 0;
+ if ( butPtr->borderWidth <= 2 ) {
+ border = 6;
+ } else {
+ border = 2 * butPtr->borderWidth + 2;
+ }
+ width += border;
+ height += border;
+ } else {
+ butPtr->inset = butPtr->borderWidth;
+ }
+ }
+ } else {
+ butPtr->inset = butPtr->borderWidth;
+ }
+
+ if (TkMacOSXComputeDrawParams(butPtr,&drawParams)) {
+ xInset = butPtr->indicatorSpace + DEF_INSET_LEFT + DEF_INSET_RIGHT;
+ yInset = DEF_INSET_TOP + DEF_INSET_BOTTOM;
+ } else {
+ xInset = butPtr->indicatorSpace+butPtr->inset*2;
+ yInset = butPtr->inset*2;
+ }
+ Tk_GeometryRequest(butPtr->tkwin, width + xInset, height + yInset);
+ Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyButton --
+ *
+ * Free data structures associated with the button control.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Restores the default control state.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDestroyButton(
+ TkButton *butPtr)
+{
+ MacButton *mbPtr = ( MacButton *) butPtr; /* Mac button. */
+ if (mbPtr->userPane) {
+ DisposeControl(mbPtr->userPane);
+ mbPtr->userPane = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitControl --
+ *
+ * This procedure initialises a Carbon control
+ *
+ * Results:
+ * 0 on success, 1 on failure.
+ *
+ * Side effects:
+ * A background pane control and the control itself is created
+ * The contol is embedded in the background control
+ * The background control is embedded in the root control
+ * of the containing window
+ * The creation parameters for the control are also computed
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXInitControl (
+ MacButton *mbPtr, /* Mac button. */
+ GWorldPtr destPort,
+ GC gc,
+ Pixmap pixmap,
+ Rect *paneRect,
+ Rect *cntrRect
+)
+{
+ OSErr status;
+ TkButton * butPtr = ( TkButton * )mbPtr;
+ ControlRef rootControl;
+ SInt16 procID;
+ Boolean initiallyVisible;
+ SInt16 initialValue;
+ SInt16 minValue;
+ SInt16 maxValue;
+ SInt32 controlReference;
+
+ rootControl = TkMacOSXGetRootControl(Tk_WindowId(butPtr->tkwin));
+ mbPtr->windowRef
+ = GetWindowFromPort(TkMacOSXGetDrawablePort(Tk_WindowId(butPtr->tkwin)));
+
+ /*
+ * Set up the user pane
+ */
+
+ initiallyVisible=false;
+ initialValue=kControlSupportsEmbedding|
+ kControlHasSpecialBackground;
+ minValue=0;
+ maxValue=1;
+ procID=kControlUserPaneProc;
+ controlReference=(SInt32)mbPtr;
+ mbPtr->userPane=NewControl(mbPtr->windowRef,
+ paneRect, "\p",
+ initiallyVisible,
+ initialValue,
+ minValue,
+ maxValue,
+ procID,
+ controlReference );
+
+ if (!mbPtr->userPane) {
+ fprintf(stderr,"Failed to create user pane control\n");
+ return 1;
+ }
+
+ if ((status=EmbedControl(mbPtr->userPane,rootControl))!=noErr) {
+ fprintf(stderr,"Failed to embed user pane control %d\n", status);
+ return 1;
+ }
+
+ SetUserPaneSetUpSpecialBackgroundProc(mbPtr->userPane,
+ UserPaneBackgroundProc);
+ SetUserPaneDrawProc(mbPtr->userPane,UserPaneDraw);
+ initiallyVisible=false;
+ TkMacOSXComputeControlParams(butPtr,&mbPtr->params);
+ mbPtr->control=NewControl(mbPtr->windowRef,
+ cntrRect, "\p",
+ initiallyVisible,
+ mbPtr->params.initialValue,
+ mbPtr->params.minValue,
+ mbPtr->params.maxValue,
+ mbPtr->params.procID,
+ controlReference );
+
+ if (!mbPtr->control) {
+ fprintf(stderr,"failed to create control of type %d\n",procID);
+ return 1;
+ }
+
+ if (EmbedControl(mbPtr->control,mbPtr->userPane) != noErr ) {
+ fprintf(stderr,"failed to embed control of type %d\n",procID);
+ return 1;
+ }
+
+ mbPtr->flags|=(1 + 2);
+ return 0;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkMacOSXDrawControl --
+ *
+ * This function draws the tk button using Mac controls
+ * In addition, this code may apply custom colors passed
+ * in the TkButton.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The control is created, or reinitialised as needed
+ *
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+TkMacOSXDrawControl(
+ MacButton *mbPtr, /* Mac button. */
+ GWorldPtr destPort, /* Off screen GWorld. */
+ GC gc, /* The GC we are drawing into - needed for
+ * the bevel button */
+ Pixmap pixmap) /* The pixmap we are drawing into - needed
+ * for the bevel button */
+
+{
+ TkButton * butPtr = ( TkButton *)mbPtr;
+ int err;
+ TkWindow * winPtr;
+ Rect paneRect;
+ Rect cntrRect;
+ int hilitePart = -1;
+
+
+ winPtr=(TkWindow *)butPtr->tkwin;
+
+ paneRect.left = winPtr->privatePtr->xOff;
+ paneRect.top = winPtr->privatePtr->yOff;
+ paneRect.right = paneRect.left + Tk_Width(butPtr->tkwin);
+ paneRect.bottom = paneRect.top + Tk_Height(butPtr->tkwin);
+
+ cntrRect=paneRect;
+
+/*
+ cntrRect.left+=butPtr->inset;
+ cntrRect.top+=butPtr->inset;
+ cntrRect.right-=butPtr->inset;
+ cntrRect.bottom-=butPtr->inset;
+*/
+ cntrRect.left+=DEF_INSET_LEFT;
+ cntrRect.top+=DEF_INSET_TOP;
+ cntrRect.right-=DEF_INSET_RIGHT;
+ cntrRect.bottom-=DEF_INSET_BOTTOM;
+
+ /*
+ * The control has been previously initialised
+ * It may need to be re-initialised
+ */
+
+ if (mbPtr->flags) {
+ MacControlParams params;
+ TkMacOSXComputeControlParams(butPtr, &params);
+ if (bcmp(&params, &mbPtr->params, sizeof(params))) {
+ /*
+ * the type of control has changed
+ * Clean it up and clear the flag
+ */
+
+ if (mbPtr->userPane) {
+ DisposeControl(mbPtr->userPane);
+ mbPtr->userPane = NULL;
+ mbPtr->control = NULL;
+ }
+ mbPtr->flags = 0;
+ }
+ }
+ if (!(mbPtr->flags & 1)) {
+ if (TkMacOSXInitControl(mbPtr, destPort, gc,
+ pixmap, &paneRect, &cntrRect) ) {
+ return;
+ }
+ }
+ SetControlBounds(mbPtr->userPane, &paneRect);
+ SetControlBounds(mbPtr->control, &cntrRect);
+
+ if (!mbPtr->useTkText) {
+ Str255 controlTitle;
+ ControlFontStyleRec fontStyle;
+ Tk_Font font;
+ int len;
+
+ len = TkFontGetFirstTextLayout(butPtr->textLayout,
+ &font, controlTitle);
+ controlTitle[len] = 0;
+ if (bcmp(mbPtr->controlTitle, controlTitle, len+1)) {
+ CFStringRef cf;
+ cf = CFStringCreateWithCString(NULL,
+ controlTitle, kCFStringEncodingUTF8);
+ if (cf != NULL) {
+ SetControlTitleWithCFString(mbPtr->control, cf);
+ CFRelease(cf);
+ }
+ bcopy(controlTitle, mbPtr->controlTitle, len+1);
+ }
+ if (len) {
+ TkMacOSXInitControlFontStyle(font, &fontStyle);
+ if (bcmp(&mbPtr->fontStyle, &fontStyle, sizeof(fontStyle)) ) {
+ if (SetControlFontStyle(mbPtr->control, &fontStyle) != noErr) {
+ fprintf(stderr,"SetControlFontStyle failed\n");
+ }
+ bcopy(&fontStyle, &mbPtr->fontStyle,
+ sizeof(fontStyle));
+ }
+ }
+ }
+ if (mbPtr->params.isBevel) {
+ /* Initialiase the image/button parameters */
+ SetupBevelButton(mbPtr, mbPtr->control, destPort,
+ gc, pixmap);
+ }
+
+ if (butPtr->flags & SELECTED) {
+ SetControlValue(mbPtr->control, 1);
+ } else {
+ SetControlValue(mbPtr->control, 0);
+ }
+
+ if (!Tk_MacOSXIsAppInFront() || butPtr->state == STATE_DISABLED) {
+ HiliteControl(mbPtr->control, kControlInactivePart);
+ } else if (butPtr->state == STATE_ACTIVE) {
+ if (mbPtr->params.isBevel) {
+ HiliteControl(mbPtr->control, kControlButtonPart);
+ } else {
+ switch (butPtr->type) {
+ case TYPE_BUTTON:
+ HiliteControl(mbPtr->control, kControlButtonPart);
+ break;
+ case TYPE_RADIO_BUTTON:
+ HiliteControl(mbPtr->control, kControlRadioButtonPart);
+ break;
+ case TYPE_CHECK_BUTTON:
+ HiliteControl(mbPtr->control, kControlCheckBoxPart);
+ break;
+ }
+ }
+ } else {
+ HiliteControl(mbPtr->control, kControlNoPart);
+ }
+ UpdateControlColors(mbPtr);
+
+ if ((butPtr->type == TYPE_BUTTON) ) {
+ Boolean isDefault;
+
+ if (butPtr->defaultState == STATE_ACTIVE) {
+ isDefault = true;
+ } else {
+ isDefault = false;
+ }
+ if ((err=SetControlData(mbPtr->control, kControlNoPart,
+ kControlPushButtonDefaultTag,
+ sizeof(isDefault), (Ptr) &isDefault)) != noErr ) {
+ }
+ }
+
+ if (mbPtr->flags&2) {
+ ShowControl(mbPtr->control);
+ ShowControl(mbPtr->userPane);
+ mbPtr->flags ^= 2;
+ } else {
+ Draw1Control(mbPtr->userPane);
+ SetControlVisibility(mbPtr->control, true, true);
+ }
+
+ if (mbPtr->params.isBevel) {
+ KillPicture(mbPtr->bevelButtonContent.u.picture);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SetupBevelButton --
+ *
+ * Sets up the Bevel Button with image by copying the
+ * source image onto the PicHandle for the button.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * The image or bitmap for the button is copied over to a picture.
+ *
+ *--------------------------------------------------------------
+ */
+void
+SetupBevelButton(
+ MacButton *mbPtr, /* Mac button. */
+ ControlRef controlHandle, /* The control to set this picture to */
+ GWorldPtr destPort, /* Off screen GWorld. */
+ GC gc, /* The GC we are drawing into - needed for
+ * the bevel button */
+ Pixmap pixmap /* The pixmap we are drawing into - needed
+ for the bevel button */
+ )
+{
+ int err;
+ TkButton *butPtr = ( TkButton *)mbPtr;
+ int height, width;
+ ControlButtonGraphicAlignment theAlignment;
+
+ SetPort(destPort);
+
+ if (butPtr->image != None) {
+ Tk_SizeOfImage(butPtr->image,
+ &width, &height);
+ } else {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap,
+ &width, &height);
+ }
+
+ if ((butPtr->width > 0) && (butPtr->width < width)) {
+ width = butPtr->width;
+ }
+ if ((butPtr->height > 0) && (butPtr->height < height)) {
+ height = butPtr->height;
+ }
+
+ mbPtr->picParams.srcRect.right = width;
+ mbPtr->picParams.srcRect.bottom = height;
+
+ /*
+ * Set the flag to circumvent clipping and bounds problems with OS 10.0.4
+ */
+
+ if (!(mbPtr->bevelButtonContent.u.picture
+ = OpenCPicture(&mbPtr->picParams)) ) {
+ fprintf(stderr,"OpenCPicture failed\n");
+ }
+ tkPictureIsOpen = 1;
+
+ /*
+ * TO DO - There is one case where XCopyPlane calls CopyDeepMask,
+ * which does not get recorded in the picture. So the bitmap code
+ * will fail in that case.
+ */
+
+ if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) {
+ Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height,
+ pixmap, 0, 0);
+ } else if (butPtr->image != NULL) {
+ Tk_RedrawImage(butPtr->image, 0, 0, width,
+ height, pixmap, 0, 0);
+ } else {
+ XSetClipOrigin(butPtr->display, gc, 0, 0);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc, 0, 0,
+ (unsigned int) width, (unsigned int) height, 0, 0, 1);
+ }
+
+ ClosePicture();
+ tkPictureIsOpen = 0;
+
+ if ( (err=SetControlData(controlHandle, kControlButtonPart,
+ kControlBevelButtonContentTag,
+ sizeof(ControlButtonContentInfo),
+ (char *) &mbPtr->bevelButtonContent)) != noErr ) {
+ fprintf(stderr,
+ "SetControlData BevelButtonContent failed, %d\n", err );
+ }
+
+ if (butPtr->anchor == TK_ANCHOR_N) {
+ theAlignment = kControlBevelButtonAlignTop;
+ } else if (butPtr->anchor == TK_ANCHOR_NE) {
+ theAlignment = kControlBevelButtonAlignTopRight;
+ } else if (butPtr->anchor == TK_ANCHOR_E) {
+ theAlignment = kControlBevelButtonAlignRight;
+ } else if (butPtr->anchor == TK_ANCHOR_SE) {
+ theAlignment = kControlBevelButtonAlignBottomRight;
+ } else if (butPtr->anchor == TK_ANCHOR_S) {
+ theAlignment = kControlBevelButtonAlignBottom;
+ } else if (butPtr->anchor == TK_ANCHOR_SW) {
+ theAlignment = kControlBevelButtonAlignBottomLeft;
+ } else if (butPtr->anchor == TK_ANCHOR_W) {
+ theAlignment = kControlBevelButtonAlignLeft;
+ } else if (butPtr->anchor == TK_ANCHOR_NW) {
+ theAlignment = kControlBevelButtonAlignTopLeft;
+ } else if (butPtr->anchor == TK_ANCHOR_CENTER) {
+ theAlignment = kControlBevelButtonAlignCenter;
+ }
+
+ if ((err=SetControlData(controlHandle, kControlButtonPart,
+ kControlBevelButtonGraphicAlignTag,
+ sizeof(ControlButtonGraphicAlignment),
+ (char *) &theAlignment)) != noErr ) {
+ fprintf(stderr,
+ "SetControlData BevelButtonGraphicAlign failed, %d\n", err );
+ }
+
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SetUserPaneDrawProc --
+ *
+ * Utility function to add a UserPaneDrawProc
+ * to a userPane control. From MoreControls code
+ * from Apple DTS.
+ *
+ * Results:
+ * MacOS system error.
+ *
+ * Side effects:
+ * The user pane gets a new UserPaneDrawProc.
+ *
+ *--------------------------------------------------------------
+ */
+OSErr SetUserPaneDrawProc (
+ ControlRef control,
+ ControlUserPaneDrawProcPtr upp)
+{
+ ControlUserPaneDrawUPP myControlUserPaneDrawUPP;
+ myControlUserPaneDrawUPP = NewControlUserPaneDrawUPP(upp);
+ return SetControlData (control,
+ kControlNoPart, kControlUserPaneDrawProcTag,
+ sizeof(myControlUserPaneDrawUPP),
+ (Ptr) &myControlUserPaneDrawUPP);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SetUserPaneSetUpSpecialBackgroundProc --
+ *
+ * Utility function to add a UserPaneBackgroundProc
+ * to a userPane control
+ *
+ * Results:
+ * MacOS system error.
+ *
+ * Side effects:
+ * The user pane gets a new UserPaneBackgroundProc.
+ *
+ *--------------------------------------------------------------
+ */
+OSErr
+SetUserPaneSetUpSpecialBackgroundProc(
+ ControlRef control,
+ ControlUserPaneBackgroundProcPtr upp)
+{
+ ControlUserPaneBackgroundUPP myControlUserPaneBackgroundUPP;
+ myControlUserPaneBackgroundUPP = NewControlUserPaneBackgroundUPP(upp);
+ return SetControlData (control, kControlNoPart,
+ kControlUserPaneBackgroundProcTag,
+ sizeof(myControlUserPaneBackgroundUPP),
+ (Ptr) &myControlUserPaneBackgroundUPP);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UserPaneDraw --
+ *
+ * This function draws the background of the user pane that will
+ * lie under checkboxes and radiobuttons.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The user pane gets updated to the current color.
+ *
+ *--------------------------------------------------------------
+ */
+void
+UserPaneDraw(
+ ControlRef control,
+ ControlPartCode cpc)
+{
+ Rect contrlRect;
+ MacButton * mbPtr;
+ mbPtr = ( MacButton *)GetControlReference(control);
+ GetControlBounds(control,&contrlRect);
+ RGBBackColor (&mbPtr->userPaneBackground);
+ EraseRect (&contrlRect);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UserPaneBackgroundProc --
+ *
+ * This function sets up the background of the user pane that will
+ * lie under checkboxes and radiobuttons.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The user pane background gets set to the current color.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+UserPaneBackgroundProc(
+ ControlHandle control,
+ ControlBackgroundPtr info)
+{
+ MacButton * mbPtr;
+ mbPtr = ( MacButton *)GetControlReference(control);
+ if (info->colorDevice) {
+ RGBBackColor (&mbPtr->userPaneBackground);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UpdateControlColors --
+ *
+ * This function will review the colors used to display
+ * a Macintosh button. If any non-standard colors are
+ * used we create a custom palette for the button, populate
+ * with the colors for the button and install the palette.
+ *
+ * Under Appearance, we just set the pointer that will be
+ * used by the UserPaneDrawProc.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The Macintosh control may get a custom palette installed.
+ *
+ *--------------------------------------------------------------
+ */
+
+static int
+UpdateControlColors(MacButton * mbPtr)
+{
+ XColor *xcolor;
+ TkButton * butPtr = ( TkButton * )mbPtr;
+
+ /*
+ * Under Appearance we cannot change the background of the
+ * button itself. However, the color we are setting is the color
+ * of the containing userPane. This will be the color that peeks
+ * around the rounded corners of the button.
+ * We make this the highlightbackground rather than the background,
+ * because if you color the background of a frame containing a
+ * button, you usually also color the highlightbackground as well,
+ * or you will get a thin grey ring around the button.
+ */
+
+ if (butPtr->type == TYPE_BUTTON) {
+ xcolor = Tk_3DBorderColor(butPtr->highlightBorder);
+ } else {
+ xcolor = Tk_3DBorderColor(butPtr->normalBorder);
+ }
+ TkSetMacColor(xcolor->pixel, &mbPtr->userPaneBackground);
+
+ return false;
+}
+/*
+ *--------------------------------------------------------------
+ *
+ * ButtonEventProc --
+ *
+ * This procedure is invoked by the Tk dispatcher for various
+ * events on buttons.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * When it gets exposed, it is redisplayed.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+ButtonEventProc(
+ ClientData clientData, /* Information about window. */
+ XEvent *eventPtr) /* Information about event. */
+{
+ TkButton *buttonPtr = (TkButton *) clientData;
+ if (eventPtr->type == ActivateNotify
+ || eventPtr->type == DeactivateNotify) {
+ if ((buttonPtr->tkwin == NULL)
+ || (!Tk_IsMapped(buttonPtr->tkwin))) {
+ return;
+ }
+ if ((buttonPtr->flags & REDRAW_PENDING) == 0) {
+ Tcl_DoWhenIdle(TkpDisplayButton, (ClientData) buttonPtr);
+ buttonPtr->flags |= REDRAW_PENDING;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXComputeControlParams --
+ *
+ * This procedure computes the various parameters used
+ * when creating a Carbon control (NewControl)
+ * These are determined by the various tk button parameters
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets the control initialisation parameters
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+TkMacOSXComputeControlParams(TkButton * butPtr, MacControlParams * paramsPtr )
+{
+ paramsPtr->isBevel = 0;
+
+ /*
+ * Determine ProcID based on button type and dimensions
+ */
+
+ switch (butPtr->type) {
+ case TYPE_BUTTON:
+ if ((butPtr->image == None) && (butPtr->bitmap == None)) {
+ paramsPtr->initialValue = 1;
+ paramsPtr->minValue = 0;
+ paramsPtr->maxValue = 1;
+ paramsPtr->procID = kControlPushButtonProc;
+ } else {
+ paramsPtr->initialValue = 0;
+ paramsPtr->minValue = kControlBehaviorOffsetContents
+ | kControlContentPictHandle;
+ paramsPtr->maxValue = 1;
+ if (butPtr->borderWidth <= 2) {
+ paramsPtr->procID = kControlBevelButtonSmallBevelProc;
+ } else if (butPtr->borderWidth == 3) {
+ paramsPtr->procID = kControlBevelButtonNormalBevelProc;
+ } else {
+ paramsPtr->procID = kControlBevelButtonLargeBevelProc;
+ }
+ paramsPtr->isBevel = 1;
+ }
+ break;
+ case TYPE_RADIO_BUTTON:
+ if (((butPtr->image == None) && (butPtr->bitmap == None))
+ || (butPtr->indicatorOn)) {
+ paramsPtr->initialValue = 1;
+ paramsPtr->minValue = 0;
+ paramsPtr->maxValue = 1;
+ paramsPtr->procID = kControlRadioButtonProc;
+ } else {
+ paramsPtr->initialValue = 0;
+ paramsPtr->minValue = kControlBehaviorOffsetContents|
+ kControlBehaviorSticky|
+ kControlContentPictHandle;
+ paramsPtr->maxValue = 1;
+ if (butPtr->borderWidth <= 2) {
+ paramsPtr->procID = kControlBevelButtonSmallBevelProc;
+ } else if (butPtr->borderWidth == 3) {
+ paramsPtr->procID = kControlBevelButtonNormalBevelProc;
+ } else {
+ paramsPtr->procID = kControlBevelButtonLargeBevelProc;
+ }
+ paramsPtr->isBevel = 1;
+ }
+ break;
+ case TYPE_CHECK_BUTTON:
+ if (((butPtr->image == None)
+ && (butPtr->bitmap == None))
+ || (butPtr->indicatorOn)) {
+ paramsPtr->initialValue = 1;
+ paramsPtr->minValue = 0;
+ paramsPtr->maxValue = 1;
+ paramsPtr->procID = kControlCheckBoxProc;
+ } else {
+ paramsPtr->initialValue = 0;
+ paramsPtr->minValue = kControlBehaviorOffsetContents
+ | kControlBehaviorSticky
+ | kControlContentPictHandle;
+ paramsPtr->maxValue = 1;
+ if (butPtr->borderWidth <= 2) {
+ paramsPtr->procID = kControlBevelButtonSmallBevelProc;
+ } else if (butPtr->borderWidth == 3) {
+ paramsPtr->procID = kControlBevelButtonNormalBevelProc;
+ } else {
+ paramsPtr->procID = kControlBevelButtonLargeBevelProc;
+ }
+ paramsPtr->isBevel = 1;
+ }
+ break;
+ }
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXComputeDrawParams --
+ *
+ * This procedure computes the various parameters used
+ * when drawing a button
+ * These are determined by the various tk button parameters
+ *
+ * Results:
+ * 1 if control will be used, 0 otherwise.
+ *
+ * Side effects:
+ * Sets the button draw parameters
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TkMacOSXComputeDrawParams(TkButton * butPtr, DrawParams * dpPtr)
+{
+ dpPtr->hasImageOrBitmap = ((butPtr->image != NULL)
+ || (butPtr->bitmap != None));
+ dpPtr->offset = (butPtr->type == TYPE_BUTTON)
+ && dpPtr->hasImageOrBitmap;
+ dpPtr->border = butPtr->normalBorder;
+ if ((butPtr->state == STATE_DISABLED)
+ && (butPtr->disabledFg != NULL)) {
+ dpPtr->gc = butPtr->disabledGC;
+ } else if ((butPtr->type == TYPE_BUTTON)
+ && (butPtr->state == STATE_ACTIVE)) {
+ dpPtr->gc = butPtr->activeTextGC;
+ dpPtr->border = butPtr->activeBorder;
+ } else {
+ dpPtr->gc = butPtr->normalTextGC;
+ }
+
+ if ((butPtr->flags & SELECTED)
+ && (butPtr->state != STATE_ACTIVE)
+ && (butPtr->selectBorder != NULL)
+ && !butPtr->indicatorOn) {
+ dpPtr->border = butPtr->selectBorder;
+ }
+
+ /*
+ * Override the relief specified for the button if this is a
+ * checkbutton or radiobutton and there's no indicator.
+ * However, don't do this in the presence of Appearance, since
+ * then the bevel button will take care of the relief.
+ */
+
+ dpPtr->relief = butPtr->relief;
+
+ if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) {
+ if (!dpPtr->hasImageOrBitmap) {
+ dpPtr->relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN
+ : TK_RELIEF_RAISED;
+ }
+ }
+
+ /*
+ * Determine the draw type
+ */
+ if (butPtr->type == TYPE_LABEL) {
+ dpPtr->drawType = DRAW_LABEL;
+ } else if (butPtr->type == TYPE_BUTTON) {
+ if (!dpPtr->hasImageOrBitmap) {
+ dpPtr->drawType = DRAW_CONTROL;
+ } else if (butPtr->image != None) {
+ dpPtr->drawType = DRAW_BEVEL;
+ } else {
+ /*
+ * TO DO - The current way the we draw bitmaps (XCopyPlane)
+ * uses CopyDeepMask in this one case. The Picture recording
+ * does not record this call, and so we can't use the
+ * Appearance bevel button here. The only case that would
+ * exercise this is if you use a bitmap, with
+ * -data & -mask specified. We should probably draw the
+ * appearance button and overprint the image in this case.
+ * This just punts and draws the old-style, ugly, button.
+ */
+
+ if (dpPtr->gc->clip_mask == 0) {
+ dpPtr->drawType = DRAW_BEVEL;
+ } else {
+ TkpClipMask *clipPtr = (TkpClipMask*) dpPtr->gc->clip_mask;
+ if ((clipPtr->type == TKP_CLIP_PIXMAP) &&
+ (clipPtr->value.pixmap != butPtr->bitmap)) {
+ dpPtr->drawType = DRAW_CUSTOM;
+ } else {
+ dpPtr->drawType = DRAW_BEVEL;
+ }
+ }
+ }
+ } else {
+ if (butPtr->indicatorOn) {
+ dpPtr->drawType = DRAW_CONTROL;
+ } else if (dpPtr->hasImageOrBitmap) {
+ if (dpPtr->gc->clip_mask == 0) {
+ dpPtr->drawType = DRAW_BEVEL;
+ } else {
+ TkpClipMask *clipPtr = (TkpClipMask*) dpPtr->gc->clip_mask;
+ if ((clipPtr->type == TKP_CLIP_PIXMAP) &&
+ (clipPtr->value.pixmap != butPtr->bitmap)) {
+ dpPtr->drawType = DRAW_CUSTOM;
+ } else {
+ dpPtr->drawType = DRAW_BEVEL;
+ }
+ }
+ } else {
+ dpPtr->drawType = DRAW_CUSTOM;
+ }
+ }
+
+ if ((dpPtr->drawType == DRAW_CONTROL) || (dpPtr->drawType == DRAW_BEVEL)) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
diff --git a/tk/macosx/tkMacOSXClipboard.c b/tk/macosx/tkMacOSXClipboard.c
new file mode 100644
index 00000000000..833422d1caf
--- /dev/null
+++ b/tk/macosx/tkMacOSXClipboard.c
@@ -0,0 +1,321 @@
+/*
+ * tkMacOSXClipboard.c --
+ *
+ * This file manages the clipboard for the Tk toolkit.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include "tkPort.h"
+#include "tkMacOSXInt.h"
+#include "tkSelect.h"
+
+#include <Carbon/Carbon.h>
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSelGetSelection --
+ *
+ * Retrieve the specified selection from another process. For
+ * now, only fetching XA_STRING from CLIPBOARD is supported.
+ * Eventually other types should be allowed.
+ *
+ * Results:
+ * The return value is a standard Tcl return value.
+ * If an error occurs (such as no selection exists)
+ * then an error message is left in the interp's result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkSelGetSelection(
+ Tcl_Interp *interp, /* Interpreter to use for reporting
+ * errors. */
+ Tk_Window tkwin, /* Window on whose behalf to retrieve
+ * the selection (determines display
+ * from which to retrieve). */
+ Atom selection, /* Selection to retrieve. */
+ Atom target, /* Desired form in which selection
+ * is to be returned. */
+ Tk_GetSelProc *proc, /* Procedure to call to process the
+ * selection, once it has been retrieved. */
+ ClientData clientData) /* Arbitrary value to pass to proc. */
+{
+ int result;
+ int err;
+ long length;
+ ScrapRef scrapRef;
+ char * buf;
+
+ if ((selection == Tk_InternAtom(tkwin, "CLIPBOARD"))
+ && (target == XA_STRING)) {
+ /*
+ * Get the scrap from the Macintosh global clipboard.
+ */
+
+ err=GetCurrentScrap(&scrapRef);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " GetCurrentScrap failed.", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ err=GetScrapFlavorSize(scrapRef,'TEXT',&length);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " GetScrapFlavorSize failed.", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (length > 0) {
+ Tcl_DString encodedText;
+
+ buf = (char *)ckalloc(length+1);
+ buf[length] = 0;
+ err = GetScrapFlavorData(scrapRef, 'TEXT', &length, buf);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " GetScrapFlavorData failed.", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ Tcl_ExternalToUtfDString(TkMacOSXCarbonEncoding, buf, length,
+ &encodedText);
+ result = (*proc)(clientData, interp,
+ Tcl_DStringValue(&encodedText));
+ Tcl_DStringFree(&encodedText);
+
+ ckfree(buf);
+ return result;
+ }
+ }
+
+ Tcl_AppendResult(interp, Tk_GetAtomName(tkwin, selection),
+ " selection doesn't exist or form \"", Tk_GetAtomName(tkwin, target),
+ "\" not defined", (char *) NULL);
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSetSelectionOwner --
+ *
+ * This function claims ownership of the specified selection.
+ * If the selection is CLIPBOARD, then we empty the system
+ * clipboard.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XSetSelectionOwner(
+ Display* display, /* X Display. */
+ Atom selection, /* What selection to own. */
+ Window owner, /* Window to be the owner. */
+ Time time) /* The current time? */
+{
+ Tk_Window tkwin;
+ TkDisplay *dispPtr;
+
+ /*
+ * This is a gross hack because the Tk_InternAtom interface is broken.
+ * It expects a Tk_Window, even though it only needs a Tk_Display.
+ */
+
+ tkwin = (Tk_Window) TkGetMainInfoList()->winPtr;
+
+ if (selection == Tk_InternAtom(tkwin, "CLIPBOARD")) {
+
+ /*
+ * Only claim and empty the clipboard if we aren't already the
+ * owner of the clipboard.
+ */
+
+ dispPtr = TkGetMainInfoList()->winPtr->dispPtr;
+ if (dispPtr->clipboardActive) {
+ return;
+ }
+ ClearCurrentScrap();
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSelUpdateClipboard --
+ *
+ * This function is called to force the clipboard to be updated
+ * after new data is added. On the Mac we don't need to do
+ * anything.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkSelUpdateClipboard(
+ TkWindow *winPtr, /* Window associated with clipboard. */
+ TkClipboardTarget *targetPtr) /* Info about the content. */
+{
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkSelEventProc --
+ *
+ * This procedure is invoked whenever a selection-related
+ * event occurs.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Lots: depends on the type of event.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkSelEventProc(
+ Tk_Window tkwin, /* Window for which event was
+ * targeted. */
+ register XEvent *eventPtr) /* X event: either SelectionClear,
+ * SelectionRequest, or
+ * SelectionNotify. */
+{
+ if (eventPtr->type == SelectionClear) {
+ TkSelClearSelection(tkwin, eventPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSelPropProc --
+ *
+ * This procedure is invoked when property-change events
+ * occur on windows not known to the toolkit. This is a stub
+ * function under Windows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkSelPropProc(
+ register XEvent *eventPtr) /* X PropertyChange event. */
+{
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSuspendClipboard --
+ *
+ * Handle clipboard conversion as required by the suppend event.
+ * This function is also called on exit.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The local scrap is moved to the global scrap.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkSuspendClipboard()
+{
+ TkClipboardTarget *targetPtr;
+ TkClipboardBuffer *cbPtr;
+ TkDisplay *dispPtr;
+ char *buffer, *p, *endPtr, *buffPtr;
+ long length;
+ ScrapRef scrapRef;
+
+ dispPtr = TkGetDisplayList();
+ if ((dispPtr == NULL) || !dispPtr->clipboardActive) {
+ return;
+ }
+
+ for (targetPtr = dispPtr->clipTargetPtr; targetPtr != NULL;
+ targetPtr = targetPtr->nextPtr) {
+ if (targetPtr->type == XA_STRING)
+ break;
+ }
+ if (targetPtr != NULL) {
+ Tcl_DString encodedText;
+
+ length = 0;
+ for (cbPtr = targetPtr->firstBufferPtr; cbPtr != NULL;
+ cbPtr = cbPtr->nextPtr) {
+ length += cbPtr->length;
+ }
+
+ buffer = ckalloc(length);
+ buffPtr = buffer;
+ for (cbPtr = targetPtr->firstBufferPtr; cbPtr != NULL;
+ cbPtr = cbPtr->nextPtr) {
+ for (p = cbPtr->buffer, endPtr = p + cbPtr->length;
+ p < endPtr; p++) {
+ if (*p == '\n') {
+ *buffPtr++ = '\r';
+ } else {
+ *buffPtr++ = *p;
+ }
+ }
+ }
+
+ ClearCurrentScrap();
+ GetCurrentScrap(&scrapRef);
+ Tcl_UtfToExternalDString(TkMacOSXCarbonEncoding, buffer, length, &encodedText);
+ PutScrapFlavor(scrapRef, 'TEXT', 0, Tcl_DStringLength(&encodedText), Tcl_DStringValue(&encodedText) );
+ Tcl_DStringFree(&encodedText);
+ ckfree(buffer);
+ }
+
+ /*
+ * The system now owns the scrap. We tell Tk that it has
+ * lost the selection so that it will look for it the next time
+ * it needs it. (Window list NULL if quiting.)
+ */
+
+ if (TkGetMainInfoList() != NULL) {
+ Tk_ClearSelection((Tk_Window) TkGetMainInfoList()->winPtr,
+ Tk_InternAtom((Tk_Window) TkGetMainInfoList()->winPtr,
+ "CLIPBOARD"));
+ }
+
+ return;
+}
diff --git a/tk/macosx/tkMacOSXColor.c b/tk/macosx/tkMacOSXColor.c
new file mode 100644
index 00000000000..f5ab4abe044
--- /dev/null
+++ b/tk/macosx/tkMacOSXColor.c
@@ -0,0 +1,448 @@
+/*
+ * tkMacOSXColor.c --
+ *
+ * This file maintains a database of color values for the Tk
+ * toolkit, in order to avoid round-trips to the server to
+ * map color names to pixel values.
+ *
+ * Copyright (c) 1990-1994 The Regents of the University of California.
+ * Copyright (c) 1994-1996 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include <tkColor.h>
+#include "tkMacOSXInt.h"
+#include <Carbon/Carbon.h>
+
+/*
+ * Default Auxillary Control Record for all controls. This is cached once
+ * and is updated by the system. We use this to get the default system
+ * colors used by controls.
+ */
+/*
+ * Stubbed out for OS X
+static AuxCtlHandle defaultAuxCtlHandle = NULL;
+*/
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static int GetControlPartColor _ANSI_ARGS_((short part, RGBColor *macColor));
+static int GetMenuPartColor _ANSI_ARGS_((int part, RGBColor *macColor));
+static int GetWindowPartColor _ANSI_ARGS_((short part, RGBColor *macColor));
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSetMacColor --
+ *
+ * Populates a Macintosh RGBColor structure from a X style
+ * pixel value.
+ *
+ * Results:
+ * Returns false if not a real pixel, true otherwise.
+ *
+ * Side effects:
+ * The variable macColor is updated to the pixels value.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkSetMacColor(
+ unsigned long pixel, /* Pixel value to convert. */
+ RGBColor *macColor) /* Mac color struct to modify. */
+{
+ switch (pixel >> 24) {
+ case HIGHLIGHT_PIXEL:
+ LMGetHiliteRGB(macColor);
+ return true;
+ case HIGHLIGHT_TEXT_PIXEL:
+ LMGetHiliteRGB(macColor);
+ if ((macColor->red == 0) && (macColor->green == 0)
+ && (macColor->blue == 0)) {
+ macColor->red = macColor->green = macColor->blue = 0xFFFF;
+ } else {
+ macColor->red = macColor->green = macColor->blue = 0;
+ }
+ return true;
+ case CONTROL_TEXT_PIXEL:
+ GetControlPartColor(cTextColor, macColor);
+ return true;
+ case CONTROL_BODY_PIXEL:
+ GetControlPartColor(cBodyColor, macColor);
+ return true;
+ case CONTROL_FRAME_PIXEL:
+ GetControlPartColor(cFrameColor, macColor);
+ return true;
+ case WINDOW_BODY_PIXEL:
+ GetWindowPartColor(wContentColor, macColor);
+ return true;
+ case MENU_ACTIVE_PIXEL:
+ case MENU_ACTIVE_TEXT_PIXEL:
+ case MENU_BACKGROUND_PIXEL:
+ case MENU_DISABLED_PIXEL:
+ case MENU_TEXT_PIXEL:
+ return GetMenuPartColor((pixel >> 24), macColor);
+ case APPEARANCE_PIXEL:
+ return false;
+ case PIXEL_MAGIC:
+ default:
+ macColor->blue = (unsigned short) ((pixel & 0xFF) << 8);
+ macColor->green = (unsigned short) (((pixel >> 8) & 0xFF) << 8);
+ macColor->red = (unsigned short) (((pixel >> 16) & 0xFF) << 8);
+ return true;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Stub functions --
+ *
+ * These functions are just stubs for functions that either
+ * don't make sense on the Mac or have yet to be implemented.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * These calls do nothing - which may not be expected.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Status
+XAllocColor(
+ Display *display, /* Display. */
+ Colormap map, /* Not used. */
+ XColor *colorPtr) /* XColor struct to modify. */
+{
+ display->request++;
+ colorPtr->pixel = TkpGetPixel(colorPtr);
+ return 1;
+}
+
+Colormap
+XCreateColormap(
+ Display *display, /* Display. */
+ Window window, /* X window. */
+ Visual *visual, /* Not used. */
+ int alloc) /* Not used. */
+{
+ static Colormap index = 1;
+
+ /*
+ * Just return a new value each time.
+ */
+ return index++;
+}
+
+void
+XFreeColormap(
+ Display* display, /* Display. */
+ Colormap colormap) /* Colormap. */
+{
+}
+
+void
+XFreeColors(
+ Display* display, /* Display. */
+ Colormap colormap, /* Colormap. */
+ unsigned long* pixels, /* Array of pixels. */
+ int npixels, /* Number of pixels. */
+ unsigned long planes) /* Number of pixel planes. */
+{
+ /*
+ * The Macintosh version of Tk uses TrueColor. Nothing
+ * needs to be done to release colors as there really is
+ * no colormap in the Tk sense.
+ */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetColor --
+ *
+ * Allocate a new TkColor for the color with the given name.
+ *
+ * Results:
+ * Returns a newly allocated TkColor, or NULL on failure.
+ *
+ * Side effects:
+ * May invalidate the colormap cache associated with tkwin upon
+ * allocating a new colormap entry. Allocates a new TkColor
+ * structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkColor *
+TkpGetColor(
+ Tk_Window tkwin, /* Window in which color will be used. */
+ Tk_Uid name) /* Name of color to allocated (in form
+ * suitable for passing to XParseColor). */
+{
+ Display *display = Tk_Display(tkwin);
+ Colormap colormap = Tk_Colormap(tkwin);
+ TkColor *tkColPtr;
+ XColor color;
+
+ /*
+ * Check to see if this is a system color. Otherwise, XParseColor
+ * will do all the work.
+ */
+ if (strncasecmp(name, "system", 6) == 0) {
+ int foundSystemColor = false;
+ RGBColor rgbValue;
+ char pixelCode = 0;
+
+ if (!strcasecmp(name+6, "Highlight")) {
+ LMGetHiliteRGB(&rgbValue);
+ pixelCode = HIGHLIGHT_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "HighlightText")) {
+ LMGetHiliteRGB(&rgbValue);
+ if ((rgbValue.red == 0) && (rgbValue.green == 0)
+ && (rgbValue.blue == 0)) {
+ rgbValue.red = rgbValue.green = rgbValue.blue = 0xFFFF;
+ } else {
+ rgbValue.red = rgbValue.green = rgbValue.blue = 0;
+ }
+ pixelCode = HIGHLIGHT_TEXT_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "ButtonText")) {
+ GetControlPartColor(cTextColor, &rgbValue);
+ pixelCode = CONTROL_TEXT_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "ButtonFace")) {
+ GetControlPartColor(cBodyColor, &rgbValue);
+ pixelCode = CONTROL_BODY_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "ButtonFrame")) {
+ GetControlPartColor(cFrameColor, &rgbValue);
+ pixelCode = CONTROL_FRAME_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "WindowBody")) {
+ GetWindowPartColor(wContentColor, &rgbValue);
+ pixelCode = WINDOW_BODY_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "MenuActive")) {
+ GetMenuPartColor(MENU_ACTIVE_PIXEL, &rgbValue);
+ pixelCode = MENU_ACTIVE_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "MenuActiveText")) {
+ GetMenuPartColor(MENU_ACTIVE_TEXT_PIXEL, &rgbValue);
+ pixelCode = MENU_ACTIVE_TEXT_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "Menu")) {
+ GetMenuPartColor(MENU_BACKGROUND_PIXEL, &rgbValue);
+ pixelCode = MENU_BACKGROUND_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "MenuDisabled")) {
+ GetMenuPartColor(MENU_DISABLED_PIXEL, &rgbValue);
+ pixelCode = MENU_DISABLED_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "MenuText")) {
+ GetMenuPartColor(MENU_TEXT_PIXEL, &rgbValue);
+ pixelCode = MENU_TEXT_PIXEL;
+ foundSystemColor = true;
+ } else if (!strcasecmp(name+6, "AppearanceColor")) {
+ color.red = 0;
+ color.green = 0;
+ color.blue = 0;
+ pixelCode = APPEARANCE_PIXEL;
+ foundSystemColor = true;
+ }
+
+ if (foundSystemColor) {
+ color.red = rgbValue.red;
+ color.green = rgbValue.green;
+ color.blue = rgbValue.blue;
+ color.pixel = ((((((pixelCode << 8)
+ | ((color.red >> 8) & 0xff)) << 8)
+ | ((color.green >> 8) & 0xff)) << 8)
+ | ((color.blue >> 8) & 0xff));
+
+ tkColPtr = (TkColor *) ckalloc(sizeof(TkColor));
+ tkColPtr->color = color;
+ return tkColPtr;
+ }
+ }
+
+ if (XParseColor(display, colormap, name, &color) == 0) {
+ return (TkColor *) NULL;
+ }
+
+ tkColPtr = (TkColor *) ckalloc(sizeof(TkColor));
+ tkColPtr->color = color;
+
+ return tkColPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetColorByValue --
+ *
+ * Given a desired set of red-green-blue intensities for a color,
+ * locate a pixel value to use to draw that color in a given
+ * window.
+ *
+ * Results:
+ * The return value is a pointer to an TkColor structure that
+ * indicates the closest red, blue, and green intensities available
+ * to those specified in colorPtr, and also specifies a pixel
+ * value to use to draw in that color.
+ *
+ * Side effects:
+ * May invalidate the colormap cache for the specified window.
+ * Allocates a new TkColor structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkColor *
+TkpGetColorByValue(
+ Tk_Window tkwin, /* Window in which color will be used. */
+ XColor *colorPtr) /* Red, green, and blue fields indicate
+ * desired color. */
+{
+ TkColor *tkColPtr = (TkColor *) ckalloc(sizeof(TkColor));
+
+ tkColPtr->color.red = colorPtr->red;
+ tkColPtr->color.green = colorPtr->green;
+ tkColPtr->color.blue = colorPtr->blue;
+ tkColPtr->color.pixel = TkpGetPixel(&tkColPtr->color);
+ return tkColPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetControlPartColor --
+ *
+ * Given a part number this function will return the standard
+ * system default color for that part. It does this by looking
+ * in the system's 'cctb' resource.
+ *
+ * Results:
+ * True if a color is found, false otherwise.
+ *
+ * Side effects:
+ * If a color is found then the RGB variable will be changed to
+ * the parts color.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GetControlPartColor(
+ short part, /* Part code. */
+ RGBColor *macColor) /* Pointer to Mac color. */
+{
+/* Stubbed out for OS X
+ short index;
+ CCTabHandle ccTab;
+
+ if (defaultAuxCtlHandle == NULL) {
+ GetAuxiliaryControlRecord(NULL, &defaultAuxCtlHandle);
+ }
+ ccTab = (**defaultAuxCtlHandle).acCTable;
+ if(ccTab && (ResError() == noErr)) {
+ for(index = 0; index <= (**ccTab).ctSize; index++) {
+ if((**ccTab).ctTable[index].value == part) {
+ *macColor = (**ccTab).ctTable[index].rgb;
+ return true;
+ }
+ }
+ }
+*/
+ return false;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetWindowPartColor --
+ *
+ * Given a part number this function will return the standard
+ * system default color for that part. It does this by looking
+ * in the system's 'wctb' resource.
+ *
+ * Results:
+ * True if a color is found, false otherwise.
+ *
+ * Side effects:
+ * If a color is found then the RGB variable will be changed to
+ * the parts color.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GetWindowPartColor(
+ short part, /* Part code. */
+ RGBColor *macColor) /* Pointer to Mac color. */
+{
+ short index;
+ WCTabHandle wcTab;
+
+ if (part == wContentColor) {
+ GetThemeBrushAsColor(kThemeBrushDocumentWindowBackground,
+ 0xFFFF, true, macColor);
+ return true;
+ } else {
+ wcTab = (WCTabHandle) GetResource('wctb', 0);
+ if(wcTab && (ResError() == noErr)) {
+ for(index = 0; index <= (**wcTab).ctSize; index++) {
+ if((**wcTab).ctTable[index].value == part) {
+ *macColor = (**wcTab).ctTable[index].rgb;
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMenuPartColor --
+ *
+ * Given a magic pixel value, returns the RGB color associated
+ * with it by looking the value up in the system's 'mctb' resource.
+ *
+ * Results:
+ * True if a color is found, false otherwise.
+ *
+ * Side effects:
+ * If a color is found then the RGB variable will be changed to
+ * the parts color.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GetMenuPartColor(
+ int pixel, /* The magic pixel value */
+ RGBColor *macColor) /* Pointer to Mac color */
+{
+
+ /* Under Appearance, we don't want to set any menu colors when we
+ are asked for the standard menu colors. So we return false (which
+ means don't use this color... */
+
+ macColor->red = 0xFFFF;
+ macColor->green = 0;
+ macColor->blue = 0;
+ return false;
+}
diff --git a/tk/macosx/tkMacOSXConfig.c b/tk/macosx/tkMacOSXConfig.c
new file mode 100644
index 00000000000..5b2ecc4873c
--- /dev/null
+++ b/tk/macosx/tkMacOSXConfig.c
@@ -0,0 +1,46 @@
+/*
+ * tkMacOSXConfig.c --
+ *
+ * This module implements the Macintosh system defaults for
+ * the configuration package.
+ *
+ * Copyright (c) 1997 by Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tk.h"
+#include "tkInt.h"
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetSystemDefault --
+ *
+ * Given a dbName and className for a configuration option,
+ * return a string representation of the option.
+ *
+ * Results:
+ * Returns a Tk_Uid that is the string identifier that identifies
+ * this option. Returns NULL if there are no system defaults
+ * that match this pair.
+ *
+ * Side effects:
+ * None, once the package is initialized.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Obj *
+TkpGetSystemDefault(
+ Tk_Window tkwin, /* A window to use. */
+ CONST char *dbName, /* The option database name. */
+ CONST char *className) /* The name of the option class. */
+{
+ return NULL;
+}
diff --git a/tk/macosx/tkMacOSXCursor.c b/tk/macosx/tkMacOSXCursor.c
new file mode 100644
index 00000000000..6243a422f14
--- /dev/null
+++ b/tk/macosx/tkMacOSXCursor.c
@@ -0,0 +1,406 @@
+/*
+ * tkMacOSXCursor.c --
+ *
+ * This file contains Macintosh specific cursor related routines.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkPort.h"
+#include "tkInt.h"
+#include "tkMacOSXInt.h"
+
+#include <Carbon/Carbon.h>
+
+/*
+ * There are three different ways to set the cursor on the Mac.
+ */
+#define ARROW 0 /* The arrow cursor. */
+#define COLOR 1 /* Cursors of type crsr. */
+#define NORMAL 2 /* Cursors of type CURS. */
+
+/*
+ * The following data structure contains the system specific data
+ * necessary to control Windows cursors.
+ */
+
+typedef struct {
+ TkCursor info; /* Generic cursor info used by tkCursor.c */
+ Handle macCursor; /* Resource containing Macintosh cursor. */
+ int type; /* Type of Mac cursor: arrow, crsr, CURS */
+} TkMacOSXCursor;
+
+/*
+ * The table below is used to map from the name of a predefined cursor
+ * to its resource identifier.
+ */
+
+static struct CursorName {
+ char *name;
+ int id;
+} cursorNames[] = {
+ {"ibeam", 1},
+ {"text", 1},
+ {"xterm", 1},
+ {"cross", 2},
+ {"crosshair", 2},
+ {"cross-hair", 2},
+ {"plus", 3},
+ {"watch", 4},
+ {"arrow", 5},
+ {NULL, 0}
+};
+
+/*
+ * Declarations of static variables used in this file.
+ */
+
+static TkMacOSXCursor * gCurrentCursor = NULL; /* A pointer to the current
+ * cursor. */
+static int gResizeOverride = false; /* A boolean indicating whether
+ * we should use the resize
+ * cursor during installations. */
+static int gTkOwnsCursor = true; /* A boolean indicating whether
+ Tk owns the cursor. If not (for
+ instance, in the case where a Tk
+ window is embedded in another app's
+ window, and the cursor is out of
+ the tk window, we will not attempt
+ to adjust the cursor */
+
+/*
+ * Declarations of procedures local to this file
+ */
+
+static void FindCursorByName _ANSI_ARGS_ ((TkMacOSXCursor *macCursorPtr,
+ CONST char *string));
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FindCursorByName --
+ *
+ * Retrieve a system cursor by name, and fill the macCursorPtr
+ * structure. If the cursor cannot be found, the macCursor field
+ * will be NULL. The function first attempts to load a color
+ * cursor. If that fails it will attempt to load a black & white
+ * cursor.
+ *
+ * Results:
+ * Fills the macCursorPtr record.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+FindCursorByName(
+ TkMacOSXCursor *macCursorPtr,
+ CONST char *string)
+{
+ Handle resource;
+ Str255 curName;
+ int destWrote, inCurLen;
+
+ inCurLen = strlen(string);
+ if (inCurLen > 255) {
+ return;
+ }
+
+ /*
+ * macRoman is the encoding that the resource fork uses.
+ */
+
+ Tcl_UtfToExternal(NULL, Tcl_GetEncoding(NULL, "macRoman"), string,
+ inCurLen, 0, NULL,
+ (char *) &curName[1],
+ 255, NULL, &destWrote, NULL); /* Internalize native */
+ curName[0] = destWrote;
+
+ resource = GetNamedResource('crsr', curName);
+
+ if (resource != NULL) {
+ short id;
+ Str255 theName;
+ ResType theType;
+
+ HLock(resource);
+ GetResInfo(resource, &id, &theType, theName);
+ HUnlock(resource);
+ macCursorPtr->macCursor = (Handle) GetCCursor(id);
+ macCursorPtr->type = COLOR;
+ }
+
+ if (resource == NULL) {
+ macCursorPtr->macCursor = GetNamedResource('CURS', curName);
+ macCursorPtr->type = NORMAL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGetCursorByName --
+ *
+ * Retrieve a system cursor by name.
+ *
+ * Results:
+ * Returns a new cursor, or NULL on errors.
+ *
+ * Side effects:
+ * Allocates a new cursor.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkCursor *
+TkGetCursorByName(
+ Tcl_Interp *interp, /* Interpreter to use for error reporting. */
+ Tk_Window tkwin, /* Window in which cursor will be used. */
+ Tk_Uid string) /* Description of cursor. See manual entry
+ * for details on legal syntax. */
+{
+ struct CursorName *namePtr;
+ TkMacOSXCursor *macCursorPtr;
+
+ macCursorPtr = (TkMacOSXCursor *) ckalloc(sizeof(TkMacOSXCursor));
+ macCursorPtr->info.cursor = (Tk_Cursor) macCursorPtr;
+
+ /*
+ * To find a cursor we must first determine if it is one of the
+ * builtin cursors or the standard arrow cursor. Otherwise, we
+ * attempt to load the cursor as a named Mac resource.
+ */
+
+ for (namePtr = cursorNames; namePtr->name != NULL; namePtr++) {
+ if (strcmp(namePtr->name, string) == 0) {
+ break;
+ }
+ }
+
+
+ if (namePtr->name != NULL) {
+ if (namePtr->id == 5) {
+ macCursorPtr->macCursor = (Handle) -1;
+ macCursorPtr->type = ARROW;
+ } else {
+ macCursorPtr->macCursor = (Handle) GetCursor(namePtr->id);
+ macCursorPtr->type = NORMAL;
+ }
+ } else {
+ FindCursorByName(macCursorPtr, string);
+
+ if (macCursorPtr->macCursor == NULL) {
+ CONST char **argv;
+ int argc, err;
+
+ /*
+ * The user may be trying to specify an XCursor with fore
+ * & back colors. We don't want this to be an error, so pick
+ * off the first word, and try again.
+ */
+
+ err = Tcl_SplitList(interp, string, &argc, &argv);
+ if (err == TCL_OK ) {
+ if (argc > 1) {
+ FindCursorByName(macCursorPtr, argv[0]);
+ }
+
+ ckfree((char *) argv);
+ }
+ }
+ }
+
+ if (macCursorPtr->macCursor == NULL) {
+ ckfree((char *)macCursorPtr);
+ Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"",
+ (char *) NULL);
+ return NULL;
+ } else {
+ return (TkCursor *) macCursorPtr;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkCreateCursorFromData --
+ *
+ * Creates a cursor from the source and mask bits.
+ *
+ * Results:
+ * Returns a new cursor, or NULL on errors.
+ *
+ * Side effects:
+ * Allocates a new cursor.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkCursor *
+TkCreateCursorFromData(
+ Tk_Window tkwin, /* Window in which cursor will be used. */
+ CONST char *source, /* Bitmap data for cursor shape. */
+ CONST char *mask, /* Bitmap data for cursor mask. */
+ int width, int height, /* Dimensions of cursor. */
+ int xHot, int yHot, /* Location of hot-spot in cursor. */
+ XColor fgColor, /* Foreground color for cursor. */
+ XColor bgColor) /* Background color for cursor. */
+{
+ return NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpFreeCursor --
+ *
+ * This procedure is called to release a cursor allocated by
+ * TkGetCursorByName.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The cursor data structure is deallocated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpFreeCursor(
+ TkCursor *cursorPtr)
+{
+ TkMacOSXCursor *macCursorPtr = (TkMacOSXCursor *) cursorPtr;
+
+ switch (macCursorPtr->type) {
+ case COLOR:
+ DisposeCCursor((CCrsrHandle) macCursorPtr->macCursor);
+ break;
+ case NORMAL:
+ ReleaseResource(macCursorPtr->macCursor);
+ break;
+ }
+
+ if (macCursorPtr == gCurrentCursor) {
+ gCurrentCursor = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInstallCursor --
+ *
+ * Installs either the current cursor as defined by TkpSetCursor
+ * or a resize cursor as the cursor the Macintosh should currently
+ * display.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the Macintosh mouse cursor.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInstallCursor(
+ int resizeOverride)
+{
+ TkMacOSXCursor *macCursorPtr = gCurrentCursor;
+ CCrsrHandle ccursor;
+ CursHandle cursor;
+
+ gResizeOverride = resizeOverride;
+
+ if (resizeOverride) {
+ cursor = (CursHandle) GetNamedResource('CURS', "\presize");
+ if (cursor) {
+ SetCursor(*cursor);
+ } else {
+ /*
+ fprintf(stderr,"Resize cursor failed, %d\n", ResError());
+ */
+ }
+ } else if (macCursorPtr == NULL || macCursorPtr->type == ARROW) {
+ SetThemeCursor(kThemeArrowCursor);
+ } else {
+ switch (macCursorPtr->type) {
+ case COLOR:
+ ccursor = (CCrsrHandle) macCursorPtr->macCursor;
+ SetCCursor(ccursor);
+ break;
+ case NORMAL:
+ cursor = (CursHandle) macCursorPtr->macCursor;
+ SetCursor(*cursor);
+ break;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpSetCursor --
+ *
+ * Set the current cursor and install it.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the current cursor.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpSetCursor(
+ TkpCursor cursor)
+{
+ if (!gTkOwnsCursor) {
+ return;
+ }
+ if (cursor == None) {
+ gCurrentCursor = NULL;
+ } else {
+ gCurrentCursor = (TkMacOSXCursor *) cursor;
+ }
+
+ if (Tk_MacOSXIsAppInFront()) {
+ TkMacOSXInstallCursor(gResizeOverride);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_MacOSXTkOwnsCursor --
+ *
+ * Sets whether Tk has the right to adjust the cursor.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May keep Tk from changing the cursor.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_MacOSXTkOwnsCursor(
+ int tkOwnsIt)
+{
+ gTkOwnsCursor = tkOwnsIt;
+}
diff --git a/tk/macosx/tkMacOSXCursors.r b/tk/macosx/tkMacOSXCursors.r
new file mode 100644
index 00000000000..b20423994b6
--- /dev/null
+++ b/tk/macosx/tkMacOSXCursors.r
@@ -0,0 +1,130 @@
+/*
+ * tkMacOSXCursors.r --
+ *
+ * This file defines a set of Macintosh cursor resources that
+ * are only available on the Macintosh platform.
+ *
+ * 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$
+ */
+
+/*
+ * These are resource definitions for Macintosh cursors.
+ * The are identified and loaded by the "name" of the
+ * cursor. However, the ids must be unique.
+ */
+
+data 'CURS' (1000, "hand") {
+ $"0180 1A70 2648 264A 124D 1249 6809 9801"
+ $"8802 4002 2002 2004 1004 0808 0408 0408"
+ $"0180 1BF0 3FF8 3FFA 1FFF 1FFF 6FFF FFFF"
+ $"FFFE 7FFE 3FFE 3FFC 1FFC 0FF8 07F8 07F8"
+ $"0009 0008"
+};
+
+data 'CURS' (1002, "bucket") {
+ $"0000 0000 0600 0980 0940 0B30 0D18 090C"
+ $"129C 212C 104C 088C 050C 0208 0000 0000"
+ $"0000 0000 0600 0980 09C0 0BF0 0FF8 0FFC"
+ $"1FFC 3FEC 1FCC 0F8C 070C 0208 0000 0000"
+ $"000D 000C"
+};
+
+data 'CURS' (1003, "cancel") {
+ $"0000 0000 0000 0000 3180 4A40 4A40 3F80"
+ $"0A00 3F80 4A40 4A46 3186 0000 0000 0000"
+ $"0000 0000 0000 3180 7BC0 FFE0 FFE0 7FC0"
+ $"3F80 7FC0 FFE6 FFEF 7BCF 3186 0000 0000"
+ $"0008 0005"
+};
+
+data 'CURS' (1004, "resize") {
+ $"FFFF 8001 BF01 A181 A1F9 A18D A18D BF8D"
+ $"9F8D 880D 880D 880D 8FFD 87FD 8001 FFFF"
+ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+ $"FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF"
+ $"0008 0008"
+};
+
+data 'CURS' (1005, "eyedrop") {
+ $"000E 001F 001F 00FF 007E 00B8 0118 0228"
+ $"0440 0880 1100 2200 4400 4800 B000 4000"
+ $"000E 001F 001F 00FF 007E 00F8 01F8 03E8"
+ $"07C0 0F80 1F00 3E00 7C00 7800 F000 4000"
+ $"000F 0000"
+};
+
+data 'CURS' (1006, "eyedrop-full") {
+ $"000E 001F 001F 00FF 007E 00B8 0118 0328"
+ $"07C0 0F80 1F00 3E00 7C00 7800 F000 4000"
+ $"000E 001F 001F 00FF 007E 00F8 01F8 03E8"
+ $"07C0 0F80 1F00 3E00 7C00 7800 F000 4000"
+ $"000F 0000"
+};
+
+data 'CURS' (1007, "zoom-in") {
+ $"0780 1860 2790 5868 5028 A014 AFD4 AFD4"
+ $"A014 5028 5868 2798 187C 078E 0007 0003"
+ $"0780 1FE0 3FF0 7878 7038 E01C EFDC EFDC"
+ $"E01C 7038 7878 3FF8 1FFC 078E 0007 0003"
+ $"0007 0007"
+};
+
+data 'CURS' (1008, "zoom-out") {
+ $"0780 1860 2790 5868 5328 A314 AFD4 AFD4"
+ $"A314 5328 5868 2798 187C 078E 0007 0003"
+ $"0780 1FE0 3FF0 7878 7338 E31C EFDC EFDC"
+ $"E31C 7338 7878 3FF8 1FFC 078E 0007 0003"
+ $"0007 0007"
+};
+
+/*
+ * The following are resource definitions for color
+ * cursors on the Macintosh. If a color cursor and
+ * a black & white cursor are both defined with the
+ * same name preference will be given to the color
+ * cursors.
+ */
+
+data 'crsr' (1000, "hand") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0180 1A70 2648 264A 124D 1249"
+ $"6809 9801 8802 4002 2002 2004 1004 0808"
+ $"0408 0408 0180 1BF0 3FF8 3FFA 1FFF 1FFF"
+ $"6FFF FFFF FFFE 7FFE 3FFE 3FFC 1FFC 0FF8"
+ $"07F8 07F8 0008 0008 0000 0000 0000 0000"
+ $"0000 0000 8004 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0002 0001 0002 0000 0000 0000 00D2 0000"
+ $"0000 0003 C000 03CD 7F00 0D7D 75C0 0D7D"
+ $"75CC 035D 75F7 035D 75D7 3CD5 55D7 D7D5"
+ $"5557 D5D5 555C 3555 555C 0D55 555C 0D55"
+ $"5570 0355 5570 00D5 55C0 0035 55C0 0035"
+ $"55C0 0000 0000 0000 0002 0000 FFFF FFFF"
+ $"FFFF 0001 FFFF CCCC 9999 0003 0000 0000"
+ $"0000"
+};
+
+data 'crsr' (1001, "fist") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0DB0 124C"
+ $"100A 0802 1802 2002 2002 2004 1004 0808"
+ $"0408 0408 0000 0000 0000 0000 0DB0 1FFC"
+ $"1FFE 0FFE 1FFE 3FFE 3FFE 3FFC 1FFC 0FF8"
+ $"07F8 07F8 0008 0008 0000 0000 0000 0000"
+ $"0000 0000 8004 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0002 0001 0002 0000 0000 0000 00D2 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 00F3 CF00 035D 75F0 0355 55DC 00D5"
+ $"555C 03D5 555C 0D55 555C 0D55 555C 0D55"
+ $"5570 0355 5570 00D5 55C0 0035 55C0 0035"
+ $"55C0 0000 0000 0000 0002 0000 FFFF FFFF"
+ $"FFFF 0001 FFFF CCCC 9999 0003 0000 0000"
+ $"0000"
+};
+
diff --git a/tk/macosx/tkMacOSXDebug.c b/tk/macosx/tkMacOSXDebug.c
new file mode 100644
index 00000000000..53997e8fd5e
--- /dev/null
+++ b/tk/macosx/tkMacOSXDebug.c
@@ -0,0 +1,439 @@
+/*
+ * tkMacOSXDebug.c --
+ *
+ * Implementation of Macintosh specific functions for debugging MacOS events,
+ * regions, etc...
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#include "tkMacOSXDebug.h"
+
+typedef struct {
+ EventKind kind;
+ char * name;
+} MyEventName;
+
+typedef struct {
+ EventClass c;
+ MyEventName * names;
+} MyEventNameList;
+
+static MyEventName windowEventNames [] = {
+ { kEventWindowUpdate,"Update"},
+ { kEventWindowDrawContent,"DrawContent"},
+ { kEventWindowActivated,"Activated"},
+ { kEventWindowDeactivated,"Deactivated"},
+ { kEventWindowGetClickActivation,"GetClickActivation"},
+ { kEventWindowShowing,"Showing"},
+ { kEventWindowHiding,"Hiding"},
+ { kEventWindowShown,"Shown"},
+ { kEventWindowHidden,"Hidden"},
+ { kEventWindowBoundsChanging,"BoundsChanging"},
+ { kEventWindowBoundsChanged,"BoundsChanged"},
+ { kEventWindowResizeStarted,"ResizeStarted"},
+ { kEventWindowResizeCompleted,"ResizeCompleted"},
+ { kEventWindowDragStarted,"DragStarted"},
+ { kEventWindowDragCompleted,"DragCompleted"},
+ { kEventWindowClickDragRgn,"ClickDragRgn"},
+ { kEventWindowClickResizeRgn,"ClickResizeRgn"},
+ { kEventWindowClickCollapseRgn,"ClickCollapseRgn"},
+ { kEventWindowClickCloseRgn,"ClickCloseRgn"},
+ { kEventWindowClickZoomRgn,"ClickZoomRgn"},
+ { kEventWindowClickContentRgn,"ClickContentRgn"},
+ { kEventWindowClickProxyIconRgn,"ClickProxyIconRgn"},
+ { kEventWindowCursorChange,"CursorChange" },
+ { kEventWindowCollapse,"Collapse"},
+ { kEventWindowCollapsed,"Collapsed"},
+ { kEventWindowCollapseAll,"CollapseAll"},
+ { kEventWindowExpand,"Expand"},
+ { kEventWindowExpanded,"Expanded"},
+ { kEventWindowExpandAll,"ExpandAll"},
+ { kEventWindowCollapse,"Collapse"},
+ { kEventWindowClose,"Close"},
+ { kEventWindowClosed,"Closed"},
+ { kEventWindowCloseAll,"CloseAll"},
+ { kEventWindowZoom,"Zoom"},
+ { kEventWindowZoomed,"Zoomed"},
+ { kEventWindowZoomAll,"ZoomAll"},
+ { kEventWindowContextualMenuSelect,"ContextualMenuSelect"},
+ { kEventWindowPathSelect,"PathSelect"},
+ { kEventWindowGetIdealSize,"GetIdealSize"},
+ { kEventWindowGetMinimumSize,"GetMinimumSize"},
+ { kEventWindowGetMaximumSize,"GetMaximumSize"},
+ { kEventWindowConstrain,"Constrain"},
+ { kEventWindowHandleContentClick,"HandleContentClick"},
+ { kEventWindowProxyBeginDrag,"ProxyBeginDra}"},
+ { kEventWindowProxyEndDrag,"ProxyEndDrag"},
+ { kEventWindowFocusAcquired,"FocusAcquired"},
+ { kEventWindowFocusRelinquish,"FocusRelinquish"},
+ { kEventWindowDrawFrame,"DrawFrame"},
+ { kEventWindowDrawPart,"DrawPart"},
+ { kEventWindowGetRegion,"GetRegion"},
+ { kEventWindowHitTest,"HitTest"},
+ { kEventWindowInit,"Init"},
+ { kEventWindowDispose,"Dispose"},
+ { kEventWindowDragHilite,"DragHilite"},
+ { kEventWindowModified,"Modified"},
+ { kEventWindowSetupProxyDragImage,"SetupProxyDragImage"},
+ { kEventWindowStateChanged,"StateChanged"},
+ { kEventWindowMeasureTitle,"MeasureTitle"},
+ { kEventWindowDrawGrowBox,"DrawGrowBox"},
+ { kEventWindowGetGrowImageRegion,"GetGrowImageRegion"},
+ { kEventWindowPaint,"Paint"},
+ { 0, NULL },
+};
+
+static MyEventName mouseEventNames [] = {
+ { kEventMouseMoved, "Moved"},
+ { kEventMouseUp, "Up"},
+ { kEventMouseDown, "Down"},
+ { kEventMouseDragged, "Dragged"},
+ { kEventMouseWheelMoved, "WheelMoved"},
+ { 0, NULL}
+};
+
+static MyEventName keyboardEventNames [] = {
+ { kEventRawKeyDown, "Down"},
+ { kEventRawKeyRepeat, "Repeat"},
+ { kEventRawKeyUp, "Up"},
+ { kEventRawKeyModifiersChanged, "ModifiersChanged"},
+ { kEventHotKeyPressed, "HotKeyPressed"},
+ { kEventHotKeyReleased, "HotKeyReleased"},
+ { 0, NULL}
+};
+
+static MyEventName appEventNames [] = {
+ { kEventAppActivated, "Activated"},
+ { kEventAppDeactivated, "Deactivated"},
+ { kEventAppQuit, "Quit"},
+ { kEventAppLaunchNotification, "LaunchNotification"},
+ { kEventAppLaunched, "Launched"},
+ { kEventAppTerminated, "Terminated"},
+ { kEventAppFrontSwitched, "FrontSwitched"},
+ { 0, NULL}
+};
+
+static MyEventName menuEventNames [] = {
+ { kEventMenuBeginTracking, "BeginTracking"},
+ { kEventMenuEndTracking, "EndTracking"},
+ { kEventMenuChangeTrackingMode, "ChangeTrackingMode"},
+ { kEventMenuOpening, "Opening"},
+ { kEventMenuClosed, "Closed"},
+ { kEventMenuTargetItem, "TargetItem"},
+ { kEventMenuMatchKey, "MatchKey"},
+ { kEventMenuEnableItems, "EnableItems"},
+ { kEventMenuDispose, "Dispose"},
+ { 0, NULL }
+};
+
+static MyEventName controlEventNames [] = {
+ { kEventControlInitialize, "Initialize" },
+ { kEventControlDispose, "Dispose" },
+ { kEventControlGetOptimalBounds, "GetOptimalBounds" },
+ { kEventControlHit, "Hit" },
+ { kEventControlSimulateHit, "SimulateHit" },
+ { kEventControlHitTest, "HitTest" },
+ { kEventControlDraw, "Draw" },
+ { kEventControlApplyBackground, "ApplyBackground" },
+ { kEventControlApplyTextColor, "ApplyTextColor" },
+ { kEventControlSetFocusPart, "SetFocusPart" },
+ { kEventControlGetFocusPart, "GetFocusPart" },
+ { kEventControlActivate, "Activate" },
+ { kEventControlDeactivate, "Deactivate" },
+ { kEventControlSetCursor, "SetCursor" },
+ { kEventControlContextualMenuClick, "ContextualMenuClick" },
+ { kEventControlClick, "Click" },
+ { kEventControlTrack, "Track" },
+ { kEventControlGetScrollToHereStartPoint, "GetScrollToHereStartPoint" },
+ { kEventControlGetIndicatorDragConstraint, "GetIndicatorDragConstraint" },
+ { kEventControlIndicatorMoved, "IndicatorMoved" },
+ { kEventControlGhostingFinished, "GhostingFinished" },
+ { kEventControlGetActionProcPart, "GetActionProcPart" },
+ { kEventControlGetPartRegion, "GetPartRegion" },
+ { kEventControlGetPartBounds, "GetPartBounds" },
+ { kEventControlSetData, "SetData" },
+ { kEventControlGetData, "GetData" },
+ { kEventControlValueFieldChanged, "ValueFieldChanged" },
+ { kEventControlAddedSubControl, "AddedSubControl" },
+ { kEventControlRemovingSubControl, "RemovingSubControl" },
+ { kEventControlBoundsChanged, "BoundsChanged" },
+ { kEventControlOwningWindowChanged, "OwningWindowChanged" },
+ { kEventControlArbitraryMessage, "ArbitraryMessage" },
+ { 0, NULL }
+};
+
+
+static MyEventName commandEventNames [] = {
+ { kEventCommandProcess, "Process" },
+ { kEventCommandUpdateStatus, "UpdateStatus" },
+ { 0, NULL }
+};
+
+static MyEventNameList eventNameList [] = {
+ { kEventClassWindow, windowEventNames },
+ { kEventClassMouse, mouseEventNames },
+ { kEventClassKeyboard, keyboardEventNames },
+ { kEventClassApplication, appEventNames },
+ { kEventClassMenu, menuEventNames },
+ { kEventClassControl, controlEventNames },
+ { kEventClassCommand, commandEventNames },
+ { 0, NULL}
+};
+
+
+MyEventName classicEventNames [] = {
+ { nullEvent,"nullEvent" },
+ { mouseDown,"mouseDown" },
+ { mouseUp,"mouseUp" },
+ { keyDown,"keyDown" },
+ { keyUp,"keyUp" },
+ { autoKey,"autoKey" },
+ { updateEvt,"updateEvt" },
+ { diskEvt,"diskEvt" },
+ { activateEvt,"activateEvt" },
+ { osEvt,"osEvt" },
+ { kHighLevelEvent,"kHighLevelEvent" },
+ { 0, NULL }
+};
+
+char *
+CarbonEventToAscii(EventRef eventRef, char * buf)
+{
+ EventClass eventClass;
+ EventKind eventKind;
+ MyEventNameList * list = eventNameList;
+ MyEventName * names = NULL;
+ int * iPtr = ( int * )buf;
+ char * iBuf = buf;
+ int found = 0;
+
+ eventClass = GetEventClass(eventRef);
+ eventKind = GetEventKind(eventRef);
+
+ *iPtr = eventClass;
+ buf [ 4 ] = 0;
+ strcat(buf, " ");
+ buf += strlen(buf);
+ while (list->names && (!names) ) {
+ if (eventClass==list->c) {
+ names = list -> names;
+ } else {
+ list++;
+ }
+ }
+ if (names) {
+ found = 0;
+ while (names->name && !found) {
+ if (eventKind==names->kind) {
+ sprintf(buf, "%-20s", names->name);
+ found=1;
+ } else {
+ names++;
+ }
+ }
+ if (!found) {
+ sprintf(buf, "%-20d", eventKind );
+ }
+ } else {
+ sprintf(buf, "%-20d", eventKind );
+ }
+ return iBuf;
+}
+
+char * CarbonEventKindToAscii(EventRef eventRef, char * buf )
+{
+ EventClass eventClass;
+ EventKind eventKind;
+ MyEventNameList * list = eventNameList;
+ MyEventName * names = NULL;
+ int found = 0;
+ eventClass = GetEventClass(eventRef);
+ eventKind = GetEventKind(eventRef);
+ while (list->names && (!names) ) {
+ if (eventClass == list -> c) {
+ names = list -> names;
+ } else {
+ list++;
+ }
+ }
+ if (names) {
+ found=0;
+ while ( names->name && !found ) {
+ if (eventKind==names->kind) {
+ sprintf(buf,"%s",names->name);
+ found=1;
+ } else {
+ names++;
+ }
+ }
+ }
+ if (!found) {
+ sprintf ( buf,"%d", eventKind );
+ } else {
+ sprintf ( buf,"%d", eventKind );
+ }
+ return buf;
+}
+
+char * ClassicEventToAscii(EventRecord * eventPtr, char * buf )
+{
+ MyEventName * names = NULL;
+ int found = 0;
+ names = classicEventNames;
+ while ( names -> name && !found )
+ if (eventPtr->what==names->kind) {
+ int * iPtr;
+ char cBuf[8];
+ iPtr=( int *)&cBuf;
+ *iPtr = eventPtr->message;
+ cBuf[4] = 0;
+ sprintf(buf, "%-16s %08x %04x %s", names->name,
+ (int) eventPtr->message,
+ eventPtr->modifiers,
+ cBuf);
+ found=1;
+ } else {
+ names++;
+ }
+ if (!found) {
+ sprintf(buf,"%-16d %08x %08x, %s",
+ eventPtr->what, (int) eventPtr->message,
+ eventPtr->modifiers, buf);
+ }
+ return buf;
+
+}
+
+void printPoint(char * tag, Point * p )
+{
+ fprintf(stderr,"%s %4d %4d\n",
+ tag,p->h,p->v );
+}
+
+void printRect(char * tag, Rect * r )
+{
+ fprintf(stderr,"%s %4d %4d %4d %4d (%dx%d)\n",
+ tag,r->left,r->top,r->right,r->bottom,
+ r->right-r->left+1,r->bottom-r->top+1 );
+}
+
+void printRegion(char * tag, RgnHandle rgn )
+{
+ Rect r;
+ GetRegionBounds(rgn,&r);
+ printRect(tag,&r);
+}
+
+void printWindowTitle(char * tag, WindowRef window )
+{
+ Str255 title;
+ GetWTitle(window,title);
+ title [ title[0] + 1 ] = 0;
+ fprintf(stderr, "%s %s\n", tag, title +1 );
+}
+
+typedef struct {
+ int msg;
+ char * name;
+} MsgName;
+
+MsgName msgNames [] = {
+ { kMenuDrawMsg, "Draw"},
+ { kMenuSizeMsg, "Size"},
+ { kMenuPopUpMsg, "PopUp"},
+ { kMenuCalcItemMsg, "CalcItem" },
+ { kMenuThemeSavvyMsg, "ThemeSavvy"},
+ { kMenuInitMsg, "Init" },
+ { kMenuDisposeMsg, "Dispose" },
+ { kMenuFindItemMsg, "FindItem" },
+ { kMenuHiliteItemMsg, "HiliteItem" },
+ { kMenuDrawItemsMsg, "DrawItems" },
+ { -1, NULL }
+};
+
+
+char *
+TkMacOSXMenuMessageToAscii(int msg, char * s)
+{
+ MsgName * msgNamePtr;
+ for (msgNamePtr = msgNames;msgNamePtr->name;) {
+ if (msgNamePtr->msg==msg) {
+ strcpy(s,msgNamePtr->name);
+ return s;
+ } else {
+ msgNamePtr++;
+ }
+ }
+ sprintf(s,"unknown : %d", msg );
+ return s;
+}
+
+
+char * MouseTrackingResultToAscii(MouseTrackingResult r, char * buf)
+{
+ MsgName trackingNames [] = {
+ { kMouseTrackingMousePressed , "MousePressed " },
+ { kMouseTrackingMouseReleased , "MouseReleased " },
+ { kMouseTrackingMouseExited , "MouseExited " },
+ { kMouseTrackingMouseEntered , "MouseEntered " },
+ { kMouseTrackingMouseMoved , "MouseMoved " },
+ { kMouseTrackingKeyModifiersChanged, "KeyModifiersChanged" },
+ { kMouseTrackingUserCancelled , "UserCancelled " },
+ { kMouseTrackingTimedOut , "TimedOut " },
+ { -1, NULL }
+ };
+ MsgName * namePtr;
+ for (namePtr=trackingNames;namePtr->name;namePtr++) {
+ if (namePtr->msg==r) {
+ strcpy(buf,namePtr->name);
+ return buf;
+ }
+ }
+ sprintf(buf, "Unknown mouse tracking result : %d", r);
+ return buf;
+}
diff --git a/tk/macosx/tkMacOSXDebug.h b/tk/macosx/tkMacOSXDebug.h
new file mode 100644
index 00000000000..0b3185dd01a
--- /dev/null
+++ b/tk/macosx/tkMacOSXDebug.h
@@ -0,0 +1,69 @@
+/*
+ * tkMacOSXDebug.h --
+ *
+ * Declarations of Macintosh specific functions for debugging MacOS events,
+ * regions, etc...
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#ifndef _TKMACDEBUG
+#define _TKMACDEBUG
+#include <Carbon/Carbon.h>
+
+char * CarbonEventToAscii(EventRef eventRef, char * buf );
+char * ClassicEventToAscii(EventRecord * eventPtr, char * buf );
+
+void printRect(char * tag, Rect * r );
+void printPoint(char * tag, Point * p );
+
+void printRegion(char * tag, RgnHandle rgn );
+void printWindowTitle(char * tag, WindowRef window );
+char * TkMacOSXMenuMessageToAscii(int msg, char * s);
+
+char * MouseTrackingResultToAscii(MouseTrackingResult r, char * buf );
+#endif
diff --git a/tk/macosx/tkMacOSXDefault.h b/tk/macosx/tkMacOSXDefault.h
new file mode 100644
index 00000000000..e4a0ce4a2a6
--- /dev/null
+++ b/tk/macosx/tkMacOSXDefault.h
@@ -0,0 +1,531 @@
+/*
+ * tkMacOSXDefault.h --
+ *
+ * This file defines the defaults for all options for all of
+ * the Tk widgets.
+ *
+ * Copyright (c) 1991-1994 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#ifndef _TKMACDEFAULT
+#define _TKMACDEFAULT
+
+/*
+ * 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.
+ * SELECT_FG - Foreground 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 BLACK "Black"
+#define WHITE "White"
+
+#define NORMAL_BG "systemWindowBody"
+#define ACTIVE_BG "#ececec"
+#define SELECT_BG "systemHighlight"
+#define SELECT_FG "systemHighlightText"
+#define TROUGH "#c3c3c3"
+#define INDICATOR "#b03060"
+#define DISABLED "#a3a3a3"
+
+/*
+ * Defaults for labels, buttons, checkbuttons, and radiobuttons:
+ */
+
+#define DEF_BUTTON_ANCHOR "center"
+#define DEF_BUTTON_ACTIVE_BG_COLOR "systemButtonText"
+#define DEF_BUTTON_ACTIVE_BG_MONO BLACK
+#define DEF_BUTTON_ACTIVE_FG_COLOR "systemButtonFace"
+#define DEF_CHKRAD_ACTIVE_FG_COLOR DEF_BUTTON_ACTIVE_FG_COLOR
+#define DEF_BUTTON_ACTIVE_FG_MONO WHITE
+//IGR#define DEF_BUTTON_BG_COLOR "systemButtonFace"
+#define DEF_BUTTON_BG_COLOR WHITE
+#define DEF_BUTTON_BG_MONO WHITE
+#define DEF_BUTTON_BITMAP ""
+#define DEF_BUTTON_BORDER_WIDTH "2"
+#define DEF_BUTTON_CURSOR ""
+#define DEF_BUTTON_COMMAND ""
+#define DEF_BUTTON_COMPOUND "none"
+#define DEF_BUTTON_DEFAULT "disabled"
+#define DEF_BUTTON_DISABLED_FG_COLOR DISABLED
+#define DEF_BUTTON_DISABLED_FG_MONO ""
+//IGR#define DEF_BUTTON_FG "systemButtonText"
+#define DEF_BUTTON_FG BLACK
+#define DEF_CHKRAD_FG DEF_BUTTON_FG
+#define DEF_BUTTON_FONT "system"
+#define DEF_BUTTON_HEIGHT "0"
+#define DEF_BUTTON_HIGHLIGHT_BG_COLOR DEF_BUTTON_BG_COLOR
+#define DEF_BUTTON_HIGHLIGHT_BG_MONO DEF_BUTTON_BG_MONO
+#define DEF_BUTTON_HIGHLIGHT "systemButtonFrame"
+#define DEF_LABEL_HIGHLIGHT_WIDTH "0"
+#define DEF_BUTTON_HIGHLIGHT_WIDTH "4"
+#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_OVER_RELIEF ""
+#define DEF_BUTTON_PADX "12"
+#define DEF_LABCHKRAD_PADX "1"
+#define DEF_BUTTON_PADY "3"
+#define DEF_LABCHKRAD_PADY "1"
+#define DEF_BUTTON_RELIEF "flat"
+#define DEF_LABCHKRAD_RELIEF "flat"
+#define DEF_BUTTON_REPEAT_DELAY "0"
+#define DEF_BUTTON_REPEAT_INTERVAL "0"
+#define DEF_BUTTON_SELECT_COLOR INDICATOR
+#define DEF_BUTTON_SELECT_MONO 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 ""
+
+/*
+ * Defaults for canvases:
+ */
+
+#define DEF_CANVAS_BG_COLOR NORMAL_BG
+#define DEF_CANVAS_BG_MONO WHITE
+#define DEF_CANVAS_BORDER_WIDTH "0"
+#define DEF_CANVAS_CLOSE_ENOUGH "1"
+#define DEF_CANVAS_CONFINE "1"
+#define DEF_CANVAS_CURSOR ""
+#define DEF_CANVAS_HEIGHT "7c"
+#define DEF_CANVAS_HIGHLIGHT_BG NORMAL_BG
+#define DEF_CANVAS_HIGHLIGHT BLACK
+#define DEF_CANVAS_HIGHLIGHT_WIDTH "3"
+#define DEF_CANVAS_INSERT_BG BLACK
+#define DEF_CANVAS_INSERT_BD_COLOR "0"
+#define DEF_CANVAS_INSERT_BD_MONO "0"
+#define DEF_CANVAS_INSERT_OFF_TIME "300"
+#define DEF_CANVAS_INSERT_ON_TIME "600"
+#define DEF_CANVAS_INSERT_WIDTH "2"
+#define DEF_CANVAS_RELIEF "flat"
+#define DEF_CANVAS_SCROLL_REGION ""
+#define DEF_CANVAS_SELECT_COLOR SELECT_BG
+#define DEF_CANVAS_SELECT_MONO BLACK
+#define DEF_CANVAS_SELECT_BD_COLOR "1"
+#define DEF_CANVAS_SELECT_BD_MONO "0"
+#define DEF_CANVAS_SELECT_FG_COLOR BLACK
+#define DEF_CANVAS_SELECT_FG_MONO WHITE
+#define DEF_CANVAS_TAKE_FOCUS (char *) NULL
+#define DEF_CANVAS_WIDTH "10c"
+#define DEF_CANVAS_X_SCROLL_CMD ""
+#define DEF_CANVAS_X_SCROLL_INCREMENT "0"
+#define DEF_CANVAS_Y_SCROLL_CMD ""
+#define DEF_CANVAS_Y_SCROLL_INCREMENT "0"
+
+/*
+ * Defaults for entries:
+ */
+
+#define DEF_ENTRY_BG_COLOR NORMAL_BG
+#define DEF_ENTRY_BG_MONO WHITE
+/* #define DEF_ENTRY_BORDER_WIDTH "2" */
+#define DEF_ENTRY_BORDER_WIDTH "1"
+#define DEF_ENTRY_CURSOR "xterm"
+#define DEF_ENTRY_DISABLED_BG_COLOR NORMAL_BG
+#define DEF_ENTRY_DISABLED_BG_MONO WHITE
+#define DEF_ENTRY_DISABLED_FG DISABLED
+#define DEF_ENTRY_EXPORT_SELECTION "1"
+#define DEF_ENTRY_FONT "Helvetica 12"
+#define DEF_ENTRY_FG BLACK
+#define DEF_ENTRY_HIGHLIGHT_BG NORMAL_BG
+#define DEF_ENTRY_HIGHLIGHT BLACK
+/* #define DEF_ENTRY_HIGHLIGHT_WIDTH "3" */
+#define DEF_ENTRY_HIGHLIGHT_WIDTH "0"
+#define DEF_ENTRY_INSERT_BG BLACK
+#define DEF_ENTRY_INSERT_BD_COLOR "0"
+#define DEF_ENTRY_INSERT_BD_MONO "0"
+#define DEF_ENTRY_INSERT_OFF_TIME "300"
+#define DEF_ENTRY_INSERT_ON_TIME "600"
+/* #define DEF_ENTRY_INSERT_WIDTH "2" */
+#define DEF_ENTRY_INSERT_WIDTH "1"
+#define DEF_ENTRY_JUSTIFY "left"
+#define DEF_ENTRY_READONLY_BG_COLOR NORMAL_BG
+#define DEF_ENTRY_READONLY_BG_MONO WHITE
+/* #define DEF_ENTRY_RELIEF "sunken" */
+#define DEF_ENTRY_RELIEF "solid"
+#define DEF_ENTRY_SCROLL_COMMAND ""
+#define DEF_ENTRY_SELECT_COLOR SELECT_BG
+#define DEF_ENTRY_SELECT_MONO BLACK
+#define DEF_ENTRY_SELECT_BD_COLOR "1"
+#define DEF_ENTRY_SELECT_BD_MONO "0"
+#define DEF_ENTRY_SELECT_FG_COLOR SELECT_FG
+#define DEF_ENTRY_SELECT_FG_MONO WHITE
+#define DEF_ENTRY_SHOW (char *) NULL
+#define DEF_ENTRY_STATE "normal"
+#define DEF_ENTRY_TAKE_FOCUS (char *) NULL
+#define DEF_ENTRY_TEXT_VARIABLE ""
+#define DEF_ENTRY_WIDTH "20"
+
+/*
+ * Defaults for frames:
+ */
+
+#define DEF_FRAME_BG_COLOR NORMAL_BG
+#define DEF_FRAME_BG_MONO WHITE
+#define DEF_FRAME_BORDER_WIDTH "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 NORMAL_BG
+#define DEF_FRAME_HIGHLIGHT BLACK
+#define DEF_FRAME_HIGHLIGHT_WIDTH "0"
+#define DEF_FRAME_PADX "0"
+#define DEF_FRAME_PADY "0"
+#define DEF_FRAME_RELIEF "flat"
+#define DEF_FRAME_TAKE_FOCUS "0"
+#define DEF_FRAME_VISUAL ""
+#define DEF_FRAME_WIDTH "0"
+
+/*
+ * Defaults for labelframes:
+ */
+
+#define DEF_LABELFRAME_BORDER_WIDTH "2"
+#define DEF_LABELFRAME_CLASS "Labelframe"
+#define DEF_LABELFRAME_RELIEF "groove"
+#define DEF_LABELFRAME_FG "systemButtonText"
+#define DEF_LABELFRAME_FONT "system"
+#define DEF_LABELFRAME_TEXT ""
+#define DEF_LABELFRAME_LABELANCHOR "nw"
+
+/*
+ * Defaults for listboxes:
+ */
+
+#define DEF_LISTBOX_ACTIVE_STYLE "underline"
+#define DEF_LISTBOX_BG_COLOR NORMAL_BG
+#define DEF_LISTBOX_BG_MONO WHITE
+#define DEF_LISTBOX_BORDER_WIDTH "1"
+#define DEF_LISTBOX_CURSOR ""
+#define DEF_LISTBOX_DISABLED_FG DISABLED
+#define DEF_LISTBOX_EXPORT_SELECTION "1"
+#define DEF_LISTBOX_FONT "application"
+#define DEF_LISTBOX_FG BLACK
+#define DEF_LISTBOX_HEIGHT "10"
+#define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG
+#define DEF_LISTBOX_HIGHLIGHT BLACK
+#define DEF_LISTBOX_HIGHLIGHT_WIDTH "0"
+#define DEF_LISTBOX_RELIEF "solid"
+#define DEF_LISTBOX_SCROLL_COMMAND ""
+#define DEF_LISTBOX_LIST_VARIABLE ""
+#define DEF_LISTBOX_SELECT_COLOR SELECT_BG
+#define DEF_LISTBOX_SELECT_MONO BLACK
+#define DEF_LISTBOX_SELECT_BD "0"
+#define DEF_LISTBOX_SELECT_FG_COLOR SELECT_FG
+#define DEF_LISTBOX_SELECT_FG_MONO WHITE
+#define DEF_LISTBOX_SELECT_MODE "browse"
+#define DEF_LISTBOX_SET_GRID "0"
+#define DEF_LISTBOX_STATE "normal"
+#define DEF_LISTBOX_TAKE_FOCUS (char *) NULL
+#define DEF_LISTBOX_WIDTH "20"
+
+/*
+ * Defaults for individual entries of menus:
+ */
+
+#define DEF_MENU_ENTRY_ACTIVE_BG (char *) NULL
+#define DEF_MENU_ENTRY_ACTIVE_FG (char *) NULL
+#define DEF_MENU_ENTRY_ACCELERATOR (char *) NULL
+#define DEF_MENU_ENTRY_BG (char *) NULL
+#define DEF_MENU_ENTRY_BITMAP None
+#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
+#define DEF_MENU_ENTRY_COMMAND (char *) NULL
+#define DEF_MENU_ENTRY_COMPOUND "none"
+#define DEF_MENU_ENTRY_FG (char *) NULL
+#define DEF_MENU_ENTRY_FONT (char *) NULL
+#define DEF_MENU_ENTRY_HIDE_MARGIN "0"
+#define DEF_MENU_ENTRY_IMAGE (char *) NULL
+#define DEF_MENU_ENTRY_INDICATOR "1"
+#define DEF_MENU_ENTRY_LABEL (char *) NULL
+#define DEF_MENU_ENTRY_MENU (char *) NULL
+#define DEF_MENU_ENTRY_OFF_VALUE "0"
+#define DEF_MENU_ENTRY_ON_VALUE "1"
+#define DEF_MENU_ENTRY_SELECT_IMAGE (char *) NULL
+#define DEF_MENU_ENTRY_STATE "normal"
+#define DEF_MENU_ENTRY_VALUE (char *) NULL
+#define DEF_MENU_ENTRY_CHECK_VARIABLE (char *) NULL
+#define DEF_MENU_ENTRY_RADIO_VARIABLE "selectedButton"
+#define DEF_MENU_ENTRY_SELECT (char *) NULL
+#define DEF_MENU_ENTRY_UNDERLINE "-1"
+
+/*
+ * Defaults for menus overall:
+ */
+
+#define DEF_MENU_ACTIVE_BG_COLOR "SystemMenuActive"
+#define DEF_MENU_ACTIVE_BG_MONO BLACK
+#define DEF_MENU_ACTIVE_BORDER_WIDTH "0"
+#define DEF_MENU_ACTIVE_FG_COLOR "SystemMenuActiveText"
+#define DEF_MENU_ACTIVE_FG_MONO WHITE
+#define DEF_MENU_BG_COLOR "SystemMenu"
+#define DEF_MENU_BG_MONO WHITE
+#define DEF_MENU_BORDER_WIDTH "0"
+#define DEF_MENU_CURSOR "arrow"
+#define DEF_MENU_DISABLED_FG_COLOR "SystemMenuDisabled"
+#define DEF_MENU_DISABLED_FG_MONO ""
+#define DEF_MENU_FONT "system"
+#define DEF_MENU_FG "SystemMenuText"
+#define DEF_MENU_POST_COMMAND ""
+#define DEF_MENU_RELIEF "flat"
+#define DEF_MENU_SELECT_COLOR "SystemMenuActive"
+#define DEF_MENU_SELECT_MONO BLACK
+#define DEF_MENU_TAKE_FOCUS "0"
+#define DEF_MENU_TEAROFF "1"
+#define DEF_MENU_TEAROFF_CMD (char *) NULL
+#define DEF_MENU_TITLE ""
+#define DEF_MENU_TYPE "normal"
+
+/*
+ * Defaults for menubuttons:
+ */
+
+#define DEF_MENUBUTTON_ANCHOR "center"
+#define DEF_MENUBUTTON_ACTIVE_BG_COLOR ACTIVE_BG
+#define DEF_MENUBUTTON_ACTIVE_BG_MONO BLACK
+#define DEF_MENUBUTTON_ACTIVE_FG_COLOR BLACK
+#define DEF_MENUBUTTON_ACTIVE_FG_MONO WHITE
+#define DEF_MENUBUTTON_BG_COLOR NORMAL_BG
+#define DEF_MENUBUTTON_BG_MONO WHITE
+#define DEF_MENUBUTTON_BITMAP ""
+#define DEF_MENUBUTTON_BORDER_WIDTH "2"
+#define DEF_MENUBUTTON_CURSOR ""
+#define DEF_MENUBUTTON_DIRECTION "below"
+#define DEF_MENUBUTTON_DISABLED_FG_COLOR DISABLED
+#define DEF_MENUBUTTON_DISABLED_FG_MONO ""
+#define DEF_MENUBUTTON_FONT "system"
+#define DEF_MENUBUTTON_FG BLACK
+#define DEF_MENUBUTTON_HEIGHT "0"
+#define DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR DEF_MENUBUTTON_BG_COLOR
+#define DEF_MENUBUTTON_HIGHLIGHT_BG_MONO DEF_MENUBUTTON_BG_MONO
+#define DEF_MENUBUTTON_HIGHLIGHT 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_JUSTIFY "left"
+#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"
+
+/*
+ * Defaults for messages:
+ */
+
+#define DEF_MESSAGE_ANCHOR "center"
+#define DEF_MESSAGE_ASPECT "150"
+#define DEF_MESSAGE_BG_COLOR NORMAL_BG
+#define DEF_MESSAGE_BG_MONO WHITE
+#define DEF_MESSAGE_BORDER_WIDTH "2"
+#define DEF_MESSAGE_CURSOR ""
+#define DEF_MESSAGE_FG BLACK
+#define DEF_MESSAGE_FONT "system"
+#define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG
+#define DEF_MESSAGE_HIGHLIGHT BLACK
+#define DEF_MESSAGE_HIGHLIGHT_WIDTH "0"
+#define DEF_MESSAGE_JUSTIFY "left"
+#define DEF_MESSAGE_PADX "-1"
+#define DEF_MESSAGE_PADY "-1"
+#define DEF_MESSAGE_RELIEF "flat"
+#define DEF_MESSAGE_TAKE_FOCUS "0"
+#define DEF_MESSAGE_TEXT ""
+#define DEF_MESSAGE_TEXT_VARIABLE ""
+#define DEF_MESSAGE_WIDTH "0"
+/*
+ * Defaults for panedwindows
+ */
+
+#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG
+#define DEF_PANEDWINDOW_BG_MONO WHITE
+#define DEF_PANEDWINDOW_BORDERWIDTH "2"
+#define DEF_PANEDWINDOW_CURSOR ""
+#define DEF_PANEDWINDOW_HANDLEPAD "8"
+#define DEF_PANEDWINDOW_HANDLESIZE "8"
+#define DEF_PANEDWINDOW_HEIGHT ""
+#define DEF_PANEDWINDOW_OPAQUERESIZE "0"
+#define DEF_PANEDWINDOW_ORIENT "horizontal"
+#define DEF_PANEDWINDOW_RELIEF "flat"
+#define DEF_PANEDWINDOW_SASHCURSOR ""
+#define DEF_PANEDWINDOW_SASHPAD "2"
+#define DEF_PANEDWINDOW_SASHRELIEF "raised"
+#define DEF_PANEDWINDOW_SASHWIDTH "2"
+#define DEF_PANEDWINDOW_SHOWHANDLE "1"
+#define DEF_PANEDWINDOW_WIDTH ""
+
+/*
+ * Defaults for panedwindow panes
+ */
+
+#define DEF_PANEDWINDOW_PANE_AFTER ""
+#define DEF_PANEDWINDOW_PANE_BEFORE ""
+#define DEF_PANEDWINDOW_PANE_HEIGHT ""
+#define DEF_PANEDWINDOW_PANE_MINSIZE "0"
+#define DEF_PANEDWINDOW_PANE_PADX "0"
+#define DEF_PANEDWINDOW_PANE_PADY "0"
+#define DEF_PANEDWINDOW_PANE_STICKY "nsew"
+#define DEF_PANEDWINDOW_PANE_WIDTH ""
+
+/*
+ * Defaults for scales:
+ */
+
+#define DEF_SCALE_ACTIVE_BG_COLOR ACTIVE_BG
+#define DEF_SCALE_ACTIVE_BG_MONO BLACK
+#define DEF_SCALE_BG_COLOR NORMAL_BG
+#define DEF_SCALE_BG_MONO WHITE
+#define DEF_SCALE_BIG_INCREMENT "0"
+#define DEF_SCALE_BORDER_WIDTH "2"
+#define DEF_SCALE_COMMAND ""
+#define DEF_SCALE_CURSOR ""
+#define DEF_SCALE_DIGITS "0"
+#define DEF_SCALE_FONT "system"
+#define DEF_SCALE_FG_COLOR BLACK
+#define DEF_SCALE_FG_MONO BLACK
+#define DEF_SCALE_FROM "0"
+#define DEF_SCALE_HIGHLIGHT_BG_COLOR DEF_SCALE_BG_COLOR
+#define DEF_SCALE_HIGHLIGHT_BG_MONO DEF_SCALE_BG_MONO
+#define DEF_SCALE_HIGHLIGHT BLACK
+#define DEF_SCALE_HIGHLIGHT_WIDTH "0"
+#define DEF_SCALE_LABEL ""
+#define DEF_SCALE_LENGTH "100"
+#define DEF_SCALE_ORIENT "vertical"
+#define DEF_SCALE_RELIEF "flat"
+#define DEF_SCALE_REPEAT_DELAY "300"
+#define DEF_SCALE_REPEAT_INTERVAL "100"
+#define DEF_SCALE_RESOLUTION "1"
+#define DEF_SCALE_TROUGH_COLOR TROUGH
+#define DEF_SCALE_TROUGH_MONO WHITE
+#define DEF_SCALE_SHOW_VALUE "1"
+#define DEF_SCALE_SLIDER_LENGTH "30"
+#define DEF_SCALE_SLIDER_RELIEF "raised"
+#define DEF_SCALE_STATE "normal"
+#define DEF_SCALE_TAKE_FOCUS (char *) NULL
+#define DEF_SCALE_TICK_INTERVAL "0"
+#define DEF_SCALE_TO "100"
+#define DEF_SCALE_VARIABLE ""
+#define DEF_SCALE_WIDTH "15"
+
+/*
+ * Defaults for scrollbars:
+ */
+
+#define DEF_SCROLLBAR_ACTIVE_BG_COLOR ACTIVE_BG
+#define DEF_SCROLLBAR_ACTIVE_BG_MONO BLACK
+#define DEF_SCROLLBAR_ACTIVE_RELIEF "raised"
+#define DEF_SCROLLBAR_BG_COLOR NORMAL_BG
+#define DEF_SCROLLBAR_BG_MONO WHITE
+/* #define DEF_SCROLLBAR_BORDER_WIDTH "2" */
+#define DEF_SCROLLBAR_BORDER_WIDTH "0"
+#define DEF_SCROLLBAR_COMMAND ""
+#define DEF_SCROLLBAR_CURSOR ""
+#define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1"
+#define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG
+#define DEF_SCROLLBAR_HIGHLIGHT BLACK
+/* #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "2" */
+#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0"
+#define DEF_SCROLLBAR_JUMP "0"
+#define DEF_SCROLLBAR_ORIENT "vertical"
+/*#define DEF_SCROLLBAR_RELIEF "sunken" */
+#define DEF_SCROLLBAR_RELIEF "flat"
+#define DEF_SCROLLBAR_REPEAT_DELAY "300"
+#define DEF_SCROLLBAR_REPEAT_INTERVAL "100"
+#define DEF_SCROLLBAR_TAKE_FOCUS (char *) NULL
+#define DEF_SCROLLBAR_TROUGH_COLOR TROUGH
+#define DEF_SCROLLBAR_TROUGH_MONO WHITE
+/*#define DEF_SCROLLBAR_WIDTH "15" */
+#define DEF_SCROLLBAR_WIDTH "16"
+
+/*
+ * Defaults for texts:
+ */
+
+#define DEF_TEXT_AUTO_SEPARATORS "1"
+#define DEF_TEXT_BG_COLOR NORMAL_BG
+#define DEF_TEXT_BG_MONO WHITE
+#define DEF_TEXT_BORDER_WIDTH "0"
+#define DEF_TEXT_CURSOR "xterm"
+#define DEF_TEXT_FG BLACK
+#define DEF_TEXT_EXPORT_SELECTION "1"
+#define DEF_TEXT_FONT "Courier 12"
+#define DEF_TEXT_HEIGHT "24"
+#define DEF_TEXT_HIGHLIGHT_BG NORMAL_BG
+#define DEF_TEXT_HIGHLIGHT BLACK
+#define DEF_TEXT_HIGHLIGHT_WIDTH "3"
+#define DEF_TEXT_INSERT_BG BLACK
+#define DEF_TEXT_INSERT_BD_COLOR "0"
+#define DEF_TEXT_INSERT_BD_MONO "0"
+#define DEF_TEXT_INSERT_OFF_TIME "300"
+#define DEF_TEXT_INSERT_ON_TIME "600"
+#define DEF_TEXT_INSERT_WIDTH "1"
+#define DEF_TEXT_MAX_UNDO "0"
+#define DEF_TEXT_PADX "1"
+#define DEF_TEXT_PADY "1"
+#define DEF_TEXT_RELIEF "flat"
+#define DEF_TEXT_SELECT_COLOR SELECT_BG
+#define DEF_TEXT_SELECT_MONO BLACK
+#define DEF_TEXT_SELECT_BD_COLOR "1"
+#define DEF_TEXT_SELECT_BD_MONO "0"
+#define DEF_TEXT_SELECT_FG_COLOR SELECT_FG
+#define DEF_TEXT_SELECT_FG_MONO WHITE
+#define DEF_TEXT_SELECT_RELIEF "solid"
+#define DEF_TEXT_SET_GRID "0"
+#define DEF_TEXT_SPACING1 "0"
+#define DEF_TEXT_SPACING2 "0"
+#define DEF_TEXT_SPACING3 "0"
+#define DEF_TEXT_STATE "normal"
+#define DEF_TEXT_TABS ""
+#define DEF_TEXT_TAKE_FOCUS (char *) NULL
+#define DEF_TEXT_UNDO "0"
+#define DEF_TEXT_WIDTH "80"
+#define DEF_TEXT_WRAP "char"
+#define DEF_TEXT_XSCROLL_COMMAND ""
+#define DEF_TEXT_YSCROLL_COMMAND ""
+
+/*
+ * Defaults for canvas text:
+ */
+
+#define DEF_CANVTEXT_FONT "Helvetica 12"
+
+/*
+ * Defaults for toplevels (most of the defaults for frames also apply
+ * to toplevels):
+ */
+
+#define DEF_TOPLEVEL_CLASS "Toplevel"
+#define DEF_TOPLEVEL_MENU ""
+#define DEF_TOPLEVEL_SCREEN ""
+#define DEF_TOPLEVEL_USE ""
+
+#endif /* _TKMACDEFAULT */
diff --git a/tk/macosx/tkMacOSXDialog.c b/tk/macosx/tkMacOSXDialog.c
new file mode 100644
index 00000000000..281461ee737
--- /dev/null
+++ b/tk/macosx/tkMacOSXDialog.c
@@ -0,0 +1,1229 @@
+/*
+ * tkMacOSXDialog.c --
+ *
+ * Contains the Mac implementation of the common dialog boxes.
+ *
+ * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+#include <Carbon/Carbon.h>
+
+#include "tkPort.h"
+#include "tkInt.h"
+#include "tkMacOSXUtil.h"
+#include "tkMacOSXInt.h"
+#include "tkFileFilter.h"
+
+#ifndef StrLength
+#define StrLength(s) (*((unsigned char *) (s)))
+#endif
+#ifndef StrBody
+#define StrBody(s) ((char *) (s) + 1)
+#endif
+
+/*
+ * The following are ID's for resources that are defined in tkMacOSXResource.r
+ */
+#define OPEN_BOX 130
+#define OPEN_POPUP 131
+#define OPEN_MENU 132
+#define OPEN_POPUP_ITEM 10
+
+#define SAVE_FILE 0
+#define OPEN_FILE 1
+#define CHOOSE_FOLDER 2
+
+#define MATCHED 0
+#define UNMATCHED 1
+
+#define TK_DEFAULT_ABOUT 128
+
+/*
+ * The following structure is used in the GetFileName() function. It stored
+ * information about the file dialog and the file filters.
+ */
+typedef struct _OpenFileData {
+ FileFilterList fl; /* List of file filters. */
+ SInt16 curType; /* The filetype currently being
+ * listed. */
+ short popupItem; /* Item number of the popup in the
+ * dialog. */
+ int usePopup; /* True if we show the popup menu (this
+ * is an open operation and the
+ * -filetypes option is set). */
+} OpenFileData;
+
+
+static Boolean MatchOneType _ANSI_ARGS_((StringPtr fileNamePtr, OSType fileType,
+ OpenFileData *myofdPtr, FileFilter *filterPtr));
+static pascal Boolean OpenFileFilterProc(AEDesc* theItem, void* info,
+ NavCallBackUserData callBackUD,
+ NavFilterModes filterMode );
+pascal void OpenEventProc(NavEventCallbackMessage callBackSelector,
+ NavCBRecPtr callBackParms,
+ NavCallBackUserData callBackUD );
+static void InitFileDialogs();
+static int NavServicesGetFile(Tcl_Interp *interp, OpenFileData *ofd,
+ AEDesc *initialDescPtr,
+ unsigned char *initialFile, AEDescList *selectDescPtr,
+ StringPtr title, StringPtr message, int multiple, int isOpen);
+static int HandleInitialDirectory (Tcl_Interp *interp,
+ char *initialFile, char *initialDir,
+ FSRef *dirRef,
+ AEDescList *selectDescPtr,
+ AEDesc *dirDescPtr);
+
+/*
+ * Have we initialized the file dialog subsystem
+ */
+
+static int fileDlgInited = 0;
+
+/*
+ * Filter and hook functions used by the tk_getOpenFile and tk_getSaveFile
+ * commands.
+ */
+
+NavObjectFilterUPP openFileFilterUPP;
+NavEventUPP openFileEventUPP;
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_ChooseColorObjCmd --
+ *
+ * This procedure implements the color dialog box for the Mac
+ * platform. See the user documentation for details on what it
+ * does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_ChooseColorObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
+{
+ Tk_Window parent;
+ char *title;
+ int i, picked, srcRead, dstWrote;
+ ColorPickerInfo cpinfo;
+ static int inited = 0;
+ static RGBColor in;
+ static CONST char *optionStrings[] = {
+ "-initialcolor", "-parent", "-title", NULL
+ };
+ enum options {
+ COLOR_INITIAL, COLOR_PARENT, COLOR_TITLE
+ };
+
+ if (inited == 0) {
+ /*
+ * 'in' stores the last color picked. The next time the color dialog
+ * pops up, the last color will remain in the dialog.
+ */
+
+ in.red = 0xffff;
+ in.green = 0xffff;
+ in.blue = 0xffff;
+ inited = 1;
+ }
+
+ parent = (Tk_Window) clientData;
+ title = "Choose a color:";
+ picked = 0;
+
+ for (i = 1; i < objc; i += 2) {
+ int index;
+ char *option, *value;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], optionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (i + 1 == objc) {
+ option = Tcl_GetStringFromObj(objv[i], NULL);
+ Tcl_AppendResult(interp, "value for \"", option, "\" missing",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ value = Tcl_GetStringFromObj(objv[i + 1], NULL);
+
+ switch ((enum options) index) {
+ case COLOR_INITIAL: {
+ XColor *colorPtr;
+
+ colorPtr = Tk_GetColor(interp, parent, value);
+ if (colorPtr == NULL) {
+ return TCL_ERROR;
+ }
+ in.red = colorPtr->red;
+ in.green = colorPtr->green;
+ in.blue = colorPtr->blue;
+ Tk_FreeColor(colorPtr);
+ break;
+ }
+ case COLOR_PARENT: {
+ parent = Tk_NameToWindow(interp, value, parent);
+ if (parent == NULL) {
+ return TCL_ERROR;
+ }
+ break;
+ }
+ case COLOR_TITLE: {
+ title = value;
+ break;
+ }
+ }
+ }
+
+
+ cpinfo.theColor.profile = 0L;
+ cpinfo.theColor.color.rgb.red = in.red;
+ cpinfo.theColor.color.rgb.green = in.green;
+ cpinfo.theColor.color.rgb.blue = in.blue;
+ cpinfo.dstProfile = 0L;
+ cpinfo.flags = kColorPickerCanModifyPalette
+ | kColorPickerCanAnimatePalette;
+ cpinfo.placeWhere = kDeepestColorScreen;
+ cpinfo.pickerType = 0L;
+ cpinfo.eventProc = NULL;
+ cpinfo.colorProc = NULL;
+ cpinfo.colorProcData = NULL;
+
+ /* This doesn't seem to actually set the title! */
+ Tcl_UtfToExternal(NULL, NULL, title, -1, 0, NULL,
+ StrBody(cpinfo.prompt), 255, &srcRead, &dstWrote, NULL);
+ StrLength(cpinfo.prompt) = (unsigned char) dstWrote;
+
+ if ((PickColor(&cpinfo) == noErr) && (cpinfo.newColorChosen != 0)) {
+ in.red = cpinfo.theColor.color.rgb.red;
+ in.green = cpinfo.theColor.color.rgb.green;
+ in.blue = cpinfo.theColor.color.rgb.blue;
+ picked = 1;
+ }
+
+ if (picked != 0) {
+ char result[32];
+
+ sprintf(result, "#%02x%02x%02x", in.red >> 8, in.green >> 8,
+ in.blue >> 8);
+ Tcl_AppendResult(interp, result, NULL);
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetOpenFileObjCmd --
+ *
+ * This procedure implements the "open file" dialog box for the
+ * Mac platform. See the user documentation for details on what
+ * it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See user documentation.
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_GetOpenFileObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
+{
+ int i, result, multiple;
+ OpenFileData ofd;
+ Tk_Window parent;
+ Str255 message, title;
+ AEDesc initialDesc = {typeNull, NULL};
+ FSRef dirRef;
+ AEDesc *initialPtr = NULL;
+ AEDescList selectDesc = {typeNull, NULL};
+ char *initialFile = NULL, *initialDir = NULL;
+ static CONST char *openOptionStrings[] = {
+ "-defaultextension", "-filetypes",
+ "-initialdir", "-initialfile",
+ "-message", "-multiple",
+ "-parent", "-title", NULL
+ };
+ enum openOptions {
+ OPEN_DEFAULT, OPEN_FILETYPES,
+ OPEN_INITDIR, OPEN_INITFILE,
+ OPEN_MESSAGE, OPEN_MULTIPLE,
+ OPEN_PARENT, OPEN_TITLE
+ };
+
+ if (!fileDlgInited) {
+ InitFileDialogs();
+ }
+
+ result = TCL_ERROR;
+ parent = (Tk_Window) clientData;
+ multiple = false;
+ title[0] = 0;
+ message[0] = 0;
+
+ TkInitFileFilters(&ofd.fl);
+
+ ofd.curType = 0;
+ ofd.popupItem = OPEN_POPUP_ITEM;
+ ofd.usePopup = 1;
+
+ for (i = 1; i < objc; i += 2) {
+ char *choice;
+ int index, choiceLen;
+ char *string;
+ int srcRead, dstWrote;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], openOptionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetStringFromObj(objv[i], NULL);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ (char *) NULL);
+ result = TCL_ERROR;
+ goto end;
+ }
+
+ switch (index) {
+ case OPEN_DEFAULT:
+ break;
+ case OPEN_FILETYPES:
+ choice = Tcl_GetStringFromObj(objv[i + 1], NULL);
+ if (TkGetFileFilters(interp, &ofd.fl, choice, 0)
+ != TCL_OK) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ break;
+ case OPEN_INITDIR:
+ initialDir = Tcl_GetStringFromObj(objv[i + 1], NULL);
+ break;
+ case OPEN_INITFILE:
+ initialFile = Tcl_GetStringFromObj(objv[i + 1], NULL);
+ break;
+ case OPEN_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, choice, choiceLen,
+ 0, NULL, StrBody(message), 255,
+ &srcRead, &dstWrote, NULL);
+ message[0] = dstWrote;
+ break;
+ case OPEN_MULTIPLE:
+ if (Tcl_GetBooleanFromObj(interp, objv[i + 1], &multiple)
+ != TCL_OK) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ break;
+ case OPEN_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, parent);
+ if (parent == NULL) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ break;
+ case OPEN_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, choice, choiceLen,
+ 0, NULL, StrBody(title), 255,
+ &srcRead, &dstWrote, NULL);
+ title[0] = dstWrote;
+ break;
+ }
+ }
+
+ if (HandleInitialDirectory(interp, initialFile, initialDir, &dirRef,
+ &selectDesc, &initialDesc) != TCL_OK) {
+ result = TCL_ERROR;
+ goto end;
+ }
+
+ if (initialDesc.descriptorType == typeFSRef) {
+ initialPtr = &initialDesc;
+ }
+ result = NavServicesGetFile(interp, &ofd, initialPtr,
+ NULL, &selectDesc,
+ title, message, multiple, OPEN_FILE);
+
+ end:
+ TkFreeFileFilters(&ofd.fl);
+ AEDisposeDesc(&initialDesc);
+ AEDisposeDesc(&selectDesc);
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetSaveFileObjCmd --
+ *
+ * Same as Tk_GetOpenFileCmd but opens a "save file" dialog box
+ * instead
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See user documentation.
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_GetSaveFileObjCmd(
+ ClientData clientData, /* Main window associated with interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
+{
+ int i, result;
+ Str255 initialFile;
+ Tk_Window parent;
+ AEDesc initialDesc = {typeNull, NULL};
+ AEDesc *initialPtr = NULL;
+ FSRef dirRef;
+ Str255 title, message;
+ OpenFileData ofd;
+ static CONST char *saveOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
+ "-message", "-parent", "-title", NULL
+ };
+ enum saveOptions {
+ SAVE_DEFAULT, SAVE_FILETYPES, SAVE_INITDIR, SAVE_INITFILE,
+ SAVE_MESSAGE, SAVE_PARENT, SAVE_TITLE
+ };
+
+ if (!fileDlgInited) {
+ InitFileDialogs();
+ }
+
+ result = TCL_ERROR;
+ parent = (Tk_Window) clientData;
+ StrLength(initialFile) = 0;
+ title[0] = 0;
+ message[0] = 0;
+
+ for (i = 1; i < objc; i += 2) {
+ char *choice;
+ int index, choiceLen;
+ char *string;
+ Tcl_DString ds;
+ int srcRead, dstWrote;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], saveOptionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetStringFromObj(objv[i], NULL);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ switch (index) {
+ case SAVE_DEFAULT:
+ break;
+ case SAVE_FILETYPES:
+ /* Currently unimplemented - what would we do here anyway? */
+ break;
+ case SAVE_INITDIR:
+ choice = Tcl_GetStringFromObj(objv[i + 1], NULL);
+ if (HandleInitialDirectory(interp, NULL, choice, &dirRef,
+ NULL, &initialDesc) != TCL_OK) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ break;
+ case SAVE_INITFILE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ if (Tcl_TranslateFileName(interp, choice, &ds) == NULL) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, Tcl_DStringValue(&ds),
+ Tcl_DStringLength(&ds), 0, NULL,
+ StrBody(initialFile), 255, &srcRead, &dstWrote, NULL);
+ StrLength(initialFile) = (unsigned char) dstWrote;
+ Tcl_DStringFree(&ds);
+ break;
+ case SAVE_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, choice, choiceLen,
+ 0, NULL, StrBody(message), 255,
+ &srcRead, &dstWrote, NULL);
+ StrLength(message) = (unsigned char) dstWrote;
+ break;
+ case SAVE_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, parent);
+ if (parent == NULL) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ break;
+ case SAVE_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, choice, choiceLen,
+ 0, NULL, StrBody(title), 255,
+ &srcRead, &dstWrote, NULL);
+ StrLength(title) = (unsigned char) dstWrote;
+ break;
+ }
+ }
+
+ TkInitFileFilters(&ofd.fl);
+ ofd.usePopup = 0;
+
+ if (initialDesc.descriptorType == typeFSRef) {
+ initialPtr = &initialDesc;
+ }
+ result = NavServicesGetFile(interp, &ofd, initialPtr, initialFile, NULL,
+ title, message, false, SAVE_FILE);
+
+ end:
+
+ AEDisposeDesc(&initialDesc);
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_ChooseDirectoryObjCmd --
+ *
+ * This procedure implements the "tk_chooseDirectory" dialog box
+ * for the Windows platform. See the user documentation for details
+ * on what it does.
+ *
+ * Results:
+ * See user documentation.
+ *
+ * Side effects:
+ * A modal dialog window is created. Tcl_SetServiceMode() is
+ * called to allow background events to be processed
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* Main window associated with interpreter. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ int i, result;
+ Tk_Window parent;
+ AEDesc initialDesc = {typeNull, NULL};
+ AEDesc *initialPtr = NULL;
+ FSRef dirRef;
+ Str255 message, title;
+ int srcRead, dstWrote;
+ OpenFileData ofd;
+ static CONST char *chooseOptionStrings[] = {
+ "-initialdir", "-message", "-mustexist", "-parent", "-title", NULL
+ };
+ enum chooseOptions {
+ CHOOSE_INITDIR, CHOOSE_MESSAGE, CHOOSE_MUSTEXIST,
+ CHOOSE_PARENT, CHOOSE_TITLE
+ };
+
+
+ if (!NavServicesAvailable()) {
+ return TCL_ERROR;
+ }
+
+ if (!fileDlgInited) {
+ InitFileDialogs();
+ }
+ result = TCL_ERROR;
+ parent = (Tk_Window) clientData;
+ title[0] = 0;
+ message[0] = 0;
+
+ for (i = 1; i < objc; i += 2) {
+ char *choice;
+ int index, choiceLen;
+ char *string;
+
+ if (Tcl_GetIndexFromObj(interp, objv[i], chooseOptionStrings, "option",
+ TCL_EXACT, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetStringFromObj(objv[i], NULL);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ switch (index) {
+ case CHOOSE_INITDIR:
+ choice = Tcl_GetStringFromObj(objv[i + 1], NULL);
+ if (HandleInitialDirectory(interp, NULL, choice, &dirRef,
+ NULL, &initialDesc) != TCL_OK) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ break;
+ case CHOOSE_MESSAGE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, choice, choiceLen,
+ 0, NULL, StrBody(message), 255,
+ &srcRead, &dstWrote, NULL);
+ StrLength(message) = (unsigned char) dstWrote;
+ break;
+ case CHOOSE_PARENT:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ parent = Tk_NameToWindow(interp, choice, parent);
+ if (parent == NULL) {
+ result = TCL_ERROR;
+ goto end;
+ }
+ break;
+ case CHOOSE_TITLE:
+ choice = Tcl_GetStringFromObj(objv[i + 1], &choiceLen);
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, choice, choiceLen,
+ 0, NULL, StrBody(title), 255,
+ &srcRead, &dstWrote, NULL);
+ StrLength(title) = (unsigned char) dstWrote;
+ break;
+ }
+ }
+
+ TkInitFileFilters(&ofd.fl);
+ ofd.usePopup = 0;
+
+
+ if (initialDesc.descriptorType == typeFSRef) {
+ initialPtr = &initialDesc;
+ }
+ result = NavServicesGetFile(interp, &ofd, initialPtr, NULL, NULL,
+ title, message, false, CHOOSE_FOLDER);
+
+ end:
+ AEDisposeDesc(&initialDesc);
+
+ return result;
+}
+
+int
+HandleInitialDirectory (
+ Tcl_Interp *interp,
+ char *initialFile,
+ char *initialDir,
+ FSRef *dirRef,
+ AEDescList *selectDescPtr,
+ AEDesc *dirDescPtr)
+{
+ Tcl_DString ds;
+ OSErr err;
+ Boolean isDirectory;
+ char *dirName = NULL;
+ int result = TCL_OK;
+
+ if (initialDir != NULL) {
+ dirName = Tcl_TranslateFileName(interp, initialDir, &ds);
+ if (dirName == NULL) {
+ return TCL_ERROR;
+ }
+
+ err = FSPathMakeRef(dirName,
+ dirRef, &isDirectory);
+
+ if (err != noErr) {
+ Tcl_AppendResult(interp, "bad directory \"",
+ initialDir, "\"", NULL);
+ result = TCL_ERROR;
+ goto end;
+ }
+ if (!isDirectory) {
+ Tcl_AppendResult(interp, "-intialdir \"",
+ initialDir, " is a file, not a directory.\"", NULL);
+ result = TCL_ERROR;
+ goto end;
+ }
+
+ AECreateDesc(typeFSRef, dirRef, sizeof(*dirRef), dirDescPtr);
+ }
+
+ if (initialFile != NULL && selectDescPtr != NULL) {
+ FSRef fileRef;
+ AEDesc fileDesc;
+ char *namePtr;
+
+ if (initialDir != NULL) {
+ Tcl_DStringAppend(&ds, "/", 1);
+ Tcl_DStringAppend(&ds, initialFile, -1);
+ namePtr = Tcl_DStringValue(&ds);
+ } else {
+ namePtr = initialFile;
+ }
+
+ AECreateList(NULL, 0, false, selectDescPtr);
+
+ err = FSPathMakeRef(namePtr, &fileRef, &isDirectory);
+ if (err != noErr) {
+ Tcl_AppendResult(interp, "bad initialfile \"", initialFile,
+ "\" file does not exist.", NULL);
+ return TCL_ERROR;
+ }
+ AECreateDesc(typeFSRef, &fileRef, sizeof(fileRef), &fileDesc);
+ AEPutDesc(selectDescPtr, 1, &fileDesc);
+ AEDisposeDesc(&fileDesc);
+ }
+
+end:
+ if (dirName != NULL) {
+ Tcl_DStringFree(&ds);
+ }
+ return result;
+}
+
+static void
+InitFileDialogs()
+{
+ fileDlgInited = 1;
+ openFileFilterUPP = NewNavObjectFilterUPP(OpenFileFilterProc);
+ openFileEventUPP = NewNavEventUPP(OpenEventProc);
+}
+
+static int
+NavServicesGetFile(
+ Tcl_Interp *interp,
+ OpenFileData *ofdPtr,
+ AEDesc *initialDescPtr,
+ unsigned char *initialFile,
+ AEDescList *selectDescPtr,
+ StringPtr title,
+ StringPtr message,
+ int multiple,
+ int isOpen)
+{
+ NavReplyRecord theReply;
+ NavDialogCreationOptions diagOptions;
+ NavDialogRef dialogRef = NULL;
+ CFStringRef * menuItemNames = NULL;
+ OSErr err;
+ Tcl_Obj *theResult = NULL;
+ int result;
+ TextEncoding encoding;
+
+ encoding = GetApplicationTextEncoding();
+ err = NavGetDefaultDialogCreationOptions(&diagOptions);
+ if (err!=noErr) {
+ return TCL_ERROR;
+ }
+ diagOptions.location.h = -1;
+ diagOptions.location.v = -1;
+ diagOptions.optionFlags = kNavDontAutoTranslate
+ + kNavDontAddTranslateItems;
+
+ if (multiple) {
+ diagOptions.optionFlags += kNavAllowMultipleFiles;
+ }
+
+ if (ofdPtr != NULL && ofdPtr->usePopup) {
+ FileFilter *filterPtr;
+
+ filterPtr = ofdPtr->fl.filters;
+ if (filterPtr == NULL) {
+ ofdPtr->usePopup = 0;
+ }
+ }
+
+ if (ofdPtr != NULL && ofdPtr->usePopup) {
+ FileFilter *filterPtr;
+ int index = 0;
+ ofdPtr->curType = 0;
+
+ menuItemNames = (CFStringRef *)ckalloc(ofdPtr->fl.numFilters
+ * sizeof(CFStringRef));
+
+ for (filterPtr = ofdPtr->fl.filters; filterPtr != NULL;
+ filterPtr = filterPtr->next, index++) {
+ menuItemNames[index] = CFStringCreateWithCString(NULL,
+ filterPtr->name, encoding);
+ }
+ diagOptions.popupExtension = CFArrayCreate(NULL,
+ (const void **)menuItemNames, ofdPtr->fl.numFilters, NULL);;
+ } else {
+ diagOptions.optionFlags += kNavNoTypePopup;
+ diagOptions.popupExtension = NULL;
+ }
+
+ /*
+ * This is required to allow App packages to be selectable in the
+ * file dialogs...
+ */
+
+ diagOptions.optionFlags += kNavSupportPackages;
+
+ diagOptions.clientName = CFStringCreateWithCString(NULL, "Wish", encoding);
+ if (message == NULL) {
+ diagOptions.message = NULL;
+ } else {
+ diagOptions.message = CFStringCreateWithPascalString(NULL, message, encoding);
+ }
+ if ((initialFile != NULL) && (initialFile[0] != 0)) {
+ diagOptions.saveFileName = CFStringCreateWithPascalString(NULL,
+ initialFile, encoding);
+ } else {
+ diagOptions.saveFileName = NULL;
+ }
+ if (title == NULL) {
+ diagOptions.windowTitle = NULL;
+ } else {
+ diagOptions.windowTitle = CFStringCreateWithPascalString(NULL, title, encoding);
+ }
+
+ diagOptions.actionButtonLabel = NULL;
+ diagOptions.cancelButtonLabel = NULL;
+ diagOptions.preferenceKey = 0;
+
+ /*
+ * Now process the selection list. We have to use the popupExtension
+ * to fill the menu.
+ */
+
+ if (isOpen == OPEN_FILE) {
+ err = NavCreateGetFileDialog(&diagOptions,
+ NULL,
+ openFileEventUPP,
+ NULL,
+ openFileFilterUPP,
+ ofdPtr,
+ &dialogRef);
+ if (err!=noErr){
+ fprintf(stderr,"NavCreateGetFileDialog failed, %d\n", err );
+ dialogRef = NULL;
+ }
+ } else if (isOpen == SAVE_FILE) {
+ err = NavCreatePutFileDialog(&diagOptions, 'TEXT', 'WIsH',
+ openFileEventUPP, NULL, &dialogRef);
+ if (err!=noErr){
+ fprintf(stderr,"NavCreatePutFileDialog failed, %d\n", err );
+ dialogRef = NULL;
+ }
+ } else if (isOpen == CHOOSE_FOLDER) {
+ err = NavCreateChooseFolderDialog(&diagOptions, openFileEventUPP,
+ openFileFilterUPP, NULL, &dialogRef);
+ if (err!=noErr){
+ fprintf(stderr,"NavCreateChooseFolderDialog failed, %d\n", err );
+ dialogRef = NULL;
+ }
+ }
+
+ if (dialogRef) {
+ if (initialDescPtr != NULL) {
+ NavCustomControl (dialogRef, kNavCtlSetLocation, initialDescPtr);
+ }
+ if ((selectDescPtr != NULL)
+ && (selectDescPtr->descriptorType != typeNull)) {
+ NavCustomControl(dialogRef, kNavCtlSetSelection, &selectDescPtr);
+ }
+
+ if ((err = NavDialogRun(dialogRef)) != noErr ){
+ fprintf(stderr,"NavDialogRun failed, %d\n", err );
+ } else {
+ if ((err = NavDialogGetReply(dialogRef, &theReply)) != noErr) {
+ fprintf(stderr,"NavGetReply failed, %d\n", err );
+ }
+ }
+ }
+
+ /*
+ * Most commands assume that the file dialogs return a single
+ * item, not a list. So only build a list if multiple is true...
+ */
+ if (err==noErr) {
+ if (multiple) {
+ theResult = Tcl_NewListObj(0, NULL);
+ } else {
+ theResult = Tcl_NewObj();
+ }
+ if (!theResult) {
+ err = memFullErr;
+ }
+ }
+ if (theReply.validRecord && err==noErr) {
+ AEDesc resultDesc;
+ long count;
+ Tcl_DString fileName;
+ FSRef fsRef;
+ char pathPtr[1024];
+ int pathValid = 0;
+ err = AECountItems(&theReply.selection, &count);
+ if (err == noErr) {
+ long i;
+ for (i = 1; i <= count; i++ ) {
+ err = AEGetNthDesc(&theReply.selection,
+ i, typeFSRef, NULL, &resultDesc);
+ pathValid = 0;
+ if (err == noErr) {
+ if ((err = AEGetDescData(&resultDesc, &fsRef, sizeof(fsRef)))
+ != noErr ) {
+ fprintf(stderr,"AEGetDescData failed %d\n", err );
+ } else {
+ if (err = FSRefMakePath(&fsRef, pathPtr, 1024) ) {
+ fprintf(stderr,"FSRefMakePath failed, %d\n", err );
+ } else {
+ if (isOpen == SAVE_FILE) {
+ CFStringRef saveNameRef;
+ char saveName [1024];
+ if (saveNameRef = NavDialogGetSaveFileName(dialogRef)) {
+ if (CFStringGetCString(saveNameRef, saveName,
+ 1024, encoding)) {
+ strcat(pathPtr, "/");
+ strcat(pathPtr, saveName);
+ pathValid = 1;
+ } else {
+ fprintf(stderr, "CFStringGetCString failed\n");
+ }
+ } else {
+ fprintf(stderr, "NavDialogGetSaveFileName failed\n");
+ }
+ } else {
+ pathValid = 1;
+ }
+ if (pathValid) {
+ /*
+ * Tested this and NULL=utf-8 encoding is
+ * good here
+ */
+ Tcl_ExternalToUtfDString(NULL, pathPtr, -1,
+ &fileName);
+ if (multiple) {
+ Tcl_ListObjAppendElement(interp, theResult,
+ Tcl_NewStringObj(Tcl_DStringValue(&fileName),
+ Tcl_DStringLength(&fileName)));
+ } else {
+ Tcl_SetStringObj(theResult, Tcl_DStringValue(&fileName),
+ Tcl_DStringLength(&fileName));
+ }
+ Tcl_DStringFree(&fileName);
+ }
+ }
+ }
+ AEDisposeDesc(&resultDesc);
+ }
+ }
+ }
+ err = NavDisposeReply(&theReply);
+ Tcl_SetObjResult(interp, theResult);
+ result = TCL_OK;
+ } else if (err == userCanceledErr) {
+ result = TCL_OK;
+ } else {
+ result = TCL_ERROR;
+ }
+
+ /*
+ * Clean up any allocated strings
+ * dispose of things in reverse order of creation
+ */
+
+ if (diagOptions.windowTitle) {
+ CFRelease(diagOptions.windowTitle);
+ }
+ if (diagOptions.saveFileName) {
+ CFRelease(diagOptions.saveFileName);
+ }
+ if (diagOptions.message) {
+ CFRelease(diagOptions.message);
+ }
+ if (diagOptions.clientName) {
+ CFRelease(diagOptions.clientName);
+ }
+ /*
+ * dispose of the CFArray diagOptions.popupExtension
+ */
+
+ if (menuItemNames) {
+ int i;
+ for (i=0;i < ofdPtr->fl.numFilters;i++) {
+ CFRelease(menuItemNames[i]);
+ }
+ ckfree((void *)menuItemNames);
+ }
+ if (diagOptions.popupExtension != NULL) {
+ CFRelease(diagOptions.popupExtension);
+ }
+
+ return result;
+}
+
+static pascal Boolean
+OpenFileFilterProc(
+ AEDesc* theItem, void* info,
+ NavCallBackUserData callBackUD,
+ NavFilterModes filterMode )
+{
+ OpenFileData *ofdPtr = (OpenFileData *) callBackUD;
+ if (!ofdPtr || !ofdPtr->usePopup) {
+ return true;
+ } else {
+ if (ofdPtr->fl.numFilters == 0) {
+ return true;
+ } else {
+
+ if ( theItem->descriptorType == typeFSS ) {
+ NavFileOrFolderInfo* theInfo = (NavFileOrFolderInfo*)info;
+ int result;
+
+ if ( !theInfo->isFolder ) {
+ OSType fileType;
+ StringPtr fileNamePtr;
+ int i;
+ FileFilter *filterPtr;
+
+ fileType = theInfo->fileAndFolder.fileInfo.finderInfo.fdType;
+ HLock((Handle)theItem->dataHandle);
+ fileNamePtr = (((FSSpec *) *theItem->dataHandle)->name);
+
+ if (ofdPtr->usePopup) {
+ i = ofdPtr->curType;
+ for (filterPtr = ofdPtr->fl.filters; filterPtr && i > 0; i--) {
+ filterPtr = filterPtr->next;
+ }
+ if (filterPtr) {
+ result = MatchOneType(fileNamePtr, fileType,
+ ofdPtr, filterPtr);
+ } else {
+ result = false;
+ }
+ } else {
+ /*
+ * We are not using the popup menu. In this case, the file is
+ * considered matched if it matches any of the file filters.
+ */
+ result = UNMATCHED;
+ for (filterPtr = ofdPtr->fl.filters; filterPtr;
+ filterPtr = filterPtr->next) {
+ if (MatchOneType(fileNamePtr, fileType,
+ ofdPtr, filterPtr) == MATCHED) {
+ result = MATCHED;
+ break;
+ }
+ }
+ }
+
+ HUnlock((Handle)theItem->dataHandle);
+ return (result == MATCHED);
+ } else {
+ return true;
+ }
+ }
+ }
+
+ return true;
+ }
+}
+
+pascal void
+OpenEventProc(
+ NavEventCallbackMessage callBackSelector,
+ NavCBRecPtr callBackParams,
+ NavCallBackUserData callBackUD )
+{
+ NavMenuItemSpec *chosenItem;
+ OpenFileData *ofd = (OpenFileData *) callBackUD;
+ static SInt32 otherEvent = ~(kNavCBCustomize|kNavCBStart|kNavCBTerminate
+ |kNavCBNewLocation|kNavCBShowDesktop|kNavCBSelectEntry|kNavCBAccept
+ |kNavCBCancel|kNavCBAdjustPreview);
+
+ if (callBackSelector == kNavCBPopupMenuSelect) {
+ chosenItem = (NavMenuItemSpec *) callBackParams->eventData.eventDataParms.param;
+ ofd->curType = chosenItem->menuType;
+ } else if (callBackSelector == kNavCBAdjustRect
+ || callBackSelector & otherEvent != 0) {
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS
+ | TCL_DONT_WAIT
+ | TCL_WINDOW_EVENTS)) {
+ /* Empty Body */
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MatchOneType --
+ *
+ * Match a file with one file type in the list of file types.
+ *
+ * Results:
+ * Returns MATCHED if the file matches with the file type; returns
+ * UNMATCHED otherwise.
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static Boolean
+MatchOneType(
+ StringPtr fileNamePtr, /* Name of the file */
+ OSType fileType, /* Type of the file */
+ OpenFileData * ofdPtr, /* Information about this file dialog */
+ FileFilter * filterPtr) /* Match the file described by pb against
+ * this filter */
+{
+ FileFilterClause * clausePtr;
+
+ /*
+ * A file matches with a file type if it matches with at least one
+ * clause of the type.
+ *
+ * If the clause has both glob patterns and ostypes, the file must
+ * match with at least one pattern AND at least one ostype.
+ *
+ * If the clause has glob patterns only, the file must match with at least
+ * one pattern.
+ *
+ * If the clause has mac types only, the file must match with at least
+ * one mac type.
+ *
+ * If the clause has neither glob patterns nor mac types, it's
+ * considered an error.
+ */
+
+ for (clausePtr=filterPtr->clauses; clausePtr; clausePtr=clausePtr->next) {
+ int macMatched = 0;
+ int globMatched = 0;
+ GlobPattern * globPtr;
+ MacFileType * mfPtr;
+
+ if (clausePtr->patterns == NULL) {
+ globMatched = 1;
+ }
+ if (clausePtr->macTypes == NULL) {
+ macMatched = 1;
+ }
+
+ for (globPtr=clausePtr->patterns; globPtr; globPtr=globPtr->next) {
+ char filename[256];
+ int len;
+ char * p, *q, *ext;
+
+ if (fileNamePtr == NULL) {
+ continue;
+ }
+ p = (char*)(fileNamePtr);
+ len = p[0];
+ strncpy(filename, p+1, len);
+ filename[len] = '\0';
+ ext = globPtr->pattern;
+
+ if (ext[0] == '\0') {
+ /*
+ * We don't want any extensions: OK if the filename doesn't
+ * have "." in it
+ */
+ for (q=filename; *q; q++) {
+ if (*q == '.') {
+ goto glob_unmatched;
+ }
+ }
+ goto glob_matched;
+ }
+
+ if (Tcl_StringMatch(filename, ext)) {
+ goto glob_matched;
+ } else {
+ goto glob_unmatched;
+ }
+
+ glob_unmatched:
+ continue;
+
+ glob_matched:
+ globMatched = 1;
+ break;
+ }
+
+ for (mfPtr=clausePtr->macTypes; mfPtr; mfPtr=mfPtr->next) {
+ if (fileType == mfPtr->type) {
+ macMatched = 1;
+ break;
+ }
+ }
+
+ if (globMatched && macMatched) {
+ return MATCHED;
+ }
+ }
+
+ return UNMATCHED;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkAboutDlg --
+ *
+ * Displays the default Tk About box. This code uses Macintosh
+ * resources to define the content of the About Box.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkAboutDlg()
+{
+ DialogPtr aboutDlog;
+ WindowRef windowRef;
+ short itemHit = -9;
+
+ aboutDlog = GetNewDialog(128, NULL, (void *) (-1));
+
+ if (!aboutDlog) {
+ return;
+ }
+
+ windowRef=GetDialogWindow(aboutDlog);
+ SelectWindow(windowRef);
+
+ while (itemHit != 1) {
+ ModalDialog( NULL, &itemHit);
+ }
+ DisposeDialog(aboutDlog);
+ aboutDlog = NULL;
+
+ SelectWindow(FrontNonFloatingWindow());
+
+ return;
+}
diff --git a/tk/macosx/tkMacOSXDraw.c b/tk/macosx/tkMacOSXDraw.c
new file mode 100644
index 00000000000..41f90e35036
--- /dev/null
+++ b/tk/macosx/tkMacOSXDraw.c
@@ -0,0 +1,1714 @@
+/*
+ * tkMacOSXDraw.c --
+ *
+ * This file contains functions that perform drawing to
+ * Xlib windows. Most of the functions simple emulate
+ * Xlib functions.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include "X11/X.h"
+#include "X11/Xlib.h"
+#include <stdio.h>
+
+#include <Carbon/Carbon.h>
+#include "tkMacOSXInt.h"
+#include "tkPort.h"
+#include "tkMacOSXDebug.h"
+
+#ifndef PI
+# define PI 3.14159265358979323846
+#endif
+#define RGBFLOATRED( c ) (float)((float)(c.red) / 65535.0)
+#define RGBFLOATGREEN( c ) (float)((float)(c.green) / 65535.0)
+#define RGBFLOATBLUE( c ) (float)((float)(c.blue) / 65535.0)
+
+/*
+ * Temporary regions that can be reused.
+ */
+
+static RgnHandle tmpRgn = NULL;
+static RgnHandle tmpRgn2 = NULL;
+
+static PixPatHandle gPenPat = NULL;
+
+static int useCGDrawing = 0;
+
+/*
+ * Prototypes for functions used only in this file.
+ */
+static unsigned char InvertByte _ANSI_ARGS_((unsigned char data));
+
+void TkMacOSXSetUpCGContext(MacDrawable *macWin,
+ CGrafPtr destPort, GC gc, CGContextRef *contextPtr);
+void TkMacOSXReleaseCGContext(MacDrawable *macWin, CGrafPtr destPort,
+ CGContextRef *context);
+/*
+ *----------------------------------------------------------------------
+ *
+ * XCopyArea --
+ *
+ * Copies data from one drawable to another using block transfer
+ * routines.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Data is moved from a window or bitmap to a second window or
+ * bitmap.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XCopyArea(
+ Display* display, /* Display. */
+ Drawable src, /* Source drawable. */
+ Drawable dst, /* Destination drawable. */
+ GC gc, /* GC to use. */
+ int src_x, /* X & Y, width & height */
+ int src_y, /* define the source rectangle */
+ unsigned int width, /* the will be copied. */
+ unsigned int height,
+ int dest_x, /* Dest X & Y on dest rect. */
+ int dest_y)
+{
+ Rect srcRect, dstRect;
+ Rect * srcPtr, * dstPtr;
+ const BitMap * srcBit;
+ const BitMap * dstBit;
+ MacDrawable *srcDraw = (MacDrawable *) src;
+ MacDrawable *dstDraw = (MacDrawable *) dst;
+ CGrafPtr srcPort, dstPort;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ short tmode;
+ RGBColor origForeColor, origBackColor, whiteColor, blackColor;
+ Rect clpRect;
+
+ dstPort = TkMacOSXGetDrawablePort(dst);
+ srcPort = TkMacOSXGetDrawablePort(src);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(dstPort, NULL);
+ GetForeColor(&origForeColor);
+ GetBackColor(&origBackColor);
+ whiteColor.red = 0;
+ whiteColor.blue = 0;
+ whiteColor.green = 0;
+ RGBForeColor(&whiteColor);
+ blackColor.red = 0xFFFF;
+ blackColor.blue = 0xFFFF;
+ blackColor.green = 0xFFFF;
+ RGBBackColor(&blackColor);
+
+ if (tmpRgn2 == NULL) {
+ tmpRgn2 = NewRgn();
+ }
+ srcPtr = &srcRect;
+ SetRect(&srcRect, (short) (srcDraw->xOff + src_x),
+ (short) (srcDraw->yOff + src_y),
+ (short) (srcDraw->xOff + src_x + width ),
+ (short) (srcDraw->yOff + src_y + height));
+ if (tkPictureIsOpen ) {
+ dstPtr = &srcRect;
+ } else {
+ dstPtr = &dstRect;
+ SetRect(&dstRect, (short) (dstDraw->xOff + dest_x),
+ (short) (dstDraw->yOff + dest_y),
+ (short) (dstDraw->xOff + dest_x + width ),
+ (short) (dstDraw->yOff + dest_y + height));
+ }
+ TkMacOSXSetUpClippingRgn(dst);
+ /*
+ * We will change the clip rgn in this routine, so we need to
+ * be able to restore it when we exit.
+ */
+
+ GetClip(tmpRgn2);
+ if (tkPictureIsOpen) {
+ /*
+ * When rendering into a picture, after a call to "OpenCPicture"
+ * the clipping is seriously WRONG and also INCONSISTENT with the
+ * clipping for single plane bitmaps.
+ * To circumvent this problem, we clip to the whole window
+ * In this case, would have also clipped to the srcRect
+ * ClipRect(&srcRect);
+ */
+ GetPortBounds(dstPort,&clpRect);
+ dstPtr = &srcRect;
+ ClipRect(&clpRect);
+ }
+ if (!gc->clip_mask ) {
+ } else if (((TkpClipMask*)gc->clip_mask)->type == TKP_CLIP_REGION) {
+ RgnHandle clipRgn = (RgnHandle)
+ ((TkpClipMask*)gc->clip_mask)->value.region;
+
+ int xOffset, yOffset;
+ if (tmpRgn == NULL) {
+ tmpRgn = NewRgn();
+ }
+ if (!tkPictureIsOpen) {
+ xOffset = dstDraw->xOff + gc->clip_x_origin;
+ yOffset = dstDraw->yOff + gc->clip_y_origin;
+ OffsetRgn(clipRgn, xOffset, yOffset);
+ }
+ GetClip(tmpRgn);
+ SectRgn(tmpRgn, clipRgn, tmpRgn);
+ SetClip(tmpRgn);
+ if (!tkPictureIsOpen) {
+ OffsetRgn(clipRgn, -xOffset, -yOffset);
+ }
+ }
+ srcBit = GetPortBitMapForCopyBits( srcPort );
+ dstBit = GetPortBitMapForCopyBits( dstPort );
+ tmode = srcCopy;
+
+ CopyBits(srcBit, dstBit, srcPtr, dstPtr, tmode, NULL);
+ RGBForeColor(&origForeColor);
+ RGBBackColor(&origBackColor);
+ SetClip(tmpRgn2);
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XCopyPlane --
+ *
+ * Copies a bitmap from a source drawable to a destination
+ * drawable. The plane argument specifies which bit plane of
+ * the source contains the bitmap. Note that this implementation
+ * ignores the gc->function.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the destination drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XCopyPlane(
+ Display* display, /* Display. */
+ Drawable src, /* Source drawable. */
+ Drawable dst, /* Destination drawable. */
+ GC gc, /* The GC to use. */
+ int src_x, /* X, Y, width & height */
+ int src_y, /* define the source rect. */
+ unsigned int width,
+ unsigned int height,
+ int dest_x, /* X & Y on dest where we will copy. */
+ int dest_y,
+ unsigned long plane) /* Which plane to copy. */
+{
+ Rect srcRect, dstRect;
+ Rect * srcPtr, * dstPtr;
+ const BitMap * srcBit;
+ const BitMap * dstBit;
+ const BitMap * mskBit;
+ MacDrawable *srcDraw = (MacDrawable *) src;
+ MacDrawable *dstDraw = (MacDrawable *) dst;
+ GWorldPtr srcPort, dstPort, mskPort;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ RGBColor macColor;
+ TkpClipMask *clipPtr = (TkpClipMask*)gc->clip_mask;
+ short tmode;
+
+ srcPort = TkMacOSXGetDrawablePort(src);
+ dstPort = TkMacOSXGetDrawablePort(dst);
+
+ if (tmpRgn == NULL) {
+ tmpRgn = NewRgn();
+ }
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(dstPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(dst);
+
+
+ srcBit = GetPortBitMapForCopyBits ( srcPort );
+ dstBit = GetPortBitMapForCopyBits ( dstPort );
+ SetRect(&srcRect, (short) (srcDraw->xOff + src_x),
+ (short) (srcDraw->yOff + src_y),
+ (short) (srcDraw->xOff + src_x + width),
+ (short) (srcDraw->yOff + src_y + height));
+ srcPtr = &srcRect;
+ if (tkPictureIsOpen) {
+ /*
+ * When rendering into a picture, after a call to "OpenCPicture"
+ * the clipping is seriously WRONG and also INCONSISTENT with the
+ * clipping for color bitmaps.
+ * To circumvent this problem, we clip to the whole window
+ */
+ Rect clpRect;
+ GetPortBounds(dstPort,&clpRect);
+ ClipRect(&clpRect);
+ dstPtr = &srcRect;
+ } else {
+ dstPtr = &dstRect;
+ SetRect(&dstRect, (short) (dstDraw->xOff + dest_x),
+ (short) (dstDraw->yOff + dest_y),
+ (short) (dstDraw->xOff + dest_x + width),
+ (short) (dstDraw->yOff + dest_y + height));
+ }
+ tmode = srcOr;
+ tmode = srcCopy + transparent;
+
+ if (TkSetMacColor(gc->foreground, &macColor) == true) {
+ RGBForeColor(&macColor);
+ }
+
+ if (clipPtr == NULL || clipPtr->type == TKP_CLIP_REGION) {
+
+ /*
+ * Case 1: opaque bitmaps.
+ */
+ TkSetMacColor(gc->background, &macColor);
+ RGBBackColor(&macColor);
+ tmode = srcCopy;
+ CopyBits(srcBit, dstBit, srcPtr, dstPtr, tmode, NULL);
+ } else if (clipPtr->type == TKP_CLIP_PIXMAP) {
+ if (clipPtr->value.pixmap == src) {
+ PixMapHandle pm;
+ /*
+ * Case 2: transparent bitmaps. If it's color we ignore
+ * the forecolor.
+ */
+ pm=GetPortPixMap(srcPort);
+ if (GetPixDepth(pm)== 1) {
+ tmode = srcOr;
+ } else {
+ tmode = transparent;
+ }
+ CopyBits(srcBit, dstBit, srcPtr, dstPtr, tmode, NULL);
+ } else {
+ /*
+ * Case 3: two arbitrary bitmaps.
+ */
+ tmode = srcCopy;
+ mskPort = TkMacOSXGetDrawablePort(clipPtr->value.pixmap);
+ mskBit = GetPortBitMapForCopyBits ( mskPort );
+ CopyDeepMask(srcBit, mskBit, dstBit,
+ srcPtr, srcPtr, dstPtr, tmode, NULL);
+ }
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkPutImage --
+ *
+ * Copies a subimage from an in-memory image to a rectangle of
+ * of the specified drawable.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws the image on the specified drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkPutImage(
+ unsigned long *colors, /* Unused on Macintosh. */
+ int ncolors, /* Unused on Macintosh. */
+ Display* display, /* Display. */
+ Drawable d, /* Drawable to place image on. */
+ GC gc, /* GC to use. */
+ XImage* image, /* Image to place. */
+ int src_x, /* Source X & Y. */
+ int src_y,
+ int dest_x, /* Destination X & Y. */
+ int dest_y,
+ unsigned int width, /* Same width & height for both */
+ unsigned int height) /* distination and source. */
+{
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ const BitMap * destBits;
+ int i, j;
+ BitMap bitmap;
+ char *newData = NULL;
+ Rect destRect, srcRect;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+ SetRect(&destRect, dest_x, dest_y, dest_x + width, dest_y + height);
+ SetRect(&srcRect, src_x, src_y, src_x + width, src_y + height);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ if (image->depth == 1) {
+
+ /*
+ * This code assumes a pixel depth of 1
+ */
+
+ bitmap.bounds.top = bitmap.bounds.left = 0;
+ bitmap.bounds.right = (short) image->width;
+ bitmap.bounds.bottom = (short) image->height;
+ if ((image->bytes_per_line % 2) == 1) {
+ char *newPtr, *oldPtr;
+ newData = (char *) ckalloc(image->height *
+ (image->bytes_per_line + 1));
+ newPtr = newData;
+ oldPtr = image->data;
+ for (i = 0; i < image->height; i++) {
+ for (j = 0; j < image->bytes_per_line; j++) {
+ *newPtr = InvertByte((unsigned char) *oldPtr);
+ newPtr++, oldPtr++;
+ }
+ *newPtr = 0;
+ newPtr++;
+ }
+ bitmap.baseAddr = newData;
+ bitmap.rowBytes = image->bytes_per_line + 1;
+ } else {
+ newData = (char *) ckalloc(image->height * image->bytes_per_line);
+ for (i = 0; i < image->height * image->bytes_per_line; i++) {
+ newData[i] = InvertByte((unsigned char) image->data[i]);
+ }
+ bitmap.baseAddr = newData;
+ bitmap.rowBytes = image->bytes_per_line;
+ }
+ destBits = GetPortBitMapForCopyBits ( destPort );
+ CopyBits(&bitmap, destBits,
+ &srcRect, &destRect, srcCopy, NULL);
+
+ } else {
+ /* Color image */
+ PixMap pixmap;
+
+ pixmap.bounds.left = 0;
+ pixmap.bounds.top = 0;
+ pixmap.bounds.right = (short) image->width;
+ pixmap.bounds.bottom = (short) image->height;
+ pixmap.pixelType = RGBDirect;
+ pixmap.pmVersion = 4; /* 32bit clean */
+ pixmap.packType = 0;
+ pixmap.packSize = 0;
+ pixmap.hRes = 0x00480000;
+ pixmap.vRes = 0x00480000;
+ pixmap.pixelSize = 32;
+ pixmap.cmpCount = 3;
+ pixmap.cmpSize = 8;
+ pixmap.pixelFormat = 0;
+ pixmap.pmTable = NULL;
+ pixmap.pmExt = 0;
+ pixmap.baseAddr = image->data;
+ pixmap.rowBytes = image->bytes_per_line | 0x8000;
+
+ CopyBits((BitMap *) &pixmap, GetPortBitMapForCopyBits ( destPort ),
+ &srcRect, &destRect, srcCopy, NULL);
+ }
+
+ if (newData != NULL) {
+ ckfree(newData);
+ }
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XFillRectangles --
+ *
+ * Fill multiple rectangular areas in the given drawable.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws onto the specified drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+XFillRectangles(
+ Display* display, /* Display. */
+ Drawable d, /* Draw on this. */
+ GC gc, /* Use this GC. */
+ XRectangle *rectangles, /* Rectangle array. */
+ int n_rectangels) /* Number of rectangles. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ Rect theRect;
+ int i;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ for (i=0; i<n_rectangels; i++) {
+ theRect.left = (short) (macWin->xOff + rectangles[i].x);
+ theRect.top = (short) (macWin->yOff + rectangles[i].y);
+ theRect.right = (short) (theRect.left + rectangles[i].width);
+ theRect.bottom = (short) (theRect.top + rectangles[i].height);
+ FillCRect(&theRect, gPenPat);
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDrawLines --
+ *
+ * Draw connected lines.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Renders a series of connected lines.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XDrawLines(
+ Display* display, /* Display. */
+ Drawable d, /* Draw on this. */
+ GC gc, /* Use this GC. */
+ XPoint* points, /* Array of points. */
+ int npoints, /* Number of points. */
+ int mode) /* Line drawing mode. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ CGrafPtr saveWorld;
+ GWorldPtr destPort;
+ GDHandle saveDevice;
+ int i;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ if (npoints < 2) {
+ return; /* TODO: generate BadValue error. */
+ }
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ if (useCGDrawing) {
+ CGContextRef outContext;
+
+ TkMacOSXSetUpCGContext(macWin, destPort, gc, &outContext);
+
+ CGContextBeginPath(outContext);
+ CGContextMoveToPoint(outContext, (float) points[0].x,
+ (float) points[0].y);
+ if (mode == CoordModeOrigin) {
+ for (i = 1; i < npoints; i++) {
+ CGContextAddLineToPoint(outContext,
+ (float) points[i].x,
+ (float) points[i].y);
+ }
+ }
+
+ CGContextStrokePath(outContext);
+ TkMacOSXReleaseCGContext(macWin, destPort, &outContext);
+ } else {
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ ShowPen();
+
+ PenPixPat(gPenPat);
+ MoveTo((short) (macWin->xOff + points[0].x),
+ (short) (macWin->yOff + points[0].y));
+ for (i = 1; i < npoints; i++) {
+ if (mode == CoordModeOrigin) {
+ LineTo((short) (macWin->xOff + points[i].x),
+ (short) (macWin->yOff + points[i].y));
+ } else {
+ Line((short) (macWin->xOff + points[i].x),
+ (short) (macWin->yOff + points[i].y));
+ }
+ }
+ HidePen();
+
+ }
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDrawSegments --
+ *
+ * Draw unconnected lines.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Renders a series of connected lines.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void XDrawSegments(
+ Display *display,
+ Drawable d,
+ GC gc,
+ XSegment *segments,
+ int nsegments)
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ CGrafPtr saveWorld;
+ GWorldPtr destPort;
+ GDHandle saveDevice;
+ int i;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ if (useCGDrawing) {
+ CGContextRef outContext;
+
+ TkMacOSXSetUpCGContext(macWin, destPort, gc, &outContext);
+
+ CGContextBeginPath(outContext);
+ for (i = 0; i < nsegments; i++) {
+ CGContextMoveToPoint(outContext,
+ (float) segments[i].x1,
+ (float) segments[i].y1);
+ CGContextAddLineToPoint (outContext,
+ (float) segments[i].x2,
+ (float) segments[i].y2);
+ }
+ CGContextStrokePath(outContext);
+ TkMacOSXReleaseCGContext(macWin, destPort, &outContext);
+ } else {
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ ShowPen();
+
+ PenPixPat(gPenPat);
+ for (i = 0; i < nsegments; i++) {
+ MoveTo((short) (macWin->xOff + segments[i].x1),
+ (short) (macWin->yOff + segments[i].y1));
+ LineTo((short) (macWin->xOff + segments[i].x2),
+ (short) (macWin->yOff + segments[i].y2));
+ }
+ HidePen();
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XFillPolygon --
+ *
+ * Draws a filled polygon.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws a filled polygon on the specified drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XFillPolygon(
+ Display* display, /* Display. */
+ Drawable d, /* Draw on this. */
+ GC gc, /* Use this GC. */
+ XPoint* points, /* Array of points. */
+ int npoints, /* Number of points. */
+ int shape, /* Shape to draw. */
+ int mode) /* Drawing mode. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ PolyHandle polygon;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ int i;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ if (useCGDrawing) {
+ CGContextRef outContext;
+
+ TkMacOSXSetUpCGContext(macWin, destPort, gc, &outContext);
+
+ CGContextBeginPath(outContext);
+ CGContextMoveToPoint(outContext, (float) (points[0].x),
+ (float) (points[0].y));
+ for (i = 1; i < npoints; i++) {
+
+ if (mode == CoordModePrevious) {
+ CGContextAddLineToPoint(outContext, (float) points[i].x,
+ (float) points[i].y);
+ } else {
+ }
+ }
+ //CGContextStrokePath(outContext);
+ CGContextFillPath(outContext);
+ TkMacOSXReleaseCGContext(macWin, destPort, &outContext);
+ } else {
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ PenNormal();
+ polygon = OpenPoly();
+
+ MoveTo((short) (macWin->xOff + points[0].x),
+ (short) (macWin->yOff + points[0].y));
+ for (i = 1; i < npoints; i++) {
+ if (mode == CoordModePrevious) {
+ Line((short) (macWin->xOff + points[i].x),
+ (short) (macWin->yOff + points[i].y));
+ } else {
+ LineTo((short) (macWin->xOff + points[i].x),
+ (short) (macWin->yOff + points[i].y));
+ }
+ }
+
+ ClosePoly();
+
+ FillCPoly(polygon, gPenPat);
+
+ KillPoly(polygon);
+ }
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDrawRectangle --
+ *
+ * Draws a rectangle.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws a rectangle on the specified drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XDrawRectangle(
+ Display* display, /* Display. */
+ Drawable d, /* Draw on this. */
+ GC gc, /* Use this GC. */
+ int x, /* Upper left corner. */
+ int y,
+ unsigned int width, /* Width & height of rect. */
+ unsigned int height)
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ Rect theRect;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ theRect.left = (short) (macWin->xOff + x);
+ theRect.top = (short) (macWin->yOff + y);
+ theRect.right = (short) (theRect.left + width);
+ theRect.bottom = (short) (theRect.top + height);
+
+ ShowPen();
+ PenPixPat(gPenPat);
+ FrameRect(&theRect);
+ HidePen();
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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
+XDrawRectangles(
+ Display *display,
+ Drawable drawable,
+ GC gc,
+ XRectangle *rectArr,
+ int nRects)
+{
+ MacDrawable *macWin = (MacDrawable *) drawable;
+ Rect rect;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ XRectangle * rectPtr;
+ int i;
+
+ destPort = TkMacOSXGetDrawablePort(drawable);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(drawable);
+
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+
+ ShowPen();
+ PenPixPat(gPenPat);
+
+ for (i = 0, rectPtr = rectArr; i < nRects;i++, rectPtr++ ) {
+ rect.left = (short) (macWin->xOff + rectPtr->x);
+ rect.top = (short) (macWin->yOff + rectPtr->y);
+ rect.right = (short) (rect.left + rectPtr->width);
+ rect.bottom = (short) (rect.top + rectPtr->height);
+ FrameRect(&rect);
+ }
+ HidePen();
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDrawArc --
+ *
+ * Draw an arc.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws an arc on the specified drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XDrawArc(
+ Display* display, /* Display. */
+ Drawable d, /* Draw on this. */
+ GC gc, /* Use this GC. */
+ int x, /* Upper left of */
+ int y, /* bounding rect. */
+ unsigned int width, /* Width & height. */
+ unsigned int height,
+ int angle1, /* Staring angle of arc. */
+ int angle2) /* Ending angle of arc. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ Rect theRect;
+ short start, extent;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ float fX = (float) x,
+ fY = (float) y,
+ fWidth = (float) width,
+ fHeight = (float) height;
+
+ if (width == 0 || height == 0) {
+ return;
+ }
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ if (useCGDrawing) {
+ CGContextRef outContext;
+ CGAffineTransform transform;
+ int clockwise = angle1 ? 0 : 1;
+
+ TkMacOSXSetUpCGContext(macWin, destPort, gc, &outContext);
+
+ CGContextBeginPath(outContext);
+
+ /*
+ * If we are drawing an oval, we have to squash the coordinate
+ * system before drawing, since CGContextAddArcToPoint only draws
+ * circles.
+ */
+
+ CGContextSaveGState(outContext);
+ transform = CGAffineTransformMakeTranslation((float) (x + width/2),
+ (float) (y + height/2));
+ transform = CGAffineTransformScale(transform, 1.0, fHeight/fWidth);
+ CGContextConcatCTM(outContext, transform);
+
+ CGContextAddArc(outContext, 0.0, 0.0,
+ (float) width/2,
+ (float) angle1, (float) angle2, clockwise);
+
+ CGContextRestoreGState(outContext);
+
+ CGContextStrokePath(outContext);
+ TkMacOSXReleaseCGContext(macWin, destPort, &outContext);
+ } else {
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+
+ theRect.left = (short) (macWin->xOff + x);
+ theRect.top = (short) (macWin->yOff + y);
+ theRect.right = (short) (theRect.left + width);
+ theRect.bottom = (short) (theRect.top + height);
+ start = (short) (90 - (angle1 / 64));
+ extent = (short) (-(angle2 / 64));
+
+ ShowPen();
+ PenPixPat(gPenPat);
+ FrameArc(&theRect, start, extent);
+ HidePen();
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * 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
+XDrawArcs(
+ Display *display,
+ Drawable d,
+ GC gc,
+ XArc *arcArr,
+ int nArcs)
+{
+
+ MacDrawable *macWin = (MacDrawable *) d;
+ Rect rect;
+ short start, extent;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ XArc * arcPtr;
+ int i;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+
+ ShowPen();
+ PenPixPat(gPenPat);
+ for (i = 0, arcPtr = arcArr;i < nArcs;i++, arcPtr++ ) {
+ rect.left = (short) (macWin->xOff + arcPtr->x);
+ rect.top = (short) (macWin->yOff + arcPtr->y);
+ rect.right = (short) (rect.left + arcPtr->width);
+ rect.bottom = (short) (rect.top + arcPtr->height);
+ start = (short) (90 - (arcPtr->angle1 / 64));
+ extent = (short) (-(arcPtr->angle2 / 64));
+ FrameArc(&rect, start, extent);
+ }
+ HidePen();
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XFillArc --
+ *
+ * Draw a filled arc.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws a filled arc on the specified drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XFillArc(
+ Display* display, /* Display. */
+ Drawable d, /* Draw on this. */
+ GC gc, /* Use this GC. */
+ int x, /* Upper left of */
+ int y, /* bounding rect. */
+ unsigned int width, /* Width & height. */
+ unsigned int height,
+ int angle1, /* Staring angle of arc. */
+ int angle2) /* Ending angle of arc. */
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ Rect theRect;
+ short start, extent;
+ PolyHandle polygon;
+ double sin1, cos1, sin2, cos2, angle;
+ double boxWidth, boxHeight;
+ double vertex[2], center1[2], center2[2];
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ theRect.left = (short) (macWin->xOff + x);
+ theRect.top = (short) (macWin->yOff + y);
+ theRect.right = (short) (theRect.left + width);
+ theRect.bottom = (short) (theRect.top + height);
+ start = (short) (90 - (angle1 / 64));
+ extent = (short) (- (angle2 / 64));
+
+ if (gc->arc_mode == ArcChord) {
+ boxWidth = theRect.right - theRect.left;
+ boxHeight = theRect.bottom - theRect.top;
+ angle = -(angle1/64.0)*PI/180.0;
+ sin1 = sin(angle);
+ cos1 = cos(angle);
+ angle -= (angle2/64.0)*PI/180.0;
+ sin2 = sin(angle);
+ cos2 = cos(angle);
+ vertex[0] = (theRect.left + theRect.right)/2.0;
+ vertex[1] = (theRect.top + theRect.bottom)/2.0;
+ center1[0] = vertex[0] + cos1*boxWidth/2.0;
+ center1[1] = vertex[1] + sin1*boxHeight/2.0;
+ center2[0] = vertex[0] + cos2*boxWidth/2.0;
+ center2[1] = vertex[1] + sin2*boxHeight/2.0;
+
+ polygon = OpenPoly();
+ MoveTo((short) ((theRect.left + theRect.right)/2),
+ (short) ((theRect.top + theRect.bottom)/2));
+
+ LineTo((short) (center1[0] + 0.5), (short) (center1[1] + 0.5));
+ LineTo((short) (center2[0] + 0.5), (short) (center2[1] + 0.5));
+ ClosePoly();
+
+ ShowPen();
+ FillCArc(&theRect, start, extent, gPenPat);
+ FillCPoly(polygon, gPenPat);
+ HidePen();
+
+ KillPoly(polygon);
+ } else {
+ ShowPen();
+ FillCArc(&theRect, start, extent, gPenPat);
+ HidePen();
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XFillArcs --
+ *
+ * Draw a filled arc.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Draws a filled arc for each array element on the specified drawable.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+XFillArcs(
+ Display *display,
+ Drawable d,
+ GC gc,
+ XArc *arcArr,
+ int nArcs)
+{
+ MacDrawable *macWin = (MacDrawable *) d;
+ Rect rect;
+ short start, extent;
+ PolyHandle polygon;
+ double sin1, cos1, sin2, cos2, angle;
+ double boxWidth, boxHeight;
+ double vertex[2], center1[2], center2[2];
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ int i;
+ XArc * arcPtr;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+
+ display->request++;
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(d);
+
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ for (i = 0, arcPtr = arcArr;i<nArcs;i++, arcPtr++ ) {
+ rect.left = (short) (macWin->xOff + arcPtr->x);
+ rect.top = (short) (macWin->yOff + arcPtr->y);
+ rect.right = (short) (rect.left + arcPtr->width);
+ rect.bottom = (short) (rect.top + arcPtr->height);
+ start = (short) (90 - (arcPtr->angle1 / 64));
+ extent = (short) (- (arcPtr->angle2 / 64));
+
+ if (gc->arc_mode == ArcChord) {
+ boxWidth = rect.right - rect.left;
+ boxHeight = rect.bottom - rect.top;
+ angle = -(arcPtr->angle1/64.0)*PI/180.0;
+ sin1 = sin(angle);
+ cos1 = cos(angle);
+ angle -= (arcPtr->angle2/64.0)*PI/180.0;
+ sin2 = sin(angle);
+ cos2 = cos(angle);
+ vertex[0] = (rect.left + rect.right)/2.0;
+ vertex[1] = (rect.top + rect.bottom)/2.0;
+ center1[0] = vertex[0] + cos1*boxWidth/2.0;
+ center1[1] = vertex[1] + sin1*boxHeight/2.0;
+ center2[0] = vertex[0] + cos2*boxWidth/2.0;
+ center2[1] = vertex[1] + sin2*boxHeight/2.0;
+
+ polygon = OpenPoly();
+ MoveTo((short) ((rect.left + rect.right)/2),
+ (short) ((rect.top + rect.bottom)/2));
+
+ LineTo((short) (center1[0] + 0.5), (short) (center1[1] + 0.5));
+ LineTo((short) (center2[0] + 0.5), (short) (center2[1] + 0.5));
+ ClosePoly();
+
+ ShowPen();
+ FillCArc(&rect, start, extent, gPenPat);
+ FillCPoly(polygon, gPenPat);
+ HidePen();
+
+ KillPoly(polygon);
+ } else {
+ ShowPen();
+ FillCArc(&rect, start, extent, gPenPat);
+ HidePen();
+ }
+ }
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XMaxRequestSize --
+ *
+ *----------------------------------------------------------------------
+ */
+long
+XMaxRequestSize(Display *display)
+{
+ return (SHRT_MAX / 4);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkScrollWindow --
+ *
+ * Scroll a rectangle of the specified window and accumulate
+ * a damage region.
+ *
+ * Results:
+ * Returns 0 if the scroll genereated no additional damage.
+ * Otherwise, sets the region that needs to be repainted after
+ * scrolling and returns 1.
+ *
+ * Side effects:
+ * Scrolls the bits in the window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkScrollWindow(
+ Tk_Window tkwin, /* The window to be scrolled. */
+ GC gc, /* GC for window to be scrolled. */
+ int x, /* Position rectangle to be scrolled. */
+ int y,
+ int width,
+ int height,
+ int dx, /* Distance rectangle should be moved. */
+ int dy,
+ TkRegion damageRgn) /* Region to accumulate damage in. */
+{
+ MacDrawable *destDraw = (MacDrawable *) Tk_WindowId(tkwin);
+ RgnHandle rgn = (RgnHandle) damageRgn;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ Rect srcRect, scrollRect;
+ RgnHandle visRgn, clipRgn;
+
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
+
+ /*
+ * Due to the implementation below the behavior may be differnt
+ * than X in certain cases that should never occur in Tk. The
+ * scrollRect is the source rect extended by the offset (the union
+ * of the source rect and the offset rect). Everything
+ * in the extended scrollRect is scrolled. On X, it's possible
+ * to "skip" over an area if the offset makes the source and
+ * destination rects disjoint and non-aligned.
+ */
+
+ SetRect(&srcRect, (short) (destDraw->xOff + x),
+ (short) (destDraw->yOff + y),
+ (short) (destDraw->xOff + x + width),
+ (short) (destDraw->yOff + y + height));
+ scrollRect = srcRect;
+ if (dx < 0) {
+ scrollRect.left += dx;
+ } else {
+ scrollRect.right += dx;
+ }
+ if (dy < 0) {
+ scrollRect.top += dy;
+ } else {
+ scrollRect.bottom += dy;
+ }
+
+ /*
+ * Adjust clip region so that we don't copy any windows
+ * that may overlap us.
+ */
+ visRgn = NewRgn();
+ clipRgn = NewRgn();
+ RectRgn(rgn, &srcRect);
+ GetPortVisibleRegion(destPort,visRgn);
+ DiffRgn(rgn, visRgn, rgn);
+ OffsetRgn(rgn, dx, dy);
+ GetPortClipRegion(destPort, clipRgn);
+ DiffRgn(clipRgn, rgn, clipRgn);
+ SetPortClipRegion(destPort, clipRgn);
+ SetEmptyRgn(rgn);
+
+ /*
+ * When a menu is up, the Mac does not expect drawing to occur and
+ * does not clip out the menu. We have to do it ourselves. This
+ * is pretty gross.
+ */
+
+ if (tkUseMenuCascadeRgn == 1) {
+ Point scratch = {0, 0};
+ MacDrawable *macDraw = (MacDrawable *) Tk_WindowId(tkwin);
+
+ LocalToGlobal(&scratch);
+ CopyRgn(tkMenuCascadeRgn, rgn);
+ OffsetRgn(rgn, -scratch.h, -scratch.v);
+ DiffRgn(clipRgn, rgn, clipRgn);
+ SetPortClipRegion(destPort, clipRgn);
+ SetEmptyRgn(rgn);
+ macDraw->toplevel->flags |= TK_DRAWN_UNDER_MENU;
+ }
+
+ ScrollRect(&scrollRect, dx, dy, rgn);
+
+ SetGWorld(saveWorld, saveDevice);
+
+ DisposeRgn(clipRgn);
+ DisposeRgn(visRgn);
+ /*
+ * Fortunantly, the region returned by ScrollRect is symanticlly
+ * the same as what we need to return in this function. If the
+ * region is empty we return zero to denote that no damage was
+ * created.
+ */
+ if (EmptyRgn(rgn)) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetUpGraphicsPort --
+ *
+ * Set up the graphics port from the given GC.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The current port is adjusted.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetUpGraphicsPort(
+ GC gc,
+ GWorldPtr destPort) /* GC to apply to current port. */
+{
+ RGBColor macColor;
+
+ if (gPenPat == NULL) {
+ gPenPat = NewPixPat();
+ }
+
+ if (TkSetMacColor(gc->foreground, &macColor) == true) {
+ /* TODO: cache RGBPats for preformace - measure gains... */
+ MakeRGBPat(gPenPat, &macColor);
+ }
+
+ PenNormal();
+ if(gc->function == GXxor) {
+ PenMode(patXor);
+ }
+ if (gc->line_width > 1) {
+ PenSize(gc->line_width, gc->line_width);
+ }
+ if (gc->line_style != LineSolid) {
+ unsigned char *p = (unsigned char *) &(gc->dashes);
+ /*
+ * Here the dash pattern should be set in the drawing,
+ * environment, but I don't know how to do that for the Mac.
+ *
+ * p[] is an array of unsigned chars containing the dash list.
+ * A '\0' indicates the end of this list.
+ *
+ * Someone knows how to implement this? If you have a more
+ * complete implementation of SetUpGraphicsPort() for
+ * the Mac (or for Windows), please let me know.
+ *
+ * Jan Nijtmans
+ * CMG Arnhem, B.V.
+ * email: j.nijtmans@chello.nl (private)
+ * jan.nijtmans@cmg.nl (work)
+ * url: http://purl.oclc.org/net/nijtmans/
+ *
+ * FIXME:
+ * This is not possible with QuickDraw line drawing, we either
+ * have to convert all line drawings to regions, or, on Mac OS X
+ * we can use CG to draw our lines instead of QuickDraw.
+ */
+ }
+}
+ /*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetUpGraphicsPort --
+ *
+ * Set up the graphics port from the given GC.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The current port is adjusted.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetUpCGContext(
+ MacDrawable *macWin,
+ CGrafPtr destPort,
+ GC gc,
+ CGContextRef *contextPtr) /* GC to apply to current port. */
+{
+ RGBColor macColor;
+ CGContextRef outContext;
+ OSStatus err;
+ Rect boundsRect;
+ CGAffineTransform coordsTransform;
+
+ err = QDBeginCGContext(destPort, contextPtr);
+ outContext = *contextPtr;
+
+ CGContextSaveGState(outContext);
+
+ GetPortBounds(destPort, &boundsRect);
+
+ CGContextResetCTM(outContext);
+ coordsTransform = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0,
+ (float)(boundsRect.bottom - boundsRect.top));
+ CGContextConcatCTM(outContext, coordsTransform);
+
+ if (macWin->clipRgn != NULL) {
+ ClipCGContextToRegion(outContext, &boundsRect, macWin->clipRgn);
+ } else {
+ RgnHandle clipRgn = NewRgn();
+ GetPortClipRegion(destPort, clipRgn);
+ ClipCGContextToRegion(outContext, &boundsRect,
+ clipRgn);
+ DisposeRgn(clipRgn);
+ }
+
+ /* Now offset the CTM to the subwindow offset */
+
+ CGContextTranslateCTM(outContext, macWin->xOff, macWin->yOff);
+
+ if (TkSetMacColor(gc->foreground, &macColor) == true) {
+ CGContextSetRGBStrokeColor(outContext, RGBFLOATRED(macColor),
+ RGBFLOATGREEN(macColor),
+ RGBFLOATBLUE(macColor), 1.0);
+ }
+ if (TkSetMacColor(gc->background, &macColor) == true) {
+ CGContextSetRGBFillColor(outContext, RGBFLOATRED(macColor),
+ RGBFLOATGREEN(macColor),
+ RGBFLOATBLUE(macColor), 1.0);
+ }
+
+ if(gc->function == GXxor) {
+ }
+
+ CGContextSetLineWidth(outContext, (float) gc->line_width);
+
+ if (gc->line_style != LineSolid) {
+ unsigned char *p = (unsigned char *) &(gc->dashes);
+ /*
+ * Here the dash pattern should be set in the drawing,
+ * environment, but I don't know how to do that for the Mac.
+ *
+ * p[] is an array of unsigned chars containing the dash list.
+ * A '\0' indicates the end of this list.
+ *
+ * Someone knows how to implement this? If you have a more
+ * complete implementation of SetUpGraphicsPort() for
+ * the Mac (or for Windows), please let me know.
+ *
+ * Jan Nijtmans
+ * CMG Arnhem, B.V.
+ * email: j.nijtmans@chello.nl (private)
+ * jan.nijtmans@cmg.nl (work)
+ * url: http://purl.oclc.org/net/nijtmans/
+ *
+ * FIXME:
+ * This is not possible with QuickDraw line drawing, we either
+ * have to convert all line drawings to regions, or, on Mac OS X
+ * we can use CG to draw our lines instead of QuickDraw.
+ */
+ }
+}
+
+void
+TkMacOSXReleaseCGContext(
+ MacDrawable *macWin,
+ CGrafPtr destPort,
+ CGContextRef *outContext)
+{
+ CGContextResetCTM(*outContext);
+ CGContextRestoreGState(*outContext);
+ QDEndCGContext(destPort, outContext);
+
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetUpClippingRgn --
+ *
+ * Set up the clipping region so that drawing only occurs on the
+ * specified X subwindow.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The clipping region in the current port is changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetUpClippingRgn(
+ Drawable drawable) /* Drawable to update. */
+{
+ MacDrawable *macDraw = (MacDrawable *) drawable;
+
+ if (macDraw->winPtr != NULL) {
+ if (macDraw->flags & TK_CLIP_INVALID) {
+ TkMacOSXUpdateClipRgn(macDraw->winPtr);
+ }
+
+ /*
+ * When a menu is up, the Mac does not expect drawing to occur and
+ * does not clip out the menu. We have to do it ourselves. This
+ * is pretty gross.
+ */
+
+ if (macDraw->clipRgn != NULL) {
+ if (tkUseMenuCascadeRgn == 1) {
+ Point scratch = {0, 0};
+ GDHandle saveDevice;
+ GWorldPtr saveWorld;
+
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(TkMacOSXGetDrawablePort(drawable), NULL);
+ LocalToGlobal(&scratch);
+ SetGWorld(saveWorld, saveDevice);
+ if (tmpRgn == NULL) {
+ tmpRgn = NewRgn();
+ }
+ CopyRgn(tkMenuCascadeRgn, tmpRgn);
+ OffsetRgn(tmpRgn, -scratch.h, -scratch.v);
+ DiffRgn(macDraw->clipRgn, tmpRgn, tmpRgn);
+ SetClip(tmpRgn);
+ macDraw->toplevel->flags |= TK_DRAWN_UNDER_MENU;
+ } else {
+ SetClip(macDraw->clipRgn);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXMakeStippleMap --
+ *
+ * Given a drawable and a stipple pattern this function draws the
+ * pattern repeatedly over the drawable. The drawable can then
+ * be used as a mask for bit-bliting a stipple pattern over an
+ * object.
+ *
+ * Results:
+ * A BitMap data structure.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+BitMapPtr
+TkMacOSXMakeStippleMap(
+ Drawable drawable, /* Window to apply stipple. */
+ Drawable stipple) /* The stipple pattern. */
+{
+ GWorldPtr destPort;
+ BitMapPtr bitmapPtr;
+ Rect portRect;
+ int width, height, stippleHeight, stippleWidth;
+ int i, j;
+ char * data;
+ Rect bounds;
+
+ destPort = TkMacOSXGetDrawablePort(drawable);
+
+ GetPortBounds ( destPort, &portRect );
+ width = portRect.right - portRect.left;
+ height = portRect.bottom - portRect.top;
+
+ bitmapPtr = (BitMap *) ckalloc(sizeof(BitMap));
+ data = (char *) ckalloc(height * ((width / 8) + 1));
+ bitmapPtr->bounds.top = bitmapPtr->bounds.left = 0;
+ bitmapPtr->bounds.right = (short) width;
+ bitmapPtr->bounds.bottom = (short) height;
+ bitmapPtr->baseAddr = data;
+ bitmapPtr->rowBytes = (width / 8) + 1;
+
+ destPort = TkMacOSXGetDrawablePort(stipple);
+ stippleWidth = portRect.right - portRect.left;
+ stippleHeight = portRect.bottom - portRect.top;
+
+ for (i = 0; i < height; i += stippleHeight) {
+ for (j = 0; j < width; j += stippleWidth) {
+ bounds.left = j;
+ bounds.top = i;
+ bounds.right = j + stippleWidth;
+ bounds.bottom = i + stippleHeight;
+
+ CopyBits(GetPortBitMapForCopyBits ( destPort ), bitmapPtr,
+ &portRect, &bounds, srcCopy, NULL);
+ }
+ }
+ return bitmapPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InvertByte --
+ *
+ * This function reverses the bits in the passed in Byte of data.
+ *
+ * Results:
+ * The incoming byte in reverse bit order.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static unsigned char
+InvertByte(
+ unsigned char data) /* Byte of data. */
+{
+ unsigned char i;
+ unsigned char mask = 1, result = 0;
+
+ for (i = (1 << 7); i != 0; i /= 2) {
+ if (data & mask) {
+ result |= i;
+ }
+ mask = mask << 1;
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDrawpHighlightBorder --
+ *
+ * This procedure draws a rectangular ring around the outside of
+ * a widget to indicate that it has received the input focus.
+ *
+ * On the Macintosh, this puts a 1 pixel border in the bgGC color
+ * between the widget and the focus ring, except in the case where
+ * highlightWidth is 1, in which case the border is left out.
+ *
+ * For proper Mac L&F, use highlightWidth of 3.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A rectangle "width" pixels wide is drawn in "drawable",
+ * corresponding to the outer area of "tkwin".
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDrawHighlightBorder (
+ Tk_Window tkwin,
+ GC fgGC,
+ GC bgGC,
+ int highlightWidth,
+ Drawable drawable)
+{
+ if (highlightWidth == 1) {
+ TkDrawInsetFocusHighlight (tkwin, fgGC, highlightWidth, drawable, 0);
+ } else {
+ TkDrawInsetFocusHighlight (tkwin, bgGC, highlightWidth, drawable, 0);
+ if (fgGC != bgGC) {
+ TkDrawInsetFocusHighlight (tkwin, fgGC, highlightWidth - 1, drawable, 0);
+ }
+ }
+}
diff --git a/tk/macosx/tkMacOSXEmbed.c b/tk/macosx/tkMacOSXEmbed.c
new file mode 100644
index 00000000000..9ec4e3aae44
--- /dev/null
+++ b/tk/macosx/tkMacOSXEmbed.c
@@ -0,0 +1,1193 @@
+/*
+ * tkMacOSXEmbed.c --
+ *
+ * This file contains platform-specific procedures for theMac to provide
+ * basic operations needed for application embedding (where one
+ * application can use as its main window an internal window from
+ * some other application).
+ * Currently only Toplevel embedding within the same Tk application is
+ * allowed on the Macintosh.
+ *
+ * Copyright (c) 1996-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include "tkPort.h"
+#include "X11/X.h"
+#include "X11/Xlib.h"
+#include <stdio.h>
+
+#include <Carbon/Carbon.h>
+#include "tkMacOSXInt.h"
+
+/*
+ * One of the following structures exists for each container in this
+ * application. It keeps track of the container window and its
+ * associated embedded window.
+ */
+
+typedef struct Container {
+ Window parent; /* The Mac Drawable for the parent of
+ * the pair (the container). */
+ TkWindow *parentPtr; /* Tk's information about the container,
+ * or NULL if the container isn't
+ * in this process. */
+ Window embedded; /* The MacDrawable for the embedded
+ * window. Starts off as None, but
+ * gets filled in when the window is
+ * eventually created. */
+ TkWindow *embeddedPtr; /* Tk's information about the embedded
+ * window, or NULL if the
+ * embedded application isn't in
+ * this process. */
+ struct Container *nextPtr; /* Next in list of all containers in
+ * this process. */
+} Container;
+
+static Container *firstContainerPtr = NULL;
+ /* First in list of all containers
+ * managed by this process. */
+/*
+ * Globals defined in this file
+ */
+
+TkMacOSXEmbedHandler *gMacEmbedHandler = NULL;
+
+/*
+ * Prototypes for static procedures defined in this file:
+ */
+
+static void ContainerEventProc _ANSI_ARGS_((
+ ClientData clientData, XEvent *eventPtr));
+static void EmbeddedEventProc _ANSI_ARGS_((
+ ClientData clientData, XEvent *eventPtr));
+static void EmbedActivateProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static void EmbedFocusProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static void EmbedGeometryRequest _ANSI_ARGS_((
+ Container * containerPtr, int width, int height));
+static void EmbedSendConfigure _ANSI_ARGS_((
+ Container *containerPtr));
+static void EmbedStructureProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static void EmbedWindowDeleted _ANSI_ARGS_((TkWindow *winPtr));
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_MacOSXSetEmbedHandler --
+ *
+ * Registers a handler for an in process form of embedding, like
+ * Netscape plugins, where Tk is loaded into the process, but does
+ * not control the main window
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * The embed handler is set.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+Tk_MacOSXSetEmbedHandler(
+ Tk_MacOSXEmbedRegisterWinProc *registerWinProc,
+ Tk_MacOSXEmbedGetGrafPortProc *getPortProc,
+ Tk_MacOSXEmbedMakeContainerExistProc *containerExistProc,
+ Tk_MacOSXEmbedGetClipProc *getClipProc,
+ Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc)
+{
+ if (gMacEmbedHandler == NULL) {
+ gMacEmbedHandler = (TkMacOSXEmbedHandler *) ckalloc(sizeof(TkMacOSXEmbedHandler));
+ }
+ gMacEmbedHandler->registerWinProc = registerWinProc;
+ gMacEmbedHandler->getPortProc = getPortProc;
+ gMacEmbedHandler->containerExistProc = containerExistProc;
+ gMacEmbedHandler->getClipProc = getClipProc;
+ gMacEmbedHandler->getOffsetProc = getOffsetProc;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMakeWindow --
+ *
+ * Creates an X Window (Mac subwindow).
+ *
+ * Results:
+ * The window id is returned.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Window
+TkpMakeWindow(
+ TkWindow *winPtr,
+ Window parent)
+{
+ MacDrawable *macWin;
+ XEvent event;
+
+ /*
+ * If this window is marked as embedded then
+ * the window structure should have already been
+ * created in the TkpUseWindow function.
+ */
+
+ if (Tk_IsEmbedded(winPtr)) {
+ return (Window) winPtr->privatePtr;
+ }
+
+ /*
+ * Allocate sub window
+ */
+
+ macWin = (MacDrawable *) ckalloc(sizeof(MacDrawable));
+ if (macWin == NULL) {
+ winPtr->privatePtr = NULL;
+ return None;
+ }
+ macWin->winPtr = winPtr;
+ winPtr->privatePtr = macWin;
+ macWin->clipRgn = NewRgn();
+ macWin->aboveClipRgn = NewRgn();
+ macWin->referenceCount = 0;
+ macWin->flags = TK_CLIP_INVALID;
+
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+
+ /*
+ *This will be set when we are mapped.
+ */
+
+ macWin->grafPtr = NULL;
+ macWin->toplevel = macWin;
+ macWin->xOff = 0;
+ macWin->yOff = 0;
+ } else {
+ macWin->grafPtr = NULL;
+ macWin->xOff = winPtr->parentPtr->privatePtr->xOff +
+ winPtr->parentPtr->changes.border_width +
+ winPtr->changes.x;
+ macWin->yOff = winPtr->parentPtr->privatePtr->yOff +
+ winPtr->parentPtr->changes.border_width +
+ winPtr->changes.y;
+ macWin->toplevel = winPtr->parentPtr->privatePtr->toplevel;
+ }
+
+ macWin->toplevel->referenceCount++;
+
+ /*
+ * TODO: need general solution for visibility events.
+ */
+ event.xany.serial = Tk_Display(winPtr)->request;
+ event.xany.send_event = False;
+ event.xany.display = Tk_Display(winPtr);
+
+ event.xvisibility.type = VisibilityNotify;
+ event.xvisibility.window = (Window) macWin;
+ event.xvisibility.state = VisibilityUnobscured;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+ return (Window) macWin;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpUseWindow --
+ *
+ * This procedure causes a Tk window to use a given X window as
+ * its parent window, rather than the root window for the screen.
+ * It is invoked by an embedded application to specify the window
+ * in which it is embedded.
+ *
+ * Results:
+ * The return value is normally TCL_OK. If an error occurs (such
+ * as string not being a valid window spec), then the return value
+ * is TCL_ERROR and an error message is left in the interp's result if
+ * interp is non-NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpUseWindow(
+ Tcl_Interp *interp, /* If not NULL, used for error reporting
+ * if string is bogus. */
+ Tk_Window tkwin, /* Tk window that does not yet have an
+ * associated X window. */
+ CONST char *string) /* String identifying an X window to use
+ * for tkwin; must be an integer value. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ MacDrawable *parent, *macWin;
+ Container *containerPtr;
+ XEvent event;
+ int result;
+
+ if (winPtr->window != None) {
+ panic("TkpUseWindow: X window already assigned");
+ }
+
+ /*
+ * Decode the container pointer, and look for it among the
+ *list of available containers.
+ *
+ * N.B. For now, we are limiting the containers to be in the same Tk
+ * application as tkwin, since otherwise they would not be in our list
+ * of containers.
+ *
+ */
+
+ if (Tcl_GetInt(interp, string, &result) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ parent = (MacDrawable *) result;
+
+ /*
+ * Save information about the container and the embedded window
+ * in a Container structure. Currently, there must already be an existing
+ * Container structure, since we only allow the case where both container
+ * and embedded app. are in the same process.
+ */
+
+ for (containerPtr = firstContainerPtr; containerPtr != NULL;
+ containerPtr = containerPtr->nextPtr) {
+ if (containerPtr->parent == (Window) parent) {
+ winPtr->flags |= TK_BOTH_HALVES;
+ containerPtr->parentPtr->flags |= TK_BOTH_HALVES;
+ break;
+ }
+ }
+
+ /*
+ * Make the embedded window.
+ */
+
+ macWin = (MacDrawable *) ckalloc(sizeof(MacDrawable));
+ if (macWin == NULL) {
+ winPtr->privatePtr = NULL;
+ return TCL_ERROR;
+ }
+
+ macWin->winPtr = winPtr;
+ winPtr->privatePtr = macWin;
+
+ /*
+ * The grafPtr will be NULL for a Tk in Tk embedded window.
+ * It is none of our business what it is for a Tk not in Tk embedded window,
+ * but we will initialize it to NULL, and let the registerWinProc
+ * set it. In any case, you must always use TkMacOSXGetDrawablePort
+ * to get the portPtr. It will correctly find the container's port.
+ */
+
+ macWin->grafPtr = NULL;
+
+ macWin->clipRgn = NewRgn();
+ macWin->aboveClipRgn = NewRgn();
+ macWin->referenceCount = 0;
+ macWin->flags = TK_CLIP_INVALID;
+ macWin->toplevel = macWin;
+ macWin->toplevel->referenceCount++;
+
+ winPtr->flags |= TK_EMBEDDED;
+
+
+ /*
+ * Make a copy of the TK_EMBEDDED flag, since sometimes
+ * we need this to get the port after the TkWindow structure
+ * has been freed.
+ */
+
+ macWin->flags |= TK_EMBEDDED;
+
+ /*
+ * Now check whether it is embedded in another Tk widget. If not (the first
+ * case below) we see if there is an in-process embedding handler registered,
+ * and if so, let that fill in the rest of the macWin.
+ */
+
+ if (containerPtr == NULL) {
+ /*
+ * If someone has registered an in process embedding handler, then
+ * see if it can handle this window...
+ */
+
+ if (gMacEmbedHandler == NULL ||
+ gMacEmbedHandler->registerWinProc(result, (Tk_Window) winPtr) != TCL_OK) {
+ Tcl_AppendResult(interp, "The window ID ", string,
+ " does not correspond to a valid Tk Window.",
+ (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ containerPtr = (Container *) ckalloc(sizeof(Container));
+
+ containerPtr->parentPtr = NULL;
+ containerPtr->embedded = (Window) macWin;
+ containerPtr->embeddedPtr = macWin->winPtr;
+ containerPtr->nextPtr = firstContainerPtr;
+ firstContainerPtr = containerPtr;
+
+ }
+ } else {
+
+ /*
+ * The window is embedded in another Tk window.
+ */
+
+ macWin->xOff = parent->winPtr->privatePtr->xOff +
+ parent->winPtr->changes.border_width +
+ winPtr->changes.x;
+ macWin->yOff = parent->winPtr->privatePtr->yOff +
+ parent->winPtr->changes.border_width +
+ winPtr->changes.y;
+
+
+ /*
+ * Finish filling up the container structure with the embedded window's
+ * information.
+ */
+
+ containerPtr->embedded = (Window) macWin;
+ containerPtr->embeddedPtr = macWin->winPtr;
+
+ /*
+ * Create an event handler to clean up the Container structure when
+ * tkwin is eventually deleted.
+ */
+
+ Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbeddedEventProc,
+ (ClientData) winPtr);
+
+ }
+
+ /*
+ * TODO: need general solution for visibility events.
+ */
+
+
+ event.xany.serial = Tk_Display(winPtr)->request;
+ event.xany.send_event = False;
+ event.xany.display = Tk_Display(winPtr);
+
+ event.xvisibility.type = VisibilityNotify;
+ event.xvisibility.window = (Window) macWin;;
+ event.xvisibility.state = VisibilityUnobscured;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+
+ /*
+ * TODO: need general solution for visibility events.
+ */
+
+ event.xany.serial = Tk_Display(winPtr)->request;
+ event.xany.send_event = False;
+ event.xany.display = Tk_Display(winPtr);
+
+ event.xvisibility.type = VisibilityNotify;
+ event.xvisibility.window = (Window) macWin;;
+ event.xvisibility.state = VisibilityUnobscured;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMakeContainer --
+ *
+ * This procedure is called to indicate that a particular window
+ * will be a container for an embedded application. This changes
+ * certain aspects of the window's behavior, such as whether it
+ * will receive events anymore.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMakeContainer(
+ Tk_Window tkwin) /* Token for a window that is about to
+ * become a container. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ Container *containerPtr;
+
+ /*
+ * Register the window as a container so that, for example, we can
+ * make sure the argument to -use is valid.
+ */
+
+
+ Tk_MakeWindowExist(tkwin);
+ containerPtr = (Container *) ckalloc(sizeof(Container));
+ containerPtr->parent = Tk_WindowId(tkwin);
+ containerPtr->parentPtr = winPtr;
+ containerPtr->embedded = None;
+ containerPtr->embeddedPtr = NULL;
+ containerPtr->nextPtr = firstContainerPtr;
+ firstContainerPtr = containerPtr;
+ winPtr->flags |= TK_CONTAINER;
+
+ /*
+ * Request SubstructureNotify events so that we can find out when
+ * the embedded application creates its window or attempts to
+ * resize it. Also watch Configure events on the container so that
+ * we can resize the child to match. Also, pass activate events from
+ * the container down to the embedded toplevel.
+ */
+
+ Tk_CreateEventHandler(tkwin,
+ SubstructureNotifyMask|SubstructureRedirectMask,
+ ContainerEventProc, (ClientData) winPtr);
+ Tk_CreateEventHandler(tkwin, StructureNotifyMask, EmbedStructureProc,
+ (ClientData) containerPtr);
+ Tk_CreateEventHandler(tkwin, ActivateMask, EmbedActivateProc,
+ (ClientData) containerPtr);
+ Tk_CreateEventHandler(tkwin, FocusChangeMask, EmbedFocusProc,
+ (ClientData) containerPtr);
+
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXContainerId --
+ *
+ * Given an embedded window, this procedure returns the MacDrawable
+ * identifier for the associated container window.
+ *
+ * Results:
+ * The return value is the MacDrawable for winPtr's
+ * container window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MacDrawable *
+TkMacOSXContainerId(winPtr)
+ TkWindow *winPtr; /* Tk's structure for an embedded window. */
+{
+ Container *containerPtr;
+
+ for (containerPtr = firstContainerPtr; containerPtr != NULL;
+ containerPtr = containerPtr->nextPtr) {
+ if (containerPtr->embeddedPtr == winPtr) {
+ return (MacDrawable *) containerPtr->parent;
+ }
+ }
+ panic("TkMacOSXContainerId couldn't find window");
+ return None;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetHostToplevel --
+ *
+ * Given the TkWindow, return the MacDrawable for the outermost
+ * toplevel containing it. This will be a real Macintosh window.
+ *
+ * Results:
+ * Returns a MacDrawable corresponding to a Macintosh Toplevel
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+MacDrawable *
+TkMacOSXGetHostToplevel(
+ TkWindow *winPtr) /* Tk's structure for a window. */
+{
+ TkWindow *contWinPtr, *topWinPtr;
+
+ topWinPtr = winPtr->privatePtr->toplevel->winPtr;
+ if (!Tk_IsEmbedded(topWinPtr)) {
+ return winPtr->privatePtr->toplevel;
+ } else {
+ contWinPtr = TkpGetOtherWindow(topWinPtr);
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ if (contWinPtr != NULL) {
+ return TkMacOSXGetHostToplevel(contWinPtr);
+ } else {
+ return None;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpClaimFocus --
+ *
+ * This procedure is invoked when someone asks for the input focus
+ * to be put on a window in an embedded application, but the
+ * application doesn't currently have the focus. It requests the
+ * input focus from the container application.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The input focus may change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpClaimFocus(
+ TkWindow *topLevelPtr, /* Top-level window containing desired
+ * focus window; should be embedded. */
+ int force) /* One means that the container should
+ * claim the focus if it doesn't
+ * currently have it. */
+{
+ XEvent event;
+ Container *containerPtr;
+
+ if (!(topLevelPtr->flags & TK_EMBEDDED)) {
+ return;
+ }
+
+ for (containerPtr = firstContainerPtr;
+ containerPtr->embeddedPtr != topLevelPtr;
+ containerPtr = containerPtr->nextPtr) {
+ /* Empty loop body. */
+ }
+
+
+ event.xfocus.type = FocusIn;
+ event.xfocus.serial = LastKnownRequestProcessed(topLevelPtr->display);
+ event.xfocus.send_event = 1;
+ event.xfocus.display = topLevelPtr->display;
+ event.xfocus.window = containerPtr->parent;
+ event.xfocus.mode = EMBEDDED_APP_WANTS_FOCUS;
+ event.xfocus.detail = force;
+ Tk_QueueWindowEvent(&event,TCL_QUEUE_TAIL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpTestembedCmd --
+ *
+ * This procedure implements the "testembed" command. It returns
+ * some or all of the information in the list pointed to by
+ * firstContainerPtr.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpTestembedCmd(
+ ClientData clientData, /* Main window for application. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
+{
+ int all;
+ Container *containerPtr;
+ Tcl_DString dString;
+ char buffer[50];
+
+ if ((argc > 1) && (strcmp(argv[1], "all") == 0)) {
+ all = 1;
+ } else {
+ all = 0;
+ }
+ Tcl_DStringInit(&dString);
+ for (containerPtr = firstContainerPtr; containerPtr != NULL;
+ containerPtr = containerPtr->nextPtr) {
+ Tcl_DStringStartSublist(&dString);
+ if (containerPtr->parent == None) {
+ Tcl_DStringAppendElement(&dString, "");
+ } else {
+ if (all) {
+ sprintf(buffer, "0x%x", (int) containerPtr->parent);
+ Tcl_DStringAppendElement(&dString, buffer);
+ } else {
+ Tcl_DStringAppendElement(&dString, "XXX");
+ }
+ }
+ if (containerPtr->parentPtr == NULL) {
+ Tcl_DStringAppendElement(&dString, "");
+ } else {
+ Tcl_DStringAppendElement(&dString,
+ containerPtr->parentPtr->pathName);
+ }
+ if (containerPtr->embedded == None) {
+ Tcl_DStringAppendElement(&dString, "");
+ } else {
+ if (all) {
+ sprintf(buffer, "0x%x", (int) containerPtr->embedded);
+ Tcl_DStringAppendElement(&dString, buffer);
+ } else {
+ Tcl_DStringAppendElement(&dString, "XXX");
+ }
+ }
+ if (containerPtr->embeddedPtr == NULL) {
+ Tcl_DStringAppendElement(&dString, "");
+ } else {
+ Tcl_DStringAppendElement(&dString,
+ containerPtr->embeddedPtr->pathName);
+ }
+ Tcl_DStringEndSublist(&dString);
+ }
+ Tcl_DStringResult(interp, &dString);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpRedirectKeyEvent --
+ *
+ * This procedure is invoked when a key press or release event
+ * arrives for an application that does not believe it owns the
+ * input focus. This can happen because of embedding; for example,
+ * X can send an event to an embedded application when the real
+ * focus window is in the container application and is an ancestor
+ * of the container. This procedure's job is to forward the event
+ * back to the application where it really belongs.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The event may get sent to a different application.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpRedirectKeyEvent(
+ TkWindow *winPtr, /* Window to which the event was originally
+ * reported. */
+ XEvent *eventPtr) /* X event to redirect (should be KeyPress
+ * or KeyRelease). */
+{
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetOtherWindow --
+ *
+ * If both the container and embedded window are in the same
+ * process, this procedure will return either one, given the other.
+ *
+ * Results:
+ * If winPtr is a container, the return value is the token for the
+ * embedded window, and vice versa. If the "other" window isn't in
+ * this process, NULL is returned.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow *
+TkpGetOtherWindow(
+ TkWindow *winPtr) /* Tk's structure for a container or
+ * embedded window. */
+{
+ Container *containerPtr;
+
+ /*
+ * TkpGetOtherWindow returns NULL if both windows are not
+ * in the same process...
+ */
+
+ if (!(winPtr->flags & TK_BOTH_HALVES)) {
+ return NULL;
+ }
+
+ for (containerPtr = firstContainerPtr; containerPtr != NULL;
+ containerPtr = containerPtr->nextPtr) {
+ if (containerPtr->embeddedPtr == winPtr) {
+ return containerPtr->parentPtr;
+ } else if (containerPtr->parentPtr == winPtr) {
+ return containerPtr->embeddedPtr;
+ }
+ }
+ return NULL;
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * EmbeddedEventProc --
+ *
+ * This procedure is invoked by the Tk event dispatcher when various
+ * useful events are received for a window that is embedded in
+ * another application.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Our internal state gets cleaned up when an embedded window is
+ * destroyed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EmbeddedEventProc(clientData, eventPtr)
+ ClientData clientData; /* Token for container window. */
+ XEvent *eventPtr; /* ResizeRequest event. */
+{
+ TkWindow *winPtr = (TkWindow *) clientData;
+
+ if (eventPtr->type == DestroyNotify) {
+ EmbedWindowDeleted(winPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ContainerEventProc --
+ *
+ * This procedure is invoked by the Tk event dispatcher when various
+ * useful events are received for the children of a container
+ * window. It forwards relevant information, such as geometry
+ * requests, from the events into the container's application.
+ *
+ * NOTE: on the Mac, only the DestroyNotify branch is ever taken.
+ * We don't synthesize the other events.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Depends on the event. For example, when ConfigureRequest events
+ * occur, geometry information gets set for the container window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ContainerEventProc(clientData, eventPtr)
+ ClientData clientData; /* Token for container window. */
+ XEvent *eventPtr; /* ResizeRequest event. */
+{
+ TkWindow *winPtr = (TkWindow *) clientData;
+ Container *containerPtr;
+ Tk_ErrorHandler errHandler;
+
+ /*
+ * Ignore any X protocol errors that happen in this procedure
+ * (almost any operation could fail, for example, if the embedded
+ * application has deleted its window).
+ */
+
+ errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
+ -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL);
+
+ /*
+ * Find the Container structure associated with the parent window.
+ */
+
+ for (containerPtr = firstContainerPtr;
+ containerPtr->parent != eventPtr->xmaprequest.parent;
+ containerPtr = containerPtr->nextPtr) {
+ if (containerPtr == NULL) {
+ panic("ContainerEventProc couldn't find Container record");
+ }
+ }
+
+ if (eventPtr->type == CreateNotify) {
+ /*
+ * A new child window has been created in the container. Record
+ * its id in the Container structure (if more than one child is
+ * created, just remember the last one and ignore the earlier
+ * ones).
+ */
+
+ containerPtr->embedded = eventPtr->xcreatewindow.window;
+ } else if (eventPtr->type == ConfigureRequest) {
+ if ((eventPtr->xconfigurerequest.x != 0)
+ || (eventPtr->xconfigurerequest.y != 0)) {
+ /*
+ * The embedded application is trying to move itself, which
+ * isn't legal. At this point, the window hasn't actually
+ * moved, but we need to send it a ConfigureNotify event to
+ * let it know that its request has been denied. If the
+ * embedded application was also trying to resize itself, a
+ * ConfigureNotify will be sent by the geometry management
+ * code below, so we don't need to do anything. Otherwise,
+ * generate a synthetic event.
+ */
+
+ if ((eventPtr->xconfigurerequest.width == winPtr->changes.width)
+ && (eventPtr->xconfigurerequest.height
+ == winPtr->changes.height)) {
+ EmbedSendConfigure(containerPtr);
+ }
+ }
+ EmbedGeometryRequest(containerPtr,
+ eventPtr->xconfigurerequest.width,
+ eventPtr->xconfigurerequest.height);
+ } else if (eventPtr->type == MapRequest) {
+ /*
+ * The embedded application's map request was ignored and simply
+ * passed on to us, so we have to map the window for it to appear
+ * on the screen.
+ */
+
+ XMapWindow(eventPtr->xmaprequest.display,
+ eventPtr->xmaprequest.window);
+ } else if (eventPtr->type == DestroyNotify) {
+ /*
+ * The embedded application is gone. Destroy the container window.
+ */
+
+ Tk_DestroyWindow((Tk_Window) winPtr);
+ }
+ Tk_DeleteErrorHandler(errHandler);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EmbedStructureProc --
+ *
+ * This procedure is invoked by the Tk event dispatcher when
+ * a container window owned by this application gets resized
+ * (and also at several other times that we don't care about).
+ * This procedure reflects the size change in the embedded
+ * window that corresponds to the container.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The embedded window gets resized to match the container.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EmbedStructureProc(clientData, eventPtr)
+ ClientData clientData; /* Token for container window. */
+ XEvent *eventPtr; /* ResizeRequest event. */
+{
+ Container *containerPtr = (Container *) clientData;
+ Tk_ErrorHandler errHandler;
+
+ if (eventPtr->type == ConfigureNotify) {
+ if (containerPtr->embedded != None) {
+ /*
+ * Ignore errors, since the embedded application could have
+ * deleted its window.
+ */
+
+ errHandler = Tk_CreateErrorHandler(eventPtr->xfocus.display, -1,
+ -1, -1, (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ Tk_MoveResizeWindow((Tk_Window) containerPtr->embeddedPtr, 0, 0,
+ (unsigned int) Tk_Width(
+ (Tk_Window) containerPtr->parentPtr),
+ (unsigned int) Tk_Height(
+ (Tk_Window) containerPtr->parentPtr));
+ Tk_DeleteErrorHandler(errHandler);
+ }
+ } else if (eventPtr->type == DestroyNotify) {
+ EmbedWindowDeleted(containerPtr->parentPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EmbedActivateProc --
+ *
+ * This procedure is invoked by the Tk event dispatcher when
+ * Activate and Deactivate events occur for a container window owned
+ * by this application. It is responsible for forwarding an activate
+ * event down into the embedded toplevel.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The X focus may change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EmbedActivateProc(clientData, eventPtr)
+ ClientData clientData; /* Token for container window. */
+ XEvent *eventPtr; /* ResizeRequest event. */
+{
+ Container *containerPtr = (Container *) clientData;
+
+ if (containerPtr->embeddedPtr != NULL) {
+ if (eventPtr->type == ActivateNotify) {
+ TkGenerateActivateEvents(containerPtr->embeddedPtr,1);
+ } else if (eventPtr->type == DeactivateNotify) {
+ TkGenerateActivateEvents(containerPtr->embeddedPtr,0);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EmbedFocusProc --
+ *
+ * This procedure is invoked by the Tk event dispatcher when
+ * FocusIn and FocusOut events occur for a container window owned
+ * by this application. It is responsible for moving the focus
+ * back and forth between a container application and an embedded
+ * application.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The X focus may change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EmbedFocusProc(clientData, eventPtr)
+ ClientData clientData; /* Token for container window. */
+ XEvent *eventPtr; /* ResizeRequest event. */
+{
+ Container *containerPtr = (Container *) clientData;
+ Display *display;
+ XEvent event;
+
+ if (containerPtr->embeddedPtr != NULL) {
+ display = Tk_Display(containerPtr->parentPtr);
+ event.xfocus.serial = LastKnownRequestProcessed(display);
+ event.xfocus.send_event = false;
+ event.xfocus.display = display;
+ event.xfocus.mode = NotifyNormal;
+ event.xfocus.window = containerPtr->embedded;
+
+ if (eventPtr->type == FocusIn) {
+ /*
+ * The focus just arrived at the container. Change the X focus
+ * to move it to the embedded application, if there is one.
+ * Ignore X errors that occur during this operation (it's
+ * possible that the new focus window isn't mapped).
+ */
+
+ event.xfocus.detail = NotifyNonlinear;
+ event.xfocus.type = FocusIn;
+
+ } else if (eventPtr->type == FocusOut) {
+ /* When the container gets a FocusOut event, it has to tell the embedded app
+ * that it has lost the focus.
+ */
+
+ event.xfocus.type = FocusOut;
+ event.xfocus.detail = NotifyNonlinear;
+ }
+
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_MARK);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EmbedGeometryRequest --
+ *
+ * This procedure is invoked when an embedded application requests
+ * a particular size. It processes the request (which may or may
+ * not actually honor the request) and reflects the results back
+ * to the embedded application.
+ *
+ * NOTE: On the Mac, this is a stub, since we don't synthesize
+ * ConfigureRequest events.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If we deny the child's size change request, a Configure event
+ * is synthesized to let the child know how big it ought to be.
+ * Events get processed while we're waiting for the geometry
+ * managers to do their thing.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EmbedGeometryRequest(containerPtr, width, height)
+ Container *containerPtr; /* Information about the embedding. */
+ int width, height; /* Size that the child has requested. */
+{
+ TkWindow *winPtr = containerPtr->parentPtr;
+
+ /*
+ * Forward the requested size into our geometry management hierarchy
+ * via the container window. We need to send a Configure event back
+ * to the embedded application if we decide not to honor its
+ * request; to make this happen, process all idle event handlers
+ * synchronously here (so that the geometry managers have had a
+ * chance to do whatever they want to do), and if the window's size
+ * didn't change then generate a configure event.
+ */
+
+ Tk_GeometryRequest((Tk_Window) winPtr, width, height);
+ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {
+ /* Empty loop body. */
+ }
+ if ((winPtr->changes.width != width)
+ || (winPtr->changes.height != height)) {
+ EmbedSendConfigure(containerPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EmbedSendConfigure --
+ *
+ * This is currently a stub. It is called to notify an
+ * embedded application of its current size and location. This
+ * procedure is called when the embedded application made a
+ * geometry request that we did not grant, so that the embedded
+ * application knows that its geometry didn't change after all.
+ * It is a response to ConfigureRequest events, which we do not
+ * currently synthesize on the Mac
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EmbedSendConfigure(containerPtr)
+ Container *containerPtr; /* Information about the embedding. */
+{
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EmbedWindowDeleted --
+ *
+ * This procedure is invoked when a window involved in embedding
+ * (as either the container or the embedded application) is
+ * destroyed. It cleans up the Container structure for the window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A Container structure may be freed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+EmbedWindowDeleted(winPtr)
+ TkWindow *winPtr; /* Tk's information about window that
+ * was deleted. */
+{
+ Container *containerPtr, *prevPtr;
+
+ /*
+ * Find the Container structure for this window. Delete the
+ * information about the embedded application and free the container's
+ * record.
+ */
+
+ prevPtr = NULL;
+ containerPtr = firstContainerPtr;
+ while (1) {
+ if (containerPtr->embeddedPtr == winPtr) {
+
+ /*
+ * We also have to destroy our parent, to clean up the container.
+ * Fabricate an event to do this.
+ */
+
+ if (containerPtr->parentPtr != NULL &&
+ containerPtr->parentPtr->flags & TK_BOTH_HALVES) {
+ XEvent event;
+
+ event.xany.serial =
+ Tk_Display(containerPtr->parentPtr)->request;
+ event.xany.send_event = False;
+ event.xany.display = Tk_Display(containerPtr->parentPtr);
+
+ event.xany.type = DestroyNotify;
+ event.xany.window = containerPtr->parent;
+ event.xdestroywindow.event = containerPtr->parent;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_HEAD);
+
+ }
+
+ containerPtr->embedded = None;
+ containerPtr->embeddedPtr = NULL;
+
+ break;
+ }
+ if (containerPtr->parentPtr == winPtr) {
+ containerPtr->parentPtr = NULL;
+ break;
+ }
+ prevPtr = containerPtr;
+ containerPtr = containerPtr->nextPtr;
+ }
+ if ((containerPtr->embeddedPtr == NULL)
+ && (containerPtr->parentPtr == NULL)) {
+ if (prevPtr == NULL) {
+ firstContainerPtr = containerPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = containerPtr->nextPtr;
+ }
+ ckfree((char *) containerPtr);
+ }
+}
+
diff --git a/tk/macosx/tkMacOSXEvent.c b/tk/macosx/tkMacOSXEvent.c
new file mode 100644
index 00000000000..d8a3279fe76
--- /dev/null
+++ b/tk/macosx/tkMacOSXEvent.c
@@ -0,0 +1,276 @@
+/*
+ * tkMacOSXEvent.c --
+ *
+ * This file contains most of the X calls called by Tk. Many of
+ * these calls are just stubs and either don't make sense on the
+ * Macintosh or thier implamentation just doesn't do anything. Other
+ * calls will eventually be moved into other files.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+
+#include "tkMacOSXInt.h"
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXDebug.h"
+
+#define TK_MAC_DEBUG 1
+
+/*
+ * The following are undocumented event classes
+ *
+ */
+enum {
+ kEventClassUser = 'user',
+ kEventClassCgs = 'cgs ',
+};
+
+/*
+ * The following are undocumented event kinds
+ *
+ */
+enum {
+ kEventMouse8 = 8,
+ kEventMouse9 = 9,
+ kEventApp103 = 103
+};
+
+EventRef TkMacOSXCreateFakeEvent ();
+
+/*
+ * Forward declarations of procedures used in this file.
+ */
+static int ReceiveAndProcessEvent _ANSI_ARGS_(());
+
+static EventTargetRef targetRef;
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * tkMacOSXFlushWindows --
+ *
+ * This routine flushes all the Carbon windows of the application
+ * It is called by the setup procedure for the Tcl/Carbon event source
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Flushes all Carbon windows
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+tkMacOSXFlushWindows ()
+{
+ WindowRef wRef = GetWindowList();
+
+ while (wRef) {
+ CGrafPtr portPtr = GetWindowPort(wRef);
+ if (QDIsPortBuffered(portPtr)) {
+ QDFlushPortBuffer(portPtr, NULL);
+ }
+ wRef=GetNextWindow(wRef);
+ }
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXCountAndProcessMacEvents --
+ *
+ * This routine receives any Carbon events that aare in the
+ * queue and converts them to tk events
+ * It is called by the event set-up and check routines
+ * Results:
+ * The number of events in the queue.
+ *
+ * Side effects:
+ * Tells the Window Manager to deliver events to the event
+ * queue of the current thread.
+ * Receives any Carbon events on the queue and converts them to tk events
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXCountAndProcessMacEvents()
+{
+ EventQueueRef qPtr;
+ int eventCount;
+ qPtr = GetMainEventQueue();
+ eventCount = GetNumEventsInQueue(qPtr);
+ if (eventCount) {
+ int n, err;
+ for (n = 0, err = 0;n<eventCount && !err;n++) {
+ err = ReceiveAndProcessEvent();
+ }
+ }
+ return eventCount;
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessAppleEvent --
+ *
+ * This processes Apple events
+ *
+ * Results:
+ * 0 on success
+ * -1 on failure
+ *
+ * Side effects:
+ * Calls the Tk high-level event handler
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TkMacOSXProcessAppleEvent(TkMacOSXEvent * eventPtr, MacEventStatus * statusPtr)
+{
+ int err;
+ EventRecord eventRecord;
+ if (ConvertEventRefToEventRecord(eventPtr->eventRef,
+ &eventRecord )) {
+ err=TkMacOSXDoHLEvent(&eventRecord);
+ if (err!=noErr) {
+ char buf1 [ 256 ];
+ char buf2 [ 256 ];
+ fprintf(stderr,
+ "TkMacOSXDoHLEvent failed : %s,%s,%d\n",
+ CarbonEventToAscii(eventPtr->eventRef, buf1),
+ ClassicEventToAscii(&eventRecord,buf2), err);
+ statusPtr->err = 1;
+ } else {
+ statusPtr->handledByTk = 1;
+ }
+ } else {
+ statusPtr->err = 1;
+ fprintf(stderr,"ConvertEventRefToEventRecord failed\n");
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessEvent --
+ *
+ * This dispatches a filtered Carbon event to the appropriate handler
+ *
+ * Results:
+ * 0 on success
+ * -1 on failure
+ *
+ * Side effects:
+ * Converts a Carbon event to a Tk event
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+TkMacOSXProcessEvent(TkMacOSXEvent * eventPtr, MacEventStatus * statusPtr)
+{
+ switch (eventPtr->eClass) {
+ case kEventClassMouse:
+ TkMacOSXProcessMouseEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassWindow:
+ TkMacOSXProcessWindowEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassKeyboard:
+ TkMacOSXProcessKeyboardEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassApplication:
+ TkMacOSXProcessApplicationEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassAppleEvent:
+ TkMacOSXProcessAppleEvent(eventPtr, statusPtr);
+ break;
+ case kEventClassCgs:
+ case kEventClassUser:
+ case kEventClassWish:
+ statusPtr->handledByTk = 1;
+ break;
+ default:
+#ifdef TK_MAC_DEBUG
+ if (0)
+ {
+ char buf [ 256 ];
+ fprintf(stderr,
+ "Unrecognised event : %s\n",
+ CarbonEventToAscii(eventPtr->eventRef, buf));
+ }
+#endif
+ break;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReceiveAndProcessEvent --
+ *
+ * This receives a carbon event and converts it to a tk event
+ *
+ * Results:
+ * 0 on success
+ * Mac OS error number on failure
+ *
+ * Side effects:
+ * This receives the next Carbon event
+ * and converts it to the appropriate tk event
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReceiveAndProcessEvent()
+{
+ TkMacOSXEvent macEvent;
+ MacEventStatus eventStatus;
+ int err;
+ char buf [ 256 ];
+
+ /*
+ * This is a poll, since we have already counted the events coming
+ * into this routine, and are guaranteed to have one waiting.
+ */
+
+ err=ReceiveNextEvent(0, NULL, kEventDurationNoWait,
+ true, &macEvent.eventRef);
+ if (err != noErr) {
+ return err;
+ } else {
+ macEvent.eClass = GetEventClass(macEvent.eventRef);
+ macEvent.eKind = GetEventKind(macEvent.eventRef);
+ bzero(&eventStatus, sizeof(eventStatus));
+ TkMacOSXProcessEvent(&macEvent,&eventStatus);
+ if (!eventStatus.handledByTk) {
+ if (!targetRef) {
+ targetRef=GetEventDispatcherTarget();
+ }
+
+ err= SendEventToEventTarget(macEvent.eventRef,targetRef);
+ if (err != noErr /* && err != eventNotHandledErr */) {
+ fprintf(stderr,
+ "RCNE SendEventToEventTarget (%s) failed, %d\n",
+ CarbonEventToAscii(macEvent.eventRef,buf ),err);
+ }
+ }
+ ReleaseEvent(macEvent.eventRef);
+ return 0;
+ }
+}
diff --git a/tk/macosx/tkMacOSXEvent.h b/tk/macosx/tkMacOSXEvent.h
new file mode 100644
index 00000000000..2ce339b0155
--- /dev/null
+++ b/tk/macosx/tkMacOSXEvent.h
@@ -0,0 +1,86 @@
+/*
+ * tkMacOSXEvent.h --
+ *
+ * Declarations of Macintosh specific functions for implementing the
+ * Mac OS X Notifier.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#ifndef _TKMACEVENT
+#define _TKMACEVENT
+
+#include <Carbon/Carbon.h>
+#include <tcl.h>
+
+enum {
+ kEventClassWish = 'WiSH'
+};
+
+typedef struct {
+ int handledByTk;
+ int err;
+ char errMsg[1024];
+} MacEventStatus;
+
+/*
+ * The event information in passed in the following structures
+ */
+typedef struct {
+ EventRef eventRef;
+ UInt32 eClass; /* Defines the class of event : see CarbonEvents.h */
+ UInt32 eKind; /* Defines the kind of the event : see CarbonEvents.h */
+} TkMacOSXEvent;
+
+int TkMacOSXCountAndProcessMacEvents _ANSI_ARGS_(());
+void tkMacOSXFlushWindows _ANSI_ARGS_(());
+int TkMacOSXProcessMouseEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
+int TkMacOSXProcessWindowEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
+int TkMacOSXProcessKeyboardEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
+int TkMacOSXProcessApplicationEvent(TkMacOSXEvent * e, MacEventStatus * statusPtr);
+
+#endif
diff --git a/tk/macosx/tkMacOSXFont.c b/tk/macosx/tkMacOSXFont.c
new file mode 100644
index 00000000000..5f90652ae21
--- /dev/null
+++ b/tk/macosx/tkMacOSXFont.c
@@ -0,0 +1,2191 @@
+/*
+ * tkMacOSXFont.c --
+ *
+ * Contains the Macintosh implementation of the platform-independant
+ * font package interface.
+ *
+ * Copyright (c) 1990-1994 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+#include <Carbon/Carbon.h>
+
+#include "tkMacOSXInt.h"
+#include "tkFont.h"
+
+/*
+ * For doing things with Mac strings and Fixed numbers. This probably should move
+ * the mac header file.
+ */
+
+#ifndef StrLength
+#define StrLength(s) (*((unsigned char *) (s)))
+#endif
+#ifndef StrBody
+#define StrBody(s) ((char *) (s) + 1)
+#endif
+#define pstrcmp(s1, s2) RelString((s1), (s2), 1, 1)
+#define pstrcasecmp(s1, s2) RelString((s1), (s2), 0, 1)
+
+#ifndef Fixed2Int
+#define Fixed2Int(f) ((f) >> 16)
+#define Int2Fixed(i) ((i) << 16)
+#endif
+
+/*
+ * The preferred font encodings.
+ */
+
+static CONST char *encodingList[] = {
+ "macRoman", "macJapan", NULL
+};
+
+/*
+ * The following structures are used to map the script/language codes of a
+ * font to the name that should be passed to Tcl_GetTextEncoding() to obtain
+ * the encoding for that font. The set of numeric constants is fixed and
+ * defined by Apple.
+ */
+
+static TkStateMap scriptMap[] = {
+ {smRoman, "macRoman"},
+ {smJapanese, "macJapan"},
+ {smTradChinese, "macChinese"},
+ {smKorean, "macKorean"},
+ {smArabic, "macArabic"},
+ {smHebrew, "macHebrew"},
+ {smGreek, "macGreek"},
+ {smCyrillic, "macCyrillic"},
+ {smRSymbol, "macRSymbol"},
+ {smDevanagari, "macDevanagari"},
+ {smGurmukhi, "macGurmukhi"},
+ {smGujarati, "macGujarati"},
+ {smOriya, "macOriya"},
+ {smBengali, "macBengali"},
+ {smTamil, "macTamil"},
+ {smTelugu, "macTelugu"},
+ {smKannada, "macKannada"},
+ {smMalayalam, "macMalayalam"},
+ {smSinhalese, "macSinhalese"},
+ {smBurmese, "macBurmese"},
+ {smKhmer, "macKhmer"},
+ {smThai, "macThailand"},
+ {smLaotian, "macLaos"},
+ {smGeorgian, "macGeorgia"},
+ {smArmenian, "macArmenia"},
+ {smSimpChinese, "macSimpChinese"},
+ {smTibetan, "macTIbet"},
+ {smMongolian, "macMongolia"},
+ {smGeez, "macEthiopia"},
+ {smEastEurRoman, "macCentEuro"},
+ {smVietnamese, "macVietnam"},
+ {smExtArabic, "macSindhi"},
+ {NULL, NULL}
+};
+
+static TkStateMap romanMap[] = {
+ {langCroatian, "macCroatian"},
+ {langSlovenian, "macCroatian"},
+ {langIcelandic, "macIceland"},
+ {langRomanian, "macRomania"},
+ {langTurkish, "macTurkish"},
+ {langGreek, "macGreek"},
+ {NULL, NULL}
+};
+
+static TkStateMap cyrillicMap[] = {
+ {langUkrainian, "macUkraine"},
+ {langBulgarian, "macBulgaria"},
+ {NULL, NULL}
+};
+
+/*
+ * 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 Macintosh, a "font family" is uniquely identified by its face number.
+ */
+
+
+#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.
+ */
+
+ FMFontFamily faceNum; /* Unique face number key for this FontFamily. */
+
+ /*
+ * Derived properties.
+ */
+
+ Tcl_Encoding encoding; /* Encoding for this font family. */
+ int isSymbolFont; /* Non-zero if this is a symbol family. */
+ int isMultiByteFont; /* Non-zero if this is a multi-byte family. */
+ char typeTable[256]; /* Table that identfies all lead bytes for a
+ * multi-byte family, used when measuring chars.
+ * If a byte is a lead byte, the value at the
+ * corresponding position in the typeTable is 1,
+ * otherwise 0. If this is a single-byte font,
+ * all entries are 0. */
+ 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. */
+} 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. */
+ FontFamily *familyPtr; /* The FontFamily for this SubFont. */
+} SubFont;
+
+/*
+ * The following structure represents Macintosh's implementation of a font
+ * object.
+ */
+
+#define SUBFONT_SPACE 3
+
+typedef struct MacFont {
+ 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. */
+
+ short size; /* Font size in pixels, constructed from
+ * font attributes. */
+ short style; /* Style bits, constructed from font
+ * attributes. */
+} MacFont;
+
+/*
+ * The following structure is used to map between the UTF-8 name for a font and
+ * the name that the Macintosh uses to refer to the font, in order to determine
+ * if a font exists. The Macintosh names for fonts are stored in the encoding
+ * of the font itself.
+ */
+
+typedef struct FontNameMap {
+ Tk_Uid utfName; /* The name of the font in UTF-8. */
+ StringPtr nativeName; /* The name of the font in the font's encoding. */
+ FMFontFamily faceNum; /* Unique face number for this font. */
+} FontNameMap;
+
+/*
+ * The list of font families that are currently loaded. As screen fonts
+ * are loaded, this list grows to hold information about what characters
+ * exist in each font family.
+ */
+
+static FontFamily *fontFamilyList = NULL;
+
+/*
+ * Information cached about the system at startup time.
+ */
+
+static FontNameMap *gFontNameMap = NULL;
+static GWorldPtr gWorld = NULL;
+
+/*
+ * Procedures used only in this file.
+ */
+
+static FontFamily * AllocFontFamily(CONST MacFont *fontPtr, int family);
+static SubFont * CanUseFallback(MacFont *fontPtr, CONST char *fallbackName, int ch);
+static SubFont * CanUseFallbackWithAliases(MacFont *fontPtr, CONST char *faceName, int ch, Tcl_DString *nameTriedPtr);
+static SubFont * FindSubFontForChar(MacFont *fontPtr, int ch);
+static void FontMapInsert(SubFont *subFontPtr, int ch);
+static void FontMapLoadPage(SubFont *subFontPtr, int row);
+static int FontMapLookup(SubFont *subFontPtr, int ch);
+static void FreeFontFamily(FontFamily *familyPtr);
+static void InitFont(Tk_Window tkwin, int family, int size, int style, MacFont *fontPtr);
+static void InitSubFont(CONST MacFont *fontPtr, int family, SubFont *subFontPtr);
+static void MultiFontDrawText(MacFont *fontPtr, CONST char *source, int numBytes, int x, int y);
+static void ReleaseFont(MacFont *fontPtr);
+static void ReleaseSubFont(SubFont *subFontPtr);
+static int SeenName(CONST char *name, Tcl_DString *dsPtr);
+
+static CONST char * BreakLine(FontFamily *familyPtr, int flags, CONST char *source, int numBytes, int *widthPtr);
+static int GetFamilyNum(CONST char *faceName, short *familyPtr);
+static int GetFamilyOrAliasNum(CONST char *faceName, short *familyPtr);
+static Tcl_Encoding GetFontEncoding(int faceNum, int allowSymbol, int *isSymbolPtr);
+static Tk_Uid GetUtfFaceName(StringPtr faceNameStr);
+
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * TkpFontPkgInit --
+ *
+ * This procedure is called when an application is created. It
+ * initializes all the structures that are used by the
+ * platform-dependant code on a per application basis.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * See comments below.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+TkpFontPkgInit(mainPtr)
+ TkMainInfo *mainPtr; /* The application being created. */
+{
+ FMFontFamilyIterator fontFamilyIterator;
+ FMFontFamily fontFamily;
+ FontNameMap *tmpFontNameMap, *newFontNameMap, *mapPtr;
+ int i, j, numFonts, fontMapOffset, isSymbol;
+ Str255 nativeName;
+ Tcl_DString ds;
+ Tcl_Encoding encoding;
+ Tcl_Encoding *encodings;
+
+ if (gWorld == NULL) {
+ Rect rect = {0, 0, 1, 1};
+ SetFractEnable(0);
+ /*
+ * Used for saving and restoring state while drawing and measuring.
+ */
+ if (NewGWorld(&gWorld, 0, &rect, NULL, NULL, 0) != noErr) {
+ panic("TkpFontPkgInit: NewGWorld failed");
+ }
+ /*
+ * The name of each font is stored in the encoding of that font.
+ * How would we translate a name from UTF-8 into the native encoding
+ * of the font unless we knew the encoding of that font? We can't.
+ * So, precompute the UTF-8 and native names of all fonts on the
+ * system. The when the user asks for font by its UTF-8 name, we
+ * lookup the name in that table and really ask for the font by its
+ * native name. Any unknown UTF-8 names will be mapped to the system
+ * font.
+ */
+ FMCreateFontFamilyIterator (NULL, NULL, kFMDefaultOptions, &fontFamilyIterator);
+ numFonts = 0;
+ while (FMGetNextFontFamily(&fontFamilyIterator, &fontFamily) != kFMIterationCompleted) {
+ numFonts++;
+ }
+ tmpFontNameMap = (FontNameMap *) ckalloc(sizeof(FontNameMap) * numFonts);
+ encodings = (Tcl_Encoding *) ckalloc(sizeof(Tcl_Encoding) * numFonts);
+ mapPtr = tmpFontNameMap;
+ FMResetFontFamilyIterator(NULL, NULL, kFMDefaultOptions, &fontFamilyIterator);
+ i = 0;
+ while (FMGetNextFontFamily(&fontFamilyIterator, &fontFamily) != kFMIterationCompleted) {
+ mapPtr->faceNum = fontFamily;
+ encodings[i] = GetFontEncoding(mapPtr->faceNum, 0, &isSymbol);
+ FMGetFontFamilyName(fontFamily, nativeName );
+ Tcl_ExternalToUtfDString(encodings[i], StrBody(nativeName), StrLength(nativeName), &ds);
+ mapPtr->utfName = Tk_GetUid(Tcl_DStringValue(&ds));
+ mapPtr->nativeName = (StringPtr) ckalloc(StrLength(nativeName) + 1);
+ memcpy(mapPtr->nativeName, nativeName, StrLength(nativeName) + 1);
+ Tcl_DStringFree(&ds);
+ mapPtr++;
+ i++;
+ }
+ FMDisposeFontFamilyIterator (&fontFamilyIterator);
+
+ /*
+ * Reorder FontNameMap so fonts with the preferred encodings are at
+ * the front of the list. The relative order of fonts that all have
+ * the same encoding is preserved. Fonts with unknown encodings get
+ * stuck at the end.
+ */
+ newFontNameMap = (FontNameMap *) ckalloc(sizeof(FontNameMap) * (numFonts + 1));
+ fontMapOffset = 0;
+ for (i = 0; encodingList[i] != NULL; i++) {
+ encoding = Tcl_GetEncoding(NULL, encodingList[i]);
+ if (encoding == NULL) {
+ continue;
+ }
+ for (j = 0; j < numFonts; j++) {
+ if (encodings[j] == encoding) {
+ newFontNameMap[fontMapOffset] = tmpFontNameMap[j];
+ fontMapOffset++;
+ Tcl_FreeEncoding(encodings[j]);
+ tmpFontNameMap[j].utfName = NULL;
+ }
+ }
+ Tcl_FreeEncoding(encoding);
+ }
+ for (i = 0; i < numFonts; i++) {
+ if (tmpFontNameMap[i].utfName != NULL) {
+ newFontNameMap[fontMapOffset] = tmpFontNameMap[i];
+ fontMapOffset++;
+ Tcl_FreeEncoding(encodings[i]);
+ }
+ }
+ if (fontMapOffset != numFonts) {
+ panic("TkpFontPkgInit: unexpected number of fonts");
+ }
+
+ mapPtr = &newFontNameMap[numFonts];
+ mapPtr->utfName = NULL;
+ mapPtr->nativeName = NULL;
+ mapPtr->faceNum = 0;
+
+ ckfree((char *) tmpFontNameMap);
+ ckfree((char *) encodings);
+
+ gFontNameMap = newFontNameMap;
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkpGetNativeFont --
+ *
+ * Map a platform-specific native font name to a TkFont.
+ *
+ * Results:
+ * The return value is a pointer to a TkFont that represents the
+ * native font. If a native font by the given name could not be
+ * found, the return value is NULL.
+ *
+ * Every call to this procedure returns a new TkFont structure,
+ * even if the name has already been seen before. The caller should
+ * call TkpDeleteFont() when the font is no longer needed.
+ *
+ * The caller is responsible for initializing the memory associated
+ * with the generic TkFont when this function returns and releasing
+ * the contents of the generics TkFont before calling TkpDeleteFont().
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+TkFont *
+TkpGetNativeFont(
+ Tk_Window tkwin, /* For display where font will be used. */
+ CONST char *name) /* Platform-specific font name. */
+{
+ SInt16 family;
+ MacFont *fontPtr;
+
+ if (strcmp(name, "system") == 0) {
+ family = GetSysFont();
+ } else if (strcmp(name, "application") == 0) {
+ family = GetAppFont();
+ } else {
+ return NULL;
+ }
+
+ fontPtr = (MacFont *) ckalloc(sizeof(MacFont));
+ InitFont(tkwin, family, 0, 0, fontPtr);
+
+ return (TkFont *) fontPtr;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkpGetFontFromAttributes --
+ *
+ * Given a desired set of attributes for a font, find a font with
+ * the closest matching attributes.
+ *
+ * Results:
+ * The return value is a pointer to a TkFont that represents the
+ * font with the desired attributes. If a font with the desired
+ * attributes could not be constructed, some other font will be
+ * substituted automatically.
+ *
+ * Every call to this procedure returns a new TkFont structure,
+ * even if the specified attributes have already been seen before.
+ * The caller should call TkpDeleteFont() to free the platform-
+ * specific data when the font is no longer needed.
+ *
+ * The caller is responsible for initializing the memory associated
+ * with the generic TkFont when this function returns and releasing
+ * the contents of the generic TkFont before calling TkpDeleteFont().
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+TkFont *
+TkpGetFontFromAttributes(
+ TkFont *tkFontPtr, /* If non-NULL, store the information in
+ * this existing TkFont structure, rather than
+ * allocating a new structure to hold the
+ * font; the existing contents of the font
+ * will be released. If NULL, a new TkFont
+ * structure is allocated. */
+ Tk_Window tkwin, /* For display where font will be used. */
+ CONST TkFontAttributes *faPtr)
+ /* Set of attributes to match. */
+{
+ short faceNum, style;
+ int i, j;
+ CONST char *faceName, *fallback;
+ char ***fallbacks;
+ MacFont *fontPtr;
+
+ /*
+ * Algorithm to get the closest font to the one requested.
+ *
+ * try fontname
+ * try all aliases for fontname
+ * foreach fallback for fontname
+ * try the fallback
+ * try all aliases for the fallback
+ */
+
+ faceNum = 0;
+ faceName = faPtr->family;
+ if (faceName != NULL) {
+ if (GetFamilyOrAliasNum(faceName, &faceNum) != 0) {
+ goto found;
+ }
+ fallbacks = TkFontGetFallbacks();
+ for (i = 0; fallbacks[i] != NULL; i++) {
+ for (j = 0; (fallback = fallbacks[i][j]) != NULL; j++) {
+ if (strcasecmp(faceName, fallback) == 0) {
+ for (j = 0; (fallback = fallbacks[i][j]) != NULL; j++) {
+ if (GetFamilyOrAliasNum(fallback, &faceNum)) {
+ goto found;
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ found:
+ style = 0;
+ if (faPtr->weight != TK_FW_NORMAL) {
+ style |= bold;
+ }
+ if (faPtr->slant != TK_FS_ROMAN) {
+ style |= italic;
+ }
+ if (faPtr->underline) {
+ style |= underline;
+ }
+ if (tkFontPtr == NULL) {
+ fontPtr = (MacFont *) ckalloc(sizeof(MacFont));
+ } else {
+ fontPtr = (MacFont *) tkFontPtr;
+ ReleaseFont(fontPtr);
+ }
+ InitFont(tkwin, faceNum, faPtr->size, style, fontPtr);
+
+ return (TkFont *) fontPtr;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkpDeleteFont --
+ *
+ * Called to release a font allocated by TkpGetNativeFont() or
+ * TkpGetFontFromAttributes(). The caller should have already
+ * released the fields of the TkFont that are used exclusively by
+ * the generic TkFont code.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * TkFont is deallocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkpDeleteFont(
+ TkFont *tkFontPtr) /* Token of font to be deleted. */
+{
+ MacFont *fontPtr;
+
+ fontPtr = (MacFont *) tkFontPtr;
+ ReleaseFont(fontPtr);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkpGetFontFamilies --
+ *
+ * Return information about the font families that are available
+ * on the display of the given window.
+ *
+ * Results:
+ * Modifies interp's result object to hold a list of all the available
+ * font families.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+TkpGetFontFamilies(
+ Tcl_Interp *interp, /* Interp to hold result. */
+ Tk_Window tkwin) /* For display to query. */
+{
+ FontNameMap *mapPtr;
+ Tcl_Obj *resultPtr, *strPtr;
+
+ resultPtr = Tcl_GetObjResult(interp);
+ for (mapPtr = gFontNameMap; mapPtr->utfName != NULL; mapPtr++) {
+ strPtr = Tcl_NewStringObj(mapPtr->utfName, -1);
+ Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
+ }
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * TkpGetSubFonts --
+ *
+ * A function used by the testing package for querying the actual
+ * screen fonts that make up a font object.
+ *
+ * Results:
+ * Modifies interp's result object to hold a list containing the
+ * names of the screen fonts that make up the given font object.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+TkpGetSubFonts(interp, tkfont)
+ Tcl_Interp *interp; /* Interp to hold result. */
+ Tk_Font tkfont; /* Font object to query. */
+{
+ int i;
+ Tcl_Obj *resultPtr, *strPtr;
+ MacFont *fontPtr;
+ FontFamily *familyPtr;
+ Str255 nativeName;
+
+ resultPtr = Tcl_GetObjResult(interp);
+ fontPtr = (MacFont *) tkfont;
+ for (i = 0; i < fontPtr->numSubFonts; i++) {
+ familyPtr = fontPtr->subFontArray[i].familyPtr;
+ GetFontName(familyPtr->faceNum, nativeName);
+ strPtr = Tcl_NewStringObj(GetUtfFaceName(nativeName), -1);
+ Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_MeasureChars --
+ *
+ * Determine the number of characters from the string that will fit
+ * in the given horizontal span. The measurement is done under the
+ * assumption that Tk_DrawChars() will be used to actually display
+ * the characters.
+ *
+ * Results:
+ * The return value is the number of bytes from source that
+ * fit into the span that extends from 0 to maxLength. *lengthPtr is
+ * filled with the x-coordinate of the right edge of the last
+ * character that did fit.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+int
+Tk_MeasureChars(
+ Tk_Font tkfont, /* Font in which characters will be drawn. */
+ CONST char *source, /* UTF-8 string to be displayed. Need not be
+ * '\0' terminated. */
+ int numBytes, /* Maximum number of bytes to consider
+ * from source string. */
+ int maxLength, /* If >= 0, maxLength specifies the longest
+ * permissible line length; don't consider any
+ * character that would cross this
+ * x-position. If < 0, then line length is
+ * unbounded and the flags argument is
+ * ignored. */
+ int flags, /* Various flag bits OR-ed together:
+ * TK_PARTIAL_OK means include the last char
+ * which only partially fit on this line.
+ * TK_WHOLE_WORDS means stop on a word
+ * boundary, if possible.
+ * TK_AT_LEAST_ONE means return at least one
+ * character even if no characters fit. */
+ int *lengthPtr) /* Filled with x-location just after the
+ * terminating character. */
+{
+ MacFont *fontPtr;
+ FontFamily *lastFamilyPtr;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ int curX, curByte;
+
+ /*
+ * According to "Inside Macintosh: Text", the Macintosh may
+ * automatically substitute
+ * ligatures or context-sensitive presentation forms when
+ * measuring/displaying text within a font run. We cannot safely
+ * measure individual characters and add up the widths w/o errors.
+ * However, if we convert a range of text from UTF-8 to, say,
+ * Shift-JIS, and get the offset into the Shift-JIS string as to
+ * where a word or line break would occur, then can we map that
+ * number back to UTF-8?
+ */
+
+ fontPtr = (MacFont *) tkfont;
+
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(gWorld, NULL);
+
+ TextSize(fontPtr->size);
+ TextFace(fontPtr->style);
+
+ lastFamilyPtr = fontPtr->subFontArray[0].familyPtr;
+
+ if (numBytes == 0) {
+ curX = 0;
+ curByte = 0;
+ } else if (maxLength < 0) {
+ CONST char *p, *end, *next;
+ Tcl_UniChar ch;
+ FontFamily *thisFamilyPtr;
+ Tcl_DString runString;
+
+ /*
+ * A three step process:
+ * 1. Find a contiguous range of characters that can all be
+ * represented by a single screen font.
+ * 2. Convert those chars to the encoding of that font.
+ * 3. Measure converted chars.
+ */
+
+ curX = 0;
+ end = source + numBytes;
+ for (p = source; p < end; ) {
+ next = p + Tcl_UtfToUniChar(p, &ch);
+ thisFamilyPtr = FindSubFontForChar(fontPtr, ch)->familyPtr;
+ if (thisFamilyPtr != lastFamilyPtr) {
+ TextFont(lastFamilyPtr->faceNum);
+ Tcl_UtfToExternalDString(lastFamilyPtr->encoding, source,
+ p - source, &runString);
+ curX += TextWidth(Tcl_DStringValue(&runString), 0,
+ Tcl_DStringLength(&runString));
+ Tcl_DStringFree(&runString);
+ lastFamilyPtr = thisFamilyPtr;
+ source = p;
+ }
+ p = next;
+ }
+ TextFont(lastFamilyPtr->faceNum);
+ Tcl_UtfToExternalDString(lastFamilyPtr->encoding, source, p - source,
+ &runString);
+ curX += TextWidth(Tcl_DStringValue(&runString), 0,
+ Tcl_DStringLength(&runString));
+ Tcl_DStringFree(&runString);
+ curByte = numBytes;
+ } else {
+ CONST char *p, *end, *next, *sourceOrig;
+ int widthLeft;
+ FontFamily *thisFamilyPtr;
+ Tcl_UniChar ch;
+ CONST char *rest = NULL;
+
+ /*
+ * How many chars will fit in the space allotted?
+ */
+
+ if (maxLength > 32767) {
+ maxLength = 32767;
+ }
+
+ widthLeft = maxLength;
+ sourceOrig = source;
+ end = source + numBytes;
+ for (p = source; p < end; p = next) {
+ next = p + Tcl_UtfToUniChar(p, &ch);
+ thisFamilyPtr = FindSubFontForChar(fontPtr, ch)->familyPtr;
+ if (thisFamilyPtr != lastFamilyPtr) {
+ if (p > source) {
+ rest = BreakLine(lastFamilyPtr, flags, source,
+ p - source, &widthLeft);
+ flags &= ~TK_AT_LEAST_ONE;
+ if (rest != NULL) {
+ p = source;
+ break;
+ }
+ }
+ lastFamilyPtr = thisFamilyPtr;
+ source = p;
+ }
+ }
+
+ if (p > source) {
+ rest = BreakLine(lastFamilyPtr, flags, source, p - source,
+ &widthLeft);
+ }
+
+ if (rest == NULL) {
+ curByte = numBytes;
+ } else {
+ curByte = rest - sourceOrig;
+ }
+ curX = maxLength - widthLeft;
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+
+ *lengthPtr = curX;
+ return curByte;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * BreakLine --
+ *
+ * Determine where the given line of text should be broken so that it
+ * fits in the specified range. Before calling this function, the
+ * font values and graphics port must be set.
+ *
+ * Results:
+ * The return value is NULL if the specified range is larger that the
+ * space the text needs, and *widthLeftPtr is filled with how much
+ * space is left in the range after measuring the whole text buffer.
+ * Otherwise, the return value is a pointer into the text buffer that
+ * indicates where the line should be broken (up to, but not including
+ * that character), and *widthLeftPtr is filled with how much space is
+ * left in the range after measuring up to that character.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static CONST char *
+BreakLine(
+ FontFamily *familyPtr, /* FontFamily that describes the font values
+ * that are already selected into the graphics
+ * port. */
+ int flags, /* Various flag bits OR-ed together:
+ * TK_PARTIAL_OK means include the last char
+ * which only partially fit on this line.
+ * TK_WHOLE_WORDS means stop on a word
+ * boundary, if possible.
+ * TK_AT_LEAST_ONE means return at least one
+ * character even if no characters fit. */
+ CONST char *source, /* UTF-8 string to be displayed. Need not be
+ * '\0' terminated. */
+ int numBytes, /* Maximum number of bytes to consider
+ * from source string. */
+ int *widthLeftPtr) /* On input, specifies size of range into
+ * which characters from source buffer should
+ * be fit. On output, filled with how much
+ * space is left after fitting as many
+ * characters as possible into the range.
+ * Result may be negative if TK_AT_LEAST_ONE
+ * was specified in the flags argument. */
+{
+ Fixed pixelWidth, widthLeft;
+ StyledLineBreakCode breakCode;
+ Tcl_DString runString;
+ long textOffset;
+ Boolean leadingEdge;
+ Point point;
+ int charOffset, thisCharWasDoubleByte;
+ char *p, *end, *typeTable;
+
+ TextFont(familyPtr->faceNum);
+ Tcl_UtfToExternalDString(familyPtr->encoding, source, numBytes,
+ &runString);
+ pixelWidth = Int2Fixed(*widthLeftPtr) + 1;
+ if (flags & TK_WHOLE_WORDS) {
+ textOffset = (flags & TK_AT_LEAST_ONE);
+ widthLeft = pixelWidth;
+ breakCode = StyledLineBreak(Tcl_DStringValue(&runString),
+ Tcl_DStringLength(&runString), 0, Tcl_DStringLength(&runString),
+ 0, &widthLeft, &textOffset);
+ if (breakCode != smBreakOverflow) {
+ /*
+ * StyledLineBreak includes all the space characters at the end of
+ * line that we want to suppress.
+ */
+
+ textOffset = VisibleLength(Tcl_DStringValue(&runString), textOffset);
+ goto getoffset;
+ }
+ } else {
+ point.v = 1;
+ point.h = 1;
+ textOffset = PixelToChar(Tcl_DStringValue(&runString),
+ Tcl_DStringLength(&runString), 0, pixelWidth, &leadingEdge,
+ &widthLeft, smOnlyStyleRun, point, point);
+ if (Fixed2Int(widthLeft) < 0) {
+ goto getoffset;
+ }
+ }
+ *widthLeftPtr = Fixed2Int(widthLeft);
+ Tcl_DStringFree(&runString);
+ return NULL;
+
+ /*
+ * The conversion routine that converts UTF-8 to the target encoding
+ * must map one UTF-8 character to exactly one encoding-specific
+ * character, so that the following algorithm works:
+ *
+ * 1. Get byte offset of where line should be broken.
+ * 2. Get char offset corresponding to that byte offset.
+ * 3. Map that char offset to byte offset in UTF-8 string.
+ */
+
+ getoffset:
+ thisCharWasDoubleByte = 0;
+ if (familyPtr->isMultiByteFont == 0) {
+ charOffset = textOffset;
+ } else {
+ charOffset = 0;
+ typeTable = familyPtr->typeTable;
+
+ p = Tcl_DStringValue(&runString);
+ end = p + textOffset;
+ thisCharWasDoubleByte = typeTable[*((unsigned char *) p)];
+ for ( ; p < end; p++) {
+ thisCharWasDoubleByte = typeTable[*((unsigned char *) p)];
+ p += thisCharWasDoubleByte;
+ charOffset++;
+ }
+ }
+
+ if ((flags & TK_WHOLE_WORDS) == 0) {
+ if ((flags & TK_PARTIAL_OK) && (leadingEdge != 0)) {
+ textOffset += thisCharWasDoubleByte;
+ textOffset++;
+ charOffset++;
+ } else if (((flags & TK_PARTIAL_OK) == 0) && (leadingEdge == 0)) {
+ textOffset -= thisCharWasDoubleByte;
+ textOffset--;
+ charOffset--;
+ }
+ }
+ if ((textOffset == 0) && (Tcl_DStringLength(&runString) > 0)
+ && (flags & TK_AT_LEAST_ONE)) {
+ p = Tcl_DStringValue(&runString);
+ textOffset += familyPtr->typeTable[*((unsigned char *) p)];
+ textOffset++;
+ charOffset++;
+ }
+ *widthLeftPtr = Fixed2Int(pixelWidth)
+ - TextWidth(Tcl_DStringValue(&runString), 0, textOffset);
+ Tcl_DStringFree(&runString);
+ return Tcl_UtfAtIndex(source, charOffset);
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * Tk_DrawChars --
+ *
+ * Draw a string of characters on the screen.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Information gets drawn on the screen.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+void
+Tk_DrawChars(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context for drawing characters. */
+ Tk_Font tkfont, /* Font in which characters will be drawn;
+ * must be the same as font used in GC. */
+ 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 numBytes, /* Number of bytes in string. */
+ int x, int y) /* Coordinates at which to place origin of
+ * string when drawing. */
+{
+ MacFont *fontPtr;
+ MacDrawable *macWin;
+ RGBColor macColor, origColor;
+ GWorldPtr destPort;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ short txFont, txFace, txSize;
+ BitMapPtr stippleMap;
+ Rect portRect;
+
+ fontPtr = (MacFont *) tkfont;
+ macWin = (MacDrawable *) drawable;
+
+ destPort = TkMacOSXGetDrawablePort(drawable);
+ GetPortBounds(destPort, &portRect);
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ TkMacOSXSetUpClippingRgn(drawable);
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ txFont = GetPortTextFont(destPort);
+ txFace = GetPortTextFace(destPort);
+ txSize = GetPortTextSize(destPort);
+ GetForeColor(&origColor);
+
+ if ((gc->fill_style == FillStippled
+ || gc->fill_style == FillOpaqueStippled)
+ && gc->stipple != None) {
+ Pixmap pixmap;
+ GWorldPtr bufferPort;
+ Pattern white;
+
+ stippleMap = TkMacOSXMakeStippleMap(drawable, gc->stipple);
+
+ pixmap = Tk_GetPixmap(display, drawable,
+ stippleMap->bounds.right, stippleMap->bounds.bottom, 0);
+
+ bufferPort = TkMacOSXGetDrawablePort(pixmap);
+ SetGWorld(bufferPort, NULL);
+
+ if (TkSetMacColor(gc->foreground, &macColor) == true) {
+ RGBForeColor(&macColor);
+ }
+ GetQDGlobalsWhite(&white);
+ ShowPen();
+ FillRect(&stippleMap->bounds, &white);
+ MultiFontDrawText(fontPtr, source, numBytes, 0, 0);
+ HidePen();
+
+ SetGWorld(destPort, NULL);
+ CopyDeepMask(GetPortBitMapForCopyBits(bufferPort), stippleMap,
+ GetPortBitMapForCopyBits(destPort), &stippleMap->bounds,
+ &stippleMap->bounds, &portRect,
+ srcOr, NULL);
+
+ /* TODO: this doesn't work quite right - it does a blend. you can't
+ * draw white text when you have a stipple.
+ */
+
+ Tk_FreePixmap(display, pixmap);
+ ckfree(stippleMap->baseAddr);
+ ckfree((char *)stippleMap);
+ } else {
+ if (TkSetMacColor(gc->foreground, &macColor) == true) {
+ RGBForeColor(&macColor);
+ }
+ ShowPen();
+ MultiFontDrawText(fontPtr, source, numBytes, macWin->xOff + x,
+ macWin->yOff + y);
+ HidePen();
+ }
+
+ TextFont(txFont);
+ TextSize(txSize);
+ TextFace(txFace);
+ RGBForeColor(&origColor);
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * MultiFontDrawText --
+ *
+ * Helper function for Tk_DrawChars. Draws characters, using the
+ * various screen fonts in fontPtr to draw multilingual characters.
+ * Note: No bidirectional support.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Information gets drawn on the screen.
+ * Contents of fontPtr may be modified if more subfonts were loaded
+ * in order to draw all the multilingual characters in the given
+ * string.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+MultiFontDrawText(
+ MacFont *fontPtr, /* Contains set of fonts to use when drawing
+ * following string. */
+ CONST char *source, /* Potentially multilingual UTF-8 string. */
+ int numBytes, /* Length of string in bytes. */
+ int x, int y) /* Coordinates at which to place origin *
+ * of string when drawing. */
+{
+ FontFamily *lastFamilyPtr, *thisFamilyPtr = NULL;
+ Tcl_DString runString;
+ CONST char *p, *end, *next;
+ Tcl_UniChar ch;
+
+ TextSize(fontPtr->size);
+ TextFace(fontPtr->style);
+
+ lastFamilyPtr = fontPtr->subFontArray[0].familyPtr;
+
+ end = source + numBytes;
+ for (p = source; p < end; ) {
+ next = p + Tcl_UtfToUniChar(p, &ch);
+ thisFamilyPtr = FindSubFontForChar(fontPtr, ch)->familyPtr;
+ if (thisFamilyPtr != lastFamilyPtr) {
+ if (p > source) {
+ TextFont(lastFamilyPtr->faceNum);
+ Tcl_UtfToExternalDString(lastFamilyPtr->encoding, source,
+ p - source, &runString);
+ MoveTo((short) x, (short) y);
+ DrawText(Tcl_DStringValue(&runString), 0,
+ Tcl_DStringLength(&runString));
+ x += TextWidth(Tcl_DStringValue(&runString), 0,
+ Tcl_DStringLength(&runString));
+ Tcl_DStringFree(&runString);
+ source = p;
+ }
+ lastFamilyPtr = thisFamilyPtr;
+ }
+ p = next;
+ }
+ if (p > source) {
+ TextFont(thisFamilyPtr->faceNum);
+ Tcl_UtfToExternalDString(lastFamilyPtr->encoding, source,
+ p - source, &runString);
+ MoveTo((short) x, (short) y);
+ DrawText(Tcl_DStringValue(&runString), 0,
+ Tcl_DStringLength(&runString));
+ Tcl_DStringFree(&runString);
+ }
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * TkMacOSXIsCharacterMissing --
+ *
+ * Given a tkFont and a character determines whether the character has
+ * a glyph defined in the font or not. Note that this is potentially
+ * not compatible with Mac OS 8 as it looks at the font handle
+ * structure directly. Looks into the character array of the font
+ * handle to determine whether the glyph is defined or not.
+ *
+ * Results:
+ * Returns a 1 if the character is missing, a 0 if it is not.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+int
+TkMacOSXIsCharacterMissing(
+ Tk_Font tkfont, /* The font we are looking in. */
+ unsigned int searchChar) /* The character we are looking for. */
+{
+/*
+ * For some reason, FMSwapFont always returns a NULL font handle under OS X
+ * Until we figure this one out, return 0;
+ */
+#ifdef MAC_OSX_TK
+ return 0;
+#else
+ MacFont *fontPtr = (MacFont *) tkfont;
+ FMInput fm;
+ FontRec **fontRecHandle;
+ FMOutPtr fmOutPtr;
+
+
+ fm.family = fontPtr->subFontArray[0].familyPtr->faceNum;
+ fm.size = fontPtr->size;
+ fm.face = fontPtr->style;
+ fm.needBits = 0;
+ fm.device = 0;
+ fm.numer.h = fm.numer.v = fm.denom.h = fm.denom.v = 1;
+
+ fmOutPtr=FMSwapFont(&fm);
+ fprintf(stderr,"fmOut %08x, handle %08x\n", (int)fmOutPtr, fmOutPtr->fontHandle);
+
+#if !defined(UNIVERSAL_INTERFACES_VERSION) || (UNIVERSAL_INTERFACES_VERSION < 0x0300)
+ fontRecHandle = (FontRec **) FMSwapFont(&fm)->fontResult;
+#else
+ fontRecHandle = (FontRec **) FMSwapFont(&fm)->fontHandle;
+#endif
+ return *(short *) ((long) &(*fontRecHandle)->owTLoc
+ + ((long)((*fontRecHandle)->owTLoc + searchChar
+ - (*fontRecHandle)->firstChar) * sizeof(short))) == -1;
+#endif
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * InitFont --
+ *
+ * Helper for TkpGetNativeFont() and TkpGetFontFromAttributes().
+ * Initializes the memory for a MacFont that wraps the platform-specific
+ * data.
+ *
+ * The caller is responsible for initializing the fields of the
+ * TkFont that are used exclusively by the generic TkFont code, and
+ * for releasing those fields before calling TkpDeleteFont().
+ *
+ * Results:
+ * Fills the MacFont structure.
+ *
+ * Side effects:
+ * Memory allocated.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+InitFont(
+ Tk_Window tkwin, /* For display where font will be used. */
+ int faceNum, /* Macintosh font number. */
+ int size, /* Point size for Macintosh font. */
+ int style, /* Macintosh style bits. */
+ MacFont *fontPtr) /* Filled with information constructed from
+ * the above arguments. */
+{
+ Str255 nativeName;
+ FontInfo fi;
+ TkFontAttributes *faPtr;
+ TkFontMetrics *fmPtr;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ short pixels;
+
+ if (size == 0) {
+ size = -GetDefFontSize();
+ }
+ pixels = (short) TkFontGetPixels(tkwin, size);
+
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(gWorld, NULL);
+ TextFont(faceNum);
+
+
+ TextSize(pixels);
+ TextFace(style);
+
+ GetFontInfo(&fi);
+ GetFontName(faceNum, nativeName);
+ fontPtr->font.fid = (Font) fontPtr;
+
+ faPtr = &fontPtr->font.fa;
+ faPtr->family = GetUtfFaceName(nativeName);
+ faPtr->size = TkFontGetPoints(tkwin, size);
+ faPtr->weight = (style & bold) ? TK_FW_BOLD : TK_FW_NORMAL;
+ faPtr->slant = (style & italic) ? TK_FS_ITALIC : TK_FS_ROMAN;
+ faPtr->underline = ((style & underline) != 0);
+ faPtr->overstrike = 0;
+
+ fmPtr = &fontPtr->font.fm;
+ fmPtr->ascent = fi.ascent;
+ fmPtr->descent = fi.descent;
+ fmPtr->maxWidth = fi.widMax;
+ fmPtr->fixed = (CharWidth('i') == CharWidth('w'));
+
+ fontPtr->size = pixels;
+ fontPtr->style = (short) style;
+
+ fontPtr->numSubFonts = 1;
+ fontPtr->subFontArray = fontPtr->staticSubFonts;
+ InitSubFont(fontPtr, faceNum, &fontPtr->subFontArray[0]);
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * ReleaseFont --
+ *
+ * Called to release the Macintosh-specific contents of a TkFont.
+ * The caller is responsible for freeing the memory used by the
+ * font itself.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory is freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+ReleaseFont(
+ MacFont *fontPtr) /* The font to delete. */
+{
+ int i;
+
+ for (i = 0; i < fontPtr->numSubFonts; i++) {
+ ReleaseSubFont(&fontPtr->subFontArray[i]);
+ }
+ if (fontPtr->subFontArray != fontPtr->staticSubFonts) {
+ ckfree((char *) fontPtr->subFontArray);
+ }
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * InitSubFont --
+ *
+ * Wrap a screen font and load the FontFamily that represents
+ * it. Used to prepare a SubFont so that characters can be mapped
+ * from UTF-8 to the charset of the font.
+ *
+ * Results:
+ * The subFontPtr is filled with information about the font.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+InitSubFont(
+ CONST MacFont *fontPtr, /* Font object in which the SubFont will be
+ * used. */
+ int faceNum, /* The font number. */
+ SubFont *subFontPtr) /* Filled with SubFont constructed from
+ * above attributes. */
+{
+ subFontPtr->familyPtr = AllocFontFamily(fontPtr, faceNum);
+ subFontPtr->fontMap = subFontPtr->familyPtr->fontMap;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * ReleaseSubFont --
+ *
+ * Called to release the contents of a SubFont. The caller is
+ * responsible for freeing the memory used by the SubFont itself.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory and resources are freed.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static void
+ReleaseSubFont(
+ SubFont *subFontPtr) /* The SubFont to delete. */
+{
+ FreeFontFamily(subFontPtr->familyPtr);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * AllocFontFamily --
+ *
+ * Find the FontFamily structure associated with the given font
+ * family. The information should be stored by the caller in a
+ * SubFont and used when determining if that SubFont supports a
+ * character.
+ *
+ * Results:
+ * A pointer to a FontFamily. The reference count in the FontFamily
+ * is automatically incremented. When the SubFont is released, the
+ * reference count is decremented. When no SubFont is using this
+ * FontFamily, it may be deleted.
+ *
+ * Side effects:
+ * A new FontFamily structure will be allocated if this font family
+ * has not been seen.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static FontFamily *
+AllocFontFamily(
+ CONST MacFont *fontPtr, /* Font object in which the FontFamily will
+ * be used. */
+ int faceNum) /* The font number. */
+{
+ FontFamily *familyPtr;
+ int i;
+
+ familyPtr = fontFamilyList;
+ for (; familyPtr != NULL; familyPtr = familyPtr->nextPtr) {
+ if (familyPtr->faceNum == faceNum) {
+ familyPtr->refCount++;
+ return familyPtr;
+ }
+ }
+
+ familyPtr = (FontFamily *) ckalloc(sizeof(FontFamily));
+ memset(familyPtr, 0, sizeof(FontFamily));
+ familyPtr->nextPtr = fontFamilyList;
+ fontFamilyList = familyPtr;
+
+ /*
+ * Set key for this FontFamily.
+ */
+
+ familyPtr->faceNum = faceNum;
+
+ /*
+ * An initial refCount of 2 means that FontFamily information will
+ * persist even when the SubFont that loaded the FontFamily is released.
+ * Change it to 1 to cause FontFamilies to be unloaded when not in use.
+ */
+
+ familyPtr->refCount = 2;
+ familyPtr->encoding = GetFontEncoding(faceNum, 1, &familyPtr->isSymbolFont);
+ familyPtr->isMultiByteFont = 0;
+ FillParseTable(familyPtr->typeTable, FontToScript(faceNum));
+ for (i = 0; i < 256; i++) {
+ if (familyPtr->typeTable[i] != 0) {
+ familyPtr->isMultiByteFont = 1;
+ break;
+ }
+ }
+ return familyPtr;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FreeFontFamily --
+ *
+ * Called to free a FontFamily when the SubFont is finished using it.
+ * Frees the contents of the FontFamily and the memory used by the
+ * FontFamily itself.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+FreeFontFamily(
+ FontFamily *familyPtr) /* The FontFamily to delete. */
+{
+ FontFamily **familyPtrPtr;
+ int i;
+
+ if (familyPtr == NULL) {
+ return;
+ }
+ familyPtr->refCount--;
+ if (familyPtr->refCount > 0) {
+ return;
+ }
+ Tcl_FreeEncoding(familyPtr->encoding);
+ for (i = 0; i < FONTMAP_PAGES; i++) {
+ if (familyPtr->fontMap[i] != NULL) {
+ ckfree((char *) familyPtr->fontMap[i]);
+ }
+ }
+
+ /*
+ * Delete from list.
+ */
+
+ for (familyPtrPtr = &fontFamilyList; ; ) {
+ if (*familyPtrPtr == familyPtr) {
+ *familyPtrPtr = familyPtr->nextPtr;
+ break;
+ }
+ familyPtrPtr = &(*familyPtrPtr)->nextPtr;
+ }
+
+ ckfree((char *) familyPtr);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FindSubFontForChar --
+ *
+ * Determine which physical screen font is necessary to use to
+ * display the given character. If the font object does not have
+ * a screen font that can display the character, another screen font
+ * may be loaded into the font object, following a set of preferred
+ * fallback rules.
+ *
+ * Results:
+ * The return value is the SubFont to use to display the given
+ * character.
+ *
+ * Side effects:
+ * The contents of fontPtr are modified to cache the results
+ * of the lookup and remember any SubFonts that were dynamically
+ * loaded.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static SubFont *
+FindSubFontForChar(
+ MacFont *fontPtr, /* The font object with which the character
+ * will be displayed. */
+ int ch) /* The Unicode character to be displayed. */
+{
+ int i, j, k;
+ CONST char *fallbackName;
+ char **aliases;
+ SubFont *subFontPtr;
+ FontNameMap *mapPtr;
+ Tcl_DString faceNames;
+ char ***fontFallbacks;
+ char **anyFallbacks;
+
+ if (FontMapLookup(&fontPtr->subFontArray[0], ch)) {
+ return &fontPtr->subFontArray[0];
+ }
+
+ for (i = 1; i < fontPtr->numSubFonts; i++) {
+ if (FontMapLookup(&fontPtr->subFontArray[i], ch)) {
+ return &fontPtr->subFontArray[i];
+ }
+ }
+
+ /*
+ * Keep track of all face names that we check, so we don't check some
+ * name multiple times if it can be reached by multiple paths.
+ */
+
+ Tcl_DStringInit(&faceNames);
+
+ aliases = TkFontGetAliasList(fontPtr->font.fa.family);
+
+ subFontPtr = NULL;
+ fontFallbacks = TkFontGetFallbacks();
+ for (i = 0; fontFallbacks[i] != NULL; i++) {
+ for (j = 0; fontFallbacks[i][j] != NULL; j++) {
+ fallbackName = fontFallbacks[i][j];
+ if (strcasecmp(fallbackName, fontPtr->font.fa.family) == 0) {
+ /*
+ * If the base font has a fallback...
+ */
+
+ goto tryfallbacks;
+ } else if (aliases != NULL) {
+ /*
+ * Or if an alias for the base font has a fallback...
+ */
+
+ for (k = 0; aliases[k] != NULL; k++) {
+ if (strcasecmp(aliases[k], fallbackName) == 0) {
+ goto tryfallbacks;
+ }
+ }
+ }
+ }
+ continue;
+
+ /*
+ * ...then see if we can use one of the fallbacks, or an
+ * alias for one of the fallbacks.
+ */
+
+ tryfallbacks:
+ for (j = 0; fontFallbacks[i][j] != NULL; j++) {
+ fallbackName = fontFallbacks[i][j];
+ subFontPtr = CanUseFallbackWithAliases(fontPtr, fallbackName,
+ ch, &faceNames);
+ if (subFontPtr != NULL) {
+ goto end;
+ }
+ }
+ }
+
+ /*
+ * See if we can use something from the global fallback list.
+ */
+
+ anyFallbacks = TkFontGetGlobalClass();
+ for (i = 0; anyFallbacks[i] != NULL; i++) {
+ fallbackName = anyFallbacks[i];
+ subFontPtr = CanUseFallbackWithAliases(fontPtr, fallbackName, ch,
+ &faceNames);
+ if (subFontPtr != NULL) {
+ goto end;
+ }
+ }
+
+ /*
+ * Try all face names available in the whole system until we
+ * find one that can be used.
+ */
+
+ for (mapPtr = gFontNameMap; mapPtr->utfName != NULL; mapPtr++) {
+ fallbackName = mapPtr->utfName;
+ if (SeenName(fallbackName, &faceNames) == 0) {
+ subFontPtr = CanUseFallback(fontPtr, fallbackName, ch);
+ if (subFontPtr != NULL) {
+ goto end;
+ }
+ }
+ }
+
+ end:
+ Tcl_DStringFree(&faceNames);
+
+ if (subFontPtr == NULL) {
+ /*
+ * No font can display this character. We will use the base font
+ * and have it display the "unknown" character.
+ */
+
+ subFontPtr = &fontPtr->subFontArray[0];
+ FontMapInsert(subFontPtr, ch);
+ }
+ return subFontPtr;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FontMapLookup --
+ *
+ * See if the screen font can display the given character.
+ *
+ * Results:
+ * The return value is 0 if the screen font cannot display the
+ * character, non-zero otherwise.
+ *
+ * Side effects:
+ * New pages are added to the font mapping cache whenever the
+ * character belongs to a page that hasn't been seen before.
+ * When a page is loaded, information about all the characters on
+ * that page is stored, not just for the single character in
+ * question.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+FontMapLookup(
+ SubFont *subFontPtr, /* Contains font mapping cache to be queried
+ * and possibly updated. */
+ int ch) /* Character to be tested. */
+{
+ int row, bitOffset;
+
+ row = ch >> FONTMAP_SHIFT;
+ if (subFontPtr->fontMap[row] == NULL) {
+ FontMapLoadPage(subFontPtr, row);
+ }
+ bitOffset = ch & (FONTMAP_BITSPERPAGE - 1);
+ return (subFontPtr->fontMap[row][bitOffset >> 3] >> (bitOffset & 7)) & 1;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FontMapInsert --
+ *
+ * Tell the font mapping cache that the given screen font should be
+ * used to display the specified character. This is called when no
+ * font on the system can be be found that can display that
+ * character; we lie to the font and tell it that it can display
+ * the character, otherwise we would end up re-searching the entire
+ * fallback hierarchy every time that character was seen.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * New pages are added to the font mapping cache whenever the
+ * character belongs to a page that hasn't been seen before.
+ * When a page is loaded, information about all the characters on
+ * that page is stored, not just for the single character in
+ * question.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+FontMapInsert(
+ SubFont *subFontPtr, /* Contains font mapping cache to be
+ * updated. */
+ int ch) /* Character to be added to cache. */
+{
+ int row, bitOffset;
+
+ row = ch >> FONTMAP_SHIFT;
+ if (subFontPtr->fontMap[row] == NULL) {
+ FontMapLoadPage(subFontPtr, row);
+ }
+ bitOffset = ch & (FONTMAP_BITSPERPAGE - 1);
+ subFontPtr->fontMap[row][bitOffset >> 3] |= 1 << (bitOffset & 7);
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * FontMapLoadPage --
+ *
+ * Load information about all the characters on a given page.
+ * This information consists of one bit per character that indicates
+ * whether the associated HFONT can (1) or cannot (0) display the
+ * characters on the page.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Mempry allocated.
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+FontMapLoadPage(
+ SubFont *subFontPtr, /* Contains font mapping cache to be
+ * updated. */
+ int row) /* Index of the page to be loaded into
+ * the cache. */
+{
+ FMInput fm;
+ FMOutPtr fmOut;
+ int i, end, bitOffset, isMultiByteFont;
+ char src[TCL_UTF_MAX];
+ unsigned char buf[16];
+ int srcRead, dstWrote;
+ Tcl_Encoding encoding;
+ Handle fHandle = NULL;
+
+ subFontPtr->fontMap[row] = (char *) ckalloc(FONTMAP_BITSPERPAGE / 8);
+ memset(subFontPtr->fontMap[row], 0, FONTMAP_BITSPERPAGE / 8);
+
+ encoding = subFontPtr->familyPtr->encoding;
+
+ fm.family = subFontPtr->familyPtr->faceNum;
+ fm.size = 12;
+ fm.face = 0;
+ fm.needBits = 0;
+ fm.device = 0;
+ fm.numer.h = 1;
+ fm.numer.v = 1;
+ fm.denom.h = 1;
+ fm.denom.v = 1;
+ /*
+#if !defined(UNIVERSAL_INTERFACES_VERSION) || (UNIVERSAL_INTERFACES_VERSION < 0x0300)
+ fHandle = FMSwapFont(&fm)->fontHandle;
+#else
+ fHandle = FMSwapFont(&fm)->fontHandle;
+#endif
+*/
+/*
+ * For some reason, FMSwapFont alywas returns a structure where the returned font handle
+ * is NULL. Until we figure this one out, assume all characters are allowed
+ */
+ fmOut=FMSwapFont(&fm);
+ fHandle=fmOut->fontHandle;
+ isMultiByteFont=subFontPtr->familyPtr->isMultiByteFont;
+#ifndef MAC_OSX_TK
+ GetResInfo(fHandle, &theID, &theType, theName);
+ fprintf ( stderr, "ResError() %d, %x\n", ResError (), fHandle );
+ if (theType=='sfnt') {
+#endif
+ /*
+ * Found an outline font which has very complex font record.
+ * Let's just assume *ALL* the characters are allowed.
+ */
+
+ end = (row + 1) << FONTMAP_SHIFT;
+ for (i = row << FONTMAP_SHIFT; i < end; i++) {
+ if (Tcl_UtfToExternal(NULL, encoding, src, Tcl_UniCharToUtf(i,
+ src),
+ TCL_ENCODING_STOPONERROR, NULL, (char *) buf,
+ sizeof(buf),
+ &srcRead, &dstWrote, NULL) == TCL_OK) {
+ bitOffset = i & (FONTMAP_BITSPERPAGE - 1);
+ subFontPtr->fontMap[row][bitOffset >> 3] |= 1
+ << (bitOffset & 7);
+ }
+ }
+#ifndef MAC_OSX_TK
+ } else {
+ /*
+ * Found an old bitmap font which has a well-defined record.
+ * We can check the width table to see which characters exist.
+ */
+
+ fontRecPtr = *((FontRec **) fHandle );
+ widths = (short *) ((long) &fontRecPtr->owTLoc
+ + ((long) (fontRecPtr->owTLoc - fontRecPtr->firstChar)
+ * sizeof(short)));
+
+ end = (row + 1) << FONTMAP_SHIFT;
+ for (i = row << FONTMAP_SHIFT; i < end; i++) {
+ if (Tcl_UtfToExternal(NULL, encoding, src,
+ Tcl_UniCharToUtf(i, src),
+ TCL_ENCODING_STOPONERROR, NULL, (char *) buf, sizeof(buf),
+ &srcRead, &dstWrote, NULL) == TCL_OK) {
+
+ if (((isMultiByteFont != 0) && (buf[0] > 31))
+ || (widths[buf[0]] != -1)) {
+ if ((buf[0] == 0x11) && (widths[0x12] == -1)) {
+ continue;
+ }
+
+ /*
+ * Mac's char existence metrics are only for one-byte
+ * characters. If we have a double-byte char, just
+ * assume that the font supports that char if the font's
+ * encoding supports that char.
+ */
+
+ bitOffset = i & (FONTMAP_BITSPERPAGE - 1);
+ subFontPtr->fontMap[row][bitOffset >> 3] |= 1
+ << (bitOffset & 7);
+ }
+ }
+ }
+ }
+#endif
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * CanUseFallbackWithAliases --
+ *
+ * Helper function for FindSubFontForChar. Determine if the
+ * specified face name (or an alias of the specified face name)
+ * can be used to construct a screen font that can display the
+ * given character.
+ *
+ * Results:
+ * See CanUseFallback().
+ *
+ * Side effects:
+ * If the name and/or one of its aliases was rejected, the
+ * rejected string is recorded in nameTriedPtr so that it won't
+ * be tried again.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static SubFont *
+CanUseFallbackWithAliases(
+ MacFont *fontPtr, /* The font object that will own the new
+ * screen font. */
+ CONST char *faceName, /* Desired face name for new screen font. */
+ int ch, /* The Unicode character that the new
+ * screen font must be able to display. */
+ Tcl_DString *nameTriedPtr) /* Records face names that have already
+ * been tried. It is possible for the same
+ * face name to be queried multiple times when
+ * trying to find a suitable screen font. */
+{
+ SubFont *subFontPtr;
+ char **aliases;
+ int i;
+
+ if (SeenName(faceName, nameTriedPtr) == 0) {
+ subFontPtr = CanUseFallback(fontPtr, faceName, ch);
+ if (subFontPtr != NULL) {
+ return subFontPtr;
+ }
+ }
+ aliases = TkFontGetAliasList(faceName);
+ if (aliases != NULL) {
+ for (i = 0; aliases[i] != NULL; i++) {
+ if (SeenName(aliases[i], nameTriedPtr) == 0) {
+ subFontPtr = CanUseFallback(fontPtr, aliases[i], ch);
+ if (subFontPtr != NULL) {
+ return subFontPtr;
+ }
+ }
+ }
+ }
+ return NULL;
+}
+
+/*
+ *---------------------------------------------------------------------------
+ *
+ * SeenName --
+ *
+ * Used to determine we have already tried and rejected the given
+ * face name when looking for a screen font that can support some
+ * Unicode character.
+ *
+ * Results:
+ * The return value is 0 if this face name has not already been seen,
+ * non-zero otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *---------------------------------------------------------------------------
+ */
+
+static int
+SeenName(
+ CONST char *name, /* The name to check. */
+ Tcl_DString *dsPtr) /* Contains names that have already been
+ * seen. */
+{
+ CONST char *seen, *end;
+
+ seen = Tcl_DStringValue(dsPtr);
+ end = seen + Tcl_DStringLength(dsPtr);
+ while (seen < end) {
+ if (strcasecmp(seen, name) == 0) {
+ return 1;
+ }
+ seen += strlen(seen) + 1;
+ }
+ Tcl_DStringAppend(dsPtr, (char *) name, (int) (strlen(name) + 1));
+ return 0;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * CanUseFallback --
+ *
+ * If the specified physical screen font has not already been loaded
+ * into the font object, determine if the specified physical screen
+ * font can display the given character.
+ *
+ * Results:
+ * The return value is a pointer to a newly allocated SubFont, owned
+ * by the font object. This SubFont can be used to display the given
+ * character. The SubFont represents the screen font with the base set
+ * of font attributes from the font object, but using the specified
+ * font name. NULL is returned if the font object already holds
+ * a reference to the specified physical font or if the specified
+ * physical font cannot display the given character.
+ *
+ * Side effects:
+ * The font object's subFontArray is updated to contain a reference
+ * to the newly allocated SubFont.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static SubFont *
+CanUseFallback(
+ MacFont *fontPtr, /* The font object that will own the new
+ * screen font. */
+ CONST char *faceName, /* Desired face name for new screen font. */
+ int ch) /* The Unicode character that the new
+ * screen font must be able to display. */
+{
+ int i;
+ SubFont subFont;
+ short faceNum;
+
+ if (GetFamilyNum(faceName, &faceNum) == 0) {
+ return NULL;
+ }
+
+ /*
+ * Skip all fonts we've already used.
+ */
+
+ for (i = 0; i < fontPtr->numSubFonts; i++) {
+ if (faceNum == fontPtr->subFontArray[i].familyPtr->faceNum) {
+ return NULL;
+ }
+ }
+
+ /*
+ * Load this font and see if it has the desired character.
+ */
+
+ InitSubFont(fontPtr, faceNum, &subFont);
+ if (((ch < 256) && (subFont.familyPtr->isSymbolFont))
+ || (FontMapLookup(&subFont, ch) == 0)) {
+ ReleaseSubFont(&subFont);
+ return NULL;
+ }
+
+ if (fontPtr->numSubFonts >= SUBFONT_SPACE) {
+ SubFont *newPtr;
+ newPtr = (SubFont *) ckalloc(sizeof(SubFont)
+ * (fontPtr->numSubFonts + 1));
+ memcpy((char *) newPtr, fontPtr->subFontArray,
+ fontPtr->numSubFonts * sizeof(SubFont));
+ if (fontPtr->subFontArray != fontPtr->staticSubFonts) {
+ ckfree((char *) fontPtr->subFontArray);
+ }
+ fontPtr->subFontArray = newPtr;
+ }
+ fontPtr->subFontArray[fontPtr->numSubFonts] = subFont;
+ fontPtr->numSubFonts++;
+ return &fontPtr->subFontArray[fontPtr->numSubFonts - 1];
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * GetFamilyNum --
+ *
+ * Determines if any physical screen font exists on the system with
+ * the given family name. If the family exists, then it should be
+ * possible to construct some physical screen font with that family
+ * name.
+ *
+ * Results:
+ * The return value is 0 if the specified font family does not exist,
+ * non-zero otherwise. *faceNumPtr is filled with the unique face
+ * number that identifies the screen font, or 0 if the font family
+ * did not exist.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+GetFamilyNum(
+ CONST char *faceName, /* UTF-8 name of font family to query. */
+ short *faceNumPtr) /* Filled with font number for above family. */
+{
+ FontNameMap *mapPtr;
+
+ if (faceName != NULL) {
+ for (mapPtr = gFontNameMap; mapPtr->utfName != NULL; mapPtr++) {
+ if (strcasecmp(faceName, mapPtr->utfName) == 0) {
+ *faceNumPtr = mapPtr->faceNum;
+ return 1;
+ }
+ }
+ }
+ *faceNumPtr = 0;
+ return 0;
+}
+
+static int
+GetFamilyOrAliasNum(
+ CONST char *faceName, /* UTF-8 name of font family to query. */
+ short *faceNumPtr) /* Filled with font number for above family. */
+{
+ char **aliases;
+ int i;
+
+ if (GetFamilyNum(faceName, faceNumPtr) != 0) {
+ return 1;
+ }
+ aliases = TkFontGetAliasList(faceName);
+ if (aliases != NULL) {
+ for (i = 0; aliases[i] != NULL; i++) {
+ if (GetFamilyNum(aliases[i], faceNumPtr) != 0) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * GetUtfFaceName --
+ *
+ * Given the native name for a Macintosh font (in which the name of
+ * the font is in the encoding of the font itself), return the UTF-8
+ * name that corresponds to that font. The specified font name must
+ * refer to a font that actually exists on the machine.
+ *
+ * This function is used to obtain the UTF-8 name when querying the
+ * properties of a Macintosh font object.
+ *
+ * Results:
+ * The return value is a pointer to the UTF-8 of the specified font.
+ *
+ * Side effects:
+ * None.
+ *
+ *------------------------------------------------------------------------
+ */
+
+static Tk_Uid
+GetUtfFaceName(
+ StringPtr nativeName) /* Pascal name for font in native encoding. */
+{
+ FontNameMap *mapPtr;
+
+ for (mapPtr = gFontNameMap; mapPtr->utfName != NULL; mapPtr++) {
+ if (pstrcmp(nativeName, mapPtr->nativeName) == 0) {
+ return mapPtr->utfName;
+ }
+ }
+ panic("GetUtfFaceName: unexpected nativeName");
+ return NULL;
+}
+
+/*
+ *------------------------------------------------------------------------
+ *
+ * GetFontEncoding --
+ *
+ * Return a string that can be passed to Tcl_GetTextEncoding() and
+ * used to convert bytes from UTF-8 into the encoding of the
+ * specified font.
+ *
+ * The desired encoding to use to convert the name of a symbolic
+ * font into UTF-8 is macRoman, while the desired encoding to use
+ * to convert bytes in a symbolic font to UTF-8 is the corresponding
+ * symbolic encoding. Due to this dual interpretatation of symbolic
+ * fonts, the caller can specify what type of encoding to return
+ * should the specified font be symbolic.
+ *
+ * Results:
+ * The return value is a string that specifies the font's encoding.
+ * If the font's encoding could not be identified, NULL is returned.
+ *
+ * Side effects:
+ * None.
+ *
+ *------------------------------------------------------------------------
+ */
+
+static Tcl_Encoding
+GetFontEncoding(
+ int faceNum, /* Macintosh font number. */
+ int allowSymbol, /* If non-zero, then the encoding string
+ * for symbol fonts will be the corresponding
+ * symbol encoding. Otherwise, the encoding
+ * string for symbol fonts will be
+ * "macRoman". */
+ int *isSymbolPtr) /* Filled with non-zero if this font is a
+ * symbol font, 0 otherwise. */
+{
+ Str255 faceName;
+ int script, lang;
+ char *name;
+
+ if (allowSymbol != 0) {
+ GetFontName(faceNum, faceName);
+ if (pstrcasecmp(faceName, "\psymbol") == 0) {
+ *isSymbolPtr = 1;
+ return Tcl_GetEncoding(NULL, "symbol");
+ }
+ if (pstrcasecmp(faceName, "\pzapf dingbats") == 0) {
+ *isSymbolPtr = 1;
+ return Tcl_GetEncoding(NULL, "macDingbats");
+ }
+ }
+ *isSymbolPtr = 0;
+ script = FontToScript(faceNum);
+ lang = GetScriptVariable(script, smScriptLang);
+ name = NULL;
+ if (script == smRoman) {
+ name = TkFindStateString(romanMap, lang);
+ } else if (script == smCyrillic) {
+ name = TkFindStateString(cyrillicMap, lang);
+ }
+ if (name == NULL) {
+ name = TkFindStateString(scriptMap, script);
+ }
+ return Tcl_GetEncoding(NULL, name);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitControlFontStyle --
+ *
+ * This procedure sets up the appropriate ControlFontStyleRec
+ * for a Mac control.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInitControlFontStyle(Tk_Font tkfont, ControlFontStylePtr fsPtr)
+{
+ MacFont *fontPtr;
+ FontFamily *lastFamilyPtr;
+ fontPtr = (MacFont *) tkfont;
+ lastFamilyPtr = fontPtr->subFontArray[0].familyPtr;
+ fsPtr->flags =
+ kControlUseFontMask|
+ kControlUseSizeMask|
+ kControlUseFaceMask|
+ kControlUseJustMask;
+ fsPtr->font = lastFamilyPtr->faceNum;
+ fsPtr->size = fontPtr->size;
+ fsPtr->style = fontPtr->style;
+ fsPtr->just = teCenter;
+}
diff --git a/tk/macosx/tkMacOSXHLEvents.c b/tk/macosx/tkMacOSXHLEvents.c
new file mode 100644
index 00000000000..5c04014358d
--- /dev/null
+++ b/tk/macosx/tkMacOSXHLEvents.c
@@ -0,0 +1,447 @@
+/*
+ * tkMacOSXHLEvents.c --
+ *
+ * Implements high level event support for the Macintosh. Currently,
+ * the only event that really does anything is the Quit event.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkMacOSXUtil.h"
+#include "tkMacOSXInt.h"
+
+#include <Carbon/Carbon.h>
+
+/*
+ * This is a Tcl_Event structure that the Quit AppleEvent handler
+ * uses to schedule the tkReallyKillMe function.
+ */
+
+typedef struct KillEvent {
+ Tcl_Event header; /* Information that is standard for
+ * all events. */
+ Tcl_Interp *interp; /* Interp that was passed to the
+ * Quit AppleEvent */
+} KillEvent;
+
+/*
+ * Static functions used only in this file.
+ */
+
+static OSErr QuitHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon);
+static OSErr OappHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon);
+static OSErr OdocHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon);
+static OSErr PrintHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon);
+static OSErr ScriptHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon);
+static OSErr PrefsHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon);
+
+static int MissedAnyParameters _ANSI_ARGS_((const AppleEvent *theEvent));
+static int ReallyKillMe _ANSI_ARGS_((Tcl_Event *eventPtr, int flags));
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitAppleEvents --
+ *
+ * Initilize the Apple Events on the Macintosh. This registers the
+ * core event handlers.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInitAppleEvents(
+ Tcl_Interp *interp) /* Interp to handle basic events. */
+{
+ OSErr err;
+ AEEventHandlerUPP OappHandlerUPP, OdocHandlerUPP,
+ PrintHandlerUPP, QuitHandlerUPP, ScriptHandlerUPP,
+ PrefsHandlerUPP;
+
+ /*
+ * Install event handlers for the core apple events.
+ */
+ QuitHandlerUPP = NewAEEventHandlerUPP(QuitHandler);
+ err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
+ QuitHandlerUPP, (long) interp, false);
+
+ OappHandlerUPP = NewAEEventHandlerUPP(OappHandler);
+ err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
+ OappHandlerUPP, (long) interp, false);
+
+ OdocHandlerUPP = NewAEEventHandlerUPP(OdocHandler);
+ err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
+ OdocHandlerUPP, (long) interp, false);
+
+ PrintHandlerUPP = NewAEEventHandlerUPP(PrintHandler);
+ err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
+ PrintHandlerUPP, (long) interp, false);
+
+ PrefsHandlerUPP = NewAEEventHandlerUPP(PrefsHandler);
+ err = AEInstallEventHandler(kCoreEventClass, kAEShowPreferences,
+ PrefsHandlerUPP, (long) interp, false);
+
+ if (interp != NULL) {
+ ScriptHandlerUPP = NewAEEventHandlerUPP(ScriptHandler);
+ err = AEInstallEventHandler('misc', 'dosc',
+ ScriptHandlerUPP, (long) interp, false);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDoHLEvent --
+ *
+ * Dispatch incomming highlevel events.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Depends on the incoming event.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXDoHLEvent(EventRecord *theEvent)
+{
+ return AEProcessAppleEvent(theEvent);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * QuitHandler, OappHandler, etc. --
+ *
+ * These are the core Apple event handlers. Only the Quit event does
+ * anything interesting.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+OSErr QuitHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon)
+{
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ KillEvent *eventPtr;
+
+ /*
+ * Call the exit command from the event loop, since you are not supposed
+ * to call ExitToShell in an Apple Event Handler. We put this at the head
+ * of Tcl's event queue because this message usually comes when the Mac is
+ * shutting down, and we want to kill the shell as quickly as possible.
+ */
+
+ eventPtr = (KillEvent *) ckalloc(sizeof(KillEvent));
+ eventPtr->header.proc = ReallyKillMe;
+ eventPtr->interp = interp;
+
+ Tcl_QueueEvent((Tcl_Event *) eventPtr, TCL_QUEUE_HEAD);
+
+ return noErr;
+}
+
+static OSErr
+OappHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon)
+{
+ return noErr;
+}
+
+/* Called when the user selects 'Preferences...' in MacOS X */
+static OSErr
+PrefsHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon)
+{
+ Tcl_CmdInfo dummy;
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ /*
+ * Don't bother if we don't have an interp or
+ * the show preferences procedure doesn't exist.
+ */
+
+ if ((interp == NULL) ||
+ (Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)) == 0) {
+ return noErr;
+ }
+ Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences");
+ return noErr;
+}
+
+static OSErr
+OdocHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon)
+{
+ Tcl_Interp *interp = (Tcl_Interp *) handlerRefcon;
+ AEDescList fileSpecList;
+ FSSpec file;
+ OSErr err;
+ DescType type;
+ Size actual;
+ long count;
+ AEKeyword keyword;
+ long index;
+ Tcl_DString command;
+ Tcl_DString pathName;
+ Tcl_CmdInfo dummy;
+
+ /*
+ * Don't bother if we don't have an interp or
+ * the open document procedure doesn't exist.
+ */
+
+ if ((interp == NULL) ||
+ (Tcl_GetCommandInfo(interp, "::tk::mac::OpenDocument", &dummy)) == 0) {
+ return noErr;
+ }
+
+ /*
+ * If we get any errors wil retrieving our parameters
+ * we just return with no error.
+ */
+
+ err = AEGetParamDesc(event, keyDirectObject,
+ typeAEList, &fileSpecList);
+ if (err != noErr) {
+ return noErr;
+ }
+
+ err = MissedAnyParameters(event);
+ if (err != noErr) {
+ return noErr;
+ }
+
+ err = AECountItems(&fileSpecList, &count);
+ if (err != noErr) {
+ return noErr;
+ }
+
+ Tcl_DStringInit(&command);
+ Tcl_DStringAppend(&command, "::tk::mac::OpenDocument", -1);
+ for (index = 1; index <= count; index++) {
+ int length;
+ Handle fullPath;
+
+ err = AEGetNthPtr(&fileSpecList, index, typeFSS,
+ &keyword, &type, (Ptr) &file, sizeof(FSSpec), &actual);
+ if ( err != noErr ) {
+ continue;
+ }
+
+ err = FSpPathFromLocation(&file, &length, &fullPath);
+ HLock(fullPath);
+ Tcl_ExternalToUtfDString(NULL, *fullPath, length, &pathName);
+ HUnlock(fullPath);
+ DisposeHandle(fullPath);
+
+ Tcl_DStringAppendElement(&command, Tcl_DStringValue(&pathName));
+ Tcl_DStringFree(&pathName);
+ }
+
+ Tcl_GlobalEval(interp, Tcl_DStringValue(&command));
+
+ Tcl_DStringFree(&command);
+ return noErr;
+}
+
+static OSErr
+PrintHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon)
+{
+ return noErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ScriptHandler --
+ *
+ * This handler process the script event.
+ *
+ * Results:
+ * Schedules the given event to be processed.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static OSErr
+ScriptHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon)
+{
+ OSErr theErr;
+ AEDescList theDesc;
+ int tclErr = -1;
+ Tcl_Interp *interp;
+ char errString[128];
+
+ interp = (Tcl_Interp *) handlerRefcon;
+
+ /*
+ * The do script event receives one parameter that should be data or a file.
+ */
+ theErr = AEGetParamDesc(event, keyDirectObject, typeWildCard,
+ &theDesc);
+ if (theErr != noErr) {
+ sprintf(errString, "AEDoScriptHandler: GetParamDesc error %d", theErr);
+ theErr = AEPutParamPtr(reply, keyErrorString, typeChar, errString,
+ strlen(errString));
+ } else if (MissedAnyParameters(event)) {
+ sprintf(errString, "AEDoScriptHandler: extra parameters");
+ AEPutParamPtr(reply, keyErrorString, typeChar, errString,
+ strlen(errString));
+ theErr = -1771;
+ } else {
+ if (theDesc.descriptorType == (DescType)'TEXT') {
+ Tcl_DString encodedText;
+ short i;
+ Size size;
+ char * data;
+
+ size = AEGetDescDataSize(&theDesc);
+
+ data = (char *)ckalloc(size + 1);
+ if ( !data ) {
+ theErr = -1771;
+ }
+ else {
+ AEGetDescData(&theDesc,data,size);
+ data [ size ] = 0;
+ for (i=0; i<size; i++)
+ if (data[i] == '\r')
+ data[i] = '\n';
+ AEReplaceDescData(theDesc.descriptorType,data,size+1,&theDesc);
+ }
+ Tcl_ExternalToUtfDString(NULL, data, size,
+ &encodedText);
+ tclErr = Tcl_GlobalEval(interp, Tcl_DStringValue(&encodedText));
+ Tcl_DStringFree(&encodedText);
+ } else if (theDesc.descriptorType == (DescType)'alis') {
+ Boolean dummy;
+ FSSpec theFSS;
+ Handle fullPath;
+ int length;
+ AliasHandle aliasHandle;
+
+ AEGetDescData (&theDesc,&aliasHandle,sizeof(aliasHandle ) );
+
+ theErr = ResolveAlias(NULL, aliasHandle,
+ &theFSS, &dummy);
+ if (theErr == noErr) {
+ FSpPathFromLocation(&theFSS, &length, &fullPath);
+ HLock(fullPath);
+ Tcl_EvalFile(interp, *fullPath);
+ HUnlock(fullPath);
+ DisposeHandle(fullPath);
+ } else {
+ sprintf(errString, "AEDoScriptHandler: file not found");
+ AEPutParamPtr(reply, keyErrorString, typeChar,
+ errString, strlen(errString));
+ }
+ } else {
+ sprintf(errString,
+ "AEDoScriptHandler: invalid script type '%-4.4s', must be 'alis' or 'TEXT'",
+ (char *)(&theDesc.descriptorType));
+ AEPutParamPtr(reply, keyErrorString, typeChar,
+ errString, strlen(errString));
+ theErr = -1770;
+ }
+ }
+
+ /*
+ * If we actually go to run Tcl code - put the result in the reply.
+ */
+ if (tclErr >= 0) {
+ if (tclErr == TCL_OK) {
+ AEPutParamPtr(reply, keyDirectObject, typeChar,
+ Tcl_GetStringResult(interp),
+ strlen(Tcl_GetStringResult(interp)));
+ } else {
+ AEPutParamPtr(reply, keyErrorString, typeChar,
+ Tcl_GetStringResult(interp),
+ strlen(Tcl_GetStringResult(interp)));
+ AEPutParamPtr(reply, keyErrorNumber, typeInteger,
+ (Ptr) &tclErr, sizeof(int));
+ }
+ }
+
+ AEDisposeDesc(&theDesc);
+
+ return theErr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReallyKillMe --
+ *
+ * This proc tries to kill the shell by running exit, and if that
+ * has not succeeded (e.g. because someone has renamed the exit
+ * command), calls Tcl_Exit to really kill the shell. Called from
+ * an event scheduled by the "Quit" AppleEvent handler.
+ *
+ * Results:
+ * Kills the shell.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+ReallyKillMe(Tcl_Event *eventPtr, int flags)
+{
+ Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp;
+ if (interp != NULL) {
+ Tcl_GlobalEval(interp, "exit");
+ }
+ Tcl_Exit(0);
+
+ return 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MissedAnyParameters --
+ *
+ * Checks to see if parameters are still left in the event.
+ *
+ * Results:
+ * True or false.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+MissedAnyParameters(
+ const AppleEvent *theEvent)
+{
+ DescType returnedType;
+ Size actualSize;
+ OSErr err;
+
+ err = AEGetAttributePtr(theEvent, keyMissedKeywordAttr, typeWildCard,
+ &returnedType, NULL, 0, &actualSize);
+
+ return (err != errAEDescNotFound);
+}
diff --git a/tk/macosx/tkMacOSXInit.c b/tk/macosx/tkMacOSXInit.c
new file mode 100644
index 00000000000..a6c4bef728c
--- /dev/null
+++ b/tk/macosx/tkMacOSXInit.c
@@ -0,0 +1,221 @@
+/*
+ * tkUnixInit.c --
+ *
+ * This file contains Unix-specific interpreter initialization
+ * functions.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include "tkMacOSXInt.h"
+
+/*
+ * The Init script (common to Windows and Unix platforms) is
+ * defined in tkInitScript.h
+ */
+#include "tkInitScript.h"
+
+/*
+ * The following structures are used to map the script/language codes of a
+ * font to the name that should be passed to Tcl_GetEncoding() to obtain
+ * the encoding for that font. The set of numeric constants is fixed and
+ * defined by Apple.
+ */
+
+typedef struct Map {
+ int numKey;
+ char *strKey;
+} Map;
+
+static Map scriptMap[] = {
+ {smRoman, "macRoman"},
+ {smJapanese, "macJapan"},
+ {smTradChinese, "macChinese"},
+ {smKorean, "macKorean"},
+ {smArabic, "macArabic"},
+ {smHebrew, "macHebrew"},
+ {smGreek, "macGreek"},
+ {smCyrillic, "macCyrillic"},
+ {smRSymbol, "macRSymbol"},
+ {smDevanagari, "macDevanagari"},
+ {smGurmukhi, "macGurmukhi"},
+ {smGujarati, "macGujarati"},
+ {smOriya, "macOriya"},
+ {smBengali, "macBengali"},
+ {smTamil, "macTamil"},
+ {smTelugu, "macTelugu"},
+ {smKannada, "macKannada"},
+ {smMalayalam, "macMalayalam"},
+ {smSinhalese, "macSinhalese"},
+ {smBurmese, "macBurmese"},
+ {smKhmer, "macKhmer"},
+ {smThai, "macThailand"},
+ {smLaotian, "macLaos"},
+ {smGeorgian, "macGeorgia"},
+ {smArmenian, "macArmenia"},
+ {smSimpChinese, "macSimpChinese"},
+ {smTibetan, "macTIbet"},
+ {smMongolian, "macMongolia"},
+ {smGeez, "macEthiopia"},
+ {smEastEurRoman, "macCentEuro"},
+ {smVietnamese, "macVietnam"},
+ {smExtArabic, "macSindhi"},
+ {NULL, NULL}
+};
+
+Tcl_Encoding TkMacOSXCarbonEncoding = NULL;
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpInit --
+ *
+ * Performs Mac-specific interpreter initialization related to the
+ * tk_library variable.
+ *
+ * Results:
+ * Returns a standard Tcl result. Leaves an error message or result
+ * in the interp's result.
+ *
+ * Side effects:
+ * Sets "tk_library" Tcl variable, runs "tk.tcl" script.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpInit(interp)
+ Tcl_Interp *interp;
+{
+ char tkLibPath[1024];
+ int result;
+ static int menusInitialized = false;
+ static int carbonEncodingInitialized = false;
+
+ /*
+ * Since it is possible for TkInit to be called multiple times
+ * and we don't want to do the menu initialization multiple times
+ * we protect against doing it more than once.
+ */
+
+ if (menusInitialized == false) {
+ menusInitialized = true;
+ Tk_MacOSXSetupTkNotifier();
+ TkMacOSXInitAppleEvents(interp);
+ TkMacOSXInitMenus(interp);
+ }
+
+ if (carbonEncodingInitialized == false) {
+ CFStringEncoding encoding;
+ char *encodingStr = NULL;
+ int i;
+
+ encoding = CFStringGetSystemEncoding();
+
+ for (i = 0; scriptMap[i].strKey != NULL; i++) {
+ if (scriptMap[i].numKey == encoding) {
+ encodingStr = scriptMap[i].strKey;
+ break;
+ }
+ }
+ if (encodingStr == NULL) {
+ encodingStr = "macRoman";
+ }
+
+ TkMacOSXCarbonEncoding = Tcl_GetEncoding (NULL, encodingStr);
+ if (TkMacOSXCarbonEncoding == NULL) {
+ TkMacOSXCarbonEncoding = Tcl_GetEncoding (NULL, NULL);
+ }
+ }
+
+ /*
+ * When Tk is in a framework, force tcl_findLibrary to look in the
+ * framework scripts directory.
+ * FIXME: Should we come up with a more generic way of doing this?
+ */
+
+ result = Tcl_MacOSXOpenBundleResources(interp, "com.tcltk.tklibrary",
+ 1, 1024, tkLibPath);
+
+ if (result != TCL_ERROR) {
+ Tcl_SetVar(interp, "tk_library", tkLibPath, TCL_GLOBAL_ONLY);
+ }
+
+ return Tcl_Eval(interp, initScript);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetAppName --
+ *
+ * Retrieves the name of the current application from a platform
+ * specific location. For Unix, the application name is the tail
+ * of the path contained in the tcl variable argv0.
+ *
+ * Results:
+ * Returns the application name in the given Tcl_DString.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpGetAppName(interp, namePtr)
+ Tcl_Interp *interp;
+ Tcl_DString *namePtr; /* A previously initialized Tcl_DString. */
+{
+ CONST char *p, *name;
+
+ name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY);
+ if ((name == NULL) || (*name == 0)) {
+ name = "tk";
+ } else {
+ p = strrchr(name, '/');
+ if (p != NULL) {
+ name = p+1;
+ }
+ }
+ Tcl_DStringAppend(namePtr, name, -1);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDisplayWarning --
+ *
+ * This routines is called from Tk_Main to display warning
+ * messages that occur during startup.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Generates messages on stdout.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDisplayWarning(msg, title)
+ CONST char *msg; /* Message to be displayed. */
+ CONST char *title; /* Title of warning. */
+{
+ Tcl_Channel errChannel = Tcl_GetStdChannel(TCL_STDERR);
+ if (errChannel) {
+ Tcl_WriteChars(errChannel, title, -1);
+ Tcl_WriteChars(errChannel, ": ", 2);
+ Tcl_WriteChars(errChannel, msg, -1);
+ Tcl_WriteChars(errChannel, "\n", 1);
+ }
+}
diff --git a/tk/macosx/tkMacOSXInt.h b/tk/macosx/tkMacOSXInt.h
new file mode 100644
index 00000000000..91450430dcd
--- /dev/null
+++ b/tk/macosx/tkMacOSXInt.h
@@ -0,0 +1,155 @@
+/*
+ * tkMacOSXInt.h --
+ *
+ * Declarations of Macintosh specific shared variables and procedures.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#ifndef _TKMACINT
+#define _TKMACINT
+
+#ifndef _TKINT
+#include "tkInt.h"
+#endif
+
+/*
+ * Include platform specific public interfaces.
+ */
+
+#ifndef _TKMAC
+#include "tkMacOSX.h"
+#endif
+
+#ifndef _TKPORT
+#include "tkPort.h"
+#endif
+
+#include <Carbon/Carbon.h>
+
+struct TkWindowPrivate {
+ TkWindow *winPtr; /* Ptr to tk window or NULL if Pixmap */
+ CGrafPtr grafPtr;
+ ControlRef rootControl;
+ int xOff; /* X offset from toplevel window */
+ int yOff; /* Y offset from toplevel window */
+ RgnHandle clipRgn; /* Visable region of window */
+ RgnHandle aboveClipRgn; /* Visable region of window & it's children */
+ int referenceCount; /* Don't delete toplevel until children are
+ * gone. */
+ struct TkWindowPrivate *toplevel; /* Pointer to the toplevel
+ * datastruct. */
+ int flags; /* Various state see defines below. */
+};
+typedef struct TkWindowPrivate MacDrawable;
+
+/*
+ * This list is used to keep track of toplevel windows that have a Mac
+ * window attached. This is useful for several things, not the least
+ * of which is maintaining floating windows.
+ */
+
+typedef struct TkMacOSXWindowList {
+ struct TkMacOSXWindowList *nextPtr; /* The next window in the list. */
+ TkWindow *winPtr; /* This window */
+} TkMacOSXWindowList;
+
+/*
+ * Defines use for the flags field of the MacDrawable data structure.
+ */
+
+#define TK_SCROLLBAR_GROW 1
+#define TK_CLIP_INVALID 2
+#define TK_HOST_EXISTS 4
+#define TK_DRAWN_UNDER_MENU 8
+
+/*
+ * I am reserving TK_EMBEDDED = 0x100 in the MacDrawable flags
+ * This is defined in tk.h. We need to duplicate the TK_EMBEDDED flag in the
+ * TkWindow structure for the window, but in the MacWin. This way we can still tell
+ * what the correct port is after the TKWindow structure has been freed. This
+ * actually happens when you bind destroy of a toplevel to Destroy of a child.
+ */
+
+/*
+ * This structure is for handling Netscape-type in process
+ * embedding where Tk does not control the top-level. It contains
+ * various functions that are needed by Mac specific routines, like
+ * TkMacOSXGetDrawablePort. The definitions of the function types
+ * are in tclMac.h.
+ */
+
+typedef struct {
+ Tk_MacOSXEmbedRegisterWinProc *registerWinProc;
+ Tk_MacOSXEmbedGetGrafPortProc *getPortProc;
+ Tk_MacOSXEmbedMakeContainerExistProc *containerExistProc;
+ Tk_MacOSXEmbedGetClipProc *getClipProc;
+ Tk_MacOSXEmbedGetOffsetInParentProc *getOffsetProc;
+} TkMacOSXEmbedHandler;
+
+extern TkMacOSXEmbedHandler *gMacEmbedHandler;
+
+/*
+ * Defines used for TkMacOSXInvalidateWindow
+ */
+
+#define TK_WINDOW_ONLY 0
+#define TK_PARENT_WINDOW 1
+
+/*
+ * Accessor for the privatePtr flags field for the TK_HOST_EXISTS field
+ */
+
+#define TkMacOSXHostToplevelExists(tkwin) \
+ (((TkWindow *) (tkwin))->privatePtr->toplevel->flags & TK_HOST_EXISTS)
+
+/*
+ * Defines use for the flags argument to TkGenWMConfigureEvent.
+ */
+
+#define TK_LOCATION_CHANGED 1
+#define TK_SIZE_CHANGED 2
+#define TK_BOTH_CHANGED 3
+
+/*
+ * Variables shared among various Mac Tk modules but are not
+ * exported to the outside world.
+ */
+
+/*
+ * Globals shared among Macintosh Tk
+ */
+
+extern MenuHandle tkAppleMenu; /* Handle to the Apple Menu */
+extern MenuHandle tkFileMenu; /* Handles to menus */
+extern MenuHandle tkEditMenu; /* Handles to menus */
+extern RgnHandle tkMenuCascadeRgn; /* A region to clip with. */
+extern int tkUseMenuCascadeRgn; /* If this is 1, clipping code
+ * should intersect tkMenuCascadeRgn
+ * before drawing occurs.
+ * tkMenuCascadeRgn will only
+ * be valid when the value of this
+ * variable is 1. */
+extern int tkPictureIsOpen; /* If this is 1, we are drawing to a picture
+ * The clipping should then be done relative
+ * to the bounds of the picture rather than the window
+ * As of OS X.0.4, something is seriously wrong:
+ * The clipping bounds only seem to work if the
+ * top,left values are 0,0
+ * The destination rectangle for CopyBits
+ * should also have top,left values of 0,0
+ */
+extern TkMacOSXWindowList *tkMacOSXWindowListPtr;
+ /* The list of toplevels */
+
+extern Tcl_Encoding TkMacOSXCarbonEncoding;
+
+#include "tkIntPlatDecls.h"
+
+#endif /* _TKMACINT */
diff --git a/tk/macosx/tkMacOSXKeyEvent.c b/tk/macosx/tkMacOSXKeyEvent.c
new file mode 100644
index 00000000000..a8d27119156
--- /dev/null
+++ b/tk/macosx/tkMacOSXKeyEvent.c
@@ -0,0 +1,501 @@
+/*
+ * tkMacOSXKeyEvent.c --
+ *
+ * This file implements functions that decode & handle keyboard events
+ * on MacOS X.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#include "tkMacOSXInt.h"
+#include "tkPort.h"
+#include "tkMacOSXEvent.h"
+
+typedef struct {
+ WindowRef whichWindow;
+ Point global;
+ Point local;
+ int state;
+ char ch;
+ UInt32 keyCode;
+ UInt32 keyModifiers;
+ UInt32 message;
+} KeyEventData;
+
+static Tk_Window gGrabWinPtr = NULL; /* Current grab window, NULL if no grab. */
+static Tk_Window gKeyboardWinPtr = NULL; /* Current keyboard grab window. */
+
+/*
+ * Declarations for functions used only in this file.
+ */
+
+static int GenerateKeyEvent _ANSI_ARGS_(( EventKind eKind,
+ KeyEventData * e,
+ Window window,
+ UInt32 savedKeyCode,
+ UInt32 savedModifiers));
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessKeyboardEvent --
+ *
+ * This routine processes the event in eventPtr, and
+ * generates the appropriate Tk events from it.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int TkMacOSXProcessKeyboardEvent(
+ TkMacOSXEvent * eventPtr,
+ MacEventStatus * statusPtr)
+{
+ static UInt32 savedKeyCode = 0;
+ static UInt32 savedModifiers = 0;
+ OSStatus status;
+ KeyEventData keyEventData;
+ Window window;
+ MenuRef menuRef;
+ MenuItemIndex menuItemIndex;
+ int eventGenerated;
+
+ statusPtr->handledByTk = 1;
+ keyEventData.whichWindow = FrontNonFloatingWindow();
+ if (keyEventData.whichWindow == NULL) {
+ return 0;
+ }
+ GetMouse(&keyEventData.local);
+ keyEventData.global = keyEventData.local;
+ LocalToGlobal(&keyEventData.global);
+ keyEventData.state = TkMacOSXButtonKeyState();
+#if 0
+ /*
+ * This block of code seems like a good idea, to trap
+ * key-bindings which point directly to menus, but it
+ * has a number of problems:
+ * (1) when grabs are present we definitely don't want
+ * to do this.
+ * (2) Tk's semantics define accelerator keystrings in
+ * menus as a purely visual adornment, and require that
+ * the developer create separate bindings to trigger
+ * them. This breaks those semantics. (i.e. Tk will
+ * behave differently on Aqua to the behaviour on Unix/Win).
+ * (3) Tk's bindings depend on the current window's bindtags,
+ * which may be completely different to what happens to be
+ * in some global menu (agreed, it shouldn't be that different,
+ * but it often is).
+ *
+ * While a better middleground might be possible, the best, most
+ * compatible, approach at present is to disable this block.
+ */
+ if (IsMenuKeyEvent(NULL, eventPtr->eventRef,
+ kNilOptions, &menuRef, &menuItemIndex)) {
+ int oldMode;
+ MenuID menuID;
+ KeyMap theKeys;
+ int selection;
+
+ menuID = GetMenuID(menuRef);
+ selection = (menuID << 16 ) | menuItemIndex;
+
+ GetKeys(theKeys);
+ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ TkMacOSXClearMenubarActive();
+
+ /*
+ * Handle -postcommand
+ */
+
+ TkMacOSXPreprocessMenu();
+ TkMacOSXHandleMenuSelect(selection, theKeys[1] & 4);
+ Tcl_SetServiceMode(oldMode);
+ return 0; /* TODO: may not be on event on queue. */
+ }
+#endif
+
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamKeyMacCharCodes,
+ typeChar, NULL,
+ sizeof(keyEventData.ch), NULL,
+ &keyEventData.ch);
+ if (status != noErr) {
+ fprintf(stderr, "Failed to retrieve KeyMacCharCodes\n" );
+ statusPtr->err = 1;
+ return 1;
+ }
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamKeyCode,
+ typeUInt32, NULL,
+ sizeof(keyEventData.keyCode), NULL,
+ &keyEventData.keyCode);
+ if (status != noErr) {
+ fprintf(stderr, "Failed to retrieve KeyCode\n" );
+ statusPtr->err = 1;
+ return 1;
+ }
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamKeyModifiers,
+ typeUInt32, NULL,
+ sizeof(keyEventData.keyModifiers), NULL,
+ &keyEventData.keyModifiers);
+ if (status != noErr) {
+ fprintf(stderr, "Failed to retrieve KeyModifiers\n" );
+ statusPtr->err = 1;
+ return 1;
+ }
+ keyEventData.message = keyEventData.ch|(keyEventData.keyCode << 8);
+
+ window = TkMacOSXGetXWindow(keyEventData.whichWindow);
+
+ eventGenerated = GenerateKeyEvent(eventPtr->eKind, &keyEventData,
+ window, savedKeyCode, savedModifiers);
+ savedModifiers = keyEventData.keyModifiers;
+
+ if (eventGenerated == 0) {
+ savedKeyCode = keyEventData.message;
+ return false;
+ } else if (eventGenerated == -1) {
+ savedKeyCode = 0;
+ return false;
+ } else {
+ savedKeyCode = 0;
+ return true;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateKeyEvent --
+ *
+ * Given Macintosh keyUp, keyDown & autoKey events this function
+ * generates the appropiate X key events. The window that is passed
+ * should represent the frontmost window - which will recieve the
+ * event.
+ *
+ * Results:
+ * 1 if an event was generated, 0 if we are waiting for another
+ * byte of a multi-byte sequence, and -1 for any other error.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+GenerateKeyEvent( EventKind eKind,
+ KeyEventData * e,
+ Window window,
+ UInt32 savedKeyCode,
+ UInt32 savedModifiers )
+{
+ Tk_Window tkwin;
+ XEvent event;
+ unsigned char byte;
+ char buf[16];
+ TkDisplay *dispPtr;
+
+ /*
+ * The focus must be in the FrontWindow on the Macintosh.
+ * We then query Tk to determine the exact Tk window
+ * that owns the focus.
+ */
+
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+
+ if (tkwin == NULL) {
+ fprintf(stderr,"tkwin == NULL, %d\n", __LINE__);
+ return -1;
+ }
+
+ tkwin = (Tk_Window) ((TkWindow *) tkwin)->dispPtr->focusPtr;
+ if (tkwin == NULL) {
+ fprintf(stderr,"tkwin == NULL, %d\n", __LINE__);
+ return -1;
+ }
+ byte = (e->message&charCodeMask);
+ if (byte == 0) {
+ /*
+ * Either we have a pure-modifier change, or perhaps
+ * a dead-key (e.g. opt-e) was pressed. In the former case we do
+ * want to generate an event, in the latter I'm not sure
+ * what to do.
+ */
+ if (eKind == kEventRawKeyModifiersChanged) {
+ /* Drop through to the event code below */
+ } else {
+ /*
+ * What shall we do here? We certainly aren't dealing
+ * with deadkeys at present. Is this where they come?
+ */
+ return 0;
+ }
+ } else if ((savedKeyCode == 0) &&
+ (Tcl_ExternalToUtf(NULL, TkMacOSXCarbonEncoding,
+ (char *) &byte, 1, 0, NULL,
+ buf, sizeof(buf), NULL, NULL, NULL) != TCL_OK)) {
+ /*
+ * This event specifies a lead byte. Wait for the second byte
+ * to come in before sending the XEvent.
+ */
+ fprintf(stderr,"Failed %02x\n", byte);
+ return 0;
+ }
+
+ event.xany.send_event = False;
+ event.xkey.same_screen = true;
+ event.xkey.subwindow = None;
+ event.xkey.time = TkpGetMS();
+
+ event.xkey.x_root = e->global.h;
+ event.xkey.y_root = e->global.v;
+ Tk_TopCoordsToWindow(tkwin, e->local.h, e->local.v,
+ &event.xkey.x, &event.xkey.y);
+
+ /*
+ * Now, we may have a problem here. How do we handle 'Option-char'
+ * keypresses? The problem is that we might want to bind to some of
+ * these (e.g. Cmd-Opt-d is 'uncomment' in Alpha), but Option-d
+ * generates a 'delta' symbol with some keycode unrelated to 'd', and so
+ * the binding never triggers. In any case, the delta that is produced
+ * is never mapped to an 'XK_Greek_DELTA' keysym so bindings on that
+ * won't work either (a general KeyPress binding will of course trigger,
+ * but a specific binding on XK_Greek_DELTA will not).
+ *
+ * I think what we want is for the event to contain information on
+ * both the 'Opt-d' side of things and the 'delta'. Then a binding
+ * on Opt-d will trigger, but the ascii/string representation of the
+ * event will be a delta.
+ *
+ * A different way to look at this is that 'Opt-d' is delta, but that
+ * Command-Opt-d is nothing to do with delta, but I'm not sure that is
+ * helpful.
+ *
+ * Also some keypresses (Opt-e) are dead-keys to add accents to
+ * letters. We don't handle them yet.
+ *
+ * Help needed!
+ */
+ event.xkey.keycode = byte |
+ ((savedKeyCode & charCodeMask) << 8) |
+ ((e->message&keyCodeMask) << 8);
+
+ event.xany.serial = Tk_Display(tkwin)->request;
+ event.xkey.window = Tk_WindowId(tkwin);
+ event.xkey.display = Tk_Display(tkwin);
+ event.xkey.root = XRootWindow(Tk_Display(tkwin), 0);
+ event.xkey.state = e->state;
+
+ switch(eKind) {
+ case kEventRawKeyDown:
+ event.xany.type = KeyPress;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ break;
+ case kEventRawKeyUp:
+ event.xany.type = KeyRelease;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ break;
+ case kEventRawKeyRepeat:
+ event.xany.type = KeyRelease;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ event.xany.type = KeyPress;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ break;
+ case kEventRawKeyModifiersChanged:
+ if (savedModifiers > e->keyModifiers) {
+ event.xany.type = KeyRelease;
+ } else {
+ event.xany.type = KeyPress;
+ }
+ /*
+ * Use special '-1' to signify a special keycode to
+ * our platform specific code in tkMacOSXKeyboard.c.
+ * This is rather like what happens on Windows.
+ */
+ event.xany.send_event = -1;
+ /* Set keycode (which was zero) to the changed modifier */
+ event.xkey.keycode = (e->keyModifiers ^ savedModifiers);
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ break;
+ default:
+ break;
+ }
+ return 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XGrabKeyboard --
+ *
+ * Simulates a keyboard grab by setting the focus.
+ *
+ * Results:
+ * Always returns GrabSuccess.
+ *
+ * Side effects:
+ * Sets the keyboard focus to the specified window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+XGrabKeyboard(
+ Display* display,
+ Window grab_window,
+ Bool owner_events,
+ int pointer_mode,
+ int keyboard_mode,
+ Time time)
+{
+ gKeyboardWinPtr = Tk_IdToWindow(display, grab_window);
+ return GrabSuccess;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XUngrabKeyboard --
+ *
+ * Releases the simulated keyboard grab.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets the keyboard focus back to the value before the grab.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XUngrabKeyboard(
+ Display* display,
+ Time time)
+{
+ gKeyboardWinPtr = NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetCapture --
+ *
+ * Results:
+ * Returns the current grab window
+ * Side effects:
+ * None.
+ *
+ */
+Tk_Window
+TkMacOSXGetCapture()
+{
+ return gGrabWinPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpSetCapture --
+ *
+ * This function captures the mouse so that all future events
+ * will be reported to this window, even if the mouse is outside
+ * the window. If the specified window is NULL, then the mouse
+ * is released.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets the capture flag and captures the mouse.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpSetCapture(
+ TkWindow *winPtr) /* Capture window, or NULL. */
+{
+ while ((winPtr != NULL) && !Tk_IsTopLevel(winPtr)) {
+ winPtr = winPtr->parentPtr;
+ }
+ gGrabWinPtr = (Tk_Window) winPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_SetCaretPos --
+ *
+ * This enables correct placement of the XIM caret. This is called
+ * by widgets to indicate their cursor placement, and the caret
+ * location is used by TkpGetString to place the XIM caret.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_SetCaretPos(tkwin, x, y, height)
+ Tk_Window tkwin;
+ int x;
+ int y;
+ int height;
+{
+}
diff --git a/tk/macosx/tkMacOSXKeyboard.c b/tk/macosx/tkMacOSXKeyboard.c
new file mode 100644
index 00000000000..85bd0084711
--- /dev/null
+++ b/tk/macosx/tkMacOSXKeyboard.c
@@ -0,0 +1,682 @@
+/*
+ * tkMacOSXKeyboard.c --
+ *
+ * Routines to support keyboard events on the Macintosh.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include "X11/Xlib.h"
+#include "X11/keysym.h"
+#include <Carbon/Carbon.h>
+#include "tkMacOSXInt.h"
+
+typedef struct {
+ int keycode; /* Macintosh keycode */
+ KeySym keysym; /* X windows Keysym */
+} KeyInfo;
+
+static KeyInfo keyArray[] = {
+ {0x4C, XK_Return},
+ {0x24, XK_Return},
+ {0x33, XK_BackSpace},
+ {0x75, XK_Delete},
+ {0x30, XK_Tab},
+ {0x74, XK_Page_Up},
+ {0x79, XK_Page_Down},
+ {0x73, XK_Home},
+ {0x77, XK_End},
+ {0x7B, XK_Left},
+ {0x7C, XK_Right},
+ {0x7E, XK_Up},
+ {0x7D, XK_Down},
+ {0x72, XK_Help},
+ {0x35, XK_Escape},
+ {0x47, XK_Clear},
+ {0, 0}
+};
+
+static KeyInfo vituralkeyArray[] = {
+ {122, XK_F1},
+ {120, XK_F2},
+ {99, XK_F3},
+ {118, XK_F4},
+ {96, XK_F5},
+ {97, XK_F6},
+ {98, XK_F7},
+ {100, XK_F8},
+ {101, XK_F9},
+ {109, XK_F10},
+ {103, XK_F11},
+ {111, XK_F12},
+ {105, XK_F13},
+ {107, XK_F14},
+ {113, XK_F15},
+ {0, 0}
+};
+
+static int initialized = 0;
+static Tcl_HashTable keycodeTable; /* keyArray hashed by keycode value. */
+static Tcl_HashTable vkeyTable; /* vituralkeyArray hashed by virtual
+ keycode value. */
+static Ptr KCHRPtr; /* Pointer to 'KCHR' resource. */
+
+/*
+ * Prototypes for static functions used in this file.
+ */
+static void InitKeyMaps _ANSI_ARGS_((void));
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitKeyMaps --
+ *
+ * Creates hash tables used by some of the functions in this file.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Allocates memory & creates some hash tables.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+InitKeyMaps()
+{
+ Tcl_HashEntry *hPtr;
+ KeyInfo *kPtr;
+ int dummy;
+
+ Tcl_InitHashTable(&keycodeTable, TCL_ONE_WORD_KEYS);
+ for (kPtr = keyArray; kPtr->keycode != 0; kPtr++) {
+ hPtr = Tcl_CreateHashEntry(&keycodeTable, (char *) kPtr->keycode,
+ &dummy);
+ Tcl_SetHashValue(hPtr, kPtr->keysym);
+ }
+ Tcl_InitHashTable(&vkeyTable, TCL_ONE_WORD_KEYS);
+ for (kPtr = vituralkeyArray; kPtr->keycode != 0; kPtr++) {
+ hPtr = Tcl_CreateHashEntry(&vkeyTable, (char *) kPtr->keycode,
+ &dummy);
+ Tcl_SetHashValue(hPtr, kPtr->keysym);
+ }
+ KCHRPtr = (Ptr) GetScriptManagerVariable(smKCHRCache);
+ if (!KCHRPtr){
+ fprintf(stderr,"GetScriptManagerVariable failed\n");
+ }
+ initialized = 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XKeycodeToKeysym --
+ *
+ * Translate from a system-dependent keycode to a
+ * system-independent keysym.
+ *
+ * Results:
+ * Returns the translated keysym, or NoSymbol on failure.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+KeySym
+XKeycodeToKeysym(
+ Display* display,
+ KeyCode keycode,
+ int index)
+{
+ register Tcl_HashEntry *hPtr;
+ int c;
+ int virtualKey;
+ int newKeycode;
+ unsigned long dummy, newChar;
+
+ if (!initialized) {
+ InitKeyMaps();
+ }
+ if (keycode == 0) {
+ /*
+ * This means we had a pure modifier keypress or
+ * something similar which is a TO DO.
+ */
+ return NoSymbol;
+ }
+
+ virtualKey = (char) (keycode >> 16);
+ c = (keycode) & 0xffff;
+ if (c > 255) {
+ return NoSymbol;
+ }
+
+ /*
+ * When determining what keysym to produce we first check to see if
+ * the key is a function key. We then check to see if the character
+ * is another non-printing key. Finally, we return the key syms
+ * for all ASCI chars.
+ */
+ if (c == 0x10) {
+ hPtr = Tcl_FindHashEntry(&vkeyTable, (char *) virtualKey);
+ if (hPtr != NULL) {
+ return (KeySym) Tcl_GetHashValue(hPtr);
+ }
+ }
+ hPtr = Tcl_FindHashEntry(&keycodeTable, (char *) virtualKey);
+ if (hPtr != NULL) {
+ return (KeySym) Tcl_GetHashValue(hPtr);
+ }
+
+ /*
+ * Recompute the character based on the Shift key only.
+ * TODO: The index may also specify the NUM_LOCK.
+ */
+ newKeycode = virtualKey;
+ if (index & 0x01) {
+ newKeycode += 0x0200;
+ }
+ dummy = 0;
+ newChar = KeyTranslate(KCHRPtr, (short) newKeycode, &dummy);
+ c = newChar & charCodeMask;
+
+ if (c >= XK_space && c < XK_asciitilde) {
+ return c;
+ }
+
+ return NoSymbol;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetString --
+ *
+ * Retrieve the string equivalent for the given keyboard event.
+ *
+ * Results:
+ * Returns the UTF string.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+TkpGetString(
+ TkWindow *winPtr, /* Window where event occurred: needed to
+ * get input context. */
+ XEvent *eventPtr, /* X keyboard event. */
+ Tcl_DString *dsPtr) /* Uninitialized or empty string to hold
+ * result. */
+{
+ register Tcl_HashEntry *hPtr;
+ char string[3];
+ int virtualKey;
+ int c, len;
+
+ if (!initialized) {
+ InitKeyMaps();
+ }
+
+ Tcl_DStringInit(dsPtr);
+
+ virtualKey = (char) (eventPtr->xkey.keycode >> 16);
+ c = (eventPtr->xkey.keycode) & 0xffff;
+
+ if (c < 256) {
+ string[0] = (char) c;
+ len = 1;
+ } else {
+ string[0] = (char) (c >> 8);
+ string[1] = (char) c;
+ len = 2;
+ }
+ /*
+ * Just return NULL if the character is a function key or another
+ * non-printing key.
+ */
+ if (c == 0x10 || (eventPtr->xany.send_event == -1)) {
+ len = 0;
+ } else {
+ hPtr = Tcl_FindHashEntry(&keycodeTable, (char *) virtualKey);
+ if (hPtr != NULL) {
+ len = 0;
+ }
+ }
+ return Tcl_ExternalToUtfDString(TkMacOSXCarbonEncoding, string,
+ len, dsPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XGetModifierMapping --
+ *
+ * Fetch the current keycodes used as modifiers.
+ *
+ * Results:
+ * Returns a new modifier map.
+ *
+ * Side effects:
+ * Allocates a new modifier map data structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+XModifierKeymap *
+XGetModifierMapping(
+ Display* display)
+{
+ XModifierKeymap * modmap;
+
+ modmap = (XModifierKeymap *) ckalloc(sizeof(XModifierKeymap));
+ modmap->max_keypermod = 0;
+ modmap->modifiermap = NULL;
+ return modmap;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XFreeModifiermap --
+ *
+ * Deallocate a modifier map that was created by
+ * XGetModifierMapping.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Frees the datastructure referenced by modmap.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XFreeModifiermap(
+ XModifierKeymap *modmap)
+{
+ if (modmap->modifiermap != NULL) {
+ ckfree((char *) modmap->modifiermap);
+ }
+ ckfree((char *) modmap);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XKeysymToString, XStringToKeysym --
+ *
+ * These X window functions map Keysyms to strings & strings to
+ * keysyms. However, Tk already does this for the most common keysyms.
+ * Therefor, these functions only need to support keysyms that will be
+ * specific to the Macintosh. Currently, there are none.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+XKeysymToString(
+ KeySym keysym)
+{
+ return NULL;
+}
+
+KeySym
+XStringToKeysym(
+ const char* string)
+{
+ return NoSymbol;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XKeysymToKeycode --
+ *
+ * The function XKeysymToKeycode is only used by tkTest.c and
+ * currently only implementes the support for keys used in the
+ * Tk test suite.
+ * FIXME - This is no longer true. This function is now used in
+ * "event generate" so we really should make it work.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+KeyCode
+XKeysymToKeycode(
+ Display* display,
+ KeySym keysym)
+{
+ KeyCode keycode = 0;
+ char virtualKeyCode = 0;
+
+ if ((keysym >= XK_space) && (XK_asciitilde)) {
+ if (keysym == 'a') {
+ virtualKeyCode = 0x00;
+ } else if (keysym == 'b' || keysym == 'B') {
+ virtualKeyCode = 0x0B;
+ } else if (keysym == 'c') {
+ virtualKeyCode = 0x08;
+ } else if (keysym == 'x' || keysym == 'X') {
+ virtualKeyCode = 0x07;
+ } else if (keysym == 'z') {
+ virtualKeyCode = 0x06;
+ } else if (keysym == ' ') {
+ virtualKeyCode = 0x31;
+ } else if (keysym == XK_Return) {
+ virtualKeyCode = 0x24;
+ keysym = '\r';
+ }
+ keycode = keysym + (virtualKeyCode <<16);
+ }
+
+ return keycode;
+}
+
+/*
+ * When mapping from a keysym to a keycode, need
+ * information about the modifier state that should be used
+ * so that when they call XKeycodeToKeysym taking into
+ * account the xkey.state, they will get back the original
+ * keysym.
+ */
+
+void
+TkpSetKeycodeAndState(tkwin, keySym, eventPtr)
+ Tk_Window tkwin;
+ KeySym keySym;
+ XEvent *eventPtr;
+{
+ Display *display;
+ int state;
+ KeyCode keycode;
+
+ display = Tk_Display(tkwin);
+
+ if (keySym == NoSymbol) {
+ keycode = 0;
+ } else {
+ keycode = XKeysymToKeycode(display, keySym);
+ }
+ if (keycode != 0) {
+ for (state = 0; state < 4; state++) {
+ if (XKeycodeToKeysym(display, keycode, state) == keySym) {
+ if (state & 1) {
+ eventPtr->xkey.state |= ShiftMask;
+ }
+ if (state & 2) {
+ TkDisplay *dispPtr;
+
+ dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ eventPtr->xkey.state |= dispPtr->modeModMask;
+ }
+ break;
+ }
+ }
+ }
+ eventPtr->xkey.keycode = keycode;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetKeySym --
+ *
+ * Given an X KeyPress or KeyRelease event, map the
+ * keycode in the event into a KeySym.
+ *
+ * Results:
+ * The return value is the KeySym corresponding to
+ * eventPtr, or NoSymbol if no matching Keysym could be
+ * found.
+ *
+ * Side effects:
+ * In the first call for a given display, keycode-to-
+ * KeySym maps get loaded.
+ *
+ *----------------------------------------------------------------------
+ */
+
+KeySym
+TkpGetKeySym(dispPtr, eventPtr)
+ TkDisplay *dispPtr; /* Display in which to
+ * map keycode. */
+ XEvent *eventPtr; /* Description of X event. */
+{
+ KeySym sym;
+ int index;
+
+ /*
+ * Refresh the mapping information if it's stale
+ */
+
+ if (dispPtr->bindInfoStale) {
+ TkpInitKeymapInfo(dispPtr);
+ }
+
+ /*
+ * Figure out which of the four slots in the keymap vector to
+ * use for this key. Refer to Xlib documentation for more info
+ * on how this computation works.
+ */
+
+ index = 0;
+ if (eventPtr->xkey.state & dispPtr->modeModMask) {
+ index = 2;
+ }
+ if ((eventPtr->xkey.state & ShiftMask)
+ || ((dispPtr->lockUsage != LU_IGNORE)
+ && (eventPtr->xkey.state & LockMask))) {
+ index += 1;
+ }
+ if (eventPtr->xany.send_event == -1) {
+ /* We use -1 as a special signal for a pure modifier */
+ int modifier = eventPtr->xkey.keycode;
+ if (modifier == cmdKey) {
+ return XK_Alt_L;
+ } else if (modifier == shiftKey) {
+ return XK_Shift_L;
+ } else if (modifier == alphaLock) {
+ return XK_Caps_Lock;
+ } else if (modifier == optionKey) {
+ return XK_Meta_L;
+ } else if (modifier == controlKey) {
+ return XK_Control_L;
+ } else if (modifier == rightShiftKey) {
+ return XK_Shift_R;
+ } else if (modifier == rightOptionKey) {
+ return XK_Meta_R;
+ } else if (modifier == rightControlKey) {
+ return XK_Control_R;
+ } else {
+ /* If we get here, we probably need to implement something new */
+ return NoSymbol;
+ }
+ }
+ sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode, index);
+
+ /*
+ * Special handling: if the key was shifted because of Lock, but
+ * lock is only caps lock, not shift lock, and the shifted keysym
+ * isn't upper-case alphabetic, then switch back to the unshifted
+ * keysym.
+ */
+
+ if ((index & 1) && !(eventPtr->xkey.state & ShiftMask)
+ && (dispPtr->lockUsage == LU_CAPS)) {
+ if (!(((sym >= XK_A) && (sym <= XK_Z))
+ || ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
+ || ((sym >= XK_Ooblique) && (sym <= XK_Thorn)))) {
+ index &= ~1;
+ sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
+ index);
+ }
+ }
+
+ /*
+ * Another bit of special handling: if this is a shifted key and there
+ * is no keysym defined, then use the keysym for the unshifted key.
+ */
+
+ if ((index & 1) && (sym == NoSymbol)) {
+ sym = XKeycodeToKeysym(dispPtr->display, eventPtr->xkey.keycode,
+ index & ~1);
+ }
+ return sym;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpInitKeymapInfo --
+ *
+ * This procedure is invoked to scan keymap information
+ * to recompute stuff that's important for binding, such
+ * as the modifier key (if any) that corresponds to "mode
+ * switch".
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Keymap-related information in dispPtr is updated.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkpInitKeymapInfo(dispPtr)
+ TkDisplay *dispPtr; /* Display for which to recompute keymap
+ * information. */
+{
+ XModifierKeymap *modMapPtr;
+ KeyCode *codePtr;
+ KeySym keysym;
+ int count, i, j, max, arraySize;
+#define KEYCODE_ARRAY_SIZE 20
+
+ dispPtr->bindInfoStale = 0;
+ modMapPtr = XGetModifierMapping(dispPtr->display);
+
+ /*
+ * Check the keycodes associated with the Lock modifier. If
+ * any of them is associated with the XK_Shift_Lock modifier,
+ * then Lock has to be interpreted as Shift Lock, not Caps Lock.
+ */
+
+ dispPtr->lockUsage = LU_IGNORE;
+ codePtr = modMapPtr->modifiermap + modMapPtr->max_keypermod*LockMapIndex;
+ for (count = modMapPtr->max_keypermod; count > 0; count--, codePtr++) {
+ if (*codePtr == 0) {
+ continue;
+ }
+ keysym = XKeycodeToKeysym(dispPtr->display, *codePtr, 0);
+ if (keysym == XK_Shift_Lock) {
+ dispPtr->lockUsage = LU_SHIFT;
+ break;
+ }
+ if (keysym == XK_Caps_Lock) {
+ dispPtr->lockUsage = LU_CAPS;
+ break;
+ }
+ }
+
+ /*
+ * Look through the keycodes associated with modifiers to see if
+ * the the "mode switch", "meta", or "alt" keysyms are associated
+ * with any modifiers. If so, remember their modifier mask bits.
+ */
+
+ dispPtr->modeModMask = 0;
+ dispPtr->metaModMask = 0;
+ dispPtr->altModMask = 0;
+ codePtr = modMapPtr->modifiermap;
+ max = 8*modMapPtr->max_keypermod;
+ for (i = 0; i < max; i++, codePtr++) {
+ if (*codePtr == 0) {
+ continue;
+ }
+ keysym = XKeycodeToKeysym(dispPtr->display, *codePtr, 0);
+ if (keysym == XK_Mode_switch) {
+ dispPtr->modeModMask |= ShiftMask << (i/modMapPtr->max_keypermod);
+ }
+ if ((keysym == XK_Meta_L) || (keysym == XK_Meta_R)) {
+ dispPtr->metaModMask |= ShiftMask << (i/modMapPtr->max_keypermod);
+ }
+ if ((keysym == XK_Alt_L) || (keysym == XK_Alt_R)) {
+ dispPtr->altModMask |= ShiftMask << (i/modMapPtr->max_keypermod);
+ }
+ }
+
+ /*
+ * Create an array of the keycodes for all modifier keys.
+ */
+
+ if (dispPtr->modKeyCodes != NULL) {
+ ckfree((char *) dispPtr->modKeyCodes);
+ }
+ dispPtr->numModKeyCodes = 0;
+ arraySize = KEYCODE_ARRAY_SIZE;
+ dispPtr->modKeyCodes = (KeyCode *) ckalloc((unsigned)
+ (KEYCODE_ARRAY_SIZE * sizeof(KeyCode)));
+ for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) {
+ if (*codePtr == 0) {
+ continue;
+ }
+
+ /*
+ * Make sure that the keycode isn't already in the array.
+ */
+
+ for (j = 0; j < dispPtr->numModKeyCodes; j++) {
+ if (dispPtr->modKeyCodes[j] == *codePtr) {
+ goto nextModCode;
+ }
+ }
+ if (dispPtr->numModKeyCodes >= arraySize) {
+ KeyCode *new;
+
+ /*
+ * Ran out of space in the array; grow it.
+ */
+
+ arraySize *= 2;
+ new = (KeyCode *) ckalloc((unsigned)
+ (arraySize * sizeof(KeyCode)));
+ memcpy((VOID *) new, (VOID *) dispPtr->modKeyCodes,
+ (dispPtr->numModKeyCodes * sizeof(KeyCode)));
+ ckfree((char *) dispPtr->modKeyCodes);
+ dispPtr->modKeyCodes = new;
+ }
+ dispPtr->modKeyCodes[dispPtr->numModKeyCodes] = *codePtr;
+ dispPtr->numModKeyCodes++;
+ nextModCode: continue;
+ }
+ XFreeModifiermap(modMapPtr);
+}
diff --git a/tk/macosx/tkMacOSXLibrary.r b/tk/macosx/tkMacOSXLibrary.r
new file mode 100644
index 00000000000..1662aafbef5
--- /dev/null
+++ b/tk/macosx/tkMacOSXLibrary.r
@@ -0,0 +1,510 @@
+/*
+ * tkMacOSXLibrary.r --
+ *
+ * This file creates resources for use in most Tk applications.
+ * This is designed to be an example of using the Tcl/Tk
+ * libraries in a Macintosh Application.
+ *
+ * Copyright (c) 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$
+ */
+
+/*
+ * New style DLOG templates have an extra field for the positioning
+ * options for the Dialog Box. We will not use this, for now, so we
+ * turn it off here.
+ */
+
+#define DLOG_RezTemplateVersion 0
+
+/*
+#include <Types.r>
+#include <SysTypes.r>
+#include <AEUserTermTypes.r>
+*/
+
+/*
+ * The folowing include and defines help construct
+ * the version string for Tcl.
+ */
+
+#define RESOURCE_INCLUDED
+#include <tcl.h>
+#include "tk.h"
+
+#if (TK_RELEASE_LEVEL == 0)
+# define RELEASE_LEVEL alpha
+#elif (TK_RELEASE_LEVEL == 1)
+# define RELEASE_LEVEL beta
+#elif (TK_RELEASE_LEVEL == 2)
+# define RELEASE_LEVEL final
+#endif
+
+#if (TK_RELEASE_LEVEL == 2)
+# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+#else
+# define MINOR_VERSION TK_MINOR_VERSION * 16
+#endif
+
+#define RELEASE_CODE 0x00
+
+resource 'vers' (1) {
+ TK_MAJOR_VERSION, MINOR_VERSION,
+ RELEASE_LEVEL, 0x00, verUS,
+ TK_PATCH_LEVEL,
+ TK_PATCH_LEVEL ",by Ray Johnson & Jim Ingham" "\n" "© 1993-1997 Sun Microsystems" "\n" "1998-2000 Scriptics Inc."
+};
+
+resource 'vers' (2) {
+ TK_MAJOR_VERSION, MINOR_VERSION,
+ RELEASE_LEVEL, 0x00, verUS,
+ TK_PATCH_LEVEL,
+ "Tk Library " TK_PATCH_LEVEL " © 1993-1999"
+};
+
+#define TK_LIBRARY_RESOURCES 3000
+/*
+ * The -16397 string will be displayed by Finder when a user
+ * tries to open the shared library. The string should
+ * give the user a little detail about the library's capabilities
+ * and enough information to install the library in the correct location.
+ * A similar string should be placed in all shared libraries.
+ */
+resource 'STR ' (-16397, purgeable) {
+ "Tk Library\n\n"
+ "This is the library needed to run Tcl/Tk programs. "
+ "To work properly, it should be placed in the Tool Command Language folder "
+ "within the Extensions folder."
+};
+
+
+/*
+ * We now load the Tk library into the resource fork of the library.
+ */
+
+read 'TEXT' (TK_LIBRARY_RESOURCES+1, "tk", purgeable)
+ "::library:tk.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+2, "button", purgeable)
+ "::library:button.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+3, "dialog", purgeable)
+ "::library:dialog.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+4, "entry", purgeable)
+ "::library:entry.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+5, "focus", purgeable)
+ "::library:focus.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+6, "listbox", purgeable)
+ "::library:listbox.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+7, "menu", purgeable)
+ "::library:menu.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+8, "optionMenu", purgeable)
+ "::library:optMenu.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+9, "palette", purgeable)
+ "::library:palette.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+10, "scale", purgeable)
+ "::library:scale.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+11, "scrollbar", purgeable)
+ "::library:scrlbar.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+12, "tearoff", purgeable)
+ "::library:tearoff.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+13, "text", purgeable)
+ "::library:text.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+14, "tkerror", purgeable)
+ "::library:bgerror.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+15, "Console", purgeable)
+ "::library:console.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+16, "msgbox", purgeable, preload)
+ "::library:msgbox.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+17, "comdlg", purgeable, preload)
+ "::library:comdlg.tcl";
+
+/*
+ * The following two resources define the default "About Box" for Mac Tk.
+ * This dialog appears if the "About Tk..." menu item is selected from
+ * the Apple menu. This dialog may be overridden by defining a Tcl procedure
+ * with the name of "tkAboutDialog". If this procedure is defined the
+ * default dialog will not be shown and the Tcl procedure is expected to
+ * create and manage an About Dialog box.
+ */
+
+data 'DLOG' (128, "Default About Box", purgeable) {
+ $"0055 006B 00F3 0196 0001 0100 0100 0000"
+ $"0000 0081 0000 280A"
+};
+
+resource 'DITL' (129, "About Box", purgeable) {
+ {
+ {128, 128, 148, 186}, Button {enabled, "Ok"},
+ { 14, 108, 117, 298}, StaticText {disabled,
+ "Wish - Windowing Shell" "\n" "based on Tcl "
+ TCL_PATCH_LEVEL " & Tk " TK_PATCH_LEVEL "\n\n" "Jim Ingham & Ray Johnson"
+ "Scriptics Inc." "\n" "jingham@cygnus.com"},
+ { 11, 24, 111, 92}, Picture {enabled, 128}
+ }
+};
+
+data 'PICT' (128, purgeable) {
+ $"13A4 0000 0000 0064 0044 0011 02FF 0C00"
+ $"FFFE 0000 0048 0000 0048 0000 0000 0000"
+ $"0064 0044 0000 0000 0001 000A 0000 0000"
+ $"0064 0044 0099 8044 0000 0000 0064 0044"
+ $"0000 0000 0000 0000 0048 0000 0048 0000"
+ $"0000 0008 0001 0008 0000 0000 0108 00D8"
+ $"0000 0000 0001 5A5A 8000 00FF 3736 FF00"
+ $"FF00 FF00 3535 FF00 FF00 CC00 3434 FF00"
+ $"FF00 9900 3333 FF00 FF00 6600 3736 FF00"
+ $"FF00 3300 3535 FF00 FF00 0000 3434 FF00"
+ $"CC00 FF00 3333 FF00 CC00 CC00 3736 FF00"
+ $"CC00 9900 3535 FF00 CC00 6600 FAFA FF00"
+ $"CC00 3300 3333 FF00 CC00 0000 3130 FF00"
+ $"9900 FF00 2F2F FF00 9900 CC00 FAFA FF00"
+ $"9900 9900 F9F9 FF00 9900 6600 3130 FF00"
+ $"9900 3300 2F2F FF00 9900 0000 2E2E FF00"
+ $"6600 FF00 F9F9 FF00 6600 CC00 3130 FF00"
+ $"6600 9900 2F2F FF00 6600 6600 2E2E FF00"
+ $"6600 3300 2D2D FF00 6600 0000 3130 FF00"
+ $"3300 FF00 2F2F FF00 3300 CC00 2E2E FF00"
+ $"3300 9900 2D2D FF00 3300 6600 3130 FF00"
+ $"3300 3300 2F2F FF00 3300 0000 2E2E FF00"
+ $"0000 FF00 2D2D FF00 0000 CC00 3130 FF00"
+ $"0000 9900 2F2F FF00 0000 6600 2E2E FF00"
+ $"0000 3300 2DF8 FF00 0000 0000 2B2A CC00"
+ $"FF00 FF00 2929 CC00 FF00 CC00 2828 CC00"
+ $"FF00 9900 27F8 CC00 FF00 6600 2B2A CC00"
+ $"FF00 3300 2929 CC00 FF00 0000 2828 CC00"
+ $"CC00 FF00 2727 CC00 CC00 CC00 2B2A CC00"
+ $"CC00 9900 2929 CC00 CC00 6600 2828 CC00"
+ $"CC00 3300 2727 CC00 CC00 0000 2B2A CC00"
+ $"9900 FF00 2929 CC00 9900 CC00 2828 CC00"
+ $"9900 9900 2727 CC00 9900 6600 DBDB CC00"
+ $"9900 3300 4747 CC00 9900 0000 4646 CC00"
+ $"6600 FF00 4545 CC00 6600 CC00 DBDB CC00"
+ $"6600 9900 4747 CC00 6600 6600 4646 CC00"
+ $"6600 3300 4545 CC00 6600 0000 DBDB CC00"
+ $"3300 FF00 4747 CC00 3300 CC00 4646 CC00"
+ $"3300 9900 4545 CC00 3300 6600 DBDB CC00"
+ $"3300 3300 4141 CC00 3300 0000 4040 CC00"
+ $"0000 FF00 3F3F CC00 0000 CC00 4342 CC00"
+ $"0000 9900 4141 CC00 0000 6600 4040 CC00"
+ $"0000 3300 3F3F CC00 0000 0000 4342 9900"
+ $"FF00 FF00 4141 9900 FF00 CC00 4040 9900"
+ $"FF00 9900 3F3F 9900 FF00 6600 4342 9900"
+ $"FF00 3300 4141 9900 FF00 0000 4040 9900"
+ $"CC00 FF00 3F3F 9900 CC00 CC00 4342 9900"
+ $"CC00 9900 4141 9900 CC00 6600 4040 9900"
+ $"CC00 3300 3F3F 9900 CC00 0000 4342 9900"
+ $"9900 FF00 4141 9900 9900 CC00 4040 9900"
+ $"9900 9900 3F3F 9900 9900 6600 3D3C 9900"
+ $"9900 3300 3B3B 9900 9900 0000 3A3A 9900"
+ $"6600 FF00 3939 9900 6600 CC00 3D3C 9900"
+ $"6600 9900 3B3B 9900 6600 6600 3A3A 9900"
+ $"6600 3300 3939 9900 6600 0000 3D3C 9900"
+ $"3300 FF00 3B3B 9900 3300 CC00 3A3A 9900"
+ $"3300 9900 3939 9900 3300 6600 3D3C 9900"
+ $"3300 3300 3B3B 9900 3300 0000 3A3A 9900"
+ $"0000 FF00 3939 9900 0000 CC00 3D3C 9900"
+ $"0000 9900 3B3B 9900 0000 6600 3A3A 9900"
+ $"0000 3300 3939 9900 0000 0000 3D3C 6600"
+ $"FF00 FF00 3B3B 6600 FF00 CC00 3A3A 6600"
+ $"FF00 9900 3939 6600 FF00 6600 3D3C 6600"
+ $"FF00 3300 3B3B 6600 FF00 0000 3A3A 6600"
+ $"CC00 FF00 3939 6600 CC00 CC00 3736 6600"
+ $"CC00 9900 3535 6600 CC00 6600 3434 6600"
+ $"CC00 3300 3333 6600 CC00 0000 3736 6600"
+ $"9900 FF00 3535 6600 9900 CC00 3434 6600"
+ $"9900 9900 3333 6600 9900 6600 3736 6600"
+ $"9900 3300 3535 6600 9900 0000 3434 6600"
+ $"6600 FF00 3333 6600 6600 CC00 3736 6600"
+ $"6600 9900 3535 6600 6600 6600 3434 6600"
+ $"6600 3300 3333 6600 6600 0000 3736 6600"
+ $"3300 FF00 3535 6600 3300 CC00 3434 6600"
+ $"3300 9900 3333 6600 3300 6600 3736 6600"
+ $"3300 3300 3535 6600 3300 0000 3434 6600"
+ $"0000 FF00 3333 6600 0000 CC00 3130 6600"
+ $"0000 9900 2F2F 6600 0000 6600 2E2E 6600"
+ $"0000 3300 F9F9 6600 0000 0000 3130 3300"
+ $"FF00 FF00 2F2F 3300 FF00 CC00 2E2E 3300"
+ $"FF00 9900 F9F9 3300 FF00 6600 3130 3300"
+ $"FF00 3300 2F2F 3300 FF00 0000 2E2E 3300"
+ $"CC00 FF00 2D2D 3300 CC00 CC00 3130 3300"
+ $"CC00 9900 2F2F 3300 CC00 6600 2E2E 3300"
+ $"CC00 3300 2D2D 3300 CC00 0000 3130 3300"
+ $"9900 FF00 2F2F 3300 9900 CC00 2E2E 3300"
+ $"9900 9900 2D2D 3300 9900 6600 3130 3300"
+ $"9900 3300 2F2F 3300 9900 0000 2E2E 3300"
+ $"6600 FF00 2DF8 3300 6600 CC00 2B2A 3300"
+ $"6600 9900 2929 3300 6600 6600 2828 3300"
+ $"6600 3300 27F8 3300 6600 0000 2B2A 3300"
+ $"3300 FF00 2929 3300 3300 CC00 2828 3300"
+ $"3300 9900 2727 3300 3300 6600 2B2A 3300"
+ $"3300 3300 2929 3300 3300 0000 2828 3300"
+ $"0000 FF00 2727 3300 0000 CC00 2B2A 3300"
+ $"0000 9900 2929 3300 0000 6600 2828 3300"
+ $"0000 3300 2727 3300 0000 0000 4948 0000"
+ $"FF00 FF00 4747 0000 FF00 CC00 4646 0000"
+ $"FF00 9900 4545 0000 FF00 6600 4948 0000"
+ $"FF00 3300 4747 0000 FF00 0000 4646 0000"
+ $"CC00 FF00 4545 0000 CC00 CC00 4948 0000"
+ $"CC00 9900 4747 0000 CC00 6600 4646 0000"
+ $"CC00 3300 4545 0000 CC00 0000 4342 0000"
+ $"9900 FF00 4141 0000 9900 CC00 4040 0000"
+ $"9900 9900 3F3F 0000 9900 6600 4342 0000"
+ $"9900 3300 4141 0000 9900 0000 4040 0000"
+ $"6600 FF00 3F3F 0000 6600 CC00 4342 0000"
+ $"6600 9900 4141 0000 6600 6600 4040 0000"
+ $"6600 3300 3F3F 0000 6600 0000 4342 0000"
+ $"3300 FF00 4141 0000 3300 CC00 4040 0000"
+ $"3300 9900 3F3F 0000 3300 6600 4342 0000"
+ $"3300 3300 4141 0000 3300 0000 4040 0000"
+ $"0000 FF00 3F3F 0000 0000 CC00 4342 0000"
+ $"0000 9900 4141 0000 0000 6600 4040 0000"
+ $"0000 3300 3F3F EE00 0000 0000 3D3C DD00"
+ $"0000 0000 3B3B BB00 0000 0000 3A3A AA00"
+ $"0000 0000 3939 8800 0000 0000 3D3C 7700"
+ $"0000 0000 3B3B 5500 0000 0000 3A3A 4400"
+ $"0000 0000 3939 2200 0000 0000 3D3C 1100"
+ $"0000 0000 3B3B 0000 EE00 0000 3A3A 0000"
+ $"DD00 0000 3939 0000 BB00 0000 3D3C 0000"
+ $"AA00 0000 3B3B 0000 8800 0000 3A3A 0000"
+ $"7700 0000 3939 0000 5500 0000 3D3C 0000"
+ $"4400 0000 3B3B 0000 2200 0000 3A3A 0000"
+ $"1100 0000 3939 0000 0000 EE00 3D3C 0000"
+ $"0000 DD00 3B3B 0000 0000 BB00 3A3A 0000"
+ $"0000 AA00 3939 0000 0000 8800 3D3C 0000"
+ $"0000 7700 3B3B 0000 0000 5500 3A3A 0000"
+ $"0000 4400 3939 0000 0000 2200 3736 0000"
+ $"0000 1100 3535 EE00 EE00 EE00 3434 DD00"
+ $"DD00 DD00 3333 BB00 BB00 BB00 3736 AA00"
+ $"AA00 AA00 3535 8800 8800 8800 3434 7700"
+ $"7700 7700 3333 5500 5500 5500 3736 4400"
+ $"4400 4400 3535 2200 2200 2200 3434 1100"
+ $"1100 1100 3333 0000 0000 0000 0000 0000"
+ $"0064 0044 0000 0000 0064 0044 0000 000A"
+ $"0000 0000 0064 0044 02BD 0013 E800 01F5"
+ $"F6FE 07FE 0E02 3232 33FD 3900 0EE6 001D"
+ $"FC00 01F5 F5FE 0700 08FE 0E02 3232 33FE"
+ $"3900 3AFC 40F2 4102 4033 07E9 0017 0100"
+ $"0EFC 40DC 4102 390E F5F5 0002 F5F5 F6FE"
+ $"0702 0E07 0016 0100 32D5 4104 4039 0E32"
+ $"33FD 3900 3AFC 40FC 4101 3200 0801 000E"
+ $"C141 010E 0008 0100 0EC1 4101 0800 0801"
+ $"000E C141 0107 0008 0100 0EC1 4101 0700"
+ $"0901 0007 C241 0240 F500 0E01 0007 E841"
+ $"0147 47DD 4102 4000 0012 0100 07F0 4100"
+ $"47FA 4101 3B3B DD41 0240 0000 1901 0007"
+ $"F141 0C47 3B0B 3B47 4141 4711 0505 3B47"
+ $"DF41 023A 0000 1701 00F6 F041 010B 0BFE"
+ $"4105 473B 0505 113B DE41 0239 0000 1A02"
+ $"00F5 40F3 410C 473B 053B 4741 4741 0B0B"
+ $"3B47 47DE 4102 3900 0018 0200 F540 F341"
+ $"0247 110B FE41 0447 1105 4147 DC41 0233"
+ $"0000 1B02 0000 40F3 4103 4711 1147 FE41"
+ $"0205 3547 F741 FD47 E941 0232 0000 1E02"
+ $"0000 40F2 4106 113B 4741 4735 0BF7 4106"
+ $"4741 390E 0E40 47EA 4102 0E00 0021 0200"
+ $"0040 F241 0711 3B47 4141 0B35 47F9 4102"
+ $"4740 07FE 0002 F640 47EB 4102 0E00 0023"
+ $"0200 0040 F341 0847 3541 4147 3B05 4147"
+ $"FA41 0947 3AF6 00F5 4F55 F50E 47EB 4102"
+ $"0700 0022 0200 003A F341 0147 3BFE 4101"
+ $"0B0B F941 0547 3AF5 0055 C8FE CE01 5640"
+ $"EB41 0207 0000 1F02 0000 39F0 4104 4741"
+ $"053B 47FB 4104 4740 F5F5 A4FC CE01 C85D"
+ $"EB41 02F6 0000 1F02 0000 39F0 4104 473B"
+ $"0541 47FC 4104 4740 07F6 C8FA CE00 64EC"
+ $"4103 40F5 0000 1C02 0000 39F0 4102 4711"
+ $"0BFA 4103 4708 2AC8 FACE 0164 D8EC 4100"
+ $"40FE 0025 0200 0039 EF41 020B 3B47 FC41"
+ $"0347 0FF5 A4FB CE02 C887 D8FC 41FE 47FC"
+ $"4100 47F9 4100 3AFE 0028 0200 0039 EF41"
+ $"020B 3B47 FD41 0347 3900 A4FA CE00 ABFA"
+ $"4109 3B11 3B41 4147 3B0B 3B47 FA41 0039"
+ $"FE00 2402 0000 33F1 4102 4741 0BFA 4101"
+ $"0779 F9CE 0064 FA41 0235 050B FD41 010B"
+ $"0BF9 4100 39FE 0028 0200 0032 F141 0247"
+ $"3B0B FC41 0247 39F6 F9CE 0187 D8FB 4103"
+ $"4741 050B FE41 0247 110B F941 0039 FE00"
+ $"2C02 0000 32F1 4102 473B 11FB 4101 0879"
+ $"FACE 05AA 4041 4147 47FE 410A 4741 0511"
+ $"4741 4147 3511 47FA 4100 32FE 002F 0200"
+ $"000E F141 0347 3B11 47FE 4103 4740 F6C8"
+ $"FACE 0564 D841 4039 39FE 4104 473B 053B"
+ $"47FE 4102 3541 47FA 4100 0EFE 0027 0200"
+ $"000E F141 0347 3B3B 47FE 4102 470F 79FA"
+ $"CE0C 8741 4032 F500 003A 4741 473B 05F2"
+ $"4100 0EFE 0027 0200 000E F141 0347 3B3B"
+ $"47FD 4101 0EA4 FACE 01AB AAFE C808 7900"
+ $"3947 4147 110B 47F3 4100 07FE 001C 0200"
+ $"000E EA41 0240 2BC8 F5CE 0881 0033 4741"
+ $"410B 3B47 F341 0007 FE00 1A02 0000 08EB"
+ $"4102 473A 55F4 CE06 5D00 3947 4741 0BF1"
+ $"4100 F6FE 001C 0200 0007 EB41 0247 3979"
+ $"F4CE 0739 0039 4747 3511 47F3 4101 40F5"
+ $"FE00 1C02 0000 07EB 4102 4739 A4F5 CE08"
+ $"AB0E 0040 4741 1141 47F3 4100 40FD 001B"
+ $"0200 0007 EB41 0247 39A4 F5CE 0787 0707"
+ $"4147 4111 47F2 4100 40FD 001B 0200 0007"
+ $"EB41 0247 39C8 F5CE 0763 F532 4747 3B3B"
+ $"47F2 4100 3AFD 001A 0300 00F6 40EC 4102"
+ $"4739 C8F5 CE05 39F5 4047 413B F041 0039"
+ $"FD00 1C03 0000 F540 EB41 0140 C8FD CE01"
+ $"C8A4 FCCE 03AB 080E 47ED 4100 39FD 001A"
+ $"FE00 0040 EB41 0040 FCCE 01A4 C8FC CE03"
+ $"FA07 4047 ED41 0032 FD00 1AFE 0000 40EA"
+ $"4100 AAFE CE02 87F9 C8FC CE02 560F 47EC"
+ $"4100 32FD 0019 FE00 0040 EA41 00AB FECE"
+ $"0264 56C8 FDCE 01C8 32EA 4100 0EFD 001B"
+ $"FE00 0040 ED41 030E 4047 87FE CE01 4055"
+ $"FCCE 01FA 40EA 4100 08FD 001A FE00 003A"
+ $"ED41 0807 0740 FBCE CEAB 3979 FDCE 00AB"
+ $"E841 0007 FD00 1CFE 0000 3AED 4108 0700"
+ $"F6A4 CECE 8733 79FD CE02 4147 47EA 4100"
+ $"07FD 001E FE00 0039 ED41 0807 2AA4 C8CE"
+ $"CE88 0E9D FECE 0364 1C39 39EB 4101 40F5"
+ $"FD00 1CFE 0000 39ED 4101 074F FDCE 0264"
+ $"F7A4 FECE 03AB 80F6 07EB 4100 40FC 001C"
+ $"FE00 0039 ED41 0108 79FE CE03 AB40 2BA4"
+ $"FCCE 02F7 0E47 EC41 0040 FC00 1CFE 0000"
+ $"39ED 4101 0879 FECE 03AB 40F6 C8FC CE02"
+ $"F615 47EC 4100 40FC 001E FE00 003A EE41"
+ $"0247 0E79 FECE 03AB 40F5 C8FD CE03 A4F5"
+ $"3A47 EC41 0040 FC00 1EFE 0000 3AEE 4102"
+ $"470E 56FE CE03 FB3A F6C8 FDCE 0280 F540"
+ $"EB41 0140 F5FD 001E FE00 0040 EE41 0947"
+ $"0F56 CECE C888 39F6 C8FD CE02 5601 40EB"
+ $"4101 40F5 FD00 1CFE 0000 40EE 4109 4739"
+ $"32CE CEC8 8839 2AC8 FDCE 0156 07E9 4100"
+ $"F6FD 001B FE00 0040 EE41 0847 3A32 CECE"
+ $"C864 152A FCCE 0132 07E9 4100 07FD 001A"
+ $"FE00 0040 ED41 0740 32AB CEC8 6439 4EFC"
+ $"CE01 3A07 E941 0007 FD00 1D03 0000 F540"
+ $"ED41 0740 0EAB CECE 640F 4EFD CE03 AB40"
+ $"0840 EA41 0007 FD00 1B03 0000 F540 EC41"
+ $"060F 81CE CE64 334E FDCE 02AB 400E E941"
+ $"000E FD00 1C02 0000 F6EC 4107 4715 FACE"
+ $"CE64 334E FDCE 0387 0F0E 47EA 4100 0EFD"
+ $"001C 0200 0007 EC41 0747 16F9 CEC8 6433"
+ $"4EFD CE03 6308 4047 EA41 000E FD00 1A02"
+ $"0000 07EB 4106 40F9 CEC8 6439 4EFD CE02"
+ $"3940 47E9 4100 32FD 001B 0200 0007 EA41"
+ $"0539 CECE 8839 F6FE CE04 AB41 4139 40EA"
+ $"4100 32FD 001C 0200 0007 EB41 0E47 3AC8"
+ $"CE88 39F6 C8CE CE64 15F6 F540 EA41 0033"
+ $"FD00 1A02 0000 07EA 410C 40A4 CE87 392A"
+ $"C8CE AB41 40F8 F6E9 4100 39FD 001B 0200"
+ $"000E EB41 0D47 41AB C887 39F5 C8CE ABAB"
+ $"CEA4 07E9 4100 39FD 001C 0200 000E ED41"
+ $"0947 3939 4787 C8AB 40F5 C8FD CE01 A40E"
+ $"E941 0039 FD00 1D02 0000 0EED 4109 473A"
+ $"0007 80CE AB40 F5C8 FDCE 0255 0E47 EA41"
+ $"0039 FD00 1B02 0000 0EEB 4107 0779 C8CE"
+ $"CE40 F6A4 FDCE 022B 3947 EA41 003A FD00"
+ $"1C02 0000 0EEC 4102 4739 79FE CE02 6407"
+ $"A4FE CE02 A407 40E9 4100 40FD 001A 0200"
+ $"0032 EA41 0632 A4CE CE88 0879 FECE 02F9"
+ $"0F47 E941 0040 FD00 1A02 0000 32EB 4107"
+ $"4740 F7C8 CE87 0E79 FECE 0132 40E8 4100"
+ $"40FD 0019 0200 0033 EA41 0B47 40F8 C8AB"
+ $"0E55 CECE 8015 47E8 4100 40FD 0017 0200"
+ $"0033 E941 0847 40F9 A439 4FCE CE5D E641"
+ $"0140 F5FE 0014 0200 0039 E841 0647 64FB"
+ $"392B C8AB E441 00F6 FE00 1102 0000 39E5"
+ $"4103 40F6 8764 E441 0007 FE00 1E02 0000"
+ $"39EB 4102 3A0E 0EFD 4102 0740 47F6 4104"
+ $"400F 0839 47F4 4100 07FE 0027 0200 0039"
+ $"FB41 0147 47F2 4102 0800 40FE 4102 0839"
+ $"47FC 4101 4747 FC41 0339 0039 47F4 4100"
+ $"07FE 0029 0200 0039 FB41 0140 39F3 4109"
+ $"470E F540 4141 470E 3347 FC41 0139 3AFD"
+ $"4104 4739 0039 47F4 4100 08FE 0036 0200"
+ $"003A FC41 0347 0E00 40FC 4102 4741 40FC"
+ $"4109 470E F540 4141 4733 0E47 FE41 0447"
+ $"4000 0E47 FE41 0447 3900 3941 FE40 F741"
+ $"000E FE00 3A02 0000 3AFD 410E 4740 0700"
+ $"0E40 4741 4147 390E 390E 40FE 4108 470E"
+ $"F540 4141 4739 0EFC 4103 0F00 0739 FE41"
+ $"0747 3900 3940 080F 39F7 4100 0EFE 0035"
+ $"0200 0040 FB41 020E 0040 FE41 0D47 4000"
+ $"3941 0032 4741 4147 0EF5 40FE 4101 4008"
+ $"FC41 023A 000E FD41 0547 3900 3939 33F5"
+ $"4100 0EFE 0039 0200 0040 FC41 0347 0E00"
+ $"40FE 4106 4732 0040 4139 40FE 4103 470E"
+ $"F540 FD41 0108 40FE 4104 4740 000E 47FE"
+ $"4106 4739 0007 F540 47F6 4100 32FE 003A"
+ $"0200 0040 FC41 0C47 0E00 4047 4141 470E"
+ $"0040 4747 FD41 0347 0EF5 40FE 410A 470E"
+ $"3947 4141 4740 000E 47FE 4107 4739 000E"
+ $"0007 4147 F741 0032 FE00 3802 0000 40FC"
+ $"4102 470E 00FD 4106 4739 003A 4740 39FE"
+ $"4102 470E F5FD 410A 4733 3347 4141 4740"
+ $"000E 47FE 4106 4739 0039 3900 0EF6 4100"
+ $"33FE 003A 0200 F540 FC41 0447 3200 0E39"
+ $"FD41 0B0E 0E40 333A 4741 413A 07F5 39FE"
+ $"4102 473A 0EFD 410F 40F5 0733 4041 4140"
+ $"0E00 0E40 0700 0E40 F841 0039 FE00 2902"
+ $"00F5 40FA 4101 3939 FB41 023A 3A40 FD41"
+ $"FD40 FD41 0240 0E40 FD41 0240 3940 FD41"
+ $"FA40 F741 0039 FE00 2A01 00F6 F941 0147"
+ $"47FB 4101 4747 FB41 0147 47FB 4101 3940"
+ $"FD41 0147 47FB 4100 47FE 4100 47F6 4100"
+ $"39FE 000D 0100 07E1 4100 40E4 4100 3AFE"
+ $"0009 0100 07C3 4100 3AFE 0009 0100 07C3"
+ $"4100 40FE 0009 0100 07C3 4100 40FE 0009"
+ $"0100 07C3 4100 40FE 000A 0100 0EC3 4103"
+ $"40F5 0000 0901 000E C241 02F6 0000 0901"
+ $"000E C241 0207 0000 0901 000E C241 0207"
+ $"0000 1101 000E ED41 FE40 003A F940 E241"
+ $"0207 0000 2B01 0032 F941 FE40 FE39 0632"
+ $"0E0E 0707 F6F5 F800 02F5 F5F6 FB07 FB0E"
+ $"0332 3233 33FB 3901 3A3A FB40 0207 0000"
+ $"0E0A 000E 3939 320E 0E07 07F6 F5C8 0002"
+ $"BD00 00FF"
+};
+
+/*
+ * Here is the custom file open dialog. This dialog is used instead of
+ * the default file dialog if the -filetypes flag is specified.
+ */
+
+#define DLOG_RezTemplateVersion 0
+
+resource 'DLOG' (130, purgeable) {
+ {0, 0, 195, 344}, dBoxProc, invisible, noGoAway, 0,
+ 130, ""
+};
+
+resource 'DITL' (130, "File Open Box", purgeable) {
+ {
+ {135, 252, 155, 332}, Button {enabled, "Open"},
+ {104, 252, 124, 332}, Button {enabled, "Cancel"},
+ { 0, 0, 0, 0}, HelpItem {disabled, HMScanhdlg {130}},
+ { 8, 235, 24, 337}, UserItem {enabled},
+ { 32, 252, 52, 332}, Button {enabled, "Eject"},
+ { 60, 252, 80, 332}, Button {enabled, "Desktop"},
+ { 29, 12, 159, 230}, UserItem {enabled},
+ { 6, 12, 25, 230}, UserItem {enabled},
+ { 91, 251, 92, 333}, Picture {disabled, 11},
+ {168, 20, 187, 300}, Control {enabled, 131}
+ }
+};
+
+resource 'CNTL' (131, "File Types menu", purgeable) {
+ {168, 20, 187, 300},
+ popupTitleLeftJust,
+ visible,
+ 80,
+ 132,
+ popupMenuCDEFProc,
+ 0,
+ "File Type:"
+};
+
+
+resource 'MENU' (132, preload) {
+ 132,
+ textMenuProc,
+ 0xFFFF, enabled, "", {}
+};
diff --git a/tk/macosx/tkMacOSXMenu.c b/tk/macosx/tkMacOSXMenu.c
new file mode 100644
index 00000000000..f0611222980
--- /dev/null
+++ b/tk/macosx/tkMacOSXMenu.c
@@ -0,0 +1,4691 @@
+/*
+ * tkMacOSXMenu.c --
+ *
+ * This module implements the Mac-platform specific features of menus.
+ *
+ * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+#include "tkMacOSXInt.h"
+#include "tkMenuButton.h"
+#include "tkMenu.h"
+#include "tkColor.h"
+#include "tkMacOSXInt.h"
+#undef Status
+
+#define USE_TK_MDEF
+//#define USE_ATSU
+
+#include <Carbon/Carbon.h>
+#include "tkMacOSXDebug.h"
+#include <CoreFoundation/CFString.h>
+
+typedef struct MacMenu {
+ MenuRef menuHdl; /* The Menu Manager data structure. */
+ Rect menuRect; /* The rectangle as calculated in the
+ * MDEF. This is used to figure ou the
+ * clipping rgn before we push
+ * the <<MenuSelect>> virtual binding
+ * through. */
+} MacMenu;
+
+typedef struct MenuEntryUserData {
+ Drawable mdefDrawable;
+ TkMenuEntry *mePtr;
+ Tk_Font tkfont;
+ Tk_FontMetrics *fmPtr;
+} MenuEntryUserData;
+/*
+ * Various geometry definitions:
+ */
+
+#define CASCADE_ARROW_HEIGHT 10
+#define CASCADE_ARROW_WIDTH 8
+#define DECORATION_BORDER_WIDTH 2
+#define MAC_MARGIN_WIDTH 8
+
+/*
+ * The following are constants relating to the SICNs used for drawing the MDEF.
+ */
+
+#define SICN_RESOURCE_NUMBER 128
+
+#define SICN_HEIGHT 16
+#define SICN_ROWS 2
+#define CASCADE_ICON_WIDTH 7
+#define SHIFT_ICON_WIDTH 10
+#define OPTION_ICON_WIDTH 16
+#define CONTROL_ICON_WIDTH 12
+#define COMMAND_ICON_WIDTH 10
+
+#define CASCADE_ARROW 0
+#define SHIFT_ICON 1
+#define OPTION_ICON 2
+#define CONTROL_ICON 3
+#define COMMAND_ICON 4
+#define DOWN_ARROW 5
+#define UP_ARROW 6
+
+/*
+ * Platform specific flags for menu entries
+ *
+ * ENTRY_COMMAND_ACCEL Indicates the entry has the command key
+ * in its accelerator string.
+ * ENTRY_OPTION_ACCEL Indicates the entry has the option key
+ * in its accelerator string.
+ * ENTRY_SHIFT_ACCEL Indicates the entry has the shift key
+ * in its accelerator string.
+ * ENTRY_CONTROL_ACCEL Indicates the entry has the control key
+ * in its accelerator string.
+ */
+
+#define ENTRY_COMMAND_ACCEL ENTRY_PLATFORM_FLAG1
+#define ENTRY_OPTION_ACCEL ENTRY_PLATFORM_FLAG2
+#define ENTRY_SHIFT_ACCEL ENTRY_PLATFORM_FLAG3
+#define ENTRY_CONTROL_ACCEL ENTRY_PLATFORM_FLAG4
+#define ENTRY_ACCEL_MASK (ENTRY_COMMAND_ACCEL | ENTRY_OPTION_ACCEL \
+ | ENTRY_SHIFT_ACCEL | ENTRY_CONTROL_ACCEL)
+
+/*
+ * This structure is used to keep track of subfields within Macintosh menu
+ * items.
+ */
+
+typedef struct EntryGeometry {
+ int accelTextStart; /* Offset into the accel string where
+ * the text starts. Everything before
+ * this is modifier key descriptions.
+ */
+ int modifierWidth; /* Width of modifier symbols. */
+ int accelTextWidth; /* Width of the text after the modifier
+ * keys. */
+ int nonAccelMargin; /* The width of the margin for entries
+ * without accelerators. */
+} EntryGeometry;
+
+/*
+ * Structure to keep track of toplevel windows and their menubars.
+ */
+
+typedef struct TopLevelMenubarList {
+ struct TopLevelMenubarList *nextPtr;
+ /* The next window in the list. */
+ Tk_Window tkwin; /* The toplevel window. */
+ TkMenu *menuPtr; /* The menu associated with this
+ * toplevel. */
+} TopLevelMenubarList;
+
+/*
+ * Platform-specific flags for menus.
+ *
+ * MENU_APPLE_MENU 0 indicates a custom Apple menu has
+ * not been installed; 1 a custom Apple
+ * menu has been installed.
+ * MENU_HELP_MENU 0 indicates a custom Help menu has
+ * not been installed; 1 a custom Help
+ * menu has been installed.
+ * MENU_RECONFIGURE_PENDING 1 indicates that an idle handler has
+ * been scheduled to reconfigure the
+ * Macintosh MenuHandle.
+ */
+
+#define MENU_APPLE_MENU MENU_PLATFORM_FLAG1
+#define MENU_HELP_MENU MENU_PLATFORM_FLAG2
+#define MENU_RECONFIGURE_PENDING MENU_PLATFORM_FLAG3
+
+#define CASCADE_CMD (0x1b)
+ /* The special command char for cascade
+ * menus. */
+#define SEPARATOR_TEXT "\p(-"
+ /* The text for a menu separator. */
+
+#define MENUBAR_REDRAW_PENDING 1
+#define SCREEN_MARGIN 5
+
+static int gNoTkMenus = 0; /* This is used by Tk_MacOSXTurnOffMenus as the
+ * flag that Tk is not to draw any menus. */
+
+RgnHandle tkMenuCascadeRgn = NULL;
+ /* The region to clip drawing to when the
+ * MDEF is up. */
+int tkUseMenuCascadeRgn = 0; /* If this is 1, clipping code
+ * should intersect tkMenuCascadeRgn
+ * before drawing occurs.
+ * tkMenuCascadeRgn will only
+ * be valid when the value of this
+ * variable is 1. */
+
+static Tcl_HashTable commandTable;
+ /* The list of menuInstancePtrs associated with
+ * menu ids */
+static short currentAppleMenuID;
+ /* The id of the current Apple menu. 0 for
+ * none. */
+static short currentHelpMenuID; /* The id of the current Help menu. 0 for
+ * none. */
+static Tcl_Interp *currentMenuBarInterp;
+ /* The interpreter of the window that owns
+ * the current menubar. */
+static char *currentMenuBarName;
+ /* Malloced. Name of current menu in menu bar.
+ * NULL if no menu set. TO DO: make this a
+ * DString. */
+static Tk_Window currentMenuBarOwner;
+ /* Which window owns the current menu bar. */
+static char elipsisString[TCL_UTF_MAX + 1];
+ /* The UTF representation of the elipsis (...)
+ * character. */
+static int helpItemCount; /* The number of items in the help menu.
+ * -1 means that the help menu is
+ * unavailable. This does not include
+ * the automatically generated separator. */
+static int inPostMenu; /* We cannot be re-entrant like X
+ * windows. */
+static short lastMenuID; /* To pass to NewMenu; need to figure out
+ * a good way to do this. */
+static short lastCascadeID;
+ /* Cascades have to have ids that are
+ * less than 256. */
+static MacDrawable macMDEFDrawable;
+ /* Drawable for use by MDEF code */
+static int MDEFScrollFlag = 0; /* Used so that popups don't scroll too soon. */
+static int menuBarFlags; /* Used for whether the menu bar needs
+ * redrawing or not. */
+
+static struct TearoffSelect {
+ TkMenu *menuPtr; /* The menu that is torn off */
+ Point point; /* The point to place the new menu */
+ Rect excludeRect; /* We don't want to drag tearoff highlights
+ * when we are in this menu */
+} tearoffStruct;
+
+static RgnHandle totalMenuRgn = NULL;
+ /* Used to update windows which have been
+ * obscured by menus. */
+static RgnHandle utilRgn = NULL;/* Used when creating the region that is to
+ * be clipped out while the MDEF is active. */
+
+static TopLevelMenubarList *windowListPtr;
+ /* A list of windows that have menubars set. */
+static MenuItemDrawingUPP tkThemeMenuItemDrawingUPP;
+ /* Points to the UPP for theme Item drawing. */
+static Tcl_Obj *useMDEFVar;
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+int TkMacOSXGetNewMenuID _ANSI_ARGS_((Tcl_Interp *interp,
+ TkMenu *menuInstPtr,
+ int cascade,
+ short *menuIDPtr));
+void TkMacOSXFreeMenuID _ANSI_ARGS_((short menuID));
+
+static void CompleteIdlers _ANSI_ARGS_((TkMenu *menuPtr));
+static void DrawMenuBarWhenIdle _ANSI_ARGS_((
+ ClientData clientData));
+static void DrawMenuBackground _ANSI_ARGS_((
+ Rect *menuRectPtr, Drawable d, ThemeMenuType type));
+static void DrawMenuEntryAccelerator _ANSI_ARGS_((
+ TkMenu *menuPtr, TkMenuEntry *mePtr,
+ Drawable d, GC gc, Tk_Font tkfont,
+ CONST Tk_FontMetrics *fmPtr,
+ Tk_3DBorder activeBorder, int x, int y,
+ int width, int height, int drawArrow));
+static void DrawMenuEntryBackground _ANSI_ARGS_((
+ TkMenu *menuPtr, TkMenuEntry *mePtr,
+ Drawable d, Tk_3DBorder activeBorder,
+ Tk_3DBorder bgBorder, int x, int y,
+ int width, int heigth));
+static void DrawMenuEntryIndicator _ANSI_ARGS_((
+ TkMenu *menuPtr, TkMenuEntry *mePtr,
+ Drawable d, GC gc, GC indicatorGC,
+ Tk_Font tkfont,
+ CONST Tk_FontMetrics *fmPtr, int x, int y,
+ int width, int height));
+static void DrawMenuEntryLabel _ANSI_ARGS_((
+ TkMenu * menuPtr, TkMenuEntry *mePtr, Drawable d,
+ GC gc, Tk_Font tkfont,
+ CONST Tk_FontMetrics *fmPtr, int x, int y,
+ int width, int height));
+static void DrawMenuSeparator _ANSI_ARGS_((TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Drawable d, GC gc,
+ Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ int x, int y, int width, int height));
+static void DrawTearoffEntry _ANSI_ARGS_((TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Drawable d, GC gc,
+ Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ int x, int y, int width, int height));
+static void GetEntryText _ANSI_ARGS_((TkMenuEntry *mePtr,
+ Tcl_DString *dStringPtr));
+static void GetMenuAccelGeometry _ANSI_ARGS_((TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Tk_Font tkfont,
+ CONST Tk_FontMetrics *fmPtr, int *modWidthPtr,
+ int *textWidthPtr, int *heightPtr));
+static void GetMenuLabelGeometry _ANSI_ARGS_((TkMenuEntry *mePtr,
+ Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ int *widthPtr, int *heightPtr));
+static void GetMenuIndicatorGeometry _ANSI_ARGS_((
+ TkMenu *menuPtr, TkMenuEntry *mePtr,
+ Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ int *widthPtr, int *heightPtr));
+static void GetMenuSeparatorGeometry _ANSI_ARGS_((
+ TkMenu *menuPtr, TkMenuEntry *mePtr,
+ Tk_Font tkfont, CONST Tk_FontMetrics *fmPtr,
+ int *widthPtr, int *heightPtr));
+static void GetTearoffEntryGeometry _ANSI_ARGS_((TkMenu *menuPtr,
+ TkMenuEntry *mePtr, Tk_Font tkfont,
+ CONST Tk_FontMetrics *fmPtr, int *widthPtr,
+ int *heightPtr));
+static char FindMarkCharacter _ANSI_ARGS_((TkMenuEntry *mePtr));
+static void InvalidateMDEFRgns _ANSI_ARGS_((void));
+
+static void MenuDefProc _ANSI_ARGS_((short message,
+ MenuHandle menu, Rect *menuRectPtr,
+ Point hitPt, short *whichItem ));
+static void HandleMenuHiliteMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr);
+static void HandleMenuDrawMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr);
+static void HandleMenuFindItemsMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr);
+static void HandleMenuPopUpMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr);
+static void HandleMenuCalcItemMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr);
+
+static void MenuSelectEvent _ANSI_ARGS_((TkMenu *menuPtr));
+static void ReconfigureIndividualMenu _ANSI_ARGS_((
+ TkMenu *menuPtr, MenuHandle macMenuHdl,
+ int base));
+static void ReconfigureMacintoshMenu _ANSI_ARGS_ ((
+ ClientData clientData));
+static void RecursivelyClearActiveMenu _ANSI_ARGS_((
+ TkMenu *menuPtr));
+static void RecursivelyDeleteMenu _ANSI_ARGS_((
+ TkMenu *menuPtr));
+static void RecursivelyInsertMenu _ANSI_ARGS_((
+ TkMenu *menuPtr));
+static void SetDefaultMenubar _ANSI_ARGS_((void));
+static int SetMenuCascade _ANSI_ARGS_((TkMenu *menuPtr));
+static void mySetMenuTitle _ANSI_ARGS_((MenuHandle menuHdl,
+ Tcl_Obj *titlePtr));
+static void AppearanceEntryDrawWrapper _ANSI_ARGS_((TkMenuEntry *mePtr,
+ Rect * menuRectPtr, MenuTrackingData *mtdPtr,
+ Drawable d, Tk_FontMetrics *fmPtr, Tk_Font tkfont,
+ int x, int y, int width, int height));
+pascal void tkThemeMenuItemDrawingProc _ANSI_ARGS_ ((const Rect *inBounds,
+ SInt16 inDepth, Boolean inIsColorDevice,
+ SInt32 inUserData));
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXUseID --
+ *
+ * Take the ID out of the available list for new menus. Used by the
+ * default menu bar's menus so that they do not get created at the tk
+ * level. See TkMacOSXGetNewMenuID for more information.
+ *
+ * Results:
+ * Returns TCL_OK if the id was not in use. Returns TCL_ERROR if the
+ * id was in use.
+ *
+ * Side effects:
+ * A hash table entry in the command table is created with a NULL
+ * value.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXUseMenuID(
+ short macID) /* The id to take out of the table */
+{
+ Tcl_HashEntry *commandEntryPtr;
+ int newEntry;
+ int iMacID = macID; /* Do this to remove compiler warning */
+
+ TkMenuInit();
+ commandEntryPtr = Tcl_CreateHashEntry(&commandTable, (char *) iMacID,
+ &newEntry);
+ if (newEntry == 1) {
+ Tcl_SetHashValue(commandEntryPtr, NULL);
+ return TCL_OK;
+ } else {
+ return TCL_ERROR;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetNewMenuID --
+ *
+ * Allocates a new menu id and marks it in use. Each menu on the
+ * mac must be designated by a unique id, which is a short. In
+ * addition, some ids are reserved by the system. Since Tk uses
+ * mostly dynamic menus, we must allocate and free these ids on
+ * the fly. We use the id as a key into a hash table; if there
+ * is no hash entry, we know that we can use the id.
+ *
+ * Carbon allows a much larger number of menus than the old APIs.
+ * I believe this is 32768, but am not sure. This code just uses
+ * 2000 as the upper limit. Unfortunately tk leaks menus when
+ * cloning, under some circumstances (see bug on sourceforge).
+ *
+ * Results:
+ * Returns TCL_OK if succesful; TCL_ERROR if there are no more
+ * ids of the appropriate type to allocate. menuIDPtr contains
+ * the new id if succesful.
+ *
+ * Side effects:
+ * An entry is created for the menu in the command hash table,
+ * and the hash entry is stored in the appropriate field in the
+ * menu data structure.
+ *
+ *----------------------------------------------------------------------
+ */
+int
+ TkMacOSXGetNewMenuID(
+ Tcl_Interp *interp, /* Used for error reporting */
+ TkMenu *menuPtr, /* The menu we are working with */
+ int cascade, /* 0 if we are working with a normal menu;
+ 1 if we are working with a cascade */
+ short *menuIDPtr) /* The resulting id */
+{
+ int found = 0;
+ int newEntry;
+ Tcl_HashEntry *commandEntryPtr = NULL;
+ short returnID = *menuIDPtr;
+
+ /*
+ * The following code relies on shorts and unsigned chars wrapping
+ * when the highest value is incremented. Also, the values between
+ * 236 and 255 inclusive are reserved for DA's by the Mac OS.
+ */
+
+ if (!cascade) {
+ short curID = lastMenuID + 1;
+ if (curID == 236) {
+ curID = 256;
+ }
+
+ while (curID != lastMenuID) {
+ int iCurID = curID;
+ commandEntryPtr = Tcl_CreateHashEntry(&commandTable,
+ (char *) iCurID, &newEntry);
+ if (newEntry == 1) {
+ found = 1;
+ lastMenuID = returnID = curID;
+ break;
+ }
+ curID++;
+ if (curID == 236) {
+ curID = 256;
+ }
+ }
+ } else {
+
+ /*
+ * Cascade ids must be between 0 and 235 only, so they must be
+ * dealt with separately.
+ */
+
+ short curID = lastCascadeID + 1;
+ if (curID == 2000) {
+ curID = 0;
+ }
+
+ while (curID != lastCascadeID) {
+ int iCurID = curID;
+ commandEntryPtr = Tcl_CreateHashEntry(&commandTable,
+ (char *) iCurID, &newEntry);
+ if (newEntry == 1) {
+ found = 1;
+ lastCascadeID = returnID = curID;
+ break;
+ }
+ curID++;
+ if (curID == 2000) {
+ curID = 0;
+ }
+ }
+ }
+
+ if (found) {
+ Tcl_SetHashValue(commandEntryPtr, (char *) menuPtr);
+ *menuIDPtr = returnID;
+ return TCL_OK;
+ } else {
+ Tcl_ResetResult(interp);
+ Tcl_AppendResult(interp, "No more menus can be allocated.",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXFreeMenuID --
+ *
+ * Marks the id as free.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The hash table entry for the ID is cleared.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXFreeMenuID(
+ short menuID) /* The id to free */
+{
+ Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(&commandTable,
+ (char *) ((int)menuID));
+
+ if (entryPtr != NULL) {
+ Tcl_DeleteHashEntry(entryPtr);
+ }
+ if (menuID == currentAppleMenuID) {
+ currentAppleMenuID = 0;
+ }
+ if (menuID == currentHelpMenuID) {
+ currentHelpMenuID = 0;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpNewMenu --
+ *
+ * Gets a new blank menu. Only the platform specific options are filled
+ * in.
+ *
+ * Results:
+ * Returns a standard TCL error.
+ *
+ * Side effects:
+ * Allocates a Macintosh menu handle and puts in the platformData
+ * field of the menuPtr.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpNewMenu(
+ TkMenu *menuPtr) /* The common structure we are making the
+ * platform structure for. */
+{
+ short menuID;
+ Str255 itemText;
+ int length;
+ MenuRef macMenuHdl;
+ MenuDefSpec menuDefSpec;
+ Tcl_Obj *useMDEFObjPtr;
+ int useMDEF;
+ int error = TCL_OK;
+ int err;
+
+
+ error = TkMacOSXGetNewMenuID(menuPtr->interp, menuPtr, 0, &menuID);
+ if (error != TCL_OK) {
+ return error;
+ }
+ length = strlen(Tk_PathName(menuPtr->tkwin));
+ memmove(&itemText[1], Tk_PathName(menuPtr->tkwin),
+ (length > 230) ? 230 : length);
+ itemText[0] = (length > 230) ? 230 : length;
+ macMenuHdl = NewMenu(menuID, itemText);
+
+ /*
+ * Check whether we want to use the custom mdef or not. For now
+ * the default is to use it unless the variable is explicitly
+ * set to no.
+ */
+
+ useMDEFObjPtr = Tcl_ObjGetVar2(menuPtr->interp, useMDEFVar, NULL, TCL_GLOBAL_ONLY);
+ if (useMDEFObjPtr == NULL
+ || Tcl_GetBooleanFromObj(NULL, useMDEFObjPtr, &useMDEF) == TCL_ERROR
+ || useMDEF) {
+ menuDefSpec.defType = kMenuDefProcPtr;
+ menuDefSpec.u.defProc = MenuDefProc;
+ if ((err = SetMenuDefinition(macMenuHdl, &menuDefSpec)) != noErr) {
+ fprintf(stderr, "SetMenuDefinition failed %d\n", err );
+ }
+ }
+ menuPtr->platformData = (TkMenuPlatformData) ckalloc(sizeof(MacMenu));
+ ((MacMenu *) menuPtr->platformData)->menuHdl = macMenuHdl;
+ SetRect(&((MacMenu *) menuPtr->platformData)->menuRect, 0, 0, 0, 0);
+
+ if ((currentMenuBarInterp == menuPtr->interp)
+ && (currentMenuBarName != NULL)) {
+ Tk_Window parentWin = Tk_Parent(menuPtr->tkwin);
+
+ if (strcmp(currentMenuBarName, Tk_PathName(parentWin)) == 0) {
+ if ((strcmp(Tk_PathName(menuPtr->tkwin)
+ + strlen(Tk_PathName(parentWin)), ".apple") == 0)
+ || (strcmp(Tk_PathName(menuPtr->tkwin)
+ + strlen(Tk_PathName(parentWin)), ".help") == 0)) {
+ if (!(menuBarFlags & MENUBAR_REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DrawMenuBarWhenIdle, (ClientData *) NULL);
+ menuBarFlags |= MENUBAR_REDRAW_PENDING;
+ }
+ }
+ }
+ }
+
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, (ClientData) menuPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyMenu --
+ *
+ * Destroys platform-specific menu structures.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * All platform-specific allocations are freed up.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDestroyMenu(
+ TkMenu *menuPtr) /* The common menu structure */
+{
+ MenuRef macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
+
+ if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {
+ Tcl_CancelIdleCall(ReconfigureMacintoshMenu, (ClientData) menuPtr);
+ menuPtr->menuFlags &= ~MENU_RECONFIGURE_PENDING;
+ }
+ if (GetMenuID(macMenuHdl) == currentHelpMenuID) {
+ MenuRef helpMenuHdl;
+ MenuItemIndex helpIndex;
+
+ if ((HMGetHelpMenu(&helpMenuHdl,&helpIndex) == noErr)
+ && (helpMenuHdl != NULL)) {
+ int i, count = CountMenuItems(helpMenuHdl);
+
+ for (i = helpItemCount; i <= count; i++) {
+ DeleteMenuItem(helpMenuHdl, helpItemCount);
+ }
+ }
+ currentHelpMenuID = 0;
+ }
+ if (menuPtr->platformData != NULL) {
+ MenuID menuID;
+ menuID = GetMenuID(macMenuHdl);
+ DeleteMenu(menuID);
+ TkMacOSXFreeMenuID(menuID);
+ DisposeMenu(macMenuHdl);
+ ckfree((char *) menuPtr->platformData);
+ menuPtr->platformData = NULL;
+ }
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetMenuCascade --
+ *
+ * Does any cleanup to change a menu from a normal to a cascade.
+ *
+ * Results:
+ * Standard Tcl error.
+ *
+ * Side effects:
+ * The mac menu id is reset.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+SetMenuCascade(
+ TkMenu* menuPtr) /* The menu we are setting up to be a
+ * cascade. */
+{
+ MenuHandle macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
+ MenuID newMenuID, menuID = GetMenuID(macMenuHdl);
+ int error = TCL_OK;
+ if (menuID >= 256) {
+ error = TkMacOSXGetNewMenuID(menuPtr->interp, menuPtr, 1, &newMenuID);
+ if (error == TCL_OK) {
+ TkMacOSXFreeMenuID(menuID);
+ SetMenuID (macMenuHdl,newMenuID);
+ }
+ }
+ return error;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyMenuEntry --
+ *
+ * Cleans up platform-specific menu entry items.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * All platform-specific allocations are freed up.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDestroyMenuEntry(
+ TkMenuEntry *mePtr) /* The common structure for the menu
+ * entry. */
+{
+ TkMenu *menuPtr = mePtr->menuPtr;
+
+ ckfree((char *) mePtr->platformEntryData);
+ if ((menuPtr->platformData != NULL)
+ && !(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, (ClientData) menuPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetEntryText --
+ *
+ * Given a menu entry, gives back the text that should go in it.
+ * Separators should be done by the caller, as they have to be
+ * handled specially. This is primarily used to do a substitution
+ * between "..." and the ellipsis character which looks nicer.
+ *
+ * Results:
+ * itemText points to the new text for the item.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetEntryText(
+ TkMenuEntry *mePtr, /* A pointer to the menu entry. */
+ Tcl_DString *dStringPtr) /* The DString to put the text into. This
+ * will be initialized by this routine. */
+{
+ Tcl_DStringInit(dStringPtr);
+ if (mePtr->type == TEAROFF_ENTRY) {
+ Tcl_DStringAppend(dStringPtr, "(Tear-off)", -1);
+ } else if (mePtr->imagePtr != NULL) {
+ Tcl_DStringAppend(dStringPtr, "(Image)", -1);
+ } else if (mePtr->bitmapPtr != NULL) {
+ Tcl_DStringAppend(dStringPtr, "(Pixmap)", -1);
+ } else if (mePtr->labelPtr == NULL || mePtr->labelLength == 0) {
+ /*
+ * The Mac menu manager does not like null strings.
+ */
+
+ Tcl_DStringAppend(dStringPtr, " ", -1);
+ } else {
+ int length;
+ char *text = Tcl_GetStringFromObj(mePtr->labelPtr, &length);
+ char *dStringText;
+ int i;
+
+ for (i = 0; *text; text++, i++) {
+ if ((*text == '.')
+ && (*(text + 1) != '\0') && (*(text + 1) == '.')
+ && (*(text + 2) != '\0') && (*(text + 2) == '.')) {
+ Tcl_DStringAppend(dStringPtr, elipsisString, -1);
+ i += strlen(elipsisString) - 1;
+ text += 2;
+ } else {
+ Tcl_DStringSetLength(dStringPtr,
+ Tcl_DStringLength(dStringPtr) + 1);
+ dStringText = Tcl_DStringValue(dStringPtr);
+ dStringText[i] = *text;
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FindMarkCharacter --
+ *
+ * Finds the Macintosh mark character based on the font of the
+ * item. We calculate a good mark character based on the font
+ * that this item is rendered in.
+ *
+ * We try the following special mac characters. If none of them
+ * are present, just use the check mark.
+ * '' - Check mark character (\022)
+ * 'Â¥' - Mac Bullet character (\245)
+ * '' - Filled diamond (\023)
+ * '—' - Hollow diamond (\327)
+ * '‘' = Mac Long dash ("em dash") (\321)
+ * '-' = short dash (minus, "en dash");
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * New item is added to platform menu
+ *
+ *----------------------------------------------------------------------
+ */
+
+static char
+FindMarkCharacter(
+ TkMenuEntry *mePtr) /* The entry we are finding the character
+ * for. */
+{
+ char markChar;
+ Tk_Font tkfont;
+
+ tkfont = Tk_GetFontFromObj(mePtr->menuPtr->tkwin,
+ (mePtr->fontPtr == NULL) ? mePtr->menuPtr->fontPtr
+ : mePtr->fontPtr);
+
+ if (!TkMacOSXIsCharacterMissing(tkfont, '\022')) {
+ markChar = '\022'; /* Check mark */
+ } else if (!TkMacOSXIsCharacterMissing(tkfont, '\245')) {
+ markChar = '\245'; /* Bullet */
+ } else if (!TkMacOSXIsCharacterMissing(tkfont, '\023')) {
+ markChar = '\023'; /* Filled Diamond */
+ } else if (!TkMacOSXIsCharacterMissing(tkfont, '\327')) {
+ markChar = '\327'; /* Hollow Diamond */
+ } else if (!TkMacOSXIsCharacterMissing(tkfont, '\321')) {
+ markChar = '\321'; /* Long Dash */
+ } else if (!TkMacOSXIsCharacterMissing(tkfont, '-')) {
+ markChar = '-'; /* Short Dash */
+ } else {
+ markChar = '\022'; /* Check mark */
+ }
+ return markChar;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetMenuTitle --
+ *
+ * Sets title of menu so that the text displays correctly in menubar.
+ * This code directly manipulates menu handle data. This code
+ * was originally part of an ancient Apple Developer Response mail.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The menu handle will change size depending on the length of the
+ * title
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+mySetMenuTitle(
+ MenuRef menuHdl, /* The menu we are setting the title of. */
+ Tcl_Obj *titlePtr) /* The C string to set the title to. */
+{
+ char *title = (titlePtr == NULL) ? ""
+ : Tcl_GetStringFromObj(titlePtr, NULL);
+ Str255 menuTitle;
+ menuTitle [ 0 ] = strlen ( title ) + 1;
+ strcpy ( menuTitle + 1, title );
+ SetMenuTitle ( menuHdl, menuTitle );
+}
+static int ParseAccelerators(char **accelStringPtr) {
+ char *accelString = *accelStringPtr;
+ int flags = 0;
+ while (1) {
+ if ((0 == strncasecmp("Control", accelString, 6))
+ && (('-' == accelString[6]) || ('+' == accelString[6]))) {
+ flags |= ENTRY_CONTROL_ACCEL;
+ accelString += 7;
+ } else if ((0 == strncasecmp("Ctrl", accelString, 4))
+ && (('-' == accelString[4]) || ('+' == accelString[4]))) {
+ flags |= ENTRY_CONTROL_ACCEL;
+ accelString += 5;
+ } else if ((0 == strncasecmp("Shift", accelString, 5))
+ && (('-' == accelString[5]) || ('+' == accelString[5]))) {
+ flags |= ENTRY_SHIFT_ACCEL;
+ accelString += 6;
+ } else if ((0 == strncasecmp("Option", accelString, 6))
+ && (('-' == accelString[6]) || ('+' == accelString[6]))) {
+ flags |= ENTRY_OPTION_ACCEL;
+ accelString += 7;
+ } else if ((0 == strncasecmp("Opt", accelString, 3))
+ && (('-' == accelString[3]) || ('+' == accelString[3]))) {
+ flags |= ENTRY_OPTION_ACCEL;
+ accelString += 4;
+ } else if ((0 == strncasecmp("Command", accelString, 7))
+ && (('-' == accelString[7]) || ('+' == accelString[7]))) {
+ flags |= ENTRY_COMMAND_ACCEL;
+ accelString += 8;
+ } else if ((0 == strncasecmp("Cmd", accelString, 3))
+ && (('-' == accelString[3]) || ('+' == accelString[3]))) {
+ flags |= ENTRY_COMMAND_ACCEL;
+ accelString += 4;
+ } else if ((0 == strncasecmp("Alt", accelString, 3))
+ && (('-' == accelString[3]) || ('+' == accelString[3]))) {
+ flags |= ENTRY_OPTION_ACCEL;
+ accelString += 4;
+ } else if ((0 == strncasecmp("Meta", accelString, 4))
+ && (('-' == accelString[4]) || ('+' == accelString[4]))) {
+ flags |= ENTRY_COMMAND_ACCEL;
+ accelString += 5;
+ } else {
+ break;
+ }
+ }
+ *accelStringPtr = accelString;
+ return flags;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpConfigureMenuEntry --
+ *
+ * Processes configurations for menu entries.
+ *
+ * Results:
+ * Returns standard TCL result. If TCL_ERROR is returned, then
+ * the interp's result contains an error message.
+ *
+ * Side effects:
+ * Configuration information get set for mePtr; old resources
+ * get freed, if any need it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpConfigureMenuEntry(
+ TkMenuEntry *mePtr) /* Information about menu entry; may
+ * or may not already have values for
+ * some fields. */
+{
+ TkMenu *menuPtr = mePtr->menuPtr;
+ int index = mePtr->index;
+ MenuHandle macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
+ MenuHandle helpMenuHdl = NULL;
+
+ /*
+ * Cascade menus have to have menu IDs of less than 256. So
+ * we need to change the child menu if this has been configured
+ * for a cascade item.
+ */
+
+ if (mePtr->type == CASCADE_ENTRY) {
+ if ((mePtr->childMenuRefPtr != NULL)
+ && (mePtr->childMenuRefPtr->menuPtr != NULL)) {
+ MenuHandle childMenuHdl = ((MacMenu *) mePtr
+ ->childMenuRefPtr->menuPtr->platformData)->menuHdl;
+
+ if (childMenuHdl != NULL) {
+ int error = SetMenuCascade(mePtr->childMenuRefPtr->menuPtr);
+
+ if (error != TCL_OK) {
+ return error;
+ }
+
+ if (menuPtr->menuType == MENUBAR) {
+ mySetMenuTitle(childMenuHdl, mePtr->labelPtr);
+ }
+ }
+ }
+ }
+
+ /*
+ * We need to parse the accelerator string. If it has the strings
+ * for Command, Control, Shift or Option, we need to flag it
+ * so we can draw the symbols for it. We also need to precalcuate
+ * the position of the first real character we are drawing.
+ */
+
+ if (0 == mePtr->accelLength) {
+ ((EntryGeometry *)mePtr->platformEntryData)->accelTextStart = -1;
+ } else {
+ char *accelString = (mePtr->accelPtr == NULL) ? ""
+ : Tcl_GetStringFromObj(mePtr->accelPtr, NULL);
+ char *accel = accelString;
+ mePtr->entryFlags |= ~ENTRY_ACCEL_MASK;
+
+ mePtr->entryFlags |= ParseAccelerators(&accelString);
+
+ ((EntryGeometry *)mePtr->platformEntryData)->accelTextStart
+ = ((long) accelString - (long) accel);
+ }
+
+ if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, (ClientData) menuPtr);
+ }
+
+ return TCL_OK;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReconfigureIndividualMenu --
+ *
+ * This routine redoes the guts of the menu. It works from
+ * a base item and offset, so that a regular menu will
+ * just have all of its items added, but the help menu will
+ * have all of its items appended after the apple-defined
+ * items.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The Macintosh menu handle is updated
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ReconfigureIndividualMenu(
+ TkMenu *menuPtr, /* The menu we are affecting. */
+ MenuHandle macMenuHdl, /* The macintosh menu we are affecting.
+ * Will not necessarily be
+ * menuPtr->platformData because this could
+ * be the help menu. */
+ int base) /* The last index that we do not want
+ * touched. 0 for normal menus;
+ * helpMenuItemCount for help menus. */
+{
+ int count;
+ int index;
+ TkMenuEntry *mePtr;
+ Str255 itemText;
+ int parentDisabled = 0;
+
+ for (mePtr = menuPtr->menuRefPtr->parentEntryPtr; mePtr != NULL;
+ mePtr = mePtr->nextCascadePtr) {
+ char *name = (mePtr->namePtr == NULL) ? ""
+ : Tcl_GetStringFromObj(mePtr->namePtr, NULL);
+
+ if (strcmp(Tk_PathName(menuPtr->tkwin), name) == 0) {
+ if (mePtr->state == ENTRY_DISABLED) {
+ parentDisabled = 1;
+ }
+ break;
+ }
+ }
+
+ /*
+ * First, we get rid of all of the old items.
+ */
+
+ count = CountMenuItems(macMenuHdl);
+ for (index = base; index < count; index++) {
+ DeleteMenuItem(macMenuHdl, base + 1);
+ }
+
+ count = menuPtr->numEntries;
+
+ for (index = 1; index <= count; index++) {
+ mePtr = menuPtr->entries[index - 1];
+
+ /*
+ * We have to do separators separately because SetMenuItemText
+ * does not parse meta-characters.
+ */
+
+ if (mePtr->type == SEPARATOR_ENTRY) {
+ AppendMenu(macMenuHdl, SEPARATOR_TEXT);
+ } else {
+ Tcl_DString itemTextDString;
+ int destWrote;
+ CFStringRef cf;
+ GetEntryText(mePtr, &itemTextDString);
+ cf = CFStringCreateWithCString(NULL,
+ Tcl_DStringValue(&itemTextDString), kCFStringEncodingUTF8);
+ AppendMenu(macMenuHdl, "\px");
+ if (cf != NULL) {
+ SetMenuItemTextWithCFString(macMenuHdl, base + index, cf);
+ CFRelease(cf);
+ } else {
+ cf = CFSTR ("<Error>");
+ SetMenuItemTextWithCFString(macMenuHdl, base + index, cf);
+ }
+ Tcl_DStringFree(&itemTextDString);
+
+ /*
+ * Set enabling and disabling correctly.
+ */
+
+ if (parentDisabled || (mePtr->state == ENTRY_DISABLED)) {
+ DisableMenuItem(macMenuHdl, base + index);
+ } else {
+ EnableMenuItem(macMenuHdl, base + index);
+ }
+
+ /*
+ * Set the check mark for check entries and radio entries.
+ */
+
+ SetItemMark(macMenuHdl, base + index, 0);
+ if ((mePtr->type == CHECK_BUTTON_ENTRY)
+ || (mePtr->type == RADIO_BUTTON_ENTRY)) {
+ CheckMenuItem(macMenuHdl, base + index, (mePtr->entryFlags
+ & ENTRY_SELECTED) && mePtr->indicatorOn);
+ if (mePtr->indicatorOn
+ && (mePtr->entryFlags & ENTRY_SELECTED)) {
+ SetItemMark(macMenuHdl, base + index,
+ FindMarkCharacter(mePtr));
+ }
+ }
+
+ if (mePtr->type == CASCADE_ENTRY) {
+ if ((mePtr->childMenuRefPtr != NULL)
+ && (mePtr->childMenuRefPtr->menuPtr != NULL)) {
+ MenuHandle childMenuHdl =
+ ((MacMenu *) mePtr->childMenuRefPtr
+ ->menuPtr->platformData)->menuHdl;
+
+ if (childMenuHdl == NULL) {
+ childMenuHdl = ((MacMenu *) mePtr->childMenuRefPtr
+ ->menuPtr->platformData)->menuHdl;
+ }
+ if (childMenuHdl != NULL) {
+ {
+ SetMenuItemHierarchicalID(macMenuHdl, base + index,
+ GetMenuID(childMenuHdl));
+ }
+ }
+ /*
+ * If we changed the highligthing of this menu, its
+ * children all have to be reconfigured so that
+ * their state will be reflected in the menubar.
+ */
+
+ if (!(mePtr->childMenuRefPtr->menuPtr->menuFlags
+ & MENU_RECONFIGURE_PENDING)) {
+ mePtr->childMenuRefPtr->menuPtr->menuFlags
+ |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu,
+ (ClientData) mePtr->childMenuRefPtr->menuPtr);
+ }
+ }
+ }
+
+ if ((mePtr->type != CASCADE_ENTRY) && (mePtr->accelPtr != NULL)) {
+ int accelLen;
+ int modifiers = 0;
+ int hasCmd = 0;
+ int offset = ((EntryGeometry *)mePtr->platformEntryData)->accelTextStart;
+ char *accel = Tcl_GetStringFromObj(mePtr->accelPtr, &accelLen);
+ accelLen -= offset;
+ accel+= offset;
+
+ if (mePtr->entryFlags & ENTRY_OPTION_ACCEL) {
+ modifiers |= kMenuOptionModifier;
+ }
+ if (mePtr->entryFlags & ENTRY_SHIFT_ACCEL) {
+ modifiers |= kMenuShiftModifier;
+ }
+ if (mePtr->entryFlags & ENTRY_CONTROL_ACCEL) {
+ modifiers |= kMenuControlModifier;
+ }
+ if (mePtr->entryFlags & ENTRY_COMMAND_ACCEL) {
+ hasCmd = 1;
+ }
+ if (accelLen == 1) {
+ if (hasCmd || (modifiers != 0 && modifiers != kMenuShiftModifier)) {
+ SetItemCmd(macMenuHdl, base + index, accel[0]);
+ if (!hasCmd) {
+ modifiers |= kMenuNoCommandModifier;
+ }
+ }
+ } else {
+ /*
+ * Now we need to convert from various textual names
+ * to Carbon codes
+ */
+ char glyph = 0x0;
+ char first = UCHAR(accel[0]);
+ if (first == 'F' && (accel[1] > '0' && accel[1] <= '9')) {
+ int fkey = accel[1] - '0';
+ if (accel[2] > '0' && accel[2] <= '9') {
+ fkey = 10*fkey + (accel[2] - '0');
+ }
+ if (fkey > 0 && fkey < 16) {
+ glyph = kMenuF1Glyph + fkey - 1;
+ }
+ } else if (first == 'P' && 0 ==strcasecmp(accel,"pageup")) {
+ glyph = kMenuPageUpGlyph;
+ } else if (first == 'P' && 0 ==strcasecmp(accel,"pagedown")) {
+ glyph = kMenuPageDownGlyph;
+ } else if (first == 'L' && 0 ==strcasecmp(accel,"left")) {
+ glyph = kMenuLeftArrowGlyph;
+ } else if (first == 'R' && 0 ==strcasecmp(accel,"right")) {
+ glyph = kMenuRightArrowGlyph;
+ } else if (first == 'U' && 0 ==strcasecmp(accel,"up")) {
+ glyph = kMenuUpArrowGlyph;
+ } else if (first == 'D' && 0 ==strcasecmp(accel,"down")) {
+ glyph = kMenuDownArrowGlyph;
+ } else if (first == 'E' && 0 ==strcasecmp(accel,"escape")) {
+ glyph = kMenuEscapeGlyph;
+ } else if (first == 'C' && 0 ==strcasecmp(accel,"clear")) {
+ glyph = kMenuClearGlyph;
+ } else if (first == 'E' && 0 ==strcasecmp(accel,"enter")) {
+ glyph = kMenuEnterGlyph;
+ } else if (first == 'D' && 0 ==strcasecmp(accel,"backspace")) {
+ glyph = kMenuDeleteLeftGlyph;
+ } else if (first == 'S' && 0 ==strcasecmp(accel,"space")) {
+ glyph = kMenuSpaceGlyph;
+ } else if (first == 'T' && 0 ==strcasecmp(accel,"tab")) {
+ glyph = kMenuTabRightGlyph;
+ } else if (first == 'F' && 0 ==strcasecmp(accel,"delete")) {
+ glyph = kMenuDeleteRightGlyph;
+ } else if (first == 'H' && 0 ==strcasecmp(accel,"home")) {
+ glyph = kMenuNorthwestArrowGlyph;
+ } else if (first == 'R' && 0 ==strcasecmp(accel,"return")) {
+ glyph = kMenuReturnGlyph;
+ } else if (first == 'H' && 0 ==strcasecmp(accel,"help")) {
+ glyph = kMenuHelpGlyph;
+ } else if (first == 'P' && 0 ==strcasecmp(accel,"power")) {
+ glyph = kMenuPowerGlyph;
+ }
+ if (glyph != 0x0) {
+ SetMenuItemKeyGlyph(macMenuHdl, base + index, glyph);
+ if (modifiers == 0) {
+ if (!hasCmd) {
+ modifiers |= kMenuNoCommandModifier;
+ }
+ }
+ }
+ }
+
+ SetMenuItemModifiers(macMenuHdl, base + index, modifiers);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReconfigureMacintoshMenu --
+ *
+ * Rebuilds the Macintosh MenuHandle items from the menu. Called
+ * usually as an idle handler, but can be called synchronously
+ * if the menu is about to be posted.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Configuration information get set for mePtr; old resources
+ * get freed, if any need it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ReconfigureMacintoshMenu(
+ ClientData clientData) /* Information about menu entry; may
+ * or may not already have values for
+ * some fields. */
+{
+ TkMenu *menuPtr = (TkMenu *) clientData;
+ MenuHandle macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
+ MenuHandle helpMenuHdl = NULL;
+
+ menuPtr->menuFlags &= ~MENU_RECONFIGURE_PENDING;
+
+ if (NULL == macMenuHdl) {
+ return;
+ }
+
+ ReconfigureIndividualMenu(menuPtr, macMenuHdl, 0);
+
+ if (menuPtr->menuFlags & MENU_APPLE_MENU) {
+ AppendResMenu(macMenuHdl, 'DRVR');
+ }
+ if (GetMenuID(macMenuHdl) == currentHelpMenuID) {
+ MenuItemIndex helpIndex;
+ HMGetHelpMenu(&helpMenuHdl,&helpIndex);
+ if (helpMenuHdl != NULL) {
+ ReconfigureIndividualMenu(menuPtr, helpMenuHdl, helpItemCount);
+ }
+ }
+
+ if (menuPtr->menuType == MENUBAR) {
+ if (!(menuBarFlags & MENUBAR_REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DrawMenuBarWhenIdle, (ClientData *) NULL);
+ menuBarFlags |= MENUBAR_REDRAW_PENDING;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * CompleteIdlers --
+ *
+ * Completes all idle handling so that the menus are in sync when
+ * the user invokes them with the mouse.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The Macintosh menu handles are flushed out.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+CompleteIdlers(
+ TkMenu *menuPtr) /* The menu we are completing. */
+{
+ int i;
+
+ if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {
+ Tcl_CancelIdleCall(ReconfigureMacintoshMenu, (ClientData) menuPtr);
+ ReconfigureMacintoshMenu((ClientData) menuPtr);
+ }
+
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ if (menuPtr->entries[i]->type == CASCADE_ENTRY) {
+ if ((menuPtr->entries[i]->childMenuRefPtr != NULL)
+ && (menuPtr->entries[i]->childMenuRefPtr->menuPtr
+ != NULL)) {
+ CompleteIdlers(menuPtr->entries[i]->childMenuRefPtr
+ ->menuPtr);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpPostMenu --
+ *
+ * Posts a menu on the screen
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The menu is posted and handled.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpPostMenu(
+ Tcl_Interp *interp, /* The interpreter this menu lives in */
+ TkMenu *menuPtr, /* The menu we are posting */
+ int x, /* The global x-coordinate of the top, left-
+ * hand corner of where the menu is supposed
+ * to be posted. */
+ int y) /* The global y-coordinate */
+{
+ MenuHandle macMenuHdl = ((MacMenu *) menuPtr->platformData)->menuHdl;
+ long popUpResult;
+ int result;
+ int oldMode;
+
+ if (inPostMenu) {
+ Tcl_AppendResult(interp,
+ "Cannot call post menu while already posting menu",
+ (char *) NULL);
+ result = TCL_ERROR;
+ } else {
+ Window dummyWin;
+ unsigned int state;
+ int dummy, mouseX, mouseY;
+ short menuID;
+ Window window;
+ int oldWidth = menuPtr->totalWidth;
+ Tk_Window parentWindow = Tk_Parent(menuPtr->tkwin);
+
+ inPostMenu++;
+
+ result = TkPreprocessMenu(menuPtr);
+ if (result != TCL_OK) {
+ inPostMenu--;
+ return result;
+ }
+
+ /*
+ * The post commands could have deleted the menu, which means
+ * we are dead and should go away.
+ */
+
+ if (menuPtr->tkwin == NULL) {
+ inPostMenu--;
+ return TCL_OK;
+ }
+
+ CompleteIdlers(menuPtr);
+ if (menuBarFlags & MENUBAR_REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DrawMenuBarWhenIdle, (ClientData *) NULL);
+ DrawMenuBarWhenIdle((ClientData *) NULL);
+ }
+
+ if (NULL == parentWindow) {
+ tearoffStruct.excludeRect.top = tearoffStruct.excludeRect.left
+ = tearoffStruct.excludeRect.bottom
+ = tearoffStruct.excludeRect.right = SHRT_MAX;
+ } else {
+ int left, top;
+
+ Tk_GetRootCoords(parentWindow, &left, &top);
+ tearoffStruct.excludeRect.left = left;
+ tearoffStruct.excludeRect.top = top;
+ tearoffStruct.excludeRect.right = left + Tk_Width(parentWindow);
+ tearoffStruct.excludeRect.bottom = top + Tk_Height(parentWindow);
+ if (Tk_Class(parentWindow) == Tk_GetUid("Menubutton")) {
+ TkWindow *parentWinPtr = (TkWindow *) parentWindow;
+ TkMenuButton *mbPtr =
+ (TkMenuButton *) parentWinPtr->instanceData;
+ int menuButtonWidth = Tk_Width(parentWindow)
+ - 2 * (mbPtr->highlightWidth + mbPtr->borderWidth + 1);
+ menuPtr->totalWidth = menuButtonWidth > menuPtr->totalWidth
+ ? menuButtonWidth : menuPtr->totalWidth;
+ }
+ }
+
+ InsertMenu(macMenuHdl, -1);
+ RecursivelyInsertMenu(menuPtr);
+ CountMenuItems(macMenuHdl);
+
+ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ popUpResult = PopUpMenuSelect(macMenuHdl, y, x, menuPtr->active);
+ Tcl_SetServiceMode(oldMode);
+
+ menuPtr->totalWidth = oldWidth;
+ RecursivelyDeleteMenu(menuPtr);
+ DeleteMenu(GetMenuID(macMenuHdl));
+
+ /*
+ * Simulate the mouse up.
+ */
+
+ XQueryPointer(NULL, None, &dummyWin, &dummyWin, &mouseX,
+ &mouseY, &dummy, &dummy, &state);
+ window = Tk_WindowId(menuPtr->tkwin);
+ TkGenerateButtonEvent(mouseX, mouseY, window, state);
+
+ /*
+ * Dispatch the command.
+ */
+
+ menuID = HiWord(popUpResult);
+ if (menuID != 0) {
+ result = TkMacOSXDispatchMenuEvent(menuID, LoWord(popUpResult));
+ } else {
+ TkMacOSXHandleTearoffMenu();
+ result = TCL_OK;
+ }
+
+ /*
+ * Be careful, here. The command executed in handling the menu event
+ * could destroy the window. Don't try to do anything with it then.
+ */
+
+ if (menuPtr->tkwin) {
+ InvalidateMDEFRgns();
+ RecursivelyClearActiveMenu(menuPtr);
+ }
+ inPostMenu--;
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMenuNewEntry --
+ *
+ * Adds a pointer to a new menu entry structure with the platform-
+ * specific fields filled in. The Macintosh uses the
+ * platformEntryData field of the TkMenuEntry record to store
+ * geometry information.
+ *
+ * Results:
+ * Standard TCL error.
+ *
+ * Side effects:
+ * Storage gets allocated. New menu entry data is put into the
+ * platformEntryData field of the mePtr.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpMenuNewEntry(
+ TkMenuEntry *mePtr) /* The menu we are adding an entry to */
+{
+ EntryGeometry *geometryPtr =
+ (EntryGeometry *) ckalloc(sizeof(EntryGeometry));
+ TkMenu *menuPtr = mePtr->menuPtr;
+
+ geometryPtr->accelTextStart = 0;
+ geometryPtr->accelTextWidth = 0;
+ geometryPtr->nonAccelMargin = 0;
+ geometryPtr->modifierWidth = 0;
+ mePtr->platformEntryData = (TkMenuPlatformEntryData) geometryPtr;
+ if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
+ menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu, (ClientData) menuPtr);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ *
+ * Tk_MacOSXTurnOffMenus --
+ *
+ * Turns off all the menu drawing code. This is more than just disabling
+ * the "menu" command, this means that Tk will NEVER touch the menubar.
+ * It is needed in the Plugin, where Tk does not own the menubar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A flag is set which will disable all menu drawing.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_MacOSXTurnOffMenus()
+{
+ gNoTkMenus = 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ *
+ * DrawMenuBarWhenIdle --
+ *
+ * Update the menu bar next time there is an idle event.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Menu bar is redrawn.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DrawMenuBarWhenIdle(
+ ClientData clientData) /* ignored here */
+{
+ TkMenuReferences *menuRefPtr;
+ TkMenu *appleMenuPtr, *helpMenuPtr;
+ MenuHandle macMenuHdl;
+ Tcl_HashEntry *hashEntryPtr;
+
+ /*
+ * If we have been turned off, exit.
+ */
+
+ if (gNoTkMenus) {
+ return;
+ }
+
+ /*
+ * We need to clear the apple and help menus of any extra items.
+ */
+
+ if (currentAppleMenuID != 0) {
+ hashEntryPtr = Tcl_FindHashEntry(&commandTable,
+ (char *) ((int)currentAppleMenuID));
+ appleMenuPtr = (TkMenu *) Tcl_GetHashValue(hashEntryPtr);
+ TkpDestroyMenu(appleMenuPtr);
+ TkpNewMenu(appleMenuPtr);
+ appleMenuPtr->menuFlags &= ~MENU_APPLE_MENU;
+ appleMenuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu,
+ (ClientData) appleMenuPtr);
+ }
+
+ if (currentHelpMenuID != 0) {
+ hashEntryPtr = Tcl_FindHashEntry(&commandTable,
+ (char *) ((int)currentHelpMenuID));
+ helpMenuPtr = (TkMenu *) Tcl_GetHashValue(hashEntryPtr);
+ TkpDestroyMenu(helpMenuPtr);
+ TkpNewMenu(helpMenuPtr);
+ helpMenuPtr->menuFlags &= ~MENU_HELP_MENU;
+ helpMenuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu,
+ (ClientData) helpMenuPtr);
+ }
+
+ /*
+ * We need to find the clone of this menu that is the menubar.
+ * Once we do that, for every cascade in the menu, we need to
+ * insert the Mac menu in the Mac menubar. Finally, we need
+ * to redraw the menubar.
+ */
+
+ menuRefPtr = NULL;
+ if (currentMenuBarName != NULL) {
+ menuRefPtr = TkFindMenuReferences(currentMenuBarInterp,
+ currentMenuBarName);
+ }
+ if (menuRefPtr != NULL) {
+ TkMenu *menuPtr, *menuBarPtr;
+ TkMenu *cascadeMenuPtr;
+ char *appleMenuName, *helpMenuName;
+ int appleIndex = -1, helpIndex = -1;
+ int i;
+
+ menuPtr = menuRefPtr->menuPtr;
+ if (menuPtr != NULL) {
+ TkMenuReferences *specialMenuRefPtr;
+ TkMenuEntry *specialEntryPtr;
+
+ appleMenuName = ckalloc(strlen(currentMenuBarName)
+ + 1 + strlen(".apple") + 1);
+ sprintf(appleMenuName, "%s.apple",
+ Tk_PathName(menuPtr->tkwin));
+ specialMenuRefPtr = TkFindMenuReferences(currentMenuBarInterp,
+ appleMenuName);
+ if ((specialMenuRefPtr != NULL)
+ && (specialMenuRefPtr->menuPtr != NULL)) {
+ for (specialEntryPtr
+ = specialMenuRefPtr->parentEntryPtr;
+ specialEntryPtr != NULL;
+ specialEntryPtr
+ = specialEntryPtr->nextCascadePtr) {
+ if (specialEntryPtr->menuPtr == menuPtr) {
+ appleIndex = specialEntryPtr->index;
+ break;
+ }
+ }
+ }
+ ckfree(appleMenuName);
+
+ helpMenuName = ckalloc(strlen(currentMenuBarName)
+ + 1 + strlen(".help") + 1);
+ sprintf(helpMenuName, "%s.help",
+ Tk_PathName(menuPtr->tkwin));
+ specialMenuRefPtr = TkFindMenuReferences(currentMenuBarInterp,
+ helpMenuName);
+ if ((specialMenuRefPtr != NULL)
+ && (specialMenuRefPtr->menuPtr != NULL)) {
+ for (specialEntryPtr
+ = specialMenuRefPtr->parentEntryPtr;
+ specialEntryPtr != NULL;
+ specialEntryPtr
+ = specialEntryPtr->nextCascadePtr) {
+ if (specialEntryPtr->menuPtr == menuPtr) {
+ helpIndex = specialEntryPtr->index;
+ break;
+ }
+ }
+ }
+ ckfree(helpMenuName);
+
+ }
+
+ for (menuBarPtr = menuPtr;
+ (menuBarPtr != NULL)
+ && (menuBarPtr->menuType != MENUBAR);
+ menuBarPtr = menuBarPtr->nextInstancePtr) {
+
+ /*
+ * Null loop body.
+ */
+
+ }
+
+ if (menuBarPtr == NULL) {
+ SetDefaultMenubar();
+ } else {
+ if (menuBarPtr->tearoff != menuPtr->tearoff) {
+ if (menuBarPtr->tearoff) {
+ appleIndex = (-1 == appleIndex) ? appleIndex
+ : appleIndex + 1;
+ helpIndex = (-1 == helpIndex) ? helpIndex
+ : helpIndex + 1;
+ } else {
+ appleIndex = (-1 == appleIndex) ? appleIndex
+ : appleIndex - 1;
+ helpIndex = (-1 == helpIndex) ? helpIndex
+ : helpIndex - 1;
+ }
+ }
+ ClearMenuBar();
+
+ if (appleIndex == -1) {
+ InsertMenu(tkAppleMenu, 0);
+ currentAppleMenuID = 0;
+ } else {
+ short appleID;
+ appleMenuPtr = menuBarPtr->entries[appleIndex]
+ ->childMenuRefPtr->menuPtr;
+ TkpDestroyMenu(appleMenuPtr);
+ TkMacOSXGetNewMenuID(appleMenuPtr->interp, appleMenuPtr, 0,
+ &appleID);
+ macMenuHdl = NewMenu(appleID, "\p\024");
+ appleMenuPtr->platformData =
+ (TkMenuPlatformData) ckalloc(sizeof(MacMenu));
+ ((MacMenu *)appleMenuPtr->platformData)->menuHdl
+ = macMenuHdl;
+ SetRect(&((MacMenu *) appleMenuPtr->platformData)->menuRect,
+ 0, 0, 0, 0);
+ appleMenuPtr->menuFlags |= MENU_APPLE_MENU;
+ if (!(appleMenuPtr->menuFlags
+ & MENU_RECONFIGURE_PENDING)) {
+ appleMenuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu,
+ (ClientData) appleMenuPtr);
+ }
+ InsertMenu(macMenuHdl, 0);
+ RecursivelyInsertMenu(appleMenuPtr);
+ currentAppleMenuID = appleID;
+ }
+ if (helpIndex == -1) {
+ currentHelpMenuID = 0;
+ }
+
+ for (i = 0; i < menuBarPtr->numEntries; i++) {
+ if (i == appleIndex) {
+ if (menuBarPtr->entries[i]->state == ENTRY_DISABLED) {
+ DisableMenuItem(((MacMenu *) menuBarPtr->entries[i]
+ ->childMenuRefPtr->menuPtr
+ ->platformData)->menuHdl,
+ 0);
+ } else {
+ EnableMenuItem(((MacMenu *) menuBarPtr->entries[i]
+ ->childMenuRefPtr->menuPtr
+ ->platformData)->menuHdl,
+ 0);
+ }
+ continue;
+ } else if (i == helpIndex) {
+ TkMenu *helpMenuPtr = menuBarPtr->entries[i]
+ ->childMenuRefPtr->menuPtr;
+ MenuHandle helpMenuHdl = NULL;
+
+ if (helpMenuPtr == NULL) {
+ continue;
+ }
+ helpMenuPtr->menuFlags |= MENU_HELP_MENU;
+ if (!(helpMenuPtr->menuFlags
+ & MENU_RECONFIGURE_PENDING)) {
+ helpMenuPtr->menuFlags
+ |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureMacintoshMenu,
+ (ClientData) helpMenuPtr);
+ }
+ macMenuHdl =
+ ((MacMenu *) helpMenuPtr->platformData)->menuHdl;
+ currentHelpMenuID = GetMenuID(macMenuHdl);
+ } else if (menuBarPtr->entries[i]->type
+ == CASCADE_ENTRY) {
+ if ((menuBarPtr->entries[i]->childMenuRefPtr != NULL)
+ && menuBarPtr->entries[i]->childMenuRefPtr
+ ->menuPtr != NULL) {
+ cascadeMenuPtr = menuBarPtr->entries[i]
+ ->childMenuRefPtr->menuPtr;
+ macMenuHdl = ((MacMenu *) cascadeMenuPtr
+ ->platformData)->menuHdl;
+ DeleteMenu(GetMenuID(macMenuHdl));
+ InsertMenu(macMenuHdl, 0);
+ RecursivelyInsertMenu(cascadeMenuPtr);
+ if (menuBarPtr->entries[i]->state == ENTRY_DISABLED) {
+ DisableMenuItem(((MacMenu *) menuBarPtr->entries[i]
+ ->childMenuRefPtr->menuPtr
+ ->platformData)->menuHdl,
+ 0);
+ } else {
+ EnableMenuItem(((MacMenu *) menuBarPtr->entries[i]
+ ->childMenuRefPtr->menuPtr
+ ->platformData)->menuHdl,
+ 0);
+ }
+ }
+ }
+ }
+ }
+ } else {
+ SetDefaultMenubar();
+ }
+ DrawMenuBar();
+ menuBarFlags &= ~MENUBAR_REDRAW_PENDING;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RecursivelyInsertMenu --
+ *
+ * Puts all of the cascades of this menu in the Mac hierarchical list.
+ *
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The menubar is changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+RecursivelyInsertMenu(
+ TkMenu *menuPtr) /* All of the cascade items in this menu
+ * will be inserted into the mac menubar. */
+{
+ int i;
+ TkMenu *cascadeMenuPtr;
+ MenuHandle macMenuHdl;
+
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ if (menuPtr->entries[i]->type == CASCADE_ENTRY) {
+ if ((menuPtr->entries[i]->childMenuRefPtr != NULL)
+ && (menuPtr->entries[i]->childMenuRefPtr->menuPtr
+ != NULL)) {
+ cascadeMenuPtr = menuPtr->entries[i]->childMenuRefPtr->menuPtr;
+ macMenuHdl =
+ ((MacMenu *) cascadeMenuPtr->platformData)->menuHdl;
+ InsertMenu(macMenuHdl, -1);
+ RecursivelyInsertMenu(cascadeMenuPtr);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RecursivelyDeleteMenu --
+ *
+ * Takes all of the cascades of this menu out of the Mac hierarchical
+ * list.
+ *
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The menubar is changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+RecursivelyDeleteMenu(
+ TkMenu *menuPtr) /* All of the cascade items in this menu
+ * will be inserted into the mac menubar. */
+{
+ int i;
+ TkMenu *cascadeMenuPtr;
+ MenuHandle macMenuHdl;
+
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ if (menuPtr->entries[i]->type == CASCADE_ENTRY) {
+ if ((menuPtr->entries[i]->childMenuRefPtr != NULL)
+ && (menuPtr->entries[i]->childMenuRefPtr->menuPtr
+ != NULL)) {
+ cascadeMenuPtr = menuPtr->entries[i]->childMenuRefPtr->menuPtr;
+ macMenuHdl =
+ ((MacMenu *) cascadeMenuPtr->platformData)->menuHdl;
+ DeleteMenu(GetMenuID(macMenuHdl));
+ RecursivelyInsertMenu(cascadeMenuPtr);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SetDefaultMenubar --
+ *
+ * Puts the Apple, File and Edit menus into the Macintosh menubar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The menubar is changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+SetDefaultMenubar()
+{
+ if (currentMenuBarName != NULL) {
+ ckfree(currentMenuBarName);
+ currentMenuBarName = NULL;
+ }
+ currentMenuBarOwner = NULL;
+ ClearMenuBar();
+ InsertMenu(tkAppleMenu, 0);
+ InsertMenu(tkFileMenu, 0);
+ InsertMenu(tkEditMenu, 0);
+ if (!(menuBarFlags & MENUBAR_REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DrawMenuBarWhenIdle, (ClientData *) NULL);
+ menuBarFlags |= MENUBAR_REDRAW_PENDING;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpSetMainMenubar --
+ *
+ * Puts the menu associated with a window into the menubar. Should
+ * only be called when the window is in front.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The menubar is changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpSetMainMenubar(
+ Tcl_Interp *interp, /* The interpreter of the application */
+ Tk_Window tkwin, /* The frame we are setting up */
+ char *menuName) /* The name of the menu to put in front.
+ * If NULL, use the default menu bar.
+ */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ CGrafPtr winPort;
+ WindowRef macWindowPtr;
+ WindowRef frontNonFloating;
+
+ winPort=TkMacOSXGetDrawablePort(winPtr->window);
+ if (!winPort) {
+ return;
+ }
+ macWindowPtr = GetWindowFromPort(winPort);
+
+ frontNonFloating = FrontNonFloatingWindow();
+ if ((macWindowPtr == NULL) || (macWindowPtr != frontNonFloating)) {
+ return;
+ }
+
+ if ((currentMenuBarInterp != interp)
+ || (currentMenuBarOwner != tkwin)
+ || (currentMenuBarName == NULL)
+ || (menuName == NULL)
+ || (strcmp(menuName, currentMenuBarName) != 0)) {
+ Tk_Window searchWindow;
+ TopLevelMenubarList *listPtr;
+
+ if (currentMenuBarName != NULL) {
+ ckfree(currentMenuBarName);
+ }
+
+ if (menuName == NULL) {
+ searchWindow = tkwin;
+ if (strcmp(Tk_Class(searchWindow), "Menu") == 0) {
+ TkMenuReferences *menuRefPtr;
+
+ menuRefPtr = TkFindMenuReferences(interp, Tk_PathName(tkwin));
+ if (menuRefPtr != NULL) {
+ TkMenu *menuPtr = menuRefPtr->menuPtr;
+ if (menuPtr != NULL) {
+ menuPtr = menuPtr->masterMenuPtr;
+ searchWindow = menuPtr->tkwin;
+ }
+ }
+ }
+ for (; searchWindow != NULL;
+ searchWindow = Tk_Parent(searchWindow)) {
+
+ for (listPtr = windowListPtr; listPtr != NULL;
+ listPtr = listPtr->nextPtr) {
+ if (listPtr->tkwin == searchWindow) {
+ break;
+ }
+ }
+ if (listPtr != NULL) {
+ menuName = Tk_PathName(listPtr->menuPtr->masterMenuPtr
+ ->tkwin);
+ break;
+ }
+ }
+ }
+
+ if (menuName == NULL) {
+ currentMenuBarName = NULL;
+ } else {
+ currentMenuBarName = ckalloc(strlen(menuName) + 1);
+ strcpy(currentMenuBarName, menuName);
+ }
+ currentMenuBarOwner = tkwin;
+ currentMenuBarInterp = interp;
+ }
+ if (!(menuBarFlags & MENUBAR_REDRAW_PENDING)) {
+ Tcl_DoWhenIdle(DrawMenuBarWhenIdle, (ClientData *) NULL);
+ menuBarFlags |= MENUBAR_REDRAW_PENDING;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpSetWindowMenuBar --
+ *
+ * Associates a given menu with a window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * On Windows and UNIX, associates the platform menu with the
+ * platform window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpSetWindowMenuBar(
+ Tk_Window tkwin, /* The window we are setting the menu in */
+ TkMenu *menuPtr) /* The menu we are setting */
+{
+ TopLevelMenubarList *listPtr, *prevPtr;
+
+ /*
+ * Remove any existing reference to this window.
+ */
+
+ for (prevPtr = NULL, listPtr = windowListPtr;
+ listPtr != NULL;
+ prevPtr = listPtr, listPtr = listPtr->nextPtr) {
+ if (listPtr->tkwin == tkwin) {
+ break;
+ }
+ }
+
+ if (listPtr != NULL) {
+ if (prevPtr != NULL) {
+ prevPtr->nextPtr = listPtr->nextPtr;
+ } else {
+ windowListPtr = listPtr->nextPtr;
+ }
+ ckfree((char *) listPtr);
+ }
+
+ if (menuPtr != NULL) {
+ listPtr = (TopLevelMenubarList *) ckalloc(sizeof(TopLevelMenubarList));
+ listPtr->nextPtr = windowListPtr;
+ windowListPtr = listPtr;
+ listPtr->tkwin = tkwin;
+ listPtr->menuPtr = menuPtr;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXDispatchMenuEvent --
+ *
+ * Given a menu id and an item, dispatches the command associated
+ * with it.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands get executed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXDispatchMenuEvent(
+ int menuID, /* The menu id of the menu we are invoking */
+ int index) /* The one-based index of the item that was
+ * selected. */
+{
+ int result = TCL_OK;
+ if (menuID != 0) {
+ if (menuID == kHMHelpMenuID) {
+ if (currentMenuBarOwner != NULL) {
+ TkMenuReferences *helpMenuRef;
+ char *helpMenuName = ckalloc(strlen(currentMenuBarName)
+ + strlen(".help") + 1);
+ sprintf(helpMenuName, "%s.help", currentMenuBarName);
+ helpMenuRef = TkFindMenuReferences(currentMenuBarInterp,
+ helpMenuName);
+ ckfree(helpMenuName);
+ if ((helpMenuRef != NULL) && (helpMenuRef->menuPtr != NULL)) {
+ int newIndex = index - helpItemCount - 1;
+ result = TkInvokeMenu(currentMenuBarInterp,
+ helpMenuRef->menuPtr, newIndex);
+ }
+ }
+ } else {
+ Tcl_HashEntry *commandEntryPtr =
+ Tcl_FindHashEntry(&commandTable, (char *) ((int)menuID));
+ if (commandEntryPtr != NULL) {
+ TkMenu *menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
+ if ((currentAppleMenuID == menuID)
+ && (index > menuPtr->numEntries + 1)) {
+ Str255 itemText;
+
+ GetMenuItemText(GetMenuHandle(menuID), index, itemText);
+ result = TCL_OK;
+ } else {
+ result = TkInvokeMenu(menuPtr->interp, menuPtr, index - 1);
+ }
+ } else {
+ return TCL_ERROR;
+ }
+ }
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMenuIndicatorGeometry --
+ *
+ * Gets the width and height of the indicator area of a menu.
+ *
+ * Results:
+ * widthPtr and heightPtr are set.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetMenuIndicatorGeometry (
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are measuring */
+ Tk_Font tkfont, /* Precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* Precalculated font metrics */
+ int *widthPtr, /* The resulting width */
+ int *heightPtr) /* The resulting height */
+{
+ char markChar;
+
+ *heightPtr = fmPtr->linespace;
+
+ markChar = (char) FindMarkCharacter(mePtr);
+ *widthPtr = Tk_TextWidth(tkfont, &markChar, 1) + 4;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMenuAccelGeometry --
+ *
+ * Gets the width and height of the accelerator area of a menu.
+ *
+ * Results:
+ * widthPtr and heightPtr are set.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetMenuAccelGeometry (
+ TkMenu *menuPtr, /* The menu we are measuring */
+ TkMenuEntry *mePtr, /* The entry we are measuring */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalculated font metrics */
+ int *modWidthPtr, /* The width of all of the key
+ * modifier symbols. */
+ int *textWidthPtr, /* The resulting width */
+ int *heightPtr) /* The resulting height */
+{
+ *heightPtr = fmPtr->linespace;
+ *modWidthPtr = 0;
+ if (mePtr->type == CASCADE_ENTRY) {
+ *textWidthPtr = SICN_HEIGHT;
+ *modWidthPtr = Tk_TextWidth(tkfont, "W", 1);
+ } else if (0 == mePtr->accelLength) {
+ *textWidthPtr = 0;
+ } else {
+ char *accel = (mePtr->accelPtr == NULL) ? ""
+ : Tcl_GetStringFromObj(mePtr->accelPtr, NULL);
+
+ if (NULL == GetResource('SICN', SICN_RESOURCE_NUMBER)) {
+ *textWidthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
+ } else {
+ int emWidth = Tk_TextWidth(tkfont, "W", 1) + 1;
+ if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
+ int width = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
+ *textWidthPtr = emWidth;
+ if (width < emWidth) {
+ *modWidthPtr = 0;
+ } else {
+ *modWidthPtr = width - emWidth;
+ }
+ } else {
+ int length = ((EntryGeometry *)mePtr->platformEntryData)
+ ->accelTextStart;
+ if (mePtr->entryFlags & ENTRY_CONTROL_ACCEL) {
+ *modWidthPtr += CONTROL_ICON_WIDTH;
+ }
+ if (mePtr->entryFlags & ENTRY_SHIFT_ACCEL) {
+ *modWidthPtr += SHIFT_ICON_WIDTH;
+ }
+ if (mePtr->entryFlags & ENTRY_OPTION_ACCEL) {
+ *modWidthPtr += OPTION_ICON_WIDTH;
+ }
+ if (mePtr->entryFlags & ENTRY_COMMAND_ACCEL) {
+ *modWidthPtr += COMMAND_ICON_WIDTH;
+ }
+ if (1 == (mePtr->accelLength - length)) {
+ *textWidthPtr = emWidth;
+ } else {
+ *textWidthPtr += Tk_TextWidth(tkfont, accel
+ + length, mePtr->accelLength - length);
+ }
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetTearoffEntryGeometry --
+ *
+ * Gets the width and height of of a tearoff entry.
+ *
+ * Results:
+ * widthPtr and heightPtr are set.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetTearoffEntryGeometry (
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are measuring */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalculated font metrics */
+ int *widthPtr, /* The resulting width */
+ int *heightPtr) /* The resulting height */
+{
+ if ((GetResource('MDEF', 591) == NULL) &&
+ (menuPtr->menuType == MASTER_MENU)) {
+ *heightPtr = fmPtr->linespace;
+ *widthPtr = 0;
+ } else {
+ *widthPtr = *heightPtr = 0;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMenuSeparatorGeometry --
+ *
+ * Gets the width and height of menu separator.
+ *
+ * Results:
+ * widthPtr and heightPtr are set.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetMenuSeparatorGeometry(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are measuring */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalcualted font metrics */
+ int *widthPtr, /* The resulting width */
+ int *heightPtr) /* The resulting height */
+{
+ SInt16 outHeight;
+
+ GetThemeMenuSeparatorHeight(&outHeight);
+ *widthPtr = 0;
+ *heightPtr = outHeight;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuEntryIndicator --
+ *
+ * This procedure draws the indicator part of a menu.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DrawMenuEntryIndicator(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* The drawable we are drawing */
+ GC gc, /* The GC we are drawing with */
+ GC indicatorGC, /* The GC to use for the indicator */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalculated font metrics */
+ int x, /* topleft hand corner of entry */
+ int y, /* topleft hand corner of entry */
+ int width, /* width of entry */
+ int height) /* height of entry */
+{
+ if ((mePtr->type == CHECK_BUTTON_ENTRY) ||
+ (mePtr->type == RADIO_BUTTON_ENTRY)) {
+ if (mePtr->indicatorOn
+ && (mePtr->entryFlags & ENTRY_SELECTED)) {
+ int baseline;
+ short markShort;
+
+ baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
+ GetItemMark(((MacMenu *) menuPtr->platformData)->menuHdl,
+ mePtr->index + 1, &markShort);
+ if (markShort != 0) {
+ char markChar;
+ char markCharUTF[TCL_UTF_MAX + 1];
+ int dstWrote;
+
+ markChar = (char) markShort;
+ /*
+ * Not sure if this is the correct encoding, but this function
+ * doesn't appear to be used at all in, since the Carbon Menus
+ * draw themselves
+ */
+ Tcl_ExternalToUtf(NULL, NULL, &markChar, 1, 0, NULL,
+ markCharUTF, TCL_UTF_MAX + 1, NULL, &dstWrote, NULL);
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont, markCharUTF,
+ dstWrote, x + 2, baseline);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuBackground --
+ *
+ * If Appearance is present, draws the Appearance background
+ *
+ * Results:
+ * Nothing
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+static void
+DrawMenuBackground(
+ Rect *menuRectPtr, /* The menu rect */
+ Drawable d, /* What we are drawing into */
+ ThemeMenuType type /* Type of menu */
+ )
+{
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(d);
+ DrawThemeMenuBackground (menuRectPtr, type);
+ SetGWorld(saveWorld, saveDevice);
+ return;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawSICN --
+ *
+ * Given a resource id and an index, loads the appropriate SICN
+ * and draws it into a given drawable using the given gc.
+ *
+ * Results:
+ * Returns 1 if the SICN was found, 0 if not found.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+static int
+DrawSICN(
+ int resourceID, /* The resource # of the SICN table */
+ int index, /* The index into the SICN table of the
+ * icon we want. */
+ Drawable d, /* What we are drawing into */
+ GC gc, /* The GC to draw with */
+ int x, /* The left hand coord of the SICN */
+ int y) /* The top coord of the SICN */
+{
+ Handle sicnHandle = (Handle) GetResource('SICN', SICN_RESOURCE_NUMBER);
+
+ if (NULL == sicnHandle) {
+ return 0;
+ } else {
+ BitMap sicnBitmap;
+ Rect destRect;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ const BitMap *destBitMap;
+ RGBColor origForeColor, origBackColor, foreColor, backColor;
+
+ HLock(sicnHandle);
+ destPort = TkMacOSXGetDrawablePort(d);
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(d);
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+ GetForeColor(&origForeColor);
+ GetBackColor(&origBackColor);
+
+ if (TkSetMacColor(gc->foreground, &foreColor)) {
+ RGBForeColor(&foreColor);
+ }
+
+ if (TkSetMacColor(gc->background, &backColor)) {
+ RGBBackColor(&backColor);
+ }
+
+ SetRect(&destRect, x, y, x + SICN_HEIGHT, y + SICN_HEIGHT);
+ sicnBitmap.baseAddr = (Ptr) (*sicnHandle) + index * SICN_HEIGHT
+ * SICN_ROWS;
+ sicnBitmap.rowBytes = SICN_ROWS;
+ SetRect(&sicnBitmap.bounds, 0, 0, 16, 16);
+ destBitMap = GetPortBitMapForCopyBits(destPort);
+ CopyBits(&sicnBitmap, destBitMap, &sicnBitmap.bounds, &destRect, GetPortTextMode(destPort), NULL);
+ HUnlock(sicnHandle);
+ RGBForeColor(&origForeColor);
+ RGBBackColor(&origBackColor);
+ SetGWorld(saveWorld, saveDevice);
+ return 1;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuEntryAccelerator --
+ *
+ * This procedure draws the accelerator part of a menu. We
+ * need to decide what to draw here. Should we replace strings
+ * like "Control", "Command", etc?
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DrawMenuEntryAccelerator(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* The drawable we are drawing in */
+ GC gc, /* The gc to draw into */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalculated font metrics */
+ Tk_3DBorder activeBorder, /* border for menu background */
+ int x, /* The left side of the entry */
+ int y, /* The top of the entry */
+ int width, /* The width of the entry */
+ int height, /* The height of the entry */
+ int drawArrow) /* Whether or not to draw cascade arrow */
+{
+ int activeBorderWidth;
+
+ Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr,
+ &activeBorderWidth);
+ if (mePtr->type == CASCADE_ENTRY) {
+ /*
+ * Under Appearance, we let the Appearance Manager draw the icon
+ */
+
+ } else if (mePtr->accelLength != 0) {
+ int leftEdge = x + width;
+ int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
+ char *accel;
+
+ accel = Tcl_GetStringFromObj(mePtr->accelPtr, NULL);
+
+ if (NULL == GetResource('SICN', SICN_RESOURCE_NUMBER)) {
+ leftEdge -= ((EntryGeometry *) mePtr->platformEntryData)
+ ->accelTextWidth;
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel,
+ mePtr->accelLength, leftEdge, baseline);
+ } else {
+ EntryGeometry *geometryPtr =
+ (EntryGeometry *) mePtr->platformEntryData;
+ int length = mePtr->accelLength - geometryPtr->accelTextStart;
+
+ leftEdge -= geometryPtr->accelTextWidth;
+ if ((mePtr->entryFlags & ENTRY_ACCEL_MASK) == 0) {
+ leftEdge -= geometryPtr->modifierWidth;
+ }
+
+ Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel
+ + geometryPtr->accelTextStart, length, leftEdge, baseline);
+
+ if (mePtr->entryFlags & ENTRY_COMMAND_ACCEL) {
+ leftEdge -= COMMAND_ICON_WIDTH;
+ DrawSICN(SICN_RESOURCE_NUMBER, COMMAND_ICON, d, gc,
+ leftEdge, (y + (height / 2)) - (SICN_HEIGHT / 2) - 1);
+ }
+
+ if (mePtr->entryFlags & ENTRY_OPTION_ACCEL) {
+ leftEdge -= OPTION_ICON_WIDTH;
+ DrawSICN(SICN_RESOURCE_NUMBER, OPTION_ICON, d, gc,
+ leftEdge, (y + (height / 2)) - (SICN_HEIGHT / 2) - 1);
+ }
+
+ if (mePtr->entryFlags & ENTRY_SHIFT_ACCEL) {
+ leftEdge -= SHIFT_ICON_WIDTH;
+ DrawSICN(SICN_RESOURCE_NUMBER, SHIFT_ICON, d, gc,
+ leftEdge, (y + (height / 2)) - (SICN_HEIGHT / 2) - 1);
+ }
+
+ if (mePtr->entryFlags & ENTRY_CONTROL_ACCEL) {
+ leftEdge -= CONTROL_ICON_WIDTH;
+ DrawSICN(SICN_RESOURCE_NUMBER, CONTROL_ICON, d, gc,
+ leftEdge, (y + (height / 2)) - (SICN_HEIGHT / 2) - 1);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuSeparator --
+ *
+ * The menu separator is drawn.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DrawMenuSeparator(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* The drawable we are drawing into */
+ GC gc, /* The gc we are drawing with */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalculated font metrics */
+ int x, /* left coordinate of entry */
+ int y, /* top coordinate of entry */
+ int width, /* width of entry */
+ int height) /* height of entry */
+{
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ Rect r;
+
+ destPort = TkMacOSXGetDrawablePort(d);
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(d);
+ r.top = y;
+ r.left = x;
+ r.bottom = y + height;
+ r.right = x + width;
+
+ DrawThemeMenuSeparator(&r);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * AppearanceEntryDrawWrapper --
+ *
+ * It routes to the Appearance Managers DrawThemeEntry, which will
+ * then call us back after setting up the drawing context.
+ *
+ * Results:
+ * A menu entry is drawn
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+static void
+AppearanceEntryDrawWrapper(
+ TkMenuEntry *mePtr,
+ Rect *menuRectPtr,
+ MenuTrackingData *mtdPtr,
+ Drawable d,
+ Tk_FontMetrics *fmPtr,
+ Tk_Font tkfont,
+ int x,
+ int y,
+ int width,
+ int height)
+{
+ MenuEntryUserData meData;
+ Rect itemRect;
+ ThemeMenuState theState;
+ ThemeMenuItemType theType;
+
+ meData.mePtr = mePtr;
+ meData.mdefDrawable = d;
+ meData.fmPtr = fmPtr;
+ meData.tkfont = tkfont;
+
+ itemRect.top = y;
+ itemRect.left = x;
+ itemRect.bottom = itemRect.top + height;
+ itemRect.right = itemRect.left + width;
+
+ if (mePtr->state == ENTRY_ACTIVE) {
+ theState = kThemeMenuSelected;
+ } else if (mePtr->state == ENTRY_DISABLED) {
+ theState = kThemeMenuDisabled;
+ } else {
+ theState = kThemeMenuActive;
+ }
+
+ if (mePtr->type == CASCADE_ENTRY) {
+ theType = kThemeMenuItemHierarchical;
+ } else {
+ theType = kThemeMenuItemPlain;
+ }
+
+ DrawThemeMenuItem (menuRectPtr, &itemRect,
+ mtdPtr->virtualMenuTop, mtdPtr->virtualMenuBottom, theState,
+ theType, tkThemeMenuItemDrawingUPP,
+ (unsigned long) &meData);
+
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * tkThemeMenuItemDrawingProc --
+ *
+ * This routine is called from the Appearance DrawThemeMenuEntry
+ *
+ * Results:
+ * A menu entry is drawn
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+pascal void
+tkThemeMenuItemDrawingProc (
+ const Rect *inBounds,
+ SInt16 inDepth,
+ Boolean inIsColorDevice,
+ SInt32 inUserData)
+{
+ MenuEntryUserData *meData = (MenuEntryUserData *) inUserData;
+ TkpDrawMenuEntry(meData->mePtr, meData->mdefDrawable,
+ meData->tkfont, meData->fmPtr, inBounds->left,
+ inBounds->top, inBounds->right - inBounds->left,
+ inBounds->bottom - inBounds->top, 0, 1);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXHandleTearoffMenu() --
+ *
+ * This routine sees if the MDEF has set a menu and a mouse position
+ * for tearing off and makes a tearoff menu if it has.
+ *
+ * Results:
+ * menuPtr->interp will have the result of the tearoff command.
+ *
+ * Side effects:
+ * A new tearoff menu is created if it is supposed to be.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXHandleTearoffMenu(void)
+{
+ if (tearoffStruct.menuPtr != NULL) {
+ Tcl_DString tearoffCmdStr;
+ char intString[TCL_INTEGER_SPACE];
+ short windowPart;
+ WindowRef whichWindow;
+
+ windowPart = FindWindow(tearoffStruct.point, &whichWindow);
+
+ if (windowPart != inMenuBar) {
+ Tcl_DStringInit(&tearoffCmdStr);
+ Tcl_DStringAppendElement(&tearoffCmdStr, "tkTearOffMenu");
+ Tcl_DStringAppendElement(&tearoffCmdStr,
+ Tk_PathName(tearoffStruct.menuPtr->tkwin));
+ sprintf(intString, "%d", tearoffStruct.point.h);
+ Tcl_DStringAppendElement(&tearoffCmdStr, intString);
+ sprintf(intString, "%d", tearoffStruct.point.v);
+ Tcl_DStringAppendElement(&tearoffCmdStr, intString);
+ Tcl_Eval(tearoffStruct.menuPtr->interp,
+ Tcl_DStringValue(&tearoffCmdStr));
+ Tcl_DStringFree(&tearoffCmdStr);
+ tearoffStruct.menuPtr = NULL;
+ }
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpInitializeMenuBindings --
+ *
+ * For every interp, initializes the bindings for Windows
+ * menus. Does nothing on Mac or XWindows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * C-level bindings are setup for the interp which will
+ * handle Alt-key sequences for menus without beeping
+ * or interfering with user-defined Alt-key bindings.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkpInitializeMenuBindings(interp, bindingTable)
+ Tcl_Interp *interp; /* The interpreter to set. */
+ Tk_BindingTable bindingTable; /* The table to add to. */
+{
+ /*
+ * Nothing to do.
+ */
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpComputeMenubarGeometry --
+ *
+ * This procedure is invoked to recompute the size and
+ * layout of a menu that is a menubar clone.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Fields of menu entries are changed to reflect their
+ * current positions, and the size of the menu window
+ * itself may be changed.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkpComputeMenubarGeometry(menuPtr)
+ TkMenu *menuPtr; /* Structure describing menu. */
+{
+ TkpComputeStandardMenuGeometry(menuPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawTearoffEntry --
+ *
+ * This procedure draws the background part of a menu.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+DrawTearoffEntry(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* The drawable we are drawing into */
+ GC gc, /* The gc we are drawing with */
+ Tk_Font tkfont, /* The font we are drawing with */
+ CONST Tk_FontMetrics *fmPtr, /* The metrics we are drawing with */
+ int x, /* Left edge of entry. */
+ int y, /* Top edge of entry. */
+ int width, /* Width of entry. */
+ int height) /* Height of entry. */
+{
+ XPoint points[2];
+ int margin, segmentWidth, maxX;
+ Tk_3DBorder border;
+
+ if (menuPtr->menuType != MASTER_MENU ) {
+ return;
+ }
+
+ margin = (fmPtr->ascent + fmPtr->descent)/2;
+ points[0].x = x;
+ points[0].y = y + height/2;
+ points[1].y = points[0].y;
+ segmentWidth = 6;
+ maxX = width - 1;
+ border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr);
+
+ while (points[0].x < maxX) {
+ points[1].x = points[0].x + segmentWidth;
+ if (points[1].x > maxX) {
+ points[1].x = maxX;
+ }
+ Tk_Draw3DPolygon(menuPtr->tkwin, d, border, points, 2, 1,
+ TK_RELIEF_RAISED);
+ points[0].x += 2*segmentWidth;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetHelpMenuItemCount --
+ *
+ * Has to be called after the first call to InsertMenu. Sets
+ * up the global variable for the number of items in the
+ * unmodified help menu.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets the global helpItemCount.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetHelpMenuItemCount()
+{
+ MenuRef helpMenuHandle;
+ MenuItemIndex itemIndex;
+
+ if ((HMGetHelpMenu(&helpMenuHandle,&itemIndex) != noErr)
+ || (helpMenuHandle == NULL)) {
+ helpItemCount = -1;
+ } else {
+ helpItemCount = CountMenuItems(helpMenuHandle);
+ DeleteMenuItem(helpMenuHandle, helpItemCount);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXMenuClick --
+ *
+ * Prepares a menubar for MenuSelect or MenuKey.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Any pending configurations of the menubar are completed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXMenuClick()
+{
+ TkMenu *menuPtr;
+ TkMenuReferences *menuRefPtr;
+
+ if ((currentMenuBarInterp != NULL) && (currentMenuBarName != NULL)) {
+ menuRefPtr = TkFindMenuReferences(currentMenuBarInterp,
+ currentMenuBarName);
+ for (menuPtr = menuRefPtr->menuPtr->masterMenuPtr;
+ menuPtr != NULL; menuPtr = menuPtr->nextInstancePtr) {
+ if (menuPtr->menuType == MENUBAR) {
+ CompleteIdlers(menuPtr);
+ break;
+ }
+ }
+ }
+
+ if (menuBarFlags & MENUBAR_REDRAW_PENDING) {
+ Tcl_CancelIdleCall(DrawMenuBarWhenIdle, (ClientData *) NULL);
+ DrawMenuBarWhenIdle((ClientData *) NULL);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDrawMenuEntry --
+ *
+ * Draws the given menu entry at the given coordinates with the
+ * given attributes.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * X Server commands are executed to display the menu entry.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDrawMenuEntry(
+ TkMenuEntry *mePtr, /* The entry to draw */
+ Drawable d, /* What to draw into */
+ Tk_Font tkfont, /* Precalculated font for menu */
+ CONST Tk_FontMetrics *menuMetricsPtr,
+ /* Precalculated metrics for menu */
+ int x, /* X-coordinate of topleft of entry */
+ int y, /* Y-coordinate of topleft of entry */
+ int width, /* Width of the entry rectangle */
+ int height, /* Height of the current rectangle */
+ int strictMotif, /* Boolean flag */
+ int drawArrow) /* Whether or not to draw the cascade
+ * arrow for cascade items. Only applies
+ * to Windows. */
+{
+ GC gc;
+ TkMenu *menuPtr = mePtr->menuPtr;
+ int padY = (menuPtr->menuType == MENUBAR) ? 3 : 0;
+ GC indicatorGC;
+ Tk_3DBorder bgBorder, activeBorder;
+ const Tk_FontMetrics *fmPtr;
+ Tk_FontMetrics entryMetrics;
+ int adjustedY = y + padY;
+ int adjustedHeight = height - 2 * padY;
+
+ /*
+ * Choose the gc for drawing the foreground part of the entry.
+ * Under Appearance, we pass a null (appearanceGC) to tell
+ * ourselves not to change whatever color the appearance manager has set.
+ */
+
+ if ((mePtr->state == ENTRY_ACTIVE) && !strictMotif) {
+ gc = mePtr->activeGC;
+ if (gc == NULL) {
+ gc = menuPtr->activeGC;
+ }
+ } else {
+ TkMenuEntry *cascadeEntryPtr;
+ int parentDisabled = 0;
+
+ for (cascadeEntryPtr = menuPtr->menuRefPtr->parentEntryPtr;
+ cascadeEntryPtr != NULL;
+ cascadeEntryPtr = cascadeEntryPtr->nextCascadePtr) {
+ char *name = (cascadeEntryPtr->namePtr == NULL) ? ""
+ : Tcl_GetStringFromObj(cascadeEntryPtr->namePtr, NULL);
+
+ if (strcmp(name, Tk_PathName(menuPtr->tkwin)) == 0) {
+ if (cascadeEntryPtr->state == ENTRY_DISABLED) {
+ parentDisabled = 1;
+ }
+ break;
+ }
+ }
+
+ if (((parentDisabled || (mePtr->state == ENTRY_DISABLED)))
+ && (menuPtr->disabledFgPtr != NULL)) {
+ gc = mePtr->disabledGC;
+ if (gc == NULL) {
+ gc = menuPtr->disabledGC;
+ }
+ } else {
+ gc = mePtr->textGC;
+ if (gc == NULL) {
+ gc = menuPtr->textGC;
+ }
+ }
+ }
+
+ indicatorGC = mePtr->indicatorGC;
+ if (indicatorGC == NULL) {
+ indicatorGC = menuPtr->indicatorGC;
+ }
+
+ bgBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin,
+ (mePtr->borderPtr == NULL)
+ ? menuPtr->borderPtr : mePtr->borderPtr);
+ if (strictMotif) {
+ activeBorder = bgBorder;
+ } else {
+ activeBorder = Tk_Get3DBorderFromObj(menuPtr->tkwin,
+ (mePtr->activeBorderPtr == NULL)
+ ? menuPtr->activeBorderPtr : mePtr->activeBorderPtr);
+ }
+
+ if (mePtr->fontPtr == NULL) {
+ fmPtr = menuMetricsPtr;
+ } else {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr);
+ Tk_GetFontMetrics(tkfont, &entryMetrics);
+ fmPtr = &entryMetrics;
+ }
+
+ /*
+ * Need to draw the entire background, including padding. On Unix,
+ * for menubars, we have to draw the rest of the entry taking
+ * into account the padding.
+ */
+
+ DrawMenuEntryBackground(menuPtr, mePtr, d, activeBorder,
+ bgBorder, x, y, width, height);
+
+ if (mePtr->type == SEPARATOR_ENTRY) {
+ DrawMenuSeparator(menuPtr, mePtr, d, gc, tkfont,
+ fmPtr, x, adjustedY, width, adjustedHeight);
+ } else if (mePtr->type == TEAROFF_ENTRY) {
+ DrawTearoffEntry(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, adjustedY,
+ width, adjustedHeight);
+ } else {
+ DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x,
+ adjustedY, width, adjustedHeight);
+ DrawMenuEntryAccelerator(menuPtr, mePtr, d, gc, tkfont, fmPtr,
+ activeBorder, x, adjustedY, width, adjustedHeight, drawArrow);
+ if (!mePtr->hideMargin) {
+ DrawMenuEntryIndicator(menuPtr, mePtr, d, gc, indicatorGC, tkfont,
+ fmPtr, x, adjustedY, width, adjustedHeight);
+ }
+
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpComputeStandardMenuGeometry --
+ *
+ * This procedure is invoked to recompute the size and
+ * layout of a menu that is not a menubar clone.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Fields of menu entries are changed to reflect their
+ * current positions, and the size of the menu window
+ * itself may be changed.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkpComputeStandardMenuGeometry(
+ TkMenu *menuPtr) /* Structure describing menu. */
+{
+ Tk_Font tkfont, menuFont;
+ Tk_FontMetrics menuMetrics, entryMetrics, *fmPtr;
+ int x, y, height, modifierWidth, labelWidth, indicatorSpace;
+ int windowWidth, windowHeight, accelWidth, maxAccelTextWidth;
+ int i, j, lastColumnBreak, maxModifierWidth, maxWidth, nonAccelMargin;
+ int maxNonAccelMargin, maxEntryWithAccelWidth, maxEntryWithoutAccelWidth;
+ int entryWidth, maxIndicatorSpace, borderWidth, activeBorderWidth;
+ TkMenuEntry *mePtr, *columnEntryPtr;
+ EntryGeometry *geometryPtr;
+
+ if (menuPtr->tkwin == NULL) {
+ return;
+ }
+
+ Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
+ &borderWidth);
+ Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr,
+ &activeBorderWidth);
+ x = y = borderWidth;
+ indicatorSpace = labelWidth = accelWidth = maxAccelTextWidth = 0;
+ windowHeight = windowWidth = maxWidth = lastColumnBreak = 0;
+ maxModifierWidth = nonAccelMargin = maxNonAccelMargin = 0;
+ maxEntryWithAccelWidth = maxEntryWithoutAccelWidth = 0;
+ maxIndicatorSpace = 0;
+
+ /*
+ * On the Mac especially, getting font metrics can be quite slow,
+ * so we want to do it intelligently. We are going to precalculate
+ * them and pass them down to all of the measuring and drawing
+ * routines. We will measure the font metrics of the menu once.
+ * If an entry does not have its own font set, then we give
+ * the geometry/drawing routines the menu's font and metrics.
+ * If an entry has its own font, we will measure that font and
+ * give all of the geometry/drawing the entry's font and metrics.
+ */
+
+ menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
+ Tk_GetFontMetrics(menuFont, &menuMetrics);
+
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ mePtr = menuPtr->entries[i];
+ if (mePtr->fontPtr == NULL) {
+ tkfont = menuFont;
+ fmPtr = &menuMetrics;
+ } else {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr);
+ Tk_GetFontMetrics(tkfont, &entryMetrics);
+ fmPtr = &entryMetrics;
+ }
+
+ if ((i > 0) && mePtr->columnBreak) {
+ if (maxIndicatorSpace != 0) {
+ maxIndicatorSpace += 2;
+ }
+ for (j = lastColumnBreak; j < i; j++) {
+ columnEntryPtr = menuPtr->entries[j];
+ geometryPtr =
+ (EntryGeometry *) columnEntryPtr->platformEntryData;
+
+ columnEntryPtr->indicatorSpace = maxIndicatorSpace;
+ columnEntryPtr->width = maxIndicatorSpace + maxWidth
+ + 2 * activeBorderWidth;
+ geometryPtr->accelTextWidth = maxAccelTextWidth;
+ geometryPtr->modifierWidth = maxModifierWidth;
+ columnEntryPtr->x = x;
+ columnEntryPtr->entryFlags &= ~ENTRY_LAST_COLUMN;
+ if (maxEntryWithoutAccelWidth > maxEntryWithAccelWidth) {
+ geometryPtr->nonAccelMargin = maxEntryWithoutAccelWidth
+ - maxEntryWithAccelWidth;
+ if (geometryPtr->nonAccelMargin > maxNonAccelMargin) {
+ geometryPtr->nonAccelMargin = maxNonAccelMargin;
+ }
+ } else {
+ geometryPtr->nonAccelMargin = 0;
+ }
+ }
+ x += maxIndicatorSpace + maxWidth + 2 * borderWidth;
+ windowWidth = x;
+ maxWidth = maxIndicatorSpace = maxAccelTextWidth = 0;
+ maxModifierWidth = maxNonAccelMargin = maxEntryWithAccelWidth = 0;
+ maxEntryWithoutAccelWidth = 0;
+ lastColumnBreak = i;
+ y = borderWidth;
+ }
+
+ if (mePtr->type == SEPARATOR_ENTRY) {
+ GetMenuSeparatorGeometry(menuPtr, mePtr, tkfont,
+ fmPtr, &entryWidth, &height);
+ mePtr->height = height;
+ } else if (mePtr->type == TEAROFF_ENTRY) {
+ GetTearoffEntryGeometry(menuPtr, mePtr, tkfont,
+ fmPtr, &entryWidth, &height);
+ mePtr->height = height;
+ } else {
+ /*
+ * For each entry, compute the height required by that
+ * particular entry, plus three widths: the width of the
+ * label, the width to allow for an indicator to be displayed
+ * to the left of the label (if any), and the width of the
+ * accelerator to be displayed to the right of the label
+ * (if any). These sizes depend, of course, on the type
+ * of the entry.
+ */
+
+ GetMenuLabelGeometry(mePtr, tkfont, fmPtr, &labelWidth,
+ &height);
+ mePtr->height = height;
+
+ if (mePtr->type == CASCADE_ENTRY) {
+ GetMenuAccelGeometry(menuPtr, mePtr, tkfont, fmPtr,
+ &modifierWidth, &accelWidth, &height);
+ nonAccelMargin = 0;
+ } else if (mePtr->accelLength == 0) {
+ nonAccelMargin = mePtr->hideMargin ? 0
+ : Tk_TextWidth(tkfont, "m", 1);
+ accelWidth = modifierWidth = 0;
+ } else {
+ labelWidth += Tk_TextWidth(tkfont, "m", 1);
+ GetMenuAccelGeometry(menuPtr, mePtr, tkfont,
+ fmPtr, &modifierWidth, &accelWidth, &height);
+ if (height > mePtr->height) {
+ mePtr->height = height;
+ }
+ nonAccelMargin = 0;
+ }
+
+ if (!(mePtr->hideMargin)) {
+ GetMenuIndicatorGeometry(menuPtr, mePtr, tkfont,
+ fmPtr, &indicatorSpace, &height);
+ if (height > mePtr->height) {
+ mePtr->height = height;
+ }
+ } else {
+ indicatorSpace = 0;
+ }
+
+ if (nonAccelMargin > maxNonAccelMargin) {
+ maxNonAccelMargin = nonAccelMargin;
+ }
+ if (accelWidth > maxAccelTextWidth) {
+ maxAccelTextWidth = accelWidth;
+ }
+ if (modifierWidth > maxModifierWidth) {
+ maxModifierWidth = modifierWidth;
+ }
+ if (indicatorSpace > maxIndicatorSpace) {
+ maxIndicatorSpace = indicatorSpace;
+ }
+
+ entryWidth = labelWidth + modifierWidth + accelWidth
+ + nonAccelMargin;
+
+ if (entryWidth > maxWidth) {
+ maxWidth = entryWidth;
+ }
+
+ if (mePtr->accelLength > 0) {
+ if (entryWidth > maxEntryWithAccelWidth) {
+ maxEntryWithAccelWidth = entryWidth;
+ }
+ } else {
+ if (entryWidth > maxEntryWithoutAccelWidth) {
+ maxEntryWithoutAccelWidth = entryWidth;
+ }
+ }
+
+ mePtr->height += 2 * activeBorderWidth;
+ }
+ mePtr->y = y;
+ y += menuPtr->entries[i]->height + borderWidth;
+ if (y > windowHeight) {
+ windowHeight = y;
+ }
+ }
+
+ for (j = lastColumnBreak; j < menuPtr->numEntries; j++) {
+ columnEntryPtr = menuPtr->entries[j];
+ geometryPtr = (EntryGeometry *) columnEntryPtr->platformEntryData;
+
+ columnEntryPtr->indicatorSpace = maxIndicatorSpace;
+ columnEntryPtr->width = maxIndicatorSpace + maxWidth
+ + 2 * activeBorderWidth;
+ geometryPtr->accelTextWidth = maxAccelTextWidth;
+ geometryPtr->modifierWidth = maxModifierWidth;
+ columnEntryPtr->x = x;
+ columnEntryPtr->entryFlags |= ENTRY_LAST_COLUMN;
+ if (maxEntryWithoutAccelWidth > maxEntryWithAccelWidth) {
+ geometryPtr->nonAccelMargin = maxEntryWithoutAccelWidth
+ - maxEntryWithAccelWidth;
+ if (geometryPtr->nonAccelMargin > maxNonAccelMargin) {
+ geometryPtr->nonAccelMargin = maxNonAccelMargin;
+ }
+ } else {
+ geometryPtr->nonAccelMargin = 0;
+ }
+ }
+ windowWidth = x + maxIndicatorSpace + maxWidth
+ + 2 * activeBorderWidth + borderWidth;
+ windowHeight += borderWidth;
+
+ /*
+ * The X server doesn't like zero dimensions, so round up to at least
+ * 1 (a zero-sized menu should never really occur, anyway).
+ */
+
+ if (windowWidth <= 0) {
+ windowWidth = 1;
+ }
+ if (windowHeight <= 0) {
+ windowHeight = 1;
+ }
+ menuPtr->totalWidth = windowWidth;
+ menuPtr->totalHeight = windowHeight;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuEntryLabel --
+ *
+ * This procedure draws the label part of a menu.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DrawMenuEntryLabel(
+ TkMenu *menuPtr, /* The menu we are drawing */
+ TkMenuEntry *mePtr, /* The entry we are drawing */
+ Drawable d, /* What we are drawing into */
+ GC gc, /* The gc we are drawing into */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalculated font metrics */
+ int x, /* left edge */
+ int y, /* right edge */
+ int width, /* width of entry */
+ int height) /* height of entry */
+{
+ int baseline;
+ int indicatorSpace = mePtr->indicatorSpace;
+ int leftEdge = x + indicatorSpace;
+ int imageHeight, imageWidth;
+
+ /*
+ * Draw label or bitmap or image for entry.
+ */
+
+ baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
+ if (mePtr->image != NULL) {
+ Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight);
+ if ((mePtr->selectImage != NULL)
+ && (mePtr->entryFlags & ENTRY_SELECTED)) {
+ Tk_RedrawImage(mePtr->selectImage, 0, 0,
+ imageWidth, imageHeight, d, leftEdge,
+ (int) (y + (mePtr->height - imageHeight)/2));
+ } else {
+ Tk_RedrawImage(mePtr->image, 0, 0, imageWidth,
+ imageHeight, d, leftEdge,
+ (int) (y + (mePtr->height - imageHeight)/2));
+ }
+ } else if (mePtr->bitmapPtr != NULL) {
+ int width, height;
+ Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
+ Tk_SizeOfBitmap(menuPtr->display,
+ bitmap, &width, &height);
+ XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0,
+ (unsigned) width, (unsigned) height, leftEdge,
+ (int) (y + (mePtr->height - height)/2), 1);
+ } else {
+ if (mePtr->labelLength > 0) {
+ Tcl_DString itemTextDString, convertedTextDString;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+#ifdef USE_ATSU
+ int runLengths;
+ CFStringRef stringRef;
+ ATSUTextLayout textLayout;
+ UniCharCount runLength;
+ ATSUStyle style;
+ int length;
+ int err;
+ Str255 fontName;
+ SInt16 fontSize;
+ Style fontStyle;
+ ATSUAttributeValuePtr valuePtr;
+ ByteCount valueSize;
+ Fixed fixedSize;
+ short iFONDNumber;
+ ATSUFontID fontID;
+ ATSUAttributeTag tag;
+
+ GetThemeFont (kThemeMenuItemFont, smSystemScript, fontName, &fontSize, &fontStyle);
+ if ((err = ATSUCreateStyle(&style)) != noErr) {
+ fprintf(stderr,"ATSUCreateStyle failed, %d\n", err);
+ return;
+ }
+ fixedSize = fontSize<<16;
+ tag = kATSUSizeTag;
+ valueSize = sizeof(fixedSize);
+ valuePtr = &fixedSize;
+ if ((err=ATSUSetAttributes(style, 1, &tag, &valueSize, &valuePtr))!= noErr) {
+ fprintf(stderr,"ATSUSetAttributes failed,%d\n", err );
+ }
+
+ GetFNum(fontName, &iFONDNumber);
+ ATSUFONDtoFontID(iFONDNumber, NULL, &fontID);
+ tag = kATSUFontTag;
+ valueSize = sizeof(fontID);
+ valuePtr = &fontID;
+ if ((err=ATSUSetAttributes(style, 1, &tag, &valueSize, &valuePtr))!= noErr) {
+ fprintf(stderr,"ATSUSetAttributes failed,%d\n", err );
+ }
+
+#endif
+
+ GetEntryText(mePtr, &itemTextDString);
+#ifdef USE_ATSU
+ runLengths = 1;
+ length = Tcl_DStringLength(&itemTextDString);
+ stringRef = CFStringCreateWithCString(NULL, Tcl_DStringValue(&itemTextDString), GetApplicationTextEncoding());
+ if (!stringRef) {
+ fprintf(stderr,"CFStringCreateWithCString failed\n");
+ }
+ if ((err=ATSUCreateTextLayoutWithTextPtr(CFStringGetCharactersPtr(stringRef), 0, length, length,
+ 1, &runLengths, &style, &textLayout)) != noErr) {
+ fprintf(stderr,"ATSUCreateTextLayoutWithTextPtr failed, %d\n", err);
+ return;
+ }
+#endif
+
+ /* Somehow DrawChars is changing the colors, it is odd, since
+ it works for the Apple Platinum Appearance, but not for
+ some Kaleidoscope Themes... Untill I can figure out what
+ exactly is going on, this will have to do: */
+
+ destPort = TkMacOSXGetDrawablePort(d);
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpGraphicsPort(gc, destPort);
+
+ MoveTo((short) leftEdge, (short) baseline);
+ Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&itemTextDString),
+ Tcl_DStringLength(&itemTextDString), &convertedTextDString);
+#ifdef USE_ATSU
+ xLocation = leftEdge<<16;
+ yLocation = baseline<<16;
+ ATSUDrawText(textLayout,kATSUFromTextBeginning, kATSUToTextEnd, xLocation, yLocation);
+ ATSUDisposeTextLayout(textLayout);
+ CFRelease(stringRef);
+#else
+ DrawText(Tcl_DStringValue(&convertedTextDString), 0,
+ Tcl_DStringLength(&convertedTextDString));
+#endif
+
+ /* Tk_DrawChars(menuPtr->display, d, gc,
+ tkfont, Tcl_DStringValue(&itemTextDString),
+ Tcl_DStringLength(&itemTextDString),
+ leftEdge, baseline); */
+
+ Tcl_DStringFree(&itemTextDString);
+ }
+ }
+
+ if (mePtr->state == ENTRY_DISABLED) {
+ if (menuPtr->disabledFgPtr == NULL) {
+ } else if ((mePtr->image != NULL)
+ && (menuPtr->disabledImageGC != None)) {
+ XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
+ leftEdge,
+ (int) (y + (mePtr->height - imageHeight)/2),
+ (unsigned) imageWidth, (unsigned) imageHeight);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DrawMenuEntryBackground --
+ *
+ * This procedure draws the background part of a menu entry.
+ * Under Appearance, we only draw the background if the entry's
+ * border is set, we DO NOT inherit it from the menu...
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Commands are output to X to display the menu in its
+ * current mode.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+DrawMenuEntryBackground(
+ TkMenu *menuPtr, /* The menu we are drawing. */
+ TkMenuEntry *mePtr, /* The entry we are drawing. */
+ Drawable d, /* What we are drawing into */
+ Tk_3DBorder activeBorder, /* Border for active items */
+ Tk_3DBorder bgBorder, /* Border for the background */
+ int x, /* left edge */
+ int y, /* top edge */
+ int width, /* width of rectangle to draw */
+ int height) /* height of rectangle to draw */
+{
+ if ((menuPtr->menuType == TEAROFF_MENU)
+ || ((mePtr->state == ENTRY_ACTIVE)
+ && (mePtr->activeBorderPtr != None))
+ || ((mePtr->state != ENTRY_ACTIVE) && (mePtr->borderPtr != None))) {
+ if (mePtr->state == ENTRY_ACTIVE) {
+ bgBorder = activeBorder;
+ }
+ Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder,
+ x, y, width, height, 0, TK_RELIEF_FLAT);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetMenuLabelGeometry --
+ *
+ * Figures out the size of the label portion of a menu item.
+ *
+ * Results:
+ * widthPtr and heightPtr are filled in with the correct geometry
+ * information.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GetMenuLabelGeometry(
+ TkMenuEntry *mePtr, /* The entry we are computing */
+ Tk_Font tkfont, /* The precalculated font */
+ CONST Tk_FontMetrics *fmPtr, /* The precalculated metrics */
+ int *widthPtr, /* The resulting width of the label
+ * portion */
+ int *heightPtr) /* The resulting height of the label
+ * portion */
+{
+ TkMenu *menuPtr = mePtr->menuPtr;
+
+ if (mePtr->image != NULL) {
+ Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr);
+ } else if (mePtr->bitmapPtr != NULL) {
+ Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
+ Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr);
+ } else {
+ *heightPtr = fmPtr->linespace;
+
+ if (mePtr->labelPtr != NULL) {
+ Tcl_DString itemTextDString;
+
+ GetEntryText(mePtr, &itemTextDString);
+ *widthPtr = Tk_TextWidth(tkfont,
+ Tcl_DStringValue(&itemTextDString),
+ Tcl_DStringLength(&itemTextDString));
+ Tcl_DStringFree(&itemTextDString);
+ } else {
+ *widthPtr = 0;
+ }
+ }
+ *heightPtr += 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MenuSelectEvent --
+ *
+ * Generates a "MenuSelect" virtual event. This can be used to
+ * do context-sensitive menu help.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Places a virtual event on the event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+MenuSelectEvent(
+ TkMenu *menuPtr) /* the menu we have selected. */
+{
+ XVirtualEvent event;
+ Point where;
+ CGrafPtr port;
+ Rect bounds;
+
+ event.type = VirtualEvent;
+ event.serial = menuPtr->display->request;
+ event.send_event = false;
+ event.display = menuPtr->display;
+ Tk_MakeWindowExist(menuPtr->tkwin);
+ event.event = Tk_WindowId(menuPtr->tkwin);
+ event.root = XRootWindow(menuPtr->display, 0);
+ event.subwindow = None;
+ event.time = TkpGetMS();
+
+ GetMouse(&where);
+ GetPort(&port);
+ GetPortBounds(port,&bounds);
+ event.x_root = where.h + bounds.left;
+ event.y_root = where.v + bounds.top;
+ event.state = TkMacOSXButtonKeyState();
+ event.same_screen = true;
+ event.name = Tk_GetUid("MenuSelect");
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * RecursivelyClearActiveMenu --
+ *
+ * Recursively clears the active entry in the menu's cascade hierarchy.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Generates <<MenuSelect>> virtual events.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+RecursivelyClearActiveMenu(
+ TkMenu *menuPtr) /* The menu to reset. */
+{
+ int i;
+ TkMenuEntry *mePtr;
+
+ TkActivateMenuEntry(menuPtr, -1);
+ MenuSelectEvent(menuPtr);
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ mePtr = menuPtr->entries[i];
+ if (mePtr->type == CASCADE_ENTRY) {
+ if ((mePtr->childMenuRefPtr != NULL)
+ && (mePtr->childMenuRefPtr->menuPtr != NULL)) {
+ RecursivelyClearActiveMenu(mePtr->childMenuRefPtr->menuPtr);
+ }
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InvalidateMDEFRgns --
+ *
+ * Invalidates the regions covered by menus that did redrawing and
+ * might be damaged.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Generates Mac update events for affected windows.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+InvalidateMDEFRgns(void)
+{
+ GDHandle saveDevice;
+ GWorldPtr saveWorld, destPort;
+ Point scratch;
+ MacDrawable *macDraw;
+ TkMacOSXWindowList *listPtr;
+
+ if (totalMenuRgn == NULL) {
+ return;
+ }
+
+ GetGWorld(&saveWorld, &saveDevice);
+ for (listPtr = tkMacOSXWindowListPtr ; listPtr != NULL;
+ listPtr = listPtr->nextPtr) {
+ macDraw = (MacDrawable *) Tk_WindowId(listPtr->winPtr);
+ if (macDraw->flags & TK_DRAWN_UNDER_MENU) {
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(listPtr->winPtr));
+ SetGWorld(destPort, NULL);
+ scratch.h = scratch.v = 0;
+ GlobalToLocal(&scratch);
+ OffsetRgn(totalMenuRgn, scratch.v, scratch.h);
+ InvalWindowRgn(GetWindowFromPort(destPort),totalMenuRgn);
+ OffsetRgn(totalMenuRgn, -scratch.v, -scratch.h);
+ macDraw->flags &= ~TK_DRAWN_UNDER_MENU;
+ }
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+ SetEmptyRgn(totalMenuRgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXClearMenubarActive --
+ *
+ * Recursively clears the active entry in the current menubar hierarchy.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Generates <<MenuSelect>> virtual events.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXClearMenubarActive(void)
+{
+ TkMenuReferences *menuBarRefPtr;
+
+ if (currentMenuBarName != NULL) {
+ menuBarRefPtr = TkFindMenuReferences(currentMenuBarInterp,
+ currentMenuBarName);
+ if ((menuBarRefPtr != NULL) && (menuBarRefPtr->menuPtr != NULL)) {
+ TkMenu *menuPtr;
+
+ for (menuPtr = menuBarRefPtr->menuPtr->masterMenuPtr; menuPtr != NULL;
+ menuPtr = menuPtr->nextInstancePtr) {
+ if (menuPtr->menuType == MENUBAR) {
+ RecursivelyClearActiveMenu(menuPtr);
+ }
+ }
+ }
+ }
+ InvalidateMDEFRgns();
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMenuNotifyToplevelCreate --
+ *
+ * This routine reconfigures the menu and the clones indicated by
+ * menuName becuase a toplevel has been created and any system
+ * menus need to be created. Only applicable to Windows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * An idle handler is set up to do the reconfiguration.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMenuNotifyToplevelCreate(
+ Tcl_Interp *interp, /* The interp the menu lives in. */
+ char *menuName) /* The name of the menu to
+ * reconfigure. */
+{
+ /*
+ * Nothing to do.
+ */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMenuInit --
+ *
+ * Initializes Mac-specific menu data.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Allocates a hash table.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMenuInit(void)
+{
+ lastMenuID = 256;
+ Tcl_InitHashTable(&commandTable, TCL_ONE_WORD_KEYS);
+ currentMenuBarOwner = NULL;
+ tearoffStruct.menuPtr = NULL;
+ currentAppleMenuID = 0;
+ currentHelpMenuID = 0;
+ currentMenuBarInterp = NULL;
+ currentMenuBarName = NULL;
+ windowListPtr = NULL;
+
+ tkThemeMenuItemDrawingUPP
+ = NewMenuItemDrawingUPP(tkThemeMenuItemDrawingProc);
+
+ /*
+ * We should just hardcode the utf-8 ellipsis character into
+ * 'elipsisString' here
+ */
+ Tcl_ExternalToUtf(NULL, Tcl_GetEncoding(NULL, "macRoman"),
+ "\311", /* ellipsis character */
+ -1, 0, NULL, elipsisString,
+ TCL_UTF_MAX + 1, NULL, NULL, NULL);
+
+ useMDEFVar = Tcl_NewStringObj("::tk::mac::useCustomMDEF", -1);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMenuThreadInit --
+ *
+ * Does platform-specific initialization of thread-specific
+ * menu state.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMenuThreadInit()
+{
+ /*
+ * Nothing to do.
+ */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpPreprocessMacMenu --
+ *
+ * Handle preprocessing of menubar if it exists.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * All post commands for the current menubar get executed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXPreprocessMenu()
+{
+ TkMenuReferences *mbRefPtr;
+ int code;
+
+ if ((currentMenuBarName != NULL) && (currentMenuBarInterp != NULL)) {
+ mbRefPtr = TkFindMenuReferences(currentMenuBarInterp,
+ currentMenuBarName);
+ if ((mbRefPtr != NULL) && (mbRefPtr->menuPtr != NULL)) {
+ Tcl_Preserve((ClientData)currentMenuBarInterp);
+ code = TkPreprocessMenu(mbRefPtr->menuPtr->masterMenuPtr);
+ if ((code != TCL_OK) && (code != TCL_CONTINUE)
+ && (code != TCL_BREAK)) {
+ Tcl_AddErrorInfo(currentMenuBarInterp,
+ "\n (menu preprocess)");
+ Tcl_BackgroundError(currentMenuBarInterp);
+ }
+ Tcl_Release((ClientData)currentMenuBarInterp);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MenuDefProc --
+ *
+ * This routine is the MDEF handler for Tk. It receives all messages
+ * for the menu and dispatches them.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * This routine causes menus to be drawn and will certainly allocate
+ * memory as a result. Also, the menu can scroll up and down, and
+ * various other interface actions can take place.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+MenuDefProc(
+ SInt16 message, /* What action are we taking? */
+ MenuRef menu, /* The menu we are working with */
+ Rect *menuRectPtr, /* A pointer to the rect for the
+ * whole menu. */
+ Point hitPt, /* Where the mouse was clicked for
+ * the appropriate messages. */
+ SInt16 *whichItem) /* Output result. Which item was
+ * hit by the user? */
+{
+ TkMenu *menuPtr;
+ Tcl_HashEntry *commandEntryPtr;
+ int maxMenuHeight;
+ MenuID menuID;
+ BitMap screenBits;
+
+ menuID = GetMenuID(menu);
+ commandEntryPtr = Tcl_FindHashEntry(&commandTable, (char *) ((int)menuID));
+
+ if (commandEntryPtr) {
+ menuPtr = (TkMenu *) Tcl_GetHashValue(commandEntryPtr);
+ } else {
+ menuPtr = NULL;
+ }
+
+ switch (message) {
+ case kMenuInitMsg:
+ *whichItem = noErr;
+ break;
+ case kMenuDisposeMsg:
+ break;
+ case kMenuHiliteItemMsg: {
+ HandleMenuHiliteMsg (menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ }
+ case kMenuCalcItemMsg:
+ HandleMenuCalcItemMsg (menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ case kMenuDrawItemsMsg: {
+ /*
+ * We do nothing here, because we don't support the Menu Managers
+ * dynamic item groups
+ */
+
+ break;
+ }
+ case kMenuThemeSavvyMsg:
+ *whichItem = kThemeSavvyMenuResponse;
+ break;
+ case kMenuSizeMsg:
+ GetQDGlobalsScreenBits(&screenBits);
+ maxMenuHeight = screenBits.bounds.bottom
+ - screenBits.bounds.top
+ - GetMBarHeight() - SCREEN_MARGIN;
+ SetMenuWidth(menu, menuPtr->totalWidth );
+ SetMenuHeight(menu,maxMenuHeight < menuPtr->totalHeight ? maxMenuHeight : menuPtr->totalHeight );
+ break;
+ case kMenuDrawMsg:
+ HandleMenuDrawMsg (menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ case kMenuFindItemMsg:
+ HandleMenuFindItemsMsg (menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ case kMenuPopUpMsg:
+ HandleMenuPopUpMsg (menu, menuRectPtr, hitPt, whichItem, menuPtr);
+ break;
+ }
+}
+
+void
+HandleMenuHiliteMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr)
+{
+ TkMenuEntry *mePtr = NULL;
+ Tk_Font tkfont;
+ Tk_FontMetrics fontMetrics;
+ int oldItem;
+ int newItem = -1;
+ MDEFHiliteItemData * hidPtr = ( MDEFHiliteItemData *)whichItem;
+ MenuTrackingData mtd, *mtdPtr = &mtd;
+ int err;
+ oldItem = hidPtr->previousItem - 1;
+ newItem = hidPtr->newItem - 1;
+
+ err = GetMenuTrackingData(menu, mtdPtr);
+ if (err !=noErr) {
+ fprintf(stderr,"GetMenuTrackingData failed : %d\n", err );
+ return;
+ }
+
+ if (oldItem >= 0) {
+ Rect oldItemRect;
+ int width;
+
+ mePtr = menuPtr->entries[oldItem];
+ if (mePtr->fontPtr == NULL) {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin,
+ menuPtr->fontPtr);
+ } else {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin,
+ mePtr->fontPtr);
+ }
+ Tk_GetFontMetrics(tkfont, &fontMetrics);
+
+ width = (mePtr->entryFlags & ENTRY_LAST_COLUMN)
+ ? menuPtr->totalWidth - mePtr->x : mePtr->width;
+
+ /*
+ * In Aqua, have to call EraseMenuBackground when you overdraw
+ * a previously selected menu item, otherwise you will see the
+ * old select highlight under the transparency of the new menu item.
+ */
+
+ oldItemRect.left = menuRectPtr->left + mePtr->x;
+ oldItemRect.right = oldItemRect.left +width;
+ oldItemRect.top = mtdPtr->virtualMenuTop + mePtr->y;
+ oldItemRect.bottom = oldItemRect.top + mePtr->height;
+
+ EraseMenuBackground(menu, & oldItemRect, NULL);
+
+ AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
+ (Drawable) &macMDEFDrawable, &fontMetrics, tkfont,
+ oldItemRect.left,
+ oldItemRect.top,
+ width,
+ mePtr->height);
+ }
+ if (newItem != -1) {
+ mePtr = menuPtr->entries[newItem];
+ if (mePtr->state != ENTRY_DISABLED) {
+ TkActivateMenuEntry(menuPtr, newItem);
+ }
+ if (mePtr->fontPtr == NULL) {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
+ } else {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr);
+ }
+ Tk_GetFontMetrics(tkfont, &fontMetrics);
+ AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
+ (Drawable) &macMDEFDrawable, &fontMetrics, tkfont,
+ menuRectPtr->left + mePtr->x,
+ mtdPtr->virtualMenuTop + mePtr->y,
+ (mePtr->entryFlags & ENTRY_LAST_COLUMN) ?
+ menuPtr->totalWidth - mePtr->x : mePtr->width,
+ mePtr->height);
+ }
+ tkUseMenuCascadeRgn = 1;
+ MenuSelectEvent(menuPtr);
+ Tcl_ServiceAll();
+ tkUseMenuCascadeRgn = 0;
+ if (newItem!=-1 && mePtr->state != ENTRY_DISABLED) {
+ TkActivateMenuEntry(menuPtr, -1);
+ }
+
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuDrawMsg --
+ *
+ * It handles the MenuDefProc's draw message.
+ *
+ * Results:
+ * A menu entry is drawn
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+void
+HandleMenuDrawMsg(MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr)
+{
+ Tk_Font tkfont, menuFont;
+ Tk_FontMetrics fontMetrics, entryMetrics;
+ Tk_FontMetrics *fmPtr;
+ TkMenuEntry *mePtr;
+ int i;
+ GDHandle device;
+ TkMenu *searchMenuPtr;
+ Rect menuClipRect;
+ ThemeMenuType menuType;
+ MenuTrackingData * mtdPtr = (MenuTrackingData *)whichItem;
+ /*
+ * Store away the menu rectangle so we can keep track of the
+ * different regions that the menu obscures.
+ */
+
+ ((MacMenu *) menuPtr->platformData)->menuRect = *menuRectPtr;
+ if (tkMenuCascadeRgn == NULL) {
+ tkMenuCascadeRgn = NewRgn();
+ }
+ if (utilRgn == NULL) {
+ utilRgn = NewRgn();
+ }
+ if (totalMenuRgn == NULL) {
+ totalMenuRgn = NewRgn();
+ }
+ SetEmptyRgn(tkMenuCascadeRgn);
+ for (searchMenuPtr = menuPtr; searchMenuPtr != NULL; ) {
+ RectRgn(utilRgn,
+ &((MacMenu *) searchMenuPtr->platformData)->menuRect);
+ InsetRgn(utilRgn, -1, -1);
+ UnionRgn(tkMenuCascadeRgn, utilRgn, tkMenuCascadeRgn);
+ OffsetRgn(utilRgn, 1, 1);
+ UnionRgn(tkMenuCascadeRgn, utilRgn, tkMenuCascadeRgn);
+
+ if (searchMenuPtr->menuRefPtr->parentEntryPtr != NULL) {
+ searchMenuPtr = searchMenuPtr->menuRefPtr
+ ->parentEntryPtr->menuPtr;
+ } else {
+ break;
+ }
+ if (searchMenuPtr->menuType == MENUBAR) {
+ break;
+ }
+ }
+ UnionRgn(totalMenuRgn, tkMenuCascadeRgn, totalMenuRgn);
+ SetEmptyRgn(utilRgn);
+
+ /*
+ * Now draw the background if Appearance is present...
+ */
+
+ GetGWorld(&macMDEFDrawable.grafPtr, &device);
+
+ if (menuPtr->menuRefPtr->topLevelListPtr != NULL) {
+ menuType = kThemeMenuTypePullDown;
+ } else if (menuPtr->menuRefPtr->parentEntryPtr != NULL) {
+ menuType = kThemeMenuTypeHierarchical;
+ } else {
+ menuType = kThemeMenuTypePopUp;
+ }
+
+ DrawMenuBackground(menuRectPtr, (Drawable) &macMDEFDrawable, menuType);
+
+ /*
+ * Next, figure out scrolling information.
+ */
+
+ menuClipRect = *menuRectPtr;
+ if ((menuClipRect.bottom - menuClipRect.top)
+ < menuPtr->totalHeight) {
+ if (mtdPtr->virtualMenuTop < menuRectPtr->top) {
+ DrawSICN(SICN_RESOURCE_NUMBER, UP_ARROW,
+ (Drawable) &macMDEFDrawable,
+ menuPtr->textGC,
+ menuRectPtr->left + menuPtr->entries[1]->indicatorSpace,
+ menuRectPtr->top);
+ menuClipRect.top += SICN_HEIGHT;
+ }
+ if ((mtdPtr->virtualMenuTop + menuPtr->totalHeight)
+ > menuRectPtr->bottom) {
+ DrawSICN(SICN_RESOURCE_NUMBER, DOWN_ARROW,
+ (Drawable) &macMDEFDrawable,
+ menuPtr->textGC,
+ menuRectPtr->left + menuPtr->entries[1]->indicatorSpace,
+ menuRectPtr->bottom - SICN_HEIGHT);
+ menuClipRect.bottom -= SICN_HEIGHT;
+ }
+ GetClip(utilRgn);
+ }
+
+ /*
+ * Now, actually draw the menu. Don't draw entries that
+ * are higher than the top arrow, and don't draw entries
+ * that are lower than the bottom.
+ */
+
+ menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
+ Tk_GetFontMetrics(menuFont, &fontMetrics);
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ mePtr = menuPtr->entries[i];
+ if (mtdPtr->virtualMenuTop + mePtr->y + mePtr->height
+ < menuClipRect.top) {
+ continue;
+ } else if (mtdPtr->virtualMenuTop + mePtr->y
+ > menuClipRect.bottom) {
+ continue;
+ }
+ ClipRect(&menuClipRect);
+ if (mePtr->fontPtr == NULL) {
+ fmPtr = &fontMetrics;
+ tkfont = menuFont;
+ } else {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin, mePtr->fontPtr);
+ Tk_GetFontMetrics(tkfont, &entryMetrics);
+ fmPtr = &entryMetrics;
+ }
+ AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
+ (Drawable) &macMDEFDrawable, fmPtr, tkfont,
+ menuRectPtr->left + mePtr->x,
+ mtdPtr->virtualMenuTop + mePtr->y,
+ (mePtr->entryFlags & ENTRY_LAST_COLUMN) ?
+ menuPtr->totalWidth - mePtr->x : mePtr->width,
+ menuPtr->entries[i]->height);
+ }
+ mtdPtr->virtualMenuBottom = mtdPtr->virtualMenuTop
+ + menuPtr->totalHeight;
+ if (!EmptyRgn(utilRgn)) {
+ SetClip(utilRgn);
+ SetEmptyRgn(utilRgn);
+ }
+ MDEFScrollFlag = 1;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuFindItemsMsg --
+ *
+ * It handles the MenuDefProc's FindItems message. We have to
+ * respond by filling in the itemSelected, itemUnderMouse and
+ * itemRect fields. This is also the time to scroll the menu if
+ * it is too long to fit on the screen.
+ *
+ * Results:
+ * The Menu system is informed of the selected item & the item
+ * under the mouse.
+ *
+ * Side effects:
+ * The menu might get scrolled.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+HandleMenuFindItemsMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr)
+{
+ TkMenuEntry *parentEntryPtr;
+ Tk_Font tkfont;
+ Tk_FontMetrics fontMetrics, entryMetrics;
+ Tk_FontMetrics *fmPtr;
+ TkMenuEntry *mePtr;
+ int i;
+ int newItem = -1;
+ GDHandle device;
+ Rect itemRect;
+ short windowPart;
+ WindowRef whichWindow;
+ RGBColor bgColor;
+ RGBColor fgColor;
+ RGBColor origFgColor;
+ PenState origPenState;
+ Rect dragRect;
+ Rect scratchRect = {-32768, -32768, 32767, 32767};
+ RgnHandle oldClipRgn;
+ TkMenuReferences *menuRefPtr;
+ Rect menuClipRect;
+
+ int hasTopScroll, hasBottomScroll;
+ MenuTrackingData * mtdPtr = (MenuTrackingData *)whichItem;
+ int itemUnderMouse = -1;
+ enum {
+ DONT_SCROLL, DOWN_SCROLL, UP_SCROLL
+ } scrollDirection;
+ Rect updateRect;
+ short scrollAmt = 0;
+ RGBColor origForeColor, origBackColor;
+
+ /*
+ * Find out which item was hit. If it is the same as the old item,
+ * we don't need to do anything.
+ */
+
+ if (PtInRect(hitPt, menuRectPtr)) {
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ mePtr = menuPtr->entries[i];
+ itemRect.left = menuRectPtr->left + mePtr->x;
+ itemRect.top = mtdPtr->virtualMenuTop + mePtr->y;
+ if (mePtr->entryFlags & ENTRY_LAST_COLUMN) {
+ itemRect.right = itemRect.left + menuPtr->totalWidth
+ - mePtr->x;
+ } else {
+ itemRect.right = itemRect.left + mePtr->width;
+ }
+ itemRect.bottom = itemRect.top
+ + mePtr->height;
+ if (PtInRect(hitPt, &itemRect)) {
+ if ((mePtr->type == SEPARATOR_ENTRY)
+ || (mePtr->state == ENTRY_DISABLED)) {
+ newItem = -1;
+ itemUnderMouse = i;
+ } else {
+ TkMenuEntry *cascadeEntryPtr;
+ int parentDisabled = 0;
+
+ for (cascadeEntryPtr
+ = menuPtr->menuRefPtr->parentEntryPtr;
+ cascadeEntryPtr != NULL;
+ cascadeEntryPtr
+ = cascadeEntryPtr->nextCascadePtr) {
+ char *name;
+
+ name = Tcl_GetStringFromObj(
+ cascadeEntryPtr->namePtr, NULL);
+ if (strcmp(name, Tk_PathName(menuPtr->tkwin))
+ == 0) {
+ if (cascadeEntryPtr->state == ENTRY_DISABLED) {
+ parentDisabled = 1;
+ }
+ break;
+ }
+ }
+
+ if (parentDisabled) {
+ newItem = -1;
+ itemUnderMouse = i;
+ } else {
+ newItem = i;
+ itemUnderMouse = i;
+ }
+ }
+ break;
+ }
+ }
+ } else {
+ }
+
+ /*
+ * Now we need to take care of scrolling the menu.
+ */
+
+ hasTopScroll = mtdPtr->virtualMenuTop < menuRectPtr->top;
+ hasBottomScroll = mtdPtr->virtualMenuBottom > menuRectPtr->bottom;
+ scrollDirection = DONT_SCROLL;
+ if (hasTopScroll && (hitPt.v < menuRectPtr->top + SICN_HEIGHT)) {
+ newItem = -1;
+ scrollDirection = DOWN_SCROLL;
+ } else if (hasBottomScroll && (hitPt.v > (menuRectPtr->bottom - SICN_HEIGHT))) {
+ newItem = -1;
+ scrollDirection = UP_SCROLL;
+ }
+
+ menuClipRect = *menuRectPtr;
+ if (hasTopScroll) {
+ menuClipRect.top += SICN_HEIGHT;
+ }
+ if (hasBottomScroll) {
+ menuClipRect.bottom -= SICN_HEIGHT;
+ }
+ if (MDEFScrollFlag) {
+ scrollDirection = DONT_SCROLL;
+ MDEFScrollFlag = 0;
+ }
+ GetClip(utilRgn);
+ ClipRect(&menuClipRect);
+
+ mtdPtr->itemSelected = newItem + 1;
+ mtdPtr->itemUnderMouse = itemUnderMouse + 1;
+ mtdPtr->itemRect = itemRect;
+
+ GetGWorld(&macMDEFDrawable.grafPtr, &device);
+ GetForeColor(&origForeColor);
+ GetBackColor(&origBackColor);
+
+ if (scrollDirection == UP_SCROLL) {
+ scrollAmt = menuClipRect.bottom - hitPt.v;
+ if (scrollAmt < menuRectPtr->bottom
+ - mtdPtr->virtualMenuBottom) {
+ scrollAmt = menuRectPtr->bottom - mtdPtr->virtualMenuBottom;
+ }
+ if (!hasTopScroll && ((mtdPtr->virtualMenuTop + scrollAmt)
+ < menuRectPtr->top)) {
+ SetRect(&updateRect, menuRectPtr->left,
+ mtdPtr->virtualMenuTop, menuRectPtr->right,
+ mtdPtr->virtualMenuTop + SICN_HEIGHT);
+ EraseRect(&updateRect);
+ DrawSICN(SICN_RESOURCE_NUMBER, UP_ARROW,
+ (Drawable) &macMDEFDrawable,
+ menuPtr->textGC, menuRectPtr->left
+ + menuPtr->entries[1]->indicatorSpace,
+ menuRectPtr->top);
+ menuClipRect.top += SICN_HEIGHT;
+ }
+ } else if (scrollDirection == DOWN_SCROLL) {
+
+ scrollAmt = menuClipRect.top - hitPt.v;
+ if (scrollAmt > menuRectPtr->top - mtdPtr->virtualMenuTop) {
+ scrollAmt = menuRectPtr->top - mtdPtr->virtualMenuTop;
+ }
+
+ if (!hasBottomScroll && ((mtdPtr->virtualMenuBottom + scrollAmt)
+ > menuRectPtr->bottom)) {
+ SetRect(&updateRect, menuRectPtr->left,
+ mtdPtr->virtualMenuBottom - SICN_HEIGHT,
+ menuRectPtr->right, mtdPtr->virtualMenuBottom);
+ EraseRect(&updateRect);
+ DrawSICN(SICN_RESOURCE_NUMBER, DOWN_ARROW,
+ (Drawable) &macMDEFDrawable,
+ menuPtr->textGC, menuRectPtr->left
+ + menuPtr->entries[1]->indicatorSpace,
+ menuRectPtr->bottom - SICN_HEIGHT);
+ menuClipRect.bottom -= SICN_HEIGHT;
+ }
+ }
+
+ if (scrollDirection != DONT_SCROLL) {
+ Tk_Font menuFont;
+ RgnHandle updateRgn = NewRgn();
+
+ ScrollMenuImage(menu, menuRectPtr, 0, scrollAmt, NULL);
+ mtdPtr->virtualMenuTop += scrollAmt;
+ mtdPtr->virtualMenuBottom += scrollAmt;
+#if 0
+ GetRegionBounds(updateRgn,&updateRect);
+ DisposeRgn(updateRgn);
+ if (mtdPtr->virtualMenuTop == menuRectPtr->top) {
+ updateRect.top -= SICN_HEIGHT;
+ }
+ if (mtdPtr->virtualMenuBottom == menuRectPtr->bottom) {
+ updateRect.bottom += SICN_HEIGHT;
+ }
+ ClipRect(&updateRect);
+ EraseRect(&updateRect);
+ menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
+ Tk_GetFontMetrics(menuFont, &fontMetrics);
+ for (i = 0; i < menuPtr->numEntries; i++) {
+ mePtr = menuPtr->entries[i];
+ if (mtdPtr->virtualMenuTop + mePtr->y + mePtr->height
+ < updateRect.top) {
+ continue;
+ } else if (mtdPtr->virtualMenuTop + mePtr->y
+ > updateRect.bottom) {
+ continue;
+ }
+ if (mePtr->fontPtr == NULL) {
+ fmPtr = &fontMetrics;
+ tkfont = menuFont;
+ } else {
+ tkfont = Tk_GetFontFromObj(menuPtr->tkwin,
+ mePtr->fontPtr);
+ Tk_GetFontMetrics(tkfont, &entryMetrics);
+ fmPtr = &entryMetrics;
+ }
+ AppearanceEntryDrawWrapper(mePtr, menuRectPtr, mtdPtr,
+ (Drawable) &macMDEFDrawable, fmPtr, tkfont,
+ menuRectPtr->left + mePtr->x,
+ mtdPtr->virtualMenuTop + mePtr->y,
+ (mePtr->entryFlags & ENTRY_LAST_COLUMN) ?
+ menuPtr->totalWidth - mePtr->x : mePtr->width,
+ menuPtr->entries[i]->height);
+ }
+#endif
+ }
+
+ SetClip(utilRgn);
+ SetEmptyRgn(utilRgn);
+ RGBForeColor(&origForeColor);
+ RGBBackColor(&origBackColor);
+
+ /*
+ * If the menu is a tearoff, and the mouse is outside the menu,
+ * we need to draw the drag rectangle.
+ *
+ * In order for tearoffs to work properly, we need to set
+ * the active member of the containing menubar.
+ */
+
+ menuRefPtr = TkFindMenuReferences(menuPtr->interp,
+ Tk_PathName(menuPtr->tkwin));
+
+ if ((menuRefPtr != NULL) && (menuRefPtr->parentEntryPtr != NULL)) {
+ char *name;
+ for (parentEntryPtr = menuRefPtr->parentEntryPtr;
+ parentEntryPtr != NULL
+ ; parentEntryPtr = parentEntryPtr->nextCascadePtr) {
+ name = Tcl_GetStringFromObj(parentEntryPtr->namePtr,
+ NULL);
+ if (strcmp(name, Tk_PathName(menuPtr->tkwin)) != 0) {
+ break;
+ }
+ }
+ if (parentEntryPtr != NULL) {
+ TkActivateMenuEntry(parentEntryPtr->menuPtr,
+ parentEntryPtr->index);
+ }
+ }
+
+ if (menuPtr->tearoff) {
+ scratchRect = *menuRectPtr;
+ if (tearoffStruct.menuPtr == NULL) {
+ scratchRect.top -= 10;
+ scratchRect.bottom += 10;
+ scratchRect.left -= 10;
+ scratchRect.right += 10;
+ }
+
+ windowPart = FindWindow(hitPt, &whichWindow);
+ if ((windowPart != inMenuBar) && (newItem == -1)
+ && (hitPt.v != 0) && (hitPt.h != 0)
+ && (!PtInRect(hitPt, &scratchRect))
+ && (!PtInRect(hitPt, &tearoffStruct.excludeRect))) {
+ unsigned long dummy;
+ oldClipRgn = NewRgn();
+ GetClip(oldClipRgn);
+ GetForeColor(&origFgColor);
+ GetPenState(&origPenState);
+ GetForeColor(&fgColor);
+ GetBackColor(&bgColor);
+ GetGray(device, &bgColor, &fgColor);
+ RGBForeColor(&fgColor);
+ SetRect(&scratchRect, -32768, -32768, 32767, 32767);
+ ClipRect(&scratchRect);
+
+ dragRect = *menuRectPtr;
+ tearoffStruct.menuPtr = menuPtr;
+
+ PenMode(srcXor);
+ dragRect = *menuRectPtr;
+ OffsetRect(&dragRect, -dragRect.left, -dragRect.top);
+ OffsetRect(&dragRect, tearoffStruct.point.h,
+ tearoffStruct.point.v);
+ if ((dragRect.top != 0) && (dragRect.left != 0)) {
+ FrameRect(&dragRect);
+ Delay(1, &dummy);
+ FrameRect(&dragRect);
+ }
+ tearoffStruct.point = hitPt;
+
+ SetClip(oldClipRgn);
+ DisposeRgn(oldClipRgn);
+ RGBForeColor(&origFgColor);
+ SetPenState(&origPenState);
+ } else {
+ tearoffStruct.menuPtr = NULL;
+ tearoffStruct.point.h = tearoffStruct.point.v = 0;
+ }
+ } else {
+ tearoffStruct.menuPtr = NULL;
+ tearoffStruct.point.h = tearoffStruct.point.v = 0;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuPopUpMsg --
+ *
+ * It handles the MenuDefProc's PopUp message. The menu is
+ * posted with the selected item at the point given in hitPt.
+ *
+ * Results:
+ * A menu is posted.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+HandleMenuPopUpMsg (MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr)
+{
+ int maxMenuHeight;
+ int oldItem;
+ Rect portRect;
+ BitMap screenBits;
+
+ /*
+ * Note that for some oddball reason, h and v are reversed in the
+ * point given to us by the MDEF.
+ */
+ GetQDGlobalsScreenBits(&screenBits);
+
+ oldItem = *whichItem;
+ if (oldItem >= menuPtr->numEntries) {
+ oldItem = -1;
+ }
+ portRect.top = 0;
+ portRect.bottom = 1280;
+ maxMenuHeight = screenBits.bounds.bottom
+ - screenBits.bounds.top
+ - GetMBarHeight() - SCREEN_MARGIN;
+ if (menuPtr->totalHeight > maxMenuHeight) {
+ menuRectPtr->top = GetMBarHeight();
+ } else {
+ int delta;
+ menuRectPtr->top = hitPt.h;
+ if (oldItem >= 0) {
+ menuRectPtr->top -= menuPtr->entries[oldItem]->y;
+ }
+
+ if (menuRectPtr->top < GetMBarHeight()) {
+ /* Displace downward if the menu would stick off the
+ * top of the screen.
+ */
+
+ menuRectPtr->top = GetMBarHeight() + SCREEN_MARGIN;
+ } else {
+ /*
+ * Or upward if the menu sticks off the
+ * bottom end...
+ */
+
+ delta = menuRectPtr->top + menuPtr->totalHeight
+ - maxMenuHeight;
+ if (delta > 0) {
+ menuRectPtr->top -= delta;
+ }
+ }
+ }
+ menuRectPtr->left = hitPt.v;
+ menuRectPtr->right = menuRectPtr->left + menuPtr->totalWidth;
+ menuRectPtr->bottom = menuRectPtr->top +
+ ((maxMenuHeight < menuPtr->totalHeight)
+ ? maxMenuHeight : menuPtr->totalHeight);
+ if (menuRectPtr->top == GetMBarHeight()) {
+ *whichItem = hitPt.h;
+ } else {
+ *whichItem = menuRectPtr->top;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleMenuCalcItemMsg --
+ *
+ * It handles the MenuDefProc's CalcItem message. It is supposed
+ * to calculate the Rect of the menu entry in whichItem in the
+ * menu, and put that in menuRectPtr. I assume this works, but I
+ * have never seen the MenuManager send this message.
+ *
+ * Results:
+ * The Menu Manager is informed of the bounding rect of a
+ * menu rect.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+HandleMenuCalcItemMsg(MenuRef menu,
+ Rect *menuRectPtr,
+ Point hitPt,
+ SInt16 *whichItem,
+ TkMenu *menuPtr)
+{
+ TkMenuEntry *mePtr;
+ MenuTrackingData mtd, *mtdPtr = &mtd;
+ int err, virtualTop;
+
+ err = GetMenuTrackingData(menu, mtdPtr);
+ if (err == noErr) {
+ virtualTop = mtdPtr->virtualMenuTop;
+ } else {
+ virtualTop = 0;
+ }
+
+ mePtr = menuPtr->entries[*whichItem];
+ menuRectPtr->left = mePtr->x;
+ menuRectPtr->top = mePtr->y - virtualTop;
+ if (mePtr->entryFlags & ENTRY_LAST_COLUMN) {
+ menuRectPtr->right = menuPtr->totalWidth;
+ } else {
+ menuRectPtr->right = mePtr->x + mePtr->width;
+ }
+ menuRectPtr->bottom = menuRectPtr->top
+ + mePtr->height;
+}
diff --git a/tk/macosx/tkMacOSXMenu.r b/tk/macosx/tkMacOSXMenu.r
new file mode 100644
index 00000000000..3291e5dba27
--- /dev/null
+++ b/tk/macosx/tkMacOSXMenu.r
@@ -0,0 +1,47 @@
+/*
+ * tkMacOSXMenu.r --
+ *
+ * Resources needed by menus.
+ *
+ * This file also contains the icons 'SICN' used by the menu code
+ * in menu items.
+ *
+ * Copyright (c) 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.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include <Carbon.r>
+
+/*
+ * Icons used in menu items.
+ */
+
+resource 'SICN' (128, preload, locked) {
+ { /* array: 7 elements */
+ /* [1] */
+ $"0000 0000 8000 C000 E000 F000 F800 FC00"
+ $"F800 F000 E000 C000 80",
+ /* [2] */
+ $"0000 0000 0000 0800 1400 2200 4100 8080"
+ $"E380 2200 2200 2200 3E",
+ /* [3] */
+ $"0000 0000 0000 0000 0000 F8F0 C4F0 F270"
+ $"0900 0480 0270 0130 00F0",
+ /* [4] */
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 E4E0 CE60 1B00 3180",
+ /* [5] */
+ $"0000 0000 0000 0000 6300 9480 9480 7F00"
+ $"1400 7F00 9480 9480 63",
+ /* [6] */
+ $"0000 0000 0000 0000 0000 3FF8 1FF0 0FE0"
+ $"07C0 0380 01",
+ /* [7] */
+ $"0000 0000 0000 0000 0000 0100 0380 07C0"
+ $"0FE0 1FF0 3FF8"
+ }
+};
diff --git a/tk/macosx/tkMacOSXMenubutton.c b/tk/macosx/tkMacOSXMenubutton.c
new file mode 100644
index 00000000000..aff5d249b59
--- /dev/null
+++ b/tk/macosx/tkMacOSXMenubutton.c
@@ -0,0 +1,861 @@
+/*
+ * tkMacOSXMenubutton.c --
+ *
+ * This file implements the Macintosh specific portion of the
+ * menubutton widget.
+ *
+ * Copyright (c) 1996 by Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include <Carbon/Carbon.h>
+#include "tkMenu.h"
+#include "tkMenubutton.h"
+#include "tkMacOSXInt.h"
+#include "tkMacOSXDebug.h"
+
+#define kShadowOffset (3) /* amount to offset shadow from frame */
+#define kTriangleWidth (11) /* width of the triangle */
+#define kTriangleHeight (6) /* height of the triangle */
+#define kTriangleMargin (5) /* margin around triangle */
+
+#define TK_POPUP_OFFSET 32 /* size of popup marker */
+
+int TkMacOSXGetNewMenuID _ANSI_ARGS_((Tcl_Interp *interp, TkMenu *menuInstPtr, int cascade, short *menuIDPtr));
+void TkMacOSXFreeMenuID _ANSI_ARGS_((short menuID));
+
+typedef struct {
+ SInt16 initialValue;
+ SInt16 minValue;
+ SInt16 maxValue;
+ SInt16 procID;
+ int isBevel;
+} MenuButtonControlParams;
+
+typedef struct {
+ int len;
+ Str255 title;
+ ControlFontStyleRec style;
+} ControlTitleParams;
+
+/*
+ * Declaration of Mac specific button structure.
+ */
+
+typedef struct MacMenuButton {
+ TkMenuButton info; /* Generic button info. */
+ WindowRef windowRef;
+ ControlRef userPane;
+ ControlRef control;
+ MenuRef menuRef;
+ RGBColor userPaneBackground;
+ MenuButtonControlParams params;
+ ControlTitleParams titleParams;
+ ControlButtonContentInfo bevelButtonContent;
+ OpenCPicParams picParams;
+ int flags;
+} MacMenuButton;
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static OSErr SetUserPaneDrawProc(ControlRef control,
+ ControlUserPaneDrawProcPtr upp);
+static OSErr SetUserPaneSetUpSpecialBackgroundProc(ControlRef control,
+ ControlUserPaneBackgroundProcPtr upp);
+static void UserPaneDraw(ControlRef control, ControlPartCode cpc);
+static void UserPaneBackgroundProc(ControlHandle,
+ ControlBackgroundPtr info);
+static int MenuButtonInitControl ( MacMenuButton *mbPtr, Rect *paneRect, Rect *cntrRect );
+
+static int UpdateControlColors _ANSI_ARGS_((MacMenuButton *mbPtr ));
+static void ComputeMenuButtonControlParams _ANSI_ARGS_((TkMenuButton * mbPtr, MenuButtonControlParams * paramsPtr));
+static void ComputeControlTitleParams _ANSI_ARGS_((TkMenuButton * mbPtr, ControlTitleParams * paramsPtr));
+static void CompareControlTitleParams(
+ ControlTitleParams * p1Ptr,
+ ControlTitleParams * p2Ptr,
+ int * titleChanged,
+ int * styleChanged
+);
+
+extern int TkFontGetFirstTextLayout(Tk_TextLayout layout, Tk_Font * font, char * dst);
+extern void TkMacOSXInitControlFontStyle(Tk_Font tkfont,ControlFontStylePtr fsPtr);
+
+extern int tkPictureIsOpen;
+
+/*
+ * The structure below defines menubutton class behavior by means of
+ * procedures that can be invoked from generic window code.
+ */
+
+Tk_ClassProcs tkpMenubuttonClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkMenuButtonWorldChanged, /* worldChangedProc */
+};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateMenuButton --
+ *
+ * Allocate a new TkMenuButton structure.
+ *
+ * Results:
+ * Returns a newly allocated TkMenuButton structure.
+ *
+ * Side effects:
+ * Registers an event handler for the widget.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkMenuButton *
+TkpCreateMenuButton(
+ Tk_Window tkwin)
+{
+ MacMenuButton *mbPtr = (MacMenuButton *) ckalloc(sizeof(MacMenuButton));
+ mbPtr->userPaneBackground.red = 0;
+ mbPtr->userPaneBackground.green = 0;
+ mbPtr->userPaneBackground.blue = ~0;
+ mbPtr->flags = 0;
+ mbPtr->userPane = NULL;
+ mbPtr->control = NULL;
+ mbPtr->picParams.version = -2;
+ mbPtr->picParams.hRes = 0x00480000;
+ mbPtr->picParams.vRes = 0x00480000;
+ mbPtr->picParams.srcRect.top = 0;
+ mbPtr->picParams.srcRect.left = 0;
+ mbPtr->picParams.reserved1 = 0;
+ mbPtr->picParams.reserved2 = 0;
+ mbPtr->bevelButtonContent.contentType = kControlContentPictHandle;
+ mbPtr->menuRef = NULL;
+
+ bzero(&mbPtr->params, sizeof(mbPtr->params));
+ bzero(&mbPtr->titleParams,sizeof(mbPtr->titleParams));
+ return (TkMenuButton *) mbPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDisplayMenuButton --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDisplayMenuButton(
+ ClientData clientData) /* Information about widget. */
+{
+ TkMenuButton *butPtr = (TkMenuButton *) clientData;
+ Tk_Window tkwin = butPtr->tkwin;
+ TkWindow * winPtr;
+ Pixmap pixmap;
+ MacMenuButton * mbPtr = (MacMenuButton *) butPtr;
+ GWorldPtr dstPort;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ int hasImageOrBitmap = 0;
+ int width, height;
+ int err;
+ ControlButtonGraphicAlignment theAlignment;
+
+ Rect paneRect, cntrRect;
+
+ butPtr->flags &= ~REDRAW_PENDING;
+ if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ return;
+ }
+ pixmap = ( Pixmap )Tk_WindowId(tkwin);
+ GetGWorld(&saveWorld, &saveDevice);
+ dstPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+ SetGWorld(dstPort, NULL);
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
+
+ winPtr=(TkWindow *)butPtr->tkwin;
+ paneRect.left=winPtr->privatePtr->xOff;
+ paneRect.top=winPtr->privatePtr->yOff;
+ paneRect.right=paneRect.left+Tk_Width(butPtr->tkwin)-1;
+ paneRect.bottom=paneRect.top+Tk_Height(butPtr->tkwin)-1;
+
+ cntrRect=paneRect;
+
+ cntrRect.left+=butPtr->inset;
+ cntrRect.top+=butPtr->inset;
+ cntrRect.right-=butPtr->inset;
+ cntrRect.bottom-=butPtr->inset;
+
+ if (mbPtr->userPane) {
+ MenuButtonControlParams params;
+ bzero(&params, sizeof(params));
+ ComputeMenuButtonControlParams(butPtr, &params );
+ if (bcmp(&params,&mbPtr->params,sizeof(params))) {
+ if (mbPtr->userPane) {
+ DisposeControl(mbPtr->userPane);
+ mbPtr->userPane = NULL;
+ mbPtr->control = NULL;
+ }
+ }
+ }
+ if (!mbPtr->userPane) {
+ if (MenuButtonInitControl(mbPtr,&paneRect,&cntrRect ) ) {
+ fprintf(stderr,"Init Control failed\n" );
+ return;
+ }
+ }
+ SetControlBounds(mbPtr->userPane,&paneRect);
+ SetControlBounds(mbPtr->control,&cntrRect);
+
+ /*
+ * We need to cache the title and its style
+ */
+ if (!(mbPtr->flags&2)) {
+ ControlTitleParams titleParams;
+ int titleChanged;
+ int styleChanged;
+ ComputeControlTitleParams(butPtr,&titleParams);
+ CompareControlTitleParams(&titleParams,&mbPtr->titleParams,
+ &titleChanged,&styleChanged);
+ if (titleChanged) {
+ CFStringRef cf;
+ cf = CFStringCreateWithCString(NULL,
+ titleParams.title, kCFStringEncodingUTF8);
+ if (hasImageOrBitmap) {
+ SetControlTitleWithCFString(mbPtr->control, cf);
+ } else {
+ SetMenuItemTextWithCFString(mbPtr->menuRef, 1, cf);
+ }
+ CFRelease(cf);
+ bcopy(titleParams.title,mbPtr->titleParams.title,titleParams.len+1);
+ mbPtr->titleParams.len = titleParams.len;
+ }
+ if ((titleChanged||styleChanged) && titleParams .len) {
+ if (hasImageOrBitmap) {
+ if ((err=SetControlFontStyle(mbPtr->control,&titleParams.style))!=noErr) {
+ fprintf(stderr,"SetControlFontStyle failed %d\n", err);
+ return;
+ }
+ }
+ bcopy(&titleParams.style,&mbPtr->titleParams.style,sizeof(titleParams.style));
+ }
+ }
+ if (butPtr->image != None) {
+ Tk_SizeOfImage(butPtr->image, &width, &height);
+ hasImageOrBitmap = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ hasImageOrBitmap = 1;
+ }
+ if (hasImageOrBitmap) {
+ mbPtr->picParams.srcRect.right = width;
+ mbPtr->picParams.srcRect.bottom = height;
+ /* Set the flag to circumvent clipping and bounds problems with OS 10.0.4 */
+ tkPictureIsOpen = 1;
+ if (!(mbPtr->bevelButtonContent.u.picture = OpenCPicture(&mbPtr->picParams)) ) {
+ fprintf(stderr,"OpenCPicture failed\n");
+ }
+ /*
+ * TO DO - There is one case where XCopyPlane calls CopyDeepMask,
+ * which does not get recorded in the picture. So the bitmap code
+ * will fail in that case.
+ */
+ if (butPtr->image != NULL) {
+ Tk_RedrawImage(butPtr->image, 0, 0, width,
+ height, pixmap, 0, 0);
+ } else {
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, NULL, 0, 0,
+ (unsigned int) width, (unsigned int) height, 0, 0, 1);
+ }
+ ClosePicture();
+
+ tkPictureIsOpen = 0;
+ if ( (err=SetControlData(mbPtr->control, kControlButtonPart,
+ kControlBevelButtonContentTag,
+ sizeof(ControlButtonContentInfo),
+ (char *) &mbPtr->bevelButtonContent)) != noErr ) {
+ fprintf(stderr,"SetControlData BevelButtonContent failed, %d\n", err );
+ }
+ switch (butPtr->anchor) {
+ case TK_ANCHOR_N:
+ theAlignment = kControlBevelButtonAlignTop;
+ break;
+ case TK_ANCHOR_NE:
+ theAlignment = kControlBevelButtonAlignTopRight;
+ break;
+ case TK_ANCHOR_E:
+ theAlignment = kControlBevelButtonAlignRight;
+ break;
+ case TK_ANCHOR_SE:
+ theAlignment = kControlBevelButtonAlignBottomRight;
+ break;
+ case TK_ANCHOR_S:
+ theAlignment = kControlBevelButtonAlignBottom;
+ break;
+ case TK_ANCHOR_SW:
+ theAlignment = kControlBevelButtonAlignBottomLeft;
+ break;
+ case TK_ANCHOR_W:
+ theAlignment = kControlBevelButtonAlignLeft;
+ break;
+ case TK_ANCHOR_NW:
+ theAlignment = kControlBevelButtonAlignTopLeft;
+ break;
+ case TK_ANCHOR_CENTER:
+ theAlignment = kControlBevelButtonAlignCenter;
+ break;
+ }
+
+ if ((err=SetControlData(mbPtr->control, kControlButtonPart,
+ kControlBevelButtonGraphicAlignTag,
+ sizeof(ControlButtonGraphicAlignment),
+ (char *) &theAlignment)) != noErr ) {
+ fprintf(stderr,"SetControlData BevelButtonGraphicAlign failed, %d\n", err );
+ }
+ }
+ if (butPtr->flags & GOT_FOCUS) {
+ HiliteControl(mbPtr->control,kControlButtonPart);
+ } else {
+ HiliteControl(mbPtr->control,kControlNoPart);
+ }
+ UpdateControlColors(mbPtr);
+ if (mbPtr->flags&2) {
+ ShowControl(mbPtr->control);
+ ShowControl(mbPtr->userPane);
+ mbPtr->flags ^= 2;
+ } else {
+ Draw1Control(mbPtr->userPane);
+ SetControlVisibility(mbPtr->control, true, true);
+ }
+ if (hasImageOrBitmap) {
+ KillPicture(mbPtr->bevelButtonContent.u.picture);
+ }
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyMenuButton --
+ *
+ * Free data structures associated with the menubutton control.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Restores the default control state.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDestroyMenuButton(
+ TkMenuButton *mbPtr)
+{
+ MacMenuButton * macMbPtr = (MacMenuButton *)mbPtr;
+ if (macMbPtr->userPane) {
+ DisposeControl(macMbPtr->userPane);
+ macMbPtr->userPane = NULL;
+ }
+ if (macMbPtr->menuRef) {
+ short menuID;
+ menuID = GetMenuID(macMbPtr->menuRef);
+ TkMacOSXFreeMenuID(menuID);
+ DisposeMenu(macMbPtr->menuRef);
+ macMbPtr->menuRef = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpComputeMenuButtonGeometry --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpComputeMenuButtonGeometry(mbPtr)
+ register TkMenuButton *mbPtr; /* Widget record for menu button. */
+{
+ int width, height, mm, pixels;
+ int hasImageOrBitmap = 0;
+
+ 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;
+ }
+ hasImageOrBitmap = 1;
+ } 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;
+ }
+ hasImageOrBitmap = 1;
+ } else {
+ hasImageOrBitmap = 0;
+ Tk_FreeTextLayout(mbPtr->textLayout);
+ mbPtr->textLayout = Tk_ComputeTextLayout(mbPtr->tkfont, mbPtr->text,
+ -1, mbPtr->wrapLength, mbPtr->justify, 0, &mbPtr->textWidth,
+ &mbPtr->textHeight);
+ width = mbPtr->textWidth;
+ height = mbPtr->textHeight;
+ if (mbPtr->width > 0) {
+ width = mbPtr->width * Tk_TextWidth(mbPtr->tkfont, "0", 1);
+ }
+ if (mbPtr->height > 0) {
+ Tk_FontMetrics fm;
+
+ Tk_GetFontMetrics(mbPtr->tkfont, &fm);
+ height = mbPtr->height * fm.linespace;
+ }
+ width += 2*mbPtr->padX;
+ height += 2*mbPtr->padY;
+ }
+
+ if (mbPtr->indicatorOn) {
+ mm = WidthMMOfScreen(Tk_Screen(mbPtr->tkwin));
+ pixels = WidthOfScreen(Tk_Screen(mbPtr->tkwin));
+ mbPtr->indicatorHeight= kTriangleHeight;
+ mbPtr->indicatorWidth = kTriangleWidth + kTriangleMargin;
+ width += mbPtr->indicatorWidth;
+ } else {
+ mbPtr->indicatorHeight = 0;
+ mbPtr->indicatorWidth = 0;
+ }
+ if (!hasImageOrBitmap) {
+ width += TK_POPUP_OFFSET;
+ }
+
+ Tk_GeometryRequest(mbPtr->tkwin, (int) (width + 2*mbPtr->inset),
+ (int) (height + 2*mbPtr->inset));
+ Tk_SetInternalBorder(mbPtr->tkwin, mbPtr->inset);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ComputeMenuButtonControlParams --
+ *
+ * This procedure computes the various parameters used
+ * when creating a Carbon control (NewControl)
+ * These are determined by the various tk menu button parameters
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets the control initialisation parameters
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+ComputeMenuButtonControlParams(TkMenuButton * mbPtr,
+ MenuButtonControlParams * paramsPtr )
+{
+ int fakeMenuID = 256;
+
+ /*
+ * Determine ProcID based on button type and dimensions
+ *
+ * We need to set minValue to some non-zero value,
+ * Otherwise, the markers do not show up
+ */
+
+ paramsPtr->minValue = kControlBehaviorMultiValueMenu;
+ paramsPtr->maxValue = 0;
+ if (mbPtr->image || mbPtr->bitmap) {
+ paramsPtr->isBevel = 1;
+ if (mbPtr->borderWidth <= 2) {
+ paramsPtr->procID = kControlBevelButtonSmallBevelProc;
+ } else if (mbPtr->borderWidth == 3) {
+ paramsPtr->procID = kControlBevelButtonNormalBevelProc;
+ } else {
+ paramsPtr->procID = kControlBevelButtonLargeBevelProc;
+ }
+ if (mbPtr->indicatorOn) {
+ paramsPtr->initialValue = fakeMenuID;
+ } else {
+ paramsPtr->initialValue = 0;
+ }
+ } else {
+ paramsPtr->isBevel = 0;
+ paramsPtr->procID = kControlPopupButtonProc
+ + kControlPopupVariableWidthVariant;
+ paramsPtr->minValue = -12345;
+ paramsPtr->maxValue = -1;
+ paramsPtr->initialValue = 0;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * returns 0 if same, 1 otherwise
+ *----------------------------------------------------------------------
+ */
+static void
+CompareControlTitleParams(
+ ControlTitleParams * p1Ptr,
+ ControlTitleParams * p2Ptr,
+ int * titleChanged,
+ int * styleChanged
+)
+{
+ if (p1Ptr->len != p2Ptr->len) {
+ *titleChanged = 1;
+ } else {
+ if (bcmp(p1Ptr->title,p2Ptr->title,p1Ptr->len)) {
+ *titleChanged = 1;
+ } else {
+ *titleChanged = 0;
+ }
+ }
+ if (p1Ptr->len && p2Ptr->len) {
+ *styleChanged = bcmp(&p1Ptr->style, &p2Ptr->style, sizeof(p2Ptr->style));
+ } else {
+ *styleChanged = p1Ptr->len||p2Ptr->len;
+ }
+}
+
+static void
+ComputeControlTitleParams(TkMenuButton * butPtr, ControlTitleParams * paramsPtr )
+{
+ Tk_Font font;
+ paramsPtr->len =TkFontGetFirstTextLayout(butPtr->textLayout,&font, paramsPtr->title);
+ paramsPtr->title [paramsPtr->len] = 0;
+ if (paramsPtr->len) {
+ TkMacOSXInitControlFontStyle(font,&paramsPtr->style);
+ }
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MenuButtonInitControl --
+ *
+ * This procedure initialises a Carbon control
+ *
+ * Results:
+ * 0 on success, 1 on failure.
+ *
+ * Side effects:
+ * A background pane control and the control itself is created
+ * The contol is embedded in the background control
+ * The background control is embedded in the root control
+ * of the containing window
+ * The creation parameters for the control are also computed
+ *
+ *----------------------------------------------------------------------
+ */
+int
+MenuButtonInitControl (
+ MacMenuButton *mbPtr, /* Mac button. */
+ Rect *paneRect,
+ Rect *cntrRect
+)
+{
+ OSErr status;
+ TkMenuButton * butPtr = ( TkMenuButton * )mbPtr;
+ ControlRef rootControl;
+ SInt16 procID;
+ Boolean initiallyVisible;
+ SInt16 initialValue;
+ SInt16 minValue;
+ SInt16 maxValue;
+ SInt32 controlReference;
+ int err;
+ short menuID;
+ int length;
+ Str255 itemText;
+
+ rootControl=TkMacOSXGetRootControl(Tk_WindowId(butPtr->tkwin));
+ mbPtr->windowRef=GetWindowFromPort(TkMacOSXGetDrawablePort(Tk_WindowId(butPtr->tkwin)));
+ /*
+ * Set up the user pane
+ */
+ initiallyVisible = false;
+ initialValue = kControlSupportsEmbedding|
+ kControlHasSpecialBackground;
+ minValue = 0;
+ maxValue = 1;
+ procID = kControlUserPaneProc;
+ controlReference = (SInt32)mbPtr;
+ mbPtr->userPane=NewControl(mbPtr->windowRef,
+ paneRect, "\p",
+ initiallyVisible,
+ initialValue,
+ minValue,
+ maxValue,
+ procID,
+ controlReference );
+ if (!mbPtr->userPane) {
+ fprintf(stderr,"Failed to create user pane control\n");
+ return 1;
+ }
+ if ((status=EmbedControl(mbPtr->userPane,rootControl))!=noErr) {
+ fprintf(stderr,"Failed to embed user pane control %d\n", status);
+ return 1;
+ }
+ SetUserPaneSetUpSpecialBackgroundProc(mbPtr->userPane,
+ UserPaneBackgroundProc);
+ SetUserPaneDrawProc(mbPtr->userPane,UserPaneDraw);
+ initiallyVisible = false;
+ ComputeMenuButtonControlParams(butPtr,&mbPtr->params);
+ /* Do this only if we are using bevel buttons */
+ ComputeControlTitleParams(butPtr,&mbPtr->titleParams);
+ mbPtr->control = NewControl(mbPtr->windowRef,
+ cntrRect, "\p", //mbPtr->titleParams.title,
+ initiallyVisible,
+ mbPtr->params.initialValue,
+ mbPtr->params.minValue,
+ mbPtr->params.maxValue,
+ mbPtr->params.procID,
+ controlReference );
+ if (!mbPtr->control) {
+ fprintf(stderr,"failed to create control of type %d : line %d\n",mbPtr->params.procID, __LINE__);
+ return 1;
+ }
+ if ((err=EmbedControl(mbPtr->control,mbPtr->userPane)) != noErr ) {
+ fprintf(stderr,"failed to embed control of type %d,%d\n",procID, err);
+ return 1;
+ }
+ if (mbPtr->params.isBevel) {
+ CFStringRef cf;
+ cf = CFStringCreateWithCString(NULL,
+ mbPtr->titleParams.title, kCFStringEncodingUTF8);
+ SetControlTitleWithCFString(mbPtr->control, cf);
+ CFRelease(cf);
+ if (mbPtr->titleParams.len) {
+ if ((err=SetControlFontStyle(mbPtr->control,&mbPtr->titleParams.style))!=noErr) {
+ fprintf(stderr,"SetControlFontStyle failed %d\n", err);
+ return 1;
+ }
+ }
+ } else {
+ CFStringRef cf;
+ err = TkMacOSXGetNewMenuID(mbPtr->info.interp, (TkMenu *)mbPtr, 0, &menuID);
+ if (err != TCL_OK) {
+ return err;
+ }
+ length = strlen(Tk_PathName(mbPtr->info.tkwin));
+ memmove(&itemText[1], Tk_PathName(mbPtr->info.tkwin),
+ (length > 230) ? 230 : length);
+ itemText[0] = (length > 230) ? 230 : length;
+ if (!(mbPtr->menuRef = NewMenu(menuID,itemText))) {
+ return 1;
+ }
+ cf = CFStringCreateWithCString(NULL,
+ mbPtr->titleParams.title, kCFStringEncodingUTF8);
+ AppendMenuItemText(mbPtr->menuRef, "\px");
+ if (cf != NULL) {
+ SetMenuItemTextWithCFString(mbPtr->menuRef, 1, cf);
+ CFRelease(cf);
+ }
+ err = SetControlData(mbPtr->control,
+ kControlNoPart,
+ kControlPopupButtonMenuRefTag,
+ sizeof(mbPtr->menuRef), &mbPtr->menuRef);
+ SetControlMinimum(mbPtr->control, 1);
+ SetControlMaximum(mbPtr->control, 1);
+ SetControlValue(mbPtr->control, 1);
+ }
+ mbPtr->flags |= 2;
+ return 0;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SetUserPane
+ *
+ * Utility function to add a UserPaneDrawProc
+ * to a userPane control. From MoreControls code
+ * from Apple DTS.
+ *
+ * Results:
+ * MacOS system error.
+ *
+ * Side effects:
+ * The user pane gets a new UserPaneDrawProc.
+ *
+ *--------------------------------------------------------------
+ */
+OSErr SetUserPaneDrawProc (
+ ControlRef control,
+ ControlUserPaneDrawProcPtr upp)
+{
+ ControlUserPaneDrawUPP myControlUserPaneDrawUPP;
+ myControlUserPaneDrawUPP = NewControlUserPaneDrawUPP(upp);
+ return SetControlData (control,
+ kControlNoPart, kControlUserPaneDrawProcTag,
+ sizeof(myControlUserPaneDrawUPP),
+ (Ptr) &myControlUserPaneDrawUPP);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SetUserPaneSetUpSpecialBackgroundProc --
+ *
+ * Utility function to add a UserPaneBackgroundProc
+ * to a userPane control
+ *
+ * Results:
+ * MacOS system error.
+ *
+ * Side effects:
+ * The user pane gets a new UserPaneBackgroundProc.
+ *
+ *--------------------------------------------------------------
+ */
+OSErr
+SetUserPaneSetUpSpecialBackgroundProc(
+ ControlRef control,
+ ControlUserPaneBackgroundProcPtr upp)
+{
+ ControlUserPaneBackgroundUPP myControlUserPaneBackgroundUPP;
+ myControlUserPaneBackgroundUPP = NewControlUserPaneBackgroundUPP(upp);
+ return SetControlData (control, kControlNoPart,
+ kControlUserPaneBackgroundProcTag,
+ sizeof(myControlUserPaneBackgroundUPP),
+ (Ptr) &myControlUserPaneBackgroundUPP);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UserPaneDraw --
+ *
+ * This function draws the background of the user pane that will
+ * lie under checkboxes and radiobuttons.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The user pane gets updated to the current color.
+ *
+ *--------------------------------------------------------------
+ */
+void
+UserPaneDraw(
+ ControlRef control,
+ ControlPartCode cpc)
+{
+ Rect contrlRect;
+ MacMenuButton * mbPtr;
+ mbPtr = ( MacMenuButton *)GetControlReference(control);
+ GetControlBounds(control,&contrlRect);
+ RGBBackColor (&mbPtr->userPaneBackground);
+ EraseRect (&contrlRect);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UserPaneBackgroundProc --
+ *
+ * This function sets up the background of the user pane that will
+ * lie under checkboxes and radiobuttons.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The user pane background gets set to the current color.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+UserPaneBackgroundProc(
+ ControlHandle control,
+ ControlBackgroundPtr info)
+{
+ MacMenuButton * mbPtr;
+ mbPtr = (MacMenuButton *)GetControlReference(control);
+ if (info->colorDevice) {
+ RGBBackColor (&mbPtr->userPaneBackground);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UpdateControlColors --
+ *
+ * This function will review the colors used to display
+ * a Macintosh button. If any non-standard colors are
+ * used we create a custom palette for the button, populate
+ * with the colors for the button and install the palette.
+ *
+ * Under Appearance, we just set the pointer that will be
+ * used by the UserPaneDrawProc.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The Macintosh control may get a custom palette installed.
+ *
+ *--------------------------------------------------------------
+ */
+
+static int
+UpdateControlColors(MacMenuButton * mbPtr)
+{
+ XColor *xcolor;
+ TkMenuButton * butPtr = ( TkMenuButton * )mbPtr;
+
+ /*
+ * Under Appearance we cannot change the background of the
+ * button itself. However, the color we are setting is the color
+ * of the containing userPane. This will be the color that peeks
+ * around the rounded corners of the button.
+ * We make this the highlightbackground rather than the background,
+ * because if you color the background of a frame containing a
+ * button, you usually also color the highlightbackground as well,
+ * or you will get a thin grey ring around the button.
+ */
+
+ xcolor = Tk_3DBorderColor(butPtr->normalBorder);
+ TkSetMacColor(xcolor->pixel, &mbPtr->userPaneBackground);
+
+ return false;
+}
diff --git a/tk/macosx/tkMacOSXMenus.c b/tk/macosx/tkMacOSXMenus.c
new file mode 100644
index 00000000000..8ca3542c230
--- /dev/null
+++ b/tk/macosx/tkMacOSXMenus.c
@@ -0,0 +1,325 @@
+/*
+ * tkMacOSXMenus.c --
+ *
+ * These calls set up and manage the menubar for the
+ * Macintosh version of Tk.
+ *
+ * Copyright (c) 1995-1996 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tk.h"
+#include "tkInt.h"
+#include "tkMacOSXInt.h"
+
+/*
+ * The define Status defined by Xlib.h conflicts with the function Status
+ * defined by Devices.h. We undefine it here to compile.
+ */
+#undef Status
+#include <Carbon/Carbon.h>
+
+#define kAppleMenu 256
+#define kAppleAboutItem 1
+#define kFileMenu 2
+#define kEditMenu 3
+
+#define kSourceItem 1
+#define kCloseItem 2
+#define kQuitItem 4
+
+#define EDIT_CUT 1
+#define EDIT_COPY 2
+#define EDIT_PASTE 3
+#define EDIT_CLEAR 4
+
+MenuRef tkAppleMenu;
+MenuRef tkFileMenu;
+MenuRef tkEditMenu;
+
+static Tcl_Interp * gInterp; /* Interpreter for this application. */
+
+static void GenerateEditEvent _ANSI_ARGS_((int flag));
+static void SourceDialog _ANSI_ARGS_((void));
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXHandleMenuSelect --
+ *
+ * Handles events that occur in the Menu bar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXHandleMenuSelect(
+ long mResult,
+ int optionKeyPressed)
+{
+ short theItem = LoWord(mResult);
+ short theMenu = HiWord(mResult);
+ Tk_Window tkwin;
+ Window window;
+ TkDisplay *dispPtr;
+
+ if (mResult == 0) {
+ TkMacOSXHandleTearoffMenu();
+ TkMacOSXClearMenubarActive();
+ return;
+ }
+
+ switch (theMenu) {
+ case kAppleMenu:
+ switch (theItem) {
+ case kAppleAboutItem:
+ {
+ Tcl_CmdInfo dummy;
+ if (optionKeyPressed || gInterp == NULL ||
+ Tcl_GetCommandInfo(gInterp,
+ "tkAboutDialog", &dummy) == 0) {
+ TkAboutDlg();
+ } else {
+ Tcl_Eval(gInterp, "tkAboutDialog");
+ }
+ break;
+ }
+ }
+ break;
+ case kFileMenu:
+ switch (theItem) {
+ case kSourceItem:
+ /* TODO: source script */
+ SourceDialog();
+ break;
+ case kCloseItem:
+ /* Send close event */
+ window = TkMacOSXGetXWindow(FrontNonFloatingWindow());
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+ TkGenWMDestroyEvent(tkwin);
+ break;
+ case kQuitItem:
+ /* Exit */
+ if (optionKeyPressed || gInterp == NULL) {
+ Tcl_Exit(0);
+ } else {
+ Tcl_Eval(gInterp, "exit");
+ }
+ break;
+ }
+ break;
+ case kEditMenu:
+ /*
+ * This implementation just send keysyms
+ * the Tk thinks are associated with function keys that
+ * do Cut, Copy & Paste on a Sun keyboard.
+ */
+ GenerateEditEvent(theItem);
+ break;
+ default:
+ TkMacOSXDispatchMenuEvent(theMenu, theItem);
+ TkMacOSXClearMenubarActive();
+ break;
+ }
+ /*
+ * Finally we unhighlight the menu.
+ */
+ HiliteMenu(0);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInitMenus --
+ *
+ * This procedure initializes the Macintosh menu bar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInitMenus(
+ Tcl_Interp *interp)
+{
+ gInterp = interp;
+
+ /*
+ * At this point, InitMenus() should have already been called.
+ */
+
+ if (TkMacOSXUseMenuID(256) != TCL_OK) {
+ panic("Menu ID 256 is already in use!");
+ }
+ tkAppleMenu = NewMenu(256, "\p\024");
+ if (tkAppleMenu == NULL) {
+ panic("memory - menus");
+ }
+ InsertMenu(tkAppleMenu, 0);
+ AppendMenu(tkAppleMenu, "\pAbout Tcl & TkÉ");
+ AppendMenu(tkAppleMenu, "\p(-");
+ /* Not necessary in Carbon:
+ AppendResMenu(tkAppleMenu, 'DRVR');
+ */
+
+ if (TkMacOSXUseMenuID(kFileMenu) != TCL_OK) {
+ panic("Menu ID %d is already in use!", kFileMenu);
+ }
+ tkFileMenu = NewMenu(kFileMenu, "\pFile");
+ if (tkFileMenu == NULL) {
+ panic("memory - menus");
+ }
+ InsertMenu(tkFileMenu, 0);
+ AppendMenu(tkFileMenu, "\pSourceÉ");
+ AppendMenu(tkFileMenu, "\pClose/W");
+ AppendMenu(tkFileMenu, "\p(-");
+ AppendMenu(tkFileMenu, "\pQuit/Q");
+
+ if (TkMacOSXUseMenuID(kEditMenu) != TCL_OK) {
+ panic("Menu ID %d is already in use!", kEditMenu);
+ }
+ tkEditMenu = NewMenu(kEditMenu, "\pEdit");
+ if (tkEditMenu == NULL) {
+ panic("memory - menus");
+ }
+ InsertMenu(tkEditMenu, 0);
+ AppendMenu(tkEditMenu, "\pCut/X");
+ AppendMenu(tkEditMenu, "\pCopy/C");
+ AppendMenu(tkEditMenu, "\pPaste/V");
+ AppendMenu(tkEditMenu, "\pClear");
+ if (TkMacOSXUseMenuID(kHMHelpMenuID) != TCL_OK) {
+ panic("Help menu ID %s is already in use!", kHMHelpMenuID);
+ }
+
+ DrawMenuBar();
+ TkMacOSXSetHelpMenuItemCount();
+ return;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateEditEvent --
+ *
+ * Takes an edit menu item and posts the corasponding a virtual
+ * event to Tk's event queue.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May place events of queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GenerateEditEvent(
+ int flag)
+{
+ XVirtualEvent event;
+ Point where;
+ Tk_Window tkwin;
+ Window window;
+ TkDisplay *dispPtr;
+
+ window = TkMacOSXGetXWindow(FrontNonFloatingWindow());
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+ tkwin = (Tk_Window) ((TkWindow *) tkwin)->dispPtr->focusPtr;
+ if (tkwin == NULL) {
+ return;
+ }
+
+ event.type = VirtualEvent;
+ event.serial = Tk_Display(tkwin)->request;
+ event.send_event = false;
+ event.display = Tk_Display(tkwin);
+ event.event = Tk_WindowId(tkwin);
+ event.root = XRootWindow(Tk_Display(tkwin), 0);
+ event.subwindow = None;
+ event.time = TkpGetMS();
+
+ GetMouse(&where);
+ tkwin = Tk_TopCoordsToWindow(tkwin, where.h, where.v,
+ &event.x, &event.y);
+ LocalToGlobal(&where);
+ event.x_root = where.h;
+ event.y_root = where.v;
+ event.state = TkMacOSXButtonKeyState();
+ event.same_screen = true;
+
+ switch (flag) {
+ case EDIT_CUT:
+ event.name = Tk_GetUid("Cut");
+ break;
+ case EDIT_COPY:
+ event.name = Tk_GetUid("Copy");
+ break;
+ case EDIT_PASTE:
+ event.name = Tk_GetUid("Paste");
+ break;
+ case EDIT_CLEAR:
+ event.name = Tk_GetUid("Clear");
+ break;
+ }
+ Tk_QueueWindowEvent((XEvent *) &event, TCL_QUEUE_TAIL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * SourceDialog --
+ *
+ * Presents a dialog to the user for selecting a Tcl file. The
+ * selected file will be sourced into the main interpreter.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+SourceDialog()
+{
+ int result;
+ CONST char *path;
+ CONST char *openCmd = "tk_getOpenFile -filetypes {\
+ {{TCL Scripts} {.tcl} TEXT} {{Text Files} {} TEXT}}";
+
+ if (gInterp == NULL) {
+ return;
+ }
+ if (Tcl_Eval(gInterp, openCmd) != TCL_OK) {
+ return;
+ }
+ path = Tcl_GetStringResult(gInterp);
+ if (strlen(path) == 0) {
+ return;
+ }
+ result = Tcl_EvalFile(gInterp, path);
+ if (result == TCL_ERROR) {
+ Tcl_BackgroundError(gInterp);
+ }
+}
diff --git a/tk/macosx/tkMacOSXMouseEvent.c b/tk/macosx/tkMacOSXMouseEvent.c
new file mode 100644
index 00000000000..12bfc939d52
--- /dev/null
+++ b/tk/macosx/tkMacOSXMouseEvent.c
@@ -0,0 +1,740 @@
+/*
+ * tkMacOSXMouseEvent.c --
+ *
+ * This file implements functions that decode & handle mouse events
+ * on MacOS X.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#include "tkInt.h"
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXInt.h"
+#include "tkPort.h"
+#include "tkMacOSXDebug.h"
+
+typedef struct {
+ WindowRef whichWin;
+ WindowRef activeNonFloating;
+ WindowPartCode windowPart;
+ Point global;
+ Point local;
+ unsigned int state;
+ long delta;
+} MouseEventData;
+
+/*
+ * Declarations of static variables used in this file.
+ */
+
+static int gEatButtonUp = 0; /* 1 if we need to eat the next * up event */
+
+/*
+ * Declarations of functions used only in this file.
+ */
+
+static void BringWindowForward _ANSI_ARGS_((WindowRef wRef));
+static int GeneratePollingEvents(MouseEventData * medPtr);
+static int GenerateMouseWheelEvent(MouseEventData * medPtr);
+
+extern int TkMacOSXGetEatButtonUp();
+extern void TkMacOSXSetEatButtonUp(int f);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessMouseEvent --
+ *
+ * This routine processes the event in eventPtr, and
+ * generates the appropriate Tk events from it.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
+{
+ WindowRef frontWindow;
+ Tk_Window tkwin;
+ Point where, where2;
+ int xOffset, yOffset;
+ TkDisplay * dispPtr;
+ Window window;
+ int status,err;
+ MouseEventData mouseEventData, * medPtr = &mouseEventData;
+ KeyMap keyMap;
+
+ switch (eventPtr->eKind) {
+ case kEventMouseUp:
+ case kEventMouseDown:
+ case kEventMouseMoved:
+ case kEventMouseDragged:
+ case kEventMouseWheelMoved:
+ break;
+ default:
+ statusPtr->handledByTk = 1;
+ return 0;
+ break;
+ }
+ statusPtr->handledByTk = 1;
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamMouseLocation,
+ typeQDPoint, NULL,
+ sizeof(where), NULL,
+ &where);
+ if (status != noErr) {
+ fprintf (stderr, "Failed to retrieve mouse location,%d\n", status);
+ return 0;
+ }
+ medPtr->state = 0;
+ GetKeys(keyMap);
+ if (keyMap[1] & 2) {
+ medPtr->state |= LockMask;
+ }
+ if (keyMap[1] & 1) {
+ medPtr->state |= ShiftMask;
+ }
+ if (keyMap[1] & 8) {
+ medPtr->state |= ControlMask;
+ }
+ if (keyMap[1] & 32768) {
+ medPtr->state |= Mod1Mask; /* command key */
+ }
+ if (keyMap[1] & 4) {
+ medPtr->state |= Mod2Mask; /* option key */
+ }
+ if (eventPtr->eKind == kEventMouseDown
+ || eventPtr->eKind== kEventMouseDragged ) {
+ EventMouseButton mouseButton;
+ if ((status=GetEventParameter(eventPtr->eventRef,
+ kEventParamMouseButton,
+ typeMouseButton, NULL,
+ sizeof(mouseButton), NULL,&mouseButton)) != noErr ) {
+ fprintf (stderr, "Failed to retrieve mouse button, %d\n", status);
+ statusPtr->err = 1;
+ return 0;
+ }
+ medPtr->state |= 1 << ((mouseButton-1)+8);
+ }
+
+ medPtr->windowPart= FindWindow(where, &medPtr->whichWin);
+ window = TkMacOSXGetXWindow(medPtr->whichWin);
+ if (medPtr->whichWin != NULL && window == None) {
+ statusPtr->handledByTk = 0;
+ return 0;
+ }
+
+ frontWindow = FrontWindow();
+ medPtr->activeNonFloating = ActiveNonFloatingWindow();
+
+ /*
+ * The window manager only needs to know about mouse down events
+ * and sometimes we need to "eat" the mouse up. Otherwise, we
+ * just pass the event to Tk.
+
+ */
+ if (eventPtr->eKind == kEventMouseUp) {
+ if (TkMacOSXGetEatButtonUp()) {
+ TkMacOSXSetEatButtonUp(false);
+ return false;
+ }
+ return TkGenerateButtonEvent(where.h, where.v,
+ window, medPtr->state);
+ }
+ if (eventPtr->eKind == kEventMouseWheelMoved) {
+ if ((status=GetEventParameter(eventPtr->eventRef,
+ kEventParamMouseWheelDelta,
+ typeLongInteger, NULL,
+ sizeof(medPtr->delta), NULL,&medPtr->delta)) != noErr ) {
+ fprintf (stderr,
+ "Failed to retrieve mouse wheel delta, %d\n", status);
+ statusPtr->err = 1;
+ return false;
+ }
+ }
+
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+
+ if (eventPtr->eKind != kEventMouseDown ) {
+ /*
+ * MouseMoved, MouseDragged or kEventMouseWheelMoved
+ */
+
+ medPtr->global = where;
+ medPtr->local = where;
+ /*
+ * We must set the port to the right window -- the one
+ * we are actually going to use -- before finding
+ * the local coordinates, otherwise we will have completely
+ * wrong local x,y!
+ *
+ * I'm pretty sure this window is medPtr->whichWin, unless
+ * perhaps there is a grab. Certainly 'frontWindow' or
+ * 'medPtr->activeNonFloating' are wrong.
+ */
+ SetPortWindowPort(medPtr->whichWin);
+ GlobalToLocal(&medPtr->local);
+ if (eventPtr->eKind == kEventMouseWheelMoved ) {
+ return GenerateMouseWheelEvent(medPtr);
+ } else {
+ return GeneratePollingEvents(medPtr);
+ }
+ }
+
+ if (medPtr->whichWin && eventPtr->eKind==kEventMouseDown) {
+ ProcessSerialNumber frontPsn, ourPsn;
+ Boolean flag;
+ if ((err=GetFrontProcess(&frontPsn))!=noErr) {
+ fprintf(stderr, "GetFrontProcess failed, %d\n", err);
+ statusPtr->err = 1;
+ return 1;
+ }
+
+ GetCurrentProcess(&ourPsn);
+ if ((err=SameProcess(&frontPsn, &ourPsn, &flag))!=noErr) {
+ fprintf(stderr, "SameProcess failed, %d\n", err);
+ statusPtr->err = 1;
+ return 1;
+ } else {
+ if (!flag) {
+ if ((err=SetFrontProcess(&ourPsn)) != noErr) {
+ fprintf(stderr,"SetFrontProcess failed,%d\n", err);
+ statusPtr->err = 1;
+ return 1;
+ }
+ }
+ }
+
+ }
+
+ if (medPtr->whichWin) {
+ /*
+ * We got a mouse down in a window
+ * See if this is the activate click
+ * This click moves the window forward. We don't want
+ * the corresponding mouse-up to be reported to the application
+ * or else it will mess up some Tk scripts.
+ */
+
+ if (!(TkpIsWindowFloating(medPtr->whichWin))
+ && (medPtr->whichWin != medPtr->activeNonFloating)) {
+ Tk_Window grabWin = TkMacOSXGetCapture();
+ if ((grabWin != NULL) && (grabWin != tkwin)) {
+ TkWindow * tkw, * grb;
+ tkw = (TkWindow *)tkwin;
+ grb = (TkWindow *)grabWin;
+ SysBeep(1);
+ return false;
+ }
+ TkMacOSXSetEatButtonUp(true);
+ BringWindowForward(medPtr->whichWin);
+ return false;
+ }
+ }
+
+ switch (medPtr->windowPart) {
+ case inDrag:
+ DragWindow(medPtr->whichWin, where, NULL);
+ where2.h = where2.v = 0;
+ LocalToGlobal(&where2);
+ if (EqualPt(where, where2)) {
+ return false;
+ }
+ TkMacOSXWindowOffset(medPtr->whichWin, &xOffset, &yOffset);
+ where2.h -= xOffset;
+ where2.v -= yOffset;
+ TkGenWMConfigureEvent(tkwin, where2.h, where2.v,
+ -1, -1, TK_LOCATION_CHANGED);
+ return true;
+ break;
+ case inContent:
+ return TkGenerateButtonEvent(where.h, where.v,
+ window, medPtr->state);
+ break;
+ case inGrow:
+ /*
+ * Generally the content region is the domain of Tk
+ * sub-windows. However, one exception is the grow
+ * region. A button down in this area will be handled
+ * by the window manager. Note: this means that Tk
+ * may not get button down events in this area!
+ */
+ if (TkMacOSXGrowToplevel(medPtr->whichWin, where) == true) {
+ return true;
+ } else {
+ return TkGenerateButtonEvent(where.h,
+ where.v, window, medPtr->state);
+ }
+ break;
+ case inGoAway:
+ if (TrackGoAway(medPtr->whichWin,where)) {
+ if (tkwin == NULL) {
+ return false;
+ }
+ TkGenWMDestroyEvent(tkwin);
+ return true;
+ }
+ return false;
+ break;
+ case inMenuBar:
+ {
+ int oldMode;
+ KeyMap theKeys;
+
+ GetKeys(theKeys);
+ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ TkMacOSXClearMenubarActive();
+
+ /*
+ * Handle -postcommand
+ */
+
+ TkMacOSXPreprocessMenu();
+ TkMacOSXHandleMenuSelect(MenuSelect(where),
+ theKeys[1] & 4);
+ Tcl_SetServiceMode(oldMode);
+ return true; /* TODO: may not be on event on queue. */
+ }
+ break;
+ case inZoomIn:
+ case inZoomOut:
+ if (TkMacOSXZoomToplevel(medPtr->whichWin, where,
+ medPtr->windowPart) == true) {
+ return true;
+ } else {
+ return false;
+ }
+ break;
+ case inCollapseBox:
+ if ((err = CollapseWindow(medPtr->whichWin,
+ !IsWindowCollapsed(medPtr->whichWin)))!=noErr) {
+ fprintf(stderr,"CollapseWindow failed,%d\n", err);
+ statusPtr->err = 1;
+ }
+ break;
+ default:
+ return false;
+ break;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GeneratePollingEvents --
+ *
+ * This function polls the mouse position and generates X Motion,
+ * Enter & Leave events. The cursor is also updated at this
+ * time.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ * The cursor may be changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+GeneratePollingEvents(MouseEventData * medPtr)
+{
+ Tk_Window tkwin, rootwin, grabWin;
+ Window window;
+ int local_x, local_y;
+ TkDisplay *dispPtr;
+
+ /*
+ * I really do not understand this complicated logic. Surely the event
+ * should be to either: (1) medPtr->whichWin, the window under the mouse
+ * (from which we then obviously extract the correct Tk subwindow), or
+ * (2) the current grab window. I really don't see why anything else is
+ * relevant.
+ */
+#if 0
+ if ((!TkpIsWindowFloating(medPtr->whichWin)
+ && (medPtr->activeNonFloating != medPtr->whichWin))) {
+ tkwin = NULL;
+ } else {
+ window = TkMacOSXGetXWindow(medPtr->whichWin);
+ dispPtr = TkGetDisplayList();
+ rootwin = Tk_IdToWindow(dispPtr->display, window);
+ if (rootwin == NULL) {
+ tkwin = NULL;
+ } else {
+ tkwin = Tk_TopCoordsToWindow(rootwin,
+ medPtr->local.h, medPtr->local.v,
+ &local_x, &local_y);
+ }
+ }
+
+ /*
+ * The following call will generate the appropiate X events and
+ * adjust any state that Tk must remember.
+ */
+
+ grabWin = TkMacOSXGetCapture();
+
+ if ((tkwin == NULL) && (grabWin != NULL)) {
+ tkwin = grabWin;
+ }
+#else
+ grabWin = TkMacOSXGetCapture();
+ if (grabWin != NULL) {
+ tkwin = grabWin;
+ } else {
+ window = TkMacOSXGetXWindow(medPtr->whichWin);
+ dispPtr = TkGetDisplayList();
+ rootwin = Tk_IdToWindow(dispPtr->display, window);
+ if (rootwin == NULL) {
+ tkwin = NULL;
+ } else {
+ tkwin = Tk_TopCoordsToWindow(rootwin,
+ medPtr->local.h, medPtr->local.v,
+ &local_x, &local_y);
+ }
+ }
+#endif
+ Tk_UpdatePointer(tkwin, medPtr->global.h, medPtr->global.v,
+ medPtr->state);
+
+
+ TkMacOSXInstallCursor(0);
+
+ return true;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BringWindowForward --
+ *
+ * Bring this background window to the front. We also set state
+ * so Tk thinks the button is currently up.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The window is brought forward.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+BringWindowForward(WindowRef wRef)
+{
+ if (!TkpIsWindowFloating(wRef)) {
+ if (IsValidWindowPtr(wRef))
+ SelectWindow(wRef);
+ }
+}
+
+static int
+GenerateMouseWheelEvent(MouseEventData * medPtr)
+{
+ Tk_Window tkwin, rootwin, grabWin;
+ Window window;
+ int local_x, local_y;
+ TkDisplay *dispPtr;
+ TkWindow *winPtr;
+ XEvent xEvent;
+
+ if ((!TkpIsWindowFloating(medPtr->whichWin)
+ && (medPtr->activeNonFloating != medPtr->whichWin))) {
+ tkwin = NULL;
+ } else {
+ window = TkMacOSXGetXWindow(medPtr->whichWin);
+ dispPtr = TkGetDisplayList();
+ rootwin = Tk_IdToWindow(dispPtr->display, window);
+ if (rootwin == NULL) {
+ tkwin = NULL;
+ } else {
+ tkwin = Tk_TopCoordsToWindow(rootwin,
+ medPtr->local.h, medPtr->local.v,
+ &local_x, &local_y);
+ }
+ }
+
+ /*
+ * The following call will generate the appropiate X events and
+ * adjust any state that Tk must remember.
+ */
+
+ grabWin = TkMacOSXGetCapture();
+
+ if ((tkwin == NULL) && (grabWin != NULL)) {
+ tkwin = grabWin;
+ }
+ if (!tkwin) {
+ return true;
+ }
+ winPtr = ( TkWindow *)tkwin;
+ xEvent.type = MouseWheelEvent;
+ xEvent.xkey.keycode = medPtr->delta;
+ xEvent.xany.serial = LastKnownRequestProcessed(winPtr->display);
+ xEvent.xany.send_event = false;
+ xEvent.xany.display = winPtr->display;
+ xEvent.xany.window = Tk_WindowId(winPtr);
+ Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL);
+
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetEatButtonUp --
+ *
+ * Results:
+ * Returns the flag indicating if we need to eat the
+ * next mouse up event
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+int
+TkMacOSXGetEatButtonUp()
+{
+ return gEatButtonUp;
+}
+
+/*
+ * TkMacOSXSetEatButtonUp --
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets the flag indicating if we need to eat the
+ * next mouse up event
+ *
+ */
+void
+TkMacOSXSetEatButtonUp(int f)
+{
+ gEatButtonUp = f;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXButtonKeyState --
+ *
+ * Returns the current state of the button & modifier keys.
+ *
+ * Results:
+ * A bitwise inclusive OR of a subset of the following:
+ * Button1Mask, ShiftMask, LockMask, ControlMask, Mod?Mask,
+ * Mod?Mask.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+unsigned int
+TkMacOSXButtonKeyState()
+{
+ unsigned int state = 0;
+ KeyMap theKeys;
+
+ if (Button() & !gEatButtonUp) {
+ state |= Button1Mask;
+ }
+
+ GetKeys(theKeys);
+
+ if (theKeys[1] & 2) {
+ state |= LockMask;
+ }
+
+ if (theKeys[1] & 1) {
+ state |= ShiftMask;
+ }
+
+ if (theKeys[1] & 8) {
+ state |= ControlMask;
+ }
+
+ if (theKeys[1] & 32768) {
+ state |= Mod1Mask; /* command key */
+ }
+
+ if (theKeys[1] & 4) {
+ state |= Mod2Mask; /* option key */
+ }
+
+ return state;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XQueryPointer --
+ *
+ * Check the current state of the mouse. This is not a complete
+ * implementation of this function. It only computes the root
+ * coordinates and the current mask.
+ *
+ * Results:
+ * Sets root_x_return, root_y_return, and mask_return. Returns
+ * true on success.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Bool
+XQueryPointer(
+ Display* display,
+ Window w,
+ Window* root_return,
+ Window* child_return,
+ int* root_x_return,
+ int* root_y_return,
+ int* win_x_return,
+ int* win_y_return,
+ unsigned int* mask_return)
+{
+ Point where;
+ CGrafPtr port;
+ GDHandle dev;
+
+ GetGWorld(&port,&dev);
+ GetMouse(&where);
+ LocalToGlobal(&where);
+
+ *root_x_return = where.h;
+ *root_y_return = where.v;
+ *mask_return = TkMacOSXButtonKeyState();
+ return True;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGenerateButtonEvent --
+ *
+ * Given a global x & y position and the button key status this
+ * procedure generates the appropiate X button event. It also
+ * handles the state changes needed to implement implicit grabs.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ * Grab state may also change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkGenerateButtonEvent(
+ int x, /* X location of mouse */
+ int y, /* Y location of mouse */
+ Window window, /* X Window containing button event. */
+ unsigned int state) /* Button Key state suitable for X event */
+{
+ WindowRef whichWin, frontWin;
+ Point where;
+ Tk_Window tkwin;
+ int dummy;
+ TkDisplay *dispPtr;
+
+ /*
+ * ButtonDown events will always occur in the front
+ * window. ButtonUp events, however, may occur anywhere
+ * on the screen. ButtonUp events should only be sent
+ * to Tk if in the front window or during an implicit grab.
+ */
+
+ where.h = x;
+ where.v = y;
+ FindWindow(where, &whichWin);
+ frontWin = FrontNonFloatingWindow();
+
+ if (0 && ((frontWin == NULL) || ((!(TkpIsWindowFloating(whichWin))
+ && (frontWin != whichWin))
+ && TkMacOSXGetCapture() == NULL))) {
+ return false;
+ }
+
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+
+ /* SetPortWindowPort(ActiveNonFloatingWindow()); */
+ SetPortWindowPort(whichWin);
+ GlobalToLocal(&where);
+ if (tkwin != NULL) {
+ tkwin = Tk_TopCoordsToWindow(tkwin, where.h, where.v,
+ &dummy, &dummy);
+ }
+
+ Tk_UpdatePointer(tkwin, x, y, state);
+
+ return true;
+} \ No newline at end of file
diff --git a/tk/macosx/tkMacOSXNotify.c b/tk/macosx/tkMacOSXNotify.c
new file mode 100644
index 00000000000..9862618f3ec
--- /dev/null
+++ b/tk/macosx/tkMacOSXNotify.c
@@ -0,0 +1,1162 @@
+/*
+ * tclMacOSXNotify.c --
+ *
+ * This file contains the implementation of a merged
+ * Carbon/select-based notifier, which is the lowest-level part
+ * of the Tcl event loop. This file works together with
+ * ../generic/tclNotify.c.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tclInt.h"
+#include "tclPort.h"
+
+/* FIXME - Why do I need these here? */
+
+#undef environ
+#include "tkMacOSX.h"
+#include "tkMacOSXEvent.h"
+#include <signal.h>
+
+extern TclStubs tclStubs;
+
+/*
+ * This structure is used to keep track of the notifier info for a
+ * a registered file.
+ */
+
+typedef struct FileHandler {
+ int fd;
+ int mask; /* Mask of desired events: TCL_READABLE,
+ * etc. */
+ int readyMask; /* Mask of events that have been seen since the
+ * last time file handlers were invoked for
+ * this file. */
+ Tcl_FileProc *proc; /* Procedure to call, in the style of
+ * Tcl_CreateFileHandler. */
+ ClientData clientData; /* Argument to pass to proc. */
+ struct FileHandler *nextPtr;/* Next in list of all files we care about. */
+} FileHandler;
+
+/*
+ * The following structure is what is added to the Tcl event queue when
+ * file handlers are ready to fire.
+ */
+
+typedef struct FileHandlerEvent {
+ Tcl_Event header; /* Information that is standard for
+ * all events. */
+ int fd; /* File descriptor that is ready. Used
+ * to find the FileHandler structure for
+ * the file (can't point directly to the
+ * FileHandler structure because it could
+ * go away while the event is queued). */
+} FileHandlerEvent;
+
+/*
+ * The following static structure contains the state information for the
+ * select based implementation of the Tcl notifier. One of these structures
+ * is created for each thread that is using the notifier.
+ */
+
+typedef struct ThreadSpecificData {
+ FileHandler *firstFileHandlerPtr;
+ /* Pointer to head of file handler list. */
+ fd_mask checkMasks[3*MASK_SIZE];
+ /* This array is used to build up the masks
+ * to be used in the next call to select.
+ * Bits are set in response to calls to
+ * Tcl_CreateFileHandler. */
+ fd_mask readyMasks[3*MASK_SIZE];
+ /* This array reflects the readable/writable
+ * conditions that were found to exist by the
+ * last call to select. */
+ int numFdBits; /* Number of valid bits in checkMasks
+ * (one more than highest fd for which
+ * Tcl_WatchFile has been called). */
+ int isMainLoop; /* Is this the main Carbon Loop (in which case
+ * we will call RNE in the actual wait... */
+#ifdef TCL_THREADS
+ int onList; /* True if it is in this list */
+ unsigned int pollState; /* pollState is used to implement a polling
+ * handshake between each thread and the
+ * notifier thread. Bits defined below. */
+ struct ThreadSpecificData *nextPtr, *prevPtr;
+ /* All threads that are currently waiting on
+ * an event have their ThreadSpecificData
+ * structure on a doubly-linked listed formed
+ * from these pointers. You must hold the
+ * notifierMutex lock before accessing these
+ * fields. */
+ Tcl_Condition waitCV; /* Any other thread alerts a notifier
+ * that an event is ready to be processed
+ * by signaling this condition variable. */
+ int eventReady; /* True if an event is ready to be processed.
+ * Used as condition flag together with
+ * waitCV above. */
+#endif
+} ThreadSpecificData;
+
+static Tcl_ThreadDataKey dataKey;
+
+#ifdef TCL_THREADS
+/*
+ * The following static indicates the number of threads that have
+ * initialized notifiers.
+ *
+ * You must hold the notifierMutex lock before accessing this variable.
+ */
+
+static int notifierCount = 0;
+
+/*
+ * The following variable points to the head of a doubly-linked list of
+ * of ThreadSpecificData structures for all threads that are currently
+ * waiting on an event.
+ *
+ * You must hold the notifierMutex lock before accessing this list.
+ */
+
+static ThreadSpecificData *waitingListPtr = NULL;
+
+/*
+ * The notifier thread spends all its time in select() waiting for a
+ * file descriptor associated with one of the threads on the waitingListPtr
+ * list to do something interesting. But if the contents of the
+ * waitingListPtr list ever changes, we need to wake up and restart
+ * the select() system call. You can wake up the notifier thread by
+ * writing a single byte to the file descriptor defined below. This
+ * file descriptor is the input-end of a pipe and the notifier thread is
+ * listening for data on the output-end of the same pipe. Hence writing
+ * to this file descriptor will cause the select() system call to return
+ * and wake up the notifier thread.
+ *
+ * You must hold the notifierMutex lock before accessing this list.
+ */
+
+static int triggerPipe = -1;
+
+/*
+ * The notifierMutex locks access to all of the global notifier state.
+ */
+
+TCL_DECLARE_MUTEX(notifierMutex)
+
+/*
+ * The notifier thread signals the notifierCV when it has finished
+ * initializing the triggerPipe and right before the notifier
+ * thread terminates.
+ */
+
+static Tcl_Condition notifierCV;
+
+/*
+ * The pollState bits
+ * POLL_WANT is set by each thread before it waits on its condition
+ * variable. It is checked by the notifier before it does
+ * select.
+ * POLL_DONE is set by the notifier if it goes into select after
+ * seeing POLL_WANT. The idea is to ensure it tries a select
+ * with the same bits the initial thread had set.
+ */
+#define POLL_WANT 0x1
+#define POLL_DONE 0x2
+
+/*
+ * This is the thread ID of the notifier thread that does select.
+ */
+static Tcl_ThreadId notifierThread;
+
+#endif
+
+/*
+ * Static routines defined in this file.
+ */
+
+#ifdef TCL_THREADS
+static void NotifierThreadProc _ANSI_ARGS_((ClientData clientData));
+#endif
+static int FileHandlerEventProc _ANSI_ARGS_((Tcl_Event *evPtr,
+ int flags));
+
+void TkMacOSXSetTimer(Tcl_Time *timePtr);
+void TkMacOSXCreateFileHandler(int fd, int mask, Tcl_FileProc *proc, ClientData clientData);
+void TkMacOSXDeleteFileHandler(int fd);
+int TkMacOSXWaitForEvent(Tcl_Time *timePtr);
+void TkMacOSXAlertNotifier(ClientData clientData);
+ClientData TkMacOSXInitNotifier();
+void TkMacOSXFinalizeNotifier(ClientData clientData);
+void TkMacOSXServiceModeHook(int mode);
+EventRef TkMacOSXCreateFakeEvent ();
+ /*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetupTkNotifier --
+ *
+ * Replaces the Tcl notifier (from tclUnixNotfy.c) with
+ * the Mac notifier that melds the Unix select based notifer
+ * with the Carbon event handling side of the Tk notifier.
+ *
+ * Results:
+ * Replaces the notifier callbacks with MacOS X specific ones.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_MacOSXSetupTkNotifier()
+{
+ EventQueueRef mainEventQueue;
+ Tcl_NotifierProcs macNotifierProcs = {
+ TkMacOSXSetTimer,
+ TkMacOSXWaitForEvent,
+ TkMacOSXCreateFileHandler,
+ TkMacOSXDeleteFileHandler,
+ TkMacOSXInitNotifier,
+ TkMacOSXFinalizeNotifier,
+ TkMacOSXAlertNotifier,
+ TkMacOSXServiceModeHook
+ };
+
+ /*
+ * Dispose of existing unix notifier thread
+ */
+
+ TclFinalizeNotifier();
+
+ Tcl_SetNotifier(&macNotifierProcs);
+
+ /* HACK ALERT: There is a bug in Jaguar where when it goes to make
+ * the event queue for the Main Event Loop, it stores the Current
+ * event loop rather than the Main Event Loop in the Queue structure.
+ * So we have to make sure that the Main Event Queue gets set up on
+ * the main thread. Calling GetMainEventQueue will force this to
+ * happen.
+ */
+
+ mainEventQueue = GetMainEventQueue();
+
+ /*
+ * Tcl_SetNotifier doesn't call the TclInitNotifier
+ * so we call it now. If we don't do this the
+ * ThreadSpecificData will keep a pointer to the original
+ * InitNotifier. See tclNotify.c:TclInitNotifier().
+ */
+
+ TclInitNotifier();
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_InitNotifier --
+ *
+ * Initializes the platform specific notifier state.
+ *
+ * Results:
+ * Returns a handle to the notifier state for this thread..
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ClientData
+TkMacOSXInitNotifier()
+{
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+#ifdef TCL_THREADS
+ tsdPtr->eventReady = 0;
+
+ /*
+ * Start the Notifier thread if necessary.
+ */
+
+ Tcl_MutexLock(&notifierMutex);
+ if (notifierCount == 0) {
+ if (Tcl_CreateThread(&notifierThread, NotifierThreadProc, NULL,
+ TCL_THREAD_STACK_DEFAULT, TCL_THREAD_NOFLAGS) != TCL_OK) {
+ panic("Tcl_InitNotifier: unable to start notifier thread");
+ }
+ }
+ notifierCount++;
+
+ if (GetCurrentEventLoop() == GetMainEventLoop()) {
+ tsdPtr->isMainLoop = 1;
+ } else {
+ tsdPtr->isMainLoop = 0;
+ }
+
+ /*
+ * Wait for the notifier pipe to be created.
+ */
+
+ while (triggerPipe < 0) {
+ Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
+ }
+
+ Tcl_MutexUnlock(&notifierMutex);
+#endif
+ return (ClientData) tsdPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_FinalizeNotifier --
+ *
+ * This function is called to cleanup the notifier state before
+ * a thread is terminated.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May terminate the background notifier thread if this is the
+ * last notifier instance.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXFinalizeNotifier(clientData)
+ ClientData clientData; /* Not used. */
+{
+#ifdef TCL_THREADS
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ Tcl_MutexLock(&notifierMutex);
+ notifierCount--;
+
+ /*
+ * If this is the last thread to use the notifier, close the notifier
+ * pipe and wait for the background thread to terminate.
+ */
+
+ if (notifierCount == 0) {
+ if (triggerPipe < 0) {
+ panic("Tcl_FinalizeNotifier: notifier pipe not initialized");
+ }
+
+ /*
+ * Send "q" message to the notifier thread so that it will
+ * terminate. The notifier will return from its call to select()
+ * and notice that a "q" message has arrived, it will then close
+ * its side of the pipe and terminate its thread. Note the we can
+ * not just close the pipe and check for EOF in the notifier
+ * thread because if a background child process was created with
+ * exec, select() would not register the EOF on the pipe until the
+ * child processes had terminated. [Bug: 4139]
+ */
+ write(triggerPipe, "q", 1);
+ close(triggerPipe);
+
+ Tcl_ConditionWait(&notifierCV, &notifierMutex, NULL);
+ }
+
+ /*
+ * Clean up any synchronization objects in the thread local storage.
+ */
+
+ Tcl_ConditionFinalize(&(tsdPtr->waitCV));
+
+ Tcl_MutexUnlock(&notifierMutex);
+#endif
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_AlertNotifier --
+ *
+ * Wake up the specified notifier from any thread. This routine
+ * is called by the platform independent notifier code whenever
+ * the Tcl_ThreadAlert routine is called. This routine is
+ * guaranteed not to be called on a given notifier after
+ * Tcl_FinalizeNotifier is called for that notifier.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Signals the notifier condition variable for the specified
+ * notifier.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXAlertNotifier(clientData)
+ ClientData clientData;
+{
+#ifdef TCL_THREADS
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
+ Tcl_MutexLock(&notifierMutex);
+ tsdPtr->eventReady = 1;
+ Tcl_ConditionNotify(&tsdPtr->waitCV);
+ Tcl_MutexUnlock(&notifierMutex);
+#endif
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_SetTimer --
+ *
+ * This procedure sets the current notifier timer value. This
+ * interface is not implemented in this notifier because we are
+ * always running inside of Tcl_DoOneEvent.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetTimer(timePtr)
+ Tcl_Time *timePtr; /* Timeout value, may be NULL. */
+{
+ /*
+ * The interval timer doesn't do anything in this implementation,
+ * because the only event loop is via Tcl_DoOneEvent, which passes
+ * timeout values to Tcl_WaitForEvent.
+ */
+
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_ServiceModeHook --
+ *
+ * This function is invoked whenever the service mode changes.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXServiceModeHook(mode)
+ int mode; /* Either TCL_SERVICE_ALL, or
+ * TCL_SERVICE_NONE. */
+{
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_CreateFileHandler --
+ *
+ * This procedure registers a file handler with the select notifier.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Creates a new file handler structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXCreateFileHandler(fd, mask, proc, clientData)
+ int fd; /* Handle of stream to watch. */
+ int mask; /* OR'ed combination of TCL_READABLE,
+ * TCL_WRITABLE, and TCL_EXCEPTION:
+ * indicates conditions under which
+ * proc should be called. */
+ Tcl_FileProc *proc; /* Procedure to call for each
+ * selected event. */
+ ClientData clientData; /* Arbitrary data to pass to proc. */
+{
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+ FileHandler *filePtr;
+ int index, bit;
+
+ for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL;
+ filePtr = filePtr->nextPtr) {
+ if (filePtr->fd == fd) {
+ break;
+ }
+ }
+ if (filePtr == NULL) {
+ filePtr = (FileHandler*) ckalloc(sizeof(FileHandler));
+ filePtr->fd = fd;
+ filePtr->readyMask = 0;
+ filePtr->nextPtr = tsdPtr->firstFileHandlerPtr;
+ tsdPtr->firstFileHandlerPtr = filePtr;
+ }
+ filePtr->proc = proc;
+ filePtr->clientData = clientData;
+ filePtr->mask = mask;
+
+ /*
+ * Update the check masks for this file.
+ */
+
+ index = fd/(NBBY*sizeof(fd_mask));
+ bit = 1 << (fd%(NBBY*sizeof(fd_mask)));
+ if (mask & TCL_READABLE) {
+ tsdPtr->checkMasks[index] |= bit;
+ } else {
+ tsdPtr->checkMasks[index] &= ~bit;
+ }
+ if (mask & TCL_WRITABLE) {
+ (tsdPtr->checkMasks+MASK_SIZE)[index] |= bit;
+ } else {
+ (tsdPtr->checkMasks+MASK_SIZE)[index] &= ~bit;
+ }
+ if (mask & TCL_EXCEPTION) {
+ (tsdPtr->checkMasks+2*(MASK_SIZE))[index] |= bit;
+ } else {
+ (tsdPtr->checkMasks+2*(MASK_SIZE))[index] &= ~bit;
+ }
+ if (tsdPtr->numFdBits <= fd) {
+ tsdPtr->numFdBits = fd+1;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DeleteFileHandler --
+ *
+ * Cancel a previously-arranged callback arrangement for
+ * a file.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If a callback was previously registered on file, remove it.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXDeleteFileHandler(fd)
+ int fd; /* Stream id for which to remove callback procedure. */
+{
+ FileHandler *filePtr, *prevPtr;
+ int index, bit, i;
+ unsigned long flags;
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ /*
+ * Find the entry for the given file (and return if there isn't one).
+ */
+
+ for (prevPtr = NULL, filePtr = tsdPtr->firstFileHandlerPtr; ;
+ prevPtr = filePtr, filePtr = filePtr->nextPtr) {
+ if (filePtr == NULL) {
+ return;
+ }
+ if (filePtr->fd == fd) {
+ break;
+ }
+ }
+
+ /*
+ * Update the check masks for this file.
+ */
+
+ index = fd/(NBBY*sizeof(fd_mask));
+ bit = 1 << (fd%(NBBY*sizeof(fd_mask)));
+
+ if (filePtr->mask & TCL_READABLE) {
+ tsdPtr->checkMasks[index] &= ~bit;
+ }
+ if (filePtr->mask & TCL_WRITABLE) {
+ (tsdPtr->checkMasks+MASK_SIZE)[index] &= ~bit;
+ }
+ if (filePtr->mask & TCL_EXCEPTION) {
+ (tsdPtr->checkMasks+2*(MASK_SIZE))[index] &= ~bit;
+ }
+
+ /*
+ * Find current max fd.
+ */
+
+ if (fd+1 == tsdPtr->numFdBits) {
+ for (tsdPtr->numFdBits = 0; index >= 0; index--) {
+ flags = tsdPtr->checkMasks[index]
+ | (tsdPtr->checkMasks+MASK_SIZE)[index]
+ | (tsdPtr->checkMasks+2*(MASK_SIZE))[index];
+ if (flags) {
+ for (i = (NBBY*sizeof(fd_mask)); i > 0; i--) {
+ if (flags & (((unsigned long)1) << (i-1))) {
+ break;
+ }
+ }
+ tsdPtr->numFdBits = index * (NBBY*sizeof(fd_mask)) + i;
+ break;
+ }
+ }
+ }
+
+ /*
+ * Clean up information in the callback record.
+ */
+
+ if (prevPtr == NULL) {
+ tsdPtr->firstFileHandlerPtr = filePtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = filePtr->nextPtr;
+ }
+ ckfree((char *) filePtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FileHandlerEventProc --
+ *
+ * This procedure is called by Tcl_ServiceEvent when a file event
+ * reaches the front of the event queue. This procedure is
+ * responsible for actually handling the event by invoking the
+ * callback for the file handler.
+ *
+ * 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 file handler's callback procedure does.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+FileHandlerEventProc(evPtr, flags)
+ Tcl_Event *evPtr; /* Event to service. */
+ int flags; /* Flags that indicate what events to
+ * handle, such as TCL_FILE_EVENTS. */
+{
+ int mask;
+ FileHandler *filePtr;
+ FileHandlerEvent *fileEvPtr = (FileHandlerEvent *) evPtr;
+ ThreadSpecificData *tsdPtr;
+
+ if (!(flags & TCL_FILE_EVENTS)) {
+ return 0;
+ }
+
+ /*
+ * Search through the file handlers to find the one whose handle matches
+ * the event. We do this rather than keeping a pointer to the file
+ * handler directly in the event, so that the handler can be deleted
+ * while the event is queued without leaving a dangling pointer.
+ */
+
+ tsdPtr = TCL_TSD_INIT(&dataKey);
+ for (filePtr = tsdPtr->firstFileHandlerPtr; filePtr != NULL;
+ filePtr = filePtr->nextPtr) {
+ if (filePtr->fd != fileEvPtr->fd) {
+ continue;
+ }
+
+ /*
+ * The code is tricky for two reasons:
+ * 1. The file handler's desired events could have changed
+ * since the time when the event was queued, so AND the
+ * ready mask with the desired mask.
+ * 2. The file could have been closed and re-opened since
+ * the time when the event was queued. This is why the
+ * ready mask is stored in the file handler rather than
+ * the queued event: it will be zeroed when a new
+ * file handler is created for the newly opened file.
+ */
+
+ mask = filePtr->readyMask & filePtr->mask;
+ filePtr->readyMask = 0;
+ if (mask != 0) {
+ (*filePtr->proc)(filePtr->clientData, mask);
+ }
+ break;
+ }
+ return 1;
+}
+
+void
+DoActualWait(timePtr)
+ Tcl_Time *timePtr; /* Maximum block time, or NULL. */
+{
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ if (!tsdPtr->isMainLoop) {
+ Tcl_ConditionWait(&tsdPtr->waitCV, &notifierMutex, timePtr);
+ } else {
+ EventRef eventRef;
+ EventTime waitTime;
+ Tcl_MutexUnlock(&notifierMutex);
+
+ if (timePtr == NULL) {
+ waitTime = kEventDurationForever;
+ } else {
+ waitTime = timePtr->sec * kEventDurationSecond
+ + timePtr->usec * kEventDurationMicrosecond;
+ }
+ ReceiveNextEvent(0, NULL, waitTime, false, &eventRef);
+ Tcl_MutexLock(&notifierMutex);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_WaitForEvent --
+ *
+ * This function is called by Tcl_DoOneEvent to wait for new
+ * events on the message queue. If the block time is 0, then
+ * Tcl_WaitForEvent just polls without blocking.
+ *
+ * Results:
+ * Returns -1 if the select would block forever, otherwise
+ * returns 0.
+ *
+ * Side effects:
+ * Queues file events that are detected by the select.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXWaitForEvent(timePtr)
+ Tcl_Time *timePtr; /* Maximum block time, or NULL. */
+{
+ FileHandler *filePtr;
+ FileHandlerEvent *fileEvPtr;
+ struct timeval timeout, *timeoutPtr;
+ int bit, index, mask;
+#ifdef TCL_THREADS
+ int waitForFiles;
+#else
+ int numFound;
+#endif
+
+ ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
+
+ /*
+ * Set up the timeout structure. Note that if there are no events to
+ * check for, we return with a negative result rather than blocking
+ * forever.
+ */
+
+ if (timePtr) {
+ timeout.tv_sec = timePtr->sec;
+ timeout.tv_usec = timePtr->usec;
+ timeoutPtr = &timeout;
+#ifndef TCL_THREADS
+ } else if (tsdPtr->numFdBits == 0) {
+ /*
+ * If there are no threads, no timeout, and no fds registered,
+ * then there are no events possible and we must avoid deadlock.
+ * Note that this is not entirely correct because there might
+ * be a signal that could interrupt the select call, but we
+ * don't handle that case if we aren't using threads.
+ */
+
+ return -1;
+#endif
+ } else {
+ timeoutPtr = NULL;
+ }
+
+#ifdef TCL_THREADS
+ /*
+ * Place this thread on the list of interested threads, signal the
+ * notifier thread, and wait for a response or a timeout.
+ */
+
+ Tcl_MutexLock(&notifierMutex);
+
+ waitForFiles = (tsdPtr->numFdBits > 0);
+ if (timePtr != NULL && timePtr->sec == 0 && timePtr->usec == 0) {
+ /*
+ * Cannot emulate a polling select with a polling condition variable.
+ * Instead, pretend to wait for files and tell the notifier
+ * thread what we are doing. The notifier thread makes sure
+ * it goes through select with its select mask in the same state
+ * as ours currently is. We block until that happens.
+ */
+
+ waitForFiles = 1;
+ tsdPtr->pollState = POLL_WANT;
+ timePtr = NULL;
+ } else {
+ tsdPtr->pollState = 0;
+ }
+
+ if (waitForFiles) {
+ /*
+ * Add the ThreadSpecificData structure of this thread to the list
+ * of ThreadSpecificData structures of all threads that are waiting
+ * on file events.
+ */
+
+
+ tsdPtr->nextPtr = waitingListPtr;
+ if (waitingListPtr) {
+ waitingListPtr->prevPtr = tsdPtr;
+ }
+ tsdPtr->prevPtr = 0;
+ waitingListPtr = tsdPtr;
+ tsdPtr->onList = 1;
+
+ write(triggerPipe, "", 1);
+ }
+
+ memset((VOID *) tsdPtr->readyMasks, 0, 3*MASK_SIZE*sizeof(fd_mask));
+
+ if (!tsdPtr->eventReady) {
+ DoActualWait(timePtr);
+ }
+ tsdPtr->eventReady = 0;
+
+ if (waitForFiles && tsdPtr->onList) {
+ /*
+ * Remove the ThreadSpecificData structure of this thread from the
+ * waiting list. Alert the notifier thread to recompute its select
+ * masks - skipping this caused a hang when trying to close a pipe
+ * which the notifier thread was still doing a select on.
+ */
+
+ if (tsdPtr->prevPtr) {
+ tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr;
+ } else {
+ waitingListPtr = tsdPtr->nextPtr;
+ }
+ if (tsdPtr->nextPtr) {
+ tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
+ }
+ tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
+ tsdPtr->onList = 0;
+ write(triggerPipe, "", 1);
+ }
+
+
+#else
+ memcpy((VOID *) tsdPtr->readyMasks, (VOID *) tsdPtr->checkMasks,
+ 3*MASK_SIZE*sizeof(fd_mask));
+ numFound = select(tsdPtr->numFdBits,
+ (SELECT_MASK *) &tsdPtr->readyMasks[0],
+ (SELECT_MASK *) &tsdPtr->readyMasks[MASK_SIZE],
+ (SELECT_MASK *) &tsdPtr->readyMasks[2*MASK_SIZE], timeoutPtr);
+
+ /*
+ * Some systems don't clear the masks after an error, so
+ * we have to do it here.
+ */
+
+ if (numFound == -1) {
+ memset((VOID *) tsdPtr->readyMasks, 0, 3*MASK_SIZE*sizeof(fd_mask));
+ }
+#endif
+
+ /*
+ * Queue all detected file events before returning.
+ */
+
+ for (filePtr = tsdPtr->firstFileHandlerPtr; (filePtr != NULL);
+ filePtr = filePtr->nextPtr) {
+ index = filePtr->fd / (NBBY*sizeof(fd_mask));
+ bit = 1 << (filePtr->fd % (NBBY*sizeof(fd_mask)));
+ mask = 0;
+
+ if (tsdPtr->readyMasks[index] & bit) {
+ mask |= TCL_READABLE;
+ }
+ if ((tsdPtr->readyMasks+MASK_SIZE)[index] & bit) {
+ mask |= TCL_WRITABLE;
+ }
+ if ((tsdPtr->readyMasks+2*(MASK_SIZE))[index] & bit) {
+ mask |= TCL_EXCEPTION;
+ }
+
+ if (!mask) {
+ continue;
+ }
+
+ /*
+ * Don't bother to queue an event if the mask was previously
+ * non-zero since an event must still be on the queue.
+ */
+
+ if (filePtr->readyMask == 0) {
+ fileEvPtr = (FileHandlerEvent *) ckalloc(
+ sizeof(FileHandlerEvent));
+ fileEvPtr->header.proc = FileHandlerEventProc;
+ fileEvPtr->fd = filePtr->fd;
+ Tcl_QueueEvent((Tcl_Event *) fileEvPtr, TCL_QUEUE_TAIL);
+ }
+ filePtr->readyMask = mask;
+ }
+
+ /*
+ * Also queue the Mac Events found...
+ */
+
+#ifdef TCL_THREADS
+ Tcl_MutexUnlock(&notifierMutex);
+#endif
+
+ if (tsdPtr->isMainLoop) {
+ TkMacOSXCountAndProcessMacEvents();
+ }
+
+ return 0;
+}
+
+#ifdef TCL_THREADS
+/*
+ *----------------------------------------------------------------------
+ *
+ * NotifierThreadProc --
+ *
+ * This routine is the initial (and only) function executed by the
+ * special notifier thread. Its job is to wait for file descriptors
+ * to become readable or writable or to have an exception condition
+ * and then to notify other threads who are interested in this
+ * information by signalling a condition variable. Other threads
+ * can signal this notifier thread of a change in their interests
+ * by writing a single byte to a special pipe that the notifier
+ * thread is monitoring.
+ *
+ * Result:
+ * None. Once started, this routine never exits. It dies with
+ * the overall process.
+ *
+ * Side effects:
+ * The trigger pipe used to signal the notifier thread is created
+ * when the notifier thread first starts.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+NotifierThreadProc(clientData)
+ ClientData clientData; /* Not used. */
+{
+ ThreadSpecificData *tsdPtr;
+ fd_mask masks[3*MASK_SIZE];
+ long *maskPtr = (long *)masks; /* masks[] cast to type long[] */
+ int fds[2];
+ int i, status, index, bit, numFdBits, found, receivePipe, word;
+ struct timeval poll = {0., 0.}, *timePtr;
+ int maskSize = 3 * ((MASK_SIZE) / sizeof(long)) * sizeof(fd_mask);
+ char buf[2];
+
+ if (pipe(fds) != 0) {
+ panic("NotifierThreadProc: could not create trigger pipe.");
+ }
+
+ receivePipe = fds[0];
+
+#ifndef USE_FIONBIO
+ status = fcntl(receivePipe, F_GETFL);
+ status |= O_NONBLOCK;
+ if (fcntl(receivePipe, F_SETFL, status) < 0) {
+ panic("NotifierThreadProc: could not make receive pipe non blocking.");
+ }
+ status = fcntl(fds[1], F_GETFL);
+ status |= O_NONBLOCK;
+ if (fcntl(fds[1], F_SETFL, status) < 0) {
+ panic("NotifierThreadProc: could not make trigger pipe non blocking.");
+ }
+#else
+ if (ioctl(receivePipe, (int) FIONBIO, &status) < 0) {
+ panic("NotifierThreadProc: could not make receive pipe non blocking.");
+ }
+ if (ioctl(fds[1], (int) FIONBIO, &status) < 0) {
+ panic("NotifierThreadProc: could not make trigger pipe non blocking.");
+ }
+#endif
+
+ /*
+ * Install the write end of the pipe into the global variable.
+ */
+
+ Tcl_MutexLock(&notifierMutex);
+ triggerPipe = fds[1];
+
+ /*
+ * Signal any threads that are waiting.
+ */
+
+ Tcl_ConditionNotify(&notifierCV);
+ Tcl_MutexUnlock(&notifierMutex);
+
+ /*
+ * Look for file events and report them to interested threads.
+ */
+
+ while (1) {
+ /*
+ * Set up the select mask to include the receive pipe.
+ */
+
+ memset((VOID *)masks, 0, 3*MASK_SIZE*sizeof(fd_mask));
+ numFdBits = receivePipe + 1;
+ index = receivePipe / (NBBY*sizeof(fd_mask));
+ bit = 1 << (receivePipe % (NBBY*sizeof(fd_mask)));
+ masks[index] |= bit;
+
+ /*
+ * Add in the check masks from all of the waiting notifiers.
+ */
+
+ Tcl_MutexLock(&notifierMutex);
+ timePtr = NULL;
+ for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
+ for (i = 0; i < maskSize; i++) {
+ maskPtr[i] |= ((long*)tsdPtr->checkMasks)[i];
+ }
+ if (tsdPtr->numFdBits > numFdBits) {
+ numFdBits = tsdPtr->numFdBits;
+ }
+ if (tsdPtr->pollState & POLL_WANT) {
+ /*
+ * Here we make sure we go through select() with the same
+ * mask bits that were present when the thread tried to poll.
+ */
+
+ tsdPtr->pollState |= POLL_DONE;
+ timePtr = &poll;
+ }
+ }
+ Tcl_MutexUnlock(&notifierMutex);
+
+ maskSize = 3 * ((MASK_SIZE) / sizeof(long)) * sizeof(fd_mask);
+
+ if (select(numFdBits, (SELECT_MASK *) &masks[0],
+ (SELECT_MASK *) &masks[MASK_SIZE],
+ (SELECT_MASK *) &masks[2*MASK_SIZE], timePtr) == -1) {
+ /*
+ * Try again immediately on an error.
+ */
+
+ continue;
+ }
+
+ /*
+ * Alert any threads that are waiting on a ready file descriptor.
+ */
+
+ Tcl_MutexLock(&notifierMutex);
+ for (tsdPtr = waitingListPtr; tsdPtr; tsdPtr = tsdPtr->nextPtr) {
+ found = 0;
+
+ for (i = 0; i < maskSize; i++) {
+ word = maskPtr[i] & ((long*)tsdPtr->checkMasks)[i];
+ found |= word;
+ (((long*)(tsdPtr->readyMasks))[i]) = word;
+ }
+ if (found || (tsdPtr->pollState & POLL_DONE)) {
+ if (tsdPtr->onList) {
+ /*
+ * Remove the ThreadSpecificData structure of this
+ * thread from the waiting list. This prevents us from
+ * continuously spining on select until the other
+ * threads runs and services the file event.
+ */
+
+ if (tsdPtr->prevPtr) {
+ tsdPtr->prevPtr->nextPtr = tsdPtr->nextPtr;
+ } else {
+ waitingListPtr = tsdPtr->nextPtr;
+ }
+ if (tsdPtr->nextPtr) {
+ tsdPtr->nextPtr->prevPtr = tsdPtr->prevPtr;
+ }
+ tsdPtr->nextPtr = tsdPtr->prevPtr = NULL;
+ tsdPtr->onList = 0;
+ tsdPtr->pollState = 0;
+ }
+ tsdPtr->eventReady = 1;
+ if (tsdPtr->isMainLoop) {
+ /* We need to wake up the main loop, and let it have the event. */
+ EventRef fakeEvent = TkMacOSXCreateFakeEvent();
+ PostEventToQueue(GetMainEventQueue(), fakeEvent, kEventPriorityHigh);
+ ReleaseEvent(fakeEvent);
+ } else {
+ Tcl_ConditionNotify(&tsdPtr->waitCV);
+ }
+ }
+ }
+ Tcl_MutexUnlock(&notifierMutex);
+
+ /*
+ * Consume the next byte from the notifier pipe if the pipe was
+ * readable. Note that there may be multiple bytes pending, but
+ * to avoid a race condition we only read one at a time.
+ */
+
+ if (masks[index] & bit) {
+ i = read(receivePipe, buf, 1);
+
+ if ((i == 0) || ((i == 1) && (buf[0] == 'q'))) {
+ /*
+ * Someone closed the write end of the pipe or sent us a
+ * Quit message [Bug: 4139] and then closed the write end
+ * of the pipe so we need to shut down the notifier thread.
+ */
+
+ break;
+ }
+ }
+ }
+
+ /*
+ * Clean up the read end of the pipe and signal any threads waiting on
+ * termination of the notifier thread.
+ */
+
+ close(receivePipe);
+ Tcl_MutexLock(&notifierMutex);
+ triggerPipe = -1;
+ Tcl_ConditionNotify(&notifierCV);
+ Tcl_MutexUnlock(&notifierMutex);
+}
+#endif
+
+EventRef
+TkMacOSXCreateFakeEvent ()
+{
+ EventKind eKind;
+ EventClass eClass;
+ EventTime eTime;
+ EventRef eventRef;
+ EventAttributes flags;
+ eClass=kEventClassWish;
+ eKind = 0xffff;
+ eTime =GetLastUserEventTime() + 0.001;
+ flags=kEventAttributeUserEvent;
+ if (CreateEvent(NULL,eClass,eKind,eTime,flags,&eventRef)!=noErr) {
+ fprintf(stderr,"CreateEvent failed\n");
+ return NULL;
+ }
+ return eventRef;
+}
diff --git a/tk/macosx/tkMacOSXPort.h b/tk/macosx/tkMacOSXPort.h
new file mode 100644
index 00000000000..70e29477d75
--- /dev/null
+++ b/tk/macosx/tkMacOSXPort.h
@@ -0,0 +1,154 @@
+/*
+ * tkMacOSXPort.h --
+ *
+ * This file is included by all of the Tk C files. It contains
+ * information that may be configuration-dependent, such as
+ * #includes for system include files and a few other things.
+ *
+ * Copyright (c) 1994-1996 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#ifndef _TKMACPORT
+#define _TKMACPORT
+
+/*
+ * Macro to use instead of "void" for arguments that must have
+ * type "void *" in ANSI C; maps them to type "char *" in
+ * non-ANSI systems. This macro may be used in some of the include
+ * files below, which is why it is defined here.
+ */
+
+#ifndef VOID
+# ifdef __STDC__
+# define VOID void
+# else
+# define VOID char
+# endif
+#endif
+
+#ifndef _TCL
+# include <tcl.h>
+#endif
+
+#include <time.h>
+#include <stdlib.h>
+#include <string.h>
+#include "tclMath.h"
+#include <ctype.h>
+#include <limits.h>
+
+#include <X11/Xlib.h>
+#include <X11/cursorfont.h>
+#include <X11/keysym.h>
+#include <X11/Xatom.h>
+#include <X11/Xfuncproto.h>
+#include <X11/Xutil.h>
+#include "tkIntXlibDecls.h"
+
+/*
+ * Not all systems declare the errno variable in errno.h. so this
+ * file does it explicitly.
+ */
+
+extern int errno;
+
+/*
+ * Define "NBBY" (number of bits per byte) if it's not already defined.
+ */
+
+#ifndef NBBY
+# define NBBY 8
+#endif
+
+/*
+ * Declarations for various library procedures that may not be declared
+ * in any other header file.
+ */
+
+#ifndef panic /* In a stubs-aware setting, this could confuse the #define */
+extern void panic _ANSI_ARGS_(TCL_VARARGS(char *, string));
+#endif
+#ifndef strcasecmp
+extern int strcasecmp _ANSI_ARGS_((CONST char *s1,
+ CONST char *s2));
+#endif
+#ifndef strncasecmp
+extern int strncasecmp _ANSI_ARGS_((CONST char *s1,
+ CONST char *s2, size_t n));
+#endif
+/*
+ * Defines for X functions that are used by Tk but are treated as
+ * no-op functions on the Macintosh.
+ */
+
+#define XFlush(display)
+#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
+#define XGrabServer(display)
+#define XNoOp(display) {display->request++;}
+#define XUngrabServer(display)
+#define XSynchronize(display, bool) {display->request++;}
+#define XSync(display, bool) {display->request++;}
+#define XVisualIDFromVisual(visual) (visual->visualid)
+
+/*
+ * The following functions are not used on the Mac, so we stub them out.
+ */
+
+#define TkFreeWindowId(dispPtr,w)
+#define TkInitXId(dispPtr)
+#define TkpButtonSetDefaults(specPtr) {}
+#define TkpCmapStressed(tkwin,colormap) (0)
+#define TkpFreeColor(tkColPtr)
+#define TkSetPixmapColormap(p,c) {}
+#define TkpSync(display)
+
+/*
+ * The following macro returns the pixel value that corresponds to the
+ * RGB values in the given XColor structure.
+ */
+
+#define PIXEL_MAGIC ((unsigned char) 0x69)
+#define TkpGetPixel(p) ((((((PIXEL_MAGIC << 8) \
+ | (((p)->red >> 8) & 0xff)) << 8) \
+ | (((p)->green >> 8) & 0xff)) << 8) \
+ | (((p)->blue >> 8) & 0xff))
+
+/*
+ * This macro stores a representation of the window handle in a string.
+ * This should perhaps use the real size of an XID.
+ */
+
+#define TkpPrintWindowId(buf,w) \
+ sprintf((buf), "0x%x", (unsigned int) (w))
+
+/*
+ * TkpScanWindowId is just an alias for Tcl_GetInt on Unix.
+ */
+
+#define TkpScanWindowId(i,s,wp) \
+ Tcl_GetInt((i),(s),(int *) (wp))
+
+/*
+ * Magic pixel values for dynamic (or active) colors.
+ */
+
+#define HIGHLIGHT_PIXEL 31
+#define HIGHLIGHT_TEXT_PIXEL 33
+#define CONTROL_TEXT_PIXEL 35
+#define CONTROL_BODY_PIXEL 37
+#define CONTROL_FRAME_PIXEL 39
+#define WINDOW_BODY_PIXEL 41
+#define MENU_ACTIVE_PIXEL 43
+#define MENU_ACTIVE_TEXT_PIXEL 45
+#define MENU_BACKGROUND_PIXEL 47
+#define MENU_DISABLED_PIXEL 49
+#define MENU_TEXT_PIXEL 51
+#define APPEARANCE_PIXEL 52
+
+#endif /* _TKMACPORT */
diff --git a/tk/macosx/tkMacOSXRegion.c b/tk/macosx/tkMacOSXRegion.c
new file mode 100644
index 00000000000..77aa9b46b93
--- /dev/null
+++ b/tk/macosx/tkMacOSXRegion.c
@@ -0,0 +1,252 @@
+/*
+ * tkMacOSXRegion.c --
+ *
+ * Implements X window calls for manipulating regions
+ *
+ * Copyright (c) 1995-1996 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include "tkMacOSXInt.h"
+#include "X11/X.h"
+#include "X11/Xlib.h"
+
+#include <Carbon/Carbon.h>
+/*
+#include <Windows.h>
+#include <QDOffscreen.h>
+*/
+
+/*
+ * Temporary region that can be reused.
+ */
+static RgnHandle tmpRgn = NULL;
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkCreateRegion --
+ *
+ * Implements the equivelent of the X window function
+ * XCreateRegion. See X window documentation for more details.
+ *
+ * Results:
+ * Returns an allocated region handle.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkRegion
+TkCreateRegion()
+{
+ RgnHandle rgn;
+ rgn = NewRgn();
+ return (TkRegion) rgn;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkDestroyRegion --
+ *
+ * Implements the equivelent of the X window function
+ * XDestroyRegion. See X window documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Memory is freed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkDestroyRegion(
+ TkRegion r)
+{
+ RgnHandle rgn = (RgnHandle) r;
+ DisposeRgn(rgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkIntersectRegion --
+ *
+ * Implements the equivilent of the X window function
+ * XIntersectRegion. See X window documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkIntersectRegion(
+ TkRegion sra,
+ TkRegion srb,
+ TkRegion dr_return)
+{
+ RgnHandle srcRgnA = (RgnHandle) sra;
+ RgnHandle srcRgnB = (RgnHandle) srb;
+ RgnHandle destRgn = (RgnHandle) dr_return;
+ SectRgn(srcRgnA, srcRgnB, destRgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkUnionRectWithRegion --
+ *
+ * Implements the equivelent of the X window function
+ * XUnionRectWithRegion. See X window documentation for more
+ * details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkUnionRectWithRegion(
+ XRectangle* rectangle,
+ TkRegion src_region,
+ TkRegion dest_region_return)
+{
+ RgnHandle srcRgn = (RgnHandle) src_region;
+ RgnHandle destRgn = (RgnHandle) dest_region_return;
+
+ if (tmpRgn == NULL) {
+ tmpRgn = NewRgn();
+ }
+ SetRectRgn(tmpRgn, rectangle->x, rectangle->y,
+ rectangle->x + rectangle->width, rectangle->y + rectangle->height);
+ UnionRgn(srcRgn, tmpRgn, destRgn);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkRectInRegion --
+ *
+ * Implements the equivelent of the X window function
+ * XRectInRegion. See X window documentation for more details.
+ *
+ * Results:
+ * Returns one of: RectangleOut, RectangleIn, RectanglePart.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkRectInRegion(
+ TkRegion region,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height)
+{
+ RgnHandle rgn = (RgnHandle) region;
+ RgnHandle rectRgn, destRgn;
+ int result;
+
+ rectRgn = NewRgn();
+ destRgn = NewRgn();
+ SetRectRgn(rectRgn, x, y, x + width, y + height);
+ SectRgn(rgn, rectRgn, destRgn);
+ if (EmptyRgn(destRgn)) {
+ result = RectangleOut;
+ } else if (EqualRgn(rgn, destRgn)) {
+ result = RectangleIn;
+ } else {
+ result = RectanglePart;
+ }
+ DisposeRgn(rectRgn);
+ DisposeRgn(destRgn);
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkClipBox --
+ *
+ * Implements the equivelent of the X window function XClipBox.
+ * See X window documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkClipBox(
+ TkRegion r,
+ XRectangle* rect_return)
+{
+ RgnHandle rgn = (RgnHandle) r;
+ Rect rect;
+
+ GetRegionBounds(rgn,&rect);
+
+ rect_return->x = rect.left;
+ rect_return->y = rect.top;
+ rect_return->width = rect.right-rect.left;
+ rect_return->height = rect.bottom-rect.top;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSubtractRegion --
+ *
+ * Implements the equivilent of the X window function
+ * XSubtractRegion. See X window documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkSubtractRegion(
+ TkRegion sra,
+ TkRegion srb,
+ TkRegion dr_return)
+{
+ RgnHandle srcRgnA = (RgnHandle) sra;
+ RgnHandle srcRgnB = (RgnHandle) srb;
+ RgnHandle destRgn = (RgnHandle) dr_return;
+
+ DiffRgn(srcRgnA, srcRgnB, destRgn);
+}
diff --git a/tk/macosx/tkMacOSXResource.r b/tk/macosx/tkMacOSXResource.r
new file mode 100644
index 00000000000..95a28d98694
--- /dev/null
+++ b/tk/macosx/tkMacOSXResource.r
@@ -0,0 +1,502 @@
+/*
+ * tkMacOSXResources.r --
+ *
+ * This file creates resources for use in a simple shell.
+ * This is designed to be an example of using the Tcl/Tk
+ * libraries in a Macintosh Application.
+ *
+ * Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center
+ * 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.
+ *
+ * RCS: @(#) $Id$
+ */
+
+/*
+ * We define SystemSevenOrLater so that our dialogs may use the
+ * auto center feature.
+ */
+#define SystemSevenOrLater 1
+
+#include <Types.r>
+#include <SysTypes.r>
+
+/*
+ * The folowing include and defines help construct
+ * the version string for Tcl.
+ */
+
+#define RESOURCE_INCLUDED
+#include "tcl.h"
+#include "tk.h"
+
+#if (TK_RELEASE_LEVEL == 0)
+# define RELEASE_LEVEL alpha
+#elif (TK_RELEASE_LEVEL == 1)
+# define RELEASE_LEVEL beta
+#elif (TK_RELEASE_LEVEL == 2)
+# define RELEASE_LEVEL final
+#endif
+
+#if (TK_RELEASE_LEVEL == 2)
+# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+#else
+# define MINOR_VERSION TK_MINOR_VERSION * 16
+#endif
+
+resource 'vers' (1) {
+ TK_MAJOR_VERSION, MINOR_VERSION,
+ RELEASE_LEVEL, 0x00, verUS,
+ TK_PATCH_LEVEL,
+ TK_PATCH_LEVEL ", by Ray Johnson & Jim Ingham " "\n" "© 1993-1997 Sun Microsystems" "\n" "© 1998-1999 Scriptics Inc."
+};
+
+resource 'vers' (2) {
+ TK_MAJOR_VERSION, MINOR_VERSION,
+ RELEASE_LEVEL, 0x00, verUS,
+ TK_PATCH_LEVEL,
+ "Wish " TK_PATCH_LEVEL " © 1993-1999"
+};
+
+
+/*
+ * The mechanisim below loads Tcl source into the resource fork of the
+ * application. The example below creates a TEXT resource named
+ * "Init" from the file "init.tcl". This allows applications to use
+ * Tcl to define the behavior of the application without having to
+ * require some predetermined file structure - all needed Tcl "files"
+ * are located within the application. To source a file for the
+ * resource fork the source command has been modified to support
+ * sourcing from resources. In the below case "source -rsrc {Init}"
+ * will load the TEXT resource named "Init".
+ */
+
+#include "tclMacTclCode.r"
+
+read 'TEXT' (10, "tk", purgeable, preload) "::library:tk.tcl";
+read 'TEXT' (11, "button", purgeable, preload) "::library:button.tcl";
+read 'TEXT' (12, "dialog", purgeable, preload) "::library:dialog.tcl";
+read 'TEXT' (13, "entry", purgeable, preload) "::library:entry.tcl";
+read 'TEXT' (14, "focus", purgeable, preload) "::library:focus.tcl";
+read 'TEXT' (15, "listbox", purgeable, preload) "::library:listbox.tcl";
+read 'TEXT' (16, "menu", purgeable, preload) "::library:menu.tcl";
+read 'TEXT' (17, "optionMenu", purgeable, preload) "::library:optMenu.tcl";
+read 'TEXT' (18, "palette", purgeable, preload) "::library:palette.tcl";
+read 'TEXT' (19, "scale", purgeable, preload) "::library:scale.tcl";
+read 'TEXT' (20, "scrollbar", purgeable, preload) "::library:scrlbar.tcl";
+read 'TEXT' (21, "tearoff", purgeable, preload) "::library:tearoff.tcl";
+read 'TEXT' (22, "text", purgeable, preload) "::library:text.tcl";
+read 'TEXT' (23, "tkerror", purgeable, preload) "::library:bgerror.tcl";
+read 'TEXT' (24, "Console", purgeable, preload) "::library:console.tcl";
+read 'TEXT' (25, "msgbox", purgeable, preload) "::library:msgbox.tcl";
+read 'TEXT' (26, "comdlg", purgeable, preload) "::library:comdlg.tcl";
+
+/*
+ * The following resource is used when creating the 'env' variable in
+ * the Macintosh environment. The creation mechanisim looks for the
+ * 'STR#' resource named "Tcl Environment Variables" rather than a
+ * specific resource number. (In other words, feel free to change the
+ * resource id if it conflicts with your application.) Each string in
+ * the resource must be of the form "KEYWORD=SOME STRING". See Tcl
+ * documentation for futher information about the env variable.
+ */
+
+/* A good example of something you may want to set is:
+ * "TCL_LIBRARY=My disk:etc."
+ */
+
+resource 'STR#' (128, "Tcl Environment Variables") {
+ { "SCHEDULE_NAME=Agent Controller Schedule",
+ "SCHEDULE_PATH=Lozoya:System Folder:Tcl Lib:Tcl-Scheduler"
+ };
+};
+
+/*
+ * The following two resources define the default "About Box" for Mac Tk.
+ * This dialog appears if the "About Tk..." menu item is selected from
+ * the Apple menu. This dialog may be overridden by defining a Tcl procedure
+ * with the name of "tkAboutDialog". If this procedure is defined the
+ * default dialog will not be shown and the Tcl procedure is expected to
+ * create and manage an About Dialog box.
+ */
+
+resource 'DLOG' (128, "Default About Box", purgeable) {
+ {85, 107, 260, 412}, dBoxProc, visible, goAway, 0,
+ 128, "", centerMainScreen
+};
+
+resource 'DITL' (128, "About Box", purgeable) {
+ {
+ {143, 147, 167, 201}, Button {enabled, "Ok"},
+ { 14, 108, 137, 314}, StaticText {disabled,
+ "Wish - Windowing Shell" "\n" "based on Tcl "
+ TCL_PATCH_LEVEL " & Tk " TK_PATCH_LEVEL "\n\n"
+ "Ray Johnson & Jim Ingham" "\n"
+ "Scriptics Inc." "\n"
+ "jim.ingham@cygnus.com"},
+ { 19, 24, 119, 92}, Picture {enabled, 128}
+ }
+};
+
+data 'PICT' (128) {
+ $"13A4 0000 0000 0064 0044 0011 02FF 0C00"
+ $"FFFE 0000 0048 0000 0048 0000 0000 0000"
+ $"0064 0044 0000 0000 0001 000A 0000 0000"
+ $"0064 0044 0099 8044 0000 0000 0064 0044"
+ $"0000 0000 0000 0000 0048 0000 0048 0000"
+ $"0000 0008 0001 0008 0000 0000 0108 00D8"
+ $"0000 0000 0001 5A5A 8000 00FF 3736 FF00"
+ $"FF00 FF00 3535 FF00 FF00 CC00 3434 FF00"
+ $"FF00 9900 3333 FF00 FF00 6600 3736 FF00"
+ $"FF00 3300 3535 FF00 FF00 0000 3434 FF00"
+ $"CC00 FF00 3333 FF00 CC00 CC00 3736 FF00"
+ $"CC00 9900 3535 FF00 CC00 6600 FAFA FF00"
+ $"CC00 3300 3333 FF00 CC00 0000 3130 FF00"
+ $"9900 FF00 2F2F FF00 9900 CC00 FAFA FF00"
+ $"9900 9900 F9F9 FF00 9900 6600 3130 FF00"
+ $"9900 3300 2F2F FF00 9900 0000 2E2E FF00"
+ $"6600 FF00 F9F9 FF00 6600 CC00 3130 FF00"
+ $"6600 9900 2F2F FF00 6600 6600 2E2E FF00"
+ $"6600 3300 2D2D FF00 6600 0000 3130 FF00"
+ $"3300 FF00 2F2F FF00 3300 CC00 2E2E FF00"
+ $"3300 9900 2D2D FF00 3300 6600 3130 FF00"
+ $"3300 3300 2F2F FF00 3300 0000 2E2E FF00"
+ $"0000 FF00 2D2D FF00 0000 CC00 3130 FF00"
+ $"0000 9900 2F2F FF00 0000 6600 2E2E FF00"
+ $"0000 3300 2DF8 FF00 0000 0000 2B2A CC00"
+ $"FF00 FF00 2929 CC00 FF00 CC00 2828 CC00"
+ $"FF00 9900 27F8 CC00 FF00 6600 2B2A CC00"
+ $"FF00 3300 2929 CC00 FF00 0000 2828 CC00"
+ $"CC00 FF00 2727 CC00 CC00 CC00 2B2A CC00"
+ $"CC00 9900 2929 CC00 CC00 6600 2828 CC00"
+ $"CC00 3300 2727 CC00 CC00 0000 2B2A CC00"
+ $"9900 FF00 2929 CC00 9900 CC00 2828 CC00"
+ $"9900 9900 2727 CC00 9900 6600 DBDB CC00"
+ $"9900 3300 4747 CC00 9900 0000 4646 CC00"
+ $"6600 FF00 4545 CC00 6600 CC00 DBDB CC00"
+ $"6600 9900 4747 CC00 6600 6600 4646 CC00"
+ $"6600 3300 4545 CC00 6600 0000 DBDB CC00"
+ $"3300 FF00 4747 CC00 3300 CC00 4646 CC00"
+ $"3300 9900 4545 CC00 3300 6600 DBDB CC00"
+ $"3300 3300 4141 CC00 3300 0000 4040 CC00"
+ $"0000 FF00 3F3F CC00 0000 CC00 4342 CC00"
+ $"0000 9900 4141 CC00 0000 6600 4040 CC00"
+ $"0000 3300 3F3F CC00 0000 0000 4342 9900"
+ $"FF00 FF00 4141 9900 FF00 CC00 4040 9900"
+ $"FF00 9900 3F3F 9900 FF00 6600 4342 9900"
+ $"FF00 3300 4141 9900 FF00 0000 4040 9900"
+ $"CC00 FF00 3F3F 9900 CC00 CC00 4342 9900"
+ $"CC00 9900 4141 9900 CC00 6600 4040 9900"
+ $"CC00 3300 3F3F 9900 CC00 0000 4342 9900"
+ $"9900 FF00 4141 9900 9900 CC00 4040 9900"
+ $"9900 9900 3F3F 9900 9900 6600 3D3C 9900"
+ $"9900 3300 3B3B 9900 9900 0000 3A3A 9900"
+ $"6600 FF00 3939 9900 6600 CC00 3D3C 9900"
+ $"6600 9900 3B3B 9900 6600 6600 3A3A 9900"
+ $"6600 3300 3939 9900 6600 0000 3D3C 9900"
+ $"3300 FF00 3B3B 9900 3300 CC00 3A3A 9900"
+ $"3300 9900 3939 9900 3300 6600 3D3C 9900"
+ $"3300 3300 3B3B 9900 3300 0000 3A3A 9900"
+ $"0000 FF00 3939 9900 0000 CC00 3D3C 9900"
+ $"0000 9900 3B3B 9900 0000 6600 3A3A 9900"
+ $"0000 3300 3939 9900 0000 0000 3D3C 6600"
+ $"FF00 FF00 3B3B 6600 FF00 CC00 3A3A 6600"
+ $"FF00 9900 3939 6600 FF00 6600 3D3C 6600"
+ $"FF00 3300 3B3B 6600 FF00 0000 3A3A 6600"
+ $"CC00 FF00 3939 6600 CC00 CC00 3736 6600"
+ $"CC00 9900 3535 6600 CC00 6600 3434 6600"
+ $"CC00 3300 3333 6600 CC00 0000 3736 6600"
+ $"9900 FF00 3535 6600 9900 CC00 3434 6600"
+ $"9900 9900 3333 6600 9900 6600 3736 6600"
+ $"9900 3300 3535 6600 9900 0000 3434 6600"
+ $"6600 FF00 3333 6600 6600 CC00 3736 6600"
+ $"6600 9900 3535 6600 6600 6600 3434 6600"
+ $"6600 3300 3333 6600 6600 0000 3736 6600"
+ $"3300 FF00 3535 6600 3300 CC00 3434 6600"
+ $"3300 9900 3333 6600 3300 6600 3736 6600"
+ $"3300 3300 3535 6600 3300 0000 3434 6600"
+ $"0000 FF00 3333 6600 0000 CC00 3130 6600"
+ $"0000 9900 2F2F 6600 0000 6600 2E2E 6600"
+ $"0000 3300 F9F9 6600 0000 0000 3130 3300"
+ $"FF00 FF00 2F2F 3300 FF00 CC00 2E2E 3300"
+ $"FF00 9900 F9F9 3300 FF00 6600 3130 3300"
+ $"FF00 3300 2F2F 3300 FF00 0000 2E2E 3300"
+ $"CC00 FF00 2D2D 3300 CC00 CC00 3130 3300"
+ $"CC00 9900 2F2F 3300 CC00 6600 2E2E 3300"
+ $"CC00 3300 2D2D 3300 CC00 0000 3130 3300"
+ $"9900 FF00 2F2F 3300 9900 CC00 2E2E 3300"
+ $"9900 9900 2D2D 3300 9900 6600 3130 3300"
+ $"9900 3300 2F2F 3300 9900 0000 2E2E 3300"
+ $"6600 FF00 2DF8 3300 6600 CC00 2B2A 3300"
+ $"6600 9900 2929 3300 6600 6600 2828 3300"
+ $"6600 3300 27F8 3300 6600 0000 2B2A 3300"
+ $"3300 FF00 2929 3300 3300 CC00 2828 3300"
+ $"3300 9900 2727 3300 3300 6600 2B2A 3300"
+ $"3300 3300 2929 3300 3300 0000 2828 3300"
+ $"0000 FF00 2727 3300 0000 CC00 2B2A 3300"
+ $"0000 9900 2929 3300 0000 6600 2828 3300"
+ $"0000 3300 2727 3300 0000 0000 4948 0000"
+ $"FF00 FF00 4747 0000 FF00 CC00 4646 0000"
+ $"FF00 9900 4545 0000 FF00 6600 4948 0000"
+ $"FF00 3300 4747 0000 FF00 0000 4646 0000"
+ $"CC00 FF00 4545 0000 CC00 CC00 4948 0000"
+ $"CC00 9900 4747 0000 CC00 6600 4646 0000"
+ $"CC00 3300 4545 0000 CC00 0000 4342 0000"
+ $"9900 FF00 4141 0000 9900 CC00 4040 0000"
+ $"9900 9900 3F3F 0000 9900 6600 4342 0000"
+ $"9900 3300 4141 0000 9900 0000 4040 0000"
+ $"6600 FF00 3F3F 0000 6600 CC00 4342 0000"
+ $"6600 9900 4141 0000 6600 6600 4040 0000"
+ $"6600 3300 3F3F 0000 6600 0000 4342 0000"
+ $"3300 FF00 4141 0000 3300 CC00 4040 0000"
+ $"3300 9900 3F3F 0000 3300 6600 4342 0000"
+ $"3300 3300 4141 0000 3300 0000 4040 0000"
+ $"0000 FF00 3F3F 0000 0000 CC00 4342 0000"
+ $"0000 9900 4141 0000 0000 6600 4040 0000"
+ $"0000 3300 3F3F EE00 0000 0000 3D3C DD00"
+ $"0000 0000 3B3B BB00 0000 0000 3A3A AA00"
+ $"0000 0000 3939 8800 0000 0000 3D3C 7700"
+ $"0000 0000 3B3B 5500 0000 0000 3A3A 4400"
+ $"0000 0000 3939 2200 0000 0000 3D3C 1100"
+ $"0000 0000 3B3B 0000 EE00 0000 3A3A 0000"
+ $"DD00 0000 3939 0000 BB00 0000 3D3C 0000"
+ $"AA00 0000 3B3B 0000 8800 0000 3A3A 0000"
+ $"7700 0000 3939 0000 5500 0000 3D3C 0000"
+ $"4400 0000 3B3B 0000 2200 0000 3A3A 0000"
+ $"1100 0000 3939 0000 0000 EE00 3D3C 0000"
+ $"0000 DD00 3B3B 0000 0000 BB00 3A3A 0000"
+ $"0000 AA00 3939 0000 0000 8800 3D3C 0000"
+ $"0000 7700 3B3B 0000 0000 5500 3A3A 0000"
+ $"0000 4400 3939 0000 0000 2200 3736 0000"
+ $"0000 1100 3535 EE00 EE00 EE00 3434 DD00"
+ $"DD00 DD00 3333 BB00 BB00 BB00 3736 AA00"
+ $"AA00 AA00 3535 8800 8800 8800 3434 7700"
+ $"7700 7700 3333 5500 5500 5500 3736 4400"
+ $"4400 4400 3535 2200 2200 2200 3434 1100"
+ $"1100 1100 3333 0000 0000 0000 0000 0000"
+ $"0064 0044 0000 0000 0064 0044 0000 000A"
+ $"0000 0000 0064 0044 02BD 0013 E800 01F5"
+ $"F6FE 07FE 0E02 3232 33FD 3900 0EE6 001D"
+ $"FC00 01F5 F5FE 0700 08FE 0E02 3232 33FE"
+ $"3900 3AFC 40F2 4102 4033 07E9 0017 0100"
+ $"0EFC 40DC 4102 390E F5F5 0002 F5F5 F6FE"
+ $"0702 0E07 0016 0100 32D5 4104 4039 0E32"
+ $"33FD 3900 3AFC 40FC 4101 3200 0801 000E"
+ $"C141 010E 0008 0100 0EC1 4101 0800 0801"
+ $"000E C141 0107 0008 0100 0EC1 4101 0700"
+ $"0901 0007 C241 0240 F500 0E01 0007 E841"
+ $"0147 47DD 4102 4000 0012 0100 07F0 4100"
+ $"47FA 4101 3B3B DD41 0240 0000 1901 0007"
+ $"F141 0C47 3B0B 3B47 4141 4711 0505 3B47"
+ $"DF41 023A 0000 1701 00F6 F041 010B 0BFE"
+ $"4105 473B 0505 113B DE41 0239 0000 1A02"
+ $"00F5 40F3 410C 473B 053B 4741 4741 0B0B"
+ $"3B47 47DE 4102 3900 0018 0200 F540 F341"
+ $"0247 110B FE41 0447 1105 4147 DC41 0233"
+ $"0000 1B02 0000 40F3 4103 4711 1147 FE41"
+ $"0205 3547 F741 FD47 E941 0232 0000 1E02"
+ $"0000 40F2 4106 113B 4741 4735 0BF7 4106"
+ $"4741 390E 0E40 47EA 4102 0E00 0021 0200"
+ $"0040 F241 0711 3B47 4141 0B35 47F9 4102"
+ $"4740 07FE 0002 F640 47EB 4102 0E00 0023"
+ $"0200 0040 F341 0847 3541 4147 3B05 4147"
+ $"FA41 0947 3AF6 00F5 4F55 F50E 47EB 4102"
+ $"0700 0022 0200 003A F341 0147 3BFE 4101"
+ $"0B0B F941 0547 3AF5 0055 C8FE CE01 5640"
+ $"EB41 0207 0000 1F02 0000 39F0 4104 4741"
+ $"053B 47FB 4104 4740 F5F5 A4FC CE01 C85D"
+ $"EB41 02F6 0000 1F02 0000 39F0 4104 473B"
+ $"0541 47FC 4104 4740 07F6 C8FA CE00 64EC"
+ $"4103 40F5 0000 1C02 0000 39F0 4102 4711"
+ $"0BFA 4103 4708 2AC8 FACE 0164 D8EC 4100"
+ $"40FE 0025 0200 0039 EF41 020B 3B47 FC41"
+ $"0347 0FF5 A4FB CE02 C887 D8FC 41FE 47FC"
+ $"4100 47F9 4100 3AFE 0028 0200 0039 EF41"
+ $"020B 3B47 FD41 0347 3900 A4FA CE00 ABFA"
+ $"4109 3B11 3B41 4147 3B0B 3B47 FA41 0039"
+ $"FE00 2402 0000 33F1 4102 4741 0BFA 4101"
+ $"0779 F9CE 0064 FA41 0235 050B FD41 010B"
+ $"0BF9 4100 39FE 0028 0200 0032 F141 0247"
+ $"3B0B FC41 0247 39F6 F9CE 0187 D8FB 4103"
+ $"4741 050B FE41 0247 110B F941 0039 FE00"
+ $"2C02 0000 32F1 4102 473B 11FB 4101 0879"
+ $"FACE 05AA 4041 4147 47FE 410A 4741 0511"
+ $"4741 4147 3511 47FA 4100 32FE 002F 0200"
+ $"000E F141 0347 3B11 47FE 4103 4740 F6C8"
+ $"FACE 0564 D841 4039 39FE 4104 473B 053B"
+ $"47FE 4102 3541 47FA 4100 0EFE 0027 0200"
+ $"000E F141 0347 3B3B 47FE 4102 470F 79FA"
+ $"CE0C 8741 4032 F500 003A 4741 473B 05F2"
+ $"4100 0EFE 0027 0200 000E F141 0347 3B3B"
+ $"47FD 4101 0EA4 FACE 01AB AAFE C808 7900"
+ $"3947 4147 110B 47F3 4100 07FE 001C 0200"
+ $"000E EA41 0240 2BC8 F5CE 0881 0033 4741"
+ $"410B 3B47 F341 0007 FE00 1A02 0000 08EB"
+ $"4102 473A 55F4 CE06 5D00 3947 4741 0BF1"
+ $"4100 F6FE 001C 0200 0007 EB41 0247 3979"
+ $"F4CE 0739 0039 4747 3511 47F3 4101 40F5"
+ $"FE00 1C02 0000 07EB 4102 4739 A4F5 CE08"
+ $"AB0E 0040 4741 1141 47F3 4100 40FD 001B"
+ $"0200 0007 EB41 0247 39A4 F5CE 0787 0707"
+ $"4147 4111 47F2 4100 40FD 001B 0200 0007"
+ $"EB41 0247 39C8 F5CE 0763 F532 4747 3B3B"
+ $"47F2 4100 3AFD 001A 0300 00F6 40EC 4102"
+ $"4739 C8F5 CE05 39F5 4047 413B F041 0039"
+ $"FD00 1C03 0000 F540 EB41 0140 C8FD CE01"
+ $"C8A4 FCCE 03AB 080E 47ED 4100 39FD 001A"
+ $"FE00 0040 EB41 0040 FCCE 01A4 C8FC CE03"
+ $"FA07 4047 ED41 0032 FD00 1AFE 0000 40EA"
+ $"4100 AAFE CE02 87F9 C8FC CE02 560F 47EC"
+ $"4100 32FD 0019 FE00 0040 EA41 00AB FECE"
+ $"0264 56C8 FDCE 01C8 32EA 4100 0EFD 001B"
+ $"FE00 0040 ED41 030E 4047 87FE CE01 4055"
+ $"FCCE 01FA 40EA 4100 08FD 001A FE00 003A"
+ $"ED41 0807 0740 FBCE CEAB 3979 FDCE 00AB"
+ $"E841 0007 FD00 1CFE 0000 3AED 4108 0700"
+ $"F6A4 CECE 8733 79FD CE02 4147 47EA 4100"
+ $"07FD 001E FE00 0039 ED41 0807 2AA4 C8CE"
+ $"CE88 0E9D FECE 0364 1C39 39EB 4101 40F5"
+ $"FD00 1CFE 0000 39ED 4101 074F FDCE 0264"
+ $"F7A4 FECE 03AB 80F6 07EB 4100 40FC 001C"
+ $"FE00 0039 ED41 0108 79FE CE03 AB40 2BA4"
+ $"FCCE 02F7 0E47 EC41 0040 FC00 1CFE 0000"
+ $"39ED 4101 0879 FECE 03AB 40F6 C8FC CE02"
+ $"F615 47EC 4100 40FC 001E FE00 003A EE41"
+ $"0247 0E79 FECE 03AB 40F5 C8FD CE03 A4F5"
+ $"3A47 EC41 0040 FC00 1EFE 0000 3AEE 4102"
+ $"470E 56FE CE03 FB3A F6C8 FDCE 0280 F540"
+ $"EB41 0140 F5FD 001E FE00 0040 EE41 0947"
+ $"0F56 CECE C888 39F6 C8FD CE02 5601 40EB"
+ $"4101 40F5 FD00 1CFE 0000 40EE 4109 4739"
+ $"32CE CEC8 8839 2AC8 FDCE 0156 07E9 4100"
+ $"F6FD 001B FE00 0040 EE41 0847 3A32 CECE"
+ $"C864 152A FCCE 0132 07E9 4100 07FD 001A"
+ $"FE00 0040 ED41 0740 32AB CEC8 6439 4EFC"
+ $"CE01 3A07 E941 0007 FD00 1D03 0000 F540"
+ $"ED41 0740 0EAB CECE 640F 4EFD CE03 AB40"
+ $"0840 EA41 0007 FD00 1B03 0000 F540 EC41"
+ $"060F 81CE CE64 334E FDCE 02AB 400E E941"
+ $"000E FD00 1C02 0000 F6EC 4107 4715 FACE"
+ $"CE64 334E FDCE 0387 0F0E 47EA 4100 0EFD"
+ $"001C 0200 0007 EC41 0747 16F9 CEC8 6433"
+ $"4EFD CE03 6308 4047 EA41 000E FD00 1A02"
+ $"0000 07EB 4106 40F9 CEC8 6439 4EFD CE02"
+ $"3940 47E9 4100 32FD 001B 0200 0007 EA41"
+ $"0539 CECE 8839 F6FE CE04 AB41 4139 40EA"
+ $"4100 32FD 001C 0200 0007 EB41 0E47 3AC8"
+ $"CE88 39F6 C8CE CE64 15F6 F540 EA41 0033"
+ $"FD00 1A02 0000 07EA 410C 40A4 CE87 392A"
+ $"C8CE AB41 40F8 F6E9 4100 39FD 001B 0200"
+ $"000E EB41 0D47 41AB C887 39F5 C8CE ABAB"
+ $"CEA4 07E9 4100 39FD 001C 0200 000E ED41"
+ $"0947 3939 4787 C8AB 40F5 C8FD CE01 A40E"
+ $"E941 0039 FD00 1D02 0000 0EED 4109 473A"
+ $"0007 80CE AB40 F5C8 FDCE 0255 0E47 EA41"
+ $"0039 FD00 1B02 0000 0EEB 4107 0779 C8CE"
+ $"CE40 F6A4 FDCE 022B 3947 EA41 003A FD00"
+ $"1C02 0000 0EEC 4102 4739 79FE CE02 6407"
+ $"A4FE CE02 A407 40E9 4100 40FD 001A 0200"
+ $"0032 EA41 0632 A4CE CE88 0879 FECE 02F9"
+ $"0F47 E941 0040 FD00 1A02 0000 32EB 4107"
+ $"4740 F7C8 CE87 0E79 FECE 0132 40E8 4100"
+ $"40FD 0019 0200 0033 EA41 0B47 40F8 C8AB"
+ $"0E55 CECE 8015 47E8 4100 40FD 0017 0200"
+ $"0033 E941 0847 40F9 A439 4FCE CE5D E641"
+ $"0140 F5FE 0014 0200 0039 E841 0647 64FB"
+ $"392B C8AB E441 00F6 FE00 1102 0000 39E5"
+ $"4103 40F6 8764 E441 0007 FE00 1E02 0000"
+ $"39EB 4102 3A0E 0EFD 4102 0740 47F6 4104"
+ $"400F 0839 47F4 4100 07FE 0027 0200 0039"
+ $"FB41 0147 47F2 4102 0800 40FE 4102 0839"
+ $"47FC 4101 4747 FC41 0339 0039 47F4 4100"
+ $"07FE 0029 0200 0039 FB41 0140 39F3 4109"
+ $"470E F540 4141 470E 3347 FC41 0139 3AFD"
+ $"4104 4739 0039 47F4 4100 08FE 0036 0200"
+ $"003A FC41 0347 0E00 40FC 4102 4741 40FC"
+ $"4109 470E F540 4141 4733 0E47 FE41 0447"
+ $"4000 0E47 FE41 0447 3900 3941 FE40 F741"
+ $"000E FE00 3A02 0000 3AFD 410E 4740 0700"
+ $"0E40 4741 4147 390E 390E 40FE 4108 470E"
+ $"F540 4141 4739 0EFC 4103 0F00 0739 FE41"
+ $"0747 3900 3940 080F 39F7 4100 0EFE 0035"
+ $"0200 0040 FB41 020E 0040 FE41 0D47 4000"
+ $"3941 0032 4741 4147 0EF5 40FE 4101 4008"
+ $"FC41 023A 000E FD41 0547 3900 3939 33F5"
+ $"4100 0EFE 0039 0200 0040 FC41 0347 0E00"
+ $"40FE 4106 4732 0040 4139 40FE 4103 470E"
+ $"F540 FD41 0108 40FE 4104 4740 000E 47FE"
+ $"4106 4739 0007 F540 47F6 4100 32FE 003A"
+ $"0200 0040 FC41 0C47 0E00 4047 4141 470E"
+ $"0040 4747 FD41 0347 0EF5 40FE 410A 470E"
+ $"3947 4141 4740 000E 47FE 4107 4739 000E"
+ $"0007 4147 F741 0032 FE00 3802 0000 40FC"
+ $"4102 470E 00FD 4106 4739 003A 4740 39FE"
+ $"4102 470E F5FD 410A 4733 3347 4141 4740"
+ $"000E 47FE 4106 4739 0039 3900 0EF6 4100"
+ $"33FE 003A 0200 F540 FC41 0447 3200 0E39"
+ $"FD41 0B0E 0E40 333A 4741 413A 07F5 39FE"
+ $"4102 473A 0EFD 410F 40F5 0733 4041 4140"
+ $"0E00 0E40 0700 0E40 F841 0039 FE00 2902"
+ $"00F5 40FA 4101 3939 FB41 023A 3A40 FD41"
+ $"FD40 FD41 0240 0E40 FD41 0240 3940 FD41"
+ $"FA40 F741 0039 FE00 2A01 00F6 F941 0147"
+ $"47FB 4101 4747 FB41 0147 47FB 4101 3940"
+ $"FD41 0147 47FB 4100 47FE 4100 47F6 4100"
+ $"39FE 000D 0100 07E1 4100 40E4 4100 3AFE"
+ $"0009 0100 07C3 4100 3AFE 0009 0100 07C3"
+ $"4100 40FE 0009 0100 07C3 4100 40FE 0009"
+ $"0100 07C3 4100 40FE 000A 0100 0EC3 4103"
+ $"40F5 0000 0901 000E C241 02F6 0000 0901"
+ $"000E C241 0207 0000 0901 000E C241 0207"
+ $"0000 1101 000E ED41 FE40 003A F940 E241"
+ $"0207 0000 2B01 0032 F941 FE40 FE39 0632"
+ $"0E0E 0707 F6F5 F800 02F5 F5F6 FB07 FB0E"
+ $"0332 3233 33FB 3901 3A3A FB40 0207 0000"
+ $"0E0A 000E 3939 320E 0E07 07F6 F5C8 0002"
+ $"BD00 00FF"
+};
+
+/*
+ * Here is the custom file open dialog. This dialog is used instead of
+ * the default file dialog if the -filetypes flag is specified.
+ */
+
+resource 'DLOG' (130, purgeable) {
+ {0, 0, 195, 344}, dBoxProc, invisible, noGoAway, 0,
+ 130, "", noAutoCenter
+};
+
+resource 'DITL' (130, "File Open Box", purgeable) {
+ {
+ {135, 252, 155, 332}, Button {enabled, "Open"},
+ {104, 252, 124, 332}, Button {enabled, "Cancel"},
+ { 0, 0, 0, 0}, HelpItem {disabled, HMScanhdlg {130}},
+ { 8, 235, 24, 337}, UserItem {enabled},
+ { 32, 252, 52, 332}, Button {enabled, "Eject"},
+ { 60, 252, 80, 332}, Button {enabled, "Desktop"},
+ { 29, 12, 159, 230}, UserItem {enabled},
+ { 6, 12, 25, 230}, UserItem {enabled},
+ { 91, 251, 92, 333}, Picture {disabled, 11},
+ {168, 20, 187, 300}, Control {enabled, 131}
+ }
+};
+
+resource 'CNTL' (131, "File Types menu", purgeable) {
+ {168, 20, 187, 300},
+ popupTitleLeftJust,
+ visible,
+ 80,
+ 132,
+ popupMenuCDEFProc,
+ 0,
+ "File Type:"
+};
+
+
+resource 'MENU' (132, preload) {
+ 132,
+ textMenuProc,
+ 0xFFFF, enabled, "", {}
+};
diff --git a/tk/macosx/tkMacOSXScale.c b/tk/macosx/tkMacOSXScale.c
new file mode 100644
index 00000000000..59ced70bcad
--- /dev/null
+++ b/tk/macosx/tkMacOSXScale.c
@@ -0,0 +1,431 @@
+/*
+ * tkMacOSXScale.c --
+ *
+ * This file implements the Macintosh specific portion of the
+ * scale widget.
+ *
+ * Copyright (c) 1996 by Sun Microsystems, Inc.
+ * Copyright (c) 1998-2000 by Scriptics Corporation.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkScale.h"
+#include "tkInt.h"
+#include <Carbon/Carbon.h>
+#include "tkMacOSXInt.h"
+
+/*
+ * Defines used in this file.
+ */
+#define slider 1110
+#define inSlider 1
+#define inInc 2
+#define inDecr 3
+
+/*
+ * Declaration of Macintosh specific scale structure.
+ */
+
+typedef struct MacScale {
+ TkScale info; /* Generic scale info. */
+ int flags; /* Flags. */
+ ControlRef scaleHandle; /* Handle to the Scale control struct. */
+} MacScale;
+
+/*
+ * Globals uses locally in this file.
+ */
+static ControlActionUPP scaleActionProc = NULL; /* Pointer to func. */
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static void MacScaleEventProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static pascal void ScaleActionProc _ANSI_ARGS_((ControlRef theControl,
+ ControlPartCode partCode));
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateScale --
+ *
+ * Allocate a new TkScale structure.
+ *
+ * Results:
+ * Returns a newly allocated TkScale structure.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkScale *
+TkpCreateScale(tkwin)
+ Tk_Window tkwin;
+{
+ MacScale *macScalePtr;
+
+ macScalePtr = (MacScale *) ckalloc(sizeof(MacScale));
+ macScalePtr->scaleHandle = NULL;
+ if (scaleActionProc == NULL) {
+ scaleActionProc = NewControlActionUPP(ScaleActionProc);
+ }
+
+ Tk_CreateEventHandler(tkwin, ButtonPressMask,
+ MacScaleEventProc, (ClientData) macScalePtr);
+
+ return (TkScale *) macScalePtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyScale --
+ *
+ * Free Macintosh specific resources.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * The slider control is destroyed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDestroyScale(scalePtr)
+ TkScale *scalePtr;
+{
+ MacScale *macScalePtr = (MacScale *) scalePtr;
+
+ /*
+ * Free Macintosh control.
+ */
+ if (macScalePtr->scaleHandle != NULL) {
+ DisposeControl(macScalePtr->scaleHandle);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDisplayScale --
+ *
+ * This procedure is invoked as an idle handler to redisplay
+ * the contents of a scale widget.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The scale gets redisplayed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDisplayScale(clientData)
+ ClientData clientData; /* Widget record for scale. */
+{
+ TkScale *scalePtr = (TkScale *) clientData;
+ Tk_Window tkwin = scalePtr->tkwin;
+ Tcl_Interp *interp = scalePtr->interp;
+ int result;
+ char string[PRINT_CHARS];
+ MacScale *macScalePtr = (MacScale *) clientData;
+ Rect r;
+ WindowRef windowRef;
+ CGrafPtr destPort;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ MacDrawable *macDraw;
+ SInt16 initialValue;
+ SInt16 minValue;
+ SInt16 maxValue;
+ SInt16 procID;
+ SInt32 controlReference;
+ Boolean initiallyVisible=true;
+
+ fprintf(stderr,"TkpDisplayScale\n");
+ scalePtr->flags &= ~REDRAW_PENDING;
+ if ((scalePtr->tkwin == NULL) || !Tk_IsMapped(scalePtr->tkwin)) {
+ goto done;
+ }
+
+ /*
+ * Invoke the scale's command if needed.
+ */
+
+ Tcl_Preserve((ClientData) scalePtr);
+ if ((scalePtr->flags & INVOKE_COMMAND) && (scalePtr->command != NULL)) {
+ Tcl_Preserve((ClientData) interp);
+ sprintf(string, scalePtr->format, scalePtr->value);
+ result = Tcl_VarEval(interp, scalePtr->command, " ", string,
+ (char *) NULL);
+ if (result != TCL_OK) {
+ Tcl_AddErrorInfo(interp, "\n (command executed by scale)");
+ Tcl_BackgroundError(interp);
+ }
+ Tcl_Release((ClientData) interp);
+ }
+ scalePtr->flags &= ~INVOKE_COMMAND;
+ if (scalePtr->flags & SCALE_DELETED) {
+ Tcl_Release((ClientData) scalePtr);
+ return;
+ }
+ Tcl_Release((ClientData) scalePtr);
+
+ /*
+ * Now handle the part of redisplay that is the same for
+ * horizontal and vertical scales: border and traversal
+ * highlight.
+ */
+
+ if (scalePtr->highlightWidth != 0) {
+ GC gc;
+
+ gc = Tk_GCForColor(scalePtr->highlightColorPtr, Tk_WindowId(tkwin));
+ Tk_DrawFocusHighlight(tkwin, gc, scalePtr->highlightWidth,
+ Tk_WindowId(tkwin));
+ }
+ Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), scalePtr->bgBorder,
+ scalePtr->highlightWidth, scalePtr->highlightWidth,
+ Tk_Width(tkwin) - 2*scalePtr->highlightWidth,
+ Tk_Height(tkwin) - 2*scalePtr->highlightWidth,
+ scalePtr->borderWidth, scalePtr->relief);
+
+ /*
+ * Set up port for drawing Macintosh control.
+ */
+ macDraw = (MacDrawable *) Tk_WindowId(tkwin);
+ destPort=TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+ windowRef=GetWindowFromPort(destPort);
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
+
+ /*
+ * Create Macintosh control.
+ */
+ if (macScalePtr->scaleHandle == NULL) {
+ fprintf(stderr,"Initialising scale\n");
+ r.left=macDraw->xOff;
+ r.top=macDraw->yOff;
+ r.right=macDraw->xOff+Tk_Width(tkwin) - scalePtr->inset;
+ r.bottom=macDraw->yOff+Tk_Height(tkwin) - scalePtr->inset;
+
+ initialValue=scalePtr->value;
+ minValue=scalePtr->toValue;
+ maxValue=scalePtr->fromValue;
+ procID=kControlSliderProc;
+ controlReference=(SInt32) macScalePtr;
+ macScalePtr->scaleHandle = NewControl(windowRef,
+ &r, "\p", initiallyVisible, initialValue,minValue,maxValue,
+ procID, controlReference);
+
+ /*
+ * If we are foremost than make us active.
+ */
+ if (windowRef==FrontWindow()) {
+ macScalePtr->flags |= ACTIVE;
+ }
+ }
+
+ /*
+ * Finally draw the control.
+ */
+ SetControlVisibility(macScalePtr->scaleHandle,true,true);
+ HiliteControl(macScalePtr->scaleHandle,0);
+ Draw1Control(macScalePtr->scaleHandle);
+
+ SetGWorld(saveWorld, saveDevice);
+done:
+ scalePtr->flags &= ~REDRAW_ALL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpScaleElement --
+ *
+ * Determine which part of a scale widget lies under a given
+ * point.
+ *
+ * Results:
+ * The return value is either TROUGH1, SLIDER, TROUGH2, or
+ * OTHER, depending on which of the scale's active elements
+ * (if any) is under the point at (x,y).
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpScaleElement(scalePtr, x, y)
+ TkScale *scalePtr; /* Widget record for scale. */
+ int x, y; /* Coordinates within scalePtr's window. */
+{
+ MacScale *macScalePtr = (MacScale *) scalePtr;
+ ControlPartCode part;
+ Point where;
+ Rect bounds;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ fprintf(stderr,"TkpScaleElement\n");
+
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(scalePtr->tkwin));
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+
+ /*
+ * All of the calculations in this procedure mirror those in
+ * DisplayScrollbar. Be sure to keep the two consistent.
+ */
+
+ TkMacOSXWinBounds((TkWindow *) scalePtr->tkwin, &bounds);
+ where.h = x + bounds.left;
+ where.v = y + bounds.top;
+ part = TestControl(macScalePtr->scaleHandle, where);
+
+ SetGWorld(saveWorld, saveDevice);
+
+ fprintf (stderr,"ScalePart %d, pos ( %d %d )\n", part, where.h, where.v );
+
+ switch (part) {
+ case inSlider:
+ return SLIDER;
+ case inInc:
+ if (scalePtr->orient == ORIENT_VERTICAL) {
+ return TROUGH1;
+ } else {
+ return TROUGH2;
+ }
+ case inDecr:
+ if (scalePtr->orient == ORIENT_VERTICAL) {
+ return TROUGH2;
+ } else {
+ return TROUGH1;
+ }
+ default:
+ return OTHER;
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * MacScaleEventProc --
+ *
+ * This procedure is invoked by the Tk dispatcher for
+ * ButtonPress events on scales.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * When the window gets deleted, internal structures get
+ * cleaned up. When it gets exposed, it is redisplayed.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+MacScaleEventProc(clientData, eventPtr)
+ ClientData clientData; /* Information about window. */
+ XEvent *eventPtr; /* Information about event. */
+{
+ MacScale *macScalePtr = (MacScale *) clientData;
+ Point where;
+ Rect bounds;
+ int part, x, y, dummy;
+ unsigned int state;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ Window dummyWin;
+
+ fprintf(stderr,"MacScaleEventProc\n" );
+ /*
+ * To call Macintosh control routines we must have the port
+ * set to the window containing the control. We will then test
+ * which part of the control was hit and act accordingly.
+ */
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(macScalePtr->info.tkwin));
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(macScalePtr->info.tkwin));
+
+ TkMacOSXWinBounds((TkWindow *) macScalePtr->info.tkwin, &bounds);
+ where.h = eventPtr->xbutton.x + bounds.left;
+ where.v = eventPtr->xbutton.y + bounds.top;
+ fprintf(stderr,"calling TestControl\n");
+ part = TestControl(macScalePtr->scaleHandle, where);
+ if (part == 0) {
+ return;
+ }
+
+ part = TrackControl(macScalePtr->scaleHandle, where, scaleActionProc);
+
+ /*
+ * Update the value for the widget.
+ */
+ macScalePtr->info.value = GetControlValue(macScalePtr->scaleHandle);
+ /* TkScaleSetValue(&macScalePtr->info, macScalePtr->info.value, 1, 0); */
+
+ /*
+ * The TrackControl call will "eat" the ButtonUp event. We now
+ * generate a ButtonUp event so Tk will unset implicit grabs etc.
+ */
+ GetMouse(&where);
+ XQueryPointer(NULL, None, &dummyWin, &dummyWin, &x,
+ &y, &dummy, &dummy, &state);
+ TkGenerateButtonEvent(x, y, Tk_WindowId(macScalePtr->info.tkwin), state);
+
+ SetGWorld(saveWorld, saveDevice);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ScaleActionProc --
+ *
+ * Callback procedure used by the Macintosh toolbox call
+ * TrackControl. This call will update the display while
+ * the scrollbar is being manipulated by the user.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May change the display.
+ *
+ *--------------------------------------------------------------
+ */
+
+static pascal void
+ScaleActionProc(ControlRef theControl, ControlPartCode partCode)
+ /* ControlRef theControl; /* Handle to scrollbat control */
+ /* ControlPartCode partCode; /* Part of scrollbar that was "hit" */
+{
+ int value;
+ TkScale *scalePtr = (TkScale *) GetControlReference(theControl);
+
+ fprintf(stderr,"ScaleActionProc\n");
+ value = GetControlValue(theControl);
+ TkScaleSetValue(scalePtr, value, 1, 1);
+ Tcl_Preserve((ClientData) scalePtr);
+ Tcl_DoOneEvent(TCL_IDLE_EVENTS);
+ Tcl_Release((ClientData) scalePtr);
+}
+
diff --git a/tk/macosx/tkMacOSXScrlbr.c b/tk/macosx/tkMacOSXScrlbr.c
new file mode 100644
index 00000000000..77241054f2f
--- /dev/null
+++ b/tk/macosx/tkMacOSXScrlbr.c
@@ -0,0 +1,1076 @@
+/*
+ * tkMacOSXScrollbar.c --
+ *
+ * This file implements the Macintosh specific portion of the scrollbar
+ * widget. The Macintosh scrollbar may also draw a windows grow
+ * region under certain cases.
+ *
+ * Copyright (c) 1996 by Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkScrollbar.h"
+#include "tkMacOSXInt.h"
+
+#include <Carbon/Carbon.h>
+
+#include "tkMacOSXDebug.h"
+/*
+ * The following definitions should really be in MacOS
+ * header files. They are included here as this is the only
+ * file that needs the declarations.
+ */
+typedef pascal void (*ThumbActionFunc)(void);
+
+typedef ThumbActionFunc ThumbActionUPP;
+
+enum {
+ uppThumbActionProcInfo = kPascalStackBased
+};
+
+#define NewThumbActionProc(userRoutine) ((ThumbActionUPP) (userRoutine))
+
+/*
+ * Minimum slider length, in pixels (designed to make sure that the slider
+ * is always easy to grab with the mouse).
+ */
+
+#define MIN_SLIDER_LENGTH 5
+#define MIN_SCROLLBAR_VALUE 0
+#define MAX_SCROLLBAR_VALUE 1000
+#define MAX_SCROLLBAR_DVALUE 1000.0
+
+/*
+ * Declaration of Windows specific scrollbar structure.
+ */
+
+typedef struct MacScrollbar {
+ TkScrollbar info; /* Generic scrollbar info */
+ ControlRef sbHandle; /* Opaque handle to the Scrollbar contol struct */
+ int macFlags; /* Various flags; see below */
+} MacScrollbar;
+
+/* Handle to the Scrollbar control structure */
+
+
+/*
+ * Flag bits for scrollbars on the Mac:
+ *
+ * ALREADY_DEAD: Non-zero means this scrollbar has been
+ * destroyed, but has not been cleaned up.
+ * IN_MODAL_LOOP: Non-zero means this scrollbar is in the middle
+ * of a modal loop.
+ * ACTIVE: Non-zero means this window is currently
+ * active (in the foreground).
+ * FLUSH_TOP: Flush with top of Mac window.
+ * FLUSH_BOTTOM: Flush with bottom of Mac window.
+ * FLUSH_RIGHT: Flush with right of Mac window.
+ * FLUSH_LEFT: Flush with left of Mac window.
+ * SCROLLBAR_GROW: Non-zero means this window draws the grow
+ * region for the toplevel window.
+ * AUTO_ADJUST: Non-zero means we automatically adjust
+ * the size of the widget to align correctly
+ * along a Mac window.
+ * DRAW_GROW: Non-zero means we draw the grow region.
+ */
+
+#define ALREADY_DEAD 1
+#define IN_MODAL_LOOP 2
+#define ACTIVE 4
+#define FLUSH_TOP 8
+#define FLUSH_BOTTOM 16
+#define FLUSH_RIGHT 32
+#define FLUSH_LEFT 64
+#define SCROLLBAR_GROW 128
+#define AUTO_ADJUST 256
+#define DRAW_GROW 512
+
+/*
+ * Globals uses locally in this file.
+ */
+static ControlActionUPP scrollActionProc = NULL; /* Pointer to func. */
+static ThumbActionUPP thumbActionProc = NULL; /* Pointer to func. */
+static TkScrollbar *activeScrollPtr = NULL; /* Non-null when in thumb */
+ /* proc. */
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static pascal void ScrollbarActionProc _ANSI_ARGS_((ControlRef theControl, ControlPartCode partCode));
+static int ScrollbarBindProc _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, XEvent *eventPtr,
+ Tk_Window tkwin, KeySym keySym));
+static void ScrollbarEventProc _ANSI_ARGS_(( ClientData clientData, XEvent *eventPtr));
+static pascal void ThumbActionProc _ANSI_ARGS_((void));
+static void UpdateControlValues _ANSI_ARGS_((MacScrollbar *macScrollPtr));
+
+/*
+ * The class procedure table for the scrollbar widget. Leave the proc fields
+ * initialized to NULL, which should happen automatically because of the scope
+ * at which the variable is declared.
+ */
+
+Tk_ClassProcs tkpScrollbarProcs = {
+ sizeof(Tk_ClassProcs) /* size */
+};
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCreateScrollbar --
+ *
+ * Allocate a new TkScrollbar structure.
+ *
+ * Results:
+ * Returns a newly allocated TkScrollbar structure.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkScrollbar *
+TkpCreateScrollbar(
+ Tk_Window tkwin) /* New Tk Window. */
+{
+ MacScrollbar * macScrollPtr;
+ TkWindow *winPtr = (TkWindow *)tkwin;
+
+ if (scrollActionProc == NULL) {
+ scrollActionProc = NewControlActionUPP (ScrollbarActionProc);
+ thumbActionProc = NewThumbActionProc(ThumbActionProc);
+ }
+
+ macScrollPtr = (MacScrollbar *) ckalloc(sizeof(MacScrollbar));
+ macScrollPtr->sbHandle = NULL;
+ macScrollPtr->macFlags = 0;
+
+ Tk_CreateEventHandler(tkwin, ActivateMask|ExposureMask|
+ StructureNotifyMask|FocusChangeMask,
+ ScrollbarEventProc, (ClientData) macScrollPtr);
+
+ if (!Tcl_GetAssocData(winPtr->mainPtr->interp, "TkScrollbar", NULL)) {
+ Tcl_SetAssocData(winPtr->mainPtr->interp, "TkScrollbar", NULL, (ClientData)1);
+ TkCreateBindingProcedure(winPtr->mainPtr->interp,
+ winPtr->mainPtr->bindingTable,
+ (ClientData)Tk_GetUid("Scrollbar"), "<ButtonPress>",
+ ScrollbarBindProc, NULL, NULL);
+ }
+ return (TkScrollbar *) macScrollPtr;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpDisplayScrollbar --
+ *
+ * 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.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkpDisplayScrollbar(
+ ClientData clientData) /* Information about window. */
+{
+ TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
+ MacScrollbar *macScrollPtr = (MacScrollbar *) clientData;
+ Tk_Window tkwin = scrollPtr->tkwin;
+
+ MacDrawable *macDraw;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ WindowRef windowRef;
+
+ if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
+ goto done;
+ }
+
+ /*
+ * Draw the focus or any 3D relief we may have.
+ */
+ if (scrollPtr->highlightWidth != 0) {
+ GC fgGC, bgGC;
+
+ bgGC = Tk_GCForColor(scrollPtr->highlightBgColorPtr,
+ Tk_WindowId(tkwin));
+
+ if (scrollPtr->flags & GOT_FOCUS) {
+ fgGC = Tk_GCForColor(scrollPtr->highlightColorPtr,
+ Tk_WindowId(tkwin));
+ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, scrollPtr->highlightWidth,
+ Tk_WindowId(tkwin));
+ } else {
+ TkpDrawHighlightBorder(tkwin, bgGC, bgGC, scrollPtr->highlightWidth,
+ Tk_WindowId(tkwin));
+ }
+ }
+ Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), scrollPtr->bgBorder,
+ scrollPtr->highlightWidth, scrollPtr->highlightWidth,
+ Tk_Width(tkwin) - 2*scrollPtr->highlightWidth,
+ Tk_Height(tkwin) - 2*scrollPtr->highlightWidth,
+ scrollPtr->borderWidth, scrollPtr->relief);
+
+ /*
+ * Set up port for drawing Macintosh control.
+ */
+ macDraw = (MacDrawable *) Tk_WindowId(tkwin);
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(tkwin));
+
+ if (macScrollPtr->sbHandle == NULL) {
+ Rect r;
+ SInt16 initialValue;
+ SInt16 minValue;
+ SInt16 maxValue;
+ SInt16 procID;
+ WindowRef frontNonFloating;
+
+ r.left = r.top = 0;
+ r.right = r.bottom = 1;
+
+ minValue = MIN_SCROLLBAR_VALUE;
+ maxValue = MAX_SCROLLBAR_VALUE;
+ initialValue = (minValue + maxValue)/2;
+ procID = kControlScrollBarLiveProc;
+
+ windowRef = GetWindowFromPort(destPort);
+ macScrollPtr->sbHandle = NewControl(windowRef, &r, "\p",
+ false, initialValue,minValue,maxValue,
+ procID, (SInt32) scrollPtr);
+
+ /*
+ * If we are foremost then make us active.
+ */
+
+ frontNonFloating = FrontNonFloatingWindow();
+
+ if ((windowRef == FrontWindow()) || TkpIsWindowFloating(windowRef)) {
+ macScrollPtr->macFlags |= ACTIVE;
+ }
+ }
+
+ /*
+ * Update the control values before we draw.
+ */
+ windowRef = GetControlOwner (macScrollPtr->sbHandle);
+ UpdateControlValues(macScrollPtr);
+
+ if (macScrollPtr->macFlags & ACTIVE) {
+ Draw1Control(macScrollPtr->sbHandle);
+ if (macScrollPtr->macFlags & DRAW_GROW) {
+ DrawGrowIcon(windowRef);
+ }
+ } else {
+ HiliteControl (macScrollPtr->sbHandle, 255 );
+ Draw1Control(macScrollPtr->sbHandle);
+ if (macScrollPtr->macFlags & DRAW_GROW) {
+ DrawGrowIcon(windowRef);
+ Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), scrollPtr->bgBorder,
+ Tk_Width(tkwin) - 13, Tk_Height(tkwin) - 13,
+ Tk_Width(tkwin), Tk_Height(tkwin),
+ 0, TK_RELIEF_FLAT);
+ }
+ }
+
+ SetGWorld(saveWorld, saveDevice);
+
+ done:
+ scrollPtr->flags &= ~REDRAW_PENDING;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpConfigureScrollbar --
+ *
+ * This procedure is called after the generic code has finished
+ * processing configuration options, in order to configure
+ * platform specific options.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpConfigureScrollbar(scrollPtr)
+ register TkScrollbar *scrollPtr; /* Information about widget; may or
+ * may not already have values for
+ * some fields. */
+{
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpComputeScrollbarGeometry --
+ *
+ * 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.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpComputeScrollbarGeometry(
+ register TkScrollbar *scrollPtr) /* Scrollbar whose geometry may
+ * have changed. */
+{
+ MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
+ int width, fieldLength, adjust = 0;
+
+ if (scrollPtr->highlightWidth < 0) {
+ scrollPtr->highlightWidth = 0;
+ }
+ scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth;
+ width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin)
+ : Tk_Height(scrollPtr->tkwin);
+ scrollPtr->arrowLength = width - 2*scrollPtr->inset + 1;
+ fieldLength = (scrollPtr->vertical ? Tk_Height(scrollPtr->tkwin)
+ : Tk_Width(scrollPtr->tkwin))
+ - 2*(scrollPtr->arrowLength + scrollPtr->inset);
+ if (fieldLength < 0) {
+ fieldLength = 0;
+ }
+ scrollPtr->sliderFirst = fieldLength*scrollPtr->firstFraction;
+ scrollPtr->sliderLast = fieldLength*scrollPtr->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).
+ */
+
+ if (scrollPtr->sliderFirst > (fieldLength - 2*scrollPtr->borderWidth)) {
+ scrollPtr->sliderFirst = fieldLength - 2*scrollPtr->borderWidth;
+ }
+ if (scrollPtr->sliderFirst < 0) {
+ scrollPtr->sliderFirst = 0;
+ }
+ if (scrollPtr->sliderLast < (scrollPtr->sliderFirst
+ + MIN_SLIDER_LENGTH)) {
+ scrollPtr->sliderLast = scrollPtr->sliderFirst + MIN_SLIDER_LENGTH;
+ }
+ if (scrollPtr->sliderLast > fieldLength) {
+ scrollPtr->sliderLast = fieldLength;
+ }
+ scrollPtr->sliderFirst += scrollPtr->arrowLength + scrollPtr->inset;
+ scrollPtr->sliderLast += scrollPtr->arrowLength + scrollPtr->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 (scrollPtr->vertical) {
+ if ((macScrollPtr->macFlags & AUTO_ADJUST) &&
+ (macScrollPtr->macFlags & (FLUSH_RIGHT|FLUSH_LEFT))) {
+ adjust--;
+ }
+ Tk_GeometryRequest(scrollPtr->tkwin,
+ scrollPtr->width + 2*scrollPtr->inset + adjust,
+ 2*(scrollPtr->arrowLength + scrollPtr->borderWidth
+ + scrollPtr->inset));
+ } else {
+ if ((macScrollPtr->macFlags & AUTO_ADJUST) &&
+ (macScrollPtr->macFlags & (FLUSH_TOP|FLUSH_BOTTOM))) {
+ adjust--;
+ }
+ Tk_GeometryRequest(scrollPtr->tkwin,
+ 2*(scrollPtr->arrowLength + scrollPtr->borderWidth
+ + scrollPtr->inset), scrollPtr->width + 2*scrollPtr->inset + adjust);
+ }
+ Tk_SetInternalBorder(scrollPtr->tkwin, scrollPtr->inset);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpDestroyScrollbar --
+ *
+ * Free data structures associated with the scrollbar control.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpDestroyScrollbar(
+ TkScrollbar *scrollPtr) /* Scrollbar to destroy. */
+{
+ MacScrollbar *macScrollPtr = (MacScrollbar *)scrollPtr;
+
+ if (macScrollPtr->sbHandle != NULL) {
+ if (!(macScrollPtr->macFlags & IN_MODAL_LOOP)) {
+ DisposeControl(macScrollPtr->sbHandle);
+ macScrollPtr->sbHandle = NULL;
+ }
+ }
+ macScrollPtr->macFlags |= ALREADY_DEAD;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkpScrollbarPosition --
+ *
+ * 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.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+TkpScrollbarPosition(
+ TkScrollbar *scrollPtr, /* Scrollbar widget record. */
+ int x, int y) /* Coordinates within scrollPtr's
+ * window. */
+{
+ MacScrollbar *macScrollPtr = (MacScrollbar *) scrollPtr;
+ GWorldPtr destPort;
+ int length, width, tmp, inactive = false;
+ ControlPartCode part;
+ Point where;
+ Rect bounds;
+ int x0, y0;
+
+ x0 = x;
+ y0 = y;
+
+ 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. On the
+ * Macintosh we use the OS call TestControl to do this mapping.
+ * For TestControl to work, the scrollbar must be active and must
+ * be in the current port.
+ */
+
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(scrollPtr->tkwin));
+ SetGWorld(destPort, NULL);
+ UpdateControlValues(macScrollPtr);
+ if ( GetControlHilite(macScrollPtr->sbHandle) == 255 ) {
+ inactive = true;
+ HiliteControl(macScrollPtr->sbHandle, 0 );
+ }
+
+ TkMacOSXWinBounds((TkWindow *) scrollPtr->tkwin, &bounds);
+ where.h = x0 + bounds.left;
+ where.v = y0 + bounds.top;
+ part = TestControl(((MacScrollbar *) scrollPtr)->sbHandle, where);
+ if (inactive) {
+ HiliteControl(macScrollPtr->sbHandle, 255 );
+ }
+ switch (part) {
+ case kControlUpButtonPart:
+ return TOP_ARROW;
+ case kControlPageUpPart:
+ return TOP_GAP;
+ case kControlIndicatorPart:
+ return SLIDER;
+ case kControlPageDownPart:
+ return BOTTOM_GAP;
+ case kControlDownButtonPart:
+ return BOTTOM_ARROW;
+ default:
+ return OUTSIDE;
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ThumbActionProc --
+ *
+ * Callback procedure used by the Macintosh toolbox call
+ * TrackControl. This call is used to track the thumb of
+ * the scrollbar. Unlike the ScrollbarActionProc function
+ * this function is called once and basically takes over
+ * tracking the scrollbar from the control. This is done
+ * to avoid conflicts with what the control plans to draw.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May change the display.
+ *
+ *--------------------------------------------------------------
+ */
+
+static pascal void
+ThumbActionProc()
+{
+ register TkScrollbar *scrollPtr = activeScrollPtr;
+ register MacScrollbar *macScrollPtr = (MacScrollbar *) activeScrollPtr;
+ Tcl_DString cmdString;
+ int origValue, trackBarPin;
+ double thumbWidth, newFirstFraction, trackBarSize;
+ char valueString[40];
+ Point currentPoint = { 0, 0 };
+ Rect trackRect;
+ Tcl_Interp *interp;
+ MouseTrackingResult trackingResult;
+ OSErr err;
+
+ if (scrollPtr == NULL) {
+ return;
+ }
+
+ Tcl_DStringInit(&cmdString);
+
+ /*
+ * First compute values that will remain constant during the tracking
+ * of the thumb. The variable trackBarSize is the length of the scrollbar
+ * minus the 2 arrows and half the width of the thumb on both sides
+ * (3 * arrowLength). The variable trackBarPin is the lower starting point
+ * of the drag region.
+ *
+ * Note: the arrowLength is equal to the thumb width of a Mac scrollbar.
+ */
+
+ origValue = GetControlValue(macScrollPtr->sbHandle);
+ GetControlBounds(macScrollPtr->sbHandle, &trackRect);
+ if (scrollPtr->vertical == true) {
+ trackBarSize = (double) (trackRect.bottom - trackRect.top
+ - (scrollPtr->arrowLength * 3));
+ trackBarPin = trackRect.top + scrollPtr->arrowLength
+ + (scrollPtr->arrowLength / 2);
+ InsetRect(&trackRect, -25, -113);
+
+ } else {
+ trackBarSize = (double) (trackRect.right - trackRect.left
+ - (scrollPtr->arrowLength * 3));
+ trackBarPin = trackRect.left + scrollPtr->arrowLength
+ + (scrollPtr->arrowLength / 2);
+ InsetRect(&trackRect, -113, -25);
+ }
+
+ /*
+ * Track the mouse while the button is held down. If the mouse is moved,
+ * we calculate the value that should be passed to the "command" part of
+ * the scrollbar.
+ */
+
+ do {
+ err = TrackMouseLocationWithOptions(NULL,
+ kTrackMouseLocationOptionDontConsumeMouseUp,
+ kEventDurationForever,
+ &currentPoint,
+ NULL,
+ &trackingResult);
+
+ if ((err==noErr)
+ && ((trackingResult == kMouseTrackingMouseDragged)
+ || (trackingResult == kMouseTrackingMouseMoved))) {
+ /*
+ * Calculating this value is a little tricky. We need to calculate a
+ * value for where the thumb would be in a Motif widget (variable
+ * thumb). This value is what the "command" expects and is what will
+ * be resent to the scrollbar to update its value.
+ */
+ thumbWidth = scrollPtr->lastFraction - scrollPtr->firstFraction;
+ if (PtInRect(currentPoint, &trackRect)) {
+ if (scrollPtr->vertical == true) {
+ newFirstFraction = (1.0 - thumbWidth) *
+ ((double) (currentPoint.v - trackBarPin) / trackBarSize);
+ } else {
+ newFirstFraction = (1.0 - thumbWidth) *
+ ((double) (currentPoint.h - trackBarPin) / trackBarSize);
+ }
+ } else {
+ newFirstFraction = ((double) origValue / MAX_SCROLLBAR_DVALUE)
+ * (1.0 - thumbWidth);
+ }
+ sprintf(valueString, "%g", newFirstFraction);
+ Tcl_DStringSetLength(&cmdString, 0);
+ Tcl_DStringAppend(&cmdString, scrollPtr->command,
+ scrollPtr->commandSize);
+ Tcl_DStringAppendElement(&cmdString, "moveto");
+ Tcl_DStringAppendElement(&cmdString, valueString);
+ interp = scrollPtr->interp;
+ Tcl_Preserve((ClientData) interp);
+ Tcl_GlobalEval(interp, cmdString.string);
+ Tcl_Release((ClientData) interp);
+ Tcl_DStringSetLength(&cmdString, 0);
+ Tcl_DStringAppend(&cmdString, "update idletasks",
+ strlen("update idletasks"));
+ Tcl_Preserve((ClientData) interp);
+ Tcl_GlobalEval(interp, cmdString.string);
+ Tcl_Release((ClientData) interp);
+ }
+ } while ((err==noErr) && trackingResult!=kMouseTrackingMouseReleased );
+
+ Tcl_DStringFree(&cmdString);
+ return;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ScrollbarActionProc --
+ *
+ * Callback procedure used by the Macintosh toolbox call
+ * TrackControl. This call will update the display while
+ * the scrollbar is being manipulated by the user.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May change the display.
+ *
+ *--------------------------------------------------------------
+ */
+
+static pascal void
+ScrollbarActionProc(
+ ControlRef theControl, /* Handle to scrollbat control */
+ ControlPartCode partCode) /* Part of scrollbar that was "hit" */
+{
+ TkScrollbar *scrollPtr = (TkScrollbar *) GetControlReference(theControl);
+ Tcl_DString cmdString;
+
+ Tcl_DStringInit(&cmdString);
+ Tcl_DStringAppend(&cmdString, scrollPtr->command,
+ scrollPtr->commandSize);
+
+ if ( partCode == kControlUpButtonPart ||
+ partCode == kControlDownButtonPart ) {
+ Tcl_DStringAppendElement(&cmdString, "scroll");
+ Tcl_DStringAppendElement(&cmdString,
+ (partCode == kControlUpButtonPart ) ? "-1" : "1");
+ Tcl_DStringAppendElement(&cmdString, "unit");
+ } else if (partCode == kControlPageUpPart || partCode == kControlPageDownPart ) {
+ Tcl_DStringAppendElement(&cmdString, "scroll");
+ Tcl_DStringAppendElement(&cmdString,
+ (partCode == kControlPageUpPart ) ? "-1" : "1");
+ Tcl_DStringAppendElement(&cmdString, "page");
+ }
+ Tcl_Preserve((ClientData) scrollPtr->interp);
+ Tcl_DStringAppend(&cmdString, "; update idletasks",
+ strlen("; update idletasks"));
+ Tcl_GlobalEval(scrollPtr->interp, cmdString.string);
+ Tcl_Release((ClientData) scrollPtr->interp);
+
+ Tcl_DStringFree(&cmdString);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ScrollbarBindProc --
+ *
+ * This procedure is invoked when the default <ButtonPress>
+ * binding on the Scrollbar bind tag fires.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The event enters a modal loop.
+ *
+ *--------------------------------------------------------------
+ */
+
+static int
+ScrollbarBindProc(
+ ClientData clientData, /* Not used. */
+ Tcl_Interp *interp, /* Interp with binding. */
+ XEvent *eventPtr, /* X event that triggered binding. */
+ Tk_Window tkwin, /* Target window for event. */
+ KeySym keySym) /* The KeySym if a key event. */
+{
+ TkWindow *winPtr = (TkWindow*)tkwin;
+ TkScrollbar *scrollPtr = (TkScrollbar *) winPtr->instanceData;
+ MacScrollbar *macScrollPtr = (MacScrollbar *) winPtr->instanceData;
+
+ Tcl_Preserve((ClientData)scrollPtr);
+ macScrollPtr->macFlags |= IN_MODAL_LOOP;
+
+ if (eventPtr->type == ButtonPress) {
+ Point where;
+ Rect bounds;
+ int part, x, y, dummy;
+ unsigned int state;
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr destPort;
+ Window window;
+
+ /*
+ * To call Macintosh control routines we must have the port
+ * set to the window containing the control. We will then test
+ * which part of the control was hit and act accordingly.
+ */
+ destPort = TkMacOSXGetDrawablePort(Tk_WindowId(scrollPtr->tkwin));
+ GetGWorld(&saveWorld, &saveDevice);
+ SetGWorld(destPort, NULL);
+ TkMacOSXSetUpClippingRgn(Tk_WindowId(scrollPtr->tkwin));
+
+ TkMacOSXWinBounds((TkWindow *) scrollPtr->tkwin, &bounds);
+ where.h = eventPtr->xbutton.x + bounds.left;
+ where.v = eventPtr->xbutton.y + bounds.top;
+ part = TestControl(macScrollPtr->sbHandle, where);
+ if (part == kControlIndicatorPart && scrollPtr->jump == false) {
+ /*
+ * Case 1: In thumb, no jump scrolling. Call track control
+ * with the thumb action proc which will do most of the work.
+ * Set the global activeScrollPtr to the current control
+ * so the callback may have access to it.
+ */
+ activeScrollPtr = scrollPtr;
+ part = TrackControl(macScrollPtr->sbHandle, where,
+ (ControlActionUPP) thumbActionProc);
+ activeScrollPtr = NULL;
+ } else if (part == kControlIndicatorPart) {
+ /*
+ * Case 2: in thumb with jump scrolling. Call TrackControl
+ * with a NULL action proc. Use the new value of the control
+ * to set update the control.
+ */
+ part = TrackControl(macScrollPtr->sbHandle, where, NULL);
+ if (part == kControlIndicatorPart) {
+ double newFirstFraction, thumbWidth;
+ Tcl_DString cmdString;
+ char valueString[TCL_DOUBLE_SPACE];
+
+ /*
+ * The following calculation takes the new control
+ * value and maps it to what Tk needs for its variable
+ * thumb size representation.
+ */
+ thumbWidth = scrollPtr->lastFraction
+ - scrollPtr->firstFraction;
+ newFirstFraction = (1.0 - thumbWidth) *
+ ((double) GetControlValue(macScrollPtr->sbHandle) / MAX_SCROLLBAR_DVALUE);
+ sprintf(valueString, "%g", newFirstFraction);
+
+ Tcl_DStringInit(&cmdString);
+ Tcl_DStringAppend(&cmdString, scrollPtr->command,
+ strlen(scrollPtr->command));
+ Tcl_DStringAppendElement(&cmdString, "moveto");
+ Tcl_DStringAppendElement(&cmdString, valueString);
+ Tcl_DStringAppend(&cmdString, "; update idletasks",
+ strlen("; update idletasks"));
+
+ interp = scrollPtr->interp;
+ Tcl_Preserve((ClientData) interp);
+ Tcl_GlobalEval(interp, cmdString.string);
+ Tcl_Release((ClientData) interp);
+ Tcl_DStringFree(&cmdString);
+ }
+ } else if (part != 0) {
+ /*
+ * Case 3: in any other part of the scrollbar. We call
+ * TrackControl with the scrollActionProc which will do
+ * most all the work.
+ */
+ TrackControl(macScrollPtr->sbHandle, where, scrollActionProc);
+ HiliteControl(macScrollPtr->sbHandle, 0);
+ }
+
+ /*
+ * The TrackControl call will "eat" the ButtonUp event. We now
+ * generate a ButtonUp event so Tk will unset implicit grabs etc.
+ */
+ GetMouse(&where);
+ XQueryPointer(NULL, None, &window, &window, &x,
+ &y, &dummy, &dummy, &state);
+ window = Tk_WindowId(scrollPtr->tkwin);
+ TkGenerateButtonEvent(x, y, window, state);
+
+ SetGWorld(saveWorld, saveDevice);
+ }
+
+ if (macScrollPtr->sbHandle && (macScrollPtr->macFlags & ALREADY_DEAD)) {
+ DisposeControl(macScrollPtr->sbHandle);
+ macScrollPtr->sbHandle = NULL;
+ }
+ macScrollPtr->macFlags &= ~IN_MODAL_LOOP;
+ Tcl_Release((ClientData)scrollPtr);
+
+ return TCL_OK;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * 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. */
+{
+ TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
+ MacScrollbar *macScrollPtr = (MacScrollbar *) clientData;
+
+ if (eventPtr->type == UnmapNotify) {
+ TkMacOSXSetScrollbarGrow((TkWindow *) scrollPtr->tkwin, false);
+ } else if (eventPtr->type == ActivateNotify) {
+ macScrollPtr->macFlags |= ACTIVE;
+ TkScrollbarEventuallyRedraw((ClientData) scrollPtr);
+ } else if (eventPtr->type == DeactivateNotify) {
+ macScrollPtr->macFlags &= ~ACTIVE;
+ TkScrollbarEventuallyRedraw((ClientData) scrollPtr);
+ } else {
+ TkScrollbarEventProc(clientData, eventPtr);
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UpdateControlValues --
+ *
+ * This procedure updates the Macintosh scrollbar control
+ * to display the values defined by the Tk scrollbar.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The Macintosh control is updated.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+UpdateControlValues(
+ MacScrollbar *macScrollPtr) /* Scrollbar data struct. */
+{
+ TkScrollbar *scrollPtr = (TkScrollbar *) macScrollPtr;
+ Tk_Window tkwin = scrollPtr->tkwin;
+ MacDrawable * macDraw = (MacDrawable *) Tk_WindowId(scrollPtr->tkwin);
+ WindowRef windowRef = GetControlOwner(macScrollPtr->sbHandle);
+ double middle;
+ SInt32 viewSize;
+ int flushRight = false;
+ int flushBottom = false;
+ Rect contrlRect, portRect;
+ UInt8 contrlHilite;
+
+ /*
+ * We can't use the Macintosh commands SizeControl and MoveControl as these
+ * calls will also cause a redraw which in our case will also cause
+ * flicker. To avoid this we adjust the control record directly. The
+ * Draw1Control command appears to just draw where ever the control says to
+ * draw so this seems right.
+ *
+ * NOTE: changing the control record directly may not work when
+ * Apple releases the Copland version of the MacOS (or when hell is cold).
+ */
+
+ contrlRect.left = macDraw->xOff + scrollPtr->inset;
+ contrlRect.top = macDraw->yOff + scrollPtr->inset;
+ contrlRect.right = macDraw->xOff + Tk_Width(tkwin) - scrollPtr->inset;
+ contrlRect.bottom = macDraw->yOff + Tk_Height(tkwin) - scrollPtr->inset;
+
+ SetControlBounds(macScrollPtr->sbHandle, &contrlRect );
+
+ /*
+ * To make Tk applications look more like Macintosh applications without
+ * requiring additional work by the Tk developer we do some cute tricks.
+ * The first trick plays with the size of the widget to get it to overlap
+ * with the side of the window by one pixel (we don't do this if the placer
+ * is the geometry manager). The second trick shrinks the scrollbar if it
+ * it covers the area of the grow region ao the scrollbar can also draw
+ * the grow region if need be.
+ */
+ if (!strcmp(macDraw->winPtr->geomMgrPtr->name, "place")) {
+ macScrollPtr->macFlags &= AUTO_ADJUST;
+ } else {
+ macScrollPtr->macFlags |= AUTO_ADJUST;
+ }
+ GetPortBounds ( GetWindowPort ( windowRef ), &portRect );
+ if ( portRect.left == contrlRect.left ) {
+ if (macScrollPtr->macFlags & AUTO_ADJUST) {
+ contrlRect.left--;
+ SetControlBounds ( macScrollPtr->sbHandle, &contrlRect );
+ }
+ if (!(macScrollPtr->macFlags & FLUSH_LEFT)) {
+ macScrollPtr->macFlags |= FLUSH_LEFT;
+ if (scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+ } else if (macScrollPtr->macFlags & FLUSH_LEFT) {
+ macScrollPtr->macFlags &= ~FLUSH_LEFT;
+ if (scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+
+ if (portRect.top == contrlRect.top) {
+ if (macScrollPtr->macFlags & AUTO_ADJUST) {
+ contrlRect.top--;
+ }
+ if (!(macScrollPtr->macFlags & FLUSH_TOP)) {
+ macScrollPtr->macFlags |= FLUSH_TOP;
+ if (! scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+ } else if (macScrollPtr->macFlags & FLUSH_TOP) {
+ macScrollPtr->macFlags &= ~FLUSH_TOP;
+ if (! scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+
+ if (portRect.right == contrlRect.right) {
+ flushRight = true;
+ if (macScrollPtr->macFlags & AUTO_ADJUST) {
+ contrlRect.right++;
+ }
+ if (!(macScrollPtr->macFlags & FLUSH_RIGHT)) {
+ macScrollPtr->macFlags |= FLUSH_RIGHT;
+ if (scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+ } else if (macScrollPtr->macFlags & FLUSH_RIGHT) {
+ macScrollPtr->macFlags &= ~FLUSH_RIGHT;
+ if (scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+
+ if (portRect.bottom == contrlRect.bottom) {
+ flushBottom = true;
+ if (macScrollPtr->macFlags & AUTO_ADJUST) {
+ contrlRect.bottom++;
+ }
+ if (!(macScrollPtr->macFlags & FLUSH_BOTTOM)) {
+ macScrollPtr->macFlags |= FLUSH_BOTTOM;
+ if (! scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+ } else if (macScrollPtr->macFlags & FLUSH_BOTTOM) {
+ macScrollPtr->macFlags &= ~FLUSH_BOTTOM;
+ if (! scrollPtr->vertical) {
+ TkpComputeScrollbarGeometry(scrollPtr);
+ }
+ }
+
+ /*
+ * If the scrollbar is flush against the bottom right hand corner then
+ * it may need to draw the grow region for the window so we let the
+ * wm code know about this scrollbar. We don't actually draw the grow
+ * region, however, unless we are currently resizable.
+ */
+ macScrollPtr->macFlags &= ~DRAW_GROW;
+ if (flushBottom && flushRight) {
+ TkMacOSXSetScrollbarGrow((TkWindow *) tkwin, true);
+ if (TkMacOSXResizable(macDraw->toplevel->winPtr)) {
+ if (scrollPtr->vertical) {
+ contrlRect.bottom -= 14;
+ } else {
+ contrlRect.right -= 14;
+ }
+ macScrollPtr->macFlags |= DRAW_GROW;
+ }
+ } else {
+ TkMacOSXSetScrollbarGrow((TkWindow *) tkwin, false);
+ }
+
+ /*
+ * Given the Tk parameters for the fractions of the start and
+ * end of the thumb, the following calculation determines the
+ * location for the fixed sized Macintosh thumb.
+ */
+ middle = scrollPtr->firstFraction / (scrollPtr->firstFraction +
+ (1.0 - scrollPtr->lastFraction));
+ viewSize = (SInt32)((scrollPtr->lastFraction-scrollPtr->firstFraction)
+ * MAX_SCROLLBAR_DVALUE);
+ SetControlViewSize(macScrollPtr->sbHandle,viewSize);
+ SetControlValue(macScrollPtr->sbHandle,
+ (short) (middle * MAX_SCROLLBAR_VALUE) );
+ contrlHilite=GetControlHilite(macScrollPtr->sbHandle);
+ if ( contrlHilite == 0 || contrlHilite == 255) {
+ if (scrollPtr->firstFraction == 0.0 &&
+ scrollPtr->lastFraction == 1.0) {
+ HiliteControl(macScrollPtr->sbHandle,255);
+ } else {
+ HiliteControl(macScrollPtr->sbHandle,0);
+ }
+ }
+ if ( !IsControlVisible (macScrollPtr -> sbHandle) ) {
+ SetControlVisibility(macScrollPtr->sbHandle,TRUE,FALSE);
+ }
+}
diff --git a/tk/macosx/tkMacOSXSend.c b/tk/macosx/tkMacOSXSend.c
new file mode 100644
index 00000000000..8b0489906fc
--- /dev/null
+++ b/tk/macosx/tkMacOSXSend.c
@@ -0,0 +1,552 @@
+/*
+ * tkMacOSXSend.c --
+ *
+ * This file provides procedures that implement the "send"
+ * command, allowing commands to be passed from interpreter
+ * to interpreter. This current implementation for the Mac
+ * has most functionality stubed out.
+ *
+ * The current plan, which we have not had time to implement, is
+ * for the first Wish app to create a gestalt of type 'WIsH'.
+ * This gestalt will point to a table, in system memory, of
+ * Tk apps. Each Tk app, when it starts up, will register their
+ * name, and process ID, in this table. This will allow us to
+ * implement "tk appname".
+ *
+ * Then the send command will look up the process id of the target
+ * app in this table, and send an AppleEvent to that process. The
+ * AppleEvent handler is much like the do script handler, except that
+ * you have to specify the name of the tk app as well, since there may
+ * be many interps in one wish app, and you need to send it to the
+ * right one.
+ *
+ * Implementing this has been on our list of things to do, but what
+ * with the demise of Tcl at Sun, and the lack of resources at
+ * Scriptics it may not get done for awhile. So this sketch is
+ * offered for the brave to attempt if they need the functionality...
+ *
+ * Copyright (c) 1989-1994 The Regents of the University of California.
+ * Copyright (c) 1994-1998 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include <Carbon/Carbon.h>
+/*
+#include <Gestalt.h>
+*/
+#include "tkPort.h"
+#include "tkInt.h"
+
+EXTERN int Tk_SendObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]));
+
+ /*
+ * The following structure is used to keep track of the
+ * interpreters registered by this process.
+ */
+
+typedef struct RegisteredInterp {
+ char *name; /* Interpreter's name (malloc-ed). */
+ Tcl_Interp *interp; /* Interpreter associated with
+ * name. */
+ struct RegisteredInterp *nextPtr;
+ /* Next in list of names associated
+ * with interps in this process.
+ * NULL means end of list. */
+} RegisteredInterp;
+
+/*
+ * A registry of all interpreters for a display is kept in a
+ * property "InterpRegistry" on the root window of the display.
+ * It is organized as a series of zero or more concatenated strings
+ * (in no particular order), each of the form
+ * window space name '\0'
+ * where "window" is the hex id of the comm. window to use to talk
+ * to an interpreter named "name".
+ *
+ * When the registry is being manipulated by an application (e.g. to
+ * add or remove an entry), it is loaded into memory using a structure
+ * of the following type:
+ */
+
+typedef struct NameRegistry {
+ TkDisplay *dispPtr; /* Display from which the registry was
+ * read. */
+ int locked; /* Non-zero means that the display was
+ * locked when the property was read in. */
+ int modified; /* Non-zero means that the property has
+ * been modified, so it needs to be written
+ * out when the NameRegistry is closed. */
+ unsigned long propLength; /* Length of the property, in bytes. */
+ char *property; /* The contents of the property, or NULL
+ * if none. See format description above;
+ * this is *not* terminated by the first
+ * null character. Dynamically allocated. */
+ int allocedByX; /* Non-zero means must free property with
+ * XFree; zero means use ckfree. */
+} NameRegistry;
+
+static int initialized = false; /* A flag to denote if we have initialized yet. */
+
+static RegisteredInterp *interpListPtr = NULL;
+/* List of all interpreters
+ * registered by this process. */
+
+ /*
+ * The information below is used for communication between processes
+ * during "send" commands. Each process keeps a private window, never
+ * even mapped, with one property, "Comm". When a command is sent to
+ * an interpreter, the command is appended to the comm property of the
+ * communication window associated with the interp's process. Similarly,
+ * when a result is returned from a sent command, it is also appended
+ * to the comm property.
+ *
+ * Each command and each result takes the form of ASCII text. For a
+ * command, the text consists of a zero character followed by several
+ * null-terminated ASCII strings. The first string consists of the
+ * single letter "c". Subsequent strings have the form "option value"
+ * where the following options are supported:
+ *
+ * -r commWindow serial
+ *
+ * This option means that a response should be sent to the window
+ * whose X identifier is "commWindow" (in hex), and the response should
+ * be identified with the serial number given by "serial" (in decimal).
+ * If this option isn't specified then the send is asynchronous and
+ * no response is sent.
+ *
+ * -n name
+ * "Name" gives the name of the application for which the command is
+ * intended. This option must be present.
+ *
+ * -s script
+ *
+ * "Script" is the script to be executed. This option must be present.
+ *
+ * The options may appear in any order. The -n and -s options must be
+ * present, but -r may be omitted for asynchronous RPCs. For compatibility
+ * with future releases that may add new features, there may be additional
+ * options present; as long as they start with a "-" character, they will
+ * be ignored.
+ *
+ * A result also consists of a zero character followed by several null-
+ * terminated ASCII strings. The first string consists of the single
+ * letter "r". Subsequent strings have the form "option value" where
+ * the following options are supported:
+ *
+ * -s serial
+ *
+ * Identifies the command for which this is the result. It is the
+ * same as the "serial" field from the -s option in the command. This
+ * option must be present.
+ *
+ * -c code
+ *
+ * "Code" is the completion code for the script, in decimal. If the
+ * code is omitted it defaults to TCL_OK.
+ *
+ * -r result
+ *
+ * "Result" is the result string for the script, which may be either
+ * a result or an error message. If this field is omitted then it
+ * defaults to an empty string.
+ *
+ * -i errorInfo
+ *
+ * "ErrorInfo" gives a string with which to initialize the errorInfo
+ * variable. This option may be omitted; it is ignored unless the
+ * completion code is TCL_ERROR.
+ *
+ * -e errorCode
+ *
+ * "ErrorCode" gives a string with with to initialize the errorCode
+ * variable. This option may be omitted; it is ignored unless the
+ * completion code is TCL_ERROR.
+ *
+ * Options may appear in any order, and only the -s option must be
+ * present. As with commands, there may be additional options besides
+ * these; unknown options are ignored.
+ */
+
+ /*
+ * The following variable is the serial number that was used in the
+ * last "send" command. It is exported only for testing purposes.
+ */
+
+int tkSendSerial = 0;
+
+ /*
+ * Maximum size property that can be read at one time by
+ * this module:
+ */
+
+#define MAX_PROP_WORDS 100000
+
+/*
+ * Forward declarations for procedures defined later in this file:
+ */
+
+static int SendInit _ANSI_ARGS_((Tcl_Interp *interp));
+/*
+static int AppendErrorProc _ANSI_ARGS_((ClientData clientData,
+ XErrorEvent *errorPtr));
+static void DeleteProc _ANSI_ARGS_((ClientData clientData));
+static void RegAddName _ANSI_ARGS_((NameRegistry *regPtr,
+ char *name, Window commWindow));
+static void RegClose _ANSI_ARGS_((NameRegistry *regPtr));
+static void RegDeleteName _ANSI_ARGS_((NameRegistry *regPtr,
+ char *name));
+static Window RegFindName _ANSI_ARGS_((NameRegistry *regPtr,
+ char *name));
+static NameRegistry * RegOpen _ANSI_ARGS_((Tcl_Interp *interp,
+ TkWindow *winPtr, int lock));
+static void SendEventProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static Bool SendRestrictProc _ANSI_ARGS_((Display *display,
+ XEvent *eventPtr, char *arg));
+static int ServerSecure _ANSI_ARGS_((TkDisplay *dispPtr));
+static void TimeoutProc _ANSI_ARGS_((ClientData clientData));
+static int ValidateName _ANSI_ARGS_((TkDisplay *dispPtr,
+ char *name, Window commWindow, int oldOK));
+*/
+
+/*
+ *--------------------------------------------------------------
+ *
+ * Tk_SetAppName --
+ *
+ * This procedure is called to associate an ASCII name with a Tk
+ * application. If the application has already been named, the
+ * name replaces the old one.
+ *
+ * Results:
+ * The return value is the name actually given to the application.
+ * This will normally be the same as name, but if name was already
+ * in use for an application 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.
+ *
+ *--------------------------------------------------------------
+ */
+
+CONST char *
+Tk_SetAppName(
+ Tk_Window tkwin, /* Token for any window in the application
+ * to be named: it is just used to identify
+ * the application and the display. */
+ CONST char *name) /* The name that will be used to
+ * refer to the interpreter in later
+ * "send" commands. Must be globally
+ * unique. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ Tcl_Interp *interp = winPtr->mainPtr->interp;
+ int i, suffix, offset, result;
+ RegisteredInterp *riPtr, *prevPtr;
+ CONST char *actualName;
+ Tcl_DString dString;
+ Tcl_Obj *resultObjPtr, *interpNamePtr;
+ char *interpName;
+
+ if (!initialized) {
+ SendInit(interp);
+ }
+
+ /*
+ * 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 = interpListPtr, prevPtr = NULL; riPtr != NULL;
+ prevPtr = riPtr, riPtr = riPtr->nextPtr) {
+ if (riPtr->interp == interp) {
+ if (prevPtr == NULL) {
+ interpListPtr = interpListPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = riPtr->nextPtr;
+ }
+ break;
+ }
+ }
+
+ /*
+ * 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.
+ */
+
+ actualName = name;
+ suffix = 1;
+ offset = 0;
+ Tcl_DStringInit(&dString);
+
+ TkGetInterpNames(interp, tkwin);
+ resultObjPtr = Tcl_GetObjResult(interp);
+ Tcl_IncrRefCount(resultObjPtr);
+ for (i = 0; ; ) {
+ result = Tcl_ListObjIndex(NULL, resultObjPtr, i, &interpNamePtr);
+ if (interpNamePtr == NULL) {
+ break;
+ }
+ interpName = Tcl_GetStringFromObj(interpNamePtr, NULL);
+ if (strcmp(actualName, interpName) == 0) {
+ if (suffix == 1) {
+ Tcl_DStringAppend(&dString, name, -1);
+ Tcl_DStringAppend(&dString, " #", 2);
+ offset = Tcl_DStringLength(&dString);
+ Tcl_DStringSetLength(&dString, offset + 10);
+ actualName = Tcl_DStringValue(&dString);
+ }
+ suffix++;
+ sprintf(Tcl_DStringValue(&dString) + offset, "%d", suffix);
+ i = 0;
+ } else {
+ i++;
+ }
+ }
+
+ Tcl_DecrRefCount(resultObjPtr);
+ Tcl_ResetResult(interp);
+
+ /*
+ * We have found a unique name. Now add it to the registry.
+ */
+
+ riPtr = (RegisteredInterp *) ckalloc(sizeof(RegisteredInterp));
+ riPtr->interp = interp;
+ riPtr->name = ckalloc(strlen(actualName) + 1);
+ riPtr->nextPtr = interpListPtr;
+ interpListPtr = riPtr;
+ strcpy(riPtr->name, actualName);
+
+ Tcl_CreateObjCommand(interp, "send", Tk_SendObjCmd,
+ (ClientData) riPtr, NULL /* TODO: DeleteProc */);
+ if (Tcl_IsSafe(interp)) {
+ Tcl_HideCommand(interp, "send", "send");
+ }
+ Tcl_DStringFree(&dString);
+
+ return riPtr->name;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * Tk_SendObjCmd --
+ *
+ * This procedure is invoked to process the "send" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *--------------------------------------------------------------
+ */
+
+int
+Tk_SendObjCmd(
+ 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 */
+{
+ CONST char *sendOptions[] = {"-async", "-displayof", "-", (char *) NULL};
+ char *stringRep, *destName;
+ int async = 0;
+ int i, index, firstArg;
+ RegisteredInterp *riPtr;
+ Tcl_Obj *resultPtr, *listObjPtr;
+ int result = TCL_OK;
+
+ for (i = 1; i < (objc - 1); ) {
+ stringRep = Tcl_GetStringFromObj(objv[i], NULL);
+ if (stringRep[0] == '-') {
+ if (Tcl_GetIndexFromObj(interp, objv[i], sendOptions, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == 0) {
+ async = 1;
+ i++;
+ } else if (index == 1) {
+ i += 2;
+ } else {
+ i++;
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (objc < (i + 2)) {
+ Tcl_WrongNumArgs(interp, 1, objv,
+ "?options? interpName arg ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ destName = Tcl_GetStringFromObj(objv[i], NULL);
+ firstArg = i + 1;
+
+ resultPtr = Tcl_GetObjResult(interp);
+
+ /*
+ * See if the target interpreter is local. If so, execute
+ * the command directly without going through the DDE server.
+ * The only tricky thing is passing the result from the target
+ * interpreter to the invoking interpreter. Watch out: they
+ * could be the same!
+ */
+
+ for (riPtr = interpListPtr; (riPtr != NULL)
+ && (strcmp(destName, riPtr->name)); riPtr = riPtr->nextPtr) {
+ /*
+ * Empty loop body.
+ */
+
+ }
+
+ if (riPtr != NULL) {
+ /*
+ * This command is to a local interp. No need to go through
+ * the server.
+ */
+
+ Tcl_Interp *localInterp;
+
+ Tcl_Preserve((ClientData) riPtr);
+ localInterp = riPtr->interp;
+ Tcl_Preserve((ClientData) localInterp);
+ if (firstArg == (objc - 1)) {
+ /*
+ * This might be one of those cases where the new
+ * parser is faster.
+ */
+
+ result = Tcl_EvalObjEx(localInterp, objv[firstArg], TCL_EVAL_DIRECT);
+ } else {
+ listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
+ for (i = firstArg; i < objc; i++) {
+ Tcl_ListObjAppendList(interp, listObjPtr, objv[i]);
+ }
+ Tcl_IncrRefCount(listObjPtr);
+ result = Tcl_EvalObjEx(localInterp, listObjPtr, TCL_EVAL_DIRECT);
+ Tcl_DecrRefCount(listObjPtr);
+ }
+ if (interp != localInterp) {
+ if (result == TCL_ERROR) {
+ /* Tcl_Obj *errorObjPtr; */
+
+ /*
+ * An error occurred, so transfer error information from the
+ * destination interpreter back to our interpreter. Must clear
+ * interp's result before calling Tcl_AddErrorInfo, since
+ * Tcl_AddErrorInfo will store the interp's result in errorInfo
+ * before appending riPtr's $errorInfo; we've already got
+ * everything we need in riPtr's $errorInfo.
+ */
+
+ Tcl_ResetResult(interp);
+ Tcl_AddErrorInfo(interp, Tcl_GetVar2(localInterp,
+ "errorInfo", (char *) NULL, TCL_GLOBAL_ONLY));
+ /* errorObjPtr = Tcl_GetObjVar2(localInterp, "errorCode", NULL,
+ TCL_GLOBAL_ONLY);
+ Tcl_SetObjErrorCode(interp, errorObjPtr); */
+ }
+ Tcl_SetObjResult(interp, Tcl_GetObjResult(localInterp));
+ }
+ Tcl_Release((ClientData) riPtr);
+ Tcl_Release((ClientData) localInterp);
+ } else {
+ /*
+ * This is a non-local request. Send the script to the server and poll
+ * it for a result. TODO!!!
+ */
+ }
+
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGetInterpNames --
+ *
+ * This procedure is invoked to fetch a list of all the
+ * interpreter names currently registered for the display
+ * of a particular window.
+ *
+ * Results:
+ * A standard Tcl return value. Interp->result will be set
+ * to hold a list of all the interpreter names defined for
+ * tkwin's display. If an error occurs, then TCL_ERROR
+ * is returned and interp->result will hold an error message.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkGetInterpNames(
+ Tcl_Interp *interp, /* Interpreter for returning a result. */
+ Tk_Window tkwin) /* Window whose display is to be used
+ * for the lookup. */
+{
+ Tcl_Obj *listObjPtr;
+ RegisteredInterp *riPtr;
+
+ listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL);
+ riPtr = interpListPtr;
+ while (riPtr != NULL) {
+ Tcl_ListObjAppendElement(interp, listObjPtr,
+ Tcl_NewStringObj(riPtr->name, -1));
+ riPtr = riPtr->nextPtr;
+ }
+
+ Tcl_SetObjResult(interp, listObjPtr);
+ return TCL_OK;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * SendInit --
+ *
+ * This procedure is called to initialize the
+ * communication channels for sending commands and
+ * receiving results.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Sets up various data structures and windows.
+ *
+ *--------------------------------------------------------------
+ */
+
+static int
+SendInit(
+ Tcl_Interp *interp) /* Interpreter to use for error reporting
+ * (no errors are ever returned, but the
+ * interpreter is needed anyway). */
+{
+ return TCL_OK;
+}
diff --git a/tk/macosx/tkMacOSXSubwindows.c b/tk/macosx/tkMacOSXSubwindows.c
new file mode 100644
index 00000000000..c5886da963b
--- /dev/null
+++ b/tk/macosx/tkMacOSXSubwindows.c
@@ -0,0 +1,1304 @@
+/*
+ * tkMacOSXSubwindows.c --
+ *
+ * Implements subwindows for the macintosh version of Tk.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include "X11/X.h"
+#include "X11/Xlib.h"
+#include <stdio.h>
+
+#include <Carbon/Carbon.h>
+#include "tkMacOSXInt.h"
+#include "tkMacOSXDebug.h"
+
+/*
+ * Temporary region that can be reused.
+ */
+static RgnHandle tmpRgn = NULL;
+
+static void UpdateOffsets _ANSI_ARGS_((TkWindow *winPtr, int deltaX, int deltaY));
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XDestroyWindow --
+ *
+ * Dealocates the given X Window.
+ *
+ * Results:
+ * The window id is returned.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XDestroyWindow(
+ Display* display, /* Display. */
+ Window window) /* Window. */
+{
+ MacDrawable *macWin = (MacDrawable *) window;
+ CGrafPtr destPort;
+ /*
+ * Remove any dangling pointers that may exist if
+ * the window we are deleting is being tracked by
+ * the grab code.
+ */
+
+ TkPointerDeadWindow(macWin->winPtr);
+ macWin->toplevel->referenceCount--;
+
+
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ DisposeRgn(macWin->clipRgn);
+ DisposeRgn(macWin->aboveClipRgn);
+
+ /*
+ * Delete the Mac window and remove it from the windowTable.
+ * The window could be NULL if the window was never mapped.
+ * However, we don't do this for embedded windows, they don't
+ * go in the window list, and they do not own their portPtr's.
+ */
+
+ if (!(Tk_IsEmbedded(macWin->winPtr))) {
+ destPort = TkMacOSXGetDrawablePort(window);
+ if (destPort != NULL) {
+ TkMacOSXWindowList *listPtr, *prevPtr;
+ WindowRef winRef;
+ winRef = GetWindowFromPort(destPort);
+ TkMacOSXUnregisterMacWindow(winRef);
+ DisposeWindow(winRef);
+
+ for (listPtr = tkMacOSXWindowListPtr, prevPtr = NULL;
+ tkMacOSXWindowListPtr != NULL;
+ prevPtr = listPtr, listPtr = listPtr->nextPtr) {
+ if (listPtr->winPtr == macWin->winPtr) {
+ if (prevPtr == NULL) {
+ tkMacOSXWindowListPtr = listPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = listPtr->nextPtr;
+ }
+ ckfree((char *) listPtr);
+ break;
+ }
+ }
+ }
+ }
+
+ macWin->grafPtr = NULL;
+
+ /*
+ * Delay deletion of a toplevel data structure untill all
+ * children have been deleted.
+ */
+ if (macWin->toplevel->referenceCount == 0) {
+ ckfree((char *) macWin->toplevel);
+ }
+ } else {
+ CGrafPtr destPort;
+ destPort = TkMacOSXGetDrawablePort(window);
+ if (destPort != NULL) {
+ SetGWorld(destPort, NULL);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+ }
+ if (macWin->winPtr->parentPtr != NULL) {
+ TkMacOSXInvalClipRgns(macWin->winPtr->parentPtr);
+ }
+ DisposeRgn(macWin->clipRgn);
+ DisposeRgn(macWin->aboveClipRgn);
+
+ if (macWin->toplevel->referenceCount == 0) {
+ ckfree((char *) macWin->toplevel);
+ }
+ ckfree((char *) macWin);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XMapWindow --
+ *
+ * Map the given X Window to the screen. See X window documentation
+ * for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The subwindow or toplevel may appear on the screen.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XMapWindow(
+ Display* display, /* Display. */
+ Window window) /* Window. */
+{
+ MacDrawable *macWin = (MacDrawable *) window;
+ XEvent event;
+ CGrafPtr destPort;
+
+ /*
+ * Under certain situations it's possible for this function to be
+ * called before the toplevel window it's associated with has actually
+ * been mapped. In that case we need to create the real Macintosh
+ * window now as this function as well as other X functions assume that
+ * the portPtr is valid.
+ */
+ if (!TkMacOSXHostToplevelExists(macWin->toplevel->winPtr)) {
+ TkMacOSXMakeRealWindowExist(macWin->toplevel->winPtr);
+ }
+ destPort = TkMacOSXGetDrawablePort (window);
+
+ display->request++;
+ macWin->winPtr->flags |= TK_MAPPED;
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ if (!Tk_IsEmbedded(macWin->winPtr)) {
+ ShowWindow(GetWindowFromPort(destPort));
+ }
+
+ /*
+ * We only need to send the MapNotify event
+ * for toplevel windows.
+ */
+ event.xany.serial = display->request;
+ event.xany.send_event = False;
+ event.xany.display = display;
+
+ event.xmap.window = window;
+ event.xmap.type = MapNotify;
+ event.xmap.event = window;
+ event.xmap.override_redirect = macWin->winPtr->atts.override_redirect;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ } else {
+ TkMacOSXInvalClipRgns(macWin->winPtr->parentPtr);
+ }
+
+ /*
+ * Generate damage for that area of the window
+ */
+ SetGWorld (destPort, NULL);
+ TkMacOSXUpdateClipRgn(macWin->winPtr);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XUnmapWindow --
+ *
+ * Unmap the given X Window to the screen. See X window
+ * documentation for more details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The subwindow or toplevel may be removed from the screen.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XUnmapWindow(
+ Display* display, /* Display. */
+ Window window) /* Window. */
+{
+ MacDrawable *macWin = (MacDrawable *) window;
+ XEvent event;
+ CGrafPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(window);
+
+ display->request++;
+ macWin->winPtr->flags &= ~TK_MAPPED;
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ if (!Tk_IsEmbedded(macWin->winPtr)) {
+ HideWindow(GetWindowFromPort(destPort));
+ }
+
+ /*
+ * We only need to send the UnmapNotify event
+ * for toplevel windows.
+ */
+ event.xany.serial = display->request;
+ event.xany.send_event = False;
+ event.xany.display = display;
+
+ event.xunmap.type = UnmapNotify;
+ event.xunmap.window = window;
+ event.xunmap.event = window;
+ event.xunmap.from_configure = false;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ } else {
+ /*
+ * Generate damage for that area of the window.
+ */
+ SetGWorld(destPort, NULL);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW); /* TODO: may not be valid */
+ TkMacOSXInvalClipRgns(macWin->winPtr->parentPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XResizeWindow --
+ *
+ * Resize a given X window. See X windows documentation for
+ * further details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XResizeWindow(
+ Display* display, /* Display. */
+ Window window, /* Window. */
+ unsigned int width,
+ unsigned int height)
+{
+ MacDrawable *macWin = (MacDrawable *) window;
+ CGrafPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(window);
+ if (destPort == NULL) {
+ return;
+ }
+
+ display->request++;
+ SetPort( destPort);
+ if (Tk_IsTopLevel(macWin->winPtr)) {
+ if (!Tk_IsEmbedded(macWin->winPtr)) {
+ /*
+ * NOTE: we are not adding the new space to the update
+ * region. It is currently assumed that Tk will need
+ * to completely redraw anway.
+ */
+ SizeWindow(GetWindowFromPort(destPort),
+ (short) width, (short) height, false);
+ TkMacOSXInvalidateWindow(macWin, TK_WINDOW_ONLY);
+ TkMacOSXInvalClipRgns(macWin->winPtr);
+ } else {
+ int deltaX, deltaY;
+
+ /*
+ * Find the Parent window -
+ * For an embedded window this will be its container.
+ */
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(macWin->winPtr);
+
+ if (contWinPtr != NULL) {
+ MacDrawable *macParent = contWinPtr->privatePtr;
+
+ TkMacOSXInvalClipRgns(macParent->winPtr);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+
+ deltaX = macParent->xOff +
+ macWin->winPtr->changes.x - macWin->xOff;
+ deltaY = macParent->yOff +
+ macWin->winPtr->changes.y - macWin->yOff;
+
+ UpdateOffsets(macWin->winPtr, deltaX, deltaY);
+ } else {
+ /*
+ * This is the case where we are embedded in
+ * another app. At this point, we are assuming that
+ * the changes.x,y is not maintained, if you need
+ * the info get it from Tk_GetRootCoords,
+ * and that the toplevel sits at 0,0 when it is drawn.
+ */
+
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+ UpdateOffsets(macWin->winPtr, 0, 0);
+ }
+
+ }
+ } else {
+ /* TODO: update all xOff & yOffs */
+ int deltaX, deltaY, parentBorderwidth;
+ MacDrawable *macParent = macWin->winPtr->parentPtr->privatePtr;
+
+ if (macParent == NULL) {
+ return; /* TODO: Probably should be a panic */
+ }
+
+ TkMacOSXInvalClipRgns(macParent->winPtr);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+
+ deltaX = - macWin->xOff;
+ deltaY = - macWin->yOff;
+
+ parentBorderwidth = macWin->winPtr->parentPtr->changes.border_width;
+
+ deltaX += macParent->xOff + parentBorderwidth +
+ macWin->winPtr->changes.x;
+ deltaY += macParent->yOff + parentBorderwidth +
+ macWin->winPtr->changes.y;
+
+ UpdateOffsets(macWin->winPtr, deltaX, deltaY);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XMoveResizeWindow --
+ *
+ * Move or resize a given X window. See X windows documentation
+ * for further details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XMoveResizeWindow(
+ Display* display, /* Display. */
+ Window window, /* Window. */
+ int x, int y,
+ unsigned int width,
+ unsigned int height)
+{
+ MacDrawable * macWin = (MacDrawable *) window;
+ CGrafPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(window);
+ if (destPort == NULL) {
+ return;
+ }
+
+ SetPort( destPort);
+ if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
+ /*
+ * NOTE: we are not adding the new space to the update
+ * region. It is currently assumed that Tk will need
+ * to completely redraw anway.
+ */
+
+ SizeWindow(GetWindowFromPort(destPort),
+ (short) width, (short) height, false);
+ MoveWindowStructure(GetWindowFromPort(destPort), x, y);
+
+ /* TODO: is the following right? */
+ TkMacOSXInvalidateWindow(macWin, TK_WINDOW_ONLY);
+ TkMacOSXInvalClipRgns(macWin->winPtr);
+ } else {
+ int deltaX, deltaY, parentBorderwidth;
+ Rect bounds;
+ MacDrawable *macParent;
+
+ /*
+ * Find the Parent window -
+ * For an embedded window this will be its container.
+ */
+
+ if (Tk_IsEmbedded(macWin->winPtr)) {
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(macWin->winPtr);
+ if (contWinPtr == NULL) {
+ panic("XMoveResizeWindow could not find container");
+ }
+ macParent = contWinPtr->privatePtr;
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+
+ } else {
+ macParent = macWin->winPtr->parentPtr->privatePtr;
+ if (macParent == NULL) {
+ return; /* TODO: Probably should be a panic */
+ }
+ }
+
+ TkMacOSXInvalClipRgns(macParent->winPtr);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+
+ deltaX = - macWin->xOff;
+ deltaY = - macWin->yOff;
+
+ /*
+ * If macWin->winPtr is an embedded window, don't offset by its
+ * parent's borderwidth...
+ */
+
+ if (!Tk_IsEmbedded(macWin->winPtr)) {
+ parentBorderwidth = macWin->winPtr->parentPtr->changes.border_width;
+ } else {
+ parentBorderwidth = 0;
+ }
+ deltaX += macParent->xOff + parentBorderwidth +
+ macWin->winPtr->changes.x;
+ deltaY += macParent->yOff + parentBorderwidth +
+ macWin->winPtr->changes.y;
+
+ UpdateOffsets(macWin->winPtr, deltaX, deltaY);
+ TkMacOSXWinBounds(macWin->winPtr, &bounds);
+ InvalWindowRect(GetWindowFromPort(destPort),&bounds);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XMoveWindow --
+ *
+ * Move a given X window. See X windows documentation for further
+ * details.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XMoveWindow(
+ Display* display, /* Display. */
+ Window window, /* Window. */
+ int x,
+ int y)
+{
+ MacDrawable *macWin = (MacDrawable *) window;
+ CGrafPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(window);
+ if (destPort == NULL) {
+ return;
+ }
+
+ SetPort( destPort);
+ if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
+ /*
+ * NOTE: we are not adding the new space to the update
+ * region. It is currently assumed that Tk will need
+ * to completely redraw anway.
+ */
+ MoveWindowStructure( GetWindowFromPort(destPort), x, y);
+
+ /* TODO: is the following right? */
+ TkMacOSXInvalidateWindow(macWin, TK_WINDOW_ONLY);
+ TkMacOSXInvalClipRgns(macWin->winPtr);
+ } else {
+ int deltaX, deltaY, parentBorderwidth;
+ Rect bounds;
+ MacDrawable *macParent;
+
+ /*
+ * Find the Parent window -
+ * For an embedded window this will be its container.
+ */
+
+ if (Tk_IsEmbedded(macWin->winPtr)) {
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(macWin->winPtr);
+ if (contWinPtr == NULL) {
+ panic("XMoveWindow could not find container");
+ }
+ macParent = contWinPtr->privatePtr;
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ } else {
+ macParent = macWin->winPtr->parentPtr->privatePtr;
+ if (macParent == NULL) {
+ return; /* TODO: Probably should be a panic */
+ }
+ }
+
+ TkMacOSXInvalClipRgns(macParent->winPtr);
+ TkMacOSXInvalidateWindow(macWin, TK_PARENT_WINDOW);
+
+ deltaX = - macWin->xOff;
+ deltaY = - macWin->yOff;
+
+ /*
+ * If macWin->winPtr is an embedded window, don't offset by its
+ * parent's borderwidth...
+ */
+
+ if (!Tk_IsEmbedded(macWin->winPtr)) {
+ parentBorderwidth = macWin->winPtr->parentPtr->changes.border_width;
+ } else {
+ parentBorderwidth = 0;
+ }
+ deltaX += macParent->xOff + parentBorderwidth +
+ macWin->winPtr->changes.x;
+ deltaY += macParent->yOff + parentBorderwidth +
+ macWin->winPtr->changes.y;
+
+ UpdateOffsets(macWin->winPtr, deltaX, deltaY);
+ TkMacOSXWinBounds(macWin->winPtr, &bounds);
+ InvalWindowRect(GetWindowFromPort(destPort),&bounds);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XRaiseWindow --
+ *
+ * Change the stacking order of a window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the stacking order of the specified window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XRaiseWindow(
+ Display* display, /* Display. */
+ Window window) /* Window. */
+{
+ MacDrawable *macWin = (MacDrawable *) window;
+
+ display->request++;
+ if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
+ TkWmRestackToplevel(macWin->winPtr, Above, NULL);
+ } else {
+ /* TODO: this should generate damage */
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XLowerWindow --
+ *
+ * Change the stacking order of a window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the stacking order of the specified window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XLowerWindow(
+ Display* display, /* Display. */
+ Window window) /* Window. */
+{
+ MacDrawable *macWin = (MacDrawable *) window;
+
+ display->request++;
+ if (Tk_IsTopLevel(macWin->winPtr) && !Tk_IsEmbedded(macWin->winPtr)) {
+ TkWmRestackToplevel(macWin->winPtr, Below, NULL);
+ } else {
+ /* TODO: this should generate damage */
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XConfigureWindow --
+ *
+ * Change the size, position, stacking, or border of the specified
+ * window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the attributes of the specified window. Note that we
+ * ignore the passed in values and use the values stored in the
+ * TkWindow data structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XConfigureWindow(
+ Display* display, /* Display. */
+ Window w, /* Window. */
+ unsigned int value_mask,
+ XWindowChanges* values)
+{
+ MacDrawable *macWin = (MacDrawable *) w;
+ TkWindow *winPtr = macWin->winPtr;
+
+ display->request++;
+
+ /*
+ * Change the shape and/or position of the window.
+ */
+
+ if (value_mask & (CWX|CWY|CWWidth|CWHeight)) {
+ XMoveResizeWindow(display, w, winPtr->changes.x, winPtr->changes.y,
+ winPtr->changes.width, winPtr->changes.height);
+ }
+
+ /*
+ * Change the stacking order of the window. Tk actuall keeps all
+ * the information we need for stacking order. All we need to do
+ * is make sure the clipping regions get updated and generate damage
+ * that will ensure things get drawn correctly.
+ */
+
+ if (value_mask & CWStackMode) {
+ Rect bounds;
+ CGrafPtr destPort;
+
+ destPort = TkMacOSXGetDrawablePort(w);
+ if (destPort != NULL) {
+ SetPort( destPort);
+ TkMacOSXInvalClipRgns(winPtr->parentPtr);
+ TkMacOSXWinBounds(winPtr, &bounds);
+ InvalWindowRect(GetWindowFromPort(destPort),&bounds);
+ }
+ }
+
+ /* TkGenWMMoveRequestEvent(macWin->winPtr,
+ macWin->winPtr->changes.x, macWin->winPtr->changes.y); */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXUpdateClipRgn --
+ *
+ * This function updates the cliping regions for a given window
+ * and all of its children. Once updated the TK_CLIP_INVALID flag
+ * in the subwindow data structure is unset. The TK_CLIP_INVALID
+ * flag should always be unset before any drawing is attempted.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The clip regions for the window and its children are updated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXUpdateClipRgn(
+ TkWindow *winPtr)
+{
+ RgnHandle rgn;
+ int x, y;
+ TkWindow *win2Ptr;
+
+ if (winPtr == NULL) {
+ return;
+ }
+
+ if (winPtr->privatePtr->flags & TK_CLIP_INVALID) {
+ rgn = winPtr->privatePtr->aboveClipRgn;
+ if (tmpRgn == NULL) {
+ tmpRgn = NewRgn();
+ }
+
+ /*
+ * Start with a region defined by the window bounds.
+ */
+
+ x = winPtr->privatePtr->xOff;
+ y = winPtr->privatePtr->yOff;
+ SetRectRgn(rgn, (short) x, (short) y,
+ (short) (winPtr->changes.width + x),
+ (short) (winPtr->changes.height + y));
+
+ /*
+ * Clip away the area of any windows that may obscure this
+ * window.
+ * For a non-toplevel window, first, clip to the parents visable
+ * clip region.
+ * Second, clip away any siblings that are higher in the
+ * stacking order.
+ * For an embedded toplevel, just clip to the container's visible
+ * clip region. Remember, we only allow one contained window
+ * in a frame, and don't support any other widgets in the frame either.
+ * This is not currently enforced, however.
+ */
+
+ if (!Tk_IsTopLevel(winPtr)) {
+ TkMacOSXUpdateClipRgn(winPtr->parentPtr);
+ SectRgn(rgn,
+ winPtr->parentPtr->privatePtr->aboveClipRgn, rgn);
+
+ win2Ptr = winPtr->nextPtr;
+ while (win2Ptr != NULL) {
+ if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ win2Ptr = win2Ptr->nextPtr;
+ continue;
+ }
+ x = win2Ptr->privatePtr->xOff;
+ y = win2Ptr->privatePtr->yOff;
+ SetRectRgn(tmpRgn, (short) x, (short) y,
+ (short) (win2Ptr->changes.width + x),
+ (short) (win2Ptr->changes.height + y));
+ DiffRgn(rgn, tmpRgn, rgn);
+
+ win2Ptr = win2Ptr->nextPtr;
+ }
+ } else if (Tk_IsEmbedded(winPtr)) {
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(winPtr);
+
+ if (contWinPtr != NULL) {
+ TkMacOSXUpdateClipRgn(contWinPtr);
+ SectRgn(rgn,
+ contWinPtr->privatePtr->aboveClipRgn, rgn);
+ } else if (gMacEmbedHandler != NULL) {
+ gMacEmbedHandler->getClipProc((Tk_Window) winPtr, tmpRgn);
+ SectRgn(rgn, tmpRgn, rgn);
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ }
+
+ /*
+ * The final clip region is the aboveClip region (or visable
+ * region) minus all the children of this window.
+ * Alternatively, if the window is a container, we must also
+ * subtract the region of the embedded window.
+ */
+
+ rgn = winPtr->privatePtr->clipRgn;
+ CopyRgn(winPtr->privatePtr->aboveClipRgn, rgn);
+
+ win2Ptr = winPtr->childList;
+ while (win2Ptr != NULL) {
+ if (Tk_IsTopLevel(win2Ptr) || !Tk_IsMapped(win2Ptr)) {
+ win2Ptr = win2Ptr->nextPtr;
+ continue;
+ }
+ x = win2Ptr->privatePtr->xOff;
+ y = win2Ptr->privatePtr->yOff;
+ SetRectRgn(tmpRgn, (short) x, (short) y,
+ (short) (win2Ptr->changes.width + x),
+ (short) (win2Ptr->changes.height + y));
+ DiffRgn(rgn, tmpRgn, rgn);
+
+ win2Ptr = win2Ptr->nextPtr;
+ }
+
+ if (Tk_IsContainer(winPtr)) {
+ win2Ptr = TkpGetOtherWindow(winPtr);
+ if (win2Ptr != NULL) {
+ if (Tk_IsMapped(win2Ptr)) {
+ x = win2Ptr->privatePtr->xOff;
+ y = win2Ptr->privatePtr->yOff;
+ SetRectRgn(tmpRgn, (short) x, (short) y,
+ (short) (win2Ptr->changes.width + x),
+ (short) (win2Ptr->changes.height + y));
+ DiffRgn(rgn, tmpRgn, rgn);
+ }
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ }
+
+ winPtr->privatePtr->flags &= ~TK_CLIP_INVALID;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXVisableClipRgn --
+ *
+ * This function returnd the Macintosh cliping region for the
+ * given window. A NULL Rgn means the window is not visable.
+ *
+ * Results:
+ * The region.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+RgnHandle
+TkMacOSXVisableClipRgn(
+ TkWindow *winPtr)
+{
+ if (winPtr->privatePtr->flags & TK_CLIP_INVALID) {
+ TkMacOSXUpdateClipRgn(winPtr);
+ }
+
+ return winPtr->privatePtr->clipRgn;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInvalidateWindow --
+ *
+ * This function makes the window as invalid will generate damage
+ * for the window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Damage is created.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInvalidateWindow(
+ MacDrawable *macWin, /* Make window that's causing damage. */
+ int flag) /* Should be TK_WINDOW_ONLY or
+ * TK_PARENT_WINDOW */
+{
+ WindowRef windowRef;
+ CGrafPtr grafPtr;
+
+ grafPtr=TkMacOSXGetDrawablePort((Drawable)macWin);
+ windowRef=GetWindowFromPort(grafPtr);
+
+ if (flag == TK_WINDOW_ONLY) {
+ InvalWindowRgn(windowRef,macWin->clipRgn);
+ } else {
+ if (!EmptyRgn(macWin->aboveClipRgn)) {
+ InvalWindowRgn(windowRef,macWin->aboveClipRgn);
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetDrawablePort --
+ *
+ * This function returns the Graphics Port for a given X drawable.
+ *
+ * Results:
+ * A CGrafPort . Either an off screen pixmap or a Window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CGrafPtr
+TkMacOSXGetDrawablePort(
+ Drawable drawable)
+{
+ MacDrawable *macWin = (MacDrawable *) drawable;
+ GWorldPtr resultPort = NULL;
+
+ if (macWin == NULL) {
+ return NULL;
+ }
+
+ /*
+ * This is NULL for off-screen pixmaps. Then the portPtr
+ * always points to the off-screen port, and we don't
+ * have to worry about containment
+ */
+
+ if (macWin->clipRgn == NULL) {
+ return macWin->grafPtr;
+ }
+
+ /*
+ * If the Drawable is in an embedded window, use the Port of its container.
+ *
+ * TRICKY POINT: we can have cases when a toplevel is being destroyed
+ * where the winPtr for the toplevel has been freed, but the children
+ * are not all the way destroyed. The children will call this function
+ * as they are being destroyed, but Tk_IsEmbedded will return garbage.
+ * So we check the copy of the TK_EMBEDDED flag we put into the
+ * toplevel's macWin flags.
+ */
+
+
+
+
+ if (!(macWin->toplevel->flags & TK_EMBEDDED)) {
+ return macWin->toplevel->grafPtr;
+ } else {
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
+
+ if (contWinPtr != NULL) {
+ resultPort = TkMacOSXGetDrawablePort(
+ (Drawable) contWinPtr->privatePtr);
+ } else if (gMacEmbedHandler != NULL) {
+ resultPort = gMacEmbedHandler->getPortProc(
+ (Tk_Window) macWin->winPtr);
+ }
+
+ if (resultPort == NULL) {
+ /*
+ * FIXME:
+ *
+ * So far as I can tell, the only time that this happens is when
+ * we are tearing down an embedded child interpreter, and most
+ * of the time, this is harmless... However, we really need to
+ * find why the embedding loses.
+ */
+ DebugStr("\pTkMacOSXGetDrawablePort couldn't find container");
+ return NULL;
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ }
+ return resultPort;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetRootControl --
+ *
+ * This function returns the Root Control for a given X drawable.
+ *
+ * Results:
+ * A ControlRef .
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ControlRef
+TkMacOSXGetRootControl(
+ Drawable drawable)
+{
+ /*
+ * will probably need to fix this up for embedding
+ */
+ MacDrawable *macWin = (MacDrawable *) drawable;
+ ControlRef result = NULL;
+
+ if (macWin == NULL) {
+ return NULL;
+ }
+ if (!(macWin->toplevel->flags & TK_EMBEDDED)) {
+ return macWin->toplevel->rootControl;
+ } else {
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(macWin->toplevel->winPtr);
+
+ if (contWinPtr != NULL) {
+ result = TkMacOSXGetRootControl(
+ (Drawable) contWinPtr->privatePtr);
+ } else if (gMacEmbedHandler != NULL) {
+ result = NULL;
+ }
+ }
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXInvalClipRgns --
+ *
+ * This function invalidates the clipping regions for a given
+ * window and all of its children. This function should be
+ * called whenever changes are made to subwindows that would
+ * effect the size or position of windows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The cliping regions for the window and its children are
+ * mark invalid. (Make sure they are valid before drawing.)
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXInvalClipRgns(
+ TkWindow *winPtr)
+{
+ TkWindow *childPtr;
+
+ /*
+ * If already marked we can stop because all
+ * decendants will also already be marked.
+ */
+ if (winPtr->privatePtr->flags & TK_CLIP_INVALID) {
+ return;
+ }
+
+ winPtr->privatePtr->flags |= TK_CLIP_INVALID;
+
+ /*
+ * Invalidate clip regions for all children &
+ * their decendants - unless the child is a toplevel.
+ */
+ childPtr = winPtr->childList;
+ while (childPtr != NULL) {
+ if (!Tk_IsTopLevel(childPtr) && Tk_IsMapped(childPtr)) {
+ TkMacOSXInvalClipRgns(childPtr);
+ }
+ childPtr = childPtr->nextPtr;
+ }
+
+ /*
+ * Also, if the window is a container, mark its embedded window
+ */
+
+ if (Tk_IsContainer(winPtr)) {
+ childPtr = TkpGetOtherWindow(winPtr);
+
+ if (childPtr != NULL && Tk_IsMapped(childPtr)) {
+ TkMacOSXInvalClipRgns(childPtr);
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXWinBounds --
+ *
+ * Given a Tk window this function determines the windows
+ * bounds in relation to the Macintosh window's coordinate
+ * system. This is also the same coordinate system as the
+ * Tk toplevel window in which this window is contained.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXWinBounds(
+ TkWindow *winPtr,
+ Rect *bounds)
+{
+ bounds->left = (short) winPtr->privatePtr->xOff;
+ bounds->top = (short) winPtr->privatePtr->yOff;
+ bounds->right = (short) (winPtr->privatePtr->xOff +
+ winPtr->changes.width);
+ bounds->bottom = (short) (winPtr->privatePtr->yOff +
+ winPtr->changes.height);
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * UpdateOffsets --
+ *
+ * Updates the X & Y offsets of the given TkWindow from the
+ * TopLevel it is a decendant of.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The xOff & yOff fields for the Mac window datastructure
+ * is updated to the proper offset.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+UpdateOffsets(
+ TkWindow *winPtr,
+ int deltaX,
+ int deltaY)
+{
+ TkWindow *childPtr;
+
+ if (winPtr->privatePtr == NULL) {
+ /*
+ * We havn't called Tk_MakeWindowExist for this window yet. The
+ * offset information will be postponed and calulated at that
+ * time. (This will usually only happen when a mapped parent is
+ * being moved but has child windows that have yet to be mapped.)
+ */
+ return;
+ }
+
+ winPtr->privatePtr->xOff += deltaX;
+ winPtr->privatePtr->yOff += deltaY;
+
+ childPtr = winPtr->childList;
+ while (childPtr != NULL) {
+ if (!Tk_IsTopLevel(childPtr)) {
+ UpdateOffsets(childPtr, deltaX, deltaY);
+ }
+ childPtr = childPtr->nextPtr;
+ }
+
+ if (Tk_IsContainer(winPtr)) {
+ childPtr = TkpGetOtherWindow(winPtr);
+ if (childPtr != NULL) {
+ UpdateOffsets(childPtr,deltaX,deltaY);
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetPixmap --
+ *
+ * Creates an in memory drawing surface.
+ *
+ * Results:
+ * Returns a handle to a new pixmap.
+ *
+ * Side effects:
+ * Allocates a new Macintosh GWorld.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Pixmap
+Tk_GetPixmap(
+ Display *display, /* Display for new pixmap (can be null). */
+ Drawable d, /* Drawable where pixmap will be used (ignored). */
+ int width, /* Dimensions of pixmap. */
+ int height,
+ int depth) /* Bits per pixel for pixmap. */
+{
+ QDErr err;
+ GWorldPtr gWorld;
+ Rect bounds;
+ MacDrawable *macPix;
+ PixMapHandle pixels;
+
+ if (display != NULL) {
+ display->request++;
+ }
+ macPix = (MacDrawable *) ckalloc(sizeof(MacDrawable));
+ macPix->winPtr = NULL;
+ macPix->xOff = 0;
+ macPix->yOff = 0;
+ macPix->clipRgn = NULL;
+ macPix->aboveClipRgn = NULL;
+ macPix->referenceCount = 0;
+ macPix->toplevel = NULL;
+ macPix->flags = 0;
+
+ bounds.top = bounds.left = 0;
+ bounds.right = (short) width;
+ bounds.bottom = (short) height;
+ if (depth != 1) {
+ depth = 0;
+ }
+ /*
+ * Allocate memory for the off screen pixmap. If we fail
+ * try again from system memory. Eventually, we may have
+ * to panic.
+ */
+ err = NewGWorld(&gWorld, depth, &bounds, NULL, NULL, 0);
+ if (err != noErr) {
+ err = NewGWorld(&gWorld, depth, &bounds, NULL, NULL, useTempMem);
+ }
+ if (err != noErr) {
+ panic("Out of memory: NewGWorld failed in Tk_GetPixmap");
+ }
+
+ /*
+ * Lock down the pixels so they don't move out from under us.
+ */
+ pixels = GetGWorldPixMap(gWorld);
+ LockPixels(pixels);
+ macPix->grafPtr = gWorld;
+
+ return (Pixmap) macPix;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_FreePixmap --
+ *
+ * Release the resources associated with a pixmap.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Deletes the Macintosh GWorld created by Tk_GetPixmap.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_FreePixmap(
+ Display *display, /* Display. */
+ Pixmap pixmap) /* Pixmap to destroy */
+{
+ MacDrawable *macPix = (MacDrawable *) pixmap;
+ PixMapHandle pixels;
+
+ display->request++;
+ pixels = GetGWorldPixMap(macPix->grafPtr);
+ UnlockPixels(pixels);
+ DisposeGWorld(macPix->grafPtr);
+ ckfree((char *) macPix);
+}
diff --git a/tk/macosx/tkMacOSXTest.c b/tk/macosx/tkMacOSXTest.c
new file mode 100644
index 00000000000..e933446b580
--- /dev/null
+++ b/tk/macosx/tkMacOSXTest.c
@@ -0,0 +1,82 @@
+/*
+ * tkMacOSXTest.c --
+ *
+ * Contains commands for platform specific tests for
+ * the Macintosh platform.
+ *
+ * Copyright (c) 1996 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include <tcl.h>
+
+/*
+ * Forward declarations of procedures defined later in this file:
+ */
+
+int TkplatformtestInit _ANSI_ARGS_((Tcl_Interp *interp));
+static int DebuggerCmd _ANSI_ARGS_((ClientData dummy,
+ Tcl_Interp *interp, int argc, char **argv));
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkplatformtestInit --
+ *
+ * Defines commands that test platform specific functionality for
+ * Unix platforms.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * Defines new commands.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkplatformtestInit(
+ Tcl_Interp *interp) /* Interpreter to add commands to. */
+{
+ /*
+ * Add commands for platform specific tests on MacOS here.
+ */
+
+ Tcl_CreateCommand(interp, "debugger", DebuggerCmd,
+ (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DebuggerCmd --
+ *
+ * This procedure simply calls the low level debugger.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+DebuggerCmd(
+ ClientData clientData, /* Not used. */
+ Tcl_Interp *interp, /* Not used. */
+ int argc, /* Not used. */
+ char **argv) /* Not used. */
+{
+ Debugger();
+ return TCL_OK;
+}
diff --git a/tk/macosx/tkMacOSXUtil.c b/tk/macosx/tkMacOSXUtil.c
new file mode 100644
index 00000000000..1e4e8567578
--- /dev/null
+++ b/tk/macosx/tkMacOSXUtil.c
@@ -0,0 +1,330 @@
+#include <Carbon/Carbon.h>
+
+#include "tkMacOSXUtil.h"
+
+#define DIR_SEP_CHAR ':'
+
+/*****************************************************************************/
+pascal OSErr FSMakeFSSpecCompat(short vRefNum,
+ long dirID,
+ ConstStr255Param fileName,
+ FSSpec *spec)
+{
+ OSErr result;
+
+ {
+ /* Let the file system create the FSSpec if it can since it does the job */
+ /* much more efficiently than I can. */
+ result = FSMakeFSSpec(vRefNum, dirID, fileName, spec);
+ /* Fix a bug in Macintosh PC Exchange's MakeFSSpec code where 0 is */
+ /* returned in the parID field when making an FSSpec to the volume's */
+ /* root directory by passing a full pathname in MakeFSSpec's */
+ /* fileName parameter. Fixed in Mac OS 8.1 */
+ if ( (result == noErr) && (spec->parID == 0) )
+ spec->parID = fsRtParID;
+ }
+ return ( result );
+}
+
+
+/*****************************************************************************/
+pascal OSErr GetCatInfoNoName(short vRefNum,
+ long dirID,
+ ConstStr255Param name,
+ CInfoPBPtr pb)
+{
+ Str31 tempName;
+ OSErr error;
+
+ /* Protection against File Sharing problem */
+ if ( (name == NULL) || (name[0] == 0) )
+ {
+ tempName[0] = 0;
+ pb->dirInfo.ioNamePtr = tempName;
+ pb->dirInfo.ioFDirIndex = -1; /* use ioDirID */
+ }
+ else
+ {
+ pb->dirInfo.ioNamePtr = (StringPtr)name;
+ pb->dirInfo.ioFDirIndex = 0; /* use ioNamePtr and ioDirID */
+ }
+ pb->dirInfo.ioVRefNum = vRefNum;
+ pb->dirInfo.ioDrDirID = dirID;
+ error = PBGetCatInfoSync(pb);
+ pb->dirInfo.ioNamePtr = NULL;
+ return ( error );
+}
+/*****************************************************************************/
+pascal OSErr GetDirectoryID(short vRefNum,
+ long dirID,
+ ConstStr255Param name,
+ long *theDirID,
+ Boolean *isDirectory)
+{
+ CInfoPBRec pb;
+ OSErr error;
+ error = GetCatInfoNoName(vRefNum, dirID, name, &pb);
+ if ( error == noErr )
+ {
+ *isDirectory = (pb.hFileInfo.ioFlAttrib & kioFlAttribDirMask) != 0;
+ if ( *isDirectory )
+ {
+ *theDirID = pb.dirInfo.ioDrDirID;
+ }
+ else
+ {
+ *theDirID = pb.hFileInfo.ioFlParID;
+ }
+ }
+
+ return ( error );
+}
+
+/*****************************************************************************/
+pascal OSErr FSpGetDirectoryID(const FSSpec *spec,
+ long *theDirID,
+ Boolean *isDirectory)
+{
+ return ( GetDirectoryID(spec->vRefNum, spec->parID, spec->name,
+ theDirID, isDirectory) );
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FSpPathFromLocation --
+ *
+ * This function obtains a full path name for a given macintosh
+ * FSSpec. Unlike the More Files function FSpGetFullPath, this
+ * function will return a C string in the Handle. It also will
+ * create paths for FSSpec that do not yet exist.
+ *
+ * Results:
+ * OSErr code.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+OSErr
+FSpPathFromLocation(
+ FSSpec *spec, /* The location we want a path for. */
+ int *length, /* Length of the resulting path. */
+ Handle *fullPath) /* Handle to path. */
+{
+ OSErr err;
+ FSSpec tempSpec;
+ CInfoPBRec pb;
+
+ *fullPath = NULL;
+
+ /*
+ * Make a copy of the input FSSpec that can be modified.
+ */
+ BlockMoveData(spec, &tempSpec, sizeof(FSSpec));
+
+ if (tempSpec.parID == fsRtParID) {
+ /*
+ * The object is a volume. Add a colon to make it a full
+ * pathname. Allocate a handle for it and we are done.
+ */
+ tempSpec.name[0] += 2;
+ tempSpec.name[tempSpec.name[0] - 1] = DIR_SEP_CHAR;
+ tempSpec.name[tempSpec.name[0]] = '\0';
+
+ err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]);
+ } else {
+ /*
+ * The object isn't a volume. Is the object a file or a directory?
+ */
+ pb.dirInfo.ioNamePtr = tempSpec.name;
+ pb.dirInfo.ioVRefNum = tempSpec.vRefNum;
+ pb.dirInfo.ioDrDirID = tempSpec.parID;
+ pb.dirInfo.ioFDirIndex = 0;
+ err = PBGetCatInfoSync(&pb);
+
+ if ((err == noErr) || (err == fnfErr)) {
+ /*
+ * If the file doesn't currently exist we start over. If the
+ * directory exists everything will work just fine. Otherwise we
+ * will just fail later. If the object is a directory, append a
+ * colon so full pathname ends with colon, but only if the name is
+ * not empty. NavServices returns FSSpec's with the parent ID set,
+ * but the name empty...
+ */
+ if (err == fnfErr) {
+ BlockMoveData(spec, &tempSpec, sizeof(FSSpec));
+ } else if ( (pb.hFileInfo.ioFlAttrib & ioDirMask) != 0 ) {
+ if (tempSpec.name[0] > 0) {
+ tempSpec.name[0] += 1;
+ tempSpec.name[tempSpec.name[0]] = DIR_SEP_CHAR;
+ }
+ }
+
+ /*
+ * Create a new Handle for the object - make it a C string.
+ */
+ tempSpec.name[0] += 1;
+ tempSpec.name[tempSpec.name[0]] = '\0';
+ err = PtrToHand(&tempSpec.name[1], fullPath, tempSpec.name[0]);
+ if (err == noErr) {
+ /*
+ * Get the ancestor directory names - loop until we have an
+ * error or find the root directory.
+ */
+ pb.dirInfo.ioNamePtr = tempSpec.name;
+ pb.dirInfo.ioVRefNum = tempSpec.vRefNum;
+ pb.dirInfo.ioDrParID = tempSpec.parID;
+ do {
+ pb.dirInfo.ioFDirIndex = -1;
+ pb.dirInfo.ioDrDirID = pb.dirInfo.ioDrParID;
+ err = PBGetCatInfoSync(&pb);
+ if (err == noErr) {
+ /*
+ * Append colon to directory name and add
+ * directory name to beginning of fullPath.
+ */
+ ++tempSpec.name[0];
+ tempSpec.name[tempSpec.name[0]] = DIR_SEP_CHAR;
+
+ (void) Munger(*fullPath, 0, NULL, 0, &tempSpec.name[1],
+ tempSpec.name[0]);
+ fprintf(stderr,"mem\n");
+ err = MemError();
+ }
+ } while ( (err == noErr) &&
+ (pb.dirInfo.ioDrDirID != fsRtDirID) );
+ }
+ }
+ }
+
+ /*
+ * On error Dispose the handle, set it to NULL & return the err.
+ * Otherwise, set the length & return.
+ */
+ if (err == noErr) {
+ *length = GetHandleSize(*fullPath) - 1;
+ } else {
+ if ( *fullPath != NULL ) {
+ DisposeHandle(*fullPath);
+ }
+ *fullPath = NULL;
+ *length = 0;
+ }
+
+ return err;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FSpLocationFromPath --
+ *
+ * This function obtains an FSSpec for a given macintosh path.
+ * Unlike the More Files function FSpLocationFromFullPath, this
+ * function will also accept partial paths and resolve any aliases
+ * along the path.
+ *
+ * Results:
+ * OSErr code.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+OSErr
+FSpLocationFromPath(
+ int length, /* Length of path. */
+ const char *path, /* The path to convert. */
+ FSSpecPtr fileSpecPtr) /* On return the spec for the path. */
+{
+ Str255 fileName;
+ OSErr err;
+ short vRefNum;
+ long dirID;
+ int pos, cur;
+ Boolean isDirectory;
+ Boolean wasAlias;
+
+ /*
+ * Check to see if this is a full path. If partial
+ * we assume that path starts with the current working
+ * directory. (Ie. volume & dir = 0)
+ */
+ vRefNum = 0;
+ dirID = 0;
+ cur = 0;
+ if (length == 0) {
+ return fnfErr;
+ }
+ if (path[cur] == DIR_SEP_CHAR) {
+ cur++;
+ if (cur >= length) {
+ /*
+ * If path = ":", just return current directory.
+ */
+ FSMakeFSSpecCompat(0, 0, NULL, fileSpecPtr);
+ return noErr;
+ }
+ } else {
+ while (path[cur] != DIR_SEP_CHAR && cur < length) {
+ cur++;
+ }
+ if (cur > 255) {
+ return bdNamErr;
+ }
+ if (cur < length) {
+ /*
+ * This is a full path
+ */
+ cur++;
+ strncpy((char *) fileName + 1, path, cur);
+ fileName[0] = cur;
+ err = FSMakeFSSpecCompat(0, 0, fileName, fileSpecPtr);
+ if (err != noErr) return err;
+ FSpGetDirectoryID(fileSpecPtr, &dirID, &isDirectory);
+ vRefNum = fileSpecPtr->vRefNum;
+ } else {
+ cur = 0;
+ }
+ }
+
+ isDirectory = 1;
+ while (cur < length) {
+ if (!isDirectory) {
+ return dirNFErr;
+ }
+ pos = cur;
+ while (path[pos] != DIR_SEP_CHAR && pos < length) {
+ pos++;
+ }
+ if (pos == cur) {
+ /* Move up one dir */
+ /* cur++; */
+ fileName[1] = DIR_SEP_CHAR;
+ fileName[2] = DIR_SEP_CHAR;
+ fileName[0] = 2;
+ } else if (pos - cur > 255) {
+ return bdNamErr;
+ } else {
+ strncpy((char *) fileName + 1, &path[cur], pos - cur);
+ fileName[0] = pos - cur;
+ }
+ err = FSMakeFSSpecCompat(vRefNum, dirID, fileName, fileSpecPtr);
+ if (err != noErr) return err;
+ err = ResolveAliasFile(fileSpecPtr, true, &isDirectory, &wasAlias);
+ if (err != noErr) return err;
+ FSpGetDirectoryID(fileSpecPtr, &dirID, &isDirectory);
+ vRefNum = fileSpecPtr->vRefNum;
+ cur = pos;
+ if (path[cur] == DIR_SEP_CHAR) {
+ cur++;
+ }
+ }
+
+ return noErr;
+}
diff --git a/tk/macosx/tkMacOSXUtil.h b/tk/macosx/tkMacOSXUtil.h
new file mode 100644
index 00000000000..e38f8a53390
--- /dev/null
+++ b/tk/macosx/tkMacOSXUtil.h
@@ -0,0 +1,65 @@
+/*
+ * tkMacOSXUtil.h --
+ *
+ * Declarations of utility functions from the MoreFiles package.
+ *
+ * FIXME: We should be able to replace all these with FSRef calls
+ * much more simply.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#ifndef TK_MAC_UTIL_H
+#define TK_MAC_UTIL_H
+
+#include <Carbon/Carbon.h>
+
+OSErr FSpPathFromLocation(FSSpec *spec, int *length, Handle *fullPath);
+OSErr FSpLocationFromPath(int length, const char *path, FSSpecPtr fileSpecPtr);
+OSErr FSpGetDirectoryID(const FSSpec *spec, long *theDirID, Boolean *isDirectory);
+
+#endif
diff --git a/tk/macosx/tkMacOSXWindowEvent.c b/tk/macosx/tkMacOSXWindowEvent.c
new file mode 100644
index 00000000000..d21d1f1d8b3
--- /dev/null
+++ b/tk/macosx/tkMacOSXWindowEvent.c
@@ -0,0 +1,693 @@
+/*
+ * tkMacOSXWindowEvent.c --
+ *
+ * This file defines the routines for both creating and handling
+ * Window Manager class events for Tk.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#include "tkMacOSXInt.h"
+#include "tkPort.h"
+#include "tkMacOSXWm.h"
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXDebug.h"
+
+/*
+ * Declarations of global variables defined in this file.
+ */
+
+int tkMacOSXAppInFront = true; /* Boolean variable for determining if
+ * we are the frontmost app. Only set
+ * in TkMacOSXProcessApplicationEvent
+ */
+static RgnHandle gDamageRgn;
+static RgnHandle visRgn;
+
+/*
+ * Declaration of functions used only in this file
+ */
+
+static int GenerateUpdateEvent( Window window);
+static void GenerateUpdates( RgnHandle updateRgn, TkWindow *winPtr);
+static int GenerateActivateEvents( Window window, int activeFlag);
+static int GenerateFocusEvent( Window window, int activeFlag);
+
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessApplicationEvent --
+ *
+ * This processes Application level events, mainly activate
+ * and deactivate.
+ *
+ * Results:
+ * o.
+ *
+ * Side effects:
+ * Hide or reveal floating windows, and set tkMacOSXAppInFront.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXProcessApplicationEvent(
+ TkMacOSXEvent *eventPtr,
+ MacEventStatus *statusPtr)
+{
+ statusPtr->handledByTk = 1;
+ switch (eventPtr->eKind) {
+ case kEventAppActivated:
+ tkMacOSXAppInFront = true;
+ ShowFloatingWindows();
+ break;
+ case kEventAppDeactivated:
+ TkSuspendClipboard();
+ tkMacOSXAppInFront = false;
+ HideFloatingWindows();
+ break;
+ case kEventAppQuit:
+ case kEventAppLaunchNotification:
+ case kEventAppLaunched:
+ case kEventAppTerminated:
+ case kEventAppFrontSwitched:
+ break;
+ }
+ return 0;
+}
+ /*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXProcessWindowEvent --
+ *
+ * This processes Window level events, mainly activate
+ * and deactivate.
+ *
+ * Results:
+ * 0.
+ *
+ * Side effects:
+ * Cause Windows to be moved forward or backward in the
+ * window stack.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXProcessWindowEvent(
+ TkMacOSXEvent * eventPtr,
+ MacEventStatus * statusPtr)
+{
+ OSStatus status;
+ WindowRef whichWindow;
+ Window window;
+ int eventFound;
+
+ switch (eventPtr->eKind) {
+ case kEventWindowActivated:
+ case kEventWindowDeactivated:
+ case kEventWindowUpdate:
+ break;
+ default:
+ statusPtr->handledByTk = 1;
+ return 0;
+ break;
+ }
+ statusPtr->handledByTk = 1;
+ status = GetEventParameter(eventPtr->eventRef,
+ kEventParamDirectObject,
+ typeWindowRef, NULL,
+ sizeof(whichWindow), NULL,
+ &whichWindow);
+ if (status != noErr) {
+ fprintf ( stderr, "TkMacOSXHandleWindowEvent:Failed to retrieve window" );
+ return 0;
+ }
+
+ window = TkMacOSXGetXWindow(whichWindow);
+
+ switch (eventPtr->eKind) {
+ case kEventWindowActivated:
+ eventFound |= GenerateActivateEvents(window, 1);
+ eventFound |= GenerateFocusEvent(window, 1);
+ break;
+ case kEventWindowDeactivated:
+ eventFound |= GenerateActivateEvents(window, 0);
+ eventFound |= GenerateFocusEvent(window, 0);
+ break;
+ case kEventWindowUpdate:
+ if (GenerateUpdateEvent(window)) {
+ eventFound = true;
+ } else {
+ statusPtr->handledByTk = 0;
+ }
+ break;
+ }
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateUpdateEvent --
+ *
+ * Given a Macintosh window update event this function generates all the
+ * X update events needed by Tk.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+static int
+GenerateUpdateEvent(Window window)
+{
+ WindowRef macWindow;
+ TkDisplay * dispPtr;
+ TkWindow * winPtr;
+ Rect bounds;
+
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *)Tk_IdToWindow(dispPtr->display, window);
+
+ if (winPtr ==NULL ){
+ return false;
+ }
+ if (gDamageRgn == NULL) {
+ gDamageRgn = NewRgn();
+ }
+ if (visRgn == NULL) {
+ visRgn = NewRgn();
+ }
+ macWindow = GetWindowFromPort(TkMacOSXGetDrawablePort(window));
+ BeginUpdate(macWindow);
+ /*
+ * In the Classic version of the code, this was the "visRgn" field of the WindowRec
+ * This no longer exists in OS X, so retrieve the content region instead
+ * Note that this is in screen coordinates
+ * We therefore convert it to window relative coordinates
+ */
+ GetWindowRegion (macWindow, kWindowContentRgn, visRgn );
+ GetRegionBounds(visRgn,&bounds);
+ bounds.right -= bounds.left;
+ bounds.bottom -= bounds.top;
+ bounds.left=
+ bounds.top=0;
+ RectRgn(visRgn, &bounds);
+ GenerateUpdates(visRgn, winPtr);
+ EndUpdate(macWindow);
+ return true;
+ }
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateUpdates --
+ *
+ * Given a Macintosh update region and a Tk window this function
+ * geneates a X damage event for the window if it is within the
+ * update region. The function will then recursivly have each
+ * damaged window generate damage events for its child windows.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+GenerateUpdates(
+ RgnHandle updateRgn,
+ TkWindow *winPtr)
+{
+ TkWindow *childPtr;
+ XEvent event;
+ Rect bounds, updateBounds, damageBounds;
+
+ TkMacOSXWinBounds(winPtr, &bounds);
+ GetRegionBounds(updateRgn,&updateBounds);
+
+ if (bounds.top > updateBounds.bottom ||
+ updateBounds.top > bounds.bottom ||
+ bounds.left > updateBounds.right ||
+ updateBounds.left > bounds.right ||
+ !RectInRgn(&bounds, updateRgn)) {
+ return;
+ }
+ if (!RectInRgn(&bounds, updateRgn)) {
+ return;
+ }
+
+ event.xany.serial = Tk_Display(winPtr)->request;
+ event.xany.send_event = false;
+ event.xany.window = Tk_WindowId(winPtr);
+ event.xany.display = Tk_Display(winPtr);
+
+ event.type = Expose;
+
+ /*
+ * Compute the bounding box of the area that the damage occured in.
+ */
+
+ /*
+ * CopyRgn(TkMacOSXVisableClipRgn(winPtr), rgn);
+ * TODO: this call doesn't work doing resizes!!!
+ */
+ RectRgn(gDamageRgn, &bounds);
+ SectRgn(gDamageRgn, updateRgn, gDamageRgn);
+ OffsetRgn(gDamageRgn, -bounds.left, -bounds.top);
+ GetRegionBounds(gDamageRgn,&damageBounds);
+ event.xexpose.x = damageBounds.left;
+ event.xexpose.y = damageBounds.top;
+ event.xexpose.width = damageBounds.right-damageBounds.left;
+ event.xexpose.height = damageBounds.bottom-damageBounds.top;
+ event.xexpose.count = 0;
+
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+ /*
+ * Generate updates for the children of this window
+ */
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ if (!Tk_IsMapped(childPtr) || Tk_IsTopLevel(childPtr)) {
+ continue;
+ }
+
+ GenerateUpdates(updateRgn, childPtr);
+ }
+
+ /*
+ * Generate updates for any contained windows
+ */
+
+ if (Tk_IsContainer(winPtr)) {
+ childPtr = TkpGetOtherWindow(winPtr);
+ if (childPtr != NULL && Tk_IsMapped(childPtr)) {
+ GenerateUpdates(updateRgn, childPtr);
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ }
+
+ return;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateActivateEvents --
+ *
+ * Given a Macintosh window activate event this function generates all the
+ * X Activate events needed by Tk.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+GenerateActivateEvents(
+ Window window, /* Root X window for event. */
+ int activeFlag )
+{
+ TkWindow *winPtr;
+ TkDisplay *dispPtr;
+
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
+ if (winPtr == NULL || winPtr->window == None) {
+ return false;
+ }
+
+ TkGenerateActivateEvents(winPtr,activeFlag);
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GenerateFocusEvent --
+ *
+ * Given a Macintosh window activate event this function generates all the
+ * X Focus events needed by Tk.
+ *
+ * Results:
+ * True if event(s) are generated - false otherwise.
+ *
+ * Side effects:
+ * Additional events may be place on the Tk event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+GenerateFocusEvent(
+ Window window, /* Root X window for event. */
+ int activeFlag )
+{
+ XEvent event;
+ Tk_Window tkwin;
+ TkDisplay *dispPtr;
+
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+ if (tkwin == NULL) {
+ return false;
+ }
+
+ /*
+ * Generate FocusIn and FocusOut events. This event
+ * is only sent to the toplevel window.
+ */
+
+ if (activeFlag) {
+ event.xany.type = FocusIn;
+ } else {
+ event.xany.type = FocusOut;
+ }
+
+ event.xany.serial = dispPtr->display->request;
+ event.xany.send_event = False;
+ event.xfocus.display = dispPtr->display;
+ event.xfocus.window = window;
+ event.xfocus.mode = NotifyNormal;
+ event.xfocus.detail = NotifyDetailNone;
+
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGenWMConfigureEvent --
+ *
+ * Generate a ConfigureNotify event for Tk. Depending on the
+ * value of flag the values of width/height, x/y, or both may
+ * be changed.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A ConfigureNotify event is sent to Tk.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkGenWMConfigureEvent(
+ Tk_Window tkwin,
+ int x,
+ int y,
+ int width,
+ int height,
+ int flags)
+{
+ XEvent event;
+ WmInfo *wmPtr;
+ TkWindow *winPtr = (TkWindow *) tkwin;
+
+ if (tkwin == NULL) {
+ return;
+ }
+
+ event.type = ConfigureNotify;
+ event.xconfigure.serial = Tk_Display(tkwin)->request;
+ event.xconfigure.send_event = False;
+ event.xconfigure.display = Tk_Display(tkwin);
+ event.xconfigure.event = Tk_WindowId(tkwin);
+ event.xconfigure.window = Tk_WindowId(tkwin);
+ event.xconfigure.border_width = winPtr->changes.border_width;
+ event.xconfigure.override_redirect = winPtr->atts.override_redirect;
+ if (winPtr->changes.stack_mode == Above) {
+ event.xconfigure.above = winPtr->changes.sibling;
+ } else {
+ event.xconfigure.above = None;
+ }
+
+ if (flags & TK_LOCATION_CHANGED) {
+ event.xconfigure.x = x;
+ event.xconfigure.y = y;
+ } else {
+ event.xconfigure.x = Tk_X(tkwin);
+ event.xconfigure.y = Tk_Y(tkwin);
+ x = Tk_X(tkwin);
+ y = Tk_Y(tkwin);
+ }
+ if (flags & TK_SIZE_CHANGED) {
+ event.xconfigure.width = width;
+ event.xconfigure.height = height;
+ } else {
+ event.xconfigure.width = Tk_Width(tkwin);
+ event.xconfigure.height = Tk_Height(tkwin);
+ width = Tk_Width(tkwin);
+ height = Tk_Height(tkwin);
+ }
+
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+ /*
+ * Update window manager information.
+ */
+ if (Tk_IsTopLevel(winPtr)) {
+ wmPtr = winPtr->wmInfoPtr;
+ if (flags & TK_LOCATION_CHANGED) {
+ wmPtr->x = x;
+ wmPtr->y = y;
+ wmPtr->flags &= ~(WM_NEGATIVE_X | WM_NEGATIVE_Y);
+ }
+ if ((flags & TK_SIZE_CHANGED) &&
+ ((width != Tk_Width(tkwin)) || (height != Tk_Height(tkwin)))) {
+ if ((wmPtr->width == -1) && (width == winPtr->reqWidth)) {
+ /*
+ * Don't set external width, since the user didn't change it
+ * from what the widgets asked for.
+ */
+ } else {
+ if (wmPtr->gridWin != NULL) {
+ wmPtr->width = wmPtr->reqGridWidth
+ + (width - winPtr->reqWidth)/wmPtr->widthInc;
+ if (wmPtr->width < 0) {
+ wmPtr->width = 0;
+ }
+ } else {
+ wmPtr->width = width;
+ }
+ }
+ if ((wmPtr->height == -1) && (height == winPtr->reqHeight)) {
+ /*
+ * Don't set external height, since the user didn't change it
+ * from what the widgets asked for.
+ */
+ } else {
+ if (wmPtr->gridWin != NULL) {
+ wmPtr->height = wmPtr->reqGridHeight
+ + (height - winPtr->reqHeight)/wmPtr->heightInc;
+ if (wmPtr->height < 0) {
+ wmPtr->height = 0;
+ }
+ } else {
+ wmPtr->height = height;
+ }
+ }
+ wmPtr->configWidth = width;
+ wmPtr->configHeight = height;
+ }
+ }
+
+ /*
+ * Now set up the changes structure. Under X we wait for the
+ * ConfigureNotify to set these values. On the Mac we know imediatly that
+ * this is what we want - so we just set them. However, we need to
+ * make sure the windows clipping region is marked invalid so the
+ * change is visable to the subwindow.
+ */
+ winPtr->changes.x = x;
+ winPtr->changes.y = y;
+ winPtr->changes.width = width;
+ winPtr->changes.height = height;
+ TkMacOSXInvalClipRgns(winPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGenWMDestroyEvent --
+ *
+ * Generate a WM Destroy event for Tk. *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A WM_PROTOCOL/WM_DELETE_WINDOW event is sent to Tk.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkGenWMDestroyEvent(
+ Tk_Window tkwin)
+{
+ XEvent event;
+
+ event.xany.serial = Tk_Display(tkwin)->request;
+ event.xany.send_event = False;
+ event.xany.display = Tk_Display(tkwin);
+
+ event.xclient.window = Tk_WindowId(tkwin);
+ event.xclient.type = ClientMessage;
+ event.xclient.message_type = Tk_InternAtom(tkwin, "WM_PROTOCOLS");
+ event.xclient.format = 32;
+ event.xclient.data.l[0] = Tk_InternAtom(tkwin, "WM_DELETE_WINDOW");
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmProtocolEventProc --
+ *
+ * This procedure is called by the Tk_HandleEvent whenever a
+ * ClientMessage event arrives whose type is "WM_PROTOCOLS".
+ * This procedure handles the message from the window manager
+ * in an appropriate fashion.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Depends on what sort of handler, if any, was set up for the
+ * protocol.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkWmProtocolEventProc(
+ TkWindow *winPtr, /* Window to which the event was sent. */
+ XEvent *eventPtr) /* X event. */
+{
+ WmInfo *wmPtr;
+ ProtocolHandler *protPtr;
+ Tcl_Interp *interp;
+ Atom protocol;
+ int result;
+
+ wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
+ protocol = (Atom) eventPtr->xclient.data.l[0];
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ if (protocol == protPtr->protocol) {
+ Tcl_Preserve((ClientData) protPtr);
+ interp = protPtr->interp;
+ Tcl_Preserve((ClientData) interp);
+ result = Tcl_GlobalEval(interp, protPtr->command);
+ if (result != TCL_OK) {
+ Tcl_AddErrorInfo(interp, "\n (command for \"");
+ Tcl_AddErrorInfo(interp,
+ Tk_GetAtomName((Tk_Window) winPtr, protocol));
+ Tcl_AddErrorInfo(interp, "\" window manager protocol)");
+ Tk_BackgroundError(interp);
+ }
+ Tcl_Release((ClientData) interp);
+ Tcl_Release((ClientData) protPtr);
+ return;
+ }
+ }
+
+ /*
+ * No handler was present for this protocol. If this is a
+ * WM_DELETE_WINDOW message then just destroy the window.
+ */
+
+ if (protocol == Tk_InternAtom((Tk_Window) winPtr, "WM_DELETE_WINDOW")) {
+ Tk_DestroyWindow((Tk_Window) winPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_MacOSXIsAppInFront --
+ *
+ * Returns 1 if this app is the foreground app.
+ *
+ * Results:
+ * 1 if app is in front, 0 otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tk_MacOSXIsAppInFront (void)
+{
+ return tkMacOSXAppInFront;
+} \ No newline at end of file
diff --git a/tk/macosx/tkMacOSXWm.c b/tk/macosx/tkMacOSXWm.c
new file mode 100644
index 00000000000..f55b7b0270d
--- /dev/null
+++ b/tk/macosx/tkMacOSXWm.c
@@ -0,0 +1,5512 @@
+/*
+ * tkMacOSXWm.c --
+ *
+ * This module takes care of the interactions between a Tk-based
+ * application and the window manager. Among other things, it
+ * implements the "wm" command and passes geometry information
+ * to the window manager.
+ *
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+#include <Carbon/Carbon.h>
+
+#include "tkPort.h"
+#include "tkInt.h"
+#include "tkMacOSXInt.h"
+#include <errno.h>
+#include "tkScrollbar.h"
+#include "tkMacOSXWm.h"
+#include "tkMacOSXEvent.h"
+#include "tkMacOSXUtil.h"
+
+/*
+ * This is a list of all of the toplevels that have been mapped so far. It is
+ * used by the menu code to inval windows that were damaged by menus, and will
+ * eventually also be used to keep track of floating windows.
+ */
+
+TkMacOSXWindowList *tkMacOSXWindowListPtr = NULL;
+
+/*
+ * The variable below is 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.
+ */
+
+static int wmTracing = 0;
+
+/*
+ * The following structure is the official type record for geometry
+ * management of top-level windows.
+ */
+
+static void TopLevelReqProc _ANSI_ARGS_((ClientData dummy,
+ Tk_Window tkwin));
+
+static Tk_GeomMgr wmMgrType = {
+ "wm", /* name */
+ TopLevelReqProc, /* requestProc */
+ (Tk_GeomLostSlaveProc *) NULL, /* lostSlaveProc */
+};
+
+/*
+ * Hash table for Mac Window -> TkWindow mapping.
+ */
+
+static Tcl_HashTable windowTable;
+static int windowHashInit = false;
+
+/*
+ * Forward declarations for procedures defined in this file:
+ */
+
+static void InitialWindowBounds _ANSI_ARGS_((TkWindow *winPtr,
+ Rect *geometry));
+static int ParseGeometry _ANSI_ARGS_((Tcl_Interp *interp,
+ char *string, TkWindow *winPtr));
+static void TopLevelEventProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+static void TopLevelReqProc _ANSI_ARGS_((ClientData dummy,
+ Tk_Window tkwin));
+static void UpdateGeometryInfo _ANSI_ARGS_((
+ ClientData clientData));
+static void UpdateSizeHints _ANSI_ARGS_((TkWindow *winPtr));
+static void UpdateVRootGeometry _ANSI_ARGS_((WmInfo *wmPtr));
+static int WmAspectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmAttributesCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmClientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmColormapwindowsCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmCommandCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmDeiconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFocusmodelCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFrameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGeometryCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGridCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGroupCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconbitmapCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconmaskCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconnameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconpositionCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconwindowCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMaxsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMinsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmOverrideredirectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmPositionfromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmProtocolCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmResizableCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmSizefromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStackorderCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStateCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTitleCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTransientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmWithdrawCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static void WmUpdateGeom _ANSI_ARGS_((WmInfo *wmPtr,
+ TkWindow *winPtr));
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkWmNewWindow --
+ *
+ * This procedure is invoked whenever a new top-level
+ * window is created. Its job is to initialize the WmInfo
+ * structure for the window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A WmInfo structure gets allocated and initialized.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkWmNewWindow(
+ TkWindow *winPtr) /* Newly-created top-level window. */
+{
+ WmInfo *wmPtr;
+
+ wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
+ wmPtr->winPtr = winPtr;
+ wmPtr->reparent = None;
+ wmPtr->titleUid = NULL;
+ wmPtr->iconName = NULL;
+ wmPtr->master = None;
+ wmPtr->hints.flags = InputHint | StateHint;
+ wmPtr->hints.input = True;
+ wmPtr->hints.initial_state = NormalState;
+ wmPtr->hints.icon_pixmap = None;
+ wmPtr->hints.icon_window = None;
+ wmPtr->hints.icon_x = wmPtr->hints.icon_y = 0;
+ wmPtr->hints.icon_mask = None;
+ wmPtr->hints.window_group = None;
+ wmPtr->leaderName = NULL;
+ wmPtr->masterWindowName = NULL;
+ wmPtr->icon = NULL;
+ wmPtr->iconFor = NULL;
+ wmPtr->sizeHintsFlags = 0;
+ wmPtr->minWidth = wmPtr->minHeight = 1;
+
+ /*
+ * Default the maximum dimensions to the size of the display, minus
+ * a guess about how space is needed for window manager decorations.
+ */
+
+ wmPtr->maxWidth = DisplayWidth(winPtr->display, winPtr->screenNum) - 15;
+ wmPtr->maxHeight = DisplayHeight(winPtr->display, winPtr->screenNum) - 30;
+ wmPtr->gridWin = NULL;
+ wmPtr->widthInc = wmPtr->heightInc = 1;
+ wmPtr->minAspect.x = wmPtr->minAspect.y = 1;
+ wmPtr->maxAspect.x = wmPtr->maxAspect.y = 1;
+ wmPtr->reqGridWidth = wmPtr->reqGridHeight = -1;
+ wmPtr->gravity = NorthWestGravity;
+ wmPtr->width = -1;
+ wmPtr->height = -1;
+ wmPtr->x = winPtr->changes.x;
+ wmPtr->y = winPtr->changes.y;
+ wmPtr->parentWidth = winPtr->changes.width
+ + 2*winPtr->changes.border_width;
+ wmPtr->parentHeight = winPtr->changes.height
+ + 2*winPtr->changes.border_width;
+ wmPtr->xInParent = 0;
+ wmPtr->yInParent = 0;
+ wmPtr->cmapList = NULL;
+ wmPtr->cmapCount = 0;
+ wmPtr->configWidth = -1;
+ wmPtr->configHeight = -1;
+ wmPtr->vRoot = None;
+ wmPtr->protPtr = NULL;
+ wmPtr->cmdArgv = NULL;
+ wmPtr->clientMachine = NULL;
+ wmPtr->flags = WM_NEVER_MAPPED;
+ wmPtr->style = -1;
+ wmPtr->macClass = kDocumentWindowClass;
+ wmPtr->attributes = kWindowStandardDocumentAttributes;
+ wmPtr->scrollWinPtr = NULL;
+ winPtr->wmInfoPtr = wmPtr;
+
+ UpdateVRootGeometry(wmPtr);
+
+ /*
+ * Tk must monitor structure events for top-level windows, in order
+ * to detect size and position changes caused by window managers.
+ */
+
+ Tk_CreateEventHandler((Tk_Window) winPtr, StructureNotifyMask,
+ TopLevelEventProc, (ClientData) winPtr);
+
+ /*
+ * Arrange for geometry requests to be reflected from the window
+ * to the window manager.
+ */
+
+ Tk_ManageGeometry((Tk_Window) winPtr, &wmMgrType, (ClientData) 0);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkWmMapWindow --
+ *
+ * This procedure is invoked to map a top-level window. This
+ * module gets a chance to update all window-manager-related
+ * information in properties before the window manager sees
+ * the map event and checks the properties. It also gets to
+ * decide whether or not to even map the window after all.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Properties of winPtr may get updated to provide up-to-date
+ * information to the window manager. The window may also get
+ * mapped, but it may not be if this procedure decides that
+ * isn't appropriate (e.g. because the window is withdrawn).
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkWmMapWindow(
+ TkWindow *winPtr) /* Top-level window that's about to
+ * be mapped. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Point where = {0, 0};
+ int xOffset, yOffset;
+ int firstMap = false;
+ MacDrawable *macWin;
+
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ wmPtr->flags &= ~WM_NEVER_MAPPED;
+ firstMap = true;
+
+ /*
+ * Create the underlying Mac window for this Tk window.
+ */
+ macWin = (MacDrawable *) winPtr->window;
+ if (!TkMacOSXHostToplevelExists(winPtr)) {
+ TkMacOSXMakeRealWindowExist(winPtr);
+ }
+
+ /*
+ * Generate configure event when we first map the window.
+ */
+ LocalToGlobal(&where);
+ TkMacOSXWindowOffset( GetWindowFromPort(TkMacOSXGetDrawablePort((Drawable) macWin)),
+ &xOffset, &yOffset);
+ where.h -= xOffset;
+ where.v -= yOffset;
+ TkGenWMConfigureEvent((Tk_Window) winPtr,
+ where.h, where.v, -1, -1, TK_LOCATION_CHANGED);
+
+ /*
+ * This is the first time this window has ever been mapped.
+ * Store all the window-manager-related information for the
+ * window.
+ */
+
+ if (wmPtr->titleUid == NULL) {
+ wmPtr->titleUid = winPtr->nameUid;
+ }
+
+ if (!Tk_IsEmbedded(winPtr)) {
+ TkSetWMName(winPtr, wmPtr->titleUid);
+ }
+
+ TkWmSetClass(winPtr);
+
+ if (wmPtr->iconName != NULL) {
+ XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
+ }
+
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ }
+ if (wmPtr->hints.initial_state == WithdrawnState) {
+ return;
+ }
+
+ /*
+ * TODO: we need to display a window if it's iconic on creation.
+ */
+
+ if (wmPtr->hints.initial_state == IconicState) {
+ return;
+ }
+
+ /*
+ * Update geometry information.
+ */
+ wmPtr->flags |= WM_ABOUT_TO_MAP;
+ if (wmPtr->flags & WM_UPDATE_PENDING) {
+ Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ }
+ UpdateGeometryInfo((ClientData) winPtr);
+ wmPtr->flags &= ~WM_ABOUT_TO_MAP;
+
+ /*
+ * Map the window.
+ */
+
+ XMapWindow(winPtr->display, winPtr->window);
+
+ /*
+ * Now that the window is visable we can determine the offset
+ * from the window's content orgin to the window's decorative
+ * orgin (structure orgin).
+ */
+ TkMacOSXWindowOffset( GetWindowFromPort(TkMacOSXGetDrawablePort(Tk_WindowId(winPtr))),
+ &wmPtr->xInParent, &wmPtr->yInParent);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkWmUnmapWindow --
+ *
+ * This procedure is invoked to unmap a top-level window.
+ * On the Macintosh all we do is call XUnmapWindow.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Unmaps the window.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkWmUnmapWindow(
+ TkWindow *winPtr) /* Top-level window that's about to
+ * be mapped. */
+{
+ XUnmapWindow(winPtr->display, winPtr->window);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkWmDeadWindow --
+ *
+ * This procedure is invoked when a top-level window is
+ * about to be deleted. It cleans up the wm-related data
+ * structures for the window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The WmInfo structure for winPtr gets freed up.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkWmDeadWindow(winPtr)
+ TkWindow *winPtr; /* Top-level window that's being deleted. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WmInfo *wmPtr2;
+
+ if (wmPtr == NULL) {
+ return;
+ }
+ if (wmPtr->hints.flags & IconPixmapHint) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
+ }
+ if (wmPtr->hints.flags & IconMaskHint) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
+ }
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
+ }
+ if (wmPtr->masterWindowName != NULL) {
+ ckfree(wmPtr->masterWindowName);
+ }
+ if (wmPtr->icon != NULL) {
+ wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr2->iconFor = NULL;
+ }
+ if (wmPtr->iconFor != NULL) {
+ wmPtr2 = ((TkWindow *) wmPtr->iconFor)->wmInfoPtr;
+ wmPtr2->icon = NULL;
+ wmPtr2->hints.flags &= ~IconWindowHint;
+ }
+ while (wmPtr->protPtr != NULL) {
+ ProtocolHandler *protPtr;
+
+ protPtr = wmPtr->protPtr;
+ wmPtr->protPtr = protPtr->nextPtr;
+ Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ }
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ }
+ if (wmPtr->flags & WM_UPDATE_PENDING) {
+ Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ }
+ ckfree((char *) wmPtr);
+ winPtr->wmInfoPtr = NULL;
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkWmSetClass --
+ *
+ * This procedure is invoked whenever a top-level window's
+ * class is changed. If the window has been mapped then this
+ * procedure updates the window manager property for the
+ * class. If the window hasn't been mapped, the update is
+ * deferred until just before the first mapping.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A window property may get updated.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkWmSetClass(
+ TkWindow *winPtr) /* Newly-created top-level window. */
+{
+ return;
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_WmObjCmd --
+ *
+ * This procedure is invoked to process the "wm" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+/* ARGSUSED */
+int
+Tk_WmObjCmd(
+ ClientData clientData, /* Main window associated with
+ * interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[]) /* Argument objects. */
+ {
+ Tk_Window tkwin = (Tk_Window) clientData;
+ static CONST char *optionStrings[] = {
+ "aspect", "attributes", "client", "colormapwindows",
+ "command", "deiconify", "focusmodel", "frame",
+ "geometry", "grid", "group", "iconbitmap",
+ "iconify", "iconmask", "iconname", "iconposition",
+ "iconwindow", "maxsize", "minsize", "overrideredirect",
+ "positionfrom", "protocol", "resizable", "sizefrom",
+ "stackorder", "state", "title", "transient",
+ "withdraw", (char *) NULL };
+ enum options {
+ WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS,
+ WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FRAME,
+ WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBITMAP,
+ WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME, WMOPT_ICONPOSITION,
+ WMOPT_ICONWINDOW, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT,
+ WMOPT_POSITIONFROM, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM,
+ WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT,
+ WMOPT_WITHDRAW };
+ int index, length;
+ char *argv1;
+ TkWindow *winPtr;
+
+ if (objc < 2) {
+wrongNumArgs:
+ Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?");
+ return TCL_ERROR;
+ }
+
+ argv1 = Tcl_GetStringFromObj(objv[1], &length);
+ if ((argv1[0] == 't') && (strncmp(argv1, "tracing", length) == 0)
+ && (length >= 3)) {
+ if ((objc != 2) && (objc != 3)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
+ return TCL_ERROR;
+ }
+ if (objc == 2) {
+ Tcl_SetResult(interp, ((wmTracing) ? "on" : "off"), TCL_STATIC);
+ return TCL_OK;
+ }
+ return Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing);
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (objc < 3) {
+ goto wrongNumArgs;
+ }
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], (Tk_Window *) &winPtr)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (!Tk_IsTopLevel(winPtr)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't a top-level window", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ switch ((enum options) index) {
+ case WMOPT_ASPECT:
+ return WmAspectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ATTRIBUTES:
+ return WmAttributesCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_CLIENT:
+ return WmClientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COLORMAPWINDOWS:
+ return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COMMAND:
+ return WmCommandCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_DEICONIFY:
+ return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FOCUSMODEL:
+ return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FRAME:
+ return WmFrameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GEOMETRY:
+ return WmGeometryCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GRID:
+ return WmGridCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GROUP:
+ return WmGroupCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONBITMAP:
+ return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONIFY:
+ return WmIconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONMASK:
+ return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONNAME:
+ return WmIconnameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONPOSITION:
+ return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONWINDOW:
+ return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MAXSIZE:
+ return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MINSIZE:
+ return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_OVERRIDEREDIRECT:
+ return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_POSITIONFROM:
+ return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_PROTOCOL:
+ return WmProtocolCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_RESIZABLE:
+ return WmResizableCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_SIZEFROM:
+ return WmSizefromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STACKORDER:
+ return WmStackorderCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STATE:
+ return WmStateCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TITLE:
+ return WmTitleCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TRANSIENT:
+ return WmTransientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_WITHDRAW:
+ return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv);
+ }
+
+ /* This should not happen */
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAspectCmd --
+ *
+ * This procedure is invoked to process the "wm aspect" 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
+WmAspectCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int numer1, denom1, numer2, denom2;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?minNumer minDenom maxNumer maxDenom?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PAspect) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
+ wmPtr->minAspect.y, wmPtr->maxAspect.x,
+ wmPtr->maxAspect.y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~PAspect;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &numer1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
+ (denom2 <= 0)) {
+ Tcl_SetResult(interp, "aspect number can't be <= 0",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+ wmPtr->minAspect.x = numer1;
+ wmPtr->minAspect.y = denom1;
+ wmPtr->maxAspect.x = numer2;
+ wmPtr->maxAspect.y = denom2;
+ wmPtr->sizeHintsFlags |= PAspect;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAttributesCmd --
+ *
+ * This procedure is invoked to process the "wm attributes" 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
+WmAttributesCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ char buf[TCL_INTEGER_SPACE];
+ int i;
+ WindowRef macWindow;
+
+ if (objc < 3) {
+configArgs:
+ Tcl_AppendResult(interp, "wrong # arguments: must be \"",
+ Tcl_GetStringFromObj (objv[0], NULL), " attributes window",
+ " ?-modified ?bool??",
+ " ?-titlepath ?path??",
+ "\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+ macWindow = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window));
+ if (objc == 3) {
+ FSSpec spec;
+ sprintf(buf, "%d", (IsWindowModified(macWindow) == true));
+ Tcl_AppendResult(interp, "-modified ", buf, (char *) NULL);
+ if (GetWindowProxyFSSpec(macWindow, &spec) == noErr) {
+ Tcl_AppendResult(interp, " -titlepath", (char *) NULL);
+ /* Need to get the path from the spec */
+ Tcl_AppendElement(interp, "<read_unimplemented>");
+ } else {
+ Tcl_AppendResult(interp, " -titlepath {}", (char *) NULL);
+ }
+ return TCL_OK;
+ }
+ for (i = 3; i < objc; i += 2) {
+ int length;
+ char *argPtr = Tcl_GetStringFromObj(objv[i], &length);
+ if ((length < 2) || (*argPtr != '-')) {
+ goto configArgs;
+ }
+ if (strncmp(argPtr, "-modified", length) == 0) {
+ int boolean;
+ if (i < objc - 1) {
+ if (Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ SetWindowModified(macWindow, boolean);
+ }
+ } else if (strncmp(argPtr, "-titlepath", length) == 0) {
+ if (i < objc - 1) {
+ OSErr err;
+ FSSpec spec;
+ FSRef ref;
+ Boolean isDirectory;
+ err = FSPathMakeRef(Tcl_GetStringFromObj(objv[i+1], NULL), &ref, &isDirectory);
+ if (err == noErr) {
+ err = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL,
+ &spec, NULL);
+ if (err == noErr) {
+ if (SetWindowProxyFSSpec(macWindow,&spec) != noErr) {
+ Tcl_AppendResult(interp, "couldn't set window proxy title path",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ }
+ }
+ }
+ } else {
+ goto configArgs;
+ }
+ if (i == objc - 2) {
+ /* Want to return last result */
+ Tcl_SetObjResult(interp, objv[i+1]);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmClientCmd --
+ *
+ * This procedure is invoked to process the "wm client" 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
+WmClientCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->clientMachine != NULL) {
+ Tcl_SetResult(interp, wmPtr->clientMachine, TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (argv3[0] == 0) {
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ wmPtr->clientMachine = NULL;
+ }
+ return TCL_OK;
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ }
+ wmPtr->clientMachine = (char *)
+ ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->clientMachine, argv3);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmColormapwindowsCmd --
+ *
+ * This procedure is invoked to process the "wm colormapwindows"
+ * 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
+WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ TkWindow **cmapList;
+ TkWindow *winPtr2;
+ int i, windowObjc, gotToplevel = 0;
+ Tcl_Obj **windowObjv;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?windowList?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ for (i = 0; i < wmPtr->cmapCount; i++) {
+ if ((i == (wmPtr->cmapCount-1))
+ && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
+ break;
+ }
+ Tcl_AppendElement(interp, wmPtr->cmapList[i]->pathName);
+ }
+ return TCL_OK;
+ }
+ if (Tcl_ListObjGetElements(interp, objv[3], &windowObjc, &windowObjv)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ cmapList = (TkWindow **) ckalloc((unsigned)
+ ((windowObjc+1)*sizeof(TkWindow*)));
+ for (i = 0; i < windowObjc; i++) {
+ if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
+ (Tk_Window *) &winPtr2) != TCL_OK)
+ {
+ ckfree((char *) cmapList);
+ return TCL_ERROR;
+ }
+ if (winPtr2 == winPtr) {
+ gotToplevel = 1;
+ }
+ if (winPtr2->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr2);
+ }
+ cmapList[i] = winPtr2;
+ }
+ if (!gotToplevel) {
+ wmPtr->flags |= WM_ADDED_TOPLEVEL_COLORMAP;
+ cmapList[windowObjc] = winPtr;
+ windowObjc++;
+ } else {
+ wmPtr->flags &= ~WM_ADDED_TOPLEVEL_COLORMAP;
+ }
+ wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
+ if (wmPtr->cmapList != NULL) {
+ ckfree((char *)wmPtr->cmapList);
+ }
+ wmPtr->cmapList = cmapList;
+ wmPtr->cmapCount = windowObjc;
+
+ /*
+ * On the Macintosh all of this is just an excercise
+ * in compatability as we don't support colormaps. If
+ * we did they would be installed here.
+ */
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmCommandCmd --
+ *
+ * This procedure is invoked to process the "wm command" 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
+WmCommandCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int cmdArgc;
+ CONST char **cmdArgv;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->cmdArgv != NULL) {
+ Tcl_SetResult(interp,
+ Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
+ TCL_DYNAMIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (argv3[0] == 0) {
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ wmPtr->cmdArgv = NULL;
+ }
+ return TCL_OK;
+ }
+ if (Tcl_SplitList(interp, argv3, &cmdArgc, &cmdArgv) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ }
+ wmPtr->cmdArgc = cmdArgc;
+ wmPtr->cmdArgv = cmdArgv;
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmDeiconifyCmd --
+ *
+ * This procedure is invoked to process the "wm deiconify" 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
+WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't deiconify ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * TODO: may not want to call this function - look at Map events gened.
+ */
+
+ TkpWmSetState(winPtr, NormalState);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFocusmodelCmd --
+ *
+ * This procedure is invoked to process the "wm focusmodel" 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
+WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "active", "passive", (char *) NULL };
+ enum options {
+ OPT_ACTIVE, OPT_PASSIVE };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?active|passive?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp, (wmPtr->hints.input ? "passive" : "active"),
+ TCL_STATIC);
+ return TCL_OK;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == OPT_ACTIVE) {
+ wmPtr->hints.input = False;
+ } else { /* OPT_PASSIVE */
+ wmPtr->hints.input = True;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFrameCmd --
+ *
+ * This procedure is invoked to process the "wm frame" 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
+WmFrameCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Window window;
+ char buf[TCL_INTEGER_SPACE];
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ window = wmPtr->reparent;
+ if (window == None) {
+ window = Tk_WindowId((Tk_Window) winPtr);
+ }
+ sprintf(buf, "0x%x", (unsigned int) window);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGeometryCmd --
+ *
+ * This procedure is invoked to process the "wm geometry" 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
+WmGeometryCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char xSign, ySign;
+ int width, height;
+ char *argv3;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[16 + TCL_INTEGER_SPACE * 4];
+
+ xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
+ ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
+ if (wmPtr->gridWin != NULL) {
+ width = wmPtr->reqGridWidth + (winPtr->changes.width
+ - winPtr->reqWidth)/wmPtr->widthInc;
+ height = wmPtr->reqGridHeight + (winPtr->changes.height
+ - winPtr->reqHeight)/wmPtr->heightInc;
+ } else {
+ width = winPtr->changes.width;
+ height = winPtr->changes.height;
+ }
+ sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
+ ySign, wmPtr->y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ wmPtr->width = -1;
+ wmPtr->height = -1;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+ }
+ return ParseGeometry(interp, argv3, winPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGridCmd --
+ *
+ * This procedure is invoked to process the "wm grid" 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
+WmGridCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int reqWidth, reqHeight, widthInc, heightInc;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?baseWidth baseHeight widthInc heightInc?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PBaseSize) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->reqGridWidth,
+ wmPtr->reqGridHeight, wmPtr->widthInc,
+ wmPtr->heightInc);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ /*
+ * Turn off gridding and reset the width and height
+ * to make sense as ungridded numbers.
+ */
+
+ wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
+ if (wmPtr->width != -1) {
+ wmPtr->width = winPtr->reqWidth + (wmPtr->width
+ - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ wmPtr->height = winPtr->reqHeight + (wmPtr->height
+ - wmPtr->reqGridHeight)*wmPtr->heightInc;
+ }
+ wmPtr->widthInc = 1;
+ wmPtr->heightInc = 1;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &reqWidth) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &heightInc) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if (reqWidth < 0) {
+ Tcl_SetResult(interp, "baseWidth can't be < 0", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ if (reqHeight < 0) {
+ Tcl_SetResult(interp, "baseHeight can't be < 0", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ if (widthInc < 0) {
+ Tcl_SetResult(interp, "widthInc can't be < 0", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ if (heightInc < 0) {
+ Tcl_SetResult(interp, "heightInc can't be < 0", TCL_STATIC);
+ return TCL_ERROR;
+ }
+ Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
+ heightInc);
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGroupCmd --
+ *
+ * This procedure is invoked to process the "wm group" 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
+WmGroupCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & WindowGroupHint) {
+ Tcl_SetResult(interp, wmPtr->leaderName, TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (*argv3 == '\0') {
+ wmPtr->hints.flags &= ~WindowGroupHint;
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
+ }
+ wmPtr->leaderName = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ Tk_MakeWindowExist(tkwin2);
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
+ }
+ wmPtr->hints.window_group = Tk_WindowId(tkwin2);
+ wmPtr->hints.flags |= WindowGroupHint;
+ wmPtr->leaderName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->leaderName, argv3);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconbitmapCmd --
+ *
+ * This procedure is invoked to process the "wm iconbitmap" 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
+WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ Pixmap pixmap;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconPixmapHint) {
+ Tcl_SetResult(interp,
+ (char *) Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
+ TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ if (wmPtr->hints.icon_pixmap != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
+ wmPtr->hints.icon_pixmap = None;
+ }
+ wmPtr->hints.flags &= ~IconPixmapHint;
+ } else {
+ OSErr err;
+ FSSpec spec;
+ FSRef ref;
+ Boolean isDirectory;
+ err = FSPathMakeRef(Tcl_GetStringFromObj(objv[3], NULL), &ref, &isDirectory);
+ if (err == noErr) {
+ err = FSGetCatalogInfo (&ref, kFSCatInfoNone, NULL, NULL, &spec, NULL);
+ if (err == noErr) {
+ WindowRef macWin
+ = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window));
+ SetWindowProxyFSSpec(macWin, &spec);
+ return TCL_OK;
+ }
+ }
+ pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr,
+ Tk_GetUid(Tcl_GetStringFromObj(objv[3], NULL)));
+ if (pixmap == None) {
+ return TCL_ERROR;
+ }
+ wmPtr->hints.icon_pixmap = pixmap;
+ wmPtr->hints.flags |= IconPixmapHint;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconifyCmd --
+ *
+ * This procedure is invoked to process the "wm iconify" 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
+WmIconifyCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": override-redirect flag is set", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->master != None) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+ TkpWmSetState(winPtr, IconicState);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconmaskCmd --
+ *
+ * This procedure is invoked to process the "wm iconmask" 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
+WmIconmaskCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Pixmap pixmap;
+ char *argv3;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconMaskHint) {
+ Tcl_SetResult(interp,
+ (char *) Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
+ TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ if (wmPtr->hints.icon_mask != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
+ }
+ wmPtr->hints.flags &= ~IconMaskHint;
+ } else {
+ pixmap = Tk_GetBitmap(interp, tkwin, argv3);
+ if (pixmap == None) {
+ return TCL_ERROR;
+ }
+ wmPtr->hints.icon_mask = pixmap;
+ wmPtr->hints.flags |= IconMaskHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconnameCmd --
+ *
+ * This procedure is invoked to process the "wm iconname" 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
+WmIconnameCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ CONST char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp,
+ (char *) ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ if (wmPtr->iconName != NULL) {
+ ckfree((char *) wmPtr->iconName);
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->iconName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->iconName, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconpositionCmd --
+ *
+ * This procedure is invoked to process the "wm iconposition"
+ * 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
+WmIconpositionCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int x, y;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?x y?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconPositionHint) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->hints.icon_x,
+ wmPtr->hints.icon_y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconPositionHint;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)){
+ return TCL_ERROR;
+ }
+ wmPtr->hints.icon_x = x;
+ wmPtr->hints.icon_y = y;
+ wmPtr->hints.flags |= IconPositionHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconwindowCmd --
+ *
+ * This procedure is invoked to process the "wm iconwindow" 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
+WmIconwindowCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ WmInfo *wmPtr2;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->icon != NULL) {
+ Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconWindowHint;
+ if (wmPtr->icon != NULL) {
+ wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr2->iconFor = NULL;
+ wmPtr2->hints.initial_state = WithdrawnState;
+ }
+ wmPtr->icon = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (!Tk_IsTopLevel(tkwin2)) {
+ Tcl_AppendResult(interp, "can't use ", Tcl_GetString(objv[3]),
+ " as icon window: not at top level", (char *) NULL);
+ return TCL_ERROR;
+ }
+ wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
+ if (wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[3]),
+ " is already an icon for ",
+ Tk_PathName(wmPtr2->iconFor), (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->icon != NULL) {
+ WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr3->iconFor = NULL;
+ }
+ Tk_MakeWindowExist(tkwin2);
+ wmPtr->hints.icon_window = Tk_WindowId(tkwin2);
+ wmPtr->hints.flags |= IconWindowHint;
+ wmPtr->icon = tkwin2;
+ wmPtr2->iconFor = (Tk_Window) winPtr;
+ if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
+ /*
+ * Don't have iconwindows on the Mac. We just withdraw.
+ */
+
+ Tk_UnmapWindow(tkwin2);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMaxsizeCmd --
+ *
+ * This procedure is invoked to process the "wm maxsize" 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
+WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->maxWidth, wmPtr->maxHeight);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->maxWidth = width;
+ wmPtr->maxHeight = height;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMinsizeCmd --
+ *
+ * This procedure is invoked to process the "wm minsize" 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
+WmMinsizeCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->minWidth, wmPtr->minHeight);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->minWidth = width;
+ wmPtr->minHeight = height;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmOverrideredirectCmd --
+ *
+ * This procedure is invoked to process the "wm overrideredirect"
+ * 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
+WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int boolean;
+ XSetWindowAttributes atts;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp),
+ Tk_Attributes((Tk_Window) winPtr)->override_redirect);
+ return TCL_OK;
+ }
+ if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ atts.override_redirect = (boolean) ? True : False;
+ Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
+ &atts);
+ wmPtr->style = (boolean) ? plainDBox : documentProc;
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmPositionfromCmd --
+ *
+ * This procedure is invoked to process the "wm positionfrom"
+ * 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
+WmPositionfromCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user/program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USPosition) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PPosition) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PPosition;
+ wmPtr->sizeHintsFlags |= USPosition;
+ } else {
+ wmPtr->sizeHintsFlags &= ~USPosition;
+ wmPtr->sizeHintsFlags |= PPosition;
+ }
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmProtocolCmd --
+ *
+ * This procedure is invoked to process the "wm protocol" 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
+WmProtocolCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ register ProtocolHandler *protPtr, *prevPtr;
+ Atom protocol;
+ char *cmd;
+ int cmdLength;
+
+ if ((objc < 3) || (objc > 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ /*
+ * Return a list of all defined protocols for the window.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ Tcl_AppendElement(interp,
+ Tk_GetAtomName((Tk_Window) winPtr, protPtr->protocol));
+ }
+ return TCL_OK;
+ }
+ protocol = Tk_InternAtom((Tk_Window) winPtr, Tcl_GetString(objv[3]));
+ if (objc == 4) {
+ /*
+ * Return the command to handle a given protocol.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ Tcl_SetResult(interp, protPtr->command, TCL_STATIC);
+ return TCL_OK;
+ }
+ }
+ return TCL_OK;
+ }
+
+ /*
+ * Delete any current protocol handler, then create a new
+ * one with the specified command, unless the command is
+ * empty.
+ */
+
+ for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
+ prevPtr = protPtr, protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ if (prevPtr == NULL) {
+ wmPtr->protPtr = protPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = protPtr->nextPtr;
+ }
+ Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ break;
+ }
+ }
+ cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
+ if (cmdLength > 0) {
+ protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr->protocol = protocol;
+ protPtr->nextPtr = wmPtr->protPtr;
+ wmPtr->protPtr = protPtr;
+ protPtr->interp = interp;
+ strcpy(protPtr->command, cmd);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmResizableCmd --
+ *
+ * This procedure is invoked to process the "wm resizable" 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
+WmResizableCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d",
+ (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetBooleanFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetBooleanFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if (width) {
+ wmPtr->flags &= ~WM_WIDTH_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
+ }
+ if (height) {
+ wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ if (wmPtr->scrollWinPtr != NULL) {
+ TkScrollbarEventuallyRedraw(
+ (TkScrollbar *) wmPtr->scrollWinPtr->instanceData);
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmSizefromCmd --
+ *
+ * This procedure is invoked to process the "wm sizefrom" 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
+WmSizefromCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user|program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USSize) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PSize) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USSize|PSize);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PSize;
+ wmPtr->sizeHintsFlags |= USSize;
+ } else { /* OPT_PROGRAM */
+ wmPtr->sizeHintsFlags &= ~USSize;
+ wmPtr->sizeHintsFlags |= PSize;
+ }
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStackorderCmd --
+ *
+ * This procedure is invoked to process the "wm stackorder" 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
+WmStackorderCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ TkWindow **windows, **window_ptr;
+ static CONST char *optionStrings[] = {
+ "isabove", "isbelow", (char *) NULL };
+ enum options {
+ OPT_ISABOVE, OPT_ISBELOW };
+ int index;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?isabove|isbelow window?");
+ return TCL_ERROR;
+ }
+
+ if (objc == 3) {
+ windows = TkWmStackorderToplevel(winPtr);
+ if (windows == NULL) {
+ panic("TkWmStackorderToplevel failed");
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ Tcl_AppendElement(interp, (*window_ptr)->pathName);
+ }
+ ckfree((char *) windows);
+ return TCL_OK;
+ }
+ } else {
+ TkWindow *winPtr2;
+ int index1=-1, index2=-1, result;
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[4], (Tk_Window *) &winPtr2)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (!Tk_IsTopLevel(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't a top-level window", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (!Tk_IsMapped(winPtr)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't mapped", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (!Tk_IsMapped(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't mapped", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ /*
+ * Lookup stacking order of all toplevels that are children
+ * of "." and find the position of winPtr and winPtr2
+ * in the stacking order.
+ */
+
+ windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
+
+ if (windows == NULL) {
+ Tcl_AppendResult(interp, "TkWmStackorderToplevel failed",
+ (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ if (*window_ptr == winPtr)
+ index1 = (window_ptr - windows);
+ if (*window_ptr == winPtr2)
+ index2 = (window_ptr - windows);
+ }
+ if (index1 == -1)
+ panic("winPtr window not found");
+ if (index2 == -1)
+ panic("winPtr2 window not found");
+
+ ckfree((char *) windows);
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == OPT_ISABOVE) {
+ result = index1 > index2;
+ } else { /* OPT_ISBELOW */
+ result = index1 < index2;
+ }
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
+ return TCL_OK;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStateCmd --
+ *
+ * This procedure is invoked to process the "wm state" 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
+WmStateCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "normal", "iconic", "withdrawn", "zoomed", (char *) NULL };
+ enum options {
+ OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED };
+ int index;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?state?");
+ return TCL_ERROR;
+ }
+ if (objc == 4) {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ winPtr->pathName, ": it is an embedded window",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ if (index == OPT_NORMAL) {
+ TkpWmSetState(winPtr, NormalState);
+ /*
+ * This varies from 'wm deiconify' because it does not
+ * force the window to be raised and receive focus
+ */
+ } else if (index == OPT_ICONIC) {
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": override-redirect flag is set",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->master != NULL) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
+ return TCL_ERROR;
+ }
+ TkpWmSetState(winPtr, IconicState);
+ } else if (index == OPT_WITHDRAWN) {
+ TkpWmSetState(winPtr, WithdrawnState);
+ } else { /* OPT_ZOOMED */
+ TkpWmSetState(winPtr, ZoomState);
+ }
+ } else {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_SetResult(interp, "icon", TCL_STATIC);
+ } else {
+ switch (wmPtr->hints.initial_state) {
+ case NormalState:
+ Tcl_SetResult(interp, "normal", TCL_STATIC);
+ break;
+ case IconicState:
+ Tcl_SetResult(interp, "iconic", TCL_STATIC);
+ break;
+ case WithdrawnState:
+ Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
+ break;
+ case ZoomState:
+ Tcl_SetResult(interp, "zoomed", TCL_STATIC);
+ break;
+ }
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTitleCmd --
+ *
+ * This procedure is invoked to process the "wm title" 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
+WmTitleCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp,
+ (char *) ((wmPtr->titleUid != NULL) ? wmPtr->titleUid : winPtr->nameUid),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->titleUid = Tk_GetUid(argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED) && !Tk_IsEmbedded(winPtr)) {
+ TkSetWMName(winPtr, wmPtr->titleUid);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTransientCmd --
+ *
+ * This procedure is invoked to process the "wm transient" 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
+WmTransientCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window master;
+ WmInfo *wmPtr2;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?master?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->master != None) {
+ Tcl_SetResult(interp, wmPtr->masterWindowName, TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ if (Tcl_GetString(objv[3])[0] == '\0') {
+ wmPtr->master = None;
+ if (wmPtr->masterWindowName != NULL) {
+ ckfree(wmPtr->masterWindowName);
+ }
+ wmPtr->masterWindowName = NULL;
+ wmPtr->style = documentProc;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &master) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ Tk_MakeWindowExist(master);
+
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[2]),
+ "\" a transient: it is an icon for ",
+ Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ wmPtr2 = ((TkWindow *) master)->wmInfoPtr;
+
+ /* Under some circumstances, wmPtr2 is NULL here */
+ if (wmPtr2 != NULL && wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[3]),
+ "\" a master: it is an icon for ",
+ Tk_PathName(wmPtr2->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->master = Tk_WindowId(master);
+ wmPtr->masterWindowName = ckalloc((unsigned) length+1);
+ strcpy(wmPtr->masterWindowName, argv3);
+ wmPtr->style = plainDBox;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmWithdrawCmd --
+ *
+ * This procedure is invoked to process the "wm withdraw" 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
+WmWithdrawCmd(tkwin, winPtr, interp, objc, objv)
+Tk_Window tkwin; /* Main window of the application. */
+TkWindow *winPtr; /* Toplevel to work with */
+Tcl_Interp *interp; /* Current interpreter. */
+int objc; /* Number of arguments. */
+Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't withdraw ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ TkpWmSetState(winPtr, WithdrawnState);
+ return TCL_OK;
+}
+
+/*
+ * Invoked by those wm subcommands that affect geometry.
+ * Schedules a geometry update.
+ */
+static void
+WmUpdateGeom(wmPtr, winPtr)
+WmInfo *wmPtr;
+TkWindow *winPtr;
+{
+ if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
+ Tk_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ wmPtr->flags |= WM_UPDATE_PENDING;
+ }
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_SetGrid --
+ *
+ * This procedure is invoked by a widget when it wishes to set a grid
+ * coordinate system that controls the size of a top-level window.
+ * It provides a C interface equivalent to the "wm grid" command and
+ * is usually asscoiated with the -setgrid option.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Grid-related information will be passed to the window manager, so
+ * that the top-level window associated with tkwin will resize on
+ * even grid units. If some other window already controls gridding
+ * for the top-level window then this procedure call has no effect.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_SetGrid(
+ Tk_Window tkwin, /* Token for window. New window mgr info
+ * will be posted for the top-level window
+ * associated with this window. */
+ int reqWidth, /* Width (in grid units) corresponding to
+ * the requested geometry for tkwin. */
+ int reqHeight, /* Height (in grid units) corresponding to
+ * the requested geometry for tkwin. */
+ int widthInc, int heightInc)/* Pixel increments corresponding to a
+ * change of one grid unit. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ WmInfo *wmPtr;
+
+ /*
+ * Find the top-level window for tkwin, plus the window manager
+ * information.
+ */
+
+ while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ winPtr = winPtr->parentPtr;
+ }
+ wmPtr = winPtr->wmInfoPtr;
+
+ if ((wmPtr->gridWin != NULL) && (wmPtr->gridWin != tkwin)) {
+ return;
+ }
+
+ if ((wmPtr->reqGridWidth == reqWidth)
+ && (wmPtr->reqGridHeight == reqHeight)
+ && (wmPtr->widthInc == widthInc)
+ && (wmPtr->heightInc == heightInc)
+ && ((wmPtr->sizeHintsFlags & (PBaseSize|PResizeInc))
+ == PBaseSize|PResizeInc)) {
+ return;
+ }
+
+ /*
+ * If gridding was previously off, then forget about any window
+ * size requests made by the user or via "wm geometry": these are
+ * in pixel units and there's no easy way to translate them to
+ * grid units since the new requested size of the top-level window in
+ * pixels may not yet have been registered yet (it may filter up
+ * the hierarchy in DoWhenIdle handlers). However, if the window
+ * has never been mapped yet then just leave the window size alone:
+ * assume that it is intended to be in grid units but just happened
+ * to have been specified before this procedure was called.
+ */
+
+ if ((wmPtr->gridWin == NULL) && !(wmPtr->flags & WM_NEVER_MAPPED)) {
+ wmPtr->width = -1;
+ wmPtr->height = -1;
+ }
+
+ /*
+ * Set the new gridding information, and start the process of passing
+ * all of this information to the window manager.
+ */
+
+ wmPtr->gridWin = tkwin;
+ wmPtr->reqGridWidth = reqWidth;
+ wmPtr->reqGridHeight = reqHeight;
+ wmPtr->widthInc = widthInc;
+ wmPtr->heightInc = heightInc;
+ wmPtr->sizeHintsFlags |= PBaseSize|PResizeInc;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
+ Tk_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ wmPtr->flags |= WM_UPDATE_PENDING;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_UnsetGrid --
+ *
+ * This procedure cancels the effect of a previous call
+ * to Tk_SetGrid.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If tkwin currently controls gridding for its top-level window,
+ * gridding is cancelled for that top-level window; if some other
+ * window controls gridding then this procedure has no effect.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_UnsetGrid(
+ Tk_Window tkwin) /* Token for window that is currently
+ * controlling gridding. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ WmInfo *wmPtr;
+
+ /*
+ * Find the top-level window for tkwin, plus the window manager
+ * information.
+ */
+
+ while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ winPtr = winPtr->parentPtr;
+ }
+ wmPtr = winPtr->wmInfoPtr;
+ if (tkwin != wmPtr->gridWin) {
+ return;
+ }
+
+ wmPtr->gridWin = NULL;
+ wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
+ if (wmPtr->width != -1) {
+ wmPtr->width = winPtr->reqWidth + (wmPtr->width
+ - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ wmPtr->height = winPtr->reqHeight + (wmPtr->height
+ - wmPtr->reqGridHeight)*wmPtr->heightInc;
+ }
+ wmPtr->widthInc = 1;
+ wmPtr->heightInc = 1;
+
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
+ Tk_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ wmPtr->flags |= WM_UPDATE_PENDING;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TopLevelEventProc --
+ *
+ * This procedure is invoked when a top-level (or other externally-
+ * managed window) is restructured in any way.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Tk's internal data structures for the window get modified to
+ * reflect the structural change.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+TopLevelEventProc(
+ ClientData clientData, /* Window for which event occurred. */
+ XEvent *eventPtr) /* Event that just happened. */
+{
+ TkWindow *winPtr = (TkWindow *) clientData;
+
+ winPtr->wmInfoPtr->flags |= WM_VROOT_OFFSET_STALE;
+ if (eventPtr->type == DestroyNotify) {
+ Tk_ErrorHandler handler;
+
+ if (!(winPtr->flags & TK_ALREADY_DEAD)) {
+ /*
+ * A top-level window was deleted externally (e.g., by the window
+ * manager). This is probably not a good thing, but cleanup as
+ * best we can. The error handler is needed because
+ * Tk_DestroyWindow will try to destroy the window, but of course
+ * it's already gone.
+ */
+
+ handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
+ (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ Tk_DestroyWindow((Tk_Window) winPtr);
+ Tk_DeleteErrorHandler(handler);
+ }
+ if (wmTracing) {
+ printf("TopLevelEventProc: %s deleted\n", winPtr->pathName);
+ }
+ } else if (eventPtr->type == ReparentNotify) {
+ panic("recieved unwanted reparent event");
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TopLevelReqProc --
+ *
+ * This procedure is invoked by the geometry manager whenever
+ * the requested size for a top-level window is changed.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Arrange for the window to be resized to satisfy the request
+ * (this happens as a when-idle action).
+ *
+ *----------------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+static void
+TopLevelReqProc(
+ ClientData dummy, /* Not used. */
+ Tk_Window tkwin) /* Information about window. */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ WmInfo *wmPtr;
+
+ wmPtr = winPtr->wmInfoPtr;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
+ Tk_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ wmPtr->flags |= WM_UPDATE_PENDING;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * UpdateGeometryInfo --
+ *
+ * This procedure is invoked when a top-level window is first
+ * mapped, and also as a when-idle procedure, to bring the
+ * geometry and/or position of a top-level window back into
+ * line with what has been requested by the user and/or widgets.
+ * This procedure doesn't return until the window manager has
+ * responded to the geometry change.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The window's size and location may change, unless the WM prevents
+ * that from happening.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+UpdateGeometryInfo(
+ ClientData clientData) /* Pointer to the window's record. */
+{
+ TkWindow *winPtr = (TkWindow *) clientData;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int x, y, width, height;
+ unsigned long serial;
+
+ wmPtr->flags &= ~WM_UPDATE_PENDING;
+
+ /*
+ * Compute the new size for the top-level window. See the
+ * user documentation for details on this, but the size
+ * requested depends on (a) the size requested internally
+ * by the window's widgets, (b) the size requested by the
+ * user in a "wm geometry" command or via wm-based interactive
+ * resizing (if any), and (c) whether or not the window is
+ * gridded. Don't permit sizes <= 0 because this upsets
+ * the X server.
+ */
+
+ if (wmPtr->width == -1) {
+ width = winPtr->reqWidth;
+ } else if (wmPtr->gridWin != NULL) {
+ width = winPtr->reqWidth
+ + (wmPtr->width - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ } else {
+ width = wmPtr->width;
+ }
+ if (width <= 0) {
+ width = 1;
+ }
+ if (wmPtr->height == -1) {
+ height = winPtr->reqHeight;
+ } else if (wmPtr->gridWin != NULL) {
+ height = winPtr->reqHeight
+ + (wmPtr->height - wmPtr->reqGridHeight)*wmPtr->heightInc;
+ } else {
+ height = wmPtr->height;
+ }
+ if (height <= 0) {
+ height = 1;
+ }
+
+ /*
+ * Compute the new position for the upper-left pixel of the window's
+ * decorative frame. This is tricky, because we need to include the
+ * border widths supplied by a reparented parent in this calculation,
+ * but can't use the parent's current overall size since that may
+ * change as a result of this code.
+ */
+
+ if (wmPtr->flags & WM_NEGATIVE_X) {
+ x = wmPtr->vRootWidth - wmPtr->x
+ - (width + (wmPtr->parentWidth - winPtr->changes.width));
+ } else {
+ x = wmPtr->x;
+ }
+ if (wmPtr->flags & WM_NEGATIVE_Y) {
+ y = wmPtr->vRootHeight - wmPtr->y
+ - (height + (wmPtr->parentHeight - winPtr->changes.height));
+ } else {
+ y = wmPtr->y;
+ }
+
+ /*
+ * If the window's size is going to change and the window is
+ * supposed to not be resizable by the user, then we have to
+ * update the size hints. There may also be a size-hint-update
+ * request pending from somewhere else, too.
+ */
+
+ if (((width != winPtr->changes.width)
+ || (height != winPtr->changes.height))
+ && (wmPtr->gridWin == NULL)
+ && ((wmPtr->sizeHintsFlags & (PMinSize|PMaxSize)) == 0)) {
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ }
+ if (wmPtr->flags & WM_UPDATE_SIZE_HINTS) {
+ UpdateSizeHints(winPtr);
+ }
+
+ /*
+ * Reconfigure the window if it isn't already configured correctly.
+ * A few tricky points:
+ *
+ * 1. If the window is embedded and the container is also in this
+ * process, don't actually reconfigure the window; just pass the
+ * desired size on to the container. Also, zero out any position
+ * information, since embedded windows are not allowed to move.
+ * 2. Sometimes the window manager will give us a different size
+ * than we asked for (e.g. mwm has a minimum size for windows), so
+ * base the size check on what we *asked for* last time, not what we
+ * got.
+ * 3. Don't move window unless a new position has been requested for
+ * it. This is because of "features" in some window managers (e.g.
+ * twm, as of 4/24/91) where they don't interpret coordinates
+ * according to ICCCM. Moving a window to its current location may
+ * cause it to shift position on the screen.
+ */
+
+ if (Tk_IsEmbedded(winPtr)) {
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(winPtr);
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ if (contWinPtr != NULL) {
+ /*
+ * This window is embedded and the container is also in this
+ * process, so we don't need to do anything special about the
+ * geometry, except to make sure that the desired size is known
+ * by the container. Also, zero out any position information,
+ * since embedded windows are not allowed to move.
+ */
+
+ wmPtr->x = wmPtr->y = 0;
+ wmPtr->flags &= ~(WM_NEGATIVE_X|WM_NEGATIVE_Y);
+ Tk_GeometryRequest((Tk_Window) contWinPtr, width, height);
+ }
+ return;
+ }
+ serial = NextRequest(winPtr->display);
+ if (wmPtr->flags & WM_MOVE_PENDING) {
+ wmPtr->configWidth = width;
+ wmPtr->configHeight = height;
+ if (wmTracing) {
+ printf(
+ "UpdateGeometryInfo moving to %d %d, resizing to %d x %d,\n",
+ x, y, width, height);
+ }
+ Tk_MoveResizeWindow((Tk_Window) winPtr, x, y, (unsigned) width,
+ (unsigned) height);
+ } else if ((width != wmPtr->configWidth)
+ || (height != wmPtr->configHeight)) {
+ wmPtr->configWidth = width;
+ wmPtr->configHeight = height;
+ if (wmTracing) {
+ printf("UpdateGeometryInfo resizing to %d x %d\n", width, height);
+ }
+ Tk_ResizeWindow((Tk_Window) winPtr, (unsigned) width,
+ (unsigned) height);
+ } else {
+ return;
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * UpdateSizeHints --
+ *
+ * This procedure is called to update the window manager's
+ * size hints information from the information in a WmInfo
+ * structure.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Properties get changed for winPtr.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+UpdateSizeHints(
+ TkWindow *winPtr)
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ XSizeHints *hintsPtr;
+
+ wmPtr->flags &= ~WM_UPDATE_SIZE_HINTS;
+
+ hintsPtr = XAllocSizeHints();
+ if (hintsPtr == NULL) {
+ return;
+ }
+
+ /*
+ * Compute the pixel-based sizes for the various fields in the
+ * size hints structure, based on the grid-based sizes in
+ * our structure.
+ */
+
+ if (wmPtr->gridWin != NULL) {
+ hintsPtr->base_width = winPtr->reqWidth
+ - (wmPtr->reqGridWidth * wmPtr->widthInc);
+ if (hintsPtr->base_width < 0) {
+ hintsPtr->base_width = 0;
+ }
+ hintsPtr->base_height = winPtr->reqHeight
+ - (wmPtr->reqGridHeight * wmPtr->heightInc);
+ if (hintsPtr->base_height < 0) {
+ hintsPtr->base_height = 0;
+ }
+ hintsPtr->min_width = hintsPtr->base_width
+ + (wmPtr->minWidth * wmPtr->widthInc);
+ hintsPtr->min_height = hintsPtr->base_height
+ + (wmPtr->minHeight * wmPtr->heightInc);
+ hintsPtr->max_width = hintsPtr->base_width
+ + (wmPtr->maxWidth * wmPtr->widthInc);
+ hintsPtr->max_height = hintsPtr->base_height
+ + (wmPtr->maxHeight * wmPtr->heightInc);
+ } else {
+ hintsPtr->min_width = wmPtr->minWidth;
+ hintsPtr->min_height = wmPtr->minHeight;
+ hintsPtr->max_width = wmPtr->maxWidth;
+ hintsPtr->max_height = wmPtr->maxHeight;
+ hintsPtr->base_width = 0;
+ hintsPtr->base_height = 0;
+ }
+ hintsPtr->width_inc = wmPtr->widthInc;
+ hintsPtr->height_inc = wmPtr->heightInc;
+ hintsPtr->min_aspect.x = wmPtr->minAspect.x;
+ hintsPtr->min_aspect.y = wmPtr->minAspect.y;
+ hintsPtr->max_aspect.x = wmPtr->maxAspect.x;
+ hintsPtr->max_aspect.y = wmPtr->maxAspect.y;
+ hintsPtr->win_gravity = wmPtr->gravity;
+ hintsPtr->flags = wmPtr->sizeHintsFlags | PMinSize | PMaxSize;
+
+ /*
+ * If the window isn't supposed to be resizable, then set the
+ * minimum and maximum dimensions to be the same.
+ */
+
+ if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
+ if (wmPtr->width >= 0) {
+ hintsPtr->min_width = wmPtr->width;
+ } else {
+ hintsPtr->min_width = winPtr->reqWidth;
+ }
+ hintsPtr->max_width = hintsPtr->min_width;
+ }
+ if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
+ if (wmPtr->height >= 0) {
+ hintsPtr->min_height = wmPtr->height;
+ } else {
+ hintsPtr->min_height = winPtr->reqHeight;
+ }
+ hintsPtr->max_height = hintsPtr->min_height;
+ }
+
+ XSetWMNormalHints(winPtr->display, winPtr->window, hintsPtr);
+
+ XFree((char *) hintsPtr);
+}
+
+/*
+ *--------------------------------------------------------------
+ *
+ * ParseGeometry --
+ *
+ * This procedure parses a geometry string and updates
+ * information used to control the geometry of a top-level
+ * window.
+ *
+ * Results:
+ * A standard Tcl return value, plus an error message in
+ * the interp's result if an error occurs.
+ *
+ * Side effects:
+ * The size and/or location of winPtr may change.
+ *
+ *--------------------------------------------------------------
+ */
+
+static int
+ParseGeometry(
+ Tcl_Interp *interp, /* Used for error reporting. */
+ char *string, /* String containing new geometry. Has the
+ * standard form "=wxh+x+y". */
+ TkWindow *winPtr) /* Pointer to top-level window whose
+ * geometry is to be changed. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int x, y, width, height, flags;
+ char *end;
+ char *p = string;
+
+ /*
+ * The leading "=" is optional.
+ */
+
+ if (*p == '=') {
+ p++;
+ }
+
+ /*
+ * Parse the width and height, if they are present. Don't
+ * actually update any of the fields of wmPtr until we've
+ * successfully parsed the entire geometry string.
+ */
+
+ width = wmPtr->width;
+ height = wmPtr->height;
+ x = wmPtr->x;
+ y = wmPtr->y;
+ flags = wmPtr->flags;
+ if (isdigit(UCHAR(*p))) {
+ width = strtoul(p, &end, 10);
+ p = end;
+ if (*p != 'x') {
+ goto error;
+ }
+ p++;
+ if (!isdigit(UCHAR(*p))) {
+ goto error;
+ }
+ height = strtoul(p, &end, 10);
+ p = end;
+ }
+
+ /*
+ * Parse the X and Y coordinates, if they are present.
+ */
+
+ if (*p != '\0') {
+ flags &= ~(WM_NEGATIVE_X | WM_NEGATIVE_Y);
+ if (*p == '-') {
+ flags |= WM_NEGATIVE_X;
+ } else if (*p != '+') {
+ goto error;
+ }
+ x = strtol(p+1, &end, 10);
+ p = end;
+ if (*p == '-') {
+ flags |= WM_NEGATIVE_Y;
+ } else if (*p != '+') {
+ goto error;
+ }
+ y = strtol(p+1, &end, 10);
+ if (*end != '\0') {
+ goto error;
+ }
+
+ /*
+ * Assume that the geometry information came from the user,
+ * unless an explicit source has been specified. Otherwise
+ * most window managers assume that the size hints were
+ * program-specified and they ignore them.
+ */
+
+ if ((wmPtr->sizeHintsFlags & (USPosition|PPosition)) == 0) {
+ wmPtr->sizeHintsFlags |= USPosition;
+ flags |= WM_UPDATE_SIZE_HINTS;
+ }
+ }
+
+ /*
+ * Everything was parsed OK. Update the fields of *wmPtr and
+ * arrange for the appropriate information to be percolated out
+ * to the window manager at the next idle moment.
+ */
+
+ wmPtr->width = width;
+ wmPtr->height = height;
+ if ((x != wmPtr->x) || (y != wmPtr->y)
+ || ((flags & (WM_NEGATIVE_X|WM_NEGATIVE_Y))
+ != (wmPtr->flags & (WM_NEGATIVE_X|WM_NEGATIVE_Y)))) {
+ wmPtr->x = x;
+ wmPtr->y = y;
+ flags |= WM_MOVE_PENDING;
+ }
+ wmPtr->flags = flags;
+
+ if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
+ Tk_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
+ wmPtr->flags |= WM_UPDATE_PENDING;
+ }
+ return TCL_OK;
+
+ error:
+ Tcl_AppendResult(interp, "bad geometry specifier \"",
+ string, "\"", (char *) NULL);
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetRootCoords --
+ *
+ * Given a token for a window, this procedure traces through the
+ * window's lineage to find the (virtual) root-window coordinates
+ * corresponding to point (0,0) in the window.
+ *
+ * Results:
+ * The locations pointed to by xPtr and yPtr are filled in with
+ * the root coordinates of the (0,0) point in tkwin. If a virtual
+ * root window is in effect for the window, then the coordinates
+ * in the virtual root are returned.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_GetRootCoords(
+ Tk_Window tkwin, /* Token for window. */
+ int *xPtr, /* Where to store x-displacement of (0,0). */
+ int *yPtr) /* Where to store y-displacement of (0,0). */
+{
+ int x, y;
+ TkWindow *winPtr = (TkWindow *) tkwin;
+
+ /*
+ * Search back through this window's parents all the way to a
+ * top-level window, combining the offsets of each window within
+ * its parent.
+ */
+
+ x = y = 0;
+ while (1) {
+ x += winPtr->changes.x + winPtr->changes.border_width;
+ y += winPtr->changes.y + winPtr->changes.border_width;
+ if (winPtr->flags & TK_TOP_LEVEL) {
+ if (!(Tk_IsEmbedded(winPtr))) {
+ x += winPtr->wmInfoPtr->xInParent;
+ y += winPtr->wmInfoPtr->yInParent;
+ break;
+ } else {
+ TkWindow *otherPtr;
+
+ otherPtr = TkpGetOtherWindow(winPtr);
+ if (otherPtr != NULL) {
+ /*
+ * The container window is in the same application.
+ * Query its coordinates.
+ */
+ winPtr = otherPtr;
+
+ /*
+ * Remember to offset by the container window here,
+ * since at the end of this if branch, we will
+ * pop out to the container's parent...
+ */
+
+ x += winPtr->changes.x + winPtr->changes.border_width;
+ y += winPtr->changes.y + winPtr->changes.border_width;
+
+ } else {
+ Point theOffset;
+
+ if (gMacEmbedHandler->getOffsetProc != NULL) {
+ /*
+ * We do not require that the changes.x & changes.y for
+ * a non-Tk master window be kept up to date. So we
+ * first subtract off the possibly bogus values that have
+ * been added on at the top of this pass through the loop,
+ * and then call out to the getOffsetProc to give us
+ * the correct offset.
+ */
+
+ x -= winPtr->changes.x + winPtr->changes.border_width;
+ y -= winPtr->changes.y + winPtr->changes.border_width;
+
+ gMacEmbedHandler->getOffsetProc((Tk_Window) winPtr, &theOffset);
+
+ x += theOffset.h;
+ y += theOffset.v;
+ }
+ break;
+ }
+ }
+ }
+ winPtr = winPtr->parentPtr;
+ }
+ *xPtr = x;
+ *yPtr = y;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_CoordsToWindow --
+ *
+ * This is a Macintosh specific implementation of this function.
+ * Given the root coordinates of a point, this procedure returns
+ * the token for the top-most window covering that point, if
+ * there exists such a window in this application.
+ *
+ * Results:
+ * The return result is either a token for the window corresponding
+ * to rootX and rootY, or else NULL to indicate that there is no such
+ * window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tk_Window
+Tk_CoordsToWindow(
+ int rootX, int rootY, /* Coordinates of point in root window. If
+ * a virtual-root window manager is in use,
+ * these coordinates refer to the virtual
+ * root, not the real root. */
+ Tk_Window tkwin) /* Token for any window in application;
+ * used to identify the display. */
+{
+ WindowPtr whichWin;
+ Point where;
+ Window rootChild;
+ TkWindow *winPtr, *childPtr;
+ TkWindow *nextPtr; /* Coordinates of highest child found so
+ * far that contains point. */
+ int x, y; /* Coordinates in winPtr. */
+ int tmpx, tmpy, bd;
+ TkDisplay *dispPtr;
+
+ /*
+ * Step 1: find the top-level window that contains the desired point.
+ */
+
+ where.h = rootX;
+ where.v = rootY;
+ FindWindow(where, &whichWin);
+ if (whichWin == NULL) {
+ return NULL;
+ }
+ rootChild = TkMacOSXGetXWindow(whichWin);
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, rootChild);
+ if (winPtr == NULL) {
+ return NULL;
+ }
+
+ /*
+ * Step 2: work down through the hierarchy underneath this window.
+ * At each level, scan through all the children to find the highest
+ * one in the stacking order that contains the point. Then repeat
+ * the whole process on that child.
+ */
+
+ x = rootX - winPtr->wmInfoPtr->xInParent;
+ y = rootY - winPtr->wmInfoPtr->yInParent;
+ while (1) {
+ x -= winPtr->changes.x;
+ y -= winPtr->changes.y;
+ nextPtr = NULL;
+
+ /*
+ * Container windows cannot have children. So if it is a container,
+ * look there, otherwise inspect the children.
+ */
+
+ if (Tk_IsContainer(winPtr)) {
+ childPtr = TkpGetOtherWindow(winPtr);
+ if (childPtr != NULL) {
+ if (Tk_IsMapped(childPtr)) {
+ tmpx = x - childPtr->changes.x;
+ tmpy = y - childPtr->changes.y;
+ bd = childPtr->changes.border_width;
+
+ if ((tmpx >= -bd) && (tmpy >= -bd)
+ && (tmpx < (childPtr->changes.width + bd))
+ && (tmpy < (childPtr->changes.height + bd))) {
+ nextPtr = childPtr;
+ }
+ }
+ }
+
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ } else {
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ if (!Tk_IsMapped(childPtr) ||
+ (childPtr->flags & TK_TOP_LEVEL)) {
+ continue;
+ }
+ tmpx = x - childPtr->changes.x;
+ tmpy = y - childPtr->changes.y;
+ bd = childPtr->changes.border_width;
+ if ((tmpx >= -bd) && (tmpy >= -bd)
+ && (tmpx < (childPtr->changes.width + bd))
+ && (tmpy < (childPtr->changes.height + bd))) {
+ nextPtr = childPtr;
+ }
+ }
+ }
+ if (nextPtr == NULL) {
+ break;
+ }
+ winPtr = nextPtr;
+ }
+ return (Tk_Window) winPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_TopCoordsToWindow --
+ *
+ * Given a Tk Window, and coordinates of a point relative to that window
+ * this procedure returns the top-most child of the window (excluding
+ * toplevels) covering that point, if there exists such a window in this
+ * application.
+ * It also sets newX, and newY to the coords of the point relative to the
+ * window returned.
+ *
+ * Results:
+ * The return result is either a token for the window corresponding
+ * to rootX and rootY, or else NULL to indicate that there is no such
+ * window. newX and newY are also set to the coords of the point relative
+ * to the returned window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tk_Window
+Tk_TopCoordsToWindow(
+ Tk_Window tkwin, /* Token for a Tk Window which defines the;
+ * coordinates for rootX & rootY */
+ int rootX, int rootY, /* Coordinates of a point in tkWin. */
+ int *newX, int *newY) /* Coordinates of point in the upperMost child of
+ * tkWin containing (rootX,rootY) */
+{
+ TkWindow *winPtr, *childPtr;
+ TkWindow *nextPtr; /* Coordinates of highest child found so
+ * far that contains point. */
+ int x, y; /* Coordinates in winPtr. */
+ Window *children; /* Children of winPtr, or NULL. */
+
+ winPtr = (TkWindow *) tkwin;
+ x = rootX;
+ y = rootY;
+ while (1) {
+ nextPtr = NULL;
+ children = NULL;
+
+ /*
+ * Container windows cannot have children. So if it is a container,
+ * look there, otherwise inspect the children.
+ */
+
+ if (Tk_IsContainer(winPtr)) {
+ childPtr = TkpGetOtherWindow(winPtr);
+ if (childPtr != NULL) {
+ if (Tk_IsMapped(childPtr) &&
+ (x > childPtr->changes.x &&
+ x < childPtr->changes.x +
+ childPtr->changes.width) &&
+ (y > childPtr->changes.y &&
+ y < childPtr->changes.y +
+ childPtr->changes.height)) {
+ nextPtr = childPtr;
+ }
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ } else {
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ if (!Tk_IsMapped(childPtr) ||
+ (childPtr->flags & TK_TOP_LEVEL)) {
+ continue;
+ }
+ if (x < childPtr->changes.x || y < childPtr->changes.y) {
+ continue;
+ }
+ if (x > childPtr->changes.x + childPtr->changes.width ||
+ y > childPtr->changes.y + childPtr->changes.height) {
+ continue;
+ }
+ nextPtr = childPtr;
+ }
+ }
+ if (nextPtr == NULL) {
+ break;
+ }
+ winPtr = nextPtr;
+ x -= winPtr->changes.x;
+ y -= winPtr->changes.y;
+ }
+ *newX = x;
+ *newY = y;
+ return (Tk_Window) winPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * UpdateVRootGeometry --
+ *
+ * This procedure is called to update all the virtual root
+ * geometry information in wmPtr.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The vRootX, vRootY, vRootWidth, and vRootHeight fields in
+ * wmPtr are filled with the most up-to-date information.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+UpdateVRootGeometry(
+ WmInfo *wmPtr) /* Window manager information to be
+ * updated. The wmPtr->vRoot field must
+ * be valid. */
+{
+ TkWindow *winPtr = wmPtr->winPtr;
+ unsigned int bd, dummy;
+ Window dummy2;
+ Status status;
+ Tk_ErrorHandler handler;
+
+ /*
+ * If this isn't a virtual-root window manager, just return information
+ * about the screen.
+ */
+
+ wmPtr->flags &= ~WM_VROOT_OFFSET_STALE;
+ if (wmPtr->vRoot == None) {
+ noVRoot:
+ wmPtr->vRootX = wmPtr->vRootY = 0;
+ wmPtr->vRootWidth = DisplayWidth(winPtr->display, winPtr->screenNum);
+ wmPtr->vRootHeight = DisplayHeight(winPtr->display, winPtr->screenNum);
+ return;
+ }
+
+ /*
+ * Refresh the virtual root information if it's out of date.
+ */
+
+ handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
+ (Tk_ErrorProc *) NULL, (ClientData) NULL);
+ status = XGetGeometry(winPtr->display, wmPtr->vRoot,
+ &dummy2, &wmPtr->vRootX, &wmPtr->vRootY,
+ &wmPtr->vRootWidth, &wmPtr->vRootHeight, &bd, &dummy);
+ if (wmTracing) {
+ printf("UpdateVRootGeometry: x = %d, y = %d, width = %d, ",
+ wmPtr->vRootX, wmPtr->vRootY, wmPtr->vRootWidth);
+ printf("height = %d, status = %d\n", wmPtr->vRootHeight, status);
+ }
+ Tk_DeleteErrorHandler(handler);
+ if (status == 0) {
+ /*
+ * The virtual root is gone! Pretend that it never existed.
+ */
+
+ wmPtr->vRoot = None;
+ goto noVRoot;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_GetVRootGeometry --
+ *
+ * This procedure returns information about the virtual root
+ * window corresponding to a particular Tk window.
+ *
+ * Results:
+ * The values at xPtr, yPtr, widthPtr, and heightPtr are set
+ * with the offset and dimensions of the root window corresponding
+ * to tkwin. If tkwin is being managed by a virtual root window
+ * manager these values correspond to the virtual root window being
+ * used for tkwin; otherwise the offsets will be 0 and the
+ * dimensions will be those of the screen.
+ *
+ * Side effects:
+ * Vroot window information is refreshed if it is out of date.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_GetVRootGeometry(
+ Tk_Window tkwin, /* Window whose virtual root is to be
+ * queried. */
+ int *xPtr, int *yPtr, /* Store x and y offsets of virtual root
+ * here. */
+ int *widthPtr, /* Store dimensions of virtual root here. */
+ int *heightPtr)
+{
+ WmInfo *wmPtr;
+ TkWindow *winPtr = (TkWindow *) tkwin;
+
+ /*
+ * Find the top-level window for tkwin, and locate the window manager
+ * information for that window.
+ */
+
+ while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ winPtr = winPtr->parentPtr;
+ }
+ wmPtr = winPtr->wmInfoPtr;
+
+ /*
+ * Make sure that the geometry information is up-to-date, then copy
+ * it out to the caller.
+ */
+
+ if (wmPtr->flags & WM_VROOT_OFFSET_STALE) {
+ UpdateVRootGeometry(wmPtr);
+ }
+ *xPtr = wmPtr->vRootX;
+ *yPtr = wmPtr->vRootY;
+ *widthPtr = wmPtr->vRootWidth;
+ *heightPtr = wmPtr->vRootHeight;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_MoveToplevelWindow --
+ *
+ * This procedure is called instead of Tk_MoveWindow to adjust
+ * the x-y location of a top-level window. It delays the actual
+ * move to a later time and keeps window-manager information
+ * up-to-date with the move
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The window is eventually moved so that its upper-left corner
+ * (actually, the upper-left corner of the window's decorative
+ * frame, if there is one) is at (x,y).
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_MoveToplevelWindow(
+ Tk_Window tkwin, /* Window to move. */
+ int x, int y) /* New location for window (within
+ * parent). */
+{
+ TkWindow *winPtr = (TkWindow *) tkwin;
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ panic("Tk_MoveToplevelWindow called with non-toplevel window");
+ }
+ wmPtr->x = x;
+ wmPtr->y = y;
+ wmPtr->flags |= WM_MOVE_PENDING;
+ wmPtr->flags &= ~(WM_NEGATIVE_X|WM_NEGATIVE_Y);
+ if ((wmPtr->sizeHintsFlags & (USPosition|PPosition)) == 0) {
+ wmPtr->sizeHintsFlags |= USPosition;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ }
+
+ /*
+ * If the window has already been mapped, must bring its geometry
+ * up-to-date immediately, otherwise an event might arrive from the
+ * server that would overwrite wmPtr->x and wmPtr->y and lose the
+ * new position.
+ */
+
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ if (wmPtr->flags & WM_UPDATE_PENDING) {
+ Tk_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ }
+ UpdateGeometryInfo((ClientData) winPtr);
+ }
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmRestackToplevel --
+ *
+ * This procedure restacks a top-level window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * WinPtr gets restacked as specified by aboveBelow and otherPtr.
+ * This procedure doesn't return until the restack has taken
+ * effect and the ConfigureNotify event for it has been received.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkWmRestackToplevel(
+ TkWindow *winPtr, /* Window to restack. */
+ int aboveBelow, /* Gives relative position for restacking;
+ * must be Above or Below. */
+ TkWindow *otherPtr) /* Window relative to which to restack;
+ * if NULL, then winPtr gets restacked
+ * above or below *all* siblings. */
+{
+ WmInfo *wmPtr;
+
+ WindowRef macWindow, otherMacWindow, frontWindow, tmpWindow;
+
+ wmPtr = winPtr->wmInfoPtr;
+
+ /*
+ * Get the mac window. Make sure it exists & is mapped.
+ */
+
+ if (winPtr->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ }
+ if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
+
+ /*
+ * Can't set stacking order properly until the window is on the
+ * screen (mapping it may give it a reparent window), so make sure
+ * it's on the screen.
+ */
+
+ TkWmMapWindow(winPtr);
+ }
+ macWindow = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window));
+
+ /*
+ * Get the window in which a raise or lower is in relation to.
+ */
+ if (otherPtr != NULL) {
+ if (otherPtr->window == None) {
+ Tk_MakeWindowExist((Tk_Window) otherPtr);
+ }
+ if (otherPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
+ TkWmMapWindow(otherPtr);
+ }
+ otherMacWindow =GetWindowFromPort(TkMacOSXGetDrawablePort(otherPtr->window));
+ } else {
+ otherMacWindow = NULL;
+ }
+
+
+ frontWindow = FrontNonFloatingWindow();
+
+ if (aboveBelow == Above) {
+ if (macWindow == frontWindow) {
+ /*
+ * Do nothing - it's already at the top.
+ */
+ } else if (otherMacWindow == frontWindow || otherMacWindow == NULL) {
+ /*
+ * Raise the window to the top. If the window is visable then
+ * we also make it the active window.
+ */
+
+ if (wmPtr->hints.initial_state == WithdrawnState) {
+ BringToFront(macWindow);
+ } else {
+ SelectWindow(macWindow);
+ }
+ } else {
+ /*
+ * Find the window to be above. (Front window will actually be the
+ * window to be behind.) Front window is NULL if no other windows.
+ */
+ while (frontWindow != NULL &&
+ ( tmpWindow = GetNextWindow (frontWindow) ) != otherMacWindow) {
+ frontWindow = tmpWindow;
+ }
+ if (frontWindow != NULL) {
+ SendBehind(macWindow, frontWindow);
+ }
+ }
+ } else {
+ /*
+ * Send behind. If it was in front find another window to make active.
+ */
+ if (macWindow == frontWindow) {
+ if ( ( tmpWindow = GetNextWindow ( macWindow )) != NULL) {
+ SelectWindow(tmpWindow);
+ }
+ }
+ SendBehind(macWindow, otherMacWindow);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmAddToColormapWindows --
+ *
+ * This procedure is called to add a given window to the
+ * WM_COLORMAP_WINDOWS property for its top-level, if it
+ * isn't already there. It is invoked by the Tk code that
+ * creates a new colormap, in order to make sure that colormap
+ * information is propagated to the window manager by default.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * WinPtr's window gets added to the WM_COLORMAP_WINDOWS
+ * property of its nearest top-level ancestor, unless the
+ * colormaps have been set explicitly with the
+ * "wm colormapwindows" command.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkWmAddToColormapWindows(
+ TkWindow *winPtr) /* Window with a non-default colormap.
+ * Should not be a top-level window. */
+{
+ TkWindow *topPtr;
+ TkWindow **oldPtr, **newPtr;
+ int count, i;
+
+ if (winPtr->window == None) {
+ return;
+ }
+
+ for (topPtr = winPtr->parentPtr; ; topPtr = topPtr->parentPtr) {
+ if (topPtr == NULL) {
+ /*
+ * Window is being deleted. Skip the whole operation.
+ */
+
+ return;
+ }
+ if (topPtr->flags & TK_TOP_LEVEL) {
+ break;
+ }
+ }
+ if (topPtr->wmInfoPtr->flags & WM_COLORMAPS_EXPLICIT) {
+ return;
+ }
+
+ /*
+ * Make sure that the window isn't already in the list.
+ */
+
+ count = topPtr->wmInfoPtr->cmapCount;
+ oldPtr = topPtr->wmInfoPtr->cmapList;
+
+ for (i = 0; i < count; i++) {
+ if (oldPtr[i] == winPtr) {
+ return;
+ }
+ }
+
+ /*
+ * Make a new bigger array and use it to reset the property.
+ * Automatically add the toplevel itself as the last element
+ * of the list.
+ */
+
+ newPtr = (TkWindow **) ckalloc((unsigned) ((count+2)*sizeof(TkWindow*)));
+ if (count > 0) {
+ memcpy(newPtr, oldPtr, count * sizeof(TkWindow*));
+ }
+ if (count == 0) {
+ count++;
+ }
+ newPtr[count-1] = winPtr;
+ newPtr[count] = topPtr;
+ if (oldPtr != NULL) {
+ ckfree((char *) oldPtr);
+ }
+
+ topPtr->wmInfoPtr->cmapList = newPtr;
+ topPtr->wmInfoPtr->cmapCount = count+1;
+
+ /*
+ * On the Macintosh all of this is just an excercise
+ * in compatability as we don't support colormaps. If
+ * we did they would be installed here.
+ */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmRemoveFromColormapWindows --
+ *
+ * This procedure is called to remove a given window from the
+ * WM_COLORMAP_WINDOWS property for its top-level. It is invoked
+ * when windows are deleted.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * WinPtr's window gets removed from the WM_COLORMAP_WINDOWS
+ * property of its nearest top-level ancestor, unless the
+ * top-level itself is being deleted too.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkWmRemoveFromColormapWindows(
+ TkWindow *winPtr) /* Window that may be present in
+ * WM_COLORMAP_WINDOWS property for its
+ * top-level. Should not be a top-level
+ * window. */
+{
+ TkWindow *topPtr;
+ TkWindow **oldPtr;
+ int count, i, j;
+
+ for (topPtr = winPtr->parentPtr; ; topPtr = topPtr->parentPtr) {
+ if (topPtr == NULL) {
+ /*
+ * Ancestors have been deleted, so skip the whole operation.
+ * Seems like this can't ever happen?
+ */
+
+ return;
+ }
+ if (topPtr->flags & TK_TOP_LEVEL) {
+ break;
+ }
+ }
+ if (topPtr->flags & TK_ALREADY_DEAD) {
+ /*
+ * Top-level is being deleted, so there's no need to cleanup
+ * the WM_COLORMAP_WINDOWS property.
+ */
+
+ return;
+ }
+
+ /*
+ * Find the window and slide the following ones down to cover
+ * it up.
+ */
+
+ count = topPtr->wmInfoPtr->cmapCount;
+ oldPtr = topPtr->wmInfoPtr->cmapList;
+ for (i = 0; i < count; i++) {
+ if (oldPtr[i] == winPtr) {
+ for (j = i ; j < count-1; j++) {
+ oldPtr[j] = oldPtr[j+1];
+ }
+ topPtr->wmInfoPtr->cmapCount = count - 1;
+ break;
+ }
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGetPointerCoords --
+ *
+ * Fetch the position of the mouse pointer.
+ *
+ * Results:
+ * *xPtr and *yPtr are filled in with the (virtual) root coordinates
+ * of the mouse pointer for tkwin's display. If the pointer isn't
+ * on tkwin's screen, then -1 values are returned for both
+ * coordinates. The argument tkwin must be a toplevel window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkGetPointerCoords(
+ Tk_Window tkwin, /* Toplevel window that identifies screen
+ * on which lookup is to be done. */
+ int *xPtr, int *yPtr) /* Store pointer coordinates here. */
+{
+ Point where;
+
+ GetMouse(&where);
+ LocalToGlobal(&where);
+ *xPtr = where.h;
+ *yPtr = where.v;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitialWindowBounds --
+ *
+ * This function calculates the initial bounds for a new Mac
+ * toplevel window. Unless the geometry is specified by the user
+ * this code will auto place the windows in a cascade diagonially
+ * across the main monitor of the Mac.
+ *
+ * Results:
+ * The bounds are returned in geometry.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+InitialWindowBounds(
+ TkWindow *winPtr, /* Window to get initial bounds for. */
+ Rect *geometry) /* On return the initial bounds. */
+{
+ int x, y;
+ static int defaultX = 5;
+ static int defaultY = 45;
+
+ if (!(winPtr->wmInfoPtr->sizeHintsFlags & (USPosition | PPosition))) {
+ /*
+ * We will override the program & hopefully place the
+ * window in a "better" location.
+ */
+ BitMap screenBits;
+ GetQDGlobalsScreenBits(&screenBits);
+ if (((screenBits.bounds.right - defaultX) < 30) ||
+ ((screenBits.bounds.bottom - defaultY) < 30)) {
+ defaultX = 5;
+ defaultY = 45;
+ }
+ x = defaultX;
+ y = defaultY;
+ defaultX += 20;
+ defaultY += 20;
+ } else {
+ x = winPtr->wmInfoPtr->x;
+ y = winPtr->wmInfoPtr->y;
+ }
+
+ geometry->left = x;
+ geometry->top = y;
+ geometry->right = x + winPtr->changes.width;
+ geometry->bottom = y + winPtr->changes.height;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXResizable --
+ *
+ * This function determines if the passed in window is part of
+ * a toplevel window that is resizable. If the window is
+ * resizable in the x, y or both directions, true is returned.
+ *
+ * Results:
+ * True if resizable, false otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXResizable(
+ TkWindow *winPtr) /* Tk window or NULL. */
+{
+ WmInfo *wmPtr;
+
+ if (winPtr == NULL) {
+ return false;
+ }
+ while (winPtr->wmInfoPtr == NULL) {
+ winPtr = winPtr->parentPtr;
+ }
+
+ wmPtr = winPtr->wmInfoPtr;
+ if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGrowToplevel --
+ *
+ * The function is invoked when the user clicks in the grow region
+ * of a Tk window. The function will handle the dragging
+ * procedure and not return until completed. Finally, the function
+ * may place information Tk's event queue is the window was resized.
+ *
+ * Results:
+ * True if events were placed on event queue, false otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXGrowToplevel(
+ WindowRef whichWindow,
+ Point start)
+{
+ Point where = start;
+ TkDisplay *dispPtr;
+ Rect portRect;
+
+ GlobalToLocal(&where);
+ GetPortBounds(GetWindowPort(whichWindow), &portRect );
+ if (where.h > (portRect.right - 16) &&
+ where.v > (portRect.bottom - 16)) {
+
+ Window window;
+ TkWindow *winPtr;
+ WmInfo *wmPtr;
+ Rect bounds;
+ long growResult;
+
+ window = TkMacOSXGetXWindow(whichWindow);
+ dispPtr = TkGetDisplayList();
+ winPtr = (TkWindow *) Tk_IdToWindow(dispPtr->display, window);
+ wmPtr = winPtr->wmInfoPtr;
+
+ /* TODO: handle grid size options. */
+ if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
+ return false;
+ }
+ if (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) {
+ bounds.left = bounds.right = winPtr->changes.width;
+ } else {
+ bounds.left = (wmPtr->minWidth < 64) ? 64 : wmPtr->minWidth;
+ bounds.right = (wmPtr->maxWidth < 64) ? 64 : wmPtr->maxWidth;
+ }
+ if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
+ bounds.top = bounds.bottom = winPtr->changes.height;
+ } else {
+ bounds.top = (wmPtr->minHeight < 64) ? 64 : wmPtr->minHeight;
+ bounds.bottom = (wmPtr->maxHeight < 64) ? 64 : wmPtr->maxHeight;
+ }
+
+ growResult = GrowWindow(whichWindow, start, &bounds);
+
+ if (growResult != 0) {
+ SizeWindow(whichWindow,
+ LoWord(growResult), HiWord(growResult), true);
+ SetPort( GetWindowPort(whichWindow));
+ InvalWindowRect(whichWindow,&portRect); /* TODO: may not be needed */
+ TkMacOSXInvalClipRgns(winPtr);
+ TkGenWMConfigureEvent((Tk_Window) winPtr, -1, -1,
+ (int) LoWord(growResult), (int) HiWord(growResult),
+ TK_SIZE_CHANGED);
+ return true;
+ }
+ return false;
+ }
+ return false;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSetWMName --
+ *
+ * Set the title for a toplevel window. If the window is embedded,
+ * do not change the window title.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * The title of the window is changed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkSetWMName(
+ TkWindow *winPtr,
+ Tk_Uid titleUid)
+{
+ Str255 pTitle;
+ WindowRef macWin;
+ int destWrote;
+
+ if (Tk_IsEmbedded(winPtr)) {
+ return;
+ }
+ Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, titleUid,
+ strlen(titleUid), 0, NULL,
+ (char *) &pTitle[1],
+ 255, NULL, &destWrote, NULL); /* Internalize native */
+ pTitle[0] = destWrote;
+
+ macWin = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window));
+
+ /*
+ * FIXME: Convert this to SetWindowTitleWithCFString, we should
+ * use CFStrings and not pascal strings wherever they are supported,
+ * since at some point there will be encodings that can't be supported
+ * with the pascal string interfaces.
+ */
+
+ SetWTitle( macWin, pTitle);
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGetTransientMaster --
+ *
+ * If the passed window has the TRANSIENT_FOR property set this
+ * will return the master window. Otherwise it will return None.
+ *
+ * Results:
+ * The master window or None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Window
+TkGetTransientMaster(
+ TkWindow *winPtr)
+{
+ if (winPtr->wmInfoPtr != NULL) {
+ return winPtr->wmInfoPtr->master;
+ }
+ return None;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXGetXWindow --
+ *
+ * Returns the X window Id associated with the given WindowRef.
+ *
+ * Results:
+ * The window id is returned. None is returned if not a Tk window.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Window
+TkMacOSXGetXWindow(
+ WindowRef macWinPtr)
+{
+ Tcl_HashEntry *hPtr;
+
+ if ((macWinPtr == NULL) || !windowHashInit) {
+ return None;
+ }
+ hPtr = Tcl_FindHashEntry(&windowTable, (char *) macWinPtr);
+ if (hPtr == NULL) {
+ return None;
+ }
+ return (Window) Tcl_GetHashValue(hPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXZoomToplevel --
+ *
+ * The function is invoked when the user clicks in the zoom region
+ * of a Tk window. The function will handle the mouse tracking
+ * for the interaction. If the window is to be zoomed the window
+ * size is changed and events are generated to let Tk know what
+ * happened.
+ *
+ * Results:
+ * True if events were placed on event queue, false otherwise.
+ *
+ * Side effects:
+ * The window may be resized & events placed on Tk's queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkMacOSXZoomToplevel(
+ WindowRef whichWindow, /* The Macintosh window to zoom. */
+ Point where, /* The current mouse position. */
+ short zoomPart) /* Either inZoomIn or inZoomOut */
+{
+ Window window;
+ Tk_Window tkwin;
+ Point location = {0, 0};
+ int xOffset, yOffset;
+ WmInfo *wmPtr;
+ TkDisplay *dispPtr;
+ Rect portRect;
+
+ SetPort( GetWindowPort(whichWindow));
+ if (!TrackBox(whichWindow, where, zoomPart)) {
+ return false;
+ }
+
+ /*
+ * We should now zoom the window (as long as it's one of ours). We
+ * also need to generate an event to let Tk know that the window size
+ * has changed.
+ */
+ window = TkMacOSXGetXWindow(whichWindow);
+ dispPtr = TkGetDisplayList();
+ tkwin = Tk_IdToWindow(dispPtr->display, window);
+ if (tkwin == NULL) {
+ return false;
+ }
+
+ /*
+ * The following block of code works around a bug in the window
+ * definition for Apple's floating windows. The zoom behavior is
+ * broken - we must manually set the standard state (by default
+ * it's something like 1x1) and we must swap the zoomPart manually
+ * otherwise we always get the same zoomPart and nothing happens.
+ */
+ wmPtr = ((TkWindow *) tkwin)->wmInfoPtr;
+ if (wmPtr->style >= floatProc && wmPtr->style <= floatSideZoomGrowProc) {
+ if (zoomPart == inZoomIn) {
+ BitMap screenBits;
+ Rect zoomRect;
+ GetQDGlobalsScreenBits(&screenBits);
+ zoomRect = screenBits.bounds;
+ InsetRect(&zoomRect, 60, 60);
+ SetWindowStandardState(whichWindow, &zoomRect);
+ zoomPart = inZoomOut;
+ } else {
+ zoomPart = inZoomIn;
+ }
+ } else {
+ zoomPart = inZoomIn;
+ }
+
+ ZoomWindow(whichWindow, zoomPart, false);
+ InvalWindowRect(whichWindow,&portRect);
+ TkMacOSXInvalClipRgns((TkWindow *) tkwin);
+
+ LocalToGlobal(&location);
+ TkMacOSXWindowOffset(whichWindow, &xOffset, &yOffset);
+ location.h -= xOffset;
+ location.v -= yOffset;
+ GetPortBounds ( GetWindowPort(whichWindow), &portRect );
+ TkGenWMConfigureEvent(tkwin, location.h, location.v,
+ portRect.right - portRect.left,
+ portRect.bottom - portRect.top,
+ TK_BOTH_CHANGED);
+ return true;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkUnsupported1Cmd --
+ *
+ * This procedure is invoked to process the
+ * "::tk::unsupported::MacWindowStyle" Tcl command.
+ * This command allows you to set the style of decoration
+ * for a Macintosh window.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * Changes the style of a new Mac window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+ /* ARGSUSED */
+int
+TkUnsupported1Cmd(
+ ClientData clientData, /* Main window associated with
+ * interpreter. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int argc, /* Number of arguments. */
+ CONST char **argv) /* Argument strings. */
+{
+ Tk_Window tkwin = (Tk_Window) clientData;
+ TkWindow *winPtr;
+ WmInfo *wmPtr;
+ int c;
+ size_t length;
+
+ if (argc < 3) {
+ Tcl_AppendResult(interp, "wrong # args: should be \"",
+ argv[0], " option window ?arg ...?\"", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[2], tkwin);
+ if (winPtr == NULL) {
+ return TCL_ERROR;
+ }
+ if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't a top-level window", (char *) NULL);
+ return TCL_ERROR;
+ }
+ wmPtr = winPtr->wmInfoPtr;
+ c = argv[1][0];
+ length = strlen(argv[1]);
+ if ((c == 's') && (strncmp(argv[1], "style", length) == 0)) {
+ if ((argc < 3) || (argc > 5)) {
+ Tcl_AppendResult(interp, "wrong # arguments: must be \"",
+ argv[0], " style window ?windowStyle?\"",
+ " or \"", argv[0], "style window ?class attributes?\"",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (argc == 3) {
+ int appearanceSpec = 0;
+
+ switch (wmPtr->style) {
+ case -1:
+ appearanceSpec = 1;
+ break;
+ case noGrowDocProc:
+ case documentProc:
+ Tcl_SetResult(interp, "documentProc", TCL_STATIC);
+ break;
+ case dBoxProc:
+ Tcl_SetResult(interp, "dBoxProc", TCL_STATIC);
+ break;
+ case plainDBox:
+ Tcl_SetResult(interp, "plainDBox", TCL_STATIC);
+ break;
+ case altDBoxProc:
+ Tcl_SetResult(interp, "altDBoxProc", TCL_STATIC);
+ break;
+ case movableDBoxProc:
+ Tcl_SetResult(interp, "movableDBoxProc", TCL_STATIC);
+ break;
+ case zoomDocProc:
+ case zoomNoGrow:
+ Tcl_SetResult(interp, "zoomDocProc", TCL_STATIC);
+ break;
+ /* Not supported in Carbon
+ case rDocProc:
+ Tcl_SetResult(interp, "rDocProc", TCL_STATIC);
+ break;
+ */
+ case floatProc:
+ case floatGrowProc:
+ Tcl_SetResult(interp, "floatProc", TCL_STATIC);
+ break;
+ case floatZoomProc:
+ case floatZoomGrowProc:
+ Tcl_SetResult(interp, "floatZoomProc", TCL_STATIC);
+ break;
+ case floatSideProc:
+ case floatSideGrowProc:
+ Tcl_SetResult(interp, "floatSideProc", TCL_STATIC);
+ break;
+ case floatSideZoomProc:
+ case floatSideZoomGrowProc:
+ Tcl_SetResult(interp, "floatSideZoomProc", TCL_STATIC);
+ break;
+ default:
+ panic("invalid style");
+ }
+ if (appearanceSpec) {
+ Tcl_Obj *attributeList, *newResult = NULL;
+
+ switch (wmPtr->macClass) {
+ case kAlertWindowClass:
+ newResult = Tcl_NewStringObj("alert", -1);
+ break;
+ case kMovableAlertWindowClass:
+ newResult = Tcl_NewStringObj("moveableAlert", -1);
+ break;
+ case kModalWindowClass:
+ newResult = Tcl_NewStringObj("modal", -1);
+ break;
+ case kMovableModalWindowClass:
+ newResult = Tcl_NewStringObj("moveableModal", -1);
+ break;
+ case kFloatingWindowClass:
+ newResult = Tcl_NewStringObj("floating", -1);
+ break;
+ case kDocumentWindowClass:
+ newResult = Tcl_NewStringObj("document", -1);
+ break;
+ case kHelpWindowClass:
+ newResult = Tcl_NewStringObj("help", -1);
+ break;
+ case kToolbarWindowClass:
+ newResult = Tcl_NewStringObj("toolbar", -1);
+ break;
+ default:
+ panic("invalid class");
+ }
+
+ attributeList = Tcl_NewListObj(0, NULL);
+ if (wmPtr->attributes == kWindowNoAttributes) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("none", -1));
+ } else if (wmPtr->attributes == kWindowStandardDocumentAttributes) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("standardDocument", -1));
+ } else if (wmPtr->attributes == kWindowStandardFloatingAttributes) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("standardFloating", -1));
+ } else {
+ if (wmPtr->attributes & kWindowCloseBoxAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("closeBox", -1));
+ }
+ if (wmPtr->attributes & kWindowHorizontalZoomAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("horizontalZoom", -1));
+ }
+ if (wmPtr->attributes & kWindowVerticalZoomAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("verticalZoom", -1));
+ }
+ if (wmPtr->attributes & kWindowCollapseBoxAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("collapseBox", -1));
+ }
+ if (wmPtr->attributes & kWindowResizableAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("resizable", -1));
+ }
+ if (wmPtr->attributes & kWindowSideTitlebarAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("sideTitlebar", -1));
+ }
+ if (wmPtr->attributes & kWindowNoUpdatesAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("noUpdates", -1));
+ }
+ if (wmPtr->attributes & kWindowNoActivatesAttribute) {
+ Tcl_ListObjAppendElement(interp, attributeList,
+ Tcl_NewStringObj("noActivates", -1));
+ }
+ }
+ Tcl_ListObjAppendElement(interp, newResult, attributeList);
+ Tcl_SetObjResult(interp, newResult);
+ }
+ return TCL_OK;
+ } else if (argc == 4) {
+ if (strcmp(argv[3], "documentProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "noGrowDocProc") == 0) {
+ wmPtr->style = documentProc;
+ } else if (strcmp(argv[3], "dBoxProc") == 0) {
+ wmPtr->style = dBoxProc;
+ } else if (strcmp(argv[3], "plainDBox") == 0) {
+ wmPtr->style = plainDBox;
+ } else if (strcmp(argv[3], "altDBoxProc") == 0) {
+ wmPtr->style = altDBoxProc;
+ } else if (strcmp(argv[3], "movableDBoxProc") == 0) {
+ wmPtr->style = movableDBoxProc;
+ } else if (strcmp(argv[3], "zoomDocProc") == 0) {
+ wmPtr->style = zoomDocProc;
+ } else if (strcmp(argv[3], "zoomNoGrow") == 0) {
+ wmPtr->style = zoomNoGrow;
+ }
+ /*
+ else
+ if (strcmp(argv[3], "rDocProc") == 0) {
+ wmPtr->style = rDocProc;
+ }
+ */
+ else if (strcmp(argv[3], "floatProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatGrowProc") == 0) {
+ wmPtr->style = floatGrowProc;
+ } else if (strcmp(argv[3], "floatZoomProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatZoomGrowProc") == 0) {
+ wmPtr->style = floatZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideGrowProc") == 0) {
+ wmPtr->style = floatSideGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else if (strcmp(argv[3], "floatSideZoomGrowProc") == 0) {
+ wmPtr->style = floatSideZoomGrowProc;
+ } else {
+ Tcl_AppendResult(interp, "bad style: should be documentProc, ",
+ "dBoxProc, plainDBox, altDBoxProc, movableDBoxProc, ",
+ "zoomDocProc, rDocProc, floatProc, floatZoomProc, ",
+ "floatSideProc, or floatSideZoomProc",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ } else if (argc == 5) {
+ int oldClass = wmPtr->macClass;
+ int oldAttributes = wmPtr->attributes;
+
+ if (strcmp(argv[3], "alert") == 0) {
+ wmPtr->macClass = kAlertWindowClass;
+ } else if (strcmp(argv[3], "moveableAlert") == 0) {
+ wmPtr->macClass = kMovableAlertWindowClass;
+ } else if (strcmp(argv[3], "modal") == 0) {
+ wmPtr->macClass = kModalWindowClass;
+ } else if (strcmp(argv[3], "moveableModal") == 0) {
+ wmPtr->macClass = kMovableModalWindowClass;
+ } else if (strcmp(argv[3], "floating") == 0) {
+ wmPtr->macClass = kFloatingWindowClass;
+ } else if (strcmp(argv[3], "document") == 0) {
+ wmPtr->macClass = kDocumentWindowClass;
+ } else if (strcmp(argv[3], "help") == 0) {
+ wmPtr->macClass = kHelpWindowClass;
+ } else if (strcmp(argv[3], "toolbar") == 0) {
+ wmPtr->macClass = kToolbarWindowClass;
+ } else {
+ wmPtr->macClass = oldClass;
+ Tcl_AppendResult(interp, "bad class: should be alert, ",
+ "moveableAlert, modal, moveableModal, floating, ",
+ "help, or document",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (strcmp(argv[4], "none") == 0) {
+ wmPtr->attributes = kWindowNoAttributes;
+ } else if (strcmp(argv[4], "standardDocument") == 0) {
+ wmPtr->attributes = kWindowStandardDocumentAttributes;
+ } else if (strcmp(argv[4], "standardFloating") == 0) {
+ wmPtr->attributes = kWindowStandardFloatingAttributes;
+ } else {
+ int foundOne = 0;
+ int attrArgc, i;
+ CONST char **attrArgv = NULL;
+
+ if (Tcl_SplitList(interp, argv[4], &attrArgc, &attrArgv) != TCL_OK) {
+ wmPtr->macClass = oldClass;
+ Tcl_AppendResult(interp, "Ill-formed attributes list: \"",
+ argv[4], "\".", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ wmPtr->attributes = kWindowNoAttributes;
+
+ for (i = 0; i < attrArgc; i++) {
+ if ((*attrArgv[i] == 'c')
+ && (strcmp(attrArgv[i], "closeBox") == 0)) {
+ wmPtr->attributes |= kWindowCloseBoxAttribute;
+ foundOne = 1;
+ } else if ((*attrArgv[i] == 'h')
+ && (strcmp(attrArgv[i], "horizontalZoom") == 0)) {
+ wmPtr->attributes |= kWindowHorizontalZoomAttribute;
+ foundOne = 1;
+ } else if ((*attrArgv[i] == 'v')
+ && (strcmp(attrArgv[i], "verticalZoom") == 0)) {
+ wmPtr->attributes |= kWindowVerticalZoomAttribute;
+ foundOne = 1;
+ } else if ((*attrArgv[i] == 'c')
+ && (strcmp(attrArgv[i], "collapseBox") == 0)) {
+ wmPtr->attributes |= kWindowCollapseBoxAttribute;
+ foundOne = 1;
+ } else if ((*attrArgv[i] == 'r')
+ && (strcmp(attrArgv[i], "resizable") == 0)) {
+ wmPtr->attributes |= kWindowResizableAttribute;
+ foundOne = 1;
+ } else if ((*attrArgv[i] == 's')
+ && (strcmp(attrArgv[i], "sideTitlebar") == 0)) {
+ wmPtr->attributes |= kWindowSideTitlebarAttribute;
+ foundOne = 1;
+ } else if ((*attrArgv[i] == 'n')
+ && (strcmp(attrArgv[i], "noActivates") == 0)) {
+ wmPtr->attributes |= kWindowNoActivatesAttribute;
+ foundOne = 1;
+ } else if ((*attrArgv[i] == 'n')
+ && (strcmp(attrArgv[i], "noUpdates") == 0)) {
+ wmPtr->attributes |= kWindowNoUpdatesAttribute;
+ foundOne = 1;
+ } else {
+ foundOne = 0;
+ break;
+ }
+ }
+
+ if (attrArgv != NULL) {
+ ckfree ((char *) attrArgv);
+ }
+
+ if (foundOne != 1) {
+ wmPtr->macClass = oldClass;
+ wmPtr->attributes = oldAttributes;
+
+ Tcl_AppendResult(interp, "bad attribute: \"", argv[4],
+ "\", should be standardDocument, ",
+ "standardFloating, or some combination of ",
+ "closeBox, horizontalZoom, verticalZoom, ",
+ "collapseBox, resizable, or sideTitlebar.",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ }
+
+ wmPtr->style = -1;
+ }
+ } else {
+ Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
+ "\": must be style",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpMakeMenuWindow --
+ *
+ * Configure the window to be either a undecorated pull-down
+ * (or pop-up) menu, or as a toplevel floating menu (palette).
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Changes the style bit used to create a new Mac toplevel.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpMakeMenuWindow(
+ Tk_Window tkwin, /* New window. */
+ int transient) /* 1 means menu is only posted briefly as
+ * a popup or pulldown or cascade. 0 means
+ * menu is always visible, e.g. as a
+ * floating menu. */
+{
+ if (transient) {
+ ((TkWindow *) tkwin)->wmInfoPtr->style = plainDBox;
+ } else {
+ ((TkWindow *) tkwin)->wmInfoPtr->style = floatProc;
+ ((TkWindow *) tkwin)->wmInfoPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
+ ((TkWindow *) tkwin)->wmInfoPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXMakeRealWindowExist --
+ *
+ * This function finally creates the real Macintosh window that
+ * the Mac actually understands.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A new Macintosh toplevel is created.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXMakeRealWindowExist(
+ TkWindow *winPtr) /* Tk window. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WindowRef newWindow = NULL;
+ ControlRef rootControl = NULL;
+ MacDrawable *macWin;
+ Rect geometry = {0,0,0,0};
+ Tcl_HashEntry *valueHashPtr;
+ int new;
+ TkMacOSXWindowList *listPtr;
+
+ if (TkMacOSXHostToplevelExists(winPtr)) {
+ return;
+ }
+
+ macWin = (MacDrawable *) winPtr->window;
+
+ /*
+ * If this is embedded, make sure its container's toplevel exists,
+ * then return...
+ */
+
+ if (Tk_IsEmbedded(winPtr)) {
+ TkWindow *contWinPtr;
+
+ contWinPtr = TkpGetOtherWindow(winPtr);
+ if (contWinPtr != NULL) {
+ TkMacOSXMakeRealWindowExist(contWinPtr->privatePtr->toplevel->winPtr);
+ macWin->flags |= TK_HOST_EXISTS;
+ return;
+ } else if (gMacEmbedHandler != NULL) {
+ if (gMacEmbedHandler->containerExistProc != NULL) {
+ if (gMacEmbedHandler->containerExistProc((Tk_Window) winPtr) != TCL_OK) {
+ panic("ContainerExistProc could not make container");
+ }
+ }
+ return;
+ } else {
+ panic("TkMacOSXMakeRealWindowExist could not find container");
+ }
+
+ /*
+ * NOTE: Here we should handle out of process embedding.
+ */
+
+ }
+
+ InitialWindowBounds(winPtr, &geometry);
+
+ if (wmPtr->style == -1) {
+ OSStatus err;
+ /*
+ * There seems to be a bug in CreateNewWindow: If I set the
+ * window geometry to be the too small for the structure region,
+ * then the whole window is positioned incorrectly.
+ * Adding this here makes the positioning work, and the size will
+ * get overwritten when you actually map the contents of the window.
+ */
+
+ geometry.right += 64;
+ geometry.bottom += 24;
+ err = CreateNewWindow(wmPtr->macClass, wmPtr->attributes,
+ &geometry, &newWindow);
+ if (err != noErr) {
+ newWindow = NULL;
+ }
+
+ } else {
+ newWindow = NewCWindow(NULL, &geometry, "\ptemp", false,
+ (short) wmPtr->style, (WindowRef) -1, true, 0);
+ }
+
+ if (newWindow == NULL) {
+ panic("couldn't allocate new Mac window");
+ }
+ if (CreateRootControl(newWindow,&rootControl) != noErr ) {
+ panic("couldn't create root control for new Mac window");
+ }
+
+ /*
+ * Add this window to the list of toplevel windows.
+ */
+
+ listPtr = (TkMacOSXWindowList *) ckalloc(sizeof(TkMacOSXWindowList));
+ listPtr->nextPtr = tkMacOSXWindowListPtr;
+ listPtr->winPtr = winPtr;
+ tkMacOSXWindowListPtr = listPtr;
+
+ macWin->grafPtr = GetWindowPort ( newWindow );
+ macWin->rootControl = rootControl;
+ MoveWindowStructure(newWindow, geometry.left, geometry.top);
+ SetPort(GetWindowPort(newWindow));
+
+ if (!windowHashInit) {
+ Tcl_InitHashTable(&windowTable, TCL_ONE_WORD_KEYS);
+ windowHashInit = true;
+ }
+ valueHashPtr = Tcl_CreateHashEntry(&windowTable,
+ (char *) newWindow, &new);
+ if (!new) {
+ panic("same macintosh window allocated twice!");
+ }
+ Tcl_SetHashValue(valueHashPtr, macWin);
+
+ macWin->flags |= TK_HOST_EXISTS;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXRegisterOffScreenWindow --
+ *
+ * This function adds the passed in Off Screen Port to the
+ * hash table that maps Mac windows to root X windows.
+ *
+ * FIXME: This is not currently used. Is there any reason
+ * to keep it?
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * An entry is added to the windowTable hash table.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXRegisterOffScreenWindow(
+ Window window, /* Window structure. */
+ GWorldPtr portPtr) /* Pointer to a Mac GWorld. */
+{
+ MacDrawable *macWin;
+ Tcl_HashEntry *valueHashPtr;
+ int new;
+
+ macWin = (MacDrawable *) window;
+ if (!windowHashInit) {
+ Tcl_InitHashTable(&windowTable, TCL_ONE_WORD_KEYS);
+ windowHashInit = true;
+ }
+ valueHashPtr = Tcl_CreateHashEntry(&windowTable,
+ (char *) portPtr, &new);
+ if (!new) {
+ panic("same macintosh window allocated twice!");
+ }
+ Tcl_SetHashValue(valueHashPtr, macWin);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXUnregisterMacWindow --
+ *
+ * Given a macintosh port window, this function removes the
+ * association between this window and the root X window that
+ * Tk cares about.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * An entry is removed from the windowTable hash table.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXUnregisterMacWindow(
+ WindowRef macWinPtr) /* Reference to a Mac Window */
+{
+ Tcl_HashEntry *entryPtr;
+ if (!windowHashInit) {
+ panic("TkMacOSXUnregisterMacWindow: unmapping before inited");
+ }
+ entryPtr=Tcl_FindHashEntry(&windowTable,(char *) macWinPtr);
+ if (!entryPtr) {
+ fprintf(stderr,"Unregister:failed to find window %08x\n",
+ (int) macWinPtr );
+ }
+ else {
+ Tcl_DeleteHashEntry(entryPtr);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXSetScrollbarGrow --
+ *
+ * Sets a flag for a toplevel window indicating that the passed
+ * Tk scrollbar window will display the grow region for the
+ * toplevel window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * A flag is set int windows toplevel parent.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXSetScrollbarGrow(
+ TkWindow *winPtr, /* Tk scrollbar window. */
+ int flag) /* Boolean value true or false. */
+{
+ if (flag) {
+ winPtr->privatePtr->toplevel->flags |= TK_SCROLLBAR_GROW;
+ winPtr->privatePtr->toplevel->winPtr->wmInfoPtr->scrollWinPtr = winPtr;
+ } else if (winPtr->privatePtr->toplevel->winPtr->wmInfoPtr->scrollWinPtr
+ == winPtr) {
+ winPtr->privatePtr->toplevel->flags &= ~TK_SCROLLBAR_GROW;
+ winPtr->privatePtr->toplevel->winPtr->wmInfoPtr->scrollWinPtr = NULL;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmFocusToplevel --
+ *
+ * This is a utility procedure invoked by focus-management code. It
+ * exists because of the extra wrapper windows that exist under
+ * Unix; its job is to map from wrapper windows to the
+ * corresponding toplevel windows. On PCs and Macs there are no
+ * wrapper windows so no mapping is necessary; this procedure just
+ * determines whether a window is a toplevel or not.
+ *
+ * Results:
+ * If winPtr is a toplevel window, returns the pointer to the
+ * window; otherwise returns NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow *
+TkWmFocusToplevel(
+ TkWindow *winPtr) /* Window that received a focus-related
+ * event. */
+{
+ if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ return NULL;
+ }
+ return winPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetWrapperWindow --
+ *
+ * This is a utility procedure invoked by focus-management code. It
+ * maps to the wrapper for a top-level, which is just the same
+ * as the top-level on Macs and PCs.
+ *
+ * Results:
+ * If winPtr is a toplevel window, returns the pointer to the
+ * window; otherwise returns NULL.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow *
+TkpGetWrapperWindow(
+ TkWindow *winPtr) /* Window that received a focus-related
+ * event. */
+{
+ if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ return NULL;
+ }
+ return winPtr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpWmSetState --
+ *
+ * Sets the window manager state for the wrapper window of a
+ * given toplevel window.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * May maximize, minimize, restore, or withdraw a window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpWmSetState(winPtr, state)
+ TkWindow *winPtr; /* Toplevel window to operate on. */
+ int state; /* One of IconicState, ZoomState, NormalState,
+ * or WithdrawnState. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+ WindowRef macWin;
+
+ wmPtr->hints.initial_state = state;
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ return;
+ }
+
+ macWin = GetWindowFromPort(TkMacOSXGetDrawablePort (winPtr->window));
+
+ if (state == WithdrawnState) {
+ Tk_UnmapWindow((Tk_Window) winPtr);
+ } else if (state == IconicState) {
+ Tk_UnmapWindow((Tk_Window) winPtr);
+ /*
+ * The window always gets unmapped. However, if we can show the
+ * icon version of the window (collapsed) we make the window visable
+ * and then collapse it.
+ *
+ * TODO: This approach causes flashing!
+ */
+
+ if (IsWindowCollapsable(macWin)) {
+ ShowWindow(macWin);
+ CollapseWindow( macWin, true);
+ }
+
+ } else if (state == NormalState) {
+ Tk_MapWindow((Tk_Window) winPtr);
+ CollapseWindow((WindowPtr) macWin, false);
+ } else if (state == ZoomState) {
+ /* TODO: need to support zoomed windows */
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpIsWindowFloating --
+ *
+ * Returns 1 if a window is floating, 0 otherwise.
+ *
+ * Results:
+ * 1 or 0 depending on window's floating attribute.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpIsWindowFloating(WindowRef wRef)
+{
+ WindowClass class;
+ GetWindowClass(wRef, &class);
+ return (class == kFloatingWindowClass);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkMacOSXWindowOffset --
+ *
+ * Determines the x and y offset from the orgin of the toplevel
+ * window dressing (the structure region, ie. title bar) and the
+ * orgin of the content area.
+ *
+ * Results:
+ * The x & y offset in pixels.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkMacOSXWindowOffset(
+ WindowRef wRef,
+ int *xOffset,
+ int *yOffset)
+{
+ OSErr err = noErr;
+ static RgnHandle strucRgn = NULL;
+ static RgnHandle contRgn = NULL;
+ Rect strucRect, contRect;
+
+ if (!strucRgn) {
+ if(!(strucRgn = NewRgn())) {
+ err=MemError();
+ }
+ }
+ if (!contRgn) {
+ if(!(contRgn = NewRgn())) {
+ err=MemError();
+ }
+ }
+ if (err==noErr) {
+ GetWindowRegion(wRef, kWindowStructureRgn, strucRgn);
+ GetWindowRegion(wRef, kWindowContentRgn, contRgn);
+ GetRegionBounds(strucRgn,&strucRect);
+ GetRegionBounds(contRgn,&contRect);
+ *xOffset = contRect.left - strucRect.left;
+ *yOffset = contRect.top - strucRect.top;
+ } else {
+ *xOffset = 0;
+ *yOffset = 0;
+ }
+ return;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpGetMS --
+ *
+ * Return a relative time in milliseconds. It doesn't matter
+ * when the epoch was.
+ *
+ * Results:
+ * Number of milliseconds.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+unsigned long
+TkpGetMS()
+{
+ long long * int64Ptr;
+ UnsignedWide micros;
+
+ Microseconds(&micros);
+ int64Ptr = (long long *) &micros;
+
+ /*
+ * We need 64 bit math to do this. This is available in CW 11
+ * and on. Other's will need to use a different scheme.
+ */
+
+ *int64Ptr /= 1000;
+
+ return (long) *int64Ptr;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XSetInputFocus --
+ *
+ * Change the focus window for the application.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XSetInputFocus(
+ Display* display,
+ Window focus,
+ int revert_to,
+ Time time)
+{
+ /*
+ * Don't need to do a thing. Tk manages the focus for us.
+ */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpChangeFocus --
+ *
+ * This procedure is a stub on the Mac because we always own the
+ * focus if we are a front most application.
+ *
+ * Results:
+ * The return value is the serial number of the command that
+ * changed the focus. It may be needed by the caller to filter
+ * out focus change events that were queued before the command.
+ * If the procedure doesn't actually change the focus then
+ * it returns 0.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpChangeFocus(winPtr, force)
+ TkWindow *winPtr; /* Window that is to receive the X focus. */
+ int force; /* Non-zero means claim the focus even
+ * if it didn't originally belong to
+ * topLevelPtr's application. */
+{
+ /*
+ * We don't really need to do anything on the Mac. Tk will
+ * keep all this state for us.
+ */
+
+ if (winPtr->atts.override_redirect) {
+ return 0;
+ }
+
+ /*
+ * Remember the current serial number for the X server and issue
+ * a dummy server request. This marks the position at which we
+ * changed the focus, so we can distinguish FocusIn and FocusOut
+ * events on either side of the mark.
+ */
+
+ return NextRequest(winPtr->display);
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmStackorderToplevelWrapperMap --
+ *
+ * This procedure will create a table that maps the reparent wrapper
+ * X id for a toplevel to the TkWindow structure that is wraps.
+ * Tk keeps track of a mapping from the window X id to the TkWindow
+ * structure but that does us no good here since we only get the X
+ * id of the wrapper window. Only those toplevel windows that are
+ * mapped have a position in the stacking order.
+ *
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Adds entries to the passed hashtable.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+TkWmStackorderToplevelWrapperMap(winPtr, table)
+ TkWindow *winPtr; /* TkWindow to recurse on */
+ Tcl_HashTable *table; /* Maps mac window to TkWindow */
+{
+ TkWindow *childPtr;
+ Tcl_HashEntry *hPtr;
+ void *wrapper;
+ int newEntry;
+
+ if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr)) {
+ wrapper = (void *) TkMacOSXGetDrawablePort(winPtr->window);
+
+ hPtr = Tcl_CreateHashEntry(table,
+ (char *) wrapper, &newEntry);
+ Tcl_SetHashValue(hPtr, winPtr);
+ }
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ TkWmStackorderToplevelWrapperMap(childPtr, table);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmStackorderToplevel --
+ *
+ * This procedure returns the stack order of toplevel windows.
+ *
+ * Results:
+ * An array of pointers to tk window objects in stacking order
+ * or else NULL if there was an error.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow **
+TkWmStackorderToplevel(parentPtr)
+ TkWindow *parentPtr; /* Parent toplevel window. */
+{
+ WindowRef frontWindow;
+ TkWindow *childWinPtr, **windows, **window_ptr;
+ Tcl_HashTable table;
+ Tcl_HashEntry *hPtr;
+ Tcl_HashSearch search;
+
+ /*
+ * Map mac windows to a TkWindow of the wrapped toplevel.
+ */
+
+ Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
+ TkWmStackorderToplevelWrapperMap(parentPtr, &table);
+
+ windows = (TkWindow **) ckalloc((table.numEntries+1)
+ * sizeof(TkWindow *));
+
+ /*
+ * Special cases: If zero or one toplevels were mapped
+ * there is no need to enumerate Windows.
+ */
+
+ switch (table.numEntries) {
+ case 0:
+ windows[0] = NULL;
+ goto done;
+ case 1:
+ hPtr = Tcl_FirstHashEntry(&table, &search);
+ windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr);
+ windows[1] = NULL;
+ goto done;
+ }
+
+ frontWindow = (WindowRef) FrontWindow();
+
+ if (frontWindow == NULL) {
+ ckfree((char *) windows);
+ windows = NULL;
+ } else {
+ window_ptr = windows + table.numEntries;
+ *window_ptr-- = NULL;
+ while (frontWindow != NULL) {
+ hPtr = Tcl_FindHashEntry(&table, (char *) frontWindow);
+ if (hPtr != NULL) {
+ childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
+ *window_ptr-- = childWinPtr;
+ }
+ frontWindow = GetNextWindow(frontWindow);
+ }
+ if (window_ptr != (windows-1))
+ panic("num matched toplevel windows does not equal num children");
+ }
+
+ done:
+ Tcl_DeleteHashTable(&table);
+ return windows;
+}
+
+
+
+
+
diff --git a/tk/macosx/tkMacOSXWm.h b/tk/macosx/tkMacOSXWm.h
new file mode 100644
index 00000000000..eaa0dd52ef6
--- /dev/null
+++ b/tk/macosx/tkMacOSXWm.h
@@ -0,0 +1,302 @@
+/*
+/*
+ * tkMacOSXWm.h --
+ *
+ * Declarations of Macintosh specific functions for implementing the
+ * Mac OS X Notifier.
+ *
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * The following terms apply to all files originating from Apple
+ * Computer, Inc. ("Apple") and associated with the software
+ * unless explicitly disclaimed in individual files.
+ *
+ *
+ * Apple hereby grants permission to use, copy, modify,
+ * distribute, and license this software and its documentation
+ * for any purpose, provided that existing copyright notices are
+ * retained in all copies and that this notice is included
+ * verbatim in any distributions. No written agreement, license,
+ * or royalty fee is required for any of the authorized
+ * uses. Modifications to this software may be copyrighted by
+ * their authors and need not follow the licensing terms
+ * described here, provided that the new terms are clearly
+ * indicated on the first page of each file where they apply.
+ *
+ *
+ * IN NO EVENT SHALL APPLE, THE AUTHORS OR DISTRIBUTORS OF THE
+ * SOFTWARE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
+ * THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
+ * EVEN IF APPLE OR THE AUTHORS HAVE BEEN ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE. APPLE, THE AUTHORS AND
+ * DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS
+ * SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND APPLE,THE
+ * AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * GOVERNMENT USE: If you are acquiring this software on behalf
+ * of the U.S. government, the Government shall have only
+ * "Restricted Rights" in the software and related documentation
+ * as defined in the Federal Acquisition Regulations (FARs) in
+ * Clause 52.227.19 (c) (2). If you are acquiring the software
+ * on behalf of the Department of Defense, the software shall be
+ * classified as "Commercial Computer Software" and the
+ * Government shall have only "Restricted Rights" as defined in
+ * Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the
+ * foregoing, the authors grant the U.S. Government and others
+ * acting in its behalf permission to use and distribute the
+ * software in accordance with the terms specified in this
+ * license.
+ */
+
+#ifndef _TKMACWM
+#define _TKMACWM
+
+#include <Carbon/Carbon.h>
+#include "tkPort.h"
+#include "tkInt.h"
+#include "tkMacOSXInt.h"
+#include <errno.h>
+#include "tkScrollbar.h"
+
+/*
+ * A data structure of the following type holds information for
+ * each window manager protocol (such as WM_DELETE_WINDOW) for
+ * which a handler (i.e. a Tcl command) has been defined for a
+ * particular top-level window.
+ */
+
+typedef struct ProtocolHandler {
+ Atom protocol; /* Identifies the protocol. */
+ struct ProtocolHandler *nextPtr;
+ /* Next in list of protocol handlers for
+ * the same top-level window, or NULL for
+ * end of list. */
+ Tcl_Interp *interp; /* Interpreter in which to invoke command. */
+ char command[4]; /* Tcl command to invoke when a client
+ * message for this protocol arrives.
+ * The actual size of the structure varies
+ * to accommodate the needs of the actual
+ * command. THIS MUST BE THE LAST FIELD OF
+ * THE STRUCTURE. */
+} ProtocolHandler;
+
+#define HANDLER_SIZE(cmdLength) \
+((unsigned) (sizeof(ProtocolHandler) - 3 + cmdLength))
+
+/*
+ * A data structure of the following type holds window-manager-related
+ * information for each top-level window in an application.
+ */
+
+typedef struct TkWmInfo {
+ TkWindow *winPtr; /* Pointer to main Tk information for
+ * this window. */
+ Window reparent; /* If the window has been reparented, this
+ * gives the ID of the ancestor of the window
+ * that is a child of the root window (may
+ * not be window's immediate parent). If
+ * the window isn't reparented, this has the
+ * value None. */
+ Tk_Uid titleUid; /* Title to display in window caption. If
+ * NULL, use name of widget. */
+ char *iconName; /* Name to display in icon. */
+ Window master; /* Master window for TRANSIENT_FOR property,
+ * or None. */
+ XWMHints hints; /* Various pieces of information for
+ * window manager. */
+ char *leaderName; /* Path name of leader of window group
+ * (corresponds to hints.window_group).
+ * Malloc-ed. Note: this field doesn't
+ * get updated if leader is destroyed. */
+ char *masterWindowName; /* Path name of window specified as master
+ * in "wm transient" command, or NULL.
+ * Malloc-ed. Note: this field doesn't
+ * get updated if masterWindowName is
+ * destroyed. */
+ Tk_Window icon; /* Window to use as icon for this window,
+ * or NULL. */
+ Tk_Window iconFor; /* Window for which this window is icon, or
+ * NULL if this isn't an icon for anyone. */
+
+ /*
+ * Information used to construct an XSizeHints structure for
+ * the window manager:
+ */
+
+ int sizeHintsFlags; /* Flags word for XSizeHints structure.
+ * If the PBaseSize flag is set then the
+ * window is gridded; otherwise it isn't
+ * gridded. */
+ int minWidth, minHeight; /* Minimum dimensions of window, in
+ * grid units, not pixels. */
+ int maxWidth, maxHeight; /* Maximum dimensions of window, in
+ * grid units, not pixels. */
+ Tk_Window gridWin; /* Identifies the window that controls
+ * gridding for this top-level, or NULL if
+ * the top-level isn't currently gridded. */
+ int widthInc, heightInc; /* Increments for size changes (# pixels
+ * per step). */
+ struct {
+ int x; /* numerator */
+ int y; /* denominator */
+ } minAspect, maxAspect; /* Min/max aspect ratios for window. */
+ int reqGridWidth, reqGridHeight;
+ /* The dimensions of the window (in
+ * grid units) requested through
+ * the geometry manager. */
+ int gravity; /* Desired window gravity. */
+
+ /*
+ * Information used to manage the size and location of a window.
+ */
+
+ int width, height; /* Desired dimensions of window, specified
+ * in grid units. These values are
+ * set by the "wm geometry" command and by
+ * ConfigureNotify events (for when wm
+ * resizes window). -1 means user hasn't
+ * requested dimensions. */
+ int x, y; /* Desired X and Y coordinates for window.
+ * These values are set by "wm geometry",
+ * plus by ConfigureNotify events (when wm
+ * moves window). These numbers are
+ * different than the numbers stored in
+ * winPtr->changes because (a) they could be
+ * measured from the right or bottom edge
+ * of the screen (see WM_NEGATIVE_X and
+ * WM_NEGATIVE_Y flags) and (b) if the window
+ * has been reparented then they refer to the
+ * parent rather than the window itself. */
+ int parentWidth, parentHeight;
+ /* Width and height of reparent, in pixels
+ * *including border*. If window hasn't been
+ * reparented then these will be the outer
+ * dimensions of the window, including
+ * border. */
+ int xInParent, yInParent; /* Offset of window within reparent, measured
+ * from upper-left outer corner of parent's
+ * border to upper-left outer corner of child's
+ * border. If not reparented then these are
+ * zero. */
+ int configWidth, configHeight;
+ /* Dimensions passed to last request that we
+ * issued to change geometry of window. Used
+ * to eliminate redundant resize operations. */
+
+ /*
+ * Information about the virtual root window for this top-level,
+ * if there is one.
+ */
+
+ Window vRoot; /* Virtual root window for this top-level,
+ * or None if there is no virtual root
+ * window (i.e. just use the screen's root). */
+ int vRootX, vRootY; /* Position of the virtual root inside the
+ * root window. If the WM_VROOT_OFFSET_STALE
+ * flag is set then this information may be
+ * incorrect and needs to be refreshed from
+ * the X server. If vRoot is None then these
+ * values are both 0. */
+ unsigned int vRootWidth, vRootHeight;
+ /* Dimensions of the virtual root window.
+ * If vRoot is None, gives the dimensions
+ * of the containing screen. This information
+ * is never stale, even though vRootX and
+ * vRootY can be. */
+
+ /*
+ * List of children of the toplevel which have private colormaps.
+ */
+
+ TkWindow **cmapList; /* Array of window with private colormaps. */
+ int cmapCount; /* Number of windows in array. */
+
+ /*
+ * Miscellaneous information.
+ */
+
+ ProtocolHandler *protPtr; /* First in list of protocol handlers for
+ * this window (NULL means none). */
+ int cmdArgc; /* Number of elements in cmdArgv below. */
+ CONST char **cmdArgv; /* Array of strings to store in the
+ * WM_COMMAND property. NULL means nothing
+ * available. */
+ char *clientMachine; /* String to store in WM_CLIENT_MACHINE
+ * property, or NULL. */
+ int flags; /* Miscellaneous flags, defined below. */
+
+ /*
+ * Macintosh information.
+ */
+ int style; /* Native window style. */
+ int macClass;
+ int attributes;
+ TkWindow *scrollWinPtr; /* Ptr to scrollbar handling grow widget. */
+} WmInfo;
+
+
+/*
+ * Flag values for WmInfo structures:
+ *
+ * WM_NEVER_MAPPED - non-zero means window has never been
+ * mapped; need to update all info when
+ * window is first mapped.
+ * WM_UPDATE_PENDING - non-zero means a call to UpdateGeometryInfo
+ * has already been scheduled for this
+ * window; no need to schedule another one.
+ * WM_NEGATIVE_X - non-zero means x-coordinate is measured in
+ * pixels from right edge of screen, rather
+ * than from left edge.
+ * WM_NEGATIVE_Y - non-zero means y-coordinate is measured in
+ * pixels up from bottom of screen, rather than
+ * down from top.
+ * WM_UPDATE_SIZE_HINTS - non-zero means that new size hints need to be
+ * propagated to window manager.
+ * WM_SYNC_PENDING - set to non-zero while waiting for the window
+ * manager to respond to some state change.
+ * WM_VROOT_OFFSET_STALE - non-zero means that (x,y) offset information
+ * about the virtual root window is stale and
+ * needs to be fetched fresh from the X server.
+ * WM_ABOUT_TO_MAP - non-zero means that the window is about to
+ * be mapped by TkWmMapWindow. This is used
+ * by UpdateGeometryInfo to modify its behavior.
+ * WM_MOVE_PENDING - non-zero means the application has requested
+ * a new position for the window, but it hasn't
+ * been reflected through the window manager
+ * yet.
+ * WM_COLORMAPS_EXPLICIT - non-zero means the colormap windows were
+ * set explicitly via "wm colormapwindows".
+ * WM_ADDED_TOPLEVEL_COLORMAP - non-zero means that when "wm colormapwindows"
+ * was called the top-level itself wasn't
+ * specified, so we added it implicitly at
+ * the end of the list.
+ * WM_WIDTH_NOT_RESIZABLE - non-zero means that we're not supposed to
+ * allow the user to change the width of the
+ * window (controlled by "wm resizable"
+ * command).
+ * WM_HEIGHT_NOT_RESIZABLE - non-zero means that we're not supposed to
+ * allow the user to change the height of the
+ * window (controlled by "wm resizable"
+ * command).
+ */
+
+#define WM_NEVER_MAPPED 1
+#define WM_UPDATE_PENDING 2
+#define WM_NEGATIVE_X 4
+#define WM_NEGATIVE_Y 8
+#define WM_UPDATE_SIZE_HINTS 0x10
+#define WM_SYNC_PENDING 0x20
+#define WM_VROOT_OFFSET_STALE 0x40
+#define WM_ABOUT_TO_MAP 0x100
+#define WM_MOVE_PENDING 0x200
+#define WM_COLORMAPS_EXPLICIT 0x400
+#define WM_ADDED_TOPLEVEL_COLORMAP 0x800
+#define WM_WIDTH_NOT_RESIZABLE 0x1000
+#define WM_HEIGHT_NOT_RESIZABLE 0x2000
+
+#endif
+
diff --git a/tk/macosx/tkMacOSXXCursors.r b/tk/macosx/tkMacOSXXCursors.r
new file mode 100644
index 00000000000..f2902bbde2c
--- /dev/null
+++ b/tk/macosx/tkMacOSXXCursors.r
@@ -0,0 +1,961 @@
+/*
+ * tkMacOSXXCursors.r --
+ *
+ * This file defines a set of Macintosh cursor resources that
+ * emulate the X cursor set. All of these cursors were
+ * constructed and donated by Grant Neufeld. (gneufeld@ccs.carleton.ca)
+ *
+ *
+ * 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$
+ */
+
+/*
+ * All of the X cursors are defined as 'CURS' resources. However, a
+ * subset of the X cursors are also defined as 'crsr' resources. Tk
+ * will attempt to first use the color cursors ('crsr') if it doesn't
+ * exist it will attempt to use the black & white cursor ('CURS').
+ */
+
+data 'CURS' (3000, "X_cursor") {
+ $"E007 F00F F81F 7C3E 3E7C 1FF8 0FF0 07E0"
+ $"07E0 0FF0 1FF8 3E7C 7C3E F81F F00F E007"
+ $"0000 6006 700E 381C 1C38 0E70 07E0 03C0"
+ $"03C0 07E0 0E70 1C38 381C 700E 6006 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3001, "arrow") {
+ $"0000 0006 001E 007C 01FC 07F8 00F8 01F0"
+ $"03B0 0720 0E20 1C00 3800 7000 2000 0000"
+ $"0007 001F 007F 01FE 07FE 1FFC 7FFC 03F8"
+ $"07F8 0FF0 1F70 3E60 7C60 F840 7040 2000"
+ $"0001 000E"
+};
+
+data 'CURS' (3002, "based_arrow_down") {
+ $"0000 0000 0000 1FE0 0000 1FE0 0300 0300"
+ $"0300 0B40 0780 0300 0000 0000 0000 0000"
+ $"0000 0000 0000 1FE0 0000 1FE0 0780 0780"
+ $"3FF0 1FE0 0FC0 0780 0300 0000 0000 0000"
+ $"000B 0006"
+};
+
+data 'CURS' (3003, "based_arrow_up") {
+ $"0000 0000 0000 0000 0300 0780 0B40 0300"
+ $"0300 0300 1FE0 0000 1FE0 0000 0000 0000"
+ $"0000 0000 0000 0300 0780 0FC0 1FE0 3FF0"
+ $"0780 0780 1FE0 0000 1FE0 0000 0000 0000"
+ $"0004 0006"
+};
+
+data 'CURS' (3004, "boat") {
+ $"0000 0000 0000 0000 0100 03C0 8460 FFFF"
+ $"0018 0020 0040 FFC0 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0100 03C0 87E0 FFFF"
+ $"FFF8 FFE0 FFC0 FFC0 0000 0000 0000 0000"
+ $"0007 000F"
+};
+
+data 'CURS' (3005, "bogosity") {
+ $"0000 711C 1110 1110 1110 7FFC 5114 5114"
+ $"5114 5114 7FFC 1110 1110 1110 711C 0000"
+ $"0000 0000 0000 0000 0000 7FFC 7FFC 7FFC"
+ $"7FFC 7FFC 7FFC 0000 0000 0000 0000 0000"
+ $"0001 0007"
+};
+
+data 'CURS' (3006, "bottom_left_corner") {
+ $"0000 0000 0000 0000 C000 C020 C840 C880"
+ $"C900 CA00 CC00 CFC0 C000 C000 FFF0 FFF0"
+ $"0000 0000 0000 0000 0000 0020 0840 0880"
+ $"0900 0A00 0C00 0FC0 0000 0000 0000 0000"
+ $"000F 0000"
+};
+
+data 'CURS' (3007, "bottom_right_corner") {
+ $"0000 0000 0000 0000 0003 0403 0213 0113"
+ $"0093 0053 0033 03F3 0003 0003 0FFF 0FFF"
+ $"0000 0000 0000 0000 0000 0400 0210 0110"
+ $"0090 0050 0030 03F0 0000 0000 0000 0000"
+ $"000F 000F"
+};
+
+data 'CURS' (3008, "bottom_side") {
+ $"0000 0000 0100 0100 0100 0100 0100 1110"
+ $"0920 0540 0380 0100 0000 7FFC 7FFC 0000"
+ $"0000 0000 0100 0100 0100 0100 0100 1110"
+ $"0920 0540 0380 0100 0000 0000 0000 0000"
+ $"000B 0007"
+};
+
+data 'CURS' (3009, "bottom_tee") {
+ $"0000 0000 0000 0180 0180 0180 0180 0180"
+ $"0180 0180 7FFE 7FFE 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"000B 0007"
+};
+
+data 'CURS' (3010, "box_spiral") {
+ $"FFFE 8000 BFFE A002 AFFA A80A ABEA AA2A"
+ $"AAAA ABAA A82A AFEA A00A BFFA 8002 FFFE"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0008 0008"
+};
+
+data 'CURS' (3011, "center_ptr") {
+ $"0000 0300 0300 0780 0780 0FC0 0FC0 1FE0"
+ $"1FE0 3330 2310 0300 0300 0300 0300 0000"
+ $"0300 0780 0780 0FC0 0FC0 1FE0 1FE0 3FF0"
+ $"3FF0 7FF8 77B8 6798 0780 0780 0780 0780"
+ $"0001 0006"
+};
+
+data 'CURS' (3012, "circle") {
+ $"0000 03C0 0FF0 1FF8 3C3C 381C 700E 700E"
+ $"700E 700E 381C 3C3C 1FF8 0FF0 03C0 0000"
+ $"03C0 0FF0 1FF8 3FFC 7FFE 7C3E F81F F81F"
+ $"F81F F81F 7C3E 7FFE 3FFC 1FF8 0FF0 03C0"
+ $"0007 0007"
+};
+
+data 'CURS' (3013, "clock") {
+ $"1FF8 33CC 6466 4992 4F12 4422 63C6 3FFC"
+ $"2994 2994 2994 2BD4 6996 781E 7FFE 7FFE"
+ $"1FF8 3FFC 7FFE 7FFE 7FFE 7FFE 7FFE 3FFC"
+ $"3FFC 3FFC 3FFC 3FFC 7FFE 7FFE 7FFE 7FFE"
+ $"0004 0008"
+};
+
+data 'CURS' (3014, "coffee_mug") {
+ $"03F8 0C06 1001 1C07 33F9 7001 D001 9001"
+ $"960D DA55 7A55 36ED 10A1 1001 0802 07FC"
+ $"03F8 0FFE 1FFF 1FFF 3FFF 7FFF FFFF FFFF"
+ $"FFFF FFFF 7FFF 3FFF 1FFF 1FFF 0FFE 07FC"
+ $"0004 0003"
+};
+
+data 'CURS' (3015, "cross") {
+ $"0280 0280 0280 0280 0280 0280 FEFE 0000"
+ $"FEFE 0280 0280 0280 0280 0280 0280 0000"
+ $"0380 0380 0380 0380 0380 0380 FFFE FFFE"
+ $"FFFE 0380 0380 0380 0380 0380 0380 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3016, "cross_reverse") {
+ $"4284 A28A 5294 2AA8 16D0 0AA0 FD7E 0280"
+ $"FD7E 0AA0 16D0 2AA8 5294 A28A 4284 0000"
+ $"4384 E38E 739C 3BB8 1FF0 0FE0 FFFE FFFE"
+ $"FFFE 0FE0 1FF0 3BB8 739C E38E 4384 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3017, "crosshair") {
+ $"0100 0100 0100 0100 0100 0100 0100 FEFE"
+ $"0100 0100 0100 0100 0100 0100 0100 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3018, "diamond_cross") {
+ $"0280 06C0 0AA0 1290 2288 4284 FEFE 0000"
+ $"FEFE 4284 2288 1290 0AA0 06C0 0280 0000"
+ $"0280 06C0 0EE0 1EF0 3EF8 7EFC FEFE 0000"
+ $"FEFE 7EFC 3EF8 1EF0 0EE0 06C0 0280 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3019, "dot") {
+ $"0000 0000 0780 1FE0 1FE0 3FF0 3FF0 3FF0"
+ $"3FF0 1FE0 1FE0 0780 0000 0000 0000 0000"
+ $"0000 0780 1FE0 3FF0 3FF0 7FF8 7FF8 7FF8"
+ $"7FF8 3FF0 3FF0 1FE0 0780 0000 0000 0000"
+ $"0006 0006"
+};
+
+data 'CURS' (3020, "dotbox") {
+ $"0000 0000 3FFC 2004 2004 2004 2004 2184"
+ $"2184 2004 2004 2004 2004 3FFC 0000 0000"
+ $"0000 0000 3FFC 3FFC 300C 300C 318C 33CC"
+ $"33CC 318C 300C 300C 3FFC 3FFC 0000 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3021, "double_arrow") {
+ $"0000 0180 03C0 07E0 0DB0 1998 0180 0180"
+ $"0180 0180 1998 0DB0 07E0 03C0 0180 0000"
+ $"0180 03C0 07E0 0FF0 1FF8 3FFC 3BDC 03C0"
+ $"03C0 3BDC 3FFC 1FF8 0FF0 07E0 03C0 0180"
+ $"0007 0007"
+};
+
+data 'CURS' (3022, "draft_large") {
+ $"0000 0002 000C 003C 00F8 03F8 0FF0 00F0"
+ $"0160 0260 0440 0840 1000 2000 4000 0000"
+ $"0003 000F 003E 00FE 03FC 0FFC 3FF8 FFF8"
+ $"03F0 07F0 0EE0 1CE0 38C0 70C0 E080 4080"
+ $"0001 000E"
+};
+
+data 'CURS' (3023, "draft_small") {
+ $"0000 0002 000C 003C 00F8 03F8 0070 00B0"
+ $"0120 0220 0400 0800 1000 2000 4000 0000"
+ $"0003 000F 003E 00FE 03FC 0FFC 3FF8 01F8"
+ $"03F0 0770 0E60 1C60 3840 7040 E000 4000"
+ $"0001 000E"
+};
+
+data 'CURS' (3024, "draped_box") {
+ $"0000 0000 3FFC 2244 2664 2C34 381C 2184"
+ $"2184 381C 2C34 2664 2244 3FFC 0000 0000"
+ $"0000 0000 3FFC 3E7C 3E7C 3C3C 399C 23C4"
+ $"23C4 399C 3C3C 3E7C 3E7C 3FFC 0000 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3025, "exchange") {
+ $"0000 47C0 6FE0 7C30 4810 4C00 7E00 0000"
+ $"0000 00FC 0064 1024 187C 0FEC 07C4 0000"
+ $"C7C0 EFE0 FFF0 FFF8 FC38 FE10 FF00 FF80"
+ $"03FE 01FE 10FE 387E 3FFE 1FFE 0FEE 07C6"
+ $"0007 0007"
+};
+
+data 'CURS' (3026, "fleur") {
+ $"0000 0180 03C0 07E0 0180 1188 318C 7FFE"
+ $"7FFE 318C 1188 0180 07E0 03C0 0180 0000"
+ $"0180 03C0 07E0 0FF0 17E8 3BDC 7FFE FFFF"
+ $"FFFF 7FFE 3BDC 17E8 0FF0 07E0 03C0 0180"
+ $"0007 0007"
+};
+
+data 'CURS' (3027, "gobbler") {
+ $"0000 0078 0070 4036 4FB0 7FF0 7E30 7C30"
+ $"3038 00F0 0FE0 0400 0400 0400 0F00 0000"
+ $"00FC 00FC E0FF FFFF FFFF FFF8 FFF8 FFF8"
+ $"FFFC 7FFC 3FF8 1FF0 0E00 1F80 1F80 1F80"
+ $"0003 000E"
+};
+
+data 'CURS' (3028, "gumby") {
+ $"3F00 10C0 C820 EAA0 C820 CBA0 F838 383E"
+ $"0826 0826 092E 0926 0920 1110 2108 3EF8"
+ $"3F00 1FC0 CFE0 EFE0 CFE0 CFE0 FFF8 3FFE"
+ $"0FE6 0FE6 0FEE 0FE6 0FE0 1FF0 3FF8 3EF8"
+ $"0000 0002"
+};
+
+data 'CURS' (3029, "hand1") {
+ $"000C 003C 00F0 01E0 03C0 07E0 0FF0 2FE0"
+ $"7FF0 5FF0 07E0 07C0 4A00 6200 3400 1800"
+ $"000C 003C 00F0 01E0 03C0 07E0 0FF0 2FE0"
+ $"7FF0 7FF0 7FE0 7FC0 7E00 7E00 3C00 1800"
+ $"0000 000D"
+};
+
+data 'CURS' (3030, "hand2") {
+ $"0000 3FC0 4020 3F10 0808 0708 0808 0714"
+ $"0822 0641 0182 0124 0088 0050 0020 0000"
+ $"0000 3FC0 7FE0 3FF0 0FF8 07F8 0FF8 07FC"
+ $"0FFE 07FF 01FE 01FC 00F8 0070 0020 0000"
+ $"0002 0001"
+};
+
+data 'CURS' (3031, "heart") {
+ $"0000 3EF8 638C C106 8002 8002 8002 8002"
+ $"C006 600C 3018 1830 0C60 06C0 0380 0000"
+ $"0000 3EF8 7FFC FFFE FFFE FFFE FFFE FFFE"
+ $"FFFE 7FFC 3FF8 1FF0 0FE0 07C0 0380 0000"
+ $"0003 0007"
+};
+
+data 'CURS' (3032, "icon") {
+ $"FFFF D555 AAAB D555 A00B D005 A00B D005"
+ $"A00B D005 A00B D005 AAAB D555 AAAB FFFF"
+ $"FFFF FFFF FFFF FFFF F00F F00F F00F F00F"
+ $"F00F F00F F00F F00F FFFF FFFF FFFF FFFF"
+ $"0007 0007"
+};
+
+data 'CURS' (3033, "iron_cross") {
+ $"0000 3FFC 1FF8 4FF2 67E6 73CE 799E 7FFE"
+ $"7FFE 799E 73CE 67E6 4FF2 1FF8 3FFC 0000"
+ $"7FFE 7FFE FFFF FFFF FFFF FFFF FFFF FFFF"
+ $"FFFF FFFF FFFF FFFF FFFF FFFF 7FFE 7FFE"
+ $"0007 0006"
+};
+
+data 'CURS' (3034, "left_ptr") {
+ $"0000 0800 0C00 0E00 0F00 0F80 0FC0 0FE0"
+ $"0FF0 0F80 0D80 08C0 00C0 0060 0060 0000"
+ $"1800 1C00 1E00 1F00 1F80 1FC0 1FE0 1FF0"
+ $"1FF8 1FFC 1FC0 1DE0 19E0 10F0 00F0 0070"
+ $"0001 0004"
+};
+
+data 'CURS' (3035, "left_side") {
+ $"0000 6000 6000 6080 6100 6200 6400 6FFC"
+ $"6400 6200 6100 6080 6000 6000 0000 0000"
+ $"0000 0000 0000 0080 0100 0200 0400 0FFC"
+ $"0400 0200 0100 0080 0000 0000 0000 0000"
+ $"0007 0004"
+};
+
+data 'CURS' (3036, "left_tee") {
+ $"0000 0C00 0C00 0C00 0C00 0C00 0C00 0FF8"
+ $"0FF8 0C00 0C00 0C00 0C00 0C00 0C00 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0007 0004"
+};
+
+data 'CURS' (3037, "leftbutton") {
+ $"8002 7FFC 7FFC 4444 4554 4554 4554 4554"
+ $"4444 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 8002"
+ $"FFFE FFFE FFFE FFFE FFFE FFFE FFFE FFFE"
+ $"FFFE FFFE FFFE FFFE FFFE FFFE FFFE FFFE"
+ $"0004 0003"
+};
+
+data 'CURS' (3038, "ll_angle") {
+ $"0000 0000 0000 0C00 0C00 0C00 0C00 0C00"
+ $"0C00 0C00 0FF8 0FF8 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"000B 0004"
+};
+
+data 'CURS' (3039, "lr_angle") {
+ $"0000 0000 0000 0030 0030 0030 0030 0030"
+ $"0030 0030 1FF0 1FF0 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"000B 000B"
+};
+
+data 'CURS' (3040, "man") {
+ $"0380 1EF0 0280 8100 4387 244B 1D70 0540"
+ $"0440 0280 0440 0920 1290 1450 783C F83F"
+ $"0380 1FF0 0380 8100 4387 27CB 1FF0 07C0"
+ $"07C0 0380 07C0 0FE0 1EF0 1C70 783C F83F"
+ $"0001 0007"
+};
+
+data 'CURS' (3041, "middlebutton") {
+ $"8002 7FFC 7FFC 4444 5454 5454 5454 5454"
+ $"4444 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 8002"
+ $"FFFE FFFE FFFE FFFE FFFE FFFE FFFE FFFE"
+ $"FFFE FFFE FFFE FFFE FFFE FFFE FFFE FFFE"
+ $"0004 0007"
+};
+
+data 'CURS' (3042, "mouse") {
+ $"0600 0100 0180 0FF0 1008 17E8 1428 1428"
+ $"17E8 1008 1008 1008 1008 1008 1008 0FF0"
+ $"0600 0100 0180 0FF0 1FF8 1FF8 1FF8 1FF8"
+ $"1FF8 1FF8 1FF8 1FF8 1FF8 1FF8 1FF8 0FF0"
+ $"0000 0000"
+};
+
+data 'CURS' (3043, "pencil") {
+ $"0000 00F0 0088 0108 0190 0270 0220 0440"
+ $"0440 0880 0880 1100 1E00 1C00 1800 1000"
+ $"0000 00F0 00F8 01F8 01F0 03F0 03E0 07C0"
+ $"07C0 0F80 0F80 1F00 1E00 1C00 1800 1000"
+ $"000F 0003"
+};
+
+data 'CURS' (3044, "pirate") {
+ $"03C0 07E0 0FF0 1998 1998 0FF0 07E0 03C0"
+ $"43C2 43C3 2184 1C38 03C0 0FF1 781F 4002"
+ $"07E0 0FF0 1FF8 3FFC 3FFC 1FF8 0FF0 47E2"
+ $"E7E7 E7E7 7FFF 3FFC 1FF9 7FFF FFFF F81F"
+ $"000A 0007"
+};
+
+data 'CURS' (3045, "plus") {
+ $"0000 0000 0000 0180 0180 0180 0180 1FF8"
+ $"1FF8 0180 0180 0180 0180 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3046, "question_arrow") {
+ $"07C0 0FE0 1C70 1830 1C30 0C70 00E0 03C0"
+ $"0380 0280 0280 0EE0 06C0 0380 0100 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 3FF8 1FF0 0FE0 07C0 0380 0100"
+ $"000E 0007"
+};
+
+data 'CURS' (3047, "right_ptr") {
+ $"0000 0010 0030 0070 00F0 01F0 03F0 07F0"
+ $"0FF0 01F0 01B0 0310 0300 0600 0600 0000"
+ $"0018 0038 0078 00F8 01F8 03F8 07F8 0FF8"
+ $"1FF8 3FF8 03F8 07B8 0798 0F08 0F00 0E00"
+ $"0001 000B"
+};
+
+data 'CURS' (3048, "right_side") {
+ $"0000 0000 0006 0006 0106 0086 0046 0026"
+ $"3FF6 0026 0046 0086 0106 0006 0006 0000"
+ $"0000 0000 0000 0000 0100 0080 0040 0020"
+ $"3FF0 0020 0040 0080 0100 0000 0000 0000"
+ $"0008 000B"
+};
+
+data 'CURS' (3049, "right_tee") {
+ $"0000 0030 0030 0030 0030 0030 0030 1FF0"
+ $"1FF0 0030 0030 0030 0030 0030 0030 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0007 000A"
+};
+
+data 'CURS' (3050, "rightbutton") {
+ $"8002 7FFC 7FFC 4444 5544 5544 5544 5544"
+ $"4444 7FFC 7FFC 7FFC 7FFC 7FFC 7FFC 8002"
+ $"FFFE FFFE FFFE FFFE FFFE FFFE FFFE FFFE"
+ $"FFFE FFFE FFFE FFFE FFFE FFFE FFFE FFFE"
+ $"0004 0003"
+};
+
+data 'CURS' (3051, "rtl_logo") {
+ $"0000 7FFE 4022 4022 4022 7FE2 4422 4422"
+ $"4422 4422 47FE 4402 4402 4402 7FFE 0000"
+ $"0000 7FFE 7FFE 6076 7FF6 7FF6 7C36 6C36"
+ $"6C36 6C3E 6FFE 6FFE 6E06 7FFE 7FFE 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3052, "sailboat") {
+ $"0000 0040 0040 0160 0160 0360 0370 0770"
+ $"0770 0F78 0F78 1F78 1F7C 3E38 0000 0000"
+ $"0040 00E0 01E0 03F0 03F0 07F0 07F8 0FF8"
+ $"0FF8 1FFC 1FFC 3FFC 3FFE 7F7C 7E38 0000"
+ $"000C 0008"
+};
+
+data 'CURS' (3053, "sb_down_arrow") {
+ $"0280 0280 0280 0280 0280 0280 0280 0280"
+ $"0280 0280 0280 0FE0 07C0 0380 0100 0000"
+ $"0380 0380 0380 0380 0380 0380 0380 0380"
+ $"0380 0380 0380 1FF0 0FE0 07C0 0380 0100"
+ $"000E 0007"
+};
+
+data 'CURS' (3054, "sb_h_double_arrow") {
+ $"0000 0000 0000 0000 0810 1818 3FFC 781E"
+ $"3FFC 1818 0810 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0810 1818 381C 7FFE FFFF"
+ $"7FFE 381C 1818 0810 0000 0000 0000 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3055, "sb_left_arrow") {
+ $"0000 0000 0000 0000 0800 1800 3FFF 7800"
+ $"3FFF 1800 0800 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0800 1800 3800 7FFF FFFF"
+ $"7FFF 3800 1800 0800 0000 0000 0000 0000"
+ $"0007 0001"
+};
+
+data 'CURS' (3056, "sb_right_arrow") {
+ $"0000 0000 0000 0000 0000 0010 0018 FFFC"
+ $"001E FFFC 0018 0010 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0010 0018 001C FFFE"
+ $"FFFF FFFE 001C 0018 0010 0000 0000 0000"
+ $"0008 000E"
+};
+
+data 'CURS' (3057, "sb_up_arrow") {
+ $"0000 0080 01C0 03E0 07F0 0140 0140 0140"
+ $"0140 0140 0140 0140 0140 0140 0140 0140"
+ $"0080 01C0 03E0 07F0 0FF8 01C0 01C0 01C0"
+ $"01C0 01C0 01C0 01C0 01C0 01C0 01C0 01C0"
+ $"0001 0008"
+};
+
+data 'CURS' (3058, "sb_v_double_arrow") {
+ $"0000 0100 0380 07C0 0FE0 0280 0280 0280"
+ $"0280 0280 0280 0FE0 07C0 0380 0100 0000"
+ $"0100 0380 07C0 0FE0 1FF0 0380 0380 0380"
+ $"0380 0380 0380 1FF0 0FE0 07C0 0380 0100"
+ $"0007 0007"
+};
+
+data 'CURS' (3059, "shuttle") {
+ $"0020 0070 00F8 01DE 05DE 09DE 11DE 11DE"
+ $"11DE 11DE 31DE 71DE FDDE 1888 0078 0030"
+ $"0020 0070 00F8 01FE 07FE 0FFE 1FFE 1FFE"
+ $"1FFE 1FFE 3FFE 7FFE FFFE 18F8 0078 0030"
+ $"0000 000A"
+};
+
+data 'CURS' (3060, "sizing") {
+ $"0000 7F80 4000 4000 4000 47E0 4420 4422"
+ $"4422 0422 07E2 0012 000A 0006 01FE 0000"
+ $"FFC0 FFC0 FFC0 E000 EFF0 EFF0 EC37 EC37"
+ $"EC37 EC37 0FF7 0FFF 001F 03FF 03FF 03FF"
+ $"000E 000E"
+};
+
+data 'CURS' (3061, "spider") {
+ $"2010 1020 1020 0840 0840 8787 6798 1FE0"
+ $"1FE0 6798 8787 0840 0840 1020 1020 2010"
+ $"7038 3870 3870 1CE0 9FE7 EFDF FFFF 7FF8"
+ $"7FF8 FFFF EFDF 9FE7 1CE0 3870 3870 7038"
+ $"0007 0007"
+};
+
+data 'CURS' (3062, "spraycan") {
+ $"0018 0040 0D18 1E40 1A18 3F00 2100 3900"
+ $"2900 3900 2900 3900 3900 2100 2100 3F00"
+ $"0000 0000 0C00 1E00 1E00 3F00 3F00 3F00"
+ $"3F00 3F00 3F00 3F00 3F00 3F00 3F00 3F00"
+ $"0002 0007"
+};
+
+data 'CURS' (3063, "star") {
+ $"0100 0280 0280 0280 0440 0440 0440 3938"
+ $"C006 3838 0920 1290 2448 2828 3018 2008"
+ $"0100 0380 0380 0380 07C0 07C0 07C0 3FF8"
+ $"FFFE 3FF8 0FE0 1EF0 3C78 3838 3018 2008"
+ $"0007 0007"
+};
+
+data 'CURS' (3064, "target") {
+ $"0000 0380 0FE0 1C70 3018 600C C106 C286"
+ $"C106 600C 3018 1C70 0FE0 0380 0000 0000"
+ $"0000 0380 0FE0 1FF0 3C78 701C E38E E38E"
+ $"E38E 701C 3C78 1FF0 0FE0 0380 0000 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3065, "tcross") {
+ $"0100 0100 0100 0100 0100 0100 0100 FFFE"
+ $"0100 0100 0100 0100 0100 0100 0100 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0007 0007"
+};
+
+data 'CURS' (3066, "top_left_arrow") {
+ $"0000 6000 7800 3E00 3F80 1FE0 1E00 0D00"
+ $"0C80 0440 0420 0010 0008 0004 0000 0000"
+ $"E000 F800 FE00 7F80 7FE0 3FF8 3FFE 1F80"
+ $"1FC0 0EE0 0E70 0638 061C 020E 0204 0000"
+ $"0001 0001"
+};
+
+data 'CURS' (3067, "top_left_corner") {
+ $"FFF0 FFF0 C000 C000 CFC0 CC00 CA00 C900"
+ $"C880 C840 C020 C000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0FC0 0C00 0A00 0900"
+ $"0880 0840 0020 0000 0000 0000 0000 0000"
+ $"0000 0000"
+};
+
+data 'CURS' (3068, "top_right_corner") {
+ $"0FFF 0FFF 0003 0003 03F3 0033 0053 0093"
+ $"0113 0213 0403 0003 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 03F0 0030 0050 0090"
+ $"0110 0210 0400 0000 0000 0000 0000 0000"
+ $"0000 000F"
+};
+
+data 'CURS' (3069, "top_side") {
+ $"0000 7FFC 7FFC 0000 0100 0380 0540 0920"
+ $"1110 0100 0100 0100 0100 0100 0000 0000"
+ $"0000 0000 0000 0000 0100 0380 0540 0920"
+ $"1110 0100 0100 0100 0100 0100 0000 0000"
+ $"0004 0007"
+};
+
+data 'CURS' (3070, "top_tee") {
+ $"0000 0000 0000 0000 7FFE 7FFE 0180 0180"
+ $"0180 0180 0180 0180 0180 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0004 0007"
+};
+
+data 'CURS' (3071, "trek") {
+ $"0100 0000 0380 07C0 0FE0 0EE0 0FE0 07C0"
+ $"0380 0100 0BA0 0D60 0920 0820 0820 0000"
+ $"0000 0380 07C0 0FE0 1FF0 1FF0 1FF0 0FE0"
+ $"07C0 0BA0 1FF0 1FF0 1FF0 1D70 1C70 0820"
+ $"0000 0007"
+};
+
+data 'CURS' (3072, "ul_angle") {
+ $"0000 0000 0000 0FF8 0FF8 0C00 0C00 0C00"
+ $"0C00 0C00 0C00 0C00 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0003 0004"
+};
+
+data 'CURS' (3073, "umbrella") {
+ $"0000 0890 0228 49A6 27C8 1930 610C 0100"
+ $"0100 0100 0100 0100 0140 0140 0080 0000"
+ $"0000 0FF0 1FF8 7FFE 7FFC FFFE FBBE E38E"
+ $"0380 0380 0380 03C0 03E0 03E0 01C0 0080"
+ $"0004 0007"
+};
+
+data 'CURS' (3074, "ur_angle") {
+ $"0000 0000 0000 0000 1FF0 1FF0 0030 0030"
+ $"0030 0030 0030 0030 0030 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0004 000B"
+};
+
+data 'CURS' (3075, "watch") {
+ $"07E0 07E0 07E0 07E0 0810 1088 1088 108C"
+ $"138C 1008 1008 0810 07E0 07E0 07E0 07E0"
+ $"07E0 07E0 07E0 07E0 0FF0 1FF8 1FF8 1FFC"
+ $"1FFC 1FF8 1FF8 0FF0 07E0 07E0 07E0 07E0"
+ $"0008 000D"
+};
+
+data 'CURS' (3076, "xterm") {
+ $"0C60 0280 0100 0100 0100 0100 0100 0100"
+ $"0100 0100 0100 0100 0100 0100 0280 0C60"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"000B 0007"
+};
+
+/*
+ * The following are color versions of some of the
+ * cursors defined above. The color cursors will be
+ * used if the exist in preference to the black & white
+ * cursors.
+ */
+
+data 'crsr' (3004, "boat", purgeable) {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0100 03C0"
+ $"8460 FFFF 0018 0020 0040 FFC0 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0100 03C0"
+ $"87E0 FFFF FFF8 FFE0 FFC0 FFC0 0000 0000"
+ $"0000 0000 0007 000F 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 000F 0000 0000 0000 00FF FF00"
+ $"0000 F000 0F32 25F0 0000 6FFF FFFF FFFF"
+ $"FFFF 2222 2222 221F F000 2222 2222 21F0"
+ $"0000 3333 3333 4F00 0000 FFFF FFFF FF00"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0007 0000 FFFF FFFF"
+ $"FFFF 0001 BBBB BBBB BBBB 0002 EEEE EEEE"
+ $"EEEE 0003 DDDD DDDD DDDD 0004 CCCC CCCC"
+ $"CCCC 0005 4444 4444 4444 0006 1111 1111"
+ $"1111 000F 0000 0000 0000"
+};
+
+data 'crsr' (3013, "clock") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 1FF8 33CC 6466 4992 4F12 4422"
+ $"63C6 3FFC 2994 2994 2994 2BD4 6996 781E"
+ $"7FFE 7FFE 1FF8 3FFC 7FFE 7FFE 7FFE 7FFE"
+ $"7FFE 3FFC 3FFC 3FFC 3FFC 3FFC 7FFE 7FFE"
+ $"7FFE 7FFE 0004 0008 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 000F FFFF FFFF F000 00F6 05FF FF50"
+ $"6F00 0F60 5F00 56F5 06F0 0F00 F021 F30F"
+ $"00F0 0F00 F6F1 000F 00F0 0F00 5F00 00F5"
+ $"00F0 0F60 05FF FF50 06F0 00FF FFFF FFFF"
+ $"FF00 00F0 F001 100F 0F00 00F0 F001 100F"
+ $"0F00 00F0 F021 120F 0F00 00F0 F01F F10F"
+ $"0F00 0FF0 F021 120F 0FF0 0FF4 F500 005F"
+ $"4FF0 0FFF FFFF FFFF FFF0 0FFF FFFF FFFF"
+ $"FFF0 0000 0000 0000 0007 0000 FFFF FFFF"
+ $"FFFF 0001 4444 4444 4444 0002 AAAA AAAA"
+ $"AAAA 0003 EEEE EEEE EEEE 0004 5555 5555"
+ $"5555 0005 DDDD DDDD DDDD 0006 7777 7777"
+ $"7777 000F 0000 0000 0000"
+};
+
+data 'crsr' (3014, "coffee_mug") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 03F8 0C06 1001 1C07 33F9 7001"
+ $"D001 9001 960D DA55 7A55 36ED 10A1 1001"
+ $"0802 07FC 03F8 0FFE 1FFF 1FFF 3FFF 7FFF"
+ $"FFFF FFFF FFFF FFFF 7FFF 3FFF 1FFF 1FFF"
+ $"0FFE 07FC 0004 0003 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 00FF FFFF F000 0000 FF42 2222"
+ $"4FF0 000F 4221 1111 224F 000F FF11 1111"
+ $"1FFF 00FF 24FF FFFF F42F 0F5F 2222 2222"
+ $"222F F52F 2222 2222 222F F40F 2222 2222"
+ $"222F F40F 4FF2 2224 FF2F F52F F2F2 2F2F"
+ $"2F2F 0F5F F2F2 535F 2F2F 00FF 4FF2 F3F4"
+ $"FF2F 000F 2222 F2F2 222F 000F 4222 2222"
+ $"224F 0000 F422 2222 24F0 0000 0FFF FFFF"
+ $"FF00 0000 0000 0000 0006 0000 FFFF FFFF"
+ $"FFFF 0001 CCCC 9999 6666 0002 CCCC CCCC"
+ $"FFFF 0003 3333 3333 6666 0004 9999 9999"
+ $"FFFF 0005 6666 6666 CCCC 000F 0000 0000"
+ $"0000"
+};
+
+data 'crsr' (3027, "gobbler") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0000 0078 0070 4036 4FB0 7FF0"
+ $"7E30 7C30 3038 00F0 0FE0 0400 0400 0400"
+ $"0F00 0000 00FC 00FC E0FF FFFF FFFF FFF8"
+ $"FFF8 FFF8 FFFC 7FFC 3FF8 1FF0 0E00 1F80"
+ $"1F80 1F80 0003 000E 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 0222"
+ $"2000 0000 0000 0111 0000 0300 0000 0011"
+ $"0220 0100 1616 1011 0000 0361 6111 1111"
+ $"0000 0111 1114 4415 0000 0311 1144 4451"
+ $"0000 0011 4444 4415 1000 0004 4444 5151"
+ $"0000 0000 1515 1510 0000 0000 0200 0000"
+ $"0000 0000 0300 0000 0000 0000 0200 0000"
+ $"0000 0000 2323 0000 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0006 0000 FFFF FFFF"
+ $"FFFF 0001 CCCC 9999 6666 0002 DDDD 0000"
+ $"0000 0003 FFFF 6666 3333 0004 CCCC CCCC"
+ $"CCCC 0005 8888 8888 8888 0006 FFFF CCCC"
+ $"9999"
+};
+
+data 'crsr' (3028, "gumby") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 3F00 10C0 C820 EAA0 C820 CBA0"
+ $"F838 383E 0826 0826 092E 0926 0920 1110"
+ $"2108 3EF8 3F00 1FC0 CFE0 EFE0 CFE0 CFE0"
+ $"FFF8 3FFE 0FE6 0FE6 0FEE 0FE6 0FE0 1FF0"
+ $"3FF8 3EF8 0000 0002 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 00FF FFFF 0000 0000 000F 1212 FF00"
+ $"0000 FF00 F131 31F0 0000 FFF0 F3F3 F3F0"
+ $"0000 FF00 F131 31F0 0000 FF00 F2FF F2F0"
+ $"0000 4FFF F121 21FF F000 00FF F212 12FF"
+ $"FF40 0000 F121 21F0 0FF0 0000 F212 12F0"
+ $"0FF0 0000 F12F 21F0 FFF0 0000 F21F 12F0"
+ $"0FF0 0000 F12F 21F0 0000 000F 121F 121F"
+ $"0000 00F1 212F 2121 F000 00FF FFF0 FFFF"
+ $"F000 0000 0000 0000 0005 0000 FFFF FFFF"
+ $"FFFF 0001 0000 BBBB 0000 0002 CCCC CCCC"
+ $"CCCC 0003 AAAA AAAA AAAA 0004 4444 4444"
+ $"4444 000F 0000 0000 0000"
+};
+
+data 'crsr' (3031, "heart") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0000 3EF8 638C C106 8002 8002"
+ $"8002 8002 C006 600C 3018 1830 0C60 06C0"
+ $"0380 0000 0000 3EF8 7FFC FFFE FFFE FFFE"
+ $"FFFE FFFE FFFE 7FFC 3FF8 1FF0 0FE0 07C0"
+ $"0380 0000 0003 0007 0000 0000 0000 0000"
+ $"0000 0000 8004 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0002 0001 0002 0000 0000 0000 00D2 0000"
+ $"0000 0000 0000 0FFC FFC0 3AAB AA70 E99B"
+ $"999C E665 A65C E999 999C E666 665C E999"
+ $"999C D666 665C 3599 9970 0D66 65C0 0359"
+ $"9700 00D6 5C00 0035 7000 000F C000 0000"
+ $"0000 0000 0000 0000 0003 0000 FFFF FFFF"
+ $"FFFF 0001 DDDD 0000 0000 0002 FFFF 6666"
+ $"CCCC 0003 0000 0000 0000"
+};
+
+data 'crsr' (3042, "mouse", purgeable) {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 BE00 0100 0180 0FF0 1008 17E8"
+ $"1428 1428 17E8 1008 1008 1008 1008 1008"
+ $"1008 0FF0 FE00 0100 0180 0FF0 1FF8 1FF8"
+ $"1FF8 1FF8 1FF8 1FF8 1FF8 1FF8 1FF8 1FF8"
+ $"1FF8 0FF0 0001 0007 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 1379 4AF0 0000 0000 0000 000F 0000"
+ $"0000 0000 000F F000 0000 0000 FFFF FFFF"
+ $"0000 000F 2111 1112 F000 000F 3655 5563"
+ $"F000 000F 3513 1351 F000 000F 3533 3351"
+ $"F000 000F 3655 5561 F000 000F 3311 1111"
+ $"F000 000F 3333 3333 F000 000F 3333 3333"
+ $"F000 000F 2222 2222 F000 000F 8888 8888"
+ $"F000 000F 7888 8887 F000 0000 FFFF FFFF"
+ $"0000 0000 0000 0000 000B 0000 FFFF FFFF"
+ $"FFFF 0001 EEEE EEEE EEEE 0002 CCCC CCCC"
+ $"CCCC 0003 DDDD DDDD DDDD 0004 4444 4444"
+ $"4444 0005 2222 2222 2222 0006 5555 5555"
+ $"5555 0007 AAAA AAAA AAAA 0008 BBBB BBBB"
+ $"BBBB 0009 7777 7777 7777 000A 1111 1111"
+ $"1111 000F 0000 0000 0000"
+};
+
+data 'crsr' (3043, "pencil", purgeable) {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0000 00F0 0088 0108 0190 0270"
+ $"0220 0440 0440 0880 0880 1100 1E00 1C00"
+ $"1800 1000 0000 00F0 00F8 01F8 01F0 03F0"
+ $"03E0 07C0 07C0 0F80 0F80 1F00 1E00 1C00"
+ $"1800 1000 000F 0003 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 0000 0000 0000 0000 0000 FFFF"
+ $"0000 0000 0000 F404 F000 0000 000F 4042"
+ $"F000 0000 000F F42F 0000 0000 00F5 3FFF"
+ $"0000 0000 00F3 52F0 0000 0000 0F35 1F00"
+ $"0000 0000 0F53 2F00 0000 0000 F532 F000"
+ $"0000 0000 F312 F000 0000 000F 352F 0000"
+ $"0000 000F FFF0 0000 0000 000F FF00 0000"
+ $"0000 000F F000 0000 0000 000F 0000 0000"
+ $"0000 0000 0000 0000 0006 0000 FFFF FFFF"
+ $"FFFF 0001 CCCC CCCC CCCC 0002 8888 8888"
+ $"8888 0003 FFFF FFFF 0000 0004 DDDD 0000"
+ $"0000 0005 FFFF 6666 3333 000F 0000 0000"
+ $"0000"
+};
+
+data 'crsr' (3059, "shuttle") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0020 0070 00F8 01DE 05DE 09DE"
+ $"11DE 11DE 11DE 11DE 31DE 71DE FDDE 1888"
+ $"0078 0030 0020 0070 00F8 01FE 07FE 0FFE"
+ $"1FFE 1FFE 1FFE 1FFE 3FFE 7FFE FFFE 18F8"
+ $"0078 0030 0000 000A 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 0000 00F0 0000 0000 0000 0F3F"
+ $"0000 0000 0000 F343 F000 0000 000F 3404"
+ $"3FF0 0000 0F4F 3404 3FF0 0000 F55F 3404"
+ $"3FF0 000F 505F 3404 3FF0 000F 005F 3404"
+ $"3FF0 000F 005F 3404 3FF0 000F 005F 3404"
+ $"3FF0 00F3 005F 3404 3FF0 0F33 505F 3404"
+ $"3FF0 FFF3 3F4F 3404 3FF0 000F F000 1222"
+ $"1000 0000 0000 0111 1000 0000 0000 0011"
+ $"0000 0000 0000 0000 0006 0000 FFFF FFFF"
+ $"FFFF 0001 FFFF 6666 3333 0002 DDDD 0000"
+ $"0000 0003 4444 4444 4444 0004 8888 8888"
+ $"8888 0005 DDDD DDDD DDDD 000F 0000 0000"
+ $"0000"
+};
+
+data 'crsr' (3062, "spraycan") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0018 0040 0D18 1E40 1A18 3F00"
+ $"2100 3900 2900 3900 2900 3900 3900 2100"
+ $"2100 3F00 0000 0000 0C00 1E00 1E00 3F00"
+ $"3F00 3F00 3F00 3F00 3F00 3F00 3F00 3F00"
+ $"3F00 3F00 0002 0007 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 0000 0005 2000 0000 0000 0460"
+ $"0000 0000 FF1F 6005 2000 000F 33F0 0460"
+ $"0000 000F 10F0 0005 2000 00FF FFFF 0000"
+ $"0000 00F8 170F 0000 0000 00F5 F70F 0000"
+ $"0000 00FA F70F 0000 0000 00F9 F70F 0000"
+ $"0000 00FA F70F 0000 0000 00F9 F70F 0000"
+ $"0000 00F5 F70F 0000 0000 00F8 170F 0000"
+ $"0000 00F8 170F 0000 0000 00FF FFFF 0000"
+ $"0000 0000 0000 0000 000B 0000 FFFF FFFF"
+ $"FFFF 0001 AAAA AAAA AAAA 0002 7777 7777"
+ $"7777 0003 5555 5555 5555 0004 2222 2222"
+ $"2222 0005 4444 4444 4444 0006 BBBB BBBB"
+ $"BBBB 0007 DDDD DDDD DDDD 0008 EEEE EEEE"
+ $"EEEE 0009 6666 6666 CCCC 000A CCCC CCCC"
+ $"FFFF 000F 0000 0000 0000"
+};
+
+data 'crsr' (3063, "star") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0100 0280 0280 0280 0440 0440"
+ $"0440 3938 C006 3838 0920 1290 2448 2828"
+ $"3018 2008 0100 0380 0380 0380 07C0 07C0"
+ $"07C0 3FF8 FFFE 3FF8 0FE0 1EF0 3C78 3838"
+ $"3018 2008 0007 0007 0000 0000 0000 0000"
+ $"0000 0000 8004 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0002 0001 0002 0000 0000 0000 00D2 0000"
+ $"0000 0003 0000 000D C000 000D C000 000D"
+ $"C000 0035 7000 0035 7000 0035 7000 0FD7"
+ $"5FC0 F555 557C 0FD5 5FC0 00D7 5C00 035C"
+ $"D700 0D70 35C0 0DC0 0DC0 0F00 03C0 0C00"
+ $"00C0 0000 0000 0000 0002 0000 FFFF FFFF"
+ $"FFFF 0001 FFFF FFFF 0000 0003 0000 0000"
+ $"0000"
+};
+
+data 'crsr' (3071, "trek") {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 0100 0000 0380 07C0 0FE0 0EE0"
+ $"0FE0 07C0 0380 0100 0BA0 0D60 0920 0820"
+ $"0820 0000 0000 0380 07C0 0FE0 1FF0 1FF0"
+ $"1FF0 0FE0 07C0 0BA0 1FF0 1FF0 1FF0 1D70"
+ $"1C70 0820 0000 0007 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 0005 0000 0000 0000 0005 0000"
+ $"0000 0000 00FF F000 0000 0000 0F31 3F00"
+ $"0000 0000 F322 23F0 0000 0000 F110 11F0"
+ $"0000 0000 F311 13F0 0000 0000 0F31 3F00"
+ $"0000 0000 00FF F000 0000 0000 000F 0000"
+ $"0000 0000 F0FF F0F0 0000 0000 FF0F 0FF0"
+ $"0000 0000 400F 0040 0000 0000 4000 0040"
+ $"0000 0000 4000 0040 0000 0000 0000 0000"
+ $"0000 0000 0000 0000 0006 0000 FFFF FFFF"
+ $"FFFF 0001 EEEE EEEE EEEE 0002 9999 9999"
+ $"FFFF 0003 DDDD DDDD DDDD 0004 3333 3333"
+ $"6666 0005 DDDD 0000 0000 000F 0000 0000"
+ $"0000"
+};
+
+data 'crsr' (3075, "watch", purgeable) {
+ $"8001 0000 0060 0000 0092 0000 0000 0000"
+ $"0000 0000 07E0 07E0 07E0 07E0 0810 1088"
+ $"1088 108C 138C 1008 1008 0810 07E0 07E0"
+ $"07E0 07E0 07E0 07E0 07E0 07E0 0FF0 1FF8"
+ $"1FF8 1FF8 1FF8 1FF8 1FF8 0FF0 07E0 07E0"
+ $"07E0 07E0 0008 000D 0000 0000 0000 0000"
+ $"0000 0000 8008 0000 0000 0010 0010 0000"
+ $"0000 0000 0000 0048 0000 0048 0000 0000"
+ $"0004 0001 0004 0000 0000 0000 0112 0000"
+ $"0000 0000 0FFF FFF0 0000 0000 0FFF FFF0"
+ $"0000 0000 0FFF FFF0 0000 0000 0FFF FFF0"
+ $"0000 0000 F020 202F 0000 000F 0222 F221"
+ $"F000 000F 2222 F123 F000 000F 0222 F121"
+ $"FF00 000F 22FF F123 FF00 000F 0222 2221"
+ $"F000 000F 2222 2213 F000 0000 F131 313F"
+ $"0000 0000 0FFF FFF0 0000 0000 0FFF FFF0"
+ $"0000 0000 0FFF FFF0 0000 0000 0FFF FFF0"
+ $"0000 0000 0000 0000 0004 0000 FFFF FFFF"
+ $"FFFF 0001 CCCC CCCC CCCC 0002 EEEE EEEE"
+ $"EEEE 0003 BBBB BBBB BBBB 000F 0000 0000"
+ $"0000"
+};
+
diff --git a/tk/macosx/tkMacOSXXStubs.c b/tk/macosx/tkMacOSXXStubs.c
new file mode 100644
index 00000000000..397929bc498
--- /dev/null
+++ b/tk/macosx/tkMacOSXXStubs.c
@@ -0,0 +1,862 @@
+/*
+ * tkMacOSXXStubs.c --
+ *
+ * This file contains most of the X calls called by Tk. Many of
+ * these calls are just stubs and either don't make sense on the
+ * Macintosh or thier implamentation just doesn't do anything. Other
+ * calls will eventually be moved into other files.
+ *
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ * Copyright 2001, Apple Computer, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id$
+ */
+
+#include "tkInt.h"
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <sys/types.h>
+
+#include <X11/Xatom.h>
+
+#include <Carbon/Carbon.h>
+#include "tkMacOSXInt.h"
+#include "tkPort.h"
+#include "tkMacOSXEvent.h"
+
+/*
+ * Because this file is still under major development Debugger statements are
+ * used through out this file. The define TCL_DEBUG will decide whether
+ * the debugger statements actually call the debugger or not.
+ */
+
+#ifndef TCL_DEBUG
+# define Debugger()
+#endif
+
+#define ROOT_ID 10
+
+/*
+ * Declarations of static variables used in this file.
+ */
+
+static TkDisplay *gMacDisplay = NULL; /* Macintosh display. */
+static char *macScreenName = ":0"; /* Default name of macintosh display. */
+
+/*
+ * Forward declarations of procedures used in this file.
+ */
+
+static XID MacXIdAlloc _ANSI_ARGS_((Display *display));
+static int DefaultErrorHandler _ANSI_ARGS_((Display* display,
+ XErrorEvent* err_evt));
+
+/*
+ * Other declarations
+ */
+
+int TkMacOSXXDestroyImage _ANSI_ARGS_((XImage *image));
+unsigned long TkMacOSXXGetPixel _ANSI_ARGS_((XImage *image, int x, int y));
+int TkMacOSXXPutPixel _ANSI_ARGS_((XImage *image, int x, int y,
+ unsigned long pixel));
+XImage *TkMacOSXXSubImage _ANSI_ARGS_((XImage *image, int x, int y,
+ unsigned int width, unsigned int height));
+int TkMacOSXXAddPixel _ANSI_ARGS_((XImage *image, long value));
+int _XInitImageFuncPtrs _ANSI_ARGS_((XImage *image));
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpOpenDisplay --
+ *
+ * Create the Display structure and fill it with device
+ * specific information.
+ *
+ * Results:
+ * Returns a Display structure on success or NULL on failure.
+ *
+ * Side effects:
+ * Allocates a new Display structure.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkDisplay *
+TkpOpenDisplay(
+ CONST char *display_name)
+{
+ Display *display;
+ Screen *screen;
+ GDHandle graphicsDevice;
+ int fd = 0;
+ if (gMacDisplay != NULL) {
+ if (strcmp(gMacDisplay->display->display_name, display_name) == 0) {
+ return gMacDisplay;
+ } else {
+ return NULL;
+ }
+ }
+ InitCursor();
+
+ graphicsDevice = GetMainDevice();
+ display = (Display *) ckalloc(sizeof(Display));
+ display->resource_alloc = MacXIdAlloc;
+ screen = (Screen *) ckalloc(sizeof(Screen) * 2);
+ display->default_screen = 0;
+ display->request = 0;
+ display->nscreens = 1;
+ display->screens = screen;
+ display->display_name = macScreenName;
+ display->qlen = 0;
+ display->fd = fd;
+
+ screen->root = ROOT_ID;
+ screen->display = display;
+ screen->root_depth = (*(*graphicsDevice)->gdPMap)->cmpSize *
+ (*(*graphicsDevice)->gdPMap)->cmpCount;
+ screen->height = (*graphicsDevice)->gdRect.bottom -
+ (*graphicsDevice)->gdRect.top;
+ screen->width = (*graphicsDevice)->gdRect.right -
+ (*graphicsDevice)->gdRect.left;
+
+ screen->mwidth = (screen->width * 254 + 360) / 720;
+ screen->mheight = (screen->height * 254 + 360) / 720;
+ screen->black_pixel = 0x00000000;
+ screen->white_pixel = 0x00FFFFFF;
+ screen->root_visual = (Visual *) ckalloc(sizeof(Visual));
+ screen->root_visual->visualid = 0;
+ screen->root_visual->class = TrueColor;
+ screen->root_visual->red_mask = 0x00FF0000;
+ screen->root_visual->green_mask = 0x0000FF00;
+ screen->root_visual->blue_mask = 0x000000FF;
+ screen->root_visual->bits_per_rgb = 24;
+ screen->root_visual->map_entries = 2 ^ 8;
+
+ gMacDisplay = (TkDisplay *) ckalloc(sizeof(TkDisplay));
+
+ /*
+ * This is the quickest way to make sure that all the *Init
+ * flags get properly initialized
+ */
+
+ bzero (gMacDisplay, sizeof (TkDisplay));
+ gMacDisplay->display = display;
+ return gMacDisplay;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpCloseDisplay --
+ *
+ * Deallocates a display structure created by TkpOpenDisplay.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Frees memory.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkpCloseDisplay(
+ TkDisplay *displayPtr)
+{
+ Display *display = displayPtr->display;
+ if (gMacDisplay != displayPtr) {
+ panic("TkpCloseDisplay: tried to call TkpCloseDisplay on bad display");
+ }
+
+ /*
+ * Make sure that the local scrap is transfered to the global
+ * scrap if needed.
+ */
+
+ TkSuspendClipboard();
+
+ gMacDisplay = NULL;
+ if (display->screens != (Screen *) NULL) {
+ if (display->screens->root_visual != (Visual *) NULL) {
+ ckfree((char *) display->screens->root_visual);
+ }
+ ckfree((char *) display->screens);
+ }
+ ckfree((char *) display);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MacXIdAlloc --
+ *
+ * This procedure is invoked by Xlib as the resource allocator
+ * for a display.
+ *
+ * Results:
+ * The return value is an X resource identifier that isn't currently
+ * in use.
+ *
+ * Side effects:
+ * The identifier is removed from the stack of free identifiers,
+ * if it was previously on the stack.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static XID
+MacXIdAlloc(
+ Display *display) /* Display for which to allocate. */
+{
+ static long int cur_id = 100;
+ /*
+ * Some special XIds are reserved
+ * - this is why we start at 100
+ */
+
+ return ++cur_id;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpWindowWasRecentlyDeleted --
+ *
+ * Tries to determine whether the given window was recently deleted.
+ * Called from the generic code error handler to attempt to deal with
+ * async BadWindow errors under some circumstances.
+ *
+ * Results:
+ * Always 0, we do not keep this information on the Mac, so we do not
+ * know whether the window was destroyed.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpWindowWasRecentlyDeleted(
+ Window win,
+ TkDisplay *dispPtr)
+{
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DefaultErrorHandler --
+ *
+ * This procedure is the default X error handler. Tk uses it's
+ * own error handler so this call should never be called.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * This function will call panic and exit.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+DefaultErrorHandler(
+ Display* display,
+ XErrorEvent* err_evt)
+{
+ /*
+ * This call should never be called. Tk replaces
+ * it with its own error handler.
+ */
+ panic("Warning hit bogus error handler!");
+ return 0;
+}
+
+
+char *
+XGetAtomName(
+ Display * display,
+ Atom atom)
+{
+ display->request++;
+ return NULL;
+}
+
+int
+_XInitImageFuncPtrs(XImage *image)
+{
+ return 0;
+}
+
+XErrorHandler
+XSetErrorHandler(
+ XErrorHandler handler)
+{
+ return DefaultErrorHandler;
+}
+
+Window
+XRootWindow(Display *display, int screen_number)
+{
+ display->request++;
+ return ROOT_ID;
+}
+
+XImage *
+XGetImage(display, d, x, y, width, height, plane_mask, format)
+ Display *display;
+ Drawable d;
+ int x;
+ int y;
+ unsigned int width;
+ unsigned int height;
+ unsigned long plane_mask;
+ int format;
+{
+ XImage * imagePtr;
+ Visual * visual = NULL;
+ int depth = 0;
+ int offset = 0;
+ char * data = NULL;
+ int bitmap_pad = 0;
+ int bytes_per_line = 0;
+ CGrafPtr grafPtr;
+
+ imagePtr = XCreateImage(display,visual,depth,format, offset, data,
+ width, height, bitmap_pad, bytes_per_line );
+ grafPtr = TkMacOSXGetDrawablePort(d);
+ imagePtr->data = (char *) grafPtr;
+ return imagePtr;
+}
+
+int
+XGetGeometry(display, d, root_return, x_return, y_return, width_return,
+ height_return, border_width_return, depth_return)
+ Display* display;
+ Drawable d;
+ Window* root_return;
+ int* x_return;
+ int* y_return;
+ unsigned int* width_return;
+ unsigned int* height_return;
+ unsigned int* border_width_return;
+ unsigned int* depth_return;
+{
+ /* Used in tkCanvPs.c & wm code */
+ Debugger();
+ return 0;
+}
+
+void
+XChangeProperty(
+ Display* display,
+ Window w,
+ Atom property,
+ Atom type,
+ int format,
+ int mode,
+ _Xconst unsigned char* data,
+ int nelements)
+{
+ Debugger();
+}
+
+void
+XSelectInput(
+ Display* display,
+ Window w,
+ long event_mask)
+{
+ Debugger();
+}
+
+void
+XBell(
+ Display* display,
+ int percent)
+{
+ SysBeep(percent);
+}
+
+void
+XSetWMNormalHints(
+ Display* display,
+ Window w,
+ XSizeHints* hints)
+{
+ /*
+ * Do nothing. Shouldn't even be called.
+ */
+}
+
+XSizeHints *
+XAllocSizeHints()
+{
+ /*
+ * Always return NULL. Tk code checks to see if NULL
+ * is returned & does nothing if it is.
+ */
+
+ return NULL;
+}
+
+XImage *
+XCreateImage(
+ Display* display,
+ Visual* visual,
+ unsigned int depth,
+ int format,
+ int offset,
+ char* data,
+ unsigned int width,
+ unsigned int height,
+ int bitmap_pad,
+ int bytes_per_line)
+{
+ XImage *ximage;
+
+ display->request++;
+ ximage = (XImage *) ckalloc(sizeof(XImage));
+
+ ximage->height = height;
+ ximage->width = width;
+ ximage->depth = depth;
+ ximage->xoffset = offset;
+ ximage->format = format;
+ ximage->data = data;
+ ximage->bitmap_pad = bitmap_pad;
+ if (bytes_per_line == 0) {
+ ximage->bytes_per_line = width * 4; /* assuming 32 bits per pixel */
+ } else {
+ ximage->bytes_per_line = bytes_per_line;
+ }
+
+ if (format == ZPixmap) {
+ ximage->bits_per_pixel = 32;
+ ximage->bitmap_unit = 32;
+ } else {
+ ximage->bits_per_pixel = 1;
+ ximage->bitmap_unit = 8;
+ }
+ ximage->byte_order = LSBFirst;
+ ximage->bitmap_bit_order = LSBFirst;
+ ximage->red_mask = 0x00FF0000;
+ ximage->green_mask = 0x0000FF00;
+ ximage->blue_mask = 0x000000FF;
+
+ ximage->f.destroy_image = TkMacOSXXDestroyImage;
+ ximage->f.get_pixel = TkMacOSXXGetPixel;
+ ximage->f.put_pixel = TkMacOSXXPutPixel;
+ ximage->f.sub_image = TkMacOSXXSubImage;
+ ximage->f.add_pixel = TkMacOSXXAddPixel;
+
+ return ximage;
+}
+
+GContext
+XGContextFromGC(
+ GC gc)
+{
+ /* TODO - currently a no-op */
+ return 0;
+}
+
+Status
+XSendEvent(
+ Display* display,
+ Window w,
+ Bool propagate,
+ long event_mask,
+ XEvent* event_send)
+{
+ Debugger();
+ return 0;
+}
+
+void
+XClearWindow(
+ Display* display,
+ Window w)
+{
+}
+
+/*
+void
+XDrawPoint(
+ Display* display,
+ Drawable d,
+ GC gc,
+ int x,
+ int y)
+{
+}
+
+void
+XDrawPoints(
+ Display* display,
+ Drawable d,
+ GC gc,
+ XPoint* points,
+ int npoints,
+ int mode)
+{
+}
+*/
+
+void
+XWarpPointer(
+ Display* display,
+ Window src_w,
+ Window dest_w,
+ int src_x,
+ int src_y,
+ unsigned int src_width,
+ unsigned int src_height,
+ int dest_x,
+ int dest_y)
+{
+}
+
+void
+XQueryColor(
+ Display* display,
+ Colormap colormap,
+ XColor* def_in_out)
+{
+}
+
+void
+XQueryColors(
+ Display* display,
+ Colormap colormap,
+ XColor* defs_in_out,
+ int ncolors)
+{
+}
+
+int
+XQueryTree(display, w, root_return, parent_return, children_return,
+ nchildren_return)
+ Display* display;
+ Window w;
+ Window* root_return;
+ Window* parent_return;
+ Window** children_return;
+ unsigned int* nchildren_return;
+{
+ return 0;
+}
+
+
+int
+XGetWindowProperty(
+ Display *display,
+ Window w,
+ Atom property,
+ long long_offset,
+ long long_length,
+ Bool delete,
+ Atom req_type,
+ Atom *actual_type_return,
+ int *actual_format_return,
+ unsigned long *nitems_return,
+ unsigned long *bytes_after_return,
+ unsigned char ** prop_return)
+{
+ display->request++;
+ *actual_type_return = None;
+ *actual_format_return = *bytes_after_return = 0;
+ *nitems_return = 0;
+ return 0;
+}
+
+void
+XRefreshKeyboardMapping( XMappingEvent* x)
+{
+ /* used by tkXEvent.c */
+ Debugger();
+}
+
+void
+XSetIconName(
+ Display* display,
+ Window w,
+ const char *icon_name)
+{
+ /*
+ * This is a no-op, no icon name for Macs.
+ */
+ display->request++;
+}
+
+void
+XForceScreenSaver(
+ Display* display,
+ int mode)
+{
+ /*
+ * This function is just a no-op. It is defined to
+ * reset the screen saver. However, there is no real
+ * way to do this on a Mac. Let me know if there is!
+ */
+ display->request++;
+}
+
+void
+Tk_FreeXId (
+ Display *display,
+ XID xid)
+{
+ /* no-op function needed for stubs implementation. */
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGetServerInfo --
+ *
+ * Given a window, this procedure returns information about
+ * the window server for that window. This procedure provides
+ * the guts of the "winfo server" command.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkGetServerInfo(
+ Tcl_Interp *interp, /* The server information is returned in
+ * this interpreter's result. */
+ Tk_Window tkwin) /* Token for window; this selects a
+ * particular display and server. */
+{
+ char buffer[8 + TCL_INTEGER_SPACE * 2];
+ char buffer2[TCL_INTEGER_SPACE];
+
+ sprintf(buffer, "X%dR%d ", ProtocolVersion(Tk_Display(tkwin)),
+ ProtocolRevision(Tk_Display(tkwin)));
+ sprintf(buffer2, " %d", VendorRelease(Tk_Display(tkwin)));
+ Tcl_AppendResult(interp, buffer, ServerVendor(Tk_Display(tkwin)),
+ buffer2, (char *) NULL);
+}
+/*
+ * Image stuff
+ */
+
+int
+TkMacOSXXDestroyImage(
+ XImage *image)
+{
+ Debugger();
+ return 0;
+}
+
+unsigned long
+TkMacOSXXGetPixel(
+ XImage *image,
+ int x,
+ int y)
+{
+ CGrafPtr grafPtr;
+ RGBColor cPix;
+ unsigned long r, g, b, c;
+ grafPtr = (CGrafPtr)image->data;
+ SetPort(grafPtr);
+ GetCPixel(x,y,&cPix);
+ r = cPix . red;
+ g = cPix . green;
+ b = cPix . blue;
+ c = (r<<16)|(g<<8)|(b);
+ return c;
+}
+
+int
+TkMacOSXXPutPixel(
+ XImage *image,
+ int x,
+ int y,
+ unsigned long pixel)
+{
+ CGrafPtr grafPtr;
+ RGBColor cPix;
+ unsigned long r, g, b;
+ grafPtr = (CGrafPtr)image->data;
+ SetPort(grafPtr);
+ r = (pixel & image->red_mask)>>16;
+ g = (pixel & image->green_mask)>>8;
+ b = (pixel & image->blue_mask);
+ cPix . red = r;
+ cPix . green = g;
+ cPix . blue = b;
+ SetCPixel(x,y,&cPix);
+ return 0;
+}
+
+XImage *
+TkMacOSXXSubImage(
+ XImage *image,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height)
+{
+ Debugger();
+ return NULL;
+}
+
+int
+TkMacOSXXAddPixel(
+ XImage *image,
+ long value)
+{
+ Debugger();
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * XChangeWindowAttributes, XSetWindowBackground,
+ * XSetWindowBackgroundPixmap, XSetWindowBorder, XSetWindowBorderPixmap,
+ * XSetWindowBorderWidth, XSetWindowColormap
+ *
+ * These functions are all no-ops. They all have equivilent
+ * Tk calls that should always be used instead.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+XChangeWindowAttributes(
+ Display* display,
+ Window w,
+ unsigned long value_mask,
+ XSetWindowAttributes* attributes)
+{
+}
+
+void
+XSetWindowBackground(
+ Display *display,
+ Window window,
+ unsigned long value)
+{
+}
+
+void
+XSetWindowBackgroundPixmap(
+ Display* display,
+ Window w,
+ Pixmap background_pixmap)
+{
+}
+
+void
+XSetWindowBorder(
+ Display* display,
+ Window w,
+ unsigned long border_pixel)
+{
+}
+
+void
+XSetWindowBorderPixmap(
+ Display* display,
+ Window w,
+ Pixmap border_pixmap)
+{
+}
+
+void
+XSetWindowBorderWidth(
+ Display* display,
+ Window w,
+ unsigned int width)
+{
+}
+
+void
+XSetWindowColormap(
+ Display* display,
+ Window w,
+ Colormap colormap)
+{
+ Debugger();
+}
+
+Status
+XStringListToTextProperty(
+ char** list,
+ int count,
+ XTextProperty* text_prop_return)
+{
+ Debugger();
+ return (Status) 0;
+}
+void
+XSetWMClientMachine(
+ Display* display,
+ Window w,
+ XTextProperty* text_prop)
+{
+ Debugger();
+}
+XIC
+XCreateIC(
+ void)
+{
+ Debugger();
+ return (XIC) 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkGetDefaultScreenName --
+ *
+ * Returns the name of the screen that Tk should use during
+ * initialization.
+ *
+ * Results:
+ * Returns a statically allocated string.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+CONST char *
+TkGetDefaultScreenName(
+ Tcl_Interp *interp, /* Not used. */
+ CONST char *screenName) /* If NULL, use default string. */
+{
+#if 0
+ if ((screenName == NULL) || (screenName[0] == '\0')) {
+ screenName = macScreenName;
+ }
+ return screenName;
+#endif
+ return macScreenName;
+}
diff --git a/tk/tests/README b/tk/tests/README
index ea935942dc4..66a428ec6b6 100644
--- a/tk/tests/README
+++ b/tk/tests/README
@@ -5,4 +5,3 @@ RCS: @(#) $Id$
This directory contains a set of validation tests for the Tk commands.
Please see the tests/README file in the Tcl source distribution for
information about the test suite.
-
diff --git a/tk/tests/all.tcl b/tk/tests/all.tcl
index dea18b63876..fbf8cde9452 100644
--- a/tk/tests/all.tcl
+++ b/tk/tests/all.tcl
@@ -5,74 +5,15 @@
# in this directory.
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
-# All rights reserved.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-set ::tcltest::testSingleFile false
-
-puts stdout "Tk $tk_patchLevel tests running in interp: [info nameofexecutable]"
-puts stdout "Tests running in working dir: $::tcltest::workingDir"
-if {[llength $::tcltest::skip] > 0} {
- puts stdout "Skipping tests that match: $::tcltest::skip"
-}
-if {[llength $::tcltest::match] > 0} {
- puts stdout "Only running tests that match: $::tcltest::match"
-}
-
-# Use command line specified glob pattern (specified by -file or -f)
-# if one exists. Otherwise use *.test. If given, the file pattern
-# should be specified relative to the dir containing this file. If no
-# files are found to match the pattern, print an error message and exit.
-set fileIndex [expr {[lsearch $argv "-file"] + 1}]
-set fIndex [expr {[lsearch $argv "-f"] + 1}]
-if {($fileIndex < 1) || ($fIndex > $fileIndex)} {
- set fileIndex $fIndex
-}
-if {$fileIndex > 0} {
- set globPattern [file join $::tcltest::testsDir [lindex $argv $fileIndex]]
- puts stdout "Sourcing files that match: $globPattern"
-} else {
- set globPattern [file join $::tcltest::testsDir *.test]
-}
-set fileList [glob -nocomplain $globPattern]
-if {[llength $fileList] < 1} {
- puts "Error: no files found matching $globPattern"
- exit
-}
-set timeCmd {clock format [clock seconds]}
-puts stdout "Tests began at [eval $timeCmd]"
-
-# source each of the specified tests
-foreach file [lsort $fileList] {
- set tail [file tail $file]
- if {[string match l.*.test $tail]} {
- # This is an SCCS lockfile; ignore it
- continue
- }
- puts stdout $tail
- if {[catch {source $file} msg]} {
- puts stdout $msg
- }
-}
-
-# cleanup
-puts stdout "\nTests ended at [eval $timeCmd]"
-::tcltest::cleanupTests 1
-return
-
-
-
-
-
-
-
-
-
-
-
-
-
+package require Tcl 8.4
+package require tcltest 2.1
+tcltest::configure -testdir [file join [pwd] [file dirname [info script]]]
+tcltest::configure -singleproc 1
+eval tcltest::configure $argv
+tcltest::runAllTests
diff --git a/tk/tests/bell.test b/tk/tests/bell.test
index e2d66f62be1..e1ab217d37c 100644
--- a/tk/tests/bell.test
+++ b/tk/tests/bell.test
@@ -2,31 +2,46 @@
# It is organized in the standard fashion for Tcl tests.
#
# Copyright (c) 1994 The Regents of the University of California.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998-2000 by Scriptics Corporation.
# All rights reserved.
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test bell-1.1 {bell command} {
list [catch {bell a} msg] $msg
-} {1 {wrong # args: should be "bell ?-displayof window?"}}
+} {1 {bad option "a": must be -displayof or -nice}}
test bell-1.2 {bell command} {
list [catch {bell a b} msg] $msg
-} {1 {bad option "a": must be -displayof}}
+} {1 {bad option "a": must be -displayof or -nice}}
test bell-1.3 {bell command} {
list [catch {bell -displayof gorp} msg] $msg
} {1 {bad window path name "gorp"}}
test bell-1.4 {bell command} {
+ list [catch {bell -nice -displayof} msg] $msg
+} {1 {wrong # args: should be "bell ?-displayof window? ?-nice?"}}
+test bell-1.5 {bell command} {
+ list [catch {bell -nice -nice -nice} msg] $msg
+} {0 {}}
+test bell-1.6 {bell command} {
+ list [catch {bell -displayof . -nice} msg] $msg
+} {0 {}}
+test bell-1.7 {bell command} {
+ list [catch {bell -nice -displayof . -nice} msg] $msg
+} {1 {wrong # args: should be "bell ?-displayof window? ?-nice?"}}
+test bell-1.8 {bell command} {
puts "Bell should ring now ..."
flush stdout
- after 500
+ after 200
bell -displayof .
after 200
- bell
+ bell -nice
after 200
bell
} {}
diff --git a/tk/tests/bgerror.test b/tk/tests/bgerror.test
index c821389b6dd..9566282fe05 100644
--- a/tk/tests/bgerror.test
+++ b/tk/tests/bgerror.test
@@ -7,9 +7,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test bgerror-1.1 {bgerror / tkerror compat} {
set errRes {}
diff --git a/tk/tests/bind.test b/tk/tests/bind.test
index 1aa7d8202b9..536188c0a6d 100644
--- a/tk/tests/bind.test
+++ b/tk/tests/bind.test
@@ -9,9 +9,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .b}
toplevel .b -width 100 -height 50
@@ -84,10 +87,10 @@ test bind-1.10 {bind command} {
test bind-2.1 {bindtags command} {
list [catch {bindtags} msg] $msg
-} {1 {wrong # args: should be "bindtags window ?tags?"}}
+} {1 {wrong # args: should be "bindtags window ?taglist?"}}
test bind-2.2 {bindtags command} {
list [catch {bindtags a b c} msg] $msg
-} {1 {wrong # args: should be "bindtags window ?tags?"}}
+} {1 {wrong # args: should be "bindtags window ?taglist?"}}
test bind-2.3 {bindtags command} {
list [catch {bindtags .foo} msg] $msg
} {1 {bad window path name ".foo"}}
@@ -214,13 +217,7 @@ test bind-5.1 {Tk_CreateBindingTable procedure} {
.b.c bind foo
} {}
-
-if {[string compare testcbind [info commands testcbind]] != 0} {
- puts "This application hasn't been compiled with the testcbind command,"
- puts "therefore I am skipping all of these tests."
- ::tcltest::cleanupTests
- return
-}
+testConstraint testcbind [llength [info commands testcbind]]
test bind-6.1 {Tk_DeleteBindTable procedure} {
catch {destroy .b.c}
@@ -230,7 +227,7 @@ test bind-6.1 {Tk_DeleteBindTable procedure} {
.b.c bind 1 <2> {string 2}
destroy .b.c
} {}
-test bind-6.2 {Tk_DeleteBindTable procedure: pending bindings deleted later} {
+test bind-6.2 {Tk_DeleteBindTable procedure: pending bindings deleted later} testcbind {
catch {interp delete foo}
interp create foo
foo eval {
@@ -258,7 +255,7 @@ test bind-7.1 {Tk_CreateBinding procedure: bad binding} {
canvas .b.c
list [catch {.b.c bind foo <} msg] $msg
} {1 {no event type or button # or keysym}}
-test bind-7.2 {Tk_CreateBinding procedure: replace existing C binding} {
+test bind-7.2 {Tk_CreateBinding procedure: replace existing C binding} testcbind {
catch {destroy .b.f}
frame .b.f
testcbind .b.f <1> "xyz" "lappend x bye.1"
@@ -282,10 +279,10 @@ test bind-7.4 {Tk_CreateBinding procedure: append to non-existing} {
.b.c bind foo <1>
} {button 1}
-test bind-8.1 {TkCreateBindingProcedure: error} {
+test bind-8.1 {TkCreateBindingProcedure: error} testcbind {
list [catch {testcbind . <xyz> "xyz"} msg] $msg
} {1 {bad event type or keysym "xyz"}}
-test bind-8.2 {TkCreateBindingProcedure: new binding} {
+test bind-8.2 {TkCreateBindingProcedure: new binding} testcbind {
catch {destroy .b.f}
frame .b.f
testcbind .b.f <1> "lappend x 1" "lappend x bye.1"
@@ -294,7 +291,7 @@ test bind-8.2 {TkCreateBindingProcedure: new binding} {
destroy .b.f
set x
} {bye.1}
-test bind-8.3 {TkCreateBindingProcedure: replace existing} {
+test bind-8.3 {TkCreateBindingProcedure: replace existing} testcbind {
catch {destroy .b.f}
frame .b.f
pack .b.f
@@ -303,7 +300,7 @@ test bind-8.3 {TkCreateBindingProcedure: replace existing} {
testcbind .b.f <1> "lappend x new1" "lappend x bye.new1"
set x
} {bye.old1}
-test bind-8.4 {TkCreateBindingProcedure: replace existing while pending} {
+test bind-8.4 {TkCreateBindingProcedure: replace existing while pending} testcbind {
catch {destroy .b.f}
frame .b.f
pack .b.f
@@ -347,7 +344,7 @@ test bind-9.3 {Tk_DeleteBinding procedure} {
}
set result
} {{<Button-1> <Double-Alt-Button-1> <Meta-Button-1>} {<Button-1> <Meta-Button-1>} <Meta-Button-1> {}}
-test bind-9.4 {Tk_DeleteBinding procedure: pending bindings delete later} {
+test bind-9.4 {Tk_DeleteBinding procedure: pending bindings delete later} testcbind {
catch {destroy .b.f}
frame .b.f
pack .b.f
@@ -375,7 +372,7 @@ test bind-10.2 {Tk_GetBinding procedure} {
.b.c bind foo a Test
.b.c bind foo a
} {Test}
-test bind-10.3 {Tk_GetBinding procedure: C binding} {
+test bind-10.3 {Tk_GetBinding procedure: C binding} testcbind {
catch {destroy .b.f}
frame .b.f
testcbind .b.f <1> "foo"
@@ -421,7 +418,7 @@ test bind-12.2 {Tk_DeleteAllBindings procedure} {
}
destroy .b.f
} {}
-test bind-12.3 {Tk_DeleteAllBindings procedure: pending bindings deleted later} {
+test bind-12.3 {Tk_DeleteAllBindings procedure: pending bindings deleted later} testcbind {
catch {destroy .b.f}
frame .b.f
pack .b.f
@@ -731,7 +728,7 @@ test bind-13.31 {Tk_BindEvent procedure: match} {
event gen .b.f <Button-2>
set x
} {Button-2}
-test bind-13.32 {Tk_BindEvent procedure: many C bindings cause realloc} {
+test bind-13.32 {Tk_BindEvent procedure: many C bindings cause realloc} testcbind {
setup
bindtags .b.f {a b c d e f g h i j k l m n o p}
foreach p [bindtags .b.f] {
@@ -753,14 +750,14 @@ test bind-13.33 {Tk_BindEvent procedure: multiple tags} {
bind Test <Button-2> {}
set x
} {.b.f Button}
-test bind-13.34 {Tk_BindEvent procedure: execute C binding} {
+test bind-13.34 {Tk_BindEvent procedure: execute C binding} testcbind {
setup
testcbind .b.f <1> {lappend x 1}
set x {}
event gen .b.f <1>
set x
} {1}
-test bind-13.35 {Tk_BindEvent procedure: pending list marked deleted} {
+test bind-13.35 {Tk_BindEvent procedure: pending list marked deleted} testcbind {
setup
testcbind Test <1> {lappend x Test} {lappend x Deleted}
bind .b.f <1> {lappend x .b.f; destroy .b.f}
@@ -770,7 +767,7 @@ test bind-13.35 {Tk_BindEvent procedure: pending list marked deleted} {
bind Test <1> {}
set y
} {.b.f <Button-1>}
-test bind-13.36 {Tk_BindEvent procedure: C binding marked deleted} {
+test bind-13.36 {Tk_BindEvent procedure: C binding marked deleted} testcbind {
setup
testcbind Test <1> {lappend x Test} {lappend x Deleted}
bind .b.f <1> {lappend x .b.f; bind Test <1> {}; lappend x after}
@@ -778,7 +775,7 @@ test bind-13.36 {Tk_BindEvent procedure: C binding marked deleted} {
event gen .b.f <1>
set x
} {.b.f after Deleted}
-test bind-13.37 {Tk_BindEvent procedure: C binding gets to run} {
+test bind-13.37 {Tk_BindEvent procedure: C binding gets to run} testcbind {
setup
testcbind Test <1> {lappend x Test}
bind .b.f <1> {lappend x .b.f}
@@ -787,14 +784,14 @@ test bind-13.37 {Tk_BindEvent procedure: C binding gets to run} {
bind Test <1> {}
set x
} {.b.f Test}
-test bind-13.38 {Tk_BindEvent procedure: C binding deleted, refcount == 0} {
+test bind-13.38 {Tk_BindEvent procedure: C binding deleted, refcount == 0} testcbind {
setup
testcbind .b.f <1> {lappend x hi; bind .b.f <1> {}} {lappend x bye}
set x {}
event gen .b.f <1>
set x
} {hi bye}
-test bind-13.39 {Tk_BindEvent procedure: C binding deleted, refcount != 0} {
+test bind-13.39 {Tk_BindEvent procedure: C binding deleted, refcount != 0} testcbind {
setup
testcbind .b.f <1> {
lappend x before$n
@@ -820,7 +817,7 @@ test bind-13.40 {Tk_BindEvent procedure: continue in script} {
bind Test <Button-2> {}
set x
} {b1 B1}
-test bind-13.41 {Tk_BindEvent procedure: continue in script} {
+test bind-13.41 {Tk_BindEvent procedure: continue in script} testcbind {
setup
testcbind .b.f <Button-2> {lappend x b1; continue; lappend x b2}
testcbind Test <Button-2> {lappend x B1; continue; lappend x B2}
@@ -838,7 +835,7 @@ test bind-13.42 {Tk_BindEvent procedure: break in script} {
bind Test <Button-2> {}
set x
} {b1}
-test bind-13.43 {Tk_BindEvent procedure: break in script} {
+test bind-13.43 {Tk_BindEvent procedure: break in script} testcbind {
setup
testcbind .b.f <Button-2> {lappend x b1; break; lappend x b2}
testcbind Test <Button-2> {lappend x B1; break; lappend x B2}
@@ -862,7 +859,7 @@ test bind-13.44 {Tk_BindEvent procedure: error in script} {
bind Test <Button-2> {}
set x
} {b1 {invalid command name "blap"}}
-test bind-13.45 {Tk_BindEvent procedure: error in script} {
+test bind-13.45 {Tk_BindEvent procedure: error in script} testcbind {
setup
testcbind .b.f <Button-2> {lappend x b1; blap}
testcbind Test <Button-2> {lappend x B1}
@@ -873,13 +870,13 @@ test bind-13.45 {Tk_BindEvent procedure: error in script} {
set x
} {b1 {invalid command name "blap"}}
-test bind-14.1 {TkBindDeadWindow: no C bindings pending} {
+test bind-14.1 {TkBindDeadWindow: no C bindings pending} testcbind {
setup
bind .b.f <1> x
testcbind .b.f <2> y
destroy .b.f
} {}
-test bind-14.2 {TkBindDeadWindow: is called after <Destroy>} {
+test bind-14.2 {TkBindDeadWindow: is called after <Destroy>} testcbind {
setup
testcbind .b.f <Destroy> "lappend x .b.f"
testcbind Test <Destroy> "lappend x Test"
@@ -888,7 +885,7 @@ test bind-14.2 {TkBindDeadWindow: is called after <Destroy>} {
bind Test <Destroy> {}
set x
} {.b.f Test}
-test bind-14.3 {TkBindDeadWindow: pending C bindings} {
+test bind-14.3 {TkBindDeadWindow: pending C bindings} testcbind {
setup
bindtags .b.f {a b c d}
testcbind a <1> "lappend x a1" "lappend x bye.a1"
@@ -1945,7 +1942,7 @@ test bind-22.2 {HandleEventGenerate} {
} {1 {bad window name/identifier "zzz"}}
test bind-22.3 {HandleEventGenerate} {
list [catch {event gen 47 <Control-v>} msg] $msg
-} {1 {window id "47" doesn't exist in this application}}
+} {1 {bad window name/identifier "47"}}
test bind-22.4 {HandleEventGenerate} {
setup
bind .b.f <Button> {set x "%s %b"}
@@ -2046,7 +2043,11 @@ test bind-22.16 {HandleEventGenerate} {
test bind-22.17 {HandleEventGenerate} {
list [catch {event gen . <Button> -when xyz} msg] $msg
} {1 {bad -when value "xyz": must be now, head, mark, or tail}}
-set i 18
+test bind-22.18 {HandleEventGenerate} {
+ # Bug 411307
+ list [catch {event gen . <a> -root 98765} msg] $msg
+} {1 {bad window name/identifier "98765"}}
+set i 19
foreach check {
{<Configure> %a {-above .xyz} {{1 {bad window path name ".xyz"}}}}
{<Configure> %a {-above .b} {[winfo id .b]}}
@@ -2673,22 +2674,8 @@ test bind-31.2 {MouseWheel events} {
set x
} {240 10 30}
-
destroy .b
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/bitmap.test b/tk/tests/bitmap.test
index d91223938bf..cf839b3107a 100644
--- a/tk/tests/bitmap.test
+++ b/tk/tests/bitmap.test
@@ -8,21 +8,16 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-if {[info commands testbitmap] != "testbitmap"} {
- puts "testbitmap command not available; skipping tests"
- ::tcltest::cleanupTests
- return
-}
+testConstraint testbitmap [llength [info commands testbitmap]]
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
-
-test bitmap-1.1 {Tk_AllocBitmapFromObj - converting internal reps} {
+test bitmap-1.1 {Tk_AllocBitmapFromObj - converting internal reps} testbitmap {
set x gray25
lindex $x 0
destroy .b1
@@ -30,7 +25,7 @@ test bitmap-1.1 {Tk_AllocBitmapFromObj - converting internal reps} {
lindex $x 0
testbitmap gray25
} {{1 0}}
-test bitmap-1.2 {Tk_AllocBitmapFromObj - discard stale bitmap} {
+test bitmap-1.2 {Tk_AllocBitmapFromObj - discard stale bitmap} testbitmap {
set x gray25
destroy .b1 .b2
button .b1 -bitmap $x
@@ -40,7 +35,7 @@ test bitmap-1.2 {Tk_AllocBitmapFromObj - discard stale bitmap} {
button .b2 -bitmap $x
lappend result [testbitmap gray25]
} {{} {{1 1}}}
-test bitmap-1.3 {Tk_AllocBitmapFromObj - reuse existing bitmap} {
+test bitmap-1.3 {Tk_AllocBitmapFromObj - reuse existing bitmap} testbitmap {
set x gray25
destroy .b1 .b2
button .b1 -bitmap $x
@@ -60,7 +55,7 @@ test bitmap-2.2 {Tk_GetBitmap procedure} {
list [catch {button .b1 -bitmap @xyzzy} msg] $msg
} {1 {error reading bitmap file "xyzzy"}}
-test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} {
+test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} testbitmap {
set x questhead
destroy .b1 .b2 .b3
button .b1 -bitmap $x
@@ -76,7 +71,7 @@ test bitmap-3.1 {Tk_FreeBitmapFromObj - reference counts} {
lappend result [testbitmap questhead]
} {{{3 1}} {{2 1}} {{1 1}} {}}
-test bitmap-4.1 {FreeBitmapObjProc} {
+test bitmap-4.1 {FreeBitmapObjProc} testbitmap {
destroy .b
set x [format questhead]
button .b -bitmap $x
diff --git a/tk/tests/border.test b/tk/tests/border.test
index 483e44d36ef..675ecade63d 100644
--- a/tk/tests/border.test
+++ b/tk/tests/border.test
@@ -7,37 +7,21 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+testConstraint testborder [llength [info commands testborder]]
+
+if {[testConstraint pseudocolor8]} {
+ toplevel .t -visual {pseudocolor 8} -colormap new
+ wm geom .t +0+0
}
-if {[info commands testborder] != "testborder"} {
- puts "testborder command not available; skipping tests"
- ::tcltest::cleanupTests
- return
-}
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
-
-# Create a top-level with its own colormap (so we can test under
-# controlled conditions), then check to make sure that the visual
-# is color-mapped with 256 borders. If not, just skip this whole
-# test file.
-
-if [catch {toplevel .t -visual {pseudocolor 8} -colormap new}] {
- ::tcltest::cleanupTests
- return
-}
-wm geom .t +0+0
-if {[winfo depth .t] != 8} {
- destroy .t
- ::tcltest::cleanupTests
- return
-}
-
-test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} {
+test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} testborder {
set x orange
lindex $x 0
destroy .b1
@@ -45,7 +29,7 @@ test border-1.1 {Tk_AllocBorderFromObj - converting internal reps} {
lindex $x 0
testborder orange
} {{1 0}}
-test border-1.3 {Tk_AllocBorderFromObj - discard stale border} {
+test border-1.3 {Tk_AllocBorderFromObj - discard stale border} testborder {
set x orange
destroy .b1 .b2
button .b1 -bg $x -text First
@@ -55,7 +39,7 @@ test border-1.3 {Tk_AllocBorderFromObj - discard stale border} {
button .b2 -bg $x -text Second
lappend result [testborder orange]
} {{} {{1 1}}}
-test border-1.2 {Tk_AllocBorderFromObj - reuse existing border} {
+test border-1.2 {Tk_AllocBorderFromObj - reuse existing border} testborder {
set x orange
destroy .b1 .b2
button .b1 -bg $x -text First
@@ -65,7 +49,7 @@ test border-1.2 {Tk_AllocBorderFromObj - reuse existing border} {
pack .b1 .b2 -side top
lappend result [testborder orange]
} {{{1 1}} {{2 1}}}
-test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} {
+test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} {pseudocolor8 testborder} {
set x purple
destroy .b1 .b2 .t.b
button .b1 -bg $x -text First
@@ -80,7 +64,7 @@ test border-1.4 {Tk_AllocBorderFromObj - try other borders in list} {
lappend result [testborder purple]
} {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}}
-test border-3.1 {Tk_Free3DBorder - reference counts} {
+test border-3.1 {Tk_Free3DBorder - reference counts} {pseudocolor8 testborder} {
set x purple
destroy .b1 .b2 .t.b
button .b1 -bg $x -text First
@@ -98,7 +82,7 @@ test border-3.1 {Tk_Free3DBorder - reference counts} {
destroy .t.b
lappend result [testborder purple]
} {{{1 0} {2 1}} {{1 0} {1 1}} {{1 0}} {}}
-test border-3.4 {Tk_Free3DBorder - unlinking from list} {
+test border-3.4 {Tk_Free3DBorder - unlinking from list} {pseudocolor8 testborder} {
destroy .b .t.b .t2 .t3
toplevel .t2 -visual {pseudocolor 8} -colormap new
toplevel .t3 -visual {pseudocolor 8} -colormap new
@@ -125,7 +109,7 @@ test border-3.4 {Tk_Free3DBorder - unlinking from list} {
lappend result [testborder purple]
} {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}}
-test border-4.1 {FreeBorderObjProc} {
+test border-4.1 {FreeBorderObjProc} testborder {
destroy .b
set x [format purple]
button .b -bg $x -text .b1
@@ -175,7 +159,9 @@ test get-2.4 {Tk_GetReliefFromObj - error} {
list [catch {.b configure -relief upanddown} msg] $msg
} {1 {bad relief "upanddown": must be flat, groove, raised, ridge, solid, or sunken}}
-destroy .t
+if {[testConstraint pseudocolor8]} {
+ destroy .t
+}
# cleanup
::tcltest::cleanupTests
diff --git a/tk/tests/button.test b/tk/tests/button.test
index df4d883971e..27c46316be1 100644
--- a/tk/tests/button.test
+++ b/tk/tests/button.test
@@ -9,23 +9,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\""
- puts "image, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
proc bogusTrace args {
error "trace aborted"
@@ -41,7 +30,9 @@ option add *Button.highlightThickness 2
option add *Button.font {Helvetica -12 bold}
eval image delete [image names]
-image create test image1
+if {[testConstraint testImageType]} {
+ image create test image1
+}
label .l -text Label
button .b -text Button
checkbutton .c -text Checkbutton
@@ -64,6 +55,7 @@ foreach test {
{1 1 1 1}}
{-borderwidth 1.3 1.3 badValue {bad screen distance "badValue"} {1 1 1 1}}
{-command "set x" {set x} {} {} {0 1 1 1}}
+ {-compound left left bogus {bad compound "bogus": must be bottom, center, left, none, right, or top} {1 1 1 1}}
{-cursor arrow arrow badValue {bad cursor spec "badValue"} {1 1 1 1}}
{-default active active huh?
{bad default "huh?": must be active, disabled, or normal}
@@ -84,11 +76,15 @@ foreach test {
{-indicatoron yes 1 no_way {expected boolean value but got "no_way"}
{0 0 1 1}}
{-justify right right bogus {bad justification "bogus": must be left, right, or center} {1 1 1 1}}
+ {-offrelief flat flat 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} {0 0 1 1}}
{-offvalue lousy lousy {} {} {0 0 1 0}}
{-offvalue fantastic fantastic {} {} {0 0 1 0}}
+ {-overrelief "" "" 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} {0 1 1 1}}
{-padx 12m 12m 420x {bad screen distance "420x"} {1 1 1 1}}
{-pady 12m 12m 420x {bad screen distance "420x"} {1 1 1 1}}
- {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} {1 1 1 1}}
+ {-repeatdelay 100 100 foo {expected integer but got "foo"} {0 1 0 0}}
+ {-repeatinterval 100 100 foo {expected integer but got "foo"} {0 1 0 0}}
+ {-relief flat flat 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken} {1 1 1 1}}
{-selectcolor #110022 #110022 bogus {unknown color name "bogus"} {0 0 1 1}}
{-selectimage image1 image1 bogus {image "bogus" doesn't exist} {0 0 1 1}}
{-state normal normal bogus {bad state "bogus": must be active, disabled, or normal} {1 1 1 1}}
@@ -104,19 +100,19 @@ foreach test {
set classes [lindex $test 5]
foreach w {.l .b .c .r} hasOption [lindex $test 5] {
if $hasOption {
- test button-1.$i {configuration options} {
+ test button-1.$i {configuration options} testImageType {
$w configure $name [lindex $test 1]
lindex [$w configure $name] 4
} [lindex $test 2]
incr i
if {[lindex $test 3] != ""} {
- test button-1.$i {configuration options} {
+ test button-1.$i {configuration options} testImageType {
list [catch {$w configure $name [lindex $test 3]} msg] $msg
} [list 1 [lindex $test 4]]
}
$w configure $name [lindex [$w configure $name] 3]
} else {
- test button-1.$i {configuration options} {
+ test button-1.$i {configuration options} testImageType {
list [catch {$w configure $name [lindex $test 1]} msg] $msg
} "1 {unknown option \"$name\"}"
}
@@ -222,7 +218,7 @@ test button-4.13 {ButtonWidgetCmd procedure, "cget" option} {
} {1 {unknown option "-onvalue"}}
test button-4.14 {ButtonWidgetCmd procedure, "configure" option} {
llength [.c configure]
-} {36}
+} {39}
test button-4.15 {ButtonWidgetCmd procedure, "configure" option} {
list [catch {.b configure -gorp} msg] $msg
} {1 {unknown option "-gorp"}}
@@ -407,7 +403,7 @@ test button-4.50 {ButtonWidgetCmd procedure, "toggle" option} {
while executing
".c toggle"}}
-test button-5.1 {DestroyButton procedure} {
+test button-5.1 {DestroyButton procedure} testImageType {
image create test image1
button .b1 -image image1
button .b2 -fg #ff0000 -text "Button 2"
@@ -417,7 +413,7 @@ test button-5.1 {DestroyButton procedure} {
set x 1
pack .b1 .b2 .b3 .b4 .b5
update
- eval destroy [winfo children .]
+ deleteWindows
} {}
test button-6.1 {ConfigureButton - textvariable trace} {
@@ -447,7 +443,7 @@ test button-6.2 {ConfigureButton - variable traces} {
.b1 toggle
set y
} {1}
-test button-6.3 {ConfigureButton - image handling} {
+test button-6.3 {ConfigureButton - image handling} testImageType {
catch {destroy .b1}
eval image delete [image names]
image create test image1
@@ -540,7 +536,7 @@ test button-6.16 {ConfigureButton - -width option} {
(processing -width option)
invoked from within
".b1 configure -width abc"}}
-test button-6.17 {ConfigureButton - -height option} {
+test button-6.17 {ConfigureButton - -height option} testImageType {
catch {destroy .b1}
eval image delete [image names]
image create test image1
@@ -577,7 +573,7 @@ test button-7.1 {ButtonEventProc procedure} {
set x
} {0 {}}
test button-7.2 {ButtonEventProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
button .b1 -bg #543210
rename .b1 .b2
set x {}
@@ -588,7 +584,7 @@ test button-7.2 {ButtonEventProc procedure} {
} {.b1 #543210 {} {}}
test button-8.1 {ButtonCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
button .b1
rename .b1 {}
list [info command .b*] [winfo children .]
@@ -644,20 +640,20 @@ test button-9.5 {TkInvokeButton procedure} {
while executing
".b1 invoke"} red}
test button-9.6 {TkInvokeButton procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set result untouched
button .b1 -command {set result invoked}
list [catch {.b1 invoke} msg] $msg $result
} {0 invoked invoked}
test button-9.7 {TkInvokeButton procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set result untouched
set x 0
checkbutton .b1 -variable x -command {set result "invoked $x"}
list [catch {.b1 invoke} msg] $msg $result
} {0 {invoked 1} {invoked 1}}
test button-9.8 {TkInvokeButton procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set result untouched
set x 0
radiobutton .b1 -variable x -value red -command {set result "invoked $x"}
@@ -665,7 +661,7 @@ test button-9.8 {TkInvokeButton procedure} {
} {0 {invoked red} {invoked red}}
test button-10.1 {ButtonVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x 1
checkbutton .b1 -variable x
unset x
@@ -677,7 +673,7 @@ test button-10.1 {ButtonVarProc procedure} {
lappend result $x
} {0 1 1}
test button-10.2 {ButtonVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x 0
checkbutton .b1 -variable x
set x 44
@@ -685,7 +681,7 @@ test button-10.2 {ButtonVarProc procedure} {
set x
} {1}
test button-10.3 {ButtonVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x 1
checkbutton .b1 -variable x
set x 44
@@ -693,7 +689,7 @@ test button-10.3 {ButtonVarProc procedure} {
set x
} {1}
test button-10.4 {ButtonVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x 0
checkbutton .b1 -variable x
set x 1
@@ -701,7 +697,7 @@ test button-10.4 {ButtonVarProc procedure} {
set x
} {0}
test button-10.5 {ButtonVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x 1
checkbutton .b1 -variable x
set x 1
@@ -709,7 +705,7 @@ test button-10.5 {ButtonVarProc procedure} {
set x
} {0}
test button-10.6 {ButtonVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x 0
checkbutton .b1 -variable x
set x 0
@@ -717,7 +713,7 @@ test button-10.6 {ButtonVarProc procedure} {
set x
} {1}
test button-10.7 {ButtonVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x 1
checkbutton .b1 -variable x
set x 0
@@ -726,7 +722,7 @@ test button-10.7 {ButtonVarProc procedure} {
} {1}
test button-10.8 {ButtonVarProc procedure, can't read variable} {
# This test does nothing but produce a core dump if there's a prbblem.
- eval destroy [winfo children .]
+ deleteWindows
catch {unset a}
checkbutton .b1 -variable a
unset a
@@ -735,7 +731,7 @@ test button-10.8 {ButtonVarProc procedure, can't read variable} {
} {}
test button-11.1 {ButtonTextVarProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
set x Label
button .b1 -textvariable x
unset x
@@ -744,8 +740,10 @@ test button-11.1 {ButtonTextVarProc procedure} {
lappend result [lindex [.b1 configure -text] 4]
} {Label Label New}
test button-11.2 {ButtonTextVarProc procedure} {
- eval destroy [winfo children .]
- set x Label
+ deleteWindows
+ # Windows buttons have a default min width, so we have to
+ # set this to be longer to force the wider button.
+ set x ExtraLongLabel
button .b1 -textvariable x
set old [winfo reqwidth .b1]
set x New
@@ -753,8 +751,8 @@ test button-11.2 {ButtonTextVarProc procedure} {
list [lindex [.b1 configure -text] 4] [expr $old == $new]
} {New 0}
-test button-12.1 {ButtonImageProc procedure} {
- eval destroy [winfo children .]
+test button-12.1 {ButtonImageProc procedure} testImageType {
+ deleteWindows
eval image delete [image names]
image create test image1
label .b1 -image image1 -padx 0 -pady 0 -bd 0
@@ -764,7 +762,7 @@ test button-12.1 {ButtonImageProc procedure} {
lappend result [winfo reqwidth .b1] [winfo reqheight .b1]
} {30 15 80 100}
-eval destroy [winfo children .]
+deleteWindows
set l [interp hidden]
test button-13.1 {button widget vs hidden commands} {
@@ -775,11 +773,40 @@ test button-13.1 {button widget vs hidden commands} {
list [winfo children .] [interp hidden]
} [list {} $l]
-eval destroy [winfo children .]
+deleteWindows
+
+test button-14.1 {size behaviouor} {
+ set res {}
+ foreach class {label button radiobutton checkbutton} {
+ eval destroy [winfo children .]
+
+ $class .a -text Hej
+ $class .b -text Hej -width 10 -height 1
+ $class .c -text "" -width 10 -height 1
+
+ for {set t 0} {$t < 2} {incr t} {
+ set res2 {}
+ # With -width, width should not be affected by text change
+ lappend res2 [expr {[winfo reqwidth .b] == [winfo reqwidth .c]}]
+ # With -height, height should not be affected by text change
+ lappend res2 [expr {[winfo reqheight .b] == [winfo reqheight .c]}]
+ # A one line text should be as high as -height 1
+ lappend res2 [expr {[winfo reqheight .a] == [winfo reqheight .b]}]
+ lappend res $res2
+
+ # Do the second round with another font
+ .a configure -font "Arial 20"
+ .b configure -font "Arial 20"
+ .c configure -font "Arial 20"
+ }
+ }
+ set res
+} {{1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1} {1 1 1}}
+
+deleteWindows
option clear
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/canvImg.test b/tk/tests/canvImg.test
index 0424d8a3348..090d5ef2963 100644
--- a/tk/tests/canvImg.test
+++ b/tk/tests/canvImg.test
@@ -9,31 +9,22 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
eval image delete [image names]
canvas .c
pack .c
update
-image create test foo -variable x
-image create test foo2 -variable y
-foo2 changed 0 0 0 0 80 60
+if {[testConstraint testImageType]} {
+ image create test foo -variable x
+ image create test foo2 -variable y
+ foo2 changed 0 0 0 0 80 60
+}
test canvImg-1.1 {options for image items} {
.c delete all
.c create image 50 50 -anchor nw -tags i1
@@ -43,7 +34,7 @@ test canvImg-1.2 {options for image items} {
.c delete all
list [catch {.c create image 50 50 -anchor gorp -tags i1} msg] $msg
} {1 {bad anchor position "gorp": must be n, ne, e, se, s, sw, w, nw, or center}}
-test canvImg-1.3 {options for image items} {
+test canvImg-1.3 {options for image items} testImageType {
.c delete all
.c create image 50 50 -image foo -tags i1
.c itemconfigure i1 -image
@@ -52,7 +43,7 @@ test canvImg-1.4 {options for image items} {
.c delete all
list [catch {.c create image 50 50 -image unknown -tags i1} msg] $msg
} {1 {image "unknown" doesn't exist}}
-test canvImg-1.5 {options for image items} {
+test canvImg-1.5 {options for image items} testImageType {
.c delete all
.c create image 50 50 -image foo -tags {i1 foo}
.c itemconfigure i1 -tags
@@ -77,37 +68,37 @@ test canvImg-2.4 {CreateImage procedure} {
test canvImg-2.5 {CreateImage procedure} {
list [catch {.c create image 50 qrs} msg] $msg
} {1 {bad screen distance "qrs"}}
-test canvImg-2.6 {CreateImage procedure} {
+test canvImg-2.6 {CreateImage procedure} testImageType {
list [catch {.c create image 50 50 -gorp foo} msg] $msg
} {1 {unknown option "-gorp"}}
-test canvImg-3.1 {ImageCoords procedure} {
+test canvImg-3.1 {ImageCoords procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1
.c coords i1
} {50.0 100.0}
-test canvImg-3.2 {ImageCoords procedure} {
+test canvImg-3.2 {ImageCoords procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1
list [catch {.c coords i1 dumb 100} msg] $msg
} {1 {bad screen distance "dumb"}}
-test canvImg-3.3 {ImageCoords procedure} {
+test canvImg-3.3 {ImageCoords procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1
list [catch {.c coords i1 250 dumb0} msg] $msg
} {1 {bad screen distance "dumb0"}}
-test canvImg-3.4 {ImageCoords procedure} {
+test canvImg-3.4 {ImageCoords procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1
list [catch {.c coords i1 250} msg] $msg
} {1 {wrong # coordinates: expected 2, got 1}}
-test canvImg-3.5 {ImageCoords procedure} {
+test canvImg-3.5 {ImageCoords procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1
list [catch {.c coords i1 250 300 400} msg] $msg
} {1 {wrong # coordinates: expected 0 or 2, got 3}}
-test canvImg-4.1 {ConfiugreImage procedure} {
+test canvImg-4.1 {ConfiugreImage procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1
update
@@ -116,7 +107,7 @@ test canvImg-4.1 {ConfiugreImage procedure} {
update
list $x [.c bbox i1]
} {{{foo free}} {}}
-test canvImg-4.2 {ConfiugreImage procedure} {
+test canvImg-4.2 {ConfiugreImage procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1 -anchor nw
update
@@ -126,7 +117,7 @@ test canvImg-4.2 {ConfiugreImage procedure} {
update
list $x $y [.c bbox i1]
} {{{foo free}} {{foo2 get} {foo2 display 0 0 80 60 30 30}} {50 100 130 160}}
-test canvImg-4.3 {ConfiugreImage procedure} {
+test canvImg-4.3 {ConfiugreImage procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags i1 -anchor nw
update
@@ -135,7 +126,7 @@ test canvImg-4.3 {ConfiugreImage procedure} {
list [catch {.c itemconfigure i1 -image lousy} msg] $msg
} {1 {image "lousy" doesn't exist}}
-test canvImg-5.1 {DeleteImage procedure} {
+test canvImg-5.1 {DeleteImage procedure} testImageType {
image create test xyzzy -variable z
.c delete all
.c create image 50 100 -image xyzzy -tags i1
@@ -155,12 +146,12 @@ test canvImg-5.2 {DeleteImage procedure (don't delete non-existent image)} {
update
} {}
-test canvImg-6.1 {ComputeImageBbox procedure} {
+test canvImg-6.1 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 15.51 17.51 -image foo -tags i1 -anchor nw
.c bbox i1
} {16 18 46 33}
-test canvImg-6.2 {ComputeImageBbox procedure} {
+test canvImg-6.2 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 15.49 17.49 -image foo -tags i1 -anchor nw
.c bbox i1
@@ -170,47 +161,47 @@ test canvImg-6.3 {ComputeImageBbox procedure} {
.c create image 20 30 -tags i1 -anchor nw
.c bbox i1
} {}
-test canvImg-6.4 {ComputeImageBbox procedure} {
+test canvImg-6.4 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor nw
.c bbox i1
} {20 30 50 45}
-test canvImg-6.5 {ComputeImageBbox procedure} {
+test canvImg-6.5 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor n
.c bbox i1
} {5 30 35 45}
-test canvImg-6.6 {ComputeImageBbox procedure} {
+test canvImg-6.6 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor ne
.c bbox i1
} {-10 30 20 45}
-test canvImg-6.7 {ComputeImageBbox procedure} {
+test canvImg-6.7 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor e
.c bbox i1
} {-10 23 20 38}
-test canvImg-6.8 {ComputeImageBbox procedure} {
+test canvImg-6.8 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor se
.c bbox i1
} {-10 15 20 30}
-test canvImg-6.9 {ComputeImageBbox procedure} {
+test canvImg-6.9 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor s
.c bbox i1
} {5 15 35 30}
-test canvImg-6.10 {ComputeImageBbox procedure} {
+test canvImg-6.10 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor sw
.c bbox i1
} {20 15 50 30}
-test canvImg-6.11 {ComputeImageBbox procedure} {
+test canvImg-6.11 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor w
.c bbox i1
} {20 23 50 38}
-test canvImg-6.12 {ComputeImageBbox procedure} {
+test canvImg-6.12 {ComputeImageBbox procedure} testImageType {
.c delete all
.c create image 20 30 -image foo -tags i1 -anchor center
.c bbox i1
@@ -219,7 +210,7 @@ test canvImg-6.12 {ComputeImageBbox procedure} {
# The following test is non-portable because of differences in
# coordinate rounding on some machines (does 0.5 round up?).
-test canvImg-7.1 {DisplayImage procedure} {nonPortable} {
+test canvImg-7.1 {DisplayImage procedure} {nonPortable testImageType} {
.c delete all
.c create image 50 100 -image foo -tags i1 -anchor nw
update
@@ -238,7 +229,9 @@ test canvImg-7.2 {DisplayImage procedure, no image} {
set i 1
.c delete all
-.c create image 50 100 -image foo -tags image -anchor nw
+if {[testConstraint testImageType]} {
+ .c create image 50 100 -image foo -tags image -anchor nw
+}
.c create rect 10 10 20 20 -tags rect -fill black -width 0 -outline {}
foreach check {
{{50 70 80 81} {70 90} {rect}}
@@ -260,7 +253,7 @@ foreach check {
{{60 70 69 109} {70 110} {image}}
{{60 70 71 111} {70 110} {rect}}
} {
- test canvImg-8.$i {ImageToPoint procedure} {
+ test canvImg-8.$i {ImageToPoint procedure} testImageType {
eval .c coords rect [lindex $check 0]
.c gettags [eval .c find closest [lindex $check 1]]
} [lindex $check 2]
@@ -268,94 +261,96 @@ foreach check {
}
.c delete all
-.c create image 50 100 -image foo -tags image -anchor nw
-test canvImg-8.19 {ImageToArea procedure} {
+if {[testConstraint testImageType]} {
+ .c create image 50 100 -image foo -tags image -anchor nw
+}
+test canvImg-8.19 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 60 0 70 99]
} {}
-test canvImg-8.20 {ImageToArea procedure} {
+test canvImg-8.20 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 60 0 70 99.999]
} {}
-test canvImg-8.21 {ImageToArea procedure} {
+test canvImg-8.21 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 60 0 70 101]
} {image}
-test canvImg-8.22 {ImageToArea procedure} {
+test canvImg-8.22 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 81 105 120 115]
} {}
-test canvImg-8.23 {ImageToArea procedure} {
+test canvImg-8.23 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 80.001 105 120 115]
} {}
-test canvImg-8.24 {ImageToArea procedure} {
+test canvImg-8.24 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 79 105 120 115]
} {image}
-test canvImg-8.25 {ImageToArea procedure} {
+test canvImg-8.25 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 60 116 70 150]
} {}
-test canvImg-8.26 {ImageToArea procedure} {
+test canvImg-8.26 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 60 115.001 70 150]
} {}
-test canvImg-8.27 {ImageToArea procedure} {
+test canvImg-8.27 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 60 114 70 150]
} {image}
-test canvImg-8.28 {ImageToArea procedure} {
+test canvImg-8.28 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 0 105 49 115]
} {}
-test canvImg-8.29 {ImageToArea procedure} {
+test canvImg-8.29 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 0 105 50 114.999]
} {}
-test canvImg-8.30 {ImageToArea procedure} {
+test canvImg-8.30 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 0 105 51 115]
} {image}
-test canvImg-8.31 {ImageToArea procedure} {
+test canvImg-8.31 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 0 0 49.999 99.999]
} {}
-test canvImg-8.32 {ImageToArea procedure} {
+test canvImg-8.32 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 0 0 51 101]
} {image}
-test canvImg-8.33 {ImageToArea procedure} {
+test canvImg-8.33 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 80 0 150 100]
} {}
-test canvImg-8.34 {ImageToArea procedure} {
+test canvImg-8.34 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 79 0 150 101]
} {image}
-test canvImg-8.35 {ImageToArea procedure} {
+test canvImg-8.35 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 80.001 115.001 150 180]
} {}
-test canvImg-8.36 {ImageToArea procedure} {
+test canvImg-8.36 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 79 114 150 180]
} {image}
-test canvImg-8.37 {ImageToArea procedure} {
+test canvImg-8.37 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 0 115 50 180]
} {}
-test canvImg-8.38 {ImageToArea procedure} {
+test canvImg-8.38 {ImageToArea procedure} testImageType {
.c gettags [.c find overlapping 0 114 51 180]
} {image}
-test canvImg-8.39 {ImageToArea procedure} {
+test canvImg-8.39 {ImageToArea procedure} testImageType {
.c gettags [.c find enclosed 0 0 200 200]
} {image}
-test canvImg-8.40 {ImageToArea procedure} {
+test canvImg-8.40 {ImageToArea procedure} testImageType {
.c gettags [.c find enclosed 49.999 99.999 80.001 115.001]
} {image}
-test canvImg-8.41 {ImageToArea procedure} {
+test canvImg-8.41 {ImageToArea procedure} testImageType {
.c gettags [.c find enclosed 51 100 80 115]
} {}
-test canvImg-8.42 {ImageToArea procedure} {
+test canvImg-8.42 {ImageToArea procedure} testImageType {
.c gettags [.c find enclosed 50 101 80 115]
} {}
-test canvImg-8.43 {ImageToArea procedure} {
+test canvImg-8.43 {ImageToArea procedure} testImageType {
.c gettags [.c find enclosed 50 100 79 115]
} {}
-test canvImg-8.44 {ImageToArea procedure} {
+test canvImg-8.44 {ImageToArea procedure} testImageType {
.c gettags [.c find enclosed 50 100 80 114]
} {}
-test canvImg-9.1 {DisplayImage procedure} {
+test canvImg-9.1 {DisplayImage procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags image -anchor nw
.c scale image 25 0 2.0 1.5
.c bbox image
} {75 150 105 165}
-test canvImg-10.1 {TranslateImage procedure} {
+test canvImg-10.1 {TranslateImage procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags image -anchor nw
update
@@ -365,7 +360,7 @@ test canvImg-10.1 {TranslateImage procedure} {
set x
} {{foo display 2 4 6 8 30 30}}
-test canvImg-11.1 {TranslateImage procedure} {
+test canvImg-11.1 {TranslateImage procedure} testImageType {
.c delete all
.c create image 50 100 -image foo -tags image -anchor nw
update
@@ -374,7 +369,7 @@ test canvImg-11.1 {TranslateImage procedure} {
update
set x
} {{foo display 0 0 40 50 30 30}}
-test canvImg-11.2 {ImageChangedProc procedure} {
+test canvImg-11.2 {ImageChangedProc procedure} testImageType {
.c delete all
image create test foo -variable x
.c create image 50 100 -image foo -tags image -anchor center
@@ -383,7 +378,7 @@ test canvImg-11.2 {ImageChangedProc procedure} {
foo changed 0 0 0 0 40 50
.c bbox image
} {30 75 70 125}
-test canvImg-11.3 {ImageChangedProc procedure} {
+test canvImg-11.3 {ImageChangedProc procedure} testImageType {
.c delete all
image create test foo -variable x
foo changed 0 0 0 0 40 50
diff --git a/tk/tests/canvPs.test b/tk/tests/canvPs.test
index 3c7cfe83f02..4eb50f88c3d 100644
--- a/tk/tests/canvPs.test
+++ b/tk/tests/canvPs.test
@@ -8,15 +8,15 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
canvas .c -width 400 -height 300 -bd 2 -relief sunken
.c create rectangle 20 20 80 80 -fill red
@@ -97,9 +97,7 @@ test canvPs-2.4 {test writing to channel and file, same output} {pcOnly} {
# cleanup
removeFile foo.ps
removeFile bar.ps
-foreach i [winfo children .] {
- destroy $i
-}
+deleteWindows
::tcltest::cleanupTests
return
diff --git a/tk/tests/canvPsImg.tcl b/tk/tests/canvPsImg.tcl
index 88a0648605b..043afa7cef8 100644
--- a/tk/tests/canvPsImg.tcl
+++ b/tk/tests/canvPsImg.tcl
@@ -69,7 +69,7 @@ foreach l { monochrome gray color } {
pack .t.$l -in .t.top.r -anchor w
}
-set BitmapImage [image create bitmap -file $tk_library/demos/images/face \
+set BitmapImage [image create bitmap -file $tk_library/demos/images/face.bmp \
-background white -foreground black]
set PhotoImage [image create photo -file $tk_library/demos/images/teapot.ppm]
@@ -82,4 +82,3 @@ button .t.file -text "Print to File" -command { FilePostscript .t.f.c }
button .t.print -text "Print" -command { PrintPostscript .t.f.c }
button .t.quit -text "Quit" -command { destroy .t }
pack .t.file .t.print .t.quit -in .t.bot -side left -fill x -expand 1
-
diff --git a/tk/tests/canvRect.test b/tk/tests/canvRect.test
index c83f5fc52d1..ad59f5c7afe 100644
--- a/tk/tests/canvRect.test
+++ b/tk/tests/canvRect.test
@@ -8,15 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
canvas .c -width 400 -height 300 -bd 2 -relief sunken
pack .c
diff --git a/tk/tests/canvText.test b/tk/tests/canvText.test
index 884a84223fc..ee271b5022a 100644
--- a/tk/tests/canvText.test
+++ b/tk/tests/canvText.test
@@ -8,15 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
canvas .c -width 400 -height 300 -bd 2 -relief sunken
pack .c
@@ -493,9 +490,9 @@ test canvText-17.1 {TextToPostscript procedure} {
} "/Courier-Oblique findfont [font actual $font -size] scalefont ISOEncode setfont
0.000 0.000 0.000 setrgbcolor AdjustColor
100 200 \[
-(000)
-(000)
-(00)
+\[(000)\]
+\[(000)\]
+\[(00)\]
] $ay -0.5 0 0 false DrawText
grestore
restore showpage
diff --git a/tk/tests/canvWind.test b/tk/tests/canvWind.test
index b408b0d9477..d0e6155fb03 100644
--- a/tk/tests/canvWind.test
+++ b/tk/tests/canvWind.test
@@ -8,15 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test canvWind-1.1 {DisplayWinItem, windows off-screen vertically} {
catch {destroy .t}
diff --git a/tk/tests/canvas.test b/tk/tests/canvas.test
index c4b76906ac3..2cde224e940 100644
--- a/tk/tests/canvas.test
+++ b/tk/tests/canvas.test
@@ -8,15 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# XXX - This test file is woefully incomplete. At present, only a
# few of the features are tested.
@@ -135,7 +132,7 @@ test canvas-3.2 {CanvasWidgetCmd, yview option} {
} {{0 0.5} {0.1 0.6}}
test canvas-4.1 {ButtonEventProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
canvas .c1 -bg #543210
rename .c1 .c2
set x {}
@@ -146,7 +143,7 @@ test canvas-4.1 {ButtonEventProc procedure} {
} {.c1 #543210 {} {}}
test canvas-5.1 {ButtonCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
canvas .c1
rename .c1 {}
list [info command .c*] [winfo children .]
@@ -196,7 +193,7 @@ test canvas-6.5 {CanvasSetOrigin procedure} {
} {55.0}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test canvas-7.1 {canvas widget vs hidden commands} {
catch {destroy .c}
@@ -366,8 +363,97 @@ test canvas-11.1 {canvas poly fill check, bug 5783} {
.c create polygon 0 0 100 100 200 50 \
-fill {} -stipple gray50 -outline black
} 1
+test canvas-11.2 {canvas poly overlap fill check, bug 226357} {
+ destroy .c
+ pack [canvas .c]
+ set result {}
+ .c create poly 30 30 90 90 30 90 90 30
+ lappend result [.c find over 40 40 45 45]; # rect region inc. edge
+ lappend result [.c find over 60 40 60 40]; # top-center point
+ lappend result [.c find over 0 0 0 0]; # not on poly
+ lappend result [.c find over 60 60 60 60]; # center-point
+ lappend result [.c find over 45 50 45 50]; # outside poly
+ .c itemconfig 1 -fill "" -outline black
+ lappend result [.c find over 40 40 45 45]; # rect region inc. edge
+ lappend result [.c find over 60 40 60 40]; # top-center point
+ lappend result [.c find over 0 0 0 0]; # not on poly
+ lappend result [.c find over 60 60 60 60]; # center-point
+ lappend result [.c find over 45 50 45 50]; # outside poly
+ .c itemconfig 1 -width 8
+ lappend result [.c find over 45 50 45 50]; # outside poly
+} {1 1 {} 1 {} 1 1 {} 1 {} 1}
+
+test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} {
+ destroy .c
+ pack [canvas .c]
+ set qx [expr {1.+1.}]
+ # qx has type double and no string representation
+ .c scale all $qx 0 1. 1.
+ # qx has now type MMRep and no string representation
+ list $qx [string length $qx]
+} {2.0 3}
+test canvas-12.2 {canvas mm obj, patch SF-403327, 102471} {
+ destroy .c
+ pack [canvas .c]
+ set val 10
+ incr val
+ # qx has type double and no string representation
+ .c scale all $val 0 1 1
+ # qx has now type MMRep and no string representation
+ incr val
+} {12}
+
+proc kill_canvas {w} {
+ destroy $w
+ pack [canvas $w -height 200 -width 200] -fill both -expand yes
+ update idle
+ $w create rectangle 80 80 120 120 -fill blue -tags blue
+ # bind a button press to re-build the canvas
+ $w bind blue <ButtonRelease-1> [subst {
+ [lindex [info level 0] 0] $w
+ append ::x ok
+ }
+ ]
+}
+
+test canvas-13.1 {canvas delete during event, SF bug-228024} {
+ kill_canvas .c
+ set ::x {}
+ # do this many times to improve chances of triggering the crash
+ for {set i 0} {$i < 30} {incr i} {
+ event generate .c <1> -x 100 -y 100
+ event generate .c <ButtonRelease-1> -x 100 -y 100
+ }
+ set ::x
+} okokokokokokokokokokokokokokokokokokokokokokokokokokokokokok
+
+test canvas-14.1 {canvas scan SF bug 581560} {
+ destroy .c; canvas .c
+ list [catch {.c scan} msg] $msg
+} {1 {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}}
+test canvas-14.2 {canvas scan} {
+ destroy .c; canvas .c
+ list [catch {.c scan bogus} msg] $msg
+} {1 {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}}
+test canvas-14.3 {canvas scan} {
+ destroy .c; canvas .c
+ list [catch {.c scan mark} msg] $msg
+} {1 {wrong # args: should be ".c scan mark|dragto x y ?dragGain?"}}
+test canvas-14.4 {canvas scan} {
+ destroy .c; canvas .c
+ list [catch {.c scan mark 10 10} msg] $msg
+} {0 {}}
+test canvas-14.5 {canvas scan} {
+ destroy .c; canvas .c
+ list [catch {.c scan mark 10 10 5} msg] $msg
+} {1 {wrong # args: should be ".c scan mark x y"}}
+test canvas-14.6 {canvas scan} {
+ destroy .c; canvas .c
+ list [catch {.c scan dragto 10 10 5} msg] $msg
+} {0 {}}
+
+destroy .c
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/choosedir.test b/tk/tests/choosedir.test
index 1b1d20ebd4d..799c07b7f70 100644
--- a/tk/tests/choosedir.test
+++ b/tk/tests/choosedir.test
@@ -8,10 +8,14 @@
# RCS: @(#) $Id$
#
-if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
- namespace import -force ::tcltest::*
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::makeDirectory
#----------------------------------------------------------------------
#
diff --git a/tk/tests/clipboard.test b/tk/tests/clipboard.test
index 240ae7e044f..b117169de33 100644
--- a/tk/tests/clipboard.test
+++ b/tk/tests/clipboard.test
@@ -13,11 +13,12 @@
# environment variable TK_ALT_DISPLAY is set to an alternate display.
#
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-eval destroy [winfo child .]
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# set up a very large buffer to test INCR retrievals
set longValue ""
@@ -31,13 +32,13 @@ foreach i {a b c d e f g j h i j k l m o p q r s t u v w x y z} {
test clipboard-1.1 {ClipboardHandler procedure} {
clipboard clear
clipboard append "test"
- selection get -s CLIPBOARD
+ clipboard get
} {test}
test clipboard-1.2 {ClipboardHandler procedure} {
clipboard clear
clipboard append "test"
clipboard append "ing"
- selection get -s CLIPBOARD
+ clipboard get
} {testing}
test clipboard-1.3 {ClipboardHandler procedure} {
clipboard clear
@@ -45,43 +46,43 @@ test clipboard-1.3 {ClipboardHandler procedure} {
clipboard append "e"
clipboard append "s"
clipboard append "t"
- selection get -s CLIPBOARD
+ clipboard get
} {test}
test clipboard-1.4 {ClipboardHandler procedure} {
clipboard clear
clipboard append $longValue
- selection get -s CLIPBOARD
+ clipboard get
} "$longValue"
test clipboard-1.5 {ClipboardHandler procedure} {
clipboard clear
clipboard append $longValue
clipboard append "test"
- selection get -s CLIPBOARD
+ clipboard get
} "${longValue}test"
test clipboard-1.6 {ClipboardHandler procedure} {
clipboard clear
clipboard append -t TEST $longValue
clipboard append -t STRING "test"
- list [selection get -s CLIPBOARD -t STRING] \
- [selection get -s CLIPBOARD -t TEST]
+ list [clipboard get -t STRING] \
+ [clipboard get -t TEST]
} [list test $longValue]
test clipboard-1.7 {ClipboardHandler procedure} {
clipboard clear
clipboard append -t TEST [string range $longValue 1 4000]
clipboard append -t STRING "test"
- list [selection get -s CLIPBOARD -t STRING] \
- [selection get -s CLIPBOARD -t TEST]
+ list [clipboard get -t STRING] \
+ [clipboard get -t TEST]
} [list test [string range $longValue 1 4000]]
test clipboard-1.8 {ClipboardHandler procedure} {
clipboard clear
clipboard append ""
- selection get -s CLIPBOARD
+ clipboard get
} {}
test clipboard-1.9 {ClipboardHandler procedure} {
clipboard clear
clipboard append ""
clipboard append "Test"
- selection get -s CLIPBOARD
+ clipboard get
} {Test}
##############################################################################
@@ -114,15 +115,15 @@ test clipboard-4.1 {ClipboardLostSel procedure} {
clipboard clear
clipboard append "Test"
selection clear -s CLIPBOARD
- list [catch {selection get -s CLIPBOARD} msg] $msg
+ list [catch {clipboard get} msg] $msg
} {1 {CLIPBOARD selection doesn't exist or form "STRING" not defined}}
test clipboard-4.2 {ClipboardLostSel procedure} {
clipboard clear
clipboard append "Test"
clipboard append -t TEST "Test2"
selection clear -s CLIPBOARD
- list [catch {selection get -s CLIPBOARD} msg] $msg \
- [catch {selection get -s CLIPBOARD -t TEST} msg] $msg
+ list [catch {clipboard get} msg] $msg \
+ [catch {clipboard get -t TEST} msg] $msg
} {1 {CLIPBOARD selection doesn't exist or form "STRING" not defined} 1 {CLIPBOARD selection doesn't exist or form "TEST" not defined}}
test clipboard-4.3 {ClipboardLostSel procedure} {
clipboard clear
@@ -130,8 +131,8 @@ test clipboard-4.3 {ClipboardLostSel procedure} {
clipboard append -t TEST "Test2"
clipboard append "Test3"
selection clear -s CLIPBOARD
- list [catch {selection get -s CLIPBOARD} msg] $msg \
- [catch {selection get -s CLIPBOARD -t TEST} msg] $msg
+ list [catch {clipboard get} msg] $msg \
+ [catch {clipboard get -t TEST} msg] $msg
} {1 {CLIPBOARD selection doesn't exist or form "STRING" not defined} 1 {CLIPBOARD selection doesn't exist or form "TEST" not defined}}
##############################################################################
@@ -139,19 +140,19 @@ test clipboard-4.3 {ClipboardLostSel procedure} {
test clipboard-5.1 {Tk_ClipboardClear procedure} {
clipboard clear
clipboard append -t TEST "test"
- set result [lsort [selection get -s CLIPBOARD TARGETS]]
+ set result [lsort [clipboard get TARGETS]]
clipboard clear
- list $result [lsort [selection get -s CLIPBOARD TARGETS]]
+ list $result [lsort [clipboard get TARGETS]]
} {{MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
test clipboard-5.2 {Tk_ClipboardClear procedure} {
clipboard clear
clipboard append -t TEST "test"
- set result [lsort [selection get -s CLIPBOARD TARGETS]]
+ set result [lsort [clipboard get TARGETS]]
selection own -s CLIPBOARD .
- lappend result [lsort [selection get -s CLIPBOARD TARGETS]]
+ lappend result [lsort [clipboard get TARGETS]]
clipboard clear
clipboard append -t TEST "test"
- lappend result [lsort [selection get -s CLIPBOARD TARGETS]]
+ lappend result [lsort [clipboard get TARGETS]]
} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
##############################################################################
@@ -162,14 +163,14 @@ test clipboard-6.1 {Tk_ClipboardAppend procedure} {
selection own -s CLIPBOARD .
list [catch {
clipboard append " second chunk"
- selection get -s CLIPBOARD
+ clipboard get
} msg] $msg
} {0 {first chunk second chunk}}
test clipboard-6.2 {Tk_ClipboardAppend procedure} {unixOnly} {
setupbg
clipboard clear
clipboard append -f INTEGER -t TEST "16"
- set result [dobg {selection get -s CLIPBOARD TEST}]
+ set result [dobg {clipboard get TEST}]
cleanupbg
set result
} {0x10}
@@ -196,7 +197,7 @@ test clipboard-7.3 {Tk_ClipboardCmd procedure} {
} {0 {} information}
test clipboard-7.4 {Tk_ClipboardCmd procedure} {
list [catch {clipboard append --x a b} msg] $msg
-} {1 {unknown option "--x"}}
+} {1 {bad option "--x": must be -displayof, -format, or -type}}
test clipboard-7.5 {Tk_ClipboardCmd procedure} {
list [catch {clipboard append -- a b} msg] $msg
} {1 {wrong # args: should be "clipboard append ?options? data"}}
@@ -207,7 +208,7 @@ test clipboard-7.6 {Tk_ClipboardCmd procedure} {
} {0 {} -format}
test clipboard-7.7 {Tk_ClipboardCmd procedure} {
list [catch {clipboard append -displayofoo f} msg] $msg
-} {1 {unknown option "-displayofoo"}}
+} {1 {bad option "-displayofoo": must be -displayof, -format, or -type}}
test clipboard-7.8 {Tk_ClipboardCmd procedure} {
list [catch {clipboard append -type TEST} msg] $msg
} {1 {wrong # args: should be "clipboard append ?options? data"}}
@@ -217,20 +218,31 @@ test clipboard-7.9 {Tk_ClipboardCmd procedure} {
test clipboard-7.10 {Tk_ClipboardCmd procedure} {
list [catch {clipboard clear -displayof} msg] $msg
-} {1 {value for "-displayof" missing}}
+} {1 {wrong # args: should be "clipboard clear ?-displayof window?"}}
test clipboard-7.11 {Tk_ClipboardCmd procedure} {
list [catch {clipboard clear -displayofoo f} msg] $msg
-} {1 {unknown option "-displayofoo"}}
+} {1 {bad option "-displayofoo": must be -displayof}}
test clipboard-7.12 {Tk_ClipboardCmd procedure} {
list [catch {clipboard clear foo} msg] $msg
-} {1 {wrong # args: should be "clipboard clear ?options?"}}
+} {1 {wrong # args: should be "clipboard clear ?-displayof window?"}}
test clipboard-7.13 {Tk_ClipboardCmd procedure} {
list [catch {clipboard clear -displayof foo} msg] $msg
} {1 {bad window path name "foo"}}
test clipboard-7.14 {Tk_ClipboardCmd procedure} {
list [catch {clipboard error} msg] $msg
-} {1 {bad option "error": must be clear or append}}
+} {1 {bad option "error": must be append, clear, or get}}
+
+test clipboard-7.15 {Tk_ClipboardCmd procedure} {
+ clipboard clear
+ list [catch {clipboard append -displayof} msg] $msg \
+ [selection get -selection CLIPBOARD]
+} {0 {} -displayof}
+test clipboard-7.16 {Tk_ClipboardCmd procedure} {
+ clipboard clear
+ list [catch {clipboard append -type} msg] $msg \
+ [selection get -selection CLIPBOARD]
+} {0 {} -type}
# cleanup
::tcltest::cleanupTests
diff --git a/tk/tests/clrpick.test b/tk/tests/clrpick.test
index 8bb7039c23c..4da9bfac72f 100644
--- a/tk/tests/clrpick.test
+++ b/tk/tests/clrpick.test
@@ -8,15 +8,12 @@
# RCS: @(#) $Id$
#
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-# Some tests require user interaction on non-unix platform
-
-set ::tcltest::testConfig(nonUnixUserInteraction) \
- [expr {$::tcltest::testConfig(userInteraction) || \
- $::tcltest::testConfig(unixOnly)}]
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test clrpick-1.1 {tk_chooseColor command} {
list [catch {tk_chooseColor -foo} msg] $msg
@@ -54,7 +51,7 @@ test clrpick-1.7 {tk_chooseColor command} {
list [catch {tk_chooseColor -initialcolor ##badbadbaadcolor} msg] $msg
} {1 {invalid color name "##badbadbaadcolor"}}
-if {[info commands tkColorDialog] == ""} {
+if {[info commands tk::dialog::color::] == ""} {
set isNative 1
} else {
set isNative 0
@@ -82,7 +79,7 @@ proc PressButton {btn} {
proc ChooseColorByKey {parent r g b} {
set w .__tk__color
- upvar #0 $w data
+ upvar ::tk::dialog::color::[winfo name $w] data
update
$data(red,entry) delete 0 end
@@ -96,14 +93,14 @@ proc ChooseColorByKey {parent r g b} {
# Manually force the refresh of the color values instead
# of counting on the timing of the event stream to change
# the values for us.
- tkColorDialog_HandleRGBEntry $w
+ tk::dialog::color::HandleRGBEntry $w
SendButtonPress $parent ok mouse
}
proc SendButtonPress {parent btn type} {
set w .__tk__color
- upvar #0 $w data
+ upvar ::tk::dialog::color::[winfo name $w] data
set button $data($btn\Btn)
if ![winfo ismapped $button] {
@@ -140,7 +137,7 @@ set verylongstring $verylongstring$verylongstring
# machines with small color palettes still fail.
# some tests will be skipped if there are no more colors
set numcolors 32
-set ::tcltest::testConfig(colorsLeftover) 1
+testConstraint colorsLeftover 1
set i 0
canvas .c
pack .c -expand 1 -fill both
@@ -158,7 +155,7 @@ while {$i<$numcolors} {
set g [expr $g/256]
set b [expr $b/256]
if {"$color" != "#[format %02x%02x%02x $r $g $b]"} {
- set ::tcltest::testConfig(colorsLeftover) 0
+ testConstraint colorsLeftover 0
}
}
.c delete $i
@@ -220,4 +217,3 @@ test clrpick-4.1 {tk_chooseColor: screen is inherited from parent} unixOnly {
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/cmds.test b/tk/tests/cmds.test
index cc86061ecab..9cba0c56e15 100644
--- a/tk/tests/cmds.test
+++ b/tk/tests/cmds.test
@@ -7,12 +7,13 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-eval destroy [winfo child .]
-wm geometry . {}
update
test cmds-1.1 {tkwait visibility, argument errors} {
diff --git a/tk/tests/color.test b/tk/tests/color.test
index a12b941127a..d9cf5f9a2f9 100644
--- a/tk/tests/color.test
+++ b/tk/tests/color.test
@@ -7,19 +7,14 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[info commands testcolor] != "testcolor"} {
- puts "testcolor command not available; skipping tests"
- ::tcltest::cleanupTests
- return
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+testConstraint testcolor [llength [info commands testcolor]]
# cname --
# Returns a proper name for a color, given its intensities.
@@ -102,39 +97,24 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} {
&& ([lindex $vals 2]/256 == $blue)
}
-# Create a top-level with its own colormap (so we can test under
-# controlled conditions), then check to make sure that the visual
-# is color-mapped with 256 colors. If not, just skip this whole
-# test file.
+if {[testConstraint psuedocolor8]} {
+ toplevel .t -visual {pseudocolor 8} -colormap new
+ wm geom .t +0+0
+ mkColors .t.c 40 6 0 0 0 0 6 0 0 0 40
+ pack .t.c
+ update
-if [catch {toplevel .t -visual {pseudocolor 8} -colormap new}] {
- ::tcltest::cleanupTests
- return
-}
-wm geom .t +0+0
-if {[winfo depth .t] != 8} {
- destroy .t
- ::tcltest::cleanupTests
- return
-}
-mkColors .t.c 40 6 0 0 0 0 6 0 0 0 40
-pack .t.c
-update
-if ![colorsFree .t.c 101 233 17] {
- destroy .t
- ::tcltest::cleanupTests
- return
-}
-mkColors .t.c2 20 1 250 0 0 -10 0 0 0 0 0
-pack .t.c2
-if [colorsFree .t.c] {
- destroy .t
- ::tcltest::cleanupTests
- return
+ testConstraint colorsFree [colorsFree .t.c 101 233 17]
+
+ if {[testConstraint colorsFree]} {
+ mkColors .t.c2 20 1 250 0 0 -10 0 0 0 0 0
+ pack .t.c2
+ testConstraint colorsFree [expr {![colorsFree .t.c]}]
+ }
+ destroy .t.c .t.c2
}
-destroy .t.c .t.c2
-test color-1.1 {Tk_AllocColorFromObj - converting internal reps} {
+test color-1.1 {Tk_AllocColorFromObj - converting internal reps} colorsFree {
set x green
lindex $x 0
destroy .b1
@@ -142,7 +122,7 @@ test color-1.1 {Tk_AllocColorFromObj - converting internal reps} {
lindex $x 0
testcolor green
} {{1 0}}
-test color-1.2 {Tk_AllocColorFromObj - discard stale color} {
+test color-1.2 {Tk_AllocColorFromObj - discard stale color} colorsFree {
set x green
destroy .b1 .b2
button .b1 -foreground $x -text First
@@ -152,7 +132,7 @@ test color-1.2 {Tk_AllocColorFromObj - discard stale color} {
button .b2 -foreground $x -text Second
lappend result [testcolor green]
} {{} {{1 1}}}
-test color-1.3 {Tk_AllocColorFromObj - reuse existing color} {
+test color-1.3 {Tk_AllocColorFromObj - reuse existing color} colorsFree {
set x green
destroy .b1 .b2
button .b1 -foreground $x -text First
@@ -162,7 +142,7 @@ test color-1.3 {Tk_AllocColorFromObj - reuse existing color} {
pack .b1 .b2 -side top
lappend result [testcolor green]
} {{{1 1}} {{2 1}}}
-test color-1.4 {Tk_AllocColorFromObj - try other colors in list} {
+test color-1.4 {Tk_AllocColorFromObj - try other colors in list} colorsFree {
set x purple
destroy .b1 .b2 .t.b
button .b1 -foreground $x -text First
@@ -177,26 +157,30 @@ test color-1.4 {Tk_AllocColorFromObj - try other colors in list} {
lappend result [testcolor purple]
} {{{1 1}} {{1 1} {1 0}} {{1 0} {2 1}}}
-test color-2.1 {Tk_GetColor procedure} {
+test color-2.1 {Tk_GetColor procedure} colorsFree {
c255 [winfo rgb .t #FF0000]
} {255 0 0}
-test color-2.2 {Tk_GetColor procedure} {
+test color-2.2 {Tk_GetColor procedure} colorsFree {
list [catch {winfo rgb .t noname} msg] $msg
} {1 {unknown color name "noname"}}
-test color-2.3 {Tk_GetColor procedure} {
+test color-2.3 {Tk_GetColor procedure} colorsFree {
c255 [winfo rgb .t #123456]
} {18 52 86}
-test color-2.4 {Tk_GetColor procedure} {
+test color-2.4 {Tk_GetColor procedure} colorsFree {
list [catch {winfo rgb .t #xyz} msg] $msg
} {1 {invalid color name "#xyz"}}
-test color-2.5 {Tk_GetColor procedure} {
+test color-2.5 {Tk_GetColor procedure} colorsFree {
winfo rgb .t #00FF00
} {0 65535 0}
-test color-2.6 {Tk_GetColor procedure} {
+test color-2.6 {Tk_GetColor procedure} {colorsFree nonPortable} {
+ # Red doesn't always map to *pure* red
winfo rgb .t red
} {65535 0 0}
+test color-2.7 {Tk_GetColor procedure} colorsFree {
+ winfo rgb .t #ff0000
+} {65535 0 0}
-test color-3.1 {Tk_FreeColor procedure, reference counting} {
+test color-3.1 {Tk_FreeColor procedure, reference counting} colorsFree {
eval destroy [winfo child .t]
mkColors .t.c 40 6 0 240 240 0 -6 0 0 0 -40
pack .t.c
@@ -210,7 +194,7 @@ test color-3.1 {Tk_FreeColor procedure, reference counting} {
.t.c2 delete $last
lappend result [colorsFree .t]
} {0 1}
-test color-3.2 {Tk_FreeColor procedure, flushing stressed cmap information} {
+test color-3.2 {Tk_FreeColor procedure, flushing stressed cmap information} colorsFree {
eval destroy [winfo child .t]
mkColors .t.c 40 6 0 240 240 0 -6 0 0 0 -40
pack .t.c
@@ -220,7 +204,7 @@ test color-3.2 {Tk_FreeColor procedure, flushing stressed cmap information} {
update
closest .t 241 241 1
} {240 240 0}
-test color-3.3 {Tk_FreeColorFromObj - reference counts} {
+test color-3.3 {Tk_FreeColorFromObj - reference counts} colorsFree {
set x purple
destroy .b1 .b2 .t.b
button .b1 -foreground $x -text First
@@ -238,7 +222,7 @@ test color-3.3 {Tk_FreeColorFromObj - reference counts} {
destroy .t.b
lappend result [testcolor purple]
} {{{1 0} {2 1}} {{1 0} {1 1}} {{1 0}} {}}
-test color-3.4 {Tk_FreeColorFromObj - unlinking from list} {
+test color-3.4 {Tk_FreeColorFromObj - unlinking from list} colorsFree {
destroy .b .t.b .t2 .t3
toplevel .t2 -visual {pseudocolor 8} -colormap new
toplevel .t3 -visual {pseudocolor 8} -colormap new
@@ -265,7 +249,7 @@ test color-3.4 {Tk_FreeColorFromObj - unlinking from list} {
lappend result [testcolor purple]
} {{{4 1} {3 0} {2 0} {1 0}} {{4 1} {2 0} {1 0}} {{4 1} {2 0}} {{2 0}} {}}
-test color-4.1 {FreeColorObjProc} {
+test color-4.1 {FreeColorObjProc} colorsFree {
destroy .b
set x [format purple]
button .b -foreground $x -text .b1
@@ -290,4 +274,3 @@ destroy .t
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/config.test b/tk/tests/config.test
index f5e4b0c6699..f6b1d1f89f3 100644
--- a/tk/tests/config.test
+++ b/tk/tests/config.test
@@ -8,17 +8,14 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-if {[info command testobjconfig] != "testobjconfig"} {
- puts "This application hasn't been compiled with the \"testobjconfig\""
- puts "command, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
+testConstraint testobjconfig [llength [info commands testobjconfig]]
proc killTables {} {
# Note: it's important to delete chain2 before chain1, because
@@ -33,79 +30,76 @@ proc killTables {} {
}
}
-foreach i [winfo children .] {
- destroy $i
+if {[testConstraint testobjconfig]} {
+ killTables
}
-killTables
-wm geometry . {}
-raise .
-test config-1.1 {Tk_CreateOptionTable - reference counts} {
- eval destroy [winfo children .]
+test config-1.1 {Tk_CreateOptionTable - reference counts} testobjconfig {
+ deleteWindows
killTables
set x {}
testobjconfig alltypes .a
lappend x [testobjconfig info alltypes]
testobjconfig alltypes .b
lappend x [testobjconfig info alltypes]
- eval destroy [winfo children .]
+ deleteWindows
set x
-} {{1 15 -boolean} {2 15 -boolean}}
-test config-1.2 {Tk_CreateOptionTable - synonym initialization} {
- eval destroy [winfo children .]
+} {{1 16 -boolean} {2 16 -boolean}}
+test config-1.2 {Tk_CreateOptionTable - synonym initialization} testobjconfig {
+ deleteWindows
testobjconfig alltypes .a -synonym green
.a cget -color
} {green}
-test config-1.3 {Tk_CreateOptionTable - option database initialization} {
- eval destroy [winfo children .]
+test config-1.3 {Tk_CreateOptionTable - option database initialization} testobjconfig {
+ deleteWindows
option clear
testobjconfig alltypes .a
option add *b.string different
testobjconfig alltypes .b
list [.a cget -string] [.b cget -string]
} {foo different}
-test config-1.4 {Tk_CreateOptionTable - option database initialization} {
- eval destroy [winfo children .]
+test config-1.4 {Tk_CreateOptionTable - option database initialization} testobjconfig {
+ deleteWindows
option clear
testobjconfig alltypes .a
option add *b.String bar
testobjconfig alltypes .b
list [.a cget -string] [.b cget -string]
} {foo bar}
-test config-1.5 {Tk_CreateOptionTable - default initialization} {
- eval destroy [winfo children .]
+test config-1.5 {Tk_CreateOptionTable - default initialization} testobjconfig {
+ deleteWindows
testobjconfig alltypes .a
.a cget -relief
} {raised}
-test config-1.6 {Tk_CreateOptionTable - chained tables} {
- eval destroy [winfo children .]
+test config-1.6 {Tk_CreateOptionTable - chained tables} testobjconfig {
+ deleteWindows
killTables
testobjconfig chain1 .a
testobjconfig chain2 .b
testobjconfig info chain2
} {1 4 -three 2 2 -one}
-test config-1.7 {Tk_CreateOptionTable - chained tables} {
- eval destroy [winfo children .]
+test config-1.7 {Tk_CreateOptionTable - chained tables} testobjconfig {
+ deleteWindows
killTables
testobjconfig chain2 .b
testobjconfig chain1 .a
testobjconfig info chain2
} {1 4 -three 2 2 -one}
-test config-1.8 {Tk_CreateOptionTable - chained tables} {
- eval destroy [winfo children .]
+test config-1.8 {Tk_CreateOptionTable - chained tables} testobjconfig {
+ deleteWindows
testobjconfig chain1 .a
testobjconfig chain2 .b
list [catch {.a cget -four} msg] $msg [.a cget -one] \
[.b cget -four] [.b cget -one]
} {1 {unknown option "-four"} one four one}
-test config-2.1 {Tk_DeleteOptionTable - reference counts} {
- eval destroy [winfo children .]
+test config-2.1 {Tk_DeleteOptionTable - reference counts} testobjconfig {
+ deleteWindows
killTables
testobjconfig chain1 .a
testobjconfig chain2 .b
testobjconfig chain2 .c
- eval destroy [winfo children .]
+ deleteWindows
set x {}
testobjconfig delete chain2
lappend x [testobjconfig info chain2] [testobjconfig info chain1]
@@ -115,38 +109,38 @@ test config-2.1 {Tk_DeleteOptionTable - reference counts} {
# No tests for DestroyOptionHashTable; couldn't figure out how to test.
-test config-3.1 {Tk_InitOptions - priority of chained tables} {
- eval destroy [winfo children .]
+test config-3.1 {Tk_InitOptions - priority of chained tables} testobjconfig {
+ deleteWindows
testobjconfig chain1 .a
testobjconfig chain2 .b
list [.a cget -two] [.b cget -two]
} {two {two and a half}}
-test config-3.2 {Tk_InitOptions - initialize from database} {
- eval destroy [winfo children .]
+test config-3.2 {Tk_InitOptions - initialize from database} testobjconfig {
+ deleteWindows
option clear
option add *a.color blue
testobjconfig alltypes .a
list [.a cget -color]
} {blue}
-test config-3.3 {Tk_InitOptions - initialize from database} {
- eval destroy [winfo children .]
+test config-3.3 {Tk_InitOptions - initialize from database} testobjconfig {
+ deleteWindows
option clear
option add *a.justify bogus
testobjconfig alltypes .a
list [.a cget -justify]
} {left}
-test config-3.4 {Tk_InitOptions - initialize from widget class} {
- eval destroy [winfo children .]
+test config-3.4 {Tk_InitOptions - initialize from widget class} testobjconfig {
+ deleteWindows
testobjconfig alltypes .a
list [.a cget -color]
} {red}
-test config-3.5 {Tk_InitOptions - no initial value} {
- eval destroy [winfo children .]
+test config-3.5 {Tk_InitOptions - no initial value} testobjconfig {
+ deleteWindows
testobjconfig alltypes .a
.a cget -anchor
} {}
-test config-3.6 {Tk_InitOptions - bad initial value} {
- eval destroy [winfo children .]
+test config-3.6 {Tk_InitOptions - bad initial value} testobjconfig {
+ deleteWindows
option clear
option add *a.color non-existent
list [catch {testobjconfig alltypes .a} msg] $msg $errorInfo
@@ -155,8 +149,8 @@ test config-3.6 {Tk_InitOptions - bad initial value} {
invoked from within
"testobjconfig alltypes .a"}}
option clear
-test config-3.7 {Tk_InitOptions - bad initial value} {
- eval destroy [winfo children .]
+test config-3.7 {Tk_InitOptions - bad initial value} testobjconfig {
+ deleteWindows
list [catch {testobjconfig configerror} msg] $msg $errorInfo
} {1 {expected integer but got "bogus"} {expected integer but got "bogus"
(default value for "-int")
@@ -164,280 +158,280 @@ test config-3.7 {Tk_InitOptions - bad initial value} {
"testobjconfig configerror"}}
option clear
-test config-4.1 {DoObjConfig - boolean} {
+test config-4.1 {DoObjConfig - boolean} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -boolean 0} msg] $msg [catch {.foo cget -boolean} result] $result [catch {rename .foo {}}]
} {0 .foo 0 0 0}
-test config-4.2 {DoObjConfig - boolean} {
+test config-4.2 {DoObjConfig - boolean} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -boolean 1} msg] $msg [catch {.foo cget -boolean} result] $result [catch {rename .foo {}}]
} {0 .foo 0 1 0}
-test config-4.3 {DoObjConfig - invalid boolean} {
+test config-4.3 {DoObjConfig - invalid boolean} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -boolean {}} msg] $msg
} {1 {expected boolean value but got ""}}
-test config-4.4 {DoObjConfig - boolean internal value} {
+test config-4.4 {DoObjConfig - boolean internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -boolean 0
.foo cget -boolean
} {0}
-test config-4.5 {DoObjConfig - integer} {
+test config-4.5 {DoObjConfig - integer} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -integer 3} msg] $msg [catch {.foo cget -integer} result] $result [catch {rename .foo {}}]
} {0 .foo 0 3 0}
-test config-4.6 {DoObjConfig - invalid integer} {
+test config-4.6 {DoObjConfig - invalid integer} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -integer bar} msg] $msg
} {1 {expected integer but got "bar"}}
-test config-4.7 {DoObjConfig - integer internal value} {
+test config-4.7 {DoObjConfig - integer internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -integer 421
.foo cget -integer
} {421}
-test config-4.8 {DoObjConfig - double} {
+test config-4.8 {DoObjConfig - double} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -double 3.14} msg] $msg [catch {.foo cget -double} result] $result [catch {rename .foo {}}]
} {0 .foo 0 3.14 0}
-test config-4.9 {DoObjConfig - invalid double} {
+test config-4.9 {DoObjConfig - invalid double} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -double bar} msg] $msg
} {1 {expected floating-point number but got "bar"}}
-test config-4.10 {DoObjConfig - double internal value} {
+test config-4.10 {DoObjConfig - double internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -double 62.75
.foo cget -double
} {62.75}
-test config-4.11 {DoObjConfig - string} {
+test config-4.11 {DoObjConfig - string} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -string test} msg] $msg [catch {.foo cget -string} result] $result [destroy .foo]
} {0 .foo 0 test {}}
-test config-4.12 {DoObjConfig - null string} {
+test config-4.12 {DoObjConfig - null string} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -string {}} msg] $msg [catch {.foo cget -string} result] $result [destroy .foo]
} {0 .foo 0 {} {}}
-test config-4.13 {DoObjConfig - string internal value} {
+test config-4.13 {DoObjConfig - string internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -string "this is a test"
.foo cget -string
} {this is a test}
-test config-4.14 {DoObjConfig - string table} {
+test config-4.14 {DoObjConfig - string table} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -stringtable two} msg] $msg [catch {.foo cget -stringtable} result] $result [destroy .foo]
} {0 .foo 0 two {}}
-test config-4.15 {DoObjConfig - invalid string table} {
+test config-4.15 {DoObjConfig - invalid string table} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -stringtable foo} msg] $msg
} {1 {bad stringtable "foo": must be one, two, three, or four}}
-test config-4.16 {DoObjConfig - new string table} {
+test config-4.16 {DoObjConfig - new string table} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -stringtable two
list [catch {.foo configure -stringtable three} msg] $msg [catch {.foo cget -stringtable} result] $result [destroy .foo]
} {0 16 0 three {}}
-test config-4.17 {DoObjConfig - stringtable internal value} {
+test config-4.17 {DoObjConfig - stringtable internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -stringtable "four"
.foo cget -stringtable
} {four}
-test config-4.18 {DoObjConfig - color} {
+test config-4.18 {DoObjConfig - color} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -color blue} msg] $msg [catch {.foo cget -color} result] $result [destroy .foo]
} {0 .foo 0 blue {}}
-test config-4.19 {DoObjConfig - invalid color} {
+test config-4.19 {DoObjConfig - invalid color} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -color xxx} msg] $msg
} {1 {unknown color name "xxx"}}
-test config-4.20 {DoObjConfig - color internal value} {
+test config-4.20 {DoObjConfig - color internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -color purple
.foo cget -color
} {purple}
-test config-4.21 {DoObjConfig - null color} {
+test config-4.21 {DoObjConfig - null color} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -color {}} msg] $msg [catch {.foo cget -color} result] $result [destroy .foo]
} {0 .foo 0 {} {}}
-test config-4.22 {DoObjConfig - getting rid of old color} {
+test config-4.22 {DoObjConfig - getting rid of old color} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -color #333333
list [catch {.foo configure -color #444444} msg] $msg [catch {.foo cget -color} result] $result [destroy .foo]
} {0 32 0 #444444 {}}
-test config-4.23 {DoObjConfig - font} {
+test config-4.23 {DoObjConfig - font} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -font {Helvetica 72}} msg] $msg [catch {.foo cget -font} result] $result [destroy .foo]
} {0 .foo 0 {Helvetica 72} {}}
-test config-4.24 {DoObjConfig - new font} {
+test config-4.24 {DoObjConfig - new font} testobjconfig {
catch {rename .foo {}}
testobjconfig alltypes .foo -font {Courier 12}
list [catch {.foo configure -font {Helvetica 72}} msg] $msg [catch {.foo cget -font} result] $result [destroy .foo]
} {0 64 0 {Helvetica 72} {}}
-test config-4.25 {DoObjConfig - invalid font} {
+test config-4.25 {DoObjConfig - invalid font} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -font {Helvetica 12 foo}} msg] $msg
} {1 {unknown font style "foo"}}
-test config-4.26 {DoObjConfig - null font} {
+test config-4.26 {DoObjConfig - null font} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -font {}} msg] $msg [catch {.foo cget -font} result] $result [destroy .foo]
} {0 .foo 0 {} {}}
-test config-4.27 {DoObjConfig - font internal value} {
+test config-4.27 {DoObjConfig - font internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -font {Times 16}
.foo cget -font
} {Times 16}
-test config-4.28 {DoObjConfig - bitmap} {
+test config-4.28 {DoObjConfig - bitmap} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -bitmap gray75} msg] $msg [catch {.foo cget -bitmap} result] $result [destroy .foo]
} {0 .foo 0 gray75 {}}
-test config-4.29 {DoObjConfig - new bitmap} {
+test config-4.29 {DoObjConfig - new bitmap} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -bitmap gray75
list [catch {.foo configure -bitmap gray50} msg] $msg [catch {.foo cget -bitmap} result] $result [destroy .foo]
} {0 128 0 gray50 {}}
-test config-4.30 {DoObjConfig - invalid bitmap} {
+test config-4.30 {DoObjConfig - invalid bitmap} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -bitmap foo} msg] $msg
} {1 {bitmap "foo" not defined}}
-test config-4.31 {DoObjConfig - null bitmap} {
+test config-4.31 {DoObjConfig - null bitmap} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -bitmap {}} msg] $msg [catch {.foo cget -bitmap} result] $result [destroy .foo]
} {0 .foo 0 {} {}}
-test config-4.32 {DoObjConfig - bitmap internal value} {
+test config-4.32 {DoObjConfig - bitmap internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -bitmap gray25
.foo cget -bitmap
} {gray25}
-test config-4.33 {DoObjConfig - border} {
+test config-4.33 {DoObjConfig - border} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -border green} msg] $msg [catch {.foo cget -border} result] $result [destroy .foo]
} {0 .foo 0 green {}}
-test config-4.34 {DoObjConfig - invalid border} {
+test config-4.34 {DoObjConfig - invalid border} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -border xxx} msg] $msg
} {1 {unknown color name "xxx"}}
-test config-4.35 {DoObjConfig - null border} {
+test config-4.35 {DoObjConfig - null border} testobjconfig {
catch {rename .foo {}}
list [catch {testobjconfig alltypes .foo -border {}} msg] $msg [catch {.foo cget -border} result] $result [destroy .foo]
} {0 .foo 0 {} {}}
-test config-4.36 {DoObjConfig - border internal value} {
+test config-4.36 {DoObjConfig - border internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -border #123456
.foo cget -border
} {#123456}
-test config-4.37 {DoObjConfig - getting rid of old border} {
+test config-4.37 {DoObjConfig - getting rid of old border} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -border #333333
list [catch {.foo configure -border #444444} msg] $msg [catch {.foo cget -border} result] $result [destroy .foo]
} {0 256 0 #444444 {}}
-test config-4.38 {DoObjConfig - relief} {
+test config-4.38 {DoObjConfig - relief} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -relief flat} msg] $msg [catch {.foo cget -relief} result] $result [destroy .foo]
} {0 .foo 0 flat {}}
-test config-4.39 {DoObjConfig - invalid relief} {
+test config-4.39 {DoObjConfig - invalid relief} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -relief foo} msg] $msg
} {1 {bad relief "foo": must be flat, groove, raised, ridge, solid, or sunken}}
-test config-4.40 {DoObjConfig - new relief} {
+test config-4.40 {DoObjConfig - new relief} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -relief raised
list [catch {.foo configure -relief flat} msg] $msg [catch {.foo cget -relief} result] $result [destroy .foo]
} {0 512 0 flat {}}
-test config-4.41 {DoObjConfig - relief internal value} {
+test config-4.41 {DoObjConfig - relief internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -relief ridge
.foo cget -relief
} {ridge}
-test config-4.42 {DoObjConfig - cursor} {
+test config-4.42 {DoObjConfig - cursor} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -cursor arrow} msg] $msg [catch {.foo cget -cursor} result] $result [destroy .foo]
} {0 .foo 0 arrow {}}
-test config-4.43 {DoObjConfig - invalid cursor} {
+test config-4.43 {DoObjConfig - invalid cursor} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -cursor foo} msg] $msg
} {1 {bad cursor spec "foo"}}
-test config-4.44 {DoObjConfig - null cursor} {
+test config-4.44 {DoObjConfig - null cursor} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -cursor {}} msg] $msg [catch {.foo cget -cursor} result] $result [destroy .foo]
} {0 .foo 0 {} {}}
-test config-4.45 {DoObjConfig - new cursor} {
+test config-4.45 {DoObjConfig - new cursor} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -cursor xterm
list [catch {.foo configure -cursor arrow} msg] $msg [catch {.foo cget -cursor} result] $result [destroy .foo]
} {0 1024 0 arrow {}}
-test config-4.46 {DoObjConfig - cursor internal value} {
+test config-4.46 {DoObjConfig - cursor internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -cursor watch
.foo cget -cursor
} {watch}
-test config-4.47 {DoObjConfig - justify} {
+test config-4.47 {DoObjConfig - justify} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -justify center} msg] $msg [catch {.foo cget -justify} result] $result [destroy .foo]
} {0 .foo 0 center {}}
-test config-4.48 {DoObjConfig - invalid justify} {
+test config-4.48 {DoObjConfig - invalid justify} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -justify foo} msg] $msg
} {1 {bad justification "foo": must be left, right, or center}}
-test config-4.49 {DoObjConfig - new justify} {
+test config-4.49 {DoObjConfig - new justify} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -justify left
list [catch {.foo configure -justify right} msg] $msg [catch {.foo cget -justify} result] $result [destroy .foo]
} {0 2048 0 right {}}
-test config-4.50 {DoObjConfig - justify internal value} {
+test config-4.50 {DoObjConfig - justify internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -justify center
.foo cget -justify
} {center}
-test config-4.51 {DoObjConfig - anchor} {
+test config-4.51 {DoObjConfig - anchor} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -anchor center} msg] $msg [catch {.foo cget -anchor} result] $result [destroy .foo]
} {0 .foo 0 center {}}
-test config-4.52 {DoObjConfig - invalid anchor} {
+test config-4.52 {DoObjConfig - invalid anchor} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -anchor foo} msg] $msg
} {1 {bad anchor "foo": must be n, ne, e, se, s, sw, w, nw, or center}}
-test config-4.53 {DoObjConfig - new anchor} {
+test config-4.53 {DoObjConfig - new anchor} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -anchor e
list [catch {.foo configure -anchor n} msg] $msg [catch {.foo cget -anchor} result] $result [destroy .foo]
} {0 4096 0 n {}}
-test config-4.54 {DoObjConfig - anchor internal value} {
+test config-4.54 {DoObjConfig - anchor internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -anchor sw
.foo cget -anchor
} {sw}
-test config-4.55 {DoObjConfig - pixel} {
+test config-4.55 {DoObjConfig - pixel} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -pixel 42} msg] $msg [catch {.foo cget -pixel} result] $result [destroy .foo]
} {0 .foo 0 42 {}}
-test config-4.56 {DoObjConfig - invalid pixel} {
+test config-4.56 {DoObjConfig - invalid pixel} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -pixel foo} msg] $msg
} {1 {bad screen distance "foo"}}
-test config-4.57 {DoObjConfig - new pixel} {
+test config-4.57 {DoObjConfig - new pixel} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -pixel 42m
list [catch {.foo configure -pixel 3c} msg] $msg [catch {.foo cget -pixel} result] $result [destroy .foo]
} {0 8192 0 3c {}}
-test config-4.58 {DoObjConfig - pixel internal value} {
+test config-4.58 {DoObjConfig - pixel internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -pixel [winfo screenmmwidth .]m
.foo cget -pixel
} [winfo screenwidth .]
-test config-4.59 {DoObjConfig - window} {
+test config-4.59 {DoObjConfig - window} testobjconfig {
catch {destroy .foo}
catch {destroy .bar}
toplevel .bar
list [catch {testobjconfig twowindows .foo -window .bar} msg] $msg [catch {.foo cget -window} result] $result [destroy .foo] [destroy .bar]
} {0 .foo 0 .bar {} {}}
-test config-4.60 {DoObjConfig - invalid window} {
+test config-4.60 {DoObjConfig - invalid window} testobjconfig {
catch {destroy .foo}
toplevel .bar
list [catch {testobjconfig twowindows .foo -window foo} msg] $msg [destroy .bar]
} {1 {bad window path name "foo"} {}}
-test config-4.61 {DoObjConfig - null window} {
+test config-4.61 {DoObjConfig - null window} testobjconfig {
catch {destroy .foo}
catch {destroy .bar}
toplevel .bar
list [catch {testobjconfig twowindows .foo -window {}} msg] $msg [catch {.foo cget -window} result] $result [destroy .foo]
} {0 .foo 0 {} {}}
-test config-4.62 {DoObjConfig - new window} {
+test config-4.62 {DoObjConfig - new window} testobjconfig {
catch {destroy .foo}
catch {destroy .bar}
catch {destroy .blamph}
@@ -446,377 +440,423 @@ test config-4.62 {DoObjConfig - new window} {
testobjconfig twowindows .foo -window .bar
list [catch {.foo configure -window .blamph} msg] $msg [catch {.foo cget -window} result] $result [destroy .foo] [destroy .bar] [destroy .blamph]
} {0 0 0 .blamph {} {} {}}
-test config-4.63 {DoObjConfig - window internal value} {
+test config-4.63 {DoObjConfig - window internal value} testobjconfig {
catch {rename .foo {}}
testobjconfig internal .foo -window .
.foo cget -window
} {.}
-test config-4.64 {DoObjConfig - releasing old values} {
+test config-4.64 {DoObjConfig - releasing old values} testobjconfig {
# This test doesn't generate a useful value to check; if an
# error occurs, it will be detected only by memory checking software
# such as Purify or Tcl's built-in checker.
catch {rename .foo {}}
testobjconfig alltypes .foo -string {Test string} -color yellow \
- -font {Courier 18} -bitmap questhead -border green -cursor cross
+ -font {Courier 18} -bitmap questhead -border green -cursor cross \
+ -custom foobar
.foo configure -string {new string} -color brown \
- -font {Times 8} -bitmap gray75 -border pink -cursor watch
+ -font {Times 8} -bitmap gray75 -border pink -cursor watch \
+ -custom barbaz
concat {}
} {}
-test config-4.65 {DoObjConfig - releasing old values} {
+test config-4.65 {DoObjConfig - releasing old values} testobjconfig {
# This test doesn't generate a useful value to check; if an
# error occurs, it will be detected only by memory checking software
# such as Purify or Tcl's built-in checker.
catch {rename .foo {}}
testobjconfig internal .foo -string {Test string} -color yellow \
- -font {Courier 18} -bitmap questhead -border green -cursor cross
+ -font {Courier 18} -bitmap questhead -border green -cursor cross \
+ -custom foobar
.foo configure -string {new string} -color brown \
- -font {Times 8} -bitmap gray75 -border pink -cursor watch
+ -font {Times 8} -bitmap gray75 -border pink -cursor watch \
+ -custom barbaz
concat {}
} {}
+test config-4.66 {DoObjConfig - custom} testobjconfig {
+ catch {destroy .foo}
+ list [catch {testobjconfig alltypes .foo -custom test} msg] $msg [catch {.foo cget -custom} result] $result [destroy .foo]
+} {0 .foo 0 TEST {}}
+test config-4.67 {DoObjConfig - null custom} testobjconfig {
+ catch {destroy .foo}
+ list [catch {testobjconfig alltypes .foo -custom {}} msg] $msg [catch {.foo cget -custom} result] $result [destroy .foo]
+} {0 .foo 0 {} {}}
+test config-4.68 {DoObjConfig - custom internal value} testobjconfig {
+ catch {rename .foo {}}
+ testobjconfig internal .foo -custom "this is a test"
+ .foo cget -custom
+} {THIS IS A TEST}
-test config-5.1 {ObjectIsEmpty - object is already string} {
+test config-5.1 {ObjectIsEmpty - object is already string} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -color [format ""]
.foo cget -color
} {}
-test config-5.2 {ObjectIsEmpty - object is already string} {
+test config-5.2 {ObjectIsEmpty - object is already string} testobjconfig {
catch {destroy .foo}
list [catch {testobjconfig alltypes .foo -color [format " "]} msg] $msg
} {1 {unknown color name " "}}
-test config-5.3 {ObjectIsEmpty - must convert back to string} {
+test config-5.3 {ObjectIsEmpty - must convert back to string} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -color [list]
.foo cget -color
} {}
-eval destroy [winfo children .]
-testobjconfig chain2 .a
-testobjconfig alltypes .b
-test config-6.1 {GetOptionFromObj - cached answer} {
+deleteWindows
+if {[testConstraint testobjconfig]} {
+ testobjconfig chain2 .a
+ testobjconfig alltypes .b
+}
+test config-6.1 {GetOptionFromObj - cached answer} testobjconfig {
list [.a cget -three] [.a cget -three]
} {three three}
-test config-6.2 {GetOptionFromObj - exact match} {
+test config-6.2 {GetOptionFromObj - exact match} testobjconfig {
.a cget -one
} {one}
-test config-6.3 {GetOptionFromObj - abbreviation} {
+test config-6.3 {GetOptionFromObj - abbreviation} testobjconfig {
.a cget -fo
} {four}
-test config-6.4 {GetOptionFromObj - ambiguous abbreviation} {
+test config-6.4 {GetOptionFromObj - ambiguous abbreviation} testobjconfig {
list [catch {.a cget -on} msg] $msg
} {1 {unknown option "-on"}}
-test config-6.5 {GetOptionFromObj - duplicate options in different tables} {
+test config-6.5 {GetOptionFromObj - duplicate options in different tables} testobjconfig {
.a cget -tw
} {two and a half}
-test config-6.6 {GetOptionFromObj - synonym} {
+test config-6.6 {GetOptionFromObj - synonym} testobjconfig {
.b cget -synonym
} {red}
-eval destroy [winfo children .]
-testobjconfig alltypes .a
-test config-7.1 {Tk_SetOptions - basics} {
+deleteWindows
+if {[testConstraint testobjconfig]} {
+ testobjconfig alltypes .a
+}
+test config-7.1 {Tk_SetOptions - basics} testobjconfig {
.a configure -color green -rel sunken
list [.a cget -color] [.a cget -relief]
} {green sunken}
-test config-7.2 {Tk_SetOptions - bogus option name} {
+test config-7.2 {Tk_SetOptions - bogus option name} testobjconfig {
list [catch {.a configure -bogus} msg] $msg
} {1 {unknown option "-bogus"}}
-test config-7.3 {Tk_SetOptions - synonym} {
+test config-7.3 {Tk_SetOptions - synonym} testobjconfig {
.a configure -synonym blue
.a cget -color
} {blue}
-test config-7.4 {Tk_SetOptions - missing value} {
+test config-7.4 {Tk_SetOptions - missing value} testobjconfig {
list [catch {.a configure -color green -relief} msg] $msg [.a cget -color]
} {1 {value for "-relief" missing} green}
-test config-7.5 {Tk_SetOptions - saving old values} {
+test config-7.5 {Tk_SetOptions - saving old values} testobjconfig {
.a configure -color red -int 7 -relief raised -double 3.14159
list [catch {.a csave -color green -int 432 -relief sunken \
-double 2.0 -color bogus} msg] $msg [.a cget -color] \
[.a cget -int] [.a cget -relief] [.a cget -double]
} {1 {unknown color name "bogus"} red 7 raised 3.14159}
-test config-7.6 {Tk_SetOptions - error in DoObjConfig call} {
+test config-7.6 {Tk_SetOptions - error in DoObjConfig call} testobjconfig {
list [catch {.a configure -color bogus} msg] $msg $errorInfo
} {1 {unknown color name "bogus"} {unknown color name "bogus"
(processing "-color" option)
invoked from within
".a configure -color bogus"}}
-test config-7.7 {Tk_SetOptions - synonym name in error message} {
+test config-7.7 {Tk_SetOptions - synonym name in error message} testobjconfig {
list [catch {.a configure -synonym bogus} msg] $msg $errorInfo
} {1 {unknown color name "bogus"} {unknown color name "bogus"
(processing "-synonym" option)
invoked from within
".a configure -synonym bogus"}}
-test config-7.8 {Tk_SetOptions - returning mask} {
+test config-7.8 {Tk_SetOptions - returning mask} testobjconfig {
format %x [.a configure -color red -int 7 -relief raised -double 3.14159]
} {226}
+test config-7.9 {Tk_SetOptions - error in DoObjConfig with custom option} testobjconfig {
+ list [catch {.a configure -custom bad} msg] $msg $errorInfo
+} {1 {expected good value, got "BAD"} {expected good value, got "BAD"
+ (processing "-custom" option)
+ invoked from within
+".a configure -custom bad"}}
-test config-8.1 {Tk_RestoreSavedOptions - restore in proper order} {
- eval destroy [winfo children .]
+test config-8.1 {Tk_RestoreSavedOptions - restore in proper order} testobjconfig {
+ deleteWindows
testobjconfig alltypes .a
list [catch {.a csave -color green -color black -color blue \
-color #ffff00 -color #ff00ff -color bogus} msg] $msg \
[.a cget -color]
} {1 {unknown color name "bogus"} red}
-test config-8.2 {Tk_RestoreSavedOptions - freeing object memory} {
- eval destroy [winfo children .]
+test config-8.2 {Tk_RestoreSavedOptions - freeing object memory} testobjconfig {
+ deleteWindows
testobjconfig alltypes .a
.a csave -color green -color black -color blue -color #ffff00 \
-color #ff00ff
} {32}
-test config-8.3 {Tk_RestoreSavedOptions - boolean internal form} {
- eval destroy [winfo children .]
+test config-8.3 {Tk_RestoreSavedOptions - boolean internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -boolean 0 -color bogus}] [.a cget -boolean]
} {1 1}
-test config-8.4 {Tk_RestoreSavedOptions - integer internal form} {
- eval destroy [winfo children .]
+test config-8.4 {Tk_RestoreSavedOptions - integer internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -integer 24 -color bogus}] [.a cget -integer]
} {1 148962237}
-test config-8.5 {Tk_RestoreSavedOptions - double internal form} {
- eval destroy [winfo children .]
+test config-8.5 {Tk_RestoreSavedOptions - double internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -double 62.4 -color bogus}] [.a cget -double]
} {1 3.14159}
-test config-8.6 {Tk_RestoreSavedOptions - string internal form} {
- eval destroy [winfo children .]
+test config-8.6 {Tk_RestoreSavedOptions - string internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -string "A long string" -color bogus}] \
[.a cget -string]
} {1 foo}
-test config-8.7 {Tk_RestoreSavedOptions - string table internal form} {
- eval destroy [winfo children .]
+test config-8.7 {Tk_RestoreSavedOptions - string table internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -stringtable three -color bogus}] \
[.a cget -stringtable]
} {1 one}
-test config-8.8 {Tk_RestoreSavedOptions - color internal form} {
- eval destroy [winfo children .]
+test config-8.8 {Tk_RestoreSavedOptions - color internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -color green -color bogus}] [.a cget -color]
} {1 red}
-test config-8.9 {Tk_RestoreSavedOptions - font internal form} {nonPortable} {
- eval destroy [winfo children .]
+test config-8.9 {Tk_RestoreSavedOptions - font internal form} {testobjconfig nonPortable} {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -font {Times 12} -color bogus}] [.a cget -font]
} {1 {Helvetica 12}}
-test config-8.10 {Tk_RestoreSavedOptions - bitmap internal form} {
- eval destroy [winfo children .]
+test config-8.10 {Tk_RestoreSavedOptions - bitmap internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -bitmap questhead -color bogus}] [.a cget -bitmap]
} {1 gray50}
-test config-8.11 {Tk_RestoreSavedOptions - border internal form} {
- eval destroy [winfo children .]
+test config-8.11 {Tk_RestoreSavedOptions - border internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -border brown -color bogus}] [.a cget -border]
} {1 blue}
-test config-8.12 {Tk_RestoreSavedOptions - relief internal form} {
- eval destroy [winfo children .]
+test config-8.12 {Tk_RestoreSavedOptions - relief internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -relief sunken -color bogus}] [.a cget -relief]
} {1 raised}
-test config-8.13 {Tk_RestoreSavedOptions - cursor internal form} {
- eval destroy [winfo children .]
+test config-8.13 {Tk_RestoreSavedOptions - cursor internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -cursor watch -color bogus}] [.a cget -cursor]
} {1 xterm}
-test config-8.14 {Tk_RestoreSavedOptions - justify internal form} {
- eval destroy [winfo children .]
+test config-8.14 {Tk_RestoreSavedOptions - justify internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -justify right -color bogus}] [.a cget -justify]
} {1 left}
-test config-8.15 {Tk_RestoreSavedOptions - anchor internal form} {
- eval destroy [winfo children .]
+test config-8.15 {Tk_RestoreSavedOptions - anchor internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a
list [catch {.a csave -anchor center -color bogus}] [.a cget -anchor]
} {1 n}
-test config-8.16 {Tk_RestoreSavedOptions - window internal form} {
- eval destroy [winfo children .]
+test config-8.16 {Tk_RestoreSavedOptions - window internal form} testobjconfig {
+ deleteWindows
testobjconfig internal .a -window .a
list [catch {.a csave -window .a -color bogus}] [.a cget -window]
} {1 .a}
+test config-8.17 {Tk_RestoreSavedOptions - custom internal form} testobjconfig {
+ deleteWindows
+ testobjconfig internal .a -custom "foobar"
+ list [catch {.a csave -custom "barbaz" -color bogus}] [.a cget -custom]
+} {1 FOOBAR}
# Most of the tests below will cause memory leakage if there is a
# problem. This may not be evident unless the tests are run in
# conjunction with a memory usage analyzer such as Purify.
-test config-9.1 {Tk_FreeConfigOptions/FreeResources - string internal form} {
+test config-9.1 {Tk_FreeConfigOptions/FreeResources - string internal form} testobjconfig {
catch {destroy .foo}
testobjconfig internal .foo
.foo configure -string "two words"
destroy .foo
} {}
-test config-9.2 {Tk_FreeConfigOptions/FreeResources - color internal form} {
+test config-9.2 {Tk_FreeConfigOptions/FreeResources - color internal form} testobjconfig {
catch {destroy .foo}
testobjconfig internal .foo
.foo configure -color yellow
destroy .foo
} {}
-test config-9.3 {Tk_FreeConfigOptions/FreeResources - color} {
+test config-9.3 {Tk_FreeConfigOptions/FreeResources - color} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -color [format blue]
destroy .foo
} {}
-test config-9.4 {Tk_FreeConfigOptions/FreeResources - font internal form} {
+test config-9.4 {Tk_FreeConfigOptions/FreeResources - font internal form} testobjconfig {
catch {destroy .foo}
testobjconfig internal .foo
.foo configure -font {Courier 20}
destroy .foo
} {}
-test config-9.5 {Tk_FreeConfigOptions/FreeResources - font} {
+test config-9.5 {Tk_FreeConfigOptions/FreeResources - font} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -font [format {Courier 24}]
destroy .foo
} {}
-test config-9.6 {Tk_FreeConfigOptions/FreeResources - bitmap internal form} {
+test config-9.6 {Tk_FreeConfigOptions/FreeResources - bitmap internal form} testobjconfig {
catch {destroy .foo}
testobjconfig internal .foo
.foo configure -bitmap gray75
destroy .foo
} {}
-test config-9.7 {Tk_FreeConfigOptions/FreeResources - bitmap} {
+test config-9.7 {Tk_FreeConfigOptions/FreeResources - bitmap} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -bitmap [format gray75]
destroy .foo
} {}
-test config-9.8 {Tk_FreeConfigOptions/FreeResources - border internal form} {
+test config-9.8 {Tk_FreeConfigOptions/FreeResources - border internal form} testobjconfig {
catch {destroy .foo}
testobjconfig internal .foo
.foo configure -border orange
destroy .foo
} {}
-test config-9.9 {Tk_FreeConfigOptions/FreeResources - border} {
+test config-9.9 {Tk_FreeConfigOptions/FreeResources - border} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -border [format blue]
destroy .foo
} {}
-test config-9.10 {Tk_FreeConfigOptions/FreeResources - cursor internal form} {
+test config-9.10 {Tk_FreeConfigOptions/FreeResources - cursor internal form} testobjconfig {
catch {destroy .foo}
testobjconfig internal .foo
.foo configure -cursor cross
destroy .foo
} {}
-test config-9.11 {Tk_FreeConfigOptions/FreeResources - cursor} {
+test config-9.11 {Tk_FreeConfigOptions/FreeResources - cursor} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -cursor [format watch]
destroy .foo
} {}
-test config-9.12 {Tk_FreeConfigOptions/FreeResources - not special} {
+test config-9.12 {Tk_FreeConfigOptions/FreeResources - not special} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -integer [format 27]
destroy .foo
} {}
+test config-9.13 {Tk_FreeConfigOptions/FreeResources - custom internal form} testobjconfig {
+ catch {destroy .fpp}
+ testobjconfig internal .foo
+ .foo configure -custom "foobar"
+ destroy .foo
+} {}
-test config-10.1 {Tk_GetOptionInfo - one item} {
+test config-10.1 {Tk_GetOptionInfo - one item} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -relief groove
.foo configure -relief
} {-relief relief Relief raised groove}
-test config-10.2 {Tk_GetOptionInfo - one item, synonym} {
+test config-10.2 {Tk_GetOptionInfo - one item, synonym} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo
.foo configure -color black
.foo configure -synonym
} {-color color Color red black}
-test config-10.3 {Tk_GetOptionInfo - all items} {
+test config-10.3 {Tk_GetOptionInfo - all items} testobjconfig {
catch {destroy .foo}
testobjconfig alltypes .foo -font {Helvetica 18} -integer 13563
.foo configure
-} {{-boolean boolean Boolean 1 1} {-integer integer Integer 7 13563} {-double double Double 3.14159 3.14159} {-string string String foo foo} {-stringtable StringTable stringTable one one} {-color color Color red red} {-font font Font {Helvetica 12} {Helvetica 18}} {-bitmap bitmap Bitmap gray50 gray50} {-border border Border blue blue} {-relief relief Relief raised raised} {-cursor cursor Cursor xterm xterm} {-justify {} {} left left} {-anchor anchor Anchor {} {}} {-pixel pixel Pixel 1 1} {-synonym -color}}
-test config-10.4 {Tk_GetOptionInfo - chaining through tables} {
+} {{-boolean boolean Boolean 1 1} {-integer integer Integer 7 13563} {-double double Double 3.14159 3.14159} {-string string String foo foo} {-stringtable StringTable stringTable one one} {-color color Color red red} {-font font Font {Helvetica 12} {Helvetica 18}} {-bitmap bitmap Bitmap gray50 gray50} {-border border Border blue blue} {-relief relief Relief raised raised} {-cursor cursor Cursor xterm xterm} {-justify {} {} left left} {-anchor anchor Anchor {} {}} {-pixel pixel Pixel 1 1} {-custom {} {} {} {}} {-synonym -color}}
+test config-10.4 {Tk_GetOptionInfo - chaining through tables} testobjconfig {
catch {destroy .foo}
testobjconfig chain2 .foo -one asdf -three xyzzy
.foo configure
} {{-three three Three three xyzzy} {-four four Four four four} {-two two Two {two and a half} {two and a half}} {-oneAgain oneAgain OneAgain {one again} {one again}} {-one one One one asdf} {-two two Two two {two and a half}}}
-eval destroy [winfo children .]
-testobjconfig alltypes .a
-test config-11.1 {GetConfigList - synonym} {
+deleteWindows
+if {[testConstraint testobjconfig]} {
+ testobjconfig alltypes .a
+}
+test config-11.1 {GetConfigList - synonym} testobjconfig {
lindex [.a configure] end
} {-synonym -color}
-test config-11.2 {GetConfigList - null database names} {
+test config-11.2 {GetConfigList - null database names} testobjconfig {
.a configure -justify
} {-justify {} {} left left}
-test config-11.3 {GetConfigList - null default and current value} {
+test config-11.3 {GetConfigList - null default and current value} testobjconfig {
.a configure -anchor
} {-anchor anchor Anchor {} {}}
-eval destroy [winfo children .]
-testobjconfig internal .a
-test config-12.1 {GetObjectForOption - boolean} {
+deleteWindows
+if {[testConstraint testobjconfig]} {
+ testobjconfig internal .a
+}
+test config-12.1 {GetObjectForOption - boolean} testobjconfig {
.a configure -boolean 0
.a cget -boolean
} {0}
-test config-12.2 {GetObjectForOption - integer} {
+test config-12.2 {GetObjectForOption - integer} testobjconfig {
.a configure -integer 1247
.a cget -integer
} {1247}
-test config-12.3 {GetObjectForOption - double} {
+test config-12.3 {GetObjectForOption - double} testobjconfig {
.a configure -double -88.82
.a cget -double
} {-88.82}
-test config-12.4 {GetObjectForOption - string} {
+test config-12.4 {GetObjectForOption - string} testobjconfig {
.a configure -string "test value"
.a cget -string
} {test value}
-test config-12.5 {GetObjectForOption - stringTable} {
+test config-12.5 {GetObjectForOption - stringTable} testobjconfig {
.a configure -stringtable "two"
.a cget -stringtable
} {two}
-test config-12.6 {GetObjectForOption - color} {
+test config-12.6 {GetObjectForOption - color} testobjconfig {
.a configure -color "green"
.a cget -color
} {green}
-test config-12.7 {GetObjectForOption - font} {
+test config-12.7 {GetObjectForOption - font} testobjconfig {
.a configure -font {Times 36}
.a cget -font
} {Times 36}
-test config-12.8 {GetObjectForOption - bitmap} {
+test config-12.8 {GetObjectForOption - bitmap} testobjconfig {
.a configure -bitmap "questhead"
.a cget -bitmap
} {questhead}
-test config-12.9 {GetObjectForOption - border} {
+test config-12.9 {GetObjectForOption - border} testobjconfig {
.a configure -border #33217c
.a cget -border
} {#33217c}
-test config-12.10 {GetObjectForOption - relief} {
+test config-12.10 {GetObjectForOption - relief} testobjconfig {
.a configure -relief groove
.a cget -relief
} {groove}
-test config-12.11 {GetObjectForOption - cursor} {
+test config-12.11 {GetObjectForOption - cursor} testobjconfig {
.a configure -cursor watch
.a cget -cursor
} {watch}
-test config-12.12 {GetObjectForOption - justify} {
+test config-12.12 {GetObjectForOption - justify} testobjconfig {
.a configure -justify right
.a cget -justify
} {right}
-test config-12.13 {GetObjectForOption - anchor} {
+test config-12.13 {GetObjectForOption - anchor} testobjconfig {
.a configure -anchor e
.a cget -anchor
} {e}
-test config-12.14 {GetObjectForOption - pixels} {
+test config-12.14 {GetObjectForOption - pixels} testobjconfig {
.a configure -pixel 193.2
.a cget -pixel
} {193}
-test config-12.15 {GetObjectForOption - window} {
+test config-12.15 {GetObjectForOption - window} testobjconfig {
.a configure -window .a
.a cget -window
} {.a}
-test config-12.16 {GetObjectForOption - null values} {
+test config-12.16 {GetObjectForOption -custom} testobjconfig {
+ .a configure -custom foobar
+ .a cget -custom
+} {FOOBAR}
+test config-12.17 {GetObjectForOption - null values} testobjconfig {
.a configure -string {} -color {} -font {} -bitmap {} -border {} \
- -cursor {} -window {}
+ -cursor {} -window {} -custom {}
list [.a cget -string] [.a cget -color] [.a cget -font] \
- [.a cget -string] [.a cget -bitmap] [.a cget -border] \
- [.a cget -cursor] [.a cget -window]
+ [.a cget -bitmap] [.a cget -border] [.a cget -cursor] \
+ [.a cget -window] [.a cget -custom]
} {{} {} {} {} {} {} {} {}}
test config-13.1 {proper cleanup of options with widget destroy} {
@@ -826,13 +866,32 @@ test config-13.1 {proper cleanup of options with widget destroy} {
} {
destroy .w
$type .w -cursor crosshair
- destroy .w
+ destroy .w
+ }
+} {}
+
+deleteWindows
+
+test config-14.1 {Tk_CreateOptionTable - use with namespace import} {
+ namespace export -clear *
+ foreach type {
+ button canvas entry frame listbox menu menubutton message
+ scale scrollbar spinbox text radiobutton checkbutton
+ } {
+ namespace eval ::foo [subst {
+ namespace import -force ::$type
+ ::foo::$type .a
+ ::foo::$type .b
+ }
+ ]
+ destroy .a .b
}
} {}
# cleanup
-eval destroy [winfo children .]
-killTables
+deleteWindows
+if {[testConstraint testobjconfig]} {
+ killTables
+}
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/constraints.tcl b/tk/tests/constraints.tcl
new file mode 100644
index 00000000000..01ed60d0bac
--- /dev/null
+++ b/tk/tests/constraints.tcl
@@ -0,0 +1,181 @@
+if {[namespace exists tk::test]} {
+ deleteWindows
+ wm geometry . {}
+ raise .
+ return
+}
+
+package require Tcl 8.4
+
+package require Tk 8.4
+tk appname tktest
+wm title . tktest
+# 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 {![winfo ismapped .]} {
+ wm geometry . +0+0
+ update
+}
+
+package require tcltest 2.1
+
+namespace eval tk {
+ namespace eval test {
+ namespace eval bg {
+ # Manage a background process.
+ # Replace with slave interp or thread?
+ namespace import ::tcltest::interpreter
+ namespace export setup cleanup do
+
+ proc cleanup {} {
+ variable fd
+ # catch in case the background process has closed $fd
+ catch {puts $fd exit}
+ catch {close $fd}
+ set fd ""
+ }
+ proc setup args {
+ variable fd
+ if {[info exists fd] && [string length $fd]} {
+ cleanup
+ }
+ set fd [open "|[list [interpreter] \
+ -geometry +0+0 -name tktest] $args" r+]
+ puts $fd "puts foo; flush stdout"
+ flush $fd
+ if {[gets $fd data] < 0} {
+ error "unexpected EOF from \"[interpreter]\""
+ }
+ if {$data ne "foo"} {
+ error "unexpected output from\
+ background process: \"$data\""
+ }
+ fileevent $fd readable [namespace code Ready]
+ }
+ proc Ready {} {
+ variable fd
+ variable Data
+ variable Done
+ set x [gets $fd]
+ if {[eof $fd]} {
+ fileevent $fd readable {}
+ set Done 1
+ } elseif {$x eq "**DONE**"} {
+ set Done 1
+ } else {
+ append Data $x
+ }
+ }
+ proc do {cmd {block 0}} {
+ variable fd
+ variable Data
+ variable Done
+ if {$block} {
+ fileevent $fd readable {}
+ }
+ puts $fd "[list catch $cmd msg]; update; puts \$msg;\
+ puts **DONE**; flush stdout"
+ flush $fd
+ set Data {}
+ if {$block} {
+ while {![eof $fd]} {
+ set line [gets $fd]
+ if {$line eq "**DONE**"} {
+ break
+ }
+ append Data $line
+ }
+ } else {
+ set Done 0
+ vwait [namespace which -variable Done]
+ }
+ return $Data
+ }
+ }
+
+ proc Export {internal as external} {
+ uplevel 1 [list namespace import $internal]
+ uplevel 1 [list rename [namespace tail $internal] $external]
+ uplevel 1 [list namespace export $external]
+ }
+ Export bg::setup as setupbg
+ Export bg::cleanup as cleanupbg
+ Export bg::do as dobg
+
+ namespace export deleteWindows
+ proc deleteWindows {} {
+ eval destroy [winfo children .]
+ }
+
+ namespace export fixfocus
+ proc fixfocus {} {
+ catch {destroy .focus}
+ toplevel .focus
+ wm geometry .focus +0+0
+ entry .focus.e
+ .focus.e insert 0 "fixfocus"
+ pack .focus.e
+ update
+ focus -force .focus.e
+ destroy .focus
+ }
+ }
+}
+
+namespace import -force tk::test::*
+
+namespace import -force tcltest::testConstraint
+testConstraint userInteraction 0
+testConstraint nonUnixUserInteraction [expr {[testConstraint userInteraction]
+ || [testConstraint unix]}]
+testConstraint altDisplay [info exists env(TK_ALT_DISPLAY)]
+testConstraint noExceed [expr {![testConstraint unix]
+ || [catch {font actual "\{xyz"}]}]
+testConstraint testImageType [expr {[lsearch [image types] test] >= 0}]
+testConstraint testembed [llength [info commands testembed]]
+testConstraint testwrapper [llength [info commands testwrapper]]
+testConstraint testfont [llength [info commands testfont]]
+testConstraint fonts 1
+destroy .e
+entry .e -width 0 -font {Helvetica -12} -bd 1
+.e insert end a.bcd
+if {([winfo reqwidth .e] != 37) || ([winfo reqheight .e] != 20)} {
+ testConstraint fonts 0
+}
+destroy .e
+destroy .t
+text .t -width 80 -height 20 -font {Times -14} -bd 1
+pack .t
+.t insert end "This is\na dot."
+update
+set x [list [.t bbox 1.3] [.t bbox 2.5]]
+destroy .t
+if {![string match {{22 3 6 15} {31 18 [34] 15}} $x]} {
+ testConstraint fonts 0
+}
+testConstraint pseudocolor8 [expr {([catch {
+ toplevel .t -visual {pseudocolor 8} -colormap new
+ }] == 0) && ([winfo depth .t] == 8)}]
+destroy .t
+setupbg
+set app [dobg {tk appname}]
+testConstraint secureserver 0
+if {[llength [info commands send]]} {
+ testConstraint secureserver 1
+ if {[catch {send $app set a 0} msg] == 1} {
+ if {[string match "X server insecure *" $msg]} {
+ testConstraint secureserver 0
+ }
+ }
+}
+cleanupbg
+
+eval tcltest::configure $argv
+namespace import -force tcltest::test
+
+deleteWindows
+wm geometry . {}
+raise .
+
diff --git a/tk/tests/cursor.test b/tk/tests/cursor.test
index a0e80f14a95..8227c5f6f84 100644
--- a/tk/tests/cursor.test
+++ b/tk/tests/cursor.test
@@ -8,21 +8,16 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[info commands testcursor] != "testcursor"} {
- puts "testcursor command not available; skipping tests"
- ::tcltest::cleanupTests
- return
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+testConstraint testcursor [llength [info commands testcursor]]
-test cursor-1.1 {Tk_AllocCursorFromObj - converting internal reps} {
+test cursor-1.1 {Tk_AllocCursorFromObj - converting internal reps} {testcursor} {
set x watch
lindex $x 0
destroy .b1
@@ -30,7 +25,7 @@ test cursor-1.1 {Tk_AllocCursorFromObj - converting internal reps} {
lindex $x 0
testcursor watch
} {{1 0}}
-test cursor-1.2 {Tk_AllocCursorFromObj - discard stale cursor} {
+test cursor-1.2 {Tk_AllocCursorFromObj - discard stale cursor} {testcursor} {
set x watch
destroy .b1 .b2
button .b1 -cursor $x
@@ -40,7 +35,7 @@ test cursor-1.2 {Tk_AllocCursorFromObj - discard stale cursor} {
button .b2 -cursor $x
lappend result [testcursor watch]
} {{} {{1 1}}}
-test cursor-1.3 {Tk_AllocCursorFromObj - reuse existing cursor} {
+test cursor-1.3 {Tk_AllocCursorFromObj - reuse existing cursor} {testcursor} {
set x watch
destroy .b1 .b2
button .b1 -cursor $x
@@ -59,39 +54,80 @@ test cursor-2.2 {Tk_GetCursor procedure} {
destroy .b1
list [catch {button .b1 -cursor @xyzzy} msg] $msg
} {1 {bad cursor spec "@xyzzy"}}
+# Next two tests need a helper file with a very specific name and
+# controlled format.
+set wincur(data_octal) {
+ 000 000 002 000 001 000 040 040 000 000 007 000 007 000 060 001
+ 000 000 026 000 000 000 050 000 000 000 040 000 000 000 100 000
+ 000 000 001 000 001 000 000 000 000 000 000 000 000 000 000 000
+ 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 000 000 377 377 377 000 000 000 000 000 000 000 000 000 000 000
+ 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
+ 000 000 000 000 000 000 000 000 000 000 160 016 000 000 170 036
+ 000 000 174 076 000 000 076 174 000 000 037 370 000 000 017 360
+ 000 000 007 340 000 000 007 340 000 000 017 360 000 000 037 370
+ 000 000 076 174 000 000 174 076 000 000 170 036 000 000 160 016
+ 000 000 000 000 000 000 377 377 377 377 377 377 377 377 377 377
+ 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
+ 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
+ 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
+ 377 377 377 377 377 377 017 360 377 377 007 340 377 377 003 300
+ 377 377 001 200 377 377 200 001 377 377 300 003 377 377 340 007
+ 377 377 360 017 377 377 360 017 377 377 340 007 377 377 300 003
+ 377 377 200 001 377 377 001 200 377 377 003 300 377 377 007 340
+ 377 377 017 360 377 377
+}
+set wincur(data_binary) {}
+foreach wincur(num) $wincur(data_octal) {
+ append wincur(data_binary) [binary format c 0$wincur(num)]
+}
+set wincur(dir) [::tcltest::makeDirectory {dir with spaces}]
+set wincur(file) [::tcltest::makeFile $wincur(data_binary) "test file.cur" $wincur(dir)]
+test cursor-2.3 {Tk_GetCursor procedure: cursor specs are lists} {pcOnly} {
+ destroy .b1
+ button .b1 -cursor [list @$wincur(file)]
+} {.b1}
+test cursor-2.4 {Tk_GetCursor procedure: cursor specs are lists} {pcOnly} {
+ destroy .b1
+ button .b1 -cursor @[regsub -all {[][ \\{}""$#]} $wincur(file) {\\&}]
+} {.b1}
+::tcltest::removeDirectory $wincur(dir)
+unset wincur
-test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} {
- set x arrow
+test cursor-3.1 {Tk_FreeCursorFromObj - reference counts} {testcursor} {
+ set x heart
destroy .b1 .b2 .b3
button .b1 -cursor $x
button .b3 -cursor $x
button .b2 -cursor $x
set result {}
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
destroy .b1
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
destroy .b2
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
destroy .b3
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
} {{{3 1}} {{2 1}} {{1 1}} {}}
-test cursor-4.1 {FreeCursorObjProc} {
+test cursor-4.1 {FreeCursorObjProc} {testcursor} {
destroy .b
- set x [format arrow]
+ set x [format heart]
button .b -cursor $x
- set y [format arrow]
+ set y [format heart]
.b configure -cursor $y
- set z [format arrow]
+ set z [format heart]
.b configure -cursor $z
set result {}
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
set x red
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
set z 32
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
destroy .b
- lappend result [testcursor arrow]
+ lappend result [testcursor heart]
set y bogus
set result
} {{{1 3}} {{1 2}} {{1 1}} {}}
@@ -101,16 +137,3 @@ destroy .t
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/dialog.test b/tk/tests/dialog.test
new file mode 100644
index 00000000000..b3501bba615
--- /dev/null
+++ b/tk/tests/dialog.test
@@ -0,0 +1,64 @@
+# This file is a Tcl script to test out Tk's "tk_dialog" command.
+# It is organized in the standard fashion for Tcl tests.
+#
+# RCS: @(#) $Id$
+#
+
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+test dialog-1.1 {tk_dialog command} {
+ list [catch {tk_dialog} msg] $msg
+} {1 {wrong # args: should be "tk_dialog w title text bitmap default args"}}
+test dialog-1.2 {tk_dialog command} {
+ list [catch {tk_dialog foo foo foo foo foo} msg] $msg
+} {1 {bad window path name "foo"}}
+test dialog-1.3 {tk_dialog command} {
+ set res [list [catch {tk_dialog .d foo foo foo foo} msg] $msg]
+ destroy .d
+ set res
+} {1 {bitmap "foo" not defined}}
+
+proc PressButton {btn} {
+ if {![winfo ismapped $btn]} {
+ update
+ }
+ event generate $btn <Enter>
+ event generate $btn <1> -x 5 -y 5
+ event generate $btn <ButtonRelease-1> -x 5 -y 5
+}
+
+proc HitReturn {w} {
+ event generate $w <Enter>
+ focus -force $w
+ event generate $w <KeyPress> -keysym Return
+}
+
+test dialog-2.0 {tk_dialog operation} {
+ set x [after 5000 [list set tk::Priv(button) "no response"]]
+ after 100 PressButton .d.button0
+ set res [tk_dialog .d foo foo info 0 click]
+ after cancel $x
+ set res
+} {0}
+test dialog-2.1 {tk_dialog operation} {
+ set x [after 5000 [list set tk::Priv(button) "no response"]]
+ after 100 HitReturn .d
+ set res [tk_dialog .d foo foo info 1 click default]
+ after cancel $x
+ set res
+} {1}
+test dialog-2.2 {tk_dialog operation} {
+ set x [after 5000 [list set tk::Priv(button) "no response"]]
+ after 100 destroy .d
+ set res [tk_dialog .d foo foo info 0 click]
+ after cancel $x
+ set res
+} {-1}
+
+tcltest::cleanupTests
+return
diff --git a/tk/tests/embed.test b/tk/tests/embed.test
new file mode 100644
index 00000000000..4e6b29dee3a
--- /dev/null
+++ b/tk/tests/embed.test
@@ -0,0 +1,51 @@
+# This file is a Tcl script to test out embedded Windows.
+#
+# Copyright (c) 1996-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+test embed-1.1 {TkpUseWindow procedure, bad window identifier} {
+ deleteWindows
+ list [catch {toplevel .t -use xyz} msg] $msg
+} {1 {expected integer but got "xyz"}}
+
+test embed-1.2 {CreateFrame procedure, bad window identifier} {
+ deleteWindows
+ list [catch {toplevel .t -container xyz} msg] $msg
+} {1 {expected boolean value but got "xyz"}}
+
+test embed-1.3 {CreateFrame procedure, both -use and
+ -container is invalid } {
+ deleteWindows
+ toplevel .container -container 1
+ list [catch {toplevel .t -use [winfo id .container] \
+ -container 1} msg] $msg
+} {1 {A window cannot have both the -use and the -container option set.}}
+
+test embed-1.4 {TkpUseWindow procedure, -container must be set} {
+ deleteWindows
+ toplevel .container
+ list [catch {toplevel .embd -use [winfo id .container]} err] $err
+} {1 {window ".container" doesn't have -container option set}}
+
+test embed-1.5 {TkpUseWindow procedure, -container must be set} {
+ deleteWindows
+ frame .container
+ list [catch {toplevel .embd -use [winfo id .container]} err] $err
+} {1 {window ".container" doesn't have -container option set}}
+
+
+# FIXME: test cases common to unixEmbed.test and macEmbed.test should
+# be moved here.
+
+tcltest::cleanupTests
+return
diff --git a/tk/tests/entry.test b/tk/tests/entry.test
index db7d8a5b0a6..51a39e70db8 100644
--- a/tk/tests/entry.test
+++ b/tk/tests/entry.test
@@ -8,23 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\""
- puts "image, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
proc scroll args {
global scrollInfo
@@ -55,11 +44,15 @@ update
set i 1
foreach test {
{-background #ff0000 #ff0000 non-existent
- {unknown color name "non-existent"}}
+ {unknown color name "non-existent"}}
{-bd 4 4 badValue {bad screen distance "badValue"}}
{-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}}
{-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
{-cursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-disabledbackground green green non-existent
+ {unknown color name "non-existent"}}
+ {-disabledforeground blue blue non-existent
+ {unknown color name "non-existent"}}
{-exportselection yes 1 xyzzy {expected boolean value but got "xyzzy"}}
{-fg #110022 #110022 bogus {unknown color name "bogus"}}
{-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
@@ -74,13 +67,18 @@ foreach test {
{-insertborderwidth 1.3 1 2.6x {bad screen distance "2.6x"}}
{-insertofftime 100 100 3.2 {expected integer but got "3.2"}}
{-insertontime 100 100 3.2 {expected integer but got "3.2"}}
+ {-invalidcommand "any string" "any string" {} {}}
+ {-invcmd "any string" "any string" {} {}}
{-justify right right bogus {bad justification "bogus": must be left, right, or center}}
+ {-readonlybackground green green non-existent
+ {unknown color name "non-existent"}}
{-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
{-selectbackground #110022 #110022 bogus {unknown color name "bogus"}}
{-selectborderwidth 1.3 1 badValue {bad screen distance "badValue"}}
{-selectforeground #654321 #654321 bogus {unknown color name "bogus"}}
{-show * * {} {}}
- {-state n normal bogus {bad state "bogus": must be disabled or normal}}
+ {-state n normal bogus
+ {bad state "bogus": must be disabled, normal, or readonly}}
{-takefocus "any string" "any string" {} {}}
{-textvariable i i {} {}}
{-width 402 402 3p {expected integer but got "3p"}}
@@ -191,7 +189,7 @@ test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} {
} {4}
test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} {
llength [.e configure]
-} {33}
+} {36}
test entry-3.16 {EntryWidgetCmd procedure, "configure" widget command} {
list [catch {.e configure -foo} msg] $msg
} {1 {unknown option "-foo"}}
@@ -254,6 +252,14 @@ test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} {
.e configure -state normal
.e get
} {01234567890}
+test entry-3.27 {EntryWidgetCmd procedure, "delete" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e configure -state readonly
+ .e delete 2 8
+ .e configure -state normal
+ .e get
+} {01234567890}
test entry-3.27 {EntryWidgetCmd procedure, "get" widget command} {
list [catch {.e get foo} msg] $msg
} {1 {wrong # args: should be ".e get"}}
@@ -310,6 +316,14 @@ test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} {
.e configure -state normal
.e get
} {01234567890}
+test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e configure -state readonly
+ .e insert 3 xxx
+ .e configure -state normal
+ .e get
+} {01234567890}
test entry-3.41 {EntryWidgetCmd procedure, "insert" widget command} {
list [catch {.e insert a b c} msg] $msg
} {1 {wrong # args: should be ".e insert index text"}}
@@ -421,7 +435,7 @@ test entry-3.62 {EntryWidgetCmd procedure, "selection range" widget command} {
.e select to 5
.e select range 4 4
list [catch {.e index sel.first} msg] $msg
-} {1 {selection isn't in entry}}
+} {1 {selection isn't in widget .e}}
test entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} {
.e delete 0 end
.e insert end 0123456789
@@ -430,6 +444,24 @@ test entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} {
.e select range 2 9
list [.e index sel.first] [.e index sel.last] [.e index anchor]
} {2 9 3}
+test entry-3.64 {EntryWidgetCmd procedure, "selection" widget command} {
+ .e delete 0 end
+ .e insert end 0123456789
+ .e selection range 0 end
+ .e configure -state disabled
+ .e selection range 2 4
+ .e configure -state normal
+ list [.e index sel.first] [.e index sel.last]
+} {0 10}
+test entry-3.64 {EntryWidgetCmd procedure, "selection" widget command} {
+ .e delete 0 end
+ .e insert end 0123456789
+ .e selection range 0 end
+ .e configure -state readonly
+ .e selection range 2 4
+ .e configure -state normal
+ list [.e index sel.first] [.e index sel.last]
+} {2 4}
.e delete 0 end
.e insert end "This is quite a long text string, so long that it "
.e insert end "runs off the end of the window quite a bit."
@@ -911,7 +943,7 @@ test entry-8.7 {DeleteChars procedure} {
.e select to 8
.e delete 1 8
list [catch {.e index sel.first} msg] $msg
-} {1 {selection isn't in entry}}
+} {1 {selection isn't in widget .e}}
test entry-8.8 {DeleteChars procedure} {
.e delete 0 end
.e insert 0 0123456789abcde
@@ -930,7 +962,7 @@ test entry-8.9 {DeleteChars procedure} {
.e select to 8
.e delete 3 8
list [catch {.e index sel.first} msg] $msg
-} {1 {selection isn't in entry}}
+} {1 {selection isn't in widget .e}}
test entry-8.10 {DeleteChars procedure} {
.e delete 0 end
.e insert 0 0123456789abcde
@@ -1039,7 +1071,7 @@ test entry-10.2 {EntrySetValue procedure, updating selection} {
.e selection range 4 10
set x "a"
list [catch {.e index sel.first} msg] $msg
-} {1 {selection isn't in entry}}
+} {1 {selection isn't in widget .e}}
test entry-10.3 {EntrySetValue procedure, updating selection} {
catch {destroy .e}
entry .e -textvariable x
@@ -1105,7 +1137,7 @@ test entry-11.1 {EntryEventProc procedure} {
update
} {}
test entry-11.2 {EntryEventProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
entry .e1 -fg #112233
rename .e1 .e2
set x {}
@@ -1116,7 +1148,7 @@ test entry-11.2 {EntryEventProc procedure} {
} {.e1 #112233 {} {}}
test entry-12.1 {EntryCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
button .e1 -text "xyz_123"
rename .e1 {}
list [info command .e*] [winfo children .]
@@ -1171,7 +1203,7 @@ test entry-13.10 {GetEntryIndex procedure} {unixOnly} {
# selection range is reset.
list [catch {.e index sel.first} msg] $msg
-} {1 {selection isn't in entry}}
+} {1 {selection isn't in widget .e}}
test entry-13.11 {GetEntryIndex procedure} {macOrPc} {
# On mac and pc, when selection is cleared, entry widget remembers
# last selected range. When selection ownership is restored to
@@ -1181,7 +1213,7 @@ test entry-13.11 {GetEntryIndex procedure} {macOrPc} {
} {1 1}
test entry-13.12 {GetEntryIndex procedure} {unixOnly} {
list [catch {.e index sbogus} msg] $msg
-} {1 {selection isn't in entry}}
+} {1 {selection isn't in widget .e}}
test entry-13.13 {GetEntryIndex procedure} {macOrPc} {
list [catch {.e index sbogus} msg] $msg
} {1 {bad entry index "sbogus"}}
@@ -1342,10 +1374,10 @@ test entry-17.4 {EntryUpdateScrollbar procedure} {
} {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand"
while executing
"thisisnotacommand 0 1"
- (horizontal scrolling command executed by entry)}}
+ (horizontal scrolling command executed by .e)}}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test entry-18.1 {Entry widget vs hiding} {
destroy .e
@@ -1471,9 +1503,9 @@ proc doval {W d i P s S v V} {
set ::vVals [list $W $d $i $P $s $S $v $V]
return 0
}
-.e configure -validate all
test entry-19.18 {entry widget validation} {
+ .e configure -validate all
set ::e nextdata
list [.e cget -validate] $::vVals
} {none {.e -1 -1 nextdata newdata {} all forced}}
@@ -1483,23 +1515,22 @@ proc doval {W d i P s S v V} {
set ::e mydata
return 1
}
-.e configure -validate all
## This sets validate to none because it shows that we prevent a possible
## loop condition in the validation, when the entry textvar is also set
test entry-19.19 {entry widget validation} {
+ .e configure -validate all
.e validate
list [.e cget -validate] [.e get] $::vVals
} {none mydata {.e -1 -1 nextdata nextdata {} all forced}}
-.e configure -validate all
-
## This leaves validate alone because we trigger validation through the
## textvar (a write trace), and the write during validation triggers
## nothing (by definition of avoiding loops on var traces). This is
## one of those "dangerous" conditions where the user will have a
## different value in the entry widget shown as is in the textvar.
test entry-19.20 {entry widget validation} {
+ .e configure -validate all
set ::e testdata
list [.e cget -validate] [.e get] $::e $::vVals
} {all testdata mydata {.e -1 -1 testdata mydata {} all forced}}
@@ -1511,6 +1542,53 @@ catch {unset ::e ::vVals}
## End validation tests
##
+test entry-20.1 {widget deletion while active} {
+ destroy .e
+ entry .e -validate all \
+ -validatecommand { destroy %W ; return 1 } \
+ -invalidcommand bell
+ update
+ .e insert 0 abc
+ winfo exists .e
+} 0
+test entry-20.2 {widget deletion while active} {
+ destroy .e
+ entry .e -validate all \
+ -validatecommand { return 0 } \
+ -invalidcommand { destroy %W }
+ .e insert 0 abc
+ winfo exists .e
+} 0
+test entry-20.3 {widget deletion while active} {
+ destroy .e
+ entry .e -validate all \
+ -validatecommand { rename .e {} ; return 1 }
+ .e insert 0 abc
+ winfo exists .e
+} 0
+test entry-20.4 {widget deletion while active} {
+ destroy .e
+ entry .e -validate all \
+ -validatecommand { return 0 } \
+ -invalidcommand { rename .e {} }
+ .e insert 0 abc
+ winfo exists .e
+} 0
+test entry-20.5 {widget deletion while active} {
+ destroy .e
+ entry .e -validatecommand { destroy .e ; return 0 }
+ .e validate
+ winfo exists .e
+} 0
+test entry-20.6 {widget deletion while active} {
+ destroy .e
+ pack [entry .e]
+ update
+ .e config -xscrollcommand { destroy .e }
+ update idle
+ winfo exists .e
+} 0
+
# XXX Still need to write tests for EntryBlinkProc, EntryFocusProc,
# and EntryTextVarProc.
@@ -1519,4 +1597,3 @@ option clear
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/event.test b/tk/tests/event.test
index b6ca6fe44ba..84d84c3210b 100644
--- a/tk/tests/event.test
+++ b/tk/tests/event.test
@@ -8,20 +8,168 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# XXX This test file is woefully incomplete. Right now it only tests
# a few of the procedures in tkEvent.c. Please add more tests whenever
# possible.
+# Setup table used to query key events.
+
+proc _init_keypress_lookup { } {
+ global keypress_lookup
+
+ scan A %c start
+ scan Z %c finish
+
+ for {set i $start} {$i <= $finish} {incr i} {
+ set l [format %c $i]
+ set keypress_lookup($l) $l
+ }
+
+ scan a %c start
+ scan z %c finish
+
+ for {set i $start} {$i <= $finish} {incr i} {
+ set l [format %c $i]
+ set keypress_lookup($l) $l
+ }
+
+ scan 0 %c start
+ scan 9 %c finish
+
+ for {set i $start} {$i <= $finish} {incr i} {
+ set l [format %c $i]
+ set keypress_lookup($l) $l
+ }
+
+ array set keypress_lookup [list \
+ " " space \
+ ! exclam \
+ \" quotedbl \
+ \# numbersign \
+ \$ dollar \
+ % percent \
+ & ampersand \
+ ( parenleft \
+ ) parenright \
+ * asterisk \
+ + plus \
+ , comma \
+ - minus \
+ . period \
+ / slash \
+ : colon \
+ \; semicolon \
+ < less \
+ = equal \
+ > greater \
+ ? question \
+ @ at \
+ \[ bracketleft \
+ \\ backslash \
+ \] bracketright \
+ ^ asciicircum \
+ _ underscore \
+ \{ braceleft \
+ | bar \
+ \} braceright \
+ ~ asciitilde \
+ ' apostrophe \
+ "\n" Return]
+}
+
+
+# Lookup an event in the keypress table.
+# For example:
+# Q -> Q
+# . -> period
+# / -> slash
+# Delete -> Delete
+# Escape -> Escape
+
+proc _keypress_lookup { char } {
+ global keypress_lookup
+
+ if {! [info exists keypress_lookup]} {
+ _init_keypress_lookup
+ }
+
+ if {$char == ""} {
+ error "empty char"
+ }
+
+ if {[info exists keypress_lookup($char)]} {
+ return $keypress_lookup($char)
+ } else {
+ return $char
+ }
+}
+
+
+# Lookup and generate a pair of KeyPress and KeyRelease events
+
+proc _keypress { win key } {
+ set keysym [_keypress_lookup $key]
+
+ event generate $win <KeyPress-$keysym>
+ _pause 50
+ event generate $win <KeyRelease-$keysym>
+ _pause 50
+}
+
+# Call _keypress for each character in the given string
+
+proc _keypress_string { win string } {
+ foreach letter [split $string ""] {
+ _keypress $win $letter
+ }
+}
+
+# Delay script execution for a given amount of time
+
+proc _pause { {msecs 1000} } {
+ global _pause
+
+ if {! [info exists _pause(number)]} {
+ set _pause(number) 0
+ }
+
+ set num [incr _pause(number)]
+ set _pause($num) 0
+
+ after $msecs "set _pause($num) 1"
+ vwait _pause($num)
+ unset _pause($num)
+}
+
+# Helper proc to convert index to x y position
+
+proc _text_ind_to_x_y { text ind } {
+ foreach {x1 y1 width height} [$text bbox $ind] break
+ set middle_y [expr {$y1 + ($height / 2)}]
+ return [list $x1 $middle_y]
+}
+
+# Return selection only if owned by the given widget
+
+proc _get_selection { widget } {
+ if {[string compare $widget [selection own]] != 0} {
+ return ""
+ }
+ if {[catch {selection get} sel]} {
+ return ""
+ }
+ return $sel
+}
+
+# Begining of the actual tests
+
test event-1.1 {Tk_HandleEvent procedure, filter events for dead windows} {
button .b -text Test
pack .b
@@ -51,20 +199,465 @@ test event-1.2 {event generate <Alt-z>} {
destroy .e
set ::event12result
} 1
-# cleanup
-::tcltest::cleanupTests
-return
+test event-keypress-1.1 { type into entry widget and hit Return } {
+ destroy .t
+ set t [toplevel .t]
+ set e [entry $t.e]
+ pack $e
+ set return_binding 0
+ bind $e <Return> {set return_binding 1}
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e HELLO\n
+ list [$e get] $return_binding
+} {HELLO 1}
+
+
+test event-keypress-1.2 { type into entry widget and then delete some text } {
+ destroy .t
+ set t [toplevel .t]
+ set e [entry $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e MELLO
+ _keypress $e BackSpace
+ _keypress $e BackSpace
+ $e get
+} MEL
+
+test event-keypress-1.3 { type into entry widget, triple click,
+ hit Delete key, and then type some more } {
+ destroy .t
+ set t [toplevel .t]
+ set e [entry $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e JUMP
+
+ set result [$e get]
+
+ event generate $e <Enter>
+ for {set i 0} {$i < 3} {incr i} {
+ _pause 100
+ event generate $e <ButtonPress-1>
+ _pause 100
+ event generate $e <ButtonRelease-1>
+ }
+
+ _keypress $e Delete
+ _keypress_string $e UP
+ lappend result [$e get]
+} {JUMP UP}
+
+
+test event-keypress-1.4 { type into text widget and hit Return } {
+ destroy .t
+ set t [toplevel .t]
+ set e [text $t.e]
+ pack $e
+ set return_binding 0
+ bind $e <Return> {set return_binding 1}
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e HELLO\n
+ list [$e get 1.0 end] $return_binding
+} [list "HELLO\n\n" 1]
+test event-keypress-1.5 { type into text widget and then delete some text } {
+ destroy .t
+ set t [toplevel .t]
+ set e [text $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e MELLO
+ _keypress $e BackSpace
+ _keypress $e BackSpace
+ $e get 1.0 1.end
+} MEL
+
+test event-keypress-1.6 { type into text widget, triple click,
+ hit Delete key, and then type some more } {
+ destroy .t
+ set t [toplevel .t]
+ set e [text $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e JUMP
+
+ set result [$e get 1.0 1.end]
+
+ event generate $e <Enter>
+ for {set i 0} {$i < 3} {incr i} {
+ _pause 100
+ event generate $e <ButtonPress-1>
+ _pause 100
+ event generate $e <ButtonRelease-1>
+ }
+
+ _keypress $e Delete
+ _keypress_string $e UP
+ lappend result [$e get 1.0 1.end]
+} {JUMP UP}
+
+
+
+test event-click-drag-1.1 { click and drag in a text widget, this
+ tests tkTextSelectTo in text.tcl } {
+ destroy .t
+ set t [toplevel .t]
+ set e [text $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e "A Tcl/Tk selection test!"
+ set anchor 1.6
+ set selend 1.18
+
+ set result [list]
+ lappend result [$e get 1.0 1.end]
+
+ # Get the x,y coords of the second T in "Tcl/Tk"
+ foreach {anchor_x anchor_y} [_text_ind_to_x_y $e $anchor] break
+
+ # Click down to set the insert cursor position
+ event generate $e <Enter>
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+
+ # Save the position of the insert cursor
+ lappend result [$e index insert]
+
+ # Now drag until selend is highlighted, then click up
+
+ set current $anchor
+ while {[$e compare $current <= $selend]} {
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ set current [$e index [list $current + 1 char]]
+ _pause 50
+ }
+
+ event generate $e <ButtonRelease-1> -x $current_x -y $current_y
+ _pause 200
+
+ # Save the position of the insert cursor
+ lappend result [$e index insert]
+
+ # Save the highlighted text
+ lappend result [_get_selection $e]
+
+ # Now click and click and drag to the left, over "Tcl/Tk selection"
+
+ event generate $e <ButtonPress-1> -x $current_x -y $current_y
+
+ while {[$e compare $current >= [list $anchor - 4 char]]} {
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ set current [$e index [list $current - 1 char]]
+ _pause 50
+ }
+ event generate $e <ButtonRelease-1> -x $current_x -y $current_y
+ _pause 200
+ # Save the position of the insert cursor
+ lappend result [$e index insert]
+ # Save the highlighted text
+ lappend result [_get_selection $e]
+} {{A Tcl/Tk selection test!} 1.6 1.18 {Tk selection} 1.2 {Tcl/Tk selection}}
+test event-click-drag-1.2 { click and drag in an entry widget, this
+ tests tkEntryMouseSelect in entry.tcl } {
+ destroy .t
+ set t [toplevel .t]
+ set e [entry $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e "A Tcl/Tk selection!"
+ set anchor 6
+ set selend 18
+ set result [list]
+ lappend result [$e get]
+
+ # Get the x,y coords of the second T in "Tcl/Tk"
+ foreach {anchor_x anchor_y} [_text_ind_to_x_y $e $anchor] break
+
+ # Click down to set the insert cursor position
+ event generate $e <Enter>
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+
+ # Save the position of the insert cursor
+ lappend result [$e index insert]
+
+ # Now drag until selend is highlighted, then click up
+
+ set current $anchor
+ while {$current <= $selend} {
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ incr current
+ _pause 50
+ }
+
+ event generate $e <ButtonRelease-1> -x $current_x -y $current_y
+ _pause 200
+
+ # Save the position of the insert cursor
+ lappend result [$e index insert]
+
+ # Save the highlighted text
+ lappend result [_get_selection $e]
+
+ # Now click and click and drag to the left, over "Tcl/Tk selection"
+
+ event generate $e <ButtonPress-1> -x $current_x -y $current_y
+
+ while {$current >= ($anchor - 4)} {
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ incr current -1
+ _pause 50
+ }
+
+ event generate $e <ButtonRelease-1> -x $current_x -y $current_y
+ _pause 200
+
+ # Save the position of the insert cursor
+ lappend result [$e index insert]
+
+ # Save the highlighted text
+ lappend result [_get_selection $e]
+
+} {{A Tcl/Tk selection!} 6 18 {Tk selection} 2 {Tcl/Tk selection}}
+
+
+
+test event-double-click-drag-1.1 { click down, click up, click down again,
+ then drag in a text widget } {
+ destroy .t
+ set t [toplevel .t]
+ set e [text $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e "Word select test"
+ set anchor 1.8
+
+ # Get the x,y coords of the second e in "select"
+ foreach {anchor_x anchor_y} [_text_ind_to_x_y $e $anchor] break
+
+ # Click down, release, then click down again
+ event generate $e <Enter>
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ _pause 50
+ event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
+ _pause 50
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ _pause 50
+
+ # Save the highlighted text
+ set result [list]
+ lappend result [_get_selection $e]
+
+ # Insert cursor should be at end of "select"
+ lappend result [$e index insert]
+
+ # Move mouse one character to the left
+ set current [$e index [list $anchor - 1 char]]
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 50
+
+ # Insert cursor should be before the l in "select"
+ lappend result [$e index insert]
+
+ # Selection should still be the word "select"
+ lappend result [_get_selection $e]
+
+ # Move mouse to the space before the word "select"
+ set current [$e index [list $current - 3 char]]
+
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 200
+
+ lappend result [$e index insert]
+ lappend result [_get_selection $e]
+
+ # Move mouse to the r in "Word"
+ set current 1.2
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 50
+
+ # Selection should now be "Word select"
+ lappend result [_get_selection $e]
+
+ # Insert cursor should be before the r in "Word"
+ lappend result [$e index insert]
+
+ set result
+} {select 1.11 1.7 select 1.4 { select} {Word select} 1.2}
+
+
+
+test event-double-click-drag-1.2 { click down, click up, click down again,
+ then drag in an entry widget } {
+ destroy .t
+ set t [toplevel .t]
+ set e [entry $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e "Word select test"
+
+ set anchor 8
+
+ # Get the x,y coords of the second e in "select"
+ foreach {anchor_x anchor_y} [_text_ind_to_x_y $e $anchor] break
+
+ # Click down, release, then click down again
+ event generate $e <Enter>
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ _pause 50
+ event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
+ _pause 50
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ _pause 50
+
+ set result [list]
+ lappend result [_get_selection $e]
+
+ # Insert cursor should be at the end of "select"
+ lappend result [$e index insert]
+
+ # Move mouse one character to the left
+ set current [expr {$anchor - 1}]
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 50
+
+ # Insert cursor should be before the l in "select"
+ lappend result [$e index insert]
+
+ # Selection should still be the word "select"
+ lappend result [_get_selection $e]
+
+ # Move mouse to the space before the word "select"
+ set current [expr {$current - 3}]
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 50
+
+ lappend result [$e index insert]
+ lappend result [_get_selection $e]
+
+ # Move mouse to the r in "Word"
+ set current [expr {$current - 2}]
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 50
+
+ # Selection should now be "Word select"
+ lappend result [_get_selection $e]
+
+ # Insert cursor should be before the r in "Word"
+ lappend result [$e index insert]
+
+ set result
+} {select 11 7 select 4 { select} {Word select} 2}
+
+
+test event-triple-click-drag-1.1 { Triple click and drag across lines in
+ a text widget, this should extend the selection to the new line } {
+ destroy .t
+ set t [toplevel .t]
+ set e [text $t.e]
+ pack $e
+ tkwait visibility $e
+ focus -force $e
+ _keypress_string $e "LINE ONE\nLINE TWO\nLINE THREE"
+
+ set anchor 3.2
+
+ # Triple click one third line leaving mouse down
+
+ foreach {anchor_x anchor_y} [_text_ind_to_x_y $e $anchor] break
+
+ event generate $e <Enter>
+
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ _pause 50
+ event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
+ _pause 50
+
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ _pause 50
+ event generate $e <ButtonRelease-1> -x $anchor_x -y $anchor_y
+ _pause 50
+
+ event generate $e <ButtonPress-1> -x $anchor_x -y $anchor_y
+ _pause 50
+
+ set result [list]
+ lappend result [_get_selection $e]
+
+ # Drag up to second line
+
+ set current [$e index [list $anchor - 1 line]]
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 50
+
+ lappend result [_get_selection $e]
+
+ # Drag up to first line
+
+ set current [$e index [list $current - 1 line]]
+ foreach {current_x current_y} [_text_ind_to_x_y $e $current] break
+
+ event generate $e <B1-Motion> -x $current_x -y $current_y
+ _pause 50
+
+ lappend result [_get_selection $e]
+
+ set result
+
+} [list "LINE THREE\n" "LINE TWO\nLINE THREE\n" \
+ "LINE ONE\nLINE TWO\nLINE THREE\n"]
+
+
+# cleanup
+
+destroy .t
+
+unset -nocomplain keypress_lookup
+rename _init_keypress_lookup {}
+rename _keypress_lookup {}
+rename _keypress {}
+rename _pause {}
+rename _text_ind_to_x_y {}
+rename _get_selection {}
+
+::tcltest::cleanupTests
+return
diff --git a/tk/tests/filebox.test b/tk/tests/filebox.test
index c9112bf405a..26e4209c546 100644
--- a/tk/tests/filebox.test
+++ b/tk/tests/filebox.test
@@ -9,17 +9,17 @@
# RCS: @(#) $Id$
#
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-set tk_strictMotif_old $tk_strictMotif
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-# Some tests require user interaction on non-unix platform
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
-set ::tcltest::testConfig(nonUnixUserInteraction) \
- [expr {$::tcltest::testConfig(userInteraction) || \
- $::tcltest::testConfig(unixOnly)}]
+set tk_strictMotif_old $tk_strictMotif
#----------------------------------------------------------------------
#
@@ -105,185 +105,296 @@ if {$tcl_platform(platform) == "unix"} {
set modes 1
}
-set unknownOptionsMsg {1 {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, or -title}}
+set unknownOptionsMsg(tk_getOpenFile) {1 {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, or -title}}
+set unknownOptionsMsg(tk_getSaveFile) {1 {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, or -title}}
set tmpFile "filebox.tmp"
makeFile {
# this file can be empty!
} $tmpFile
+array set filters {
+ 1 {}
+ 2 {
+ {"Text files" {.txt .doc} }
+ {"Text files" {} TEXT}
+ {"Tcl Scripts" {.tcl} TEXT}
+ {"C Source Files" {.c .h} }
+ {"All Source Files" {.tcl .c .h} }
+ {"Image Files" {.gif} }
+ {"Image Files" {.jpeg .jpg} }
+ {"Image Files" "" {GIFF JPEG}}
+ {"All files" *}
+ }
+ 3 {
+ {"Text files" {.txt .doc} TEXT}
+ {"Foo" {""} TEXT}
+ }
+}
+
foreach mode $modes {
#
# Test both the motif version and the "tk" version of the file dialog
# box on Unix.
#
+ # Note that this can use the same test number twice!
+ #
+ set addedExtensions {}
if {$tcl_platform(platform) == "unix"} {
set tk_strictMotif $mode
- }
-
- #
- # Test both the "open" and the "save" dialogs
- #
-
- foreach command "tk_getOpenFile tk_getSaveFile" {
- test filebox-1.1 "$command command" {
- list [catch {$command -foo} msg] $msg
- } $unknownOptionsMsg
-
- catch {$command -foo 1} msg
- regsub -all , $msg "" options
- regsub \"-foo\" $options "" options
-
- foreach option $options {
- if {[string index $option 0] == "-"} {
- test filebox-1.2 "$command command" {
- list [catch {$command $option} msg] $msg
- } [list 1 "value for \"$option\" missing"]
- }
+ # Extension adding is only done when using the non-motif file
+ # box with an extension-less filename
+ if {!$mode} {
+ set addedExtensions {NONE {} .txt .txt}
}
+ }
- test filebox-1.3 "$command command" {
- list [catch {$command -foo bar} msg] $msg
- } $unknownOptionsMsg
-
- test filebox-1.4 "$command command" {
- list [catch {$command -initialdir} msg] $msg
- } {1 {value for "-initialdir" missing}}
-
- test filebox-1.5 "$command command" {
- list [catch {$command -parent foo.bar} msg] $msg
- } {1 {bad window path name "foo.bar"}}
+ test filebox-1.1 "tk_getOpenFile command" {
+ list [catch {tk_getOpenFile -foo} msg] $msg
+ } $unknownOptionsMsg(tk_getOpenFile)
+
+ catch {tk_getOpenFile -foo 1} msg
+ regsub -all , $msg "" options
+ regsub \"-foo\" $options "" options
+
+ foreach option $options {
+ if {[string index $option 0] == "-"} {
+ test filebox-1.2 "tk_getOpenFile command" {
+ list [catch {tk_getOpenFile $option} msg] $msg
+ } [list 1 "value for \"$option\" missing"]
+ }
+ }
+
+ test filebox-1.3 "tk_getOpenFile command" {
+ list [catch {tk_getOpenFile -foo bar} msg] $msg
+ } $unknownOptionsMsg(tk_getOpenFile)
+
+ test filebox-1.4 "tk_getOpenFile command" {
+ list [catch {tk_getOpenFile -initialdir} msg] $msg
+ } {1 {value for "-initialdir" missing}}
+
+ test filebox-1.5 "tk_getOpenFile command" {
+ list [catch {tk_getOpenFile -parent foo.bar} msg] $msg
+ } {1 {bad window path name "foo.bar"}}
+
+ test filebox-1.6 "tk_getOpenFile command" {
+ list [catch {tk_getOpenFile -filetypes {Foo}} msg] $msg
+ } {1 {bad file type "Foo", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"}}
+
+ if {[info commands tk::MotifFDialog] == "" && [info commands ::tk::dialog::file::] == ""} {
+ set isNative 1
+ } else {
+ set isNative 0
+ }
+
+ set parent .
+
+ set verylongstring longstring:
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+
+ set color #404040
+ test filebox-2.1 "tk_getOpenFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent cancel
+ tk_getOpenFile -title "Press Cancel ($verylongstring)" -parent $parent
+ } ""
+
+ set fileName $tmpFile
+ set fileDir [pwd]
+ set pathName [file join $fileDir $fileName]
+
+ test filebox-2.2 "tk_getOpenFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getOpenFile -title "Press Ok" \
+ -parent $parent -initialfile $fileName -initialdir $fileDir]
+ } $pathName
+
+ test filebox-2.3 "tk_getOpenFile command" {nonUnixUserInteraction} {
+ ToEnterFileByKey $parent $fileName $fileDir
+ set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \
+ -parent $parent -initialdir $fileDir]
+ } $pathName
+
+ test filebox-2.4 "tk_getOpenFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \
+ -parent $parent -initialdir . \
+ -initialfile $fileName]
+ } $pathName
+
+ test filebox-2.5 "tk_getOpenFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getOpenFile -title "Enter \"$fileName\" and press Ok" \
+ -parent $parent -initialdir /badpath \
+ -initialfile $fileName]
+ } $pathName
+
+ test filebox-2.6 "tk_getOpenFile command" {nonUnixUserInteraction} {
+ toplevel .t1; toplevel .t2
+ wm geometry .t1 +0+0
+ wm geometry .t2 +0+0
+ ToPressButton .t1 ok
+ set choice {}
+ lappend choice [tk_getOpenFile \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t1 -initialdir $fileDir \
+ -initialfile $fileName]
+ ToPressButton .t2 ok
+ lappend choice [tk_getOpenFile \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t2 -initialdir $fileDir \
+ -initialfile $fileName]
+ ToPressButton .t1 ok
+ lappend choice [tk_getOpenFile \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t1 -initialdir $fileDir \
+ -initialfile $fileName]
+ destroy .t1
+ destroy .t2
+ set choice
+ } [list $pathName $pathName $pathName]
+
+ foreach x [lsort -integer [array names filters]] {
+ test filebox-3.$x "tk_getOpenFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getOpenFile -title "Press Ok" -filetypes $filters($x)\
+ -parent $parent -initialfile $fileName -initialdir $fileDir]
+ } $pathName
+ }
- test filebox-1.6 "$command command" {
- list [catch {$command -filetypes {Foo}} msg] $msg
- } {1 {bad file type "Foo", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"}}
+ test filebox-4.1 "tk_getSaveFile command" {
+ list [catch {tk_getSaveFile -foo} msg] $msg
+ } $unknownOptionsMsg(tk_getSaveFile)
- if {[info commands tkMotifFDialog] == "" && [info commands ::tk::dialog::file::tkFDialog] == ""} {
- set isNative 1
- } else {
- set isNative 0
- }
+ catch {tk_getSaveFile -foo 1} msg
+ regsub -all , $msg "" options
+ regsub \"-foo\" $options "" options
- set parent .
-
- set verylongstring longstring:
- set verylongstring $verylongstring$verylongstring
- set verylongstring $verylongstring$verylongstring
- set verylongstring $verylongstring$verylongstring
- set verylongstring $verylongstring$verylongstring
-# set verylongstring $verylongstring$verylongstring
-# set verylongstring $verylongstring$verylongstring
-# set verylongstring $verylongstring$verylongstring
-# set verylongstring $verylongstring$verylongstring
-# set verylongstring $verylongstring$verylongstring
-
- set color #404040
- test filebox-2.1 "$command command" {nonUnixUserInteraction} {
- ToPressButton $parent cancel
- $command -title "Press Cancel ($verylongstring)" -parent $parent
- } ""
-
- if {$command == "tk_getSaveFile"} {
- set fileName "12x 455"
- set fileDir [pwd]
- set pathName [file join [pwd] $fileName]
- } else {
- set fileName $tmpFile
- set fileDir [pwd]
- set pathName [file join $fileDir $fileName]
+ foreach option $options {
+ if {[string index $option 0] == "-"} {
+ test filebox-4.2 "tk_getSaveFile command" {
+ list [catch {tk_getSaveFile $option} msg] $msg
+ } [list 1 "value for \"$option\" missing"]
}
+ }
- test filebox-2.2 "$command command" {nonUnixUserInteraction} {
- ToPressButton $parent ok
- set choice [$command -title "Press Ok" \
- -parent $parent -initialfile $fileName -initialdir $fileDir]
- } $pathName
+ test filebox-4.3 "tk_getSaveFile command" {
+ list [catch {tk_getSaveFile -foo bar} msg] $msg
+ } $unknownOptionsMsg(tk_getSaveFile)
- test filebox-2.3 "$command command" {nonUnixUserInteraction} {
- ToEnterFileByKey $parent $fileName $fileDir
- set choice [$command -title "Enter \"$fileName\" and press Ok" \
- -parent $parent -initialdir $fileDir]
- } $pathName
+ test filebox-4.4 "tk_getSaveFile command" {
+ list [catch {tk_getSaveFile -initialdir} msg] $msg
+ } {1 {value for "-initialdir" missing}}
- test filebox-2.4 "$command command" {nonUnixUserInteraction} {
- ToPressButton $parent ok
- set choice [$command -title "Enter \"$fileName\" and press Ok" \
- -parent $parent -initialdir . \
- -initialfile $fileName]
- } $pathName
+ test filebox-4.5 "tk_getSaveFile command" {
+ list [catch {tk_getSaveFile -parent foo.bar} msg] $msg
+ } {1 {bad window path name "foo.bar"}}
- test filebox-2.5 "$command command" {nonUnixUserInteraction} {
- ToPressButton $parent ok
- set choice [$command -title "Enter \"$fileName\" and press Ok" \
- -parent $parent -initialdir /badpath \
- -initialfile $fileName]
- } $pathName
-
- test filebox-2.6 "$command command" {nonUnixUserInteraction} {
- toplevel .t1; toplevel .t2
- wm geometry .t1 +0+0
- wm geometry .t2 +0+0
- ToPressButton .t1 ok
- set choice {}
- lappend choice [$command \
- -title "Enter \"$fileName\" and press Ok" \
- -parent .t1 -initialdir $fileDir \
- -initialfile $fileName]
- ToPressButton .t2 ok
- lappend choice [$command \
- -title "Enter \"$fileName\" and press Ok" \
- -parent .t2 -initialdir $fileDir \
- -initialfile $fileName]
- ToPressButton .t1 ok
- lappend choice [$command \
- -title "Enter \"$fileName\" and press Ok" \
- -parent .t1 -initialdir $fileDir \
- -initialfile $fileName]
- destroy .t1
- destroy .t2
- set choice
- } [list $pathName $pathName $pathName]
-
-
-
- set filters(1) {}
-
- set filters(2) {
- {"Text files" {.txt .doc} }
- {"Text files" {} TEXT}
- {"Tcl Scripts" {.tcl} TEXT}
- {"C Source Files" {.c .h} }
- {"All Source Files" {.tcl .c .h} }
- {"Image Files" {.gif} }
- {"Image Files" {.jpeg .jpg} }
- {"Image Files" "" {GIFF JPEG}}
- {"All files" *}
- }
+ test filebox-4.6 "tk_getSaveFile command" {
+ list [catch {tk_getSaveFile -filetypes {Foo}} msg] $msg
+ } {1 {bad file type "Foo", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"}}
- set filters(3) {
- {"Text files" {.txt .doc} TEXT}
- {"Foo" {""} TEXT}
- }
-
- foreach x [lsort -integer [array names filters]] {
- test filebox-3.$x "$command command" {nonUnixUserInteraction} {
- ToPressButton $parent ok
- set choice [$command -title "Press Ok" -filetypes $filters($x)\
- -parent $parent -initialfile $fileName -initialdir $fileDir]
- } $pathName
- }
-
- # The rest of the tests need to be executed on Unix only.
- # The test whether the dialog box widgets were implemented correctly.
- # These tests are not
- # needed on the other platforms because they use native file dialogs.
+ if {[info commands tk::MotifFDialog] == "" && [info commands ::tk::dialog::file::] == ""} {
+ set isNative 1
+ } else {
+ set isNative 0
+ }
- # end inner if
+ set parent .
+
+ set verylongstring longstring:
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+ # set verylongstring $verylongstring$verylongstring
+
+ set color #404040
+ test filebox-5.1 "tk_getSaveFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent cancel
+ tk_getSaveFile -title "Press Cancel ($verylongstring)" -parent $parent
+ } ""
+
+ set fileName "12x 455"
+ set fileDir [pwd]
+ set pathName [file join [pwd] $fileName]
+
+ test filebox-5.2 "tk_getSaveFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getSaveFile -title "Press Ok" \
+ -parent $parent -initialfile $fileName -initialdir $fileDir]
+ } $pathName
+
+ test filebox-5.3 "tk_getSaveFile command" {nonUnixUserInteraction} {
+ ToEnterFileByKey $parent $fileName $fileDir
+ set choice [tk_getSaveFile -title "Enter \"$fileName\" and press Ok" \
+ -parent $parent -initialdir $fileDir]
+ } $pathName
+
+ test filebox-5.4 "tk_getSaveFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getSaveFile -title "Enter \"$fileName\" and press Ok" \
+ -parent $parent -initialdir . \
+ -initialfile $fileName]
+ } $pathName
+
+ test filebox-5.5 "tk_getSaveFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getSaveFile -title "Enter \"$fileName\" and press Ok" \
+ -parent $parent -initialdir /badpath \
+ -initialfile $fileName]
+ } $pathName
+
+ test filebox-5.6 "tk_getSaveFile command" {nonUnixUserInteraction} {
+ toplevel .t1; toplevel .t2
+ wm geometry .t1 +0+0
+ wm geometry .t2 +0+0
+ ToPressButton .t1 ok
+ set choice {}
+ lappend choice [tk_getSaveFile \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t1 -initialdir $fileDir \
+ -initialfile $fileName]
+ ToPressButton .t2 ok
+ lappend choice [tk_getSaveFile \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t2 -initialdir $fileDir \
+ -initialfile $fileName]
+ ToPressButton .t1 ok
+ lappend choice [tk_getSaveFile \
+ -title "Enter \"$fileName\" and press Ok" \
+ -parent .t1 -initialdir $fileDir \
+ -initialfile $fileName]
+ destroy .t1
+ destroy .t2
+ set choice
+ } [list $pathName $pathName $pathName]
+
+ foreach x [lsort -integer [array names filters]] {
+ test filebox-6.$x "tk_getSaveFile command" {nonUnixUserInteraction} {
+ ToPressButton $parent ok
+ set choice [tk_getSaveFile -title "Press Ok" -filetypes $filters($x)\
+ -parent $parent -initialfile $fileName -initialdir $fileDir]
+ } $pathName[lindex $addedExtensions $x]
}
- # end outer if
+ # The rest of the tests need to be executed on Unix only.
+ # The test whether the dialog box widgets were implemented correctly.
+ # These tests are not
+ # needed on the other platforms because they use native file dialogs.
}
set tk_strictMotif $tk_strictMotif_old
@@ -291,4 +402,3 @@ set tk_strictMotif $tk_strictMotif_old
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/focus.test b/tk/tests/focus.test
index 05c3c839781..abad7e8a300 100644
--- a/tk/tests/focus.test
+++ b/tk/tests/focus.test
@@ -8,13 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
button .b -text .b -relief raised -bd 2
pack .b
@@ -59,8 +58,7 @@ proc focusClear {} {
}
focusSetup
-set ::tcltest::testConfig(altDisplay) [info exists env(TK_ALT_DISPLAY)]
-if {$::tcltest::testConfig(altDisplay)} {
+if {[testConstraint altDisplay]} {
focusSetupAlt
}
update
@@ -188,11 +186,6 @@ test focus-1.25 {Tk_FocusCmd procedure} {unixOnly} {
list [catch {focus -unknown} msg] $msg
} {1 {bad option "-unknown": must be -displayof, -force, or -lastfor}}
-# Some tests require the testwrapper command
-
-set ::tcltest::testConfig(testwrapper) \
- [expr {[info commands testwrapper] != {}}]
-
test focus-2.1 {TkFocusFilterEvent procedure} {unixOnly nonPortable testwrapper} {
focus -force .b
destroy .t
@@ -524,21 +517,9 @@ test focus-4.4 {TkFocusDeadWindow procedure} {unixOnly testwrapper} {
# I don't know how to test most of the remaining procedures of this file
# explicitly; they've already been exercised by the preceding tests.
-# If send is disabled because of inadequate security, don't run any
-# of these tests at all.
-
-setupbg
-set app [dobg {tk appname}]
-set ::tcltest::testConfig(secureServer) 1
-if {[catch {send $app set a 0} msg] == 1} {
- if [string match "X server insecure *" $msg] {
- set ::tcltest::testConfig(secureServer) 0
- }
-}
-cleanupbg
setupbg
test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} \
- {unixOnly testwrapper secureServer} {
+ {unixOnly testwrapper secureserver} {
focusSetup
focus -force .t
update
@@ -572,7 +553,7 @@ test focus-6.1 {miscellaneous - embedded application in same process} \
bind all <FocusOut> {lappend x "focus out %W %d"}
interp create child
child eval "set argv {-use [winfo id .t.f1]}"
- load {} tk child
+ load {} Tk child
child eval {
entry .e1 -bg lightBlue
pack .e1
@@ -657,7 +638,7 @@ test focus-6.2 {miscellaneous - embedded application in different process} \
set result
} {{.t.f2.e1 {} {focus out .t.f2.e1 NotifyNonlinear} {focus out .t.f2 NotifyNonlinearVirtual} {focus in .t.f1 NotifyNonlinear} | {focus out .t.f1 NotifyNonlinear} {focus in .t.f2 NotifyNonlinearVirtual} {focus in .t.f2.e1 NotifyNonlinear}} {{focus in . NotifyVirtual} {focus in .e1 NotifyAncestor} | {focus out .e1 NotifyAncestor} {focus out . NotifyVirtual}}}
-eval destroy [winfo children .]
+deleteWindows
bind all <FocusIn> {}
bind all <FocusOut> {}
@@ -677,4 +658,3 @@ return
-
diff --git a/tk/tests/focusTcl.test b/tk/tests/focusTcl.test
index bacf1a27f48..d7e41dfd1f4 100644
--- a/tk/tests/focusTcl.test
+++ b/tk/tests/focusTcl.test
@@ -9,13 +9,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
proc setup1 w {
if {$w == "."} {
@@ -30,7 +29,9 @@ proc setup1 w {
button $w.b.$i -text "Button $w.b.$i"
pack $w.b.$i -side left
}
- tkwait visibility $w.b.z
+ if {![winfo ismapped $w.b.z]} {
+ tkwait visibility $w.b.z
+ }
}
option add *takeFocus 1
@@ -74,7 +75,7 @@ test focusTcl-1.11 {tk_focusNext procedure, basic tree traversal} {
tk_focusNext .b.z
} {.}
test focusTcl-1.12 {tk_focusNext procedure, basic tree traversal} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
update
. configure -takefocus 0
@@ -82,7 +83,7 @@ test focusTcl-1.12 {tk_focusNext procedure, basic tree traversal} {
} {.a}
. configure -takefocus 1
-eval destroy [winfo child .]
+deleteWindows
setup1 .
toplevel .t
wm geom .t +0+0
@@ -107,7 +108,7 @@ test focusTcl-2.5 {tk_focusNext procedure, toplevels} {
tk_focusNext .t.b.z
} {.t}
-eval destroy [winfo child .]
+deleteWindows
test focusTcl-3.1 {tk_focusPrev procedure, no children} {
tk_focusPrev .
} {.}
@@ -137,7 +138,7 @@ test focusTcl-3.9 {tk_focusPrev procedure, basic tree traversal} {
tk_focusPrev .a
} {.}
-eval destroy [winfo child .]
+deleteWindows
setup1 .
toplevel .t
wm geom .t +0+0
@@ -164,15 +165,15 @@ test focusTcl-4.5 {tk_focusPrev procedure, toplevels} {
tk_focusPrev .t.a
} {.t.b.z}
-eval destroy [winfo child .]
+deleteWindows
test focusTcl-5.1 {tkFocusOK procedure, -takefocus 0} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
.b.x configure -takefocus 0
tk_focusNext .b
} {.b.y}
test focusTcl-5.2 {tkFocusOK procedure, -takefocus 1} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
pack forget .b
update
@@ -190,7 +191,7 @@ test focusTcl-5.3 {tkFocusOK procedure, -takefocus procedure} {
}
return 0
}
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
pack forget .b.y
update
@@ -201,14 +202,14 @@ test focusTcl-5.3 {tkFocusOK procedure, -takefocus procedure} {
list [tk_focusNext .a] [tk_focusNext .b.x]
} {.b.x .d}
test focusTcl-5.4 {tkFocusOK procedure, -takefocus ""} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
.b.x configure -takefocus ""
update
tk_focusNext .b
} {.b.x}
test focusTcl-5.5 {tkFocusOK procedure, -takefocus "", not mapped} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
.b.x configure -takefocus ""
pack unpack .b.x
@@ -216,7 +217,7 @@ test focusTcl-5.5 {tkFocusOK procedure, -takefocus "", not mapped} {
tk_focusNext .b
} {.b.y}
test focusTcl-5.6 {tkFocusOK procedure, -takefocus "", not mapped} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
foreach w {.b.x .b.y .b.z} {
$w configure -takefocus ""
@@ -226,7 +227,7 @@ test focusTcl-5.6 {tkFocusOK procedure, -takefocus "", not mapped} {
tk_focusNext .b
} {.c}
test focusTcl-5.7 {tkFocusOK procedure, -takefocus "", not mapped} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
.b.y configure -takefocus 1
pack unpack .b.y
@@ -235,7 +236,7 @@ test focusTcl-5.7 {tkFocusOK procedure, -takefocus "", not mapped} {
} {.b.z}
test focusTcl-5.8 {tkFocusOK procedure, -takefocus "", not mapped} {
proc always args {return 1}
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
.b.y configure -takefocus always
pack unpack .b.y
@@ -243,7 +244,7 @@ test focusTcl-5.8 {tkFocusOK procedure, -takefocus "", not mapped} {
tk_focusNext .b.x
} {.b.y}
test focusTcl-5.9 {tkFocusOK procedure, -takefocus "", window disabled} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
foreach w {.b.x .b.y .b.z} {
$w configure -takefocus ""
@@ -253,7 +254,7 @@ test focusTcl-5.9 {tkFocusOK procedure, -takefocus "", window disabled} {
tk_focusNext .b
} {.b.y}
test focusTcl-5.10 {tkFocusOK procedure, -takefocus "", check for bindings} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
foreach w {.a .b .c .d} {
$w configure -takefocus ""
@@ -263,7 +264,7 @@ test focusTcl-5.10 {tkFocusOK procedure, -takefocus "", check for bindings} {
list [tk_focusNext .] [tk_focusNext .a]
} {.a .b.x}
test focusTcl-5.11 {tkFocusOK procedure, -takefocus "", check for bindings} {
- eval destroy [winfo child .]
+ deleteWindows
setup1 .
foreach w {.a .b .c .d} {
$w configure -takefocus ""
diff --git a/tk/tests/font.test b/tk/tests/font.test
index 1df9e7dfb97..65fd00ac849 100644
--- a/tk/tests/font.test
+++ b/tk/tests/font.test
@@ -8,15 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[info commands testfont] != "testfont"} {
- puts "testfont command not available; skipping tests"
- ::tcltest::cleanupTests
- return
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .b}
toplevel .b
@@ -458,7 +455,7 @@ test font-13.4 {CreateNamedFont: recreate "deleted" font} {
test font-14.1 {Tk_GetFont procedure} {
} {}
-test font-15.1 {Tk_AllocFontFromObj - converting internal reps} {
+test font-15.1 {Tk_AllocFontFromObj - converting internal reps} testfont {
set x {Times 16}
lindex $x 0
destroy .b1 .b2
@@ -466,7 +463,7 @@ test font-15.1 {Tk_AllocFontFromObj - converting internal reps} {
lindex $x 0
testfont counts {Times 16}
} {{1 0}}
-test font-15.2 {Tk_AllocFontFromObj - discard stale font} {
+test font-15.2 {Tk_AllocFontFromObj - discard stale font} testfont {
set x {Times 16}
destroy .b1 .b2
button .b1 -font $x
@@ -476,7 +473,7 @@ test font-15.2 {Tk_AllocFontFromObj - discard stale font} {
button .b2 -font $x
lappend result [testfont counts {Times 16}]
} {{} {{1 1}}}
-test font-15.3 {Tk_AllocFontFromObj - reuse existing font} {
+test font-15.3 {Tk_AllocFontFromObj - reuse existing font} testfont {
set x {Times 16}
destroy .b1 .b2
button .b1 -font $x
@@ -551,7 +548,7 @@ test font-16.1 {Tk_NameOfFont procedure} {
.b.f cget -font
} {-family fixed}
-test font-17.1 {Tk_FreeFontFromObj - reference counts} {
+test font-17.1 {Tk_FreeFontFromObj - reference counts} testfont {
set x {Courier 12}
destroy .b1 .b2 .b3
button .b1 -font $x
@@ -611,7 +608,7 @@ test font-17.6 {Tk_FreeFont procedure: named font not deleted yet} {
list [lindex [font actual xyz] 0] [lindex $x 0]
} {-family -family}
-test font-18.1 {FreeFontObjProc} {
+test font-18.1 {FreeFontObjProc} testfont {
destroy .b1
set x [format {Courier 12}]
button .b1 -font $x
@@ -1118,40 +1115,40 @@ test font-32.1 {Tk_TextLayoutToPostscript: ensure buffer doesn't overflow} {
.b.c insert text end "end"
set x [.b.c postscript]
set i [string first "(qwerty" $x]
- string range $x $i [expr {$i + 213}]
-} {(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)
-(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-()
-(end)
+ string range $x $i [expr {$i + 278}]
+} {(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)]
+[(qwertyuiopasdfghjklzxcvbnm1234qwertyuiopasdfghjklzxcvbnm)]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[()]
+[(end)]
}
test font-33.1 {Tk_TextWidth procedure} {
@@ -1381,4 +1378,3 @@ return
-
diff --git a/tk/tests/frame.test b/tk/tests/frame.test
index 24ccb984d46..a78cda1fcab 100644
--- a/tk/tests/frame.test
+++ b/tk/tests/frame.test
@@ -9,15 +9,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- catch {destroy $i}
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# eatColors --
# Creates a toplevel window and allocates enough colors in it to
@@ -65,12 +62,14 @@ test frame-1.1 {frame configuration options} {
} {{-class class Class Frame NewFrame} 1 {can't modify -class option after widget is created}}
catch {destroy .f}
test frame-1.2 {frame configuration options} {
- list [catch {frame .f -colormap new} msg] $msg
-} {0 .f}
+ frame .f -colormap new
+ list [.f configure -colormap] [catch {.f configure -colormap .} msg] $msg
+} {{-colormap colormap Colormap {} new} 1 {can't modify -colormap option after widget is created}}
catch {destroy .f}
test frame-1.3 {frame configuration options} {
- list [catch {frame .f -visual default} msg] $msg
-} {0 .f}
+ frame .f -visual default
+ list [.f configure -visual] [catch {.f configure -visual best} msg] $msg
+} {{-visual visual Visual {} default} 1 {can't modify -visual option after widget is created}}
catch {destroy .f}
test frame-1.4 {frame configuration options} {
list [catch {frame .f -screen bogus} msg] $msg
@@ -105,7 +104,9 @@ foreach test {
{-highlightcolor #123456 #123456 non-existent
{unknown color name "non-existent"}}
{-highlightthickness 6 6 badValue {bad screen distance "badValue"}}
- {-relief ridge ridge badValue {bad relief type "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-padx 3 3 badValue {bad screen distance "badValue"}}
+ {-pady 4 4 badValue {bad screen distance "badValue"}}
+ {-relief ridge ridge badValue {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
{-takefocus "any string" "any string" {} {}}
{-width 32 32 badValue {bad screen distance "badValue"}}
} {
@@ -178,11 +179,22 @@ test frame-2.9 {toplevel configuration options} {
catch {destroy .t}
list [catch {toplevel .t -width 200 -height 100 -screen bogus} msg] $msg
} {1 {couldn't connect to display "bogus"}}
+test frame-2.10 {toplevel configuration options} {
+ catch {destroy .t}
+ catch {destroy .x}
+ toplevel .t -container 1 -width 300 -height 120
+ wm geometry .t +0+0
+ set result [list \
+ [catch {toplevel .x -container 1 -use [winfo id .t]} msg] $msg]
+ destroy .t .x
+ set result
+} {1 {A window cannot have both the -use and the -container option set.}}
+
catch {destroy .t}
toplevel .t -width 300 -height 150
wm geometry .t +0+0
update
-set i 8
+set i 11
foreach test {
{-background #ff0000 #ff0000 non-existent
{unknown color name "non-existent"}}
@@ -195,17 +207,19 @@ foreach test {
{-highlightcolor #123456 #123456 non-existent
{unknown color name "non-existent"}}
{-highlightthickness 3 3 badValue {bad screen distance "badValue"}}
- {-relief ridge ridge badValue {bad relief type "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-padx 3 3 badValue {bad screen distance "badValue"}}
+ {-pady 4 4 badValue {bad screen distance "badValue"}}
+ {-relief ridge ridge badValue {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
{-width 32 32 badValue {bad screen distance "badValue"}}
} {
set name [lindex $test 0]
- test frame-2.$i {frame configuration options} {
+ test frame-2.$i {toplevel configuration options} {
.t configure $name [lindex $test 1]
lindex [.t configure $name] 4
} [lindex $test 2]
incr i
if {[lindex $test 3] != ""} {
- test frame-2.$i {frame configuration options} {
+ test frame-2.$i {toplevel configuration options} {
list [catch {.t configure $name [lindex $test 3]} msg] $msg
} [list 1 [lindex $test 4]]
}
@@ -447,22 +461,22 @@ frame .f -highlightcolor black
test frame-5.1 {FrameWidgetCommand procedure} {
list [catch .f msg] $msg
} {1 {wrong # args: should be ".f option ?arg arg ...?"}}
-test scale-5.2 {FrameWidgetCommand procedure, cget option} {
+test frame-5.2 {FrameWidgetCommand procedure, cget option} {
list [catch {.f cget} msg] $msg
} {1 {wrong # args: should be ".f cget option"}}
-test scale-5.3 {FrameWidgetCommand procedure, cget option} {
+test frame-5.3 {FrameWidgetCommand procedure, cget option} {
list [catch {.f cget a b} msg] $msg
} {1 {wrong # args: should be ".f cget option"}}
-test scale-5.4 {FrameWidgetCommand procedure, cget option} {
+test frame-5.4 {FrameWidgetCommand procedure, cget option} {
list [catch {.f cget -gorp} msg] $msg
} {1 {unknown option "-gorp"}}
-test scale-5.5 {FrameWidgetCommand procedure, cget option} {
+test frame-5.5 {FrameWidgetCommand procedure, cget option} {
.f cget -highlightcolor
} {black}
-test scale-5.6 {FrameWidgetCommand procedure, cget option} {
+test frame-5.6 {FrameWidgetCommand procedure, cget option} {
list [catch {.f cget -screen} msg] $msg
} {1 {unknown option "-screen"}}
-test scale-5.7 {FrameWidgetCommand procedure, cget option} {
+test frame-5.7 {FrameWidgetCommand procedure, cget option} {
catch {destroy .t}
toplevel .t
catch {.t cget -screen}
@@ -470,7 +484,7 @@ test scale-5.7 {FrameWidgetCommand procedure, cget option} {
catch {destroy .t}
test frame-5.8 {FrameWidgetCommand procedure, configure option} {
llength [.f configure]
-} {16}
+} {18}
test frame-5.9 {FrameWidgetCommand procedure, configure option} {
list [catch {.f configure -gorp} msg] $msg
} {1 {unknown option "-gorp"}}
@@ -483,6 +497,9 @@ test frame-5.11 {FrameWidgetCommand procedure, configure option} {
test frame-5.12 {FrameWidgetCommand procedure} {
list [catch {.f swizzle} msg] $msg
} {1 {bad option "swizzle": must be cget or configure}}
+test frame-5.13 {FrameWidgetCommand procedure, configure option} {
+ llength [. configure]
+} {21}
test frame-6.1 {ConfigureFrame procedure} {
catch {destroy .f}
@@ -512,7 +529,7 @@ test frame-7.1 {FrameEventProc procedure} {
lappend result [info commands .frame2]
} {.frame2 {}}
test frame-7.2 {FrameEventProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
frame .f1 -bg #543210
rename .f1 .f2
set x {}
@@ -523,13 +540,13 @@ test frame-7.2 {FrameEventProc procedure} {
} {.f1 #543210 {} {}}
test frame-8.1 {FrameCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
frame .f1
rename .f1 {}
list [info command .f*] [winfo children .]
} {{} {}}
test frame-8.2 {FrameCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
toplevel .f1 -menu .m
wm geometry .f1 +0+0
update
@@ -584,7 +601,7 @@ test frame-9.3 {MapFrame procedure, window deleted while mapping} {
} {0}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test frame-10.1 {frame widget vs hidden commands} {
catch {destroy .t}
@@ -613,6 +630,244 @@ test frame-11.2 {TkInstallFrameMenu - frame renamed} {
list [rename .t foo] [destroy .t] [destroy foo] [destroy .m1]
} {{} {} {} {}}
+test frame-12.1 {FrameWorldChanged procedure} {
+ # Test -bd -padx and -pady
+ destroy .f
+ frame .f -borderwidth 2 -padx 3 -pady 4
+ place .f -x 0 -y 0 -width 40 -height 40
+ pack [frame .f.f] -fill both -expand 1
+ update
+ set result [list [winfo x .f.f] [winfo y .f.f] \
+ [winfo width .f.f] [winfo height .f.f]]
+ destroy .f
+ set result
+} {5 6 30 28}
+test frame-12.2 {FrameWorldChanged procedure} {
+ # Test all -labelanchor positions
+ destroy .f
+ set font {helvetica 12}
+ labelframe .f -highlightthickness 1 -bd 3 -padx 1 -pady 2 -font $font \
+ -text "Mupp"
+ set fh [expr {[font metrics $font -linespace] + 2 - 3}]
+ set fw [expr {[font measure $font "Mupp"] + 2 - 3}]
+ if {$fw < 0} {set fw 0}
+ if {$fh < 0} {set fh 0}
+ place .f -x 0 -y 0 -width 100 -height 100
+ pack [frame .f.f] -fill both -expand 1
+
+ set result {}
+ foreach lp {nw n ne en e es se s sw ws w wn} {
+ .f configure -labelanchor $lp
+ update
+ set expx 5
+ set expy 6
+ set expw 90
+ set exph 88
+ switch -glob $lp {
+ n* {incr expy $fh ; incr exph -$fh}
+ s* {incr exph -$fh}
+ w* {incr expx $fw ; incr expw -$fw}
+ e* {incr expw -$fw}
+ }
+ lappend result [expr {\
+ [winfo x .f.f] == $expx && [winfo y .f.f] == $expy &&\
+ [winfo width .f.f] == $expw && [winfo height .f.f] == $exph}]
+ }
+ destroy .f
+ set result
+} {1 1 1 1 1 1 1 1 1 1 1 1}
+test frame-12.3 {FrameWorldChanged procedure} {
+ # Check reaction on font change
+ destroy .f
+ font create myfont -family courier -size 10
+ labelframe .f -font myfont -text Mupp
+ place .f -x 0 -y 0 -width 40 -height 40
+ pack [frame .f.f] -fill both -expand 1
+ update
+ set h1 [font metrics myfont -linespace]
+ set y1 [winfo y .f.f]
+ font configure myfont -size 20
+ update
+ set h2 [font metrics myfont -linespace]
+ set y2 [winfo y .f.f]
+ destroy .f
+ font delete myfont
+ expr {($h2 - $h1) - ($y2 - $y1)}
+} {0}
+
+test frame-13.1 {labelframe configuration options} {
+ labelframe .f -class NewFrame
+ list [.f configure -class] [catch {.f configure -class Different} msg] $msg
+} {{-class class Class Labelframe NewFrame} 1 {can't modify -class option after widget is created}}
+catch {destroy .f}
+test frame-13.2 {labelframe configuration options} {
+ list [catch {labelframe .f -colormap new} msg] $msg
+} {0 .f}
+catch {destroy .f}
+test frame-13.3 {labelframe configuration options} {
+ list [catch {labelframe .f -visual default} msg] $msg
+} {0 .f}
+catch {destroy .f}
+test frame-13.4 {labelframe configuration options} {
+ list [catch {labelframe .f -screen bogus} msg] $msg
+} {1 {unknown option "-screen"}}
+test frame-13.5 {labelframe configuration options} {
+ set result [list [catch {labelframe .f -container true} msg] $msg \
+ [.f configure -container]]
+ destroy .f
+ set result
+} {0 .f {-container container Container 0 1}}
+test frame-13.6 {labelframe configuration options} {
+ list [catch {labelframe .f -container bogus} msg] $msg
+} {1 {expected boolean value but got "bogus"}}
+test frame-13.7 {labelframe configuration options} {
+ labelframe .f
+ set result [list [catch {.f configure -container 1} msg] $msg]
+ destroy .f
+ set result
+} {1 {can't modify -container option after widget is created}}
+labelframe .f
+set i 8
+foreach test {
+ {-background #ff0000 #ff0000 non-existent
+ {unknown color name "non-existent"}}
+ {-bd 4 4 badValue {bad screen distance "badValue"}}
+ {-bg #00ff00 #00ff00 non-existent
+ {unknown color name "non-existent"}}
+ {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
+ {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-fg #0000ff #0000ff non-existent
+ {unknown color name "non-existent"}}
+ {-font {courier 8} {courier 8} {} {}}
+ {-foreground #ff0000 #ff0000 non-existent
+ {unknown color name "non-existent"}}
+ {-height 100 100 not_a_number {bad screen distance "not_a_number"}}
+ {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"}}
+ {-highlightcolor #123456 #123456 non-existent
+ {unknown color name "non-existent"}}
+ {-highlightthickness 6 6 badValue {bad screen distance "badValue"}}
+ {-labelanchor se se badValue {bad labelanchor "badValue": must be e, en, es, n, ne, nw, s, se, sw, w, wn, or ws}}
+ {-padx 3 3 badValue {bad screen distance "badValue"}}
+ {-pady 4 4 badValue {bad screen distance "badValue"}}
+ {-relief ridge ridge badValue {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-takefocus "any string" "any string" {} {}}
+ {-text "any string" "any string" {} {}}
+ {-width 32 32 badValue {bad screen distance "badValue"}}
+} {
+ set name [lindex $test 0]
+ test frame-13.$i {labelframe configuration options} {
+ .f configure $name [lindex $test 1]
+ lindex [.f configure $name] 4
+ } [lindex $test 2]
+ incr i
+ if {[lindex $test 3] != ""} {
+ test frame-13.$i {labelframe configuration options} {
+ list [catch {.f configure $name [lindex $test 3]} msg] $msg
+ } [list 1 [lindex $test 4]]
+ }
+ .f configure $name [lindex [.f configure $name] 3]
+ incr i
+}
+destroy .f
+
+test frame-14.1 {labelframe labelwidget option} {
+ # Test that label is moved in stacking order
+ destroy .f .l
+ label .l -text Mupp
+ labelframe .f -labelwidget .l
+ pack .f
+ frame .f.f -width 50 -height 50
+ pack .f.f
+ update
+ set res [list [winfo children .] [winfo width .f] \
+ [expr {[winfo height .f] - [winfo height .l]}]]
+ destroy .f .l
+ set res
+} {{.f .l} 54 52}
+test frame-14.2 {labelframe labelwidget option} {
+ # Test the labelframe's reaction if the label is destroyed
+ destroy .f .l
+ label .l -text Aratherlonglabel
+ labelframe .f -labelwidget .l
+ pack .f
+ label .f.l -text Mupp
+ pack .f.l
+ update
+ set res [list [.f cget -labelwidget]]
+ lappend res [expr {[winfo width .f] - [winfo width .l]}]
+ destroy .l
+ lappend res [.f cget -labelwidget]
+ update
+ lappend res [expr {[winfo width .f] - [winfo width .f.l]}]
+ destroy .f
+ set res
+} {.l 12 {} 4}
+test frame-14.3 {labelframe labelwidget option} {
+ # Test the labelframe's reaction if the label is stolen
+ destroy .f .l
+ label .l -text Aratherlonglabel
+ labelframe .f -labelwidget .l
+ pack .f
+ label .f.l -text Mupp
+ pack .f.l
+ update
+ set res [list [.f cget -labelwidget]]
+ lappend res [expr {[winfo width .f] - [winfo width .l]}]
+ pack .l
+ lappend res [.f cget -labelwidget]
+ update
+ lappend res [expr {[winfo width .f] - [winfo width .f.l]}]
+ destroy .f .l
+ set res
+} {.l 12 {} 4}
+test frame-14.4 {labelframe labelwidget option} {
+ # Test the label's reaction if the labelframe is destroyed
+ destroy .f .l
+ label .l -text Mupp
+ labelframe .f -labelwidget .l
+ pack .f
+ update
+ set res [list [winfo manager .l]]
+ destroy .f
+ lappend res [winfo manager .l]
+ destroy .l
+ set res
+} {labelframe {}}
+test frame-14.5 {labelframe labelwidget option} {
+ # Test that the labelframe reacts on changes in label
+ destroy .f .l
+ label .l -text Aratherlonglabel
+ labelframe .f -labelwidget .l
+ pack .f
+ label .f.l -text Mupp
+ pack .f.l
+ update
+ set first [winfo width .f]
+ set res [expr {[winfo width .f] - [winfo width .l]}]
+ .l configure -text Shorter
+ update
+ lappend res [expr {[winfo width .f] - [winfo width .l]}]
+ lappend res [expr {[winfo width .f] < $first}]
+ .l configure -text Alotlongerthananytimebefore
+ update
+ lappend res [expr {[winfo width .f] - [winfo width .l]}]
+ lappend res [expr {[winfo width .f] > $first}]
+ destroy .f .l
+ set res
+} {12 12 1 12 1}
+test frame-14.6 {labelframe labelwidget option} {
+ # Destroying a labelframe with a child label caused a crash
+ # when not handling mapping of the label correctly.
+ # This test does not test anything directly, it's just ment
+ # to catch if the same mistake is made again.
+ destroy .f
+ labelframe .f
+ pack .f
+ label .f.l -text Mupp
+ .f configure -labelwidget .f.l
+ update
+ destroy .f
+} {}
catch {destroy .f}
rename eatColors {}
@@ -621,16 +876,3 @@ rename colorsFree {}
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/geometry.test b/tk/tests/geometry.test
index 5a0c495229b..ca7cfa7d983 100644
--- a/tk/tests/geometry.test
+++ b/tk/tests/geometry.test
@@ -9,13 +9,13 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
wm geometry . 300x300
raise .
update
diff --git a/tk/tests/get.test b/tk/tests/get.test
index 0bfa5b9af9c..3adabbba65e 100644
--- a/tk/tests/get.test
+++ b/tk/tests/get.test
@@ -8,13 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
button .b
test get-1.1 {Tk_GetAnchorFromObj} {
diff --git a/tk/tests/grab.test b/tk/tests/grab.test
new file mode 100644
index 00000000000..c8e87071e01
--- /dev/null
+++ b/tk/tests/grab.test
@@ -0,0 +1,185 @@
+# Tests for the grab command.
+#
+# This file contains a collection of tests for one or more of the Tk
+# built-in commands. Sourcing this file runs the tests and
+# generates output for errors. No output means no errors were found.
+#
+# Copyright (c) 1998-2000 by Ajuba Solutions.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+# There's currently no way to test the actual grab effect, per se,
+# in an automated test. Therefore, this test suite only covers the
+# interface to the grab command (ie, error messages, etc.)
+
+test grab-1.1 {Tk_GrabObjCmd} {
+ list [catch {grab} msg] $msg
+} [list 1 "wrong # args: should be \"grab ?-global? window\" or \"grab option ?arg arg ...?\""]
+test grab-1.2 {Tk_GrabObjCmd} {
+ rename grab grabTest1.2
+ set res [list [catch {grabTest1.2} msg] $msg]
+ rename grabTest1.2 grab
+ set res
+} [list 1 "wrong # args: should be \"grabTest1.2 ?-global? window\" or \"grabTest1.2 option ?arg arg ...?\""]
+
+test grab-1.3 {Tk_GrabObjCmd, "grab ?-global? window"} {
+ list [catch {grab .foo bar baz} msg] $msg
+} [list 1 "wrong # args: should be \"grab ?-global? window\""]
+test grab-1.4 {Tk_GrabObjCmd, "grab ?-global? window"} {
+ catch {destroy .foo}
+ list [catch {grab .foo} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+test grab-1.5 {Tk_GrabObjCmd, "grab ?-global? window"} {
+ list [catch {grab -foo bar} msg] $msg
+} [list 1 "bad option \"-foo\": must be -global"]
+test grab-1.6 {Tk_GrabObjCmd, "grab ?-global? window"} {
+ catch {destroy .foo}
+ list [catch {grab -global .foo} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+
+test grab-1.7 {Tk_GrabObjCmd} {
+ list [catch {grab foo} msg] $msg
+} [list 1 "bad option \"foo\": must be current, release, set, or status"]
+
+test grab-1.8 {Tk_GrabObjCmd, "grab current ?window?"} {
+ list [catch {grab current foo bar} msg] $msg
+} [list 1 "wrong # args: should be \"grab current ?window?\""]
+test grab-1.9 {Tk_GrabObjCmd, "grab current ?window?"} {
+ catch {destroy .foo}
+ list [catch {grab current .foo} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+
+test grab-1.10 {Tk_GrabObjCmd, "grab release window"} {
+ list [catch {grab release} msg] $msg
+} [list 1 "wrong # args: should be \"grab release window\""]
+test grab-1.11 {Tk_GrabObjCmd, "grab release window"} {
+ catch {destroy .foo}
+ list [catch {grab release .foo} msg] $msg
+} [list 0 ""]
+test grab-1.12 {Tk_GrabObjCmd, "grab release window"} {
+ list [catch {grab release foo} msg] $msg
+} [list 0 ""]
+
+test grab-1.13 {Tk_GrabObjCmd, "grab set ?-global? window"} {
+ list [catch {grab set} msg] $msg
+} [list 1 "wrong # args: should be \"grab set ?-global? window\""]
+test grab-1.14 {Tk_GrabObjCmd, "grab set ?-global? window"} {
+ list [catch {grab set foo bar baz} msg] $msg
+} [list 1 "wrong # args: should be \"grab set ?-global? window\""]
+test grab-1.15 {Tk_GrabObjCmd, "grab set ?-global? window"} {
+ catch {destroy .foo}
+ list [catch {grab set .foo} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+test grab-1.16 {Tk_GrabObjCmd, "grab set ?-global? window"} {
+ list [catch {grab set -foo bar} msg] $msg
+} [list 1 "bad option \"-foo\": must be -global"]
+test grab-1.17 {Tk_GrabObjCmd, "grab set ?-global? window"} {
+ catch {destroy .foo}
+ list [catch {grab set -global .foo} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+
+test grab-1.18 {Tk_GrabObjCmd, "grab status window"} {
+ list [catch {grab status} msg] $msg
+} [list 1 "wrong # args: should be \"grab status window\""]
+test grab-1.19 {Tk_GrabObjCmd, "grab status window"} {
+ list [catch {grab status foo bar} msg] $msg
+} [list 1 "wrong # args: should be \"grab status window\""]
+test grab-1.20 {Tk_GrabObjCmd, "grab status window"} {
+ catch {destroy .foo}
+ list [catch {grab status .foo} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+
+test grab-2.1 {Tk_GrabObjCmd, grab status gives correct status} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ set result [grab status .]
+ grab release .
+ set result
+} "none"
+test grab-2.2 {Tk_GrabObjCmd, grab status gives correct status} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ grab .
+ set result [grab status .]
+ grab release .
+ set result
+} "local"
+test grab-2.3 {Tk_GrabObjCmd, grab status gives correct status} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ grab -global .
+ set result [grab status .]
+ grab release .
+ set result
+} "global"
+
+test grab-3.1 {Tk_GrabObjCmd, grab current gives correct information} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ set curr
+} ""
+test grab-3.2 {Tk_GrabObjCmd, grab current gives correct information} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ grab .
+ set curr [grab current]
+ grab release .
+ set curr
+} "."
+
+test grab-4.1 {Tk_GrabObjCmd, grab release releases grab} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ grab .
+ set result [grab status .]
+ grab release .
+ lappend result [grab status .]
+ grab -global .
+ lappend result [grab status .]
+ grab release .
+ lappend result [grab status .]
+} [list "local" "none" "global" "none"]
+
+test grab-5.1 {Tk_GrabObjCmd, grab set} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ grab set .
+ set result [list [grab current .] [grab status .]]
+ grab release .
+ set result
+} [list "." "local"]
+test grab-5.2 {Tk_GrabObjCmd, grab set} {
+ set curr [grab current .]
+ if { [string length $curr] > 0 } {
+ grab release $curr
+ }
+ grab set -global .
+ set result [list [grab current .] [grab status .]]
+ grab release .
+ set result
+} [list "." "global"]
+
+tcltest::cleanupTests
+return
diff --git a/tk/tests/grid.test b/tk/tests/grid.test
index e9720cb9480..ddd398f8775 100644
--- a/tk/tests/grid.test
+++ b/tk/tests/grid.test
@@ -7,9 +7,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# helper routine to return "." to a sane state after a test
# The variable GRID_VERBOSE can be used to "look" at the result
@@ -28,10 +31,10 @@ proc grid_reset {{test ?} {top .}} {
update
foreach {cols rows} [grid size .] {}
for {set i 0} {$i <= $cols} {incr i} {
- grid columnconfigure . $i -weight 0 -minsize 0 -pad 0
+ grid columnconfigure . $i -weight 0 -minsize 0 -pad 0 -uniform ""
}
for {set i 0} {$i <= $rows} {incr i} {
- grid rowconfigure . $i -weight 0 -minsize 0 -pad 0
+ grid rowconfigure . $i -weight 0 -minsize 0 -pad 0 -uniform ""
}
grid propagate . 1
update
@@ -46,7 +49,7 @@ test grid-1.1 {basic argument checking} {
test grid-1.2 {basic argument checking} {
list [catch {grid foo bar} msg] $msg
-} {1 {bad option "foo": must be bbox, columnconfigure, configure, forget, info, location, propagate, remove, rowconfigure, size, or slaves.}}
+} {1 {bad option "foo": must be bbox, columnconfigure, configure, forget, info, location, propagate, remove, rowconfigure, size, or slaves}}
test grid-1.3 {basic argument checking} {
button .b
@@ -68,6 +71,22 @@ test grid-1.6 {basic argument checking} {
list [catch {grid x} msg] $msg
} {1 {can't determine master window}}
+test grid-1.7 {basic argument checking} {
+ list [catch {grid configure x} msg] $msg
+} {1 {can't determine master window}}
+
+test grid-1.8 {basic argument checking} {
+ button .b
+ list [catch {grid x .b} msg] $msg
+} {0 {}}
+grid_reset 1.8
+
+test grid-1.9 {basic argument checking} {
+ button .b
+ list [catch {grid configure x .b} msg] $msg
+} {0 {}}
+grid_reset 1.9
+
test grid-2.1 {bbox} {
list [catch {grid bbox .} msg] $msg
} {0 {0 0 0 0}}
@@ -82,7 +101,7 @@ test grid-2.2 {bbox} {
test grid-2.3 {bbox: argument checking} {
list [catch {grid bbox . 0 0 5} msg] $msg
-} {1 {wrong number of arguments: must be "grid bbox master ?column row ?column row??"}}
+} {1 {wrong # args: should be "grid bbox master ?column row ?column row??"}}
test grid-2.4 {bbox} {
list [catch {grid bbox .bad 0 0} msg] $msg
@@ -175,6 +194,19 @@ test grid-3.7 {configure: basic argument checking} {
} {1 {can't put .f.b inside .}}
grid_reset 3.7
+test grid-3.8 {configure: basic argument checking} {
+ button .b
+ grid configure x .b
+ grid slaves .
+} {.b}
+grid_reset 3.8
+
+test grid-3.9 {configure: basic argument checking} {
+ button .b
+ list [catch {grid configure y .b} msg] $msg
+} {1 {invalid window shortcut, "y" should be '-', 'x', or '^'}}
+grid_reset 3.9
+
test grid-4.1 {forget: basic argument checking} {
list [catch {grid forget foo} msg] $msg
} {1 {bad window path name "foo"}}
@@ -198,6 +230,15 @@ test grid-4.3 {forget} {
} {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}
grid_reset 4.3
+test grid-4.3.1 {forget} {
+ button .c
+ grid .c -row 2 -column 2 -rowspan 2 -columnspan 2 -padx {3 5} -pady {4 7} -sticky ns
+ grid forget .c
+ grid .c -row 0 -column 0
+ grid info .c
+} {-in . -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 0 -ipady 0 -padx 0 -pady 0 -sticky {}}
+grid_reset 4.3.1
+
test grid-4.4 {forget, calling Tk_UnmaintainGeometry} {
frame .f -bd 2 -relief raised
place .f -x 10 -y 20 -width 200 -height 100
@@ -476,19 +517,19 @@ test grid-9.3 {slaves} {
test grid-9.4 {slaves} {
list [catch {grid slaves . a b} msg] $msg
-} {1 {invalid args: should be "grid slaves window ?-option value...?"}}
+} {1 {bad option "a": must be -column or -row}}
test grid-9.5 {slaves} {
- list [catch {grid slaves . -foo x} msg] $msg
+ list [catch {grid slaves . -column x} msg] $msg
} {1 {expected integer but got "x"}}
test grid-9.6 {slaves} {
- list [catch {grid slaves . -foo -3} msg] $msg
-} {1 {-foo is an invalid value: should NOT be < 0}}
+ list [catch {grid slaves . -row -3} msg] $msg
+} {1 {-row is an invalid value: should NOT be < 0}}
test grid-9.7 {slaves} {
list [catch {grid slaves . -foo 3} msg] $msg
-} {1 {-foo is an invalid option: should be "-row, -column"}}
+} {1 {bad option "-foo": must be -column or -row}}
test grid-9.8 {slaves} {
list [catch {grid slaves .x -row 3} msg] $msg
@@ -554,12 +595,12 @@ grid_reset 10.5
test grid-10.6 {column/row configure} {
list [catch {grid columnconfigure . 0} msg] $msg
-} {0 {-minsize 0 -pad 0 -weight 0}}
+} {0 {-minsize 0 -pad 0 -uniform {} -weight 0}}
grid_reset 10.6
test grid-10.7 {column/row configure} {
list [catch {grid columnconfigure . 0 -foo} msg] $msg
-} {1 {invalid arg "-foo": expecting -minsize, -pad, or -weight.}}
+} {1 {bad option "-foo": must be -minsize, -pad, -uniform, or -weight}}
grid_reset 10.7
test grid-10.8 {column/row configure} {
@@ -581,34 +622,34 @@ grid_reset 10.10
test grid-10.11 {column/row configure} {
list [catch {grid columnconfigure . 0 -weight bad} msg] $msg
} {1 {expected integer but got "bad"}}
-grid_reset 10.10a
+grid_reset 10.11
test grid-10.12 {column/row configure} {
list [catch {grid columnconfigure . 0 -weight -3} msg] $msg
} {1 {invalid arg "-weight": should be non-negative}}
-grid_reset 10.11
+grid_reset 10.12
test grid-10.13 {column/row configure} {
grid columnconfigure . 0 -weight 3
grid columnconfigure . 0 -weight
} {3}
-grid_reset 10.12
+grid_reset 10.13
test grid-10.14 {column/row configure} {
list [catch {grid columnconfigure . 0 -pad foo} msg] $msg
} {1 {bad screen distance "foo"}}
-grid_reset 10.13
+grid_reset 10.14
test grid-10.15 {column/row configure} {
list [catch {grid columnconfigure . 0 -pad -3} msg] $msg
} {1 {invalid arg "-pad": should be non-negative}}
-grid_reset 10.14
+grid_reset 10.15
test grid-10.16 {column/row configure} {
grid columnconfigure . 0 -pad 3
grid columnconfigure . 0 -pad
} {3}
-grid_reset 10.15
+grid_reset 10.16
test grid-10.17 {column/row configure} {
frame .f
@@ -624,17 +665,30 @@ test grid-10.17 {column/row configure} {
grid columnconfigure .f 0 -weight 0
set a
} {0 1 0 1}
-grid_reset 10.16
+grid_reset 10.17
test grid-10.18 {column/row configure} {
frame .f
- grid columnconfigure .f 0 -minsize 10 -weight 1
+ grid columnconfigure .f {0 2} -minsize 10 -weight 1
list [grid columnconfigure .f 0 -minsize] \
[grid columnconfigure .f 1 -minsize] \
+ [grid columnconfigure .f 2 -minsize] \
[grid columnconfigure .f 0 -weight] \
- [grid columnconfigure .f 1 -weight]
-} {10 0 1 0}
-grid_reset 10.17
+ [grid columnconfigure .f 1 -weight] \
+ [grid columnconfigure .f 2 -weight]
+} {10 0 10 1 0 1}
+grid_reset 10.18
+
+test grid-10.19 {column/row configure} {
+ list [catch {grid columnconfigure . {0 -1 2} -weight 1} msg] $msg
+} {1 {grid columnconfigure: "-1" is out of range}}
+grid_reset 10.19
+
+test grid-10.20 {column/row configure} {
+ grid columnconfigure . 0 -uniform foo
+ grid columnconfigure . 0 -uniform
+} {foo}
+grid_reset 10.20
# auto-placement tests
@@ -779,7 +833,7 @@ grid_reset 11.13
test grid-11.14 {default widget placement} {
foreach i {1 2 3} {
- frame .f$i -width 50 -height 50 -highlightthickness 0 -bg red
+ frame .f$i -width 60 -height 60 -highlightthickness 0 -bg red
}
grid .f1 .f2
grid ^ .f3
@@ -790,7 +844,7 @@ test grid-11.14 {default widget placement} {
[winfo width .f$i],[winfo height .f$i]"
}
set a
-} {{0,25 50,50} {50,0 50,50} {50,50 50,50}}
+} {{0,30 60,60} {60,0 60,60} {60,60 60,60}}
grid_reset 11.14
test grid-11.15 {^ ^ test with multiple windows} {
@@ -809,6 +863,34 @@ test grid-11.15 {^ ^ test with multiple windows} {
} {{0,0 50,50} {50,0 50,100} {100,0 50,100} {0,50 50,50}}
grid_reset 11.15
+test grid-11.16 {default widget placement} {
+ foreach l {a b c d e} {
+ frame .$l -width 50 -height 50
+ }
+ grid .a .b .c .d -sticky news
+ grid x ^ x .e -sticky news
+ update
+ set res ""
+ lappend res [winfo height .a]
+ lappend res [winfo height .b]
+ lappend res [winfo height .c]
+} {50 100 50}
+grid_reset 11.16
+
+test grid-11.17 {default widget placement} {
+ foreach l {a b c d e} {
+ frame .$l -width 50 -height 50
+ }
+ grid .a .b .c .d -sticky news
+ grid ^ x ^ .e -sticky news
+ update
+ set res ""
+ lappend res [winfo height .a]
+ lappend res [winfo height .b]
+ lappend res [winfo height .c]
+} {100 50 100}
+grid_reset 11.17
+
test grid-12.1 {-sticky} {
catch {unset data}
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
@@ -884,6 +966,12 @@ test grid-13.4 {-ipadx} {
} {1 {bad ipadx value "x": must be positive screen distance}}
grid_reset 13.4
+test grid-13.4.1 {-ipadx} {
+ frame .f -width 20 -height 20 -highlightthickness 0 -bg red
+ list [catch "grid .f -ipadx {5 5}" msg] $msg
+} {1 {bad ipadx value "5 5": must be positive screen distance}}
+grid_reset 13.4.1
+
test grid-13.5 {-ipadx} {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
@@ -901,6 +989,12 @@ test grid-13.6 {-ipady} {
} {1 {bad ipady value "x": must be positive screen distance}}
grid_reset 13.6
+test grid-13.6.1 {-ipady} {
+ frame .f -width 20 -height 20 -highlightthickness 0 -bg red
+ list [catch "grid .f -ipady {5 5}" msg] $msg
+} {1 {bad ipady value "5 5": must be positive screen distance}}
+grid_reset 13.6.1
+
test grid-13.7 {-ipady} {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
@@ -915,9 +1009,15 @@ grid_reset 13.7
test grid-13.8 {-padx} {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
list [catch "grid .f -padx x" msg] $msg
-} {1 {bad padx value "x": must be positive screen distance}}
+} {1 {bad pad value "x": must be positive screen distance}}
grid_reset 13.8
+test grid-13.8.1 {-padx} {
+ frame .f -width 20 -height 20 -highlightthickness 0 -bg red
+ list [catch "grid .f -padx {10 x}" msg] $msg
+} {1 {bad 2nd pad value "x": must be positive screen distance}}
+grid_reset 13.8.1
+
test grid-13.9 {-padx} {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
@@ -925,16 +1025,33 @@ test grid-13.9 {-padx} {
set a "[winfo width .f] [winfo width .]"
grid .f -padx 1
update
- list $a "[winfo width .f] [winfo width .]"
-} {{200 200} {200 202}}
+ list $a "[winfo width .f] [winfo width .] [winfo x .f]"
+} {{200 200} {200 202 1}}
grid_reset 13.9
+test grid-13.9.1 {-padx} {
+ frame .f -width 200 -height 100 -highlightthickness 0 -bg red
+ grid .f
+ update
+ set a "[winfo width .f] [winfo width .]"
+ grid .f -padx {10 5}
+ update
+ list $a "[winfo width .f] [winfo width .] [winfo x .f]"
+} {{200 200} {200 215 10}}
+grid_reset 13.9.1
+
test grid-13.10 {-pady} {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
list [catch "grid .f -pady x" msg] $msg
-} {1 {bad pady value "x": must be positive screen distance}}
+} {1 {bad pad value "x": must be positive screen distance}}
grid_reset 13.10
+test grid-13.10.1 {-pady} {
+ frame .f -width 20 -height 20 -highlightthickness 0 -bg red
+ list [catch "grid .f -pady {10 x}" msg] $msg
+} {1 {bad 2nd pad value "x": must be positive screen distance}}
+grid_reset 13.10.1
+
test grid-13.11 {-pady} {
frame .f -width 200 -height 100 -highlightthickness 0 -bg red
grid .f
@@ -942,10 +1059,21 @@ test grid-13.11 {-pady} {
set a "[winfo height .f] [winfo height .]"
grid .f -pady 1
update
- list $a "[winfo height .f] [winfo height .]"
-} {{100 100} {100 102}}
+ list $a "[winfo height .f] [winfo height .] [winfo y .f]"
+} {{100 100} {100 102 1}}
grid_reset 13.11
+test grid-13.11.1 {-pady} {
+ frame .f -width 200 -height 100 -highlightthickness 0 -bg red
+ grid .f
+ update
+ set a "[winfo height .f] [winfo height .]"
+ grid .f -pady {4 16}
+ update
+ list $a "[winfo height .f] [winfo height .] [winfo y .f]"
+} {{100 100} {100 120 4}}
+grid_reset 13.11.1
+
test grid-13.12 {-ipad x and y} {
frame .f -width 20 -height 20 -highlightthickness 0 -bg red
grid columnconfigure . 0 -minsize 150
@@ -1217,6 +1345,86 @@ test grid-16.8 {layout internal constraints} {
}
set a
} {0 30 70 250 280 , 0 30 130 230 260 , 0 30 113 197 280 , 0 30 60 90 120 }
+grid_reset 16.8
+
+test grid-16.9 {layout uniform} {
+ frame .f1 -width 75 -height 50
+ frame .f2 -width 60 -height 25
+ frame .f3 -width 95 -height 75
+ frame .f4 -width 135 -height 100
+ frame .f5 -width 80 -height 40
+ for {set t 1} {$t <= 5} {incr t} {
+ grid .f$t
+ }
+ grid rowconfigure . {0 2} -uniform a
+ grid rowconfigure . {1 3} -uniform b
+ update
+ list [grid bbox . 0 0] [grid bbox . 0 1] [grid bbox . 0 2] \
+ [grid bbox . 0 3] [grid bbox . 0 4]
+} {{0 0 135 75} {0 75 135 100} {0 175 135 75} {0 250 135 100} {0 350 135 40}}
+grid_reset 16.9
+
+test grid-16.10 {layout uniform} {
+ grid [frame .f1 -width 75 -height 50] -row 0 -column 0
+ grid [frame .f2 -width 60 -height 30] -row 1 -column 2
+ grid [frame .f3 -width 95 -height 90] -row 2 -column 1
+ grid [frame .f4 -width 60 -height 100] -row 3 -column 4
+ grid [frame .f5 -width 60 -height 40] -row 4 -column 3
+
+ grid rowconfigure . {0 1} -uniform a
+ grid rowconfigure . {2 4} -uniform b
+ grid rowconfigure . {0 2} -weight 2
+ grid columnconfigure . {0 2} -uniform a
+ grid columnconfigure . {3 4} -uniform b
+ grid columnconfigure . {2 4} -weight 2
+ grid columnconfigure . 3 -minsize 70
+ grid columnconfigure . 4 -minsize 130
+ update
+ list [grid bbox . 0 0] [grid bbox . 2 1] [grid bbox . 1 2] \
+ [grid bbox . 4 3] [grid bbox . 3 4]
+} {{0 0 75 60} {170 60 150 30} {75 90 95 90} {390 180 140 100} {320 280 70 45}}
+grid_reset 16.10
+
+test grid-16.11 {layout uniform (shrink)} {
+ frame .f1 -width 75 -height 50
+ frame .f2 -width 100 -height 95
+ grid .f1 .f2 -sticky news
+ grid columnconfigure . {0 1} -uniform a
+ grid columnconfigure . 0 -weight 1
+ update
+ set res {}
+ lappend res [grid bbox . 0 0] [grid bbox . 1 0]
+ grid propagate . 0
+ . configure -width 150 -height 95
+ update
+ lappend res [grid bbox . 0 0] [grid bbox . 1 0]
+} {{0 0 100 95} {100 0 100 95} {0 0 50 95} {50 0 100 95}}
+grid_reset 16.11
+
+test grid-16.12 {layout uniform (grow)} {
+ frame .f1 -width 40 -height 50
+ frame .f2 -width 50 -height 95
+ frame .f3 -width 60 -height 50
+ frame .f4 -width 70 -height 95
+ grid .f1 .f2 .f3 .f4 -sticky news
+ grid columnconfigure . {0 1 2} -uniform a
+ # Put weight 2 on the biggest in the group to see that the groups
+ # adapts to one of the smaller.
+ grid columnconfigure . 2 -weight 2
+ grid columnconfigure . {0 3} -weight 1
+ update
+ set res {}
+ lappend res [grid bbox . 0 0] [grid bbox . 1 0]
+ lappend res [grid bbox . 2 0] [grid bbox . 3 0]
+
+ grid propagate . 0
+ . configure -width 350 -height 95
+ update
+ lappend res [grid bbox . 0 0] [grid bbox . 1 0]
+ lappend res [grid bbox . 2 0] [grid bbox . 3 0]
+} [list {0 0 50 95} {50 0 50 95} {100 0 100 95} {200 0 70 95} \
+ {0 0 70 95} {70 0 50 95} {120 0 140 95} {260 0 90 95}]
+grid_reset 16.12
test grid-17.1 {forget and pending idle handlers} {
# This test is intended to detect a crash caused by a failure to remove
@@ -1241,20 +1449,54 @@ test grid-17.1 {forget and pending idle handlers} {
set result ok
} ok
+test grid-18.1 {test respect for internalborder} {
+ toplevel .pack
+ wm geometry .pack 200x200
+ frame .pack.l -width 15 -height 10
+ labelframe .pack.lf -labelwidget .pack.l
+ pack .pack.lf -fill both -expand 1
+ frame .pack.lf.f
+ grid .pack.lf.f -sticky news
+ grid columnconfigure .pack.lf 0 -weight 1
+ grid rowconfigure .pack.lf 0 -weight 1
+ update
+ set res [list [winfo geometry .pack.lf.f]]
+ .pack.lf configure -labelanchor e -padx 3 -pady 5
+ update
+ lappend res [winfo geometry .pack.lf.f]
+ destroy .pack
+ set res
+} {196x188+2+10 177x186+5+7}
+test grid-18.2 {test support for minreqsize} {
+ toplevel .pack
+ wm geometry .pack {}
+ frame .pack.l -width 150 -height 100
+ labelframe .pack.lf -labelwidget .pack.l
+ pack .pack.lf -fill both -expand 1
+ frame .pack.lf.f -width 20 -height 25
+ grid .pack.lf.f
+ update
+ set res [list [winfo geometry .pack.lf]]
+ .pack.lf configure -labelanchor ws
+ update
+ lappend res [winfo geometry .pack.lf]
+ destroy .pack
+ set res
+} {162x127+0+0 172x112+0+0}
+
+test grid-19.1 {uniform realloc} {
+ # Use a lot of uniform groups to test the reallocation mechanism
+ for {set t 0} {$t < 100} {incr t 2} {
+ frame .fa$t -width 5 -height 20
+ frame .fb$t -width 6 -height 20
+ grid .fa$t .fb$t -row 0 -column $t -sticky news
+ grid columnconfigure . [list $t [expr {$t + 1}]] -uniform a$t
+ }
+ update
+ grid bbox .
+} {0 0 600 20}
+grid_reset 19.1
+
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/id.test b/tk/tests/id.test
index 91d75c6112a..c5a19f98fed 100644
--- a/tk/tests/id.test
+++ b/tk/tests/id.test
@@ -8,24 +8,14 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[string compare testwrapper [info commands testwrapper]] != 0} {
- puts "This application hasn't been compiled with the testwrapper command,"
- puts "therefore I am skipping all of these tests."
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
-
-test id-1.1 {WindowIdCleanup, delaying window release} {unixOnly} {
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+test id-1.1 {WindowIdCleanup, delaying window release} {unixOnly testwrapper} {
bind all <Destroy> {lappend x %W}
catch {unset map}
frame .f
diff --git a/tk/tests/image.test b/tk/tests/image.test
index ea0f0be00d5..4ef07e0b03e 100644
--- a/tk/tests/image.test
+++ b/tk/tests/image.test
@@ -9,23 +9,16 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+namespace import -force tcltest::interpreter
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
eval image delete [image names]
canvas .c -highlightthickness 2
@@ -36,23 +29,23 @@ test image-1.1 {Tk_ImageCmd procedure, "create" option} {
} {1 {wrong # args: should be "image option ?args?"}}
test image-1.2 {Tk_ImageCmd procedure, "create" option} {
list [catch {image gorp} msg] $msg
-} {1 {bad option "gorp": must be create, delete, height, names, type, types, or width}}
+} {1 {bad option "gorp": must be create, delete, height, inuse, names, type, types, or width}}
test image-1.3 {Tk_ImageCmd procedure, "create" option} {
list [catch {image create} msg] $msg
} {1 {wrong # args: should be "image create type ?name? ?options?"}}
test image-1.4 {Tk_ImageCmd procedure, "create" option} {
list [catch {image c bad_type} msg] $msg
} {1 {image type "bad_type" doesn't exist}}
-test image-1.5 {Tk_ImageCmd procedure, "create" option} {
+test image-1.5 {Tk_ImageCmd procedure, "create" option} testImageType {
list [image create test myimage] [image names]
} {myimage myimage}
-test image-1.6 {Tk_ImageCmd procedure, "create" option} {
+test image-1.6 {Tk_ImageCmd procedure, "create" option} testImageType {
scan [image create test] image%d first
image create test myimage
scan [image create test -variable x] image%d second
expr $second-$first
} {1}
-test image-1.7 {Tk_ImageCmd procedure, "create" option} {
+test image-1.7 {Tk_ImageCmd procedure, "create" option} testImageType {
image delete myimage
image create test myimage -variable x
.c create image 100 50 -image myimage
@@ -63,7 +56,7 @@ test image-1.7 {Tk_ImageCmd procedure, "create" option} {
update
set x
} {{myimage free} {myimage free} {myimage delete} {myimage get} {myimage get} {myimage display 0 0 30 15 30 30} {myimage display 0 0 30 15 30 130}}
-test image-1.8 {Tk_ImageCmd procedure, "create" option} {
+test image-1.8 {Tk_ImageCmd procedure, "create" option} testImageType {
.c delete all
image create test myimage -variable x
.c create image 100 50 -image myimage
@@ -75,16 +68,27 @@ test image-1.8 {Tk_ImageCmd procedure, "create" option} {
update
set x
} {{myimage get} {myimage get} {myimage display 0 0 30 15 30 30} {myimage display 0 0 30 15 30 130}}
-test image-1.9 {Tk_ImageCmd procedure, "create" option} {
+test image-1.9 {Tk_ImageCmd procedure, "create" option} testImageType {
.c delete all
eval image delete [image names]
list [catch {image create test -badName foo} msg] $msg [image names]
} {1 {bad option name "-badName"} {}}
+test image-1.10 {Tk_ImageCmd procedure, "create" option with "." as name} {
+ set script [makeFile {
+ update
+ puts [list [catch {image create photo .} msg] $msg]
+ exit
+ } script]
+ set x [list [catch {exec [interpreter] <$script} msg] $msg]
+ removeFile script
+ set x
+} {0 {1 {this isn't a Tk applicationNULL main window}}}
+# I don't like the error message!
test image-2.1 {Tk_ImageCmd procedure, "delete" option} {
list [catch {image delete} msg] $msg
} {0 {}}
-test image-2.2 {Tk_ImageCmd procedure, "delete" option} {
+test image-2.2 {Tk_ImageCmd procedure, "delete" option} testImageType {
.c delete all
eval image delete [image names]
image create test myimage
@@ -94,7 +98,7 @@ test image-2.2 {Tk_ImageCmd procedure, "delete" option} {
image d myimage img2
lappend result [image names]
} {{img2 myimage} {}}
-test image-2.3 {Tk_ImageCmd procedure, "delete" option} {
+test image-2.3 {Tk_ImageCmd procedure, "delete" option} testImageType {
.c delete all
eval image delete [image names]
image create test myimage
@@ -111,7 +115,7 @@ test image-3.2 {Tk_ImageCmd procedure, "height" option} {
test image-3.3 {Tk_ImageCmd procedure, "height" option} {
list [catch {image height foo} msg] $msg
} {1 {image "foo" doesn't exist}}
-test image-3.4 {Tk_ImageCmd procedure, "height" option} {
+test image-3.4 {Tk_ImageCmd procedure, "height" option} testImageType {
image create test myimage
set x [image h myimage]
myimage changed 0 0 0 0 60 50
@@ -121,7 +125,7 @@ test image-3.4 {Tk_ImageCmd procedure, "height" option} {
test image-4.1 {Tk_ImageCmd procedure, "names" option} {
list [catch {image names x} msg] $msg
} {1 {wrong # args: should be "image names"}}
-test image-4.2 {Tk_ImageCmd procedure, "names" option} {
+test image-4.2 {Tk_ImageCmd procedure, "names" option} testImageType {
.c delete all
eval image delete [image names]
image create test myimage
@@ -144,11 +148,11 @@ test image-5.2 {Tk_ImageCmd procedure, "type" option} {
test image-5.3 {Tk_ImageCmd procedure, "type" option} {
list [catch {image type foo} msg] $msg
} {1 {image "foo" doesn't exist}}
-test image-5.4 {Tk_ImageCmd procedure, "type" option} {
+test image-5.4 {Tk_ImageCmd procedure, "type" option} testImageType {
image create test myimage
image type myimage
} {test}
-test image-5.5 {Tk_ImageCmd procedure, "type" option} {
+test image-5.5 {Tk_ImageCmd procedure, "type" option} testImageType {
image create test myimage
.c create image 50 50 -image myimage
image delete myimage
@@ -158,7 +162,7 @@ test image-5.5 {Tk_ImageCmd procedure, "type" option} {
test image-6.1 {Tk_ImageCmd procedure, "types" option} {
list [catch {image types x} msg] $msg
} {1 {wrong # args: should be "image types"}}
-test image-6.2 {Tk_ImageCmd procedure, "types" option} {
+test image-6.2 {Tk_ImageCmd procedure, "types" option} testImageType {
lsort [image types]
} {bitmap photo test}
@@ -171,14 +175,28 @@ test image-7.2 {Tk_ImageCmd procedure, "width" option} {
test image-7.3 {Tk_ImageCmd procedure, "width" option} {
list [catch {image width foo} msg] $msg
} {1 {image "foo" doesn't exist}}
-test image-7.4 {Tk_ImageCmd procedure, "width" option} {
+test image-7.4 {Tk_ImageCmd procedure, "width" option} testImageType {
image create test myimage
set x [image w myimage]
myimage changed 0 0 0 0 60 50
list $x [image width myimage]
} {30 60}
-test image-8.1 {Tk_ImageChanged procedure} {
+test image-8.1 {Tk_ImageCmd procedure, "inuse" option} testImageType {
+ catch {image delete myimage2}
+ image create test myimage2
+ set res {}
+ lappend res [image inuse myimage2]
+ catch {destroy .b}
+ button .b -image myimage2
+ lappend res [image inuse myimage2]
+ catch {destroy .b}
+ image delete myimage2
+ set res
+} [list 0 1]
+
+
+test image-9.1 {Tk_ImageChanged procedure} testImageType {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -189,7 +207,7 @@ test image-8.1 {Tk_ImageChanged procedure} {
update
set x
} {{foo display 5 6 7 8 30 30}}
-test image-8.2 {Tk_ImageChanged procedure} {
+test image-9.2 {Tk_ImageChanged procedure} testImageType {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -202,10 +220,10 @@ test image-8.2 {Tk_ImageChanged procedure} {
set x
} {{foo display 5 6 25 9 30 30} {foo display 0 0 12 14 65 74}}
-test image-9.1 {Tk_GetImage procedure} {
+test image-10.1 {Tk_GetImage procedure} {
list [catch {.c create image 100 10 -image bad_name} msg] $msg
} {1 {image "bad_name" doesn't exist}}
-test image-9.2 {Tk_GetImage procedure} {
+test image-10.2 {Tk_GetImage procedure} testImageType {
image create test mytest
catch {destroy .l}
label .l -image mytest
@@ -215,7 +233,7 @@ test image-9.2 {Tk_GetImage procedure} {
set result
} {1 {image "mytest" doesn't exist}}
-test image-10.1 {Tk_FreeImage procedure} {
+test image-11.1 {Tk_FreeImage procedure} testImageType {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -229,7 +247,7 @@ test image-10.1 {Tk_FreeImage procedure} {
update
list [image names] $x
} {foo {{foo free} {foo display 0 0 30 15 103 121}}}
-test image-10.2 {Tk_FreeImage procedure} {
+test image-11.2 {Tk_FreeImage procedure} testImageType {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -247,8 +265,8 @@ test image-10.2 {Tk_FreeImage procedure} {
# Non-portable, apparently due to differences in rounding:
-test image-11.1 {Tk_RedrawImage procedure, redisplay area clipping} \
- {nonPortable} {
+test image-12.1 {Tk_RedrawImage procedure, redisplay area clipping} \
+ {testImageType nonPortable} {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -259,8 +277,8 @@ test image-11.1 {Tk_RedrawImage procedure, redisplay area clipping} \
update
set x
} {{foo display 0 0 5 5 50 50}}
-test image-11.2 {Tk_RedrawImage procedure, redisplay area clipping} \
- {nonPortable} {
+test image-12.2 {Tk_RedrawImage procedure, redisplay area clipping} \
+ {testImageType nonPortable} {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -271,8 +289,8 @@ test image-11.2 {Tk_RedrawImage procedure, redisplay area clipping} \
update
set x
} {{foo display 10 0 20 5 30 50}}
-test image-11.3 {Tk_RedrawImage procedure, redisplay area clipping} \
- {nonPortable} {
+test image-12.3 {Tk_RedrawImage procedure, redisplay area clipping} \
+ {testImageType nonPortable} {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -283,8 +301,8 @@ test image-11.3 {Tk_RedrawImage procedure, redisplay area clipping} \
update
set x
} {{foo display 10 10 20 5 30 30}}
-test image-11.4 {Tk_RedrawImage procedure, redisplay area clipping} \
- {nonPortable} {
+test image-12.4 {Tk_RedrawImage procedure, redisplay area clipping} \
+ {testImageType nonPortable} {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -295,8 +313,8 @@ test image-11.4 {Tk_RedrawImage procedure, redisplay area clipping} \
update
set x
} {{foo display 0 10 5 5 50 30}}
-test image-11.5 {Tk_RedrawImage procedure, redisplay area clipping} \
- {nonPortable} {
+test image-12.5 {Tk_RedrawImage procedure, redisplay area clipping} \
+ {testImageType nonPortable} {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -307,8 +325,8 @@ test image-11.5 {Tk_RedrawImage procedure, redisplay area clipping} \
update
set x
} {{foo display 0 0 30 15 70 70}}
-test image-11.6 {Tk_RedrawImage procedure, redisplay area clipping} \
- {nonPortable} {
+test image-12.6 {Tk_RedrawImage procedure, redisplay area clipping} \
+ {testImageType nonPortable} {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -320,7 +338,7 @@ test image-11.6 {Tk_RedrawImage procedure, redisplay area clipping} \
set x
} {{foo display 5 5 20 5 30 30}}
-test image-12.1 {Tk_SizeOfImage procedure} {
+test image-13.1 {Tk_SizeOfImage procedure} testImageType {
eval image delete [image names]
image create test foo -variable x
set result [list [image width foo] [image height foo]]
@@ -328,7 +346,7 @@ test image-12.1 {Tk_SizeOfImage procedure} {
lappend result [image width foo] [image height foo]
} {30 15 85 60}
-test image-12.2 {DeleteImage procedure} {
+test image-13.2 {DeleteImage procedure} testImageType {
.c delete all
eval image delete [image names]
image create test foo -variable x
@@ -345,7 +363,7 @@ catch {image delete hidden}
set l [image names]
set h [interp hidden]
-test image-13.1 {image command vs hidden commands} {
+test image-14.1 {image command vs hidden commands} {
catch {image delete hidden}
image create photo hidden
interp hide {} hidden
@@ -359,16 +377,3 @@ eval image delete [image names]
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/imgBmap.test b/tk/tests/imgBmap.test
index 2ce431f302f..d44c1e5536d 100644
--- a/tk/tests/imgBmap.test
+++ b/tk/tests/imgBmap.test
@@ -9,15 +9,15 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
set data1 {#define foo_width 16
#define foo_height 16
diff --git a/tk/tests/imgPPM.test b/tk/tests/imgPPM.test
index 39e2a66485f..c96d53314b9 100644
--- a/tk/tests/imgPPM.test
+++ b/tk/tests/imgPPM.test
@@ -8,15 +8,15 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
eval image delete [image names]
diff --git a/tk/tests/imgPhoto.test b/tk/tests/imgPhoto.test
index a221a3e65e0..5e71b41cbb5 100644
--- a/tk/tests/imgPhoto.test
+++ b/tk/tests/imgPhoto.test
@@ -11,15 +11,15 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
eval image delete [image names]
@@ -27,27 +27,20 @@ canvas .c
pack .c
update
-# temporarily copy the README fiel from testsDir to tmpDir
-if {![file exists README]} {
- set newREADME [file join $::tcltest::workingDir README]
- file copy [file join $::tcltest::testsDir README] $newREADME
- set removeREADME 1
-}
+set README [makeFile {
+README -- Tk test suite design document.
+} README-imgPhotot]
# find the teapot.ppm file for use in these tests
# first look in $tk_library/demos/images/teapot.ppm
# then look in <this file>/../../library/demos/images/teapot.ppm
-# skip this file if you can't find the teapot.ppm file.
+testConstraint hasTeapotPhoto 1
set teapotPhotoFile [file join $tk_library demos images teapot.ppm]
if {![file exists $teapotPhotoFile]} {
- set newLib [file dirname $::tcltest::testsDir]
- set teapotPhotoFile \
- [file join $newLib library demos images teapot.ppm]
+ set newLib [file dirname [testsDirectory]]
+ set teapotPhotoFile [file join $newLib library demos images teapot.ppm]
if {![file exists $teapotPhotoFile]} {
- puts "Can't find [file join demos images teapot.ppm] in $tk_library"
- puts "your Tk library is incomplete, so I am skipping imgPhoto tests."
- ::tcltest::cleanupTests
- return 0
+ testConstraint hasTeapotPhoto
}
}
@@ -60,15 +53,15 @@ test imgPhoto-1.2 {options for photo images} {
list [catch {image create photo p1 -file no.such.file} err] \
[string tolower $err]
} {1 {couldn't open "no.such.file": no such file or directory}}
-test imgPhoto-1.3 {options for photo images} {
+test imgPhoto-1.3 {options for photo images} hasTeapotPhoto {
list [catch {image create photo p1 -file $teapotPhotoFile \
-format no.such.format} err] $err
} {1 {image file format "no.such.format" is not supported}}
-test imgPhoto-1.4 {options for photo images} {
+test imgPhoto-1.4 {options for photo images} hasTeapotPhoto {
image create photo p1 -file $teapotPhotoFile
list [image width p1] [image height p1]
} {256 256}
-test imgPhoto-1.5 {options for photo images} {
+test imgPhoto-1.5 {options for photo images} hasTeapotPhoto {
image create photo p1 -file $teapotPhotoFile \
-format ppm -width 79 -height 83
list [image width p1] [image height p1] \
@@ -80,8 +73,8 @@ test imgPhoto-1.6 {options for photo images} {
[lindex [p1 configure -palette] 4]
} {2.2 2/2/2}
test imgPhoto-1.7 {options for photo images} {
- list [catch {image create photo p1 -file README} err] $err
-} {1 {couldn't recognize data in image file "README"}}
+ list [catch {image create photo p1 -file $README} err] $err
+} [subst {1 {couldn't recognize data in image file "$README"}}]
test imgPhoto-1.8 {options for photo images} {
list [catch {image create photo -blah blah} err] $err
} {1 {unknown option "-blah"}}
@@ -95,7 +88,7 @@ test imgPhoto-2.2 {ImgPhotoCreate procedure} {
eval image delete [image names]
image create photo image1
list [info commands image1] [image names] \
- [image width image1] [image height image1]
+ [image width image1] [image height image1]
} {image1 image1 0 0}
# test imgPhoto-2.3 {ImgPhotoCreate procedure: creation failure} {
# image create photo p1
@@ -105,16 +98,16 @@ test imgPhoto-2.2 {ImgPhotoCreate procedure} {
# set msg
# } {couldn't open "bogus.img": no such file or directory}
-test imgPhoto-3.1 {ImgPhotoConfigureMaster procedure} {
+test imgPhoto-3.1 {ImgPhotoConfigureMaster procedure} hasTeapotPhoto {
image create photo p1 -file $teapotPhotoFile
p1 configure -file $teapotPhotoFile
} {}
-test imgPhoto-3.2 {ImgPhotoConfigureMaster procedure} {
+test imgPhoto-3.2 {ImgPhotoConfigureMaster procedure} hasTeapotPhoto {
image create photo p1 -file $teapotPhotoFile
list [catch {p1 configure -file bogus} err] [string tolower $err] \
[image width p1] [image height p1]
} {1 {couldn't open "bogus": no such file or directory} 256 256}
-test imgPhoto-3.3 {ImgPhotoConfigureMaster procedure} {
+test imgPhoto-3.3 {ImgPhotoConfigureMaster procedure} hasTeapotPhoto {
image create photo p1
.c create image 10 10 -image p1 -tags p1.1 -anchor nw
.c create image 300 10 -image p1 -tags p1.2 -anchor nw
@@ -134,7 +127,7 @@ test imgPhoto-4.1 {ImgPhotoCmd procedure} {
} {1 {wrong # args: should be "p1 option ?arg arg ...?"}}
test imgPhoto-4.2 {ImgPhotoCmd procedure} {
list [catch {p1 blah} err] $err
-} {1 {bad option "blah": must be blank, cget, configure, copy, data, get, put, read, redither, or write}}
+} {1 {bad option "blah": must be blank, cget, configure, copy, data, get, put, read, redither, transparency, or write}}
test imgPhoto-4.3 {ImgPhotoCmd procedure: blank option} {
p1 blank
list [catch {p1 blank x} err] $err
@@ -159,7 +152,7 @@ test imgPhoto-4.8 {ImgPhotoCmd procedure: configure option} {
test imgPhoto-4.9 {ImgPhotoCmd procedure: configure option} {
list [catch {p1 configure -palette {} -gamma} msg] $msg
} {1 {value for "-gamma" missing}}
-test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} {
+test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} hasTeapotPhoto {
image create photo p2 -file $teapotPhotoFile
p1 configure -width 0 -height 0 -palette {} -gamma 1
p1 copy p2
@@ -167,13 +160,13 @@ test imgPhoto-4.10 {ImgPhotoCmd procedure: copy option} {
} {256 256 {169 117 90}}
test imgPhoto-4.11 {ImgPhotoCmd procedure: copy option} {
list [catch {p1 copy} msg] $msg
-} {1 {wrong # args: should be "p1 copy source-image ?-from x1 y1 x2 y2? ?-to x1 y1 x2 y2? ?-zoom x y? ?-subsample x y?"}}
+} {1 {wrong # args: should be "p1 copy source-image ?-compositingrule rule? ?-from x1 y1 x2 y2? ?-to x1 y1 x2 y2? ?-zoom x y? ?-subsample x y?"}}
test imgPhoto-4.12 {ImgPhotoCmd procedure: copy option} {
list [catch {p1 copy blah} msg] $msg
} {1 {image "blah" doesn't exist or is not a photo image}}
test imgPhoto-4.13 {ImgPhotoCmd procedure: copy option} {
list [catch {p1 copy p2 -blah} msg] $msg
-} {1 {unrecognized option "-blah": must be -from, -shrink, -subsample, -to, or -zoom}}
+} {1 {unrecognized option "-blah": must be -compositingrule, -from, -shrink, -subsample, -to, or -zoom}}
test imgPhoto-4.14 {ImgPhotoCmd procedure: copy option} {
list [catch {p1 copy p2 -from -to} msg] $msg
} {1 {the "-from" option requires one to four integer values}}
@@ -218,7 +211,7 @@ test imgPhoto-4.21 {ImgPhotoCmd procedure: copy option} {
p1 copy p2 -from 0 0 10 10 -shrink
lappend result [image width p1] [image height p1]
} {256 256 49 51 49 51 49 51 10 51 10 10}
-test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} {
+test imgPhoto-4.22 {ImgPhotoCmd procedure: get option} hasTeapotPhoto {
p1 read $teapotPhotoFile
list [p1 get 100 100] [p1 get 150 100] [p1 get 100 150]
} {{169 117 90} {172 115 84} {35 35 35}}
@@ -247,23 +240,23 @@ test imgPhoto-4.29 {ImgPhotoCmd procedure: put option} {
test imgPhoto-4.30 {ImgPhotoCmd procedure: read option} {
list [catch {p1 read} err] $err
} {1 {wrong # args: should be "p1 read fileName ?options?"}}
-test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} {
+test imgPhoto-4.31 {ImgPhotoCmd procedure: read option} hasTeapotPhoto {
list [catch {p1 read $teapotPhotoFile -zoom 2} err] $err
} {1 {unrecognized option "-zoom": must be -format, -from, -shrink, or -to}}
test imgPhoto-4.32 {ImgPhotoCmd procedure: read option} {
list [catch {p1 read bogus} err] [string tolower $err]
} {1 {couldn't open "bogus": no such file or directory}}
-test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} {
+test imgPhoto-4.33 {ImgPhotoCmd procedure: read option} hasTeapotPhoto {
list [catch {p1 read $teapotPhotoFile -format bogus} err] $err
} {1 {image file format "bogus" is not supported}}
test imgPhoto-4.34 {ImgPhotoCmd procedure: read option} {
- list [catch {p1 read README} err] $err
-} {1 {couldn't recognize data in image file "README"}}
-test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} {
+ list [catch {p1 read $README} err] $err
+} [subst {1 {couldn't recognize data in image file "$README"}}]
+test imgPhoto-4.35 {ImgPhotoCmd procedure: read option} hasTeapotPhoto {
p1 read $teapotPhotoFile
list [image width p1] [image height p1] [p1 get 120 120]
} {256 256 {161 109 82}}
-test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} {
+test imgPhoto-4.36 {ImgPhotoCmd procedure: read option} hasTeapotPhoto {
p1 read $teapotPhotoFile -from 0 70 60 120 -to 10 10 -shrink
list [image width p1] [image height p1] [p1 get 29 19]
} {70 60 {244 180 144}}
@@ -277,8 +270,186 @@ test imgPhoto-4.38 {ImgPhotoCmd procedure: write option} {
test imgPhoto-4.39 {ImgPhotoCmd procedure: write option} {
list [catch {p1 write teapot.tmp -format bogus} err] $err
} {1 {image file format "bogus" is unknown}}
-
-test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} {
+eval image delete [image names]
+image create photo p1
+test imgPhoto-4.40 {ImgPhotoCmd procedure: transparency option} {
+ list [catch {p1 transparency} err] $err
+} {1 {wrong # args: should be "p1 transparency option ?arg arg ...?"}}
+test imgPhoto-4.41 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get} err] $err
+} {1 {wrong # args: should be "p1 transparency get x y"}}
+test imgPhoto-4.42 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get 0} err] $err
+} {1 {wrong # args: should be "p1 transparency get x y"}}
+test imgPhoto-4.43 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get 0 0 0} err] $err
+} {1 {wrong # args: should be "p1 transparency get x y"}}
+test imgPhoto-4.44 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get bogus 0} err] $err
+} {1 {expected integer but got "bogus"}}
+test imgPhoto-4.45 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get 0 bogus} err] $err
+} {1 {expected integer but got "bogus"}}
+test imgPhoto-4.46 {ImgPhotoCmd procedure: transparency get option} {
+ p1 put white
+ p1 transparency get 0 0
+} 0
+test imgPhoto-4.47 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get 1 0} err] $err
+} {1 {p1 transparency get: coordinates out of range}}
+test imgPhoto-4.48 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get -1 0} err] $err
+} {1 {p1 transparency get: coordinates out of range}}
+test imgPhoto-4.49 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get 0 1} err] $err
+} {1 {p1 transparency get: coordinates out of range}}
+test imgPhoto-4.50 {ImgPhotoCmd procedure: transparency get option} {
+ list [catch {p1 transparency get 0 -1} err] $err
+} {1 {p1 transparency get: coordinates out of range}}
+test imgPhoto-4.51 {ImgPhotoCmd procedure: transparency get option} {
+ p1 blank
+ p1 transparency get 0 0
+} 1
+test imgPhoto-4.52 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set} err] $err
+} {1 {wrong # args: should be "p1 transparency set x y boolean"}}
+test imgPhoto-4.53 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 0} err] $err
+} {1 {wrong # args: should be "p1 transparency set x y boolean"}}
+test imgPhoto-4.54 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 0 0} err] $err
+} {1 {wrong # args: should be "p1 transparency set x y boolean"}}
+test imgPhoto-4.55 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 0 0 0 0} err] $err
+} {1 {wrong # args: should be "p1 transparency set x y boolean"}}
+test imgPhoto-4.56 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set bogus 0 0} err] $err
+} {1 {expected integer but got "bogus"}}
+test imgPhoto-4.57 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 0 bogus 0} err] $err
+} {1 {expected integer but got "bogus"}}
+test imgPhoto-4.58 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 0 0 bogus} err] $err
+} {1 {expected boolean value but got "bogus"}}
+test imgPhoto-4.59 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 1 0 0} err] $err
+} {1 {p1 transparency set: coordinates out of range}}
+test imgPhoto-4.60 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set -1 0 0} err] $err
+} {1 {p1 transparency set: coordinates out of range}}
+test imgPhoto-4.61 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 0 1 0} err] $err
+} {1 {p1 transparency set: coordinates out of range}}
+test imgPhoto-4.62 {ImgPhotoCmd procedure: transparency set option} {
+ list [catch {p1 transparency set 0 -1 0} err] $err
+} {1 {p1 transparency set: coordinates out of range}}
+test imgPhoto-4.63 {ImgPhotoCmd procedure: transparency set option} {
+ p1 transparency set 0 0 false
+ p1 transparency get 0 0
+} 0
+test imgPhoto-4.64 {ImgPhotoCmd procedure: transparency set option} {
+ p1 transparency set 0 0 true
+ p1 transparency get 0 0
+} 1
+# Now for some heftier testing, checking that setting and resetting of
+# pixels' transparency status doesn't "leak" with any one-off errors.
+proc checkImgTrans {img width height} {
+ set result {}
+ for {set x 0} {$x<$width} {incr x} {
+ for {set y 0} {$y<$height} {incr y} {
+ if {[$img transparency get $x $y]} {
+ lappend result $x $y
+ }
+ }
+ }
+ return $result
+}
+test imgPhoto-4.65 {ImgPhotoCmd procedure: transparency get option} {
+ p1 put white -to 0 0 3 3
+ checkImgTrans p1 3 3
+} {}
+test imgPhoto-4.66 {ImgPhotoCmd procedure: transparency get option} {
+ p1 blank
+ checkImgTrans p1 3 3
+} {0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2}
+proc checkImgTransLoopSetReset {img width height} {
+ set result {}
+ for {set x 0} {$x<$width} {incr x} {
+ for {set y 0} {$y<$height} {incr y} {
+ $img put white -to 0 0 3 3
+ $img transparency set $x $y 1
+ set result [concat $result [checkImgTrans $img $width $height]]
+ lappend result ,
+ $img transparency set $x $y 0
+ set result [concat $result [checkImgTrans $img $width $height]]
+ lappend result .
+ }
+ }
+ return $result
+}
+test imgPhoto-4.67 {ImgPhotoCmd procedure: transparency set option} {
+ checkImgTransLoopSetReset p1 3 3
+} {0 0 , . 0 1 , . 0 2 , . 1 0 , . 1 1 , . 1 2 , . 2 0 , . 2 1 , . 2 2 , .}
+proc checkImgTransLoopResetSet {img width height} {
+ set result {}
+ for {set x 0} {$x<$width} {incr x} {
+ for {set y 0} {$y<$height} {incr y} {
+ $img blank
+ $img transparency set $x $y 0
+ set result [concat $result [checkImgTrans $img $width $height]]
+ lappend result ,
+ $img transparency set $x $y 1
+ set result [concat $result [checkImgTrans $img $width $height]]
+ lappend result .
+ }
+ }
+ return $result
+}
+test imgPhoto-4.68 {ImgPhotoCmd procedure: transparency set option} {
+ checkImgTransLoopResetSet p1 3 3
+} {0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 2 1 0 1 1 1 2 2 0 2 1 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 1 1 0 1 1 1 2 2 0 2 1 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 1 0 2 1 1 1 2 2 0 2 1 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 1 0 2 1 0 1 2 2 0 2 1 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 1 0 2 1 0 1 1 2 0 2 1 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 1 0 2 1 0 1 1 1 2 2 1 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 2 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 . 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 , 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 .}
+catch {rename checkImgTransLoopSetReset {}}
+catch {rename checkImgTransLoopResetSet {}}
+# Test the compositing rules for copying images
+image create photo p1 -width 3 -height 3
+image create photo p2 -width 2 -height 2
+test imgPhoto-4.68 {ImgPhotoCmd procedure: copy with -compositingrule} {
+ list [catch {p1 copy p2 -to 1 1 -compositingrule} msg] $msg
+} {1 {the "-compositingrule" option requires a value}}
+test imgPhoto-4.69 {ImgPhotoCmd procedure: copy with -compositingrule} {
+ list [catch {p1 copy p2 -to 1 1 -compositingrule BAD} msg] $msg
+} {1 {bad compositing rule "BAD": must be overlay or set}}
+test imgPhoto-4.70 {ImgPhotoCmd procedure: copy with -compositingrule} {
+ # Tests default compositing rule
+ p1 blank
+ p2 blank
+ p1 put white -to 0 0 2 2
+ p2 put white -to 0 0 2 2
+ p2 transparency set 0 0 true
+ p1 copy p2 -to 1 1
+ checkImgTrans p1 3 3
+} {0 2 2 0}
+test imgPhoto-4.71 {ImgPhotoCmd procedure: copy with -compositingrule} {
+ p1 blank
+ p2 blank
+ p1 put white -to 0 0 2 2
+ p2 put white -to 0 0 2 2
+ p2 transparency set 0 0 true
+ p1 copy p2 -to 1 1 -compositingrule overlay
+ checkImgTrans p1 3 3
+} {0 2 2 0}
+test imgPhoto-4.72 {ImgPhotoCmd procedure: copy with -compositingrule} {
+ p1 blank
+ p2 blank
+ p1 put white -to 0 0 2 2
+ p2 put white -to 0 0 2 2
+ p2 transparency set 0 0 true
+ p1 copy p2 -to 1 1 -compositingrule set
+ checkImgTrans p1 3 3
+} {0 2 1 1 2 0}
+catch {rename checkImgTrans {}}
+
+test imgPhoto-5.1 {ImgPhotoGet/Free procedures, shared instances} hasTeapotPhoto {
eval image delete [image names]
.c delete all
image create photo p1 -file $teapotPhotoFile
@@ -303,7 +474,7 @@ test imgPhoto-6.1 {ImgPhotoDisplay procedure, blank display} {
update
} {}
-test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} {
+test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} hasTeapotPhoto {
eval image delete [image names]
.c delete all
image create photo p1 -file $teapotPhotoFile
@@ -312,7 +483,7 @@ test imgPhoto-7.1 {ImgPhotoFree procedure, resource freeing} {
.c delete all
image delete p1
} {}
-test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} {
+test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} hasTeapotPhoto {
image create photo p1 -file $teapotPhotoFile
.c create image 10 10 -image p1 -anchor nw
button .b1 -image p1
@@ -328,7 +499,7 @@ test imgPhoto-7.2 {ImgPhotoFree procedures, unlinking} {
update
.c delete all
} {}
-test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} {
+test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} hasTeapotPhoto {
image create photo p1 -file $teapotPhotoFile
button .b1 -image p1
frame .f -visual best
@@ -344,11 +515,11 @@ test imgPhoto-7.3 {ImgPhotoFree procedures, multiple visuals} {
image delete p1
} {}
-test imgPhoto-8.1 {ImgPhotoDelete procedure} {
+test imgPhoto-8.1 {ImgPhotoDelete procedure} hasTeapotPhoto {
image create photo p2 -file $teapotPhotoFile
image delete p2
} {}
-test imagePhoto-8.2 {ImgPhotoDelete procedure} {
+test imagePhoto-8.2 {ImgPhotoDelete procedure} hasTeapotPhoto {
image create photo p2 -file $teapotPhotoFile
rename p2 newp2
set x [list [info command p2] [info command new*] [newp2 cget -file]]
@@ -362,7 +533,7 @@ test imagePhoto-8.3 {ImgPhotoDelete procedure, name cleanup} {
list [catch {p1 copy p2} msg] $msg
} {1 {image "p2" doesn't exist or is not a photo image}}
-test imagePhoto-9.1 {ImgPhotoCmdDeletedProc procedure} {
+test imagePhoto-9.1 {ImgPhotoCmdDeletedProc procedure} hasTeapotPhoto {
image create photo p2 -file $teapotPhotoFile
rename p2 {}
list [lsearch -exact [image names] p2] [catch {p2 foo} msg] $msg
@@ -383,7 +554,7 @@ test imgPhoto-11.1 {Tk_FindPhoto} {
list [catch {p1 copy i1} msg] $msg
} {1 {image "i1" doesn't exist or is not a photo image}}
-test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} {
+test imgPhoto-12.1 {Tk_PhotoPutZoomedBlock} hasTeapotPhoto {
image create photo p3 -file $teapotPhotoFile
set result [list [p3 get 50 50] [p3 get 100 100]]
p3 copy p3 -zoom 2
@@ -436,25 +607,55 @@ test imgPhoto-13.1 {check separation of images in different interpre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AAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAwP8AAAD/
+AP//AAAA//8A/wD//////ywAAAAAYwA5AAAI/wAZCBxIsKDBgwgTKlzIsKHD
+hxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhTqlzJsqXLlzBjypxJs6bN
+mzhz6tzJs6fPn0CDCh1KtKhRiwoSKEXAtGlTpUqPGkyagOmCq1edNsWalWkC
+BUSXIuDqFepBqFWtZv3KU+zYrkrBSqT6dgECtjOTbu16NwFHvV3lshRLti/J
+qlgRCE6ZuO9ik4Dt+k0ZVyZiyVIvXr77ODPEy5g9T4zMWfTEzXdNz1VbWvXn
+uqldP1TAOrbshqBb314Y2W7n3Qdpv7UNPCHpycUVbv6dnODy5sqzQldIe8H0
+hciva9/Ovbv37+BzBgEEADs=
+"
+ set photo [image create photo -data $data]
+ set filename [makeFile {} imgPhoto-14.1.gif]
+ removeFile imgPhoto-14.1.gif
+ $photo write $filename -format gif
+ set photo2 [image create photo -file $filename]
+ set result [string equal [$photo data] [$photo2 data]]
+ image delete $photo $photo2
+ catch {file delete -force $filename}
+ set result
+} 1
+
+test imgPhoto-15.1 {photo images can fail to allocate memory gracefully} \
+ {nonPortable} {
+ # This is not portable to very large machines with more around
+ # 3GB of free memory available...
+ list [catch {image create photo -width 32000 -height 32000} msg] $msg
+} {1 {not enough free memory for image buffer}}
+
destroy .c
eval image delete [image names]
# cleanup
-if {[info exists removeREADME]} {
- catch {file delete -force $newREADME}
-}
+removeFile README-imgPhoto
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/listbox.test b/tk/tests/listbox.test
index 900ad1f963a..800655e51fd 100644
--- a/tk/tests/listbox.test
+++ b/tk/tests/listbox.test
@@ -8,15 +8,13 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
set fixed {Courier -12}
proc record args {
@@ -73,12 +71,14 @@ resetGridInfo
set i 1
foreach test {
+ {-activestyle under underline foo {bad activestyle "foo": must be dotbox, none, or underline}}
{-background #ff0000 #ff0000 non-existent
{unknown color name "non-existent"}}
{-bd 4 4 badValue {bad screen distance "badValue"}}
{-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}}
{-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
{-cursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-disabledforeground #110022 #110022 bogus {unknown color name "bogus"}}
{-exportselection yes 1 xyzzy {expected boolean value but got "xyzzy"}}
{-fg #110022 #110022 bogus {unknown color name "bogus"}}
{-font {Helvetica 12} {Helvetica 12} {} {font "" doesn't exist}}
@@ -94,6 +94,7 @@ foreach test {
{-selectforeground #654321 #654321 bogus {unknown color name "bogus"}}
{-selectmode string string {} {}}
{-setgrid false 0 lousy {expected boolean value but got "lousy"}}
+ {-state disabled disabled foo {bad state "foo": must be disabled or normal}}
{-takefocus "any string" "any string" {} {}}
{-width 45 45 3p {expected integer but got "3p"}}
{-xscrollcommand {Some command} {Some command} {} {}}
@@ -239,7 +240,7 @@ test listbox-3.22 {ListboxWidgetCmd procedure, "cget" option} {
} {0}
test listbox-3.23 {ListboxWidgetCmd procedure, "configure" option} {
llength [.l configure]
-} {24}
+} {27}
test listbox-3.24 {ListboxWidgetCmd procedure, "configure" option} {
list [catch {.l configure -gorp} msg] $msg
} {1 {unknown option "-gorp"}}
@@ -938,11 +939,19 @@ test listbox-4.18 {ConfigureListbox, no listvar -> bad listvar} {
catch {destroy .l}
listbox .l
.l insert end a b c d
- set x {this is a " bad list}
+ set x "this is a \" bad list"
catch {.l configure -listvar x} result
list [.l get 0 end] [.l cget -listvar] $result
} [list [list a b c d] {} \
- "unmatched open quote in list: invalid listvar value"]
+ "unmatched open quote in list: invalid -listvariable value"]
+test listbox-4.19 {ConfigureListbox, no listvar -> bad non-existent listvar} {
+ catch {destroy .l}
+ listbox .l -listvar foo
+ .l insert end a b c d
+ catch {.l configure -listvar ::zoo::bar::foo} result
+ list [.l get 0 end] [.l cget -listvar] $foo $result
+} [list [list a b c d] foo [list a b c d] \
+ {can't set "::zoo::bar::foo": parent namespace doesn't exist}]
# No tests for DisplayListbox: I don't know how to test this procedure.
@@ -1286,7 +1295,7 @@ test listbox-8.2 {ListboxEventProc procedure} {fonts} {
list [.l xview] [.l yview]
} {{0 0.222222} {0 0.333333}}
test listbox-8.3 {ListboxEventProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
listbox .l1 -bg #543210
rename .l1 .l2
set x {}
@@ -1297,7 +1306,7 @@ test listbox-8.3 {ListboxEventProc procedure} {
} {.l1 #543210 {} {}}
test listbox-9.1 {ListboxCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
listbox .l1
rename .l1 {}
list [info command .l*] [winfo children .]
@@ -1740,7 +1749,7 @@ test listbox-19.2 {ListboxUpdateVScrollbar procedure} {
(horizontal scrolling command executed by listbox)}}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test listbox-20.1 {listbox vs hidden commands} {
catch {destroy .l}
@@ -1846,7 +1855,7 @@ test listbox-21.11 {ListboxListVarProc, bad list} {
catch {unset x}
listbox .l -listvar x
set x [list a b c d]
- catch {set x {this is a " bad list}} result
+ catch {set x "this is a \" bad list"} result
set result
} {can't set "x": invalid listvar value}
test listbox-21.12 {ListboxListVarProc, cleanup item attributes} {
@@ -1964,7 +1973,7 @@ test listbox-23.5 {ConfigureListboxItem, multiple calls} {
catch {destroy .l}
listbox .l
set i 0
- foreach color {red orange yellow green blue darkblue violet} {
+ foreach color {red orange yellow green blue white violet} {
.l insert end $color
.l itemconfigure $i -bg $color
incr i
@@ -1974,7 +1983,7 @@ test listbox-23.5 {ConfigureListboxItem, multiple calls} {
list [.l itemcget 0 -bg] [.l itemcget 1 -bg] [.l itemcget 2 -bg] \
[.l itemcget 3 -bg] [.l itemcget 4 -bg] [.l itemcget 5 -bg] \
[.l itemcget 6 -bg]
-} {red orange yellow green blue darkblue violet}
+} {red orange yellow green blue white violet}
catch {destroy .l}
listbox .l
.l insert end a b c d
@@ -1995,7 +2004,7 @@ foreach test {
} [list [lindex $test 2] [lindex $test 2]]
incr i
if {[lindex $test 3] != ""} {
- test listbox-1.$i {configuration options} {
+ test listbox-23.$i {configuration options} {
list [catch {.l configure $name [lindex $test 3]} msg] $msg
} [list 1 [lindex $test 4]]
}
@@ -2051,13 +2060,80 @@ test listbox-25.2 {listbox item configurations and widget based inserts} {
list [.l itemcget 0 -fg] [.l itemcget 4 -fg]
} [list {} red]
+# state issues
+test listbox-26.1 {listbox disabled state disallows inserts} {
+ catch {destroy .l}
+ listbox .l
+ .l insert end a b c
+ .l configure -state disabled
+ .l insert end d e f
+ .l get 0 end
+} [list a b c]
+test listbox-26.2 {listbox disabled state disallows deletions} {
+ catch {destroy .l}
+ listbox .l
+ .l insert end a b c
+ .l configure -state disabled
+ .l delete 0 end
+ .l get 0 end
+} [list a b c]
+test listbox-26.3 {listbox disabled state disallows selection modification} {
+ catch {destroy .l}
+ listbox .l
+ .l insert end a b c
+ .l selection set 0
+ .l selection set 2
+ .l configure -state disabled
+ .l selection clear 0 end
+ .l selection set 1
+ .l curselection
+} [list 0 2]
+test listbox-26.4 {listbox disabled state disallows anchor modification} {
+ catch {destroy .l}
+ listbox .l
+ .l insert end a b c
+ .l selection anchor 0
+ .l configure -state disabled
+ .l selection anchor 2
+ .l index anchor
+} 0
+test listbox-26.5 {listbox disabled state disallows active modification} {
+ catch {destroy .l}
+ listbox .l
+ .l insert end a b c
+ .l activate 0
+ .l configure -state disabled
+ .l activate 2
+ .l index active
+} 0
+
+test listbox-27.1 {widget deletion while active} {
+ destroy .l
+ pack [listbox .l]
+ update
+ .l configure -cursor xterm -xscrollcommand { destroy .l }
+ update idle
+ winfo exists .l
+} 0
+test listbox-28.1 {listbox -activestyle} {
+ catch {destroy .l}
+ listbox .l -activ non
+ .l cget -activestyle
+} none
+test listbox-28.2 {listbox -activestyle} {
+ catch {destroy .l}
+ listbox .l
+ .l cget -activestyle
+} underline
+test listbox-28.3 {listbox -activestyle} {
+ catch {destroy .l}
+ listbox .l -activestyle dot
+ .l cget -activestyle
+} dotbox
resetGridInfo
-catch {destroy .l2}
-catch {destroy .t}
-catch {destroy .e}
-catch {destroy .partial}
+deleteWindows
option clear
# cleanup
diff --git a/tk/tests/macEmbed.test b/tk/tests/macEmbed.test
index 74df7ad2a91..61eecc6429c 100644
--- a/tk/tests/macEmbed.test
+++ b/tk/tests/macEmbed.test
@@ -8,14 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
-
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test macEmbed-1.1 {TkpUseWindow procedure, bad window identifier} {macOnly} {
catch {destroy .t}
@@ -26,15 +24,8 @@ test macEmbed-1.2 {TkpUseWindow procedure, bad window identifier} {macOnly} {
list [catch {toplevel .t -use 47} msg] $msg
} {1 {The window ID 47 does not correspond to a valid Tk Window.}}
-if {[string compare testembed [info commands testembed]] != 0} {
- puts "This application hasn't been compiled with the testembed command,"
- puts "therefore I am skipping all of these tests."
- ::tcltest::cleanupTests
- return
-}
-
-test macEmbed-1.3 {TkpUseWindow procedure, creating Container records} {macOnly} {
- eval destroy [winfo child .]
+test macEmbed-1.3 {TkpUseWindow procedure, creating Container records} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -42,8 +33,8 @@ test macEmbed-1.3 {TkpUseWindow procedure, creating Container records} {macOnly}
toplevel .t -use $w
list [testembed] [expr [lindex [lindex [testembed all] 1] 0] - $w]
} {{{XXX .f2 {} {}} {XXX .f1 XXX .t}} 0}
-test macEmbed-1.4 {TkpUseWindow procedure, creating Container records} {macOnly} {
- eval destroy [winfo child .]
+test macEmbed-1.4 {TkpUseWindow procedure, creating Container records} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -57,10 +48,8 @@ test macEmbed-1.4 {TkpUseWindow procedure, creating Container records} {macOnly}
# Can't think of any way to test the procedures TkpMakeWindow,
# TkpMakeContainer, or EmbedErrorProc.
-test macEmbed-2.1 {EmbeddedEventProc procedure} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test macEmbed-2.1 {EmbeddedEventProc procedure} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -70,10 +59,8 @@ test macEmbed-2.1 {EmbeddedEventProc procedure} {macOnly} {
update
testembed
} {}
-test macEmbed-2.2 {EmbeddedEventProc procedure} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test macEmbed-2.2 {EmbeddedEventProc procedure} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -81,10 +68,8 @@ test macEmbed-2.2 {EmbeddedEventProc procedure} {macOnly} {
destroy .f1
testembed
} {}
-test macEmbed-2.3 {EmbeddedEventProc procedure} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test macEmbed-2.3 {EmbeddedEventProc procedure} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -94,10 +79,8 @@ test macEmbed-2.3 {EmbeddedEventProc procedure} {macOnly} {
list [testembed] [winfo children .]
} {{} {}}
-test macEmbed-3.1 {EmbeddedEventProc procedure, detect creation} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test macEmbed-3.1 {EmbeddedEventProc procedure, detect creation} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -108,9 +91,7 @@ test macEmbed-3.1 {EmbeddedEventProc procedure, detect creation} {macOnly} {
} {{{XXX .f1 {} {}}} {{XXX .f1 XXX .t1}}}
test macEmbed-3.2 {EmbeddedEventProc procedure, disallow position changes} \
{macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -122,9 +103,7 @@ test macEmbed-3.2 {EmbeddedEventProc procedure, disallow position changes} \
} {200x200+0+0}
test macEmbed-3.3 {EmbeddedEventProc procedure, disallow position changes} \
{macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -135,9 +114,7 @@ test macEmbed-3.3 {EmbeddedEventProc procedure, disallow position changes} \
wm geometry .t1
} {300x100+0+0}
test macEmbed-3.4 {EmbeddedEventProc procedure, geometry requests} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
toplevel .t1 -container 1 -width 200 -height 50
set w1 [winfo id .t1]
toplevel .t2 -use $w1
@@ -147,9 +124,7 @@ test macEmbed-3.4 {EmbeddedEventProc procedure, geometry requests} {macOnly} {
list [winfo width .t1] [winfo height .t1] [wm geometry .t2]
} {300 80 300x80+0+0}
test macEmbed-3.5 {EmbeddedEventProc procedure, map requests} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -162,9 +137,7 @@ test macEmbed-3.5 {EmbeddedEventProc procedure, map requests} {macOnly} {
set x
} {mapped}
test macEmbed-3.6 {EmbeddedEventProc procedure, destroy events} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -178,9 +151,7 @@ test macEmbed-3.6 {EmbeddedEventProc procedure, destroy events} {macOnly} {
} {dead 0}
test macEmbed-4.1 {EmbedStructureProc procedure, configure events} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -190,10 +161,8 @@ test macEmbed-4.1 {EmbedStructureProc procedure, configure events} {macOnly} {
update
winfo geometry .t1
} {180x100+0+0}
-test macEmbed-4.2 {EmbedStructureProc procedure, destroy events} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test macEmbed-4.2 {EmbedStructureProc procedure, destroy events} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -208,15 +177,13 @@ test macEmbed-4.2 {EmbedStructureProc procedure, destroy events} {macOnly} {
test unixEmbed-5.1 {TkpClaimFocus procedure} {macOnly tempNotMac} {
catch {interp delete child}
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
interp create child
child eval "set argv {-use [winfo id .f1]}"
- load {} tk child
+ load {} Tk child
child eval {
. configure -bd 2 -highlightthickness 2 -relief sunken
}
@@ -231,10 +198,8 @@ test unixEmbed-5.1 {TkpClaimFocus procedure} {macOnly tempNotMac} {
} {{{} .} .f1}
catch {interp delete child}
-test macEmbed-6.1 {EmbedWindowDeleted procedure, check parentPtr} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test macEmbed-6.1 {EmbedWindowDeleted procedure, check parentPtr} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
frame .f3 -container 1 -width 200 -height 50
@@ -248,10 +213,8 @@ test macEmbed-6.1 {EmbedWindowDeleted procedure, check parentPtr} {macOnly} {
}
set x
} {{{XXX .f4 {} {}} {XXX .f3 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f4 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}}} {}}
-test macEmbed-6.2 {EmbedWindowDeleted procedure, check embeddedPtr} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test macEmbed-6.2 {EmbedWindowDeleted procedure, check embeddedPtr} {testembed macOnly} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
set w1 [winfo id .f1]
@@ -264,9 +227,7 @@ test macEmbed-6.2 {EmbedWindowDeleted procedure, check embeddedPtr} {macOnly} {
} {{{XXX .f1 XXX .t1}} {}}
test macEmbed-7.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -276,9 +237,7 @@ test macEmbed-7.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOn
wm geometry .t1
} {150x80+0+0}
test macEmbed-7.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOnly} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -290,9 +249,7 @@ test macEmbed-7.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {macOn
-foreach w [winfo child .] {
- catch {destroy $w}
-}
+deleteWindows
# cleanup
::tcltest::cleanupTests
diff --git a/tk/tests/macFont.test b/tk/tests/macFont.test
index 5bbe38b115c..667f2f7afa4 100644
--- a/tk/tests/macFont.test
+++ b/tk/tests/macFont.test
@@ -12,15 +12,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {$tcl_platform(platform)!="macintosh"} {
- puts "skipping: Mac only tests..."
- ::tcltest::cleanupTests
- return
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .b}
toplevel .b
@@ -45,226 +42,226 @@ proc getsize {} {
return "[winfo reqwidth .b.l] [winfo reqheight .b.l]"
}
-set ::tcltest::testConfig(gothic) 0
+testConstraint gothic 0
set gothic {gothic 12}
set mx [font measure $gothic \u4e4e]
if {[font actual $gothic -family] != [font actual system -family]} {
- set ::tcltest::testConfig(gothic) 1
+ testConstraint gothic 1
}
-test macFont-1.1 {TkpFontPkgInit} {
+test macFont-1.1 {TkpFontPkgInit} {macOnly} {
} {}
-test macfont-2.1 {TkpGetNativeFont: not native} {
+test macfont-2.1 {TkpGetNativeFont: not native} {macOnly} {
list [catch {font measure {} xyz} msg] $msg
} {1 {font "" doesn't exist}}
-test macFont-2.2 {TkpGetNativeFont: native} {
+test macFont-2.2 {TkpGetNativeFont: native} {macOnly} {
font measure system "0"
font measure application "0"
set x {}
} {}
-test macFont-3.1 {TkpGetFontFromAttributes: no family} {
+test macFont-3.1 {TkpGetFontFromAttributes: no family} {macOnly} {
font actual {-underline 1} -family
} [font actual system -family]
-test macFont-3.2 {TkpGetFontFromAttributes: long family name} {
+test macFont-3.2 {TkpGetFontFromAttributes: long family name} {macOnly} {
set x "12345678901234567890123456789012345678901234567890"
set x "$x$x$x$x$x$x"
font actual "-family $x" -family
} [font actual system -family]
-test macFont-3.3 {TkpGetFontFromAttributes: family} {
+test macFont-3.3 {TkpGetFontFromAttributes: family} {macOnly} {
font actual {-family Courier} -family
} {Courier}
-test macFont-3.4 {TkpGetFontFromAttributes: Times fonts} {
+test macFont-3.4 {TkpGetFontFromAttributes: Times fonts} {macOnly} {
set x {}
lappend x [font actual {-family "Times"} -family]
lappend x [font actual {-family "Times New Roman"} -family]
} {Times Times}
-test macFont-3.5 {TkpGetFontFromAttributes: Courier fonts} {
+test macFont-3.5 {TkpGetFontFromAttributes: Courier fonts} {macOnly} {
set x {}
lappend x [font actual {-family "Courier"} -family]
lappend x [font actual {-family "Courier New"} -family]
} {Courier Courier}
-test macFont-3.6 {TkpGetFontFromAttributes: Helvetica fonts} {
+test macFont-3.6 {TkpGetFontFromAttributes: Helvetica fonts} {macOnly} {
set x {}
lappend x [font actual {-family "Geneva"} -family]
lappend x [font actual {-family "Helvetica"} -family]
lappend x [font actual {-family "Arial"} -family]
} {Geneva Helvetica Helvetica}
-test macFont-3.7 {TkpGetFontFromAttributes: try aliases} {
+test macFont-3.7 {TkpGetFontFromAttributes: try aliases} {macOnly} {
font actual {arial 10} -family
} {Helvetica}
-test macFont-3.8 {TkpGetFontFromAttributes: try fallbacks} {
+test macFont-3.8 {TkpGetFontFromAttributes: try fallbacks} {macOnly} {
font actual {{ms sans serif} 10} -family
} {Chicago}
-test macFont-3.9 {TkpGetFontFromAttributes: styles} {
+test macFont-3.9 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-weight normal} -weight
} {normal}
-test macFont-3.10 {TkpGetFontFromAttributes: styles} {
+test macFont-3.10 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-weight bold} -weight
} {bold}
-test macFont-3.11 {TkpGetFontFromAttributes: styles} {
+test macFont-3.11 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-slant roman} -slant
} {roman}
-test macFont-3.12 {TkpGetFontFromAttributes: styles} {
+test macFont-3.12 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-slant italic} -slant
} {italic}
-test macFont-3.13 {TkpGetFontFromAttributes: styles} {
+test macFont-3.13 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-underline false} -underline
} {0}
-test macFont-3.14 {TkpGetFontFromAttributes: styles} {
+test macFont-3.14 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-underline true} -underline
} {1}
-test macFont-3.15 {TkpGetFontFromAttributes: styles} {
+test macFont-3.15 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-overstrike false} -overstrike
} {0}
-test macFont-3.16 {TkpGetFontFromAttributes: styles} {
+test macFont-3.16 {TkpGetFontFromAttributes: styles} {macOnly} {
font actual {-overstrike true} -overstrike
} {0}
-test macFont-4.1 {TkpDeleteFont} {
+test macFont-4.1 {TkpDeleteFont} {macOnly} {
font actual {-family xyz}
set x {}
} {}
-test macFont-5.1 {TkpGetFontFamilies} {
+test macFont-5.1 {TkpGetFontFamilies} {macOnly} {
expr {[lsearch [font families] Geneva] > 0}
} {1}
-test macFont-6.1 {TkpGetSubFonts} {gothic} {
+test macFont-6.1 {TkpGetSubFonts} {testfont gothic macOnly} {
.b.l config -text "abc\u4e4e"
update
set x [testfont subfonts $fixed]
} "Monaco [font actual $gothic -family]"
-test macFont-7.1 {Tk_MeasureChars: unbounded right margin} {
+test macFont-7.1 {Tk_MeasureChars: unbounded right margin} {macOnly} {
.b.l config -wrap 0 -text "000000"
getsize
} "[expr $ax*6] $ay"
-test macFont-7.2 {Tk_MeasureChars: static width buffer exceeded} {
+test macFont-7.2 {Tk_MeasureChars: static width buffer exceeded} {macOnly} {
.b.l config -wrap 100000 -text "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
getsize
} "[expr $ax*256] $ay"
-test macFont-7.3 {Tk_MeasureChars: all chars did fit} {
+test macFont-7.3 {Tk_MeasureChars: all chars did fit} {macOnly} {
.b.l config -wrap [expr $ax*10] -text "00000000"
getsize
} "[expr $ax*8] $ay"
-test macFont-7.4 {Tk_MeasureChars: not all chars fit} {
+test macFont-7.4 {Tk_MeasureChars: not all chars fit} {macOnly} {
.b.l config -wrap [expr $ax*6] -text "00000000"
getsize
} "[expr $ax*6] [expr $ay*2]"
-test macFont-7.5 {Tk_MeasureChars: already saw space in line} {
+test macFont-7.5 {Tk_MeasureChars: already saw space in line} {macOnly} {
.b.l config -wrap [expr $ax*12] -text "000000 0000000"
getsize
} "[expr $ax*7] [expr $ay*2]"
-test macFont-7.6 {Tk_MeasureChars: internal spaces significant} {
+test macFont-7.6 {Tk_MeasureChars: internal spaces significant} {macOnly} {
.b.l config -wrap [expr $ax*12] -text "000 00 00000"
getsize
} "[expr $ax*7] [expr $ay*2]"
-test macFont-7.7 {Tk_MeasureChars: include last partial char} {
+test macFont-7.7 {Tk_MeasureChars: include last partial char} {macOnly} {
.b.c dchars $t 0 end
.b.c insert $t 0 "0000"
.b.c index $t @[expr int($ax*2.5)],1
} {2}
-test macFont-7.8 {Tk_MeasureChars: at least one char on line} {
+test macFont-7.8 {Tk_MeasureChars: at least one char on line} { macOnly} {
.b.l config -text "000000" -wrap 1
getsize
} "$ax [expr $ay*6]"
-test macFont-7.9 {Tk_MeasureChars: whole words} {
+test macFont-7.9 {Tk_MeasureChars: whole words} {macOnly} {
.b.l config -wrap [expr $ax*8] -text "000000 0000"
getsize
} "[expr $ax*6] [expr $ay*2]"
-test macFont-7.10 {Tk_MeasureChars: make first part of word fit} {
+test macFont-7.10 {Tk_MeasureChars: make first part of word fit} {macOnly} {
.b.l config -wrap [expr $ax*12] -text "0000000000000000"
getsize
} "[expr $ax*12] [expr $ay*2]"
-test macFont-7.11 {Tk_MeasureChars: numBytes == 0} {
+test macFont-7.11 {Tk_MeasureChars: numBytes == 0} {macOnly} {
font measure system {}
} {0}
-test macFont-7.12 {Tk_MeasureChars: maxLength < 0} {
+test macFont-7.12 {Tk_MeasureChars: maxLength < 0} {macOnly} {
font measure $courier abcd
} "[expr $cx*4]"
-test macFont-7.13 {Tk_MeasureChars: loop on each char} {
+test macFont-7.13 {Tk_MeasureChars: loop on each char} {macOnly} {
font measure $courier abcd
} "[expr $cx*4]"
-test macFont-7.14 {Tk_MeasureChars: p == end} {
+test macFont-7.14 {Tk_MeasureChars: p == end} {macOnly} {
font measure $courier abcd
} "[expr $cx*4]"
-test macFont-7.15 {Tk_MeasureChars: p > end} {
+test macFont-7.15 {Tk_MeasureChars: p > end} {macOnly} {
font measure $courier abc\xc2
} "[expr $cx*4]"
-test macFont-7.16 {Tk_MeasureChars: thisFamilyPtr != lastFamilyPtr} {gothic} {
+test macFont-7.16 {Tk_MeasureChars: thisFamilyPtr != lastFamilyPtr} {gothic macOnly} {
font measure $courier abc\u4e4edef
} [expr $cx*6+$mx]
-test macFont-7.17 {Tk_MeasureChars: measure no chars (in loop)} {gothic} {
+test macFont-7.17 {Tk_MeasureChars: measure no chars (in loop)} {gothic macOnly} {
font measure $courier \u4e4edef
} [expr $mx+$cx*3]
-test macFont-7.18 {Tk_MeasureChars: final measure} {gothic} {
+test macFont-7.18 {Tk_MeasureChars: final measure} {gothic macOnly} {
font measure $courier \u4e4edef
} [expr $mx+$cx*3]
-test macFont-7.19 {Tk_MeasureChars: final measure (no chars)} {gothic} {
+test macFont-7.19 {Tk_MeasureChars: final measure (no chars)} {gothic macOnly} {
font measure $courier \u4e4e
} [expr $mx]
-test macFont-7.20 {Tk_MeasureChars: maxLength >= 0} {
+test macFont-7.20 {Tk_MeasureChars: maxLength >= 0} {macOnly} {
.b.l config -wrap [expr $ax*8] -text "000"
getsize
} "[expr $ax*3] $ay"
-test macFont-7.21 {Tk_MeasureChars: loop on each char} {
+test macFont-7.21 {Tk_MeasureChars: loop on each char} {macOnly} {
.b.l config -wrap [expr $ax*8] -text "000"
getsize
} "[expr $ax*3] $ay"
-test macFont-7.22 {Tk_MeasureChars: p == end} {
+test macFont-7.22 {Tk_MeasureChars: p == end} {macOnly} {
.b.l config -wrap [expr $ax*8] -text "000"
getsize
} "[expr $ax*3] $ay"
-test macFont-7.23 {Tk_MeasureChars: p > end} {
+test macFont-7.23 {Tk_MeasureChars: p > end} {macOnly} {
.b.l config -wrap [expr $ax*8] -text "00\xc2"
getsize
} "[expr $ax*3] $ay"
-test macFont-7.24 {Tk_MeasureChars: thisFamilyPtr != lastFamilyPtr} {gothic} {
+test macFont-7.24 {Tk_MeasureChars: thisFamilyPtr != lastFamilyPtr} {gothic macOnly} {
.b.l config -wrap [expr $ax*8] -text "00\u4e4e00"
getsize
} "[expr $ax*4+$mx] $ay"
-test macFont-7.25 {Tk_MeasureChars: measure no chars (in loop)} {gothic} {
+test macFont-7.25 {Tk_MeasureChars: measure no chars (in loop)} {gothic macOnly} {
.b.l config -wrap [expr $ax*8] -text "\u4e4e00"
getsize
} "[expr $mx+$ax*2] $ay"
-test macFont-7.26 {Tk_MeasureChars: rest == NULL} {gothic} {
+test macFont-7.26 {Tk_MeasureChars: rest == NULL} {gothic macOnly} {
.b.l config -wrap [expr $ax*20] -text "000000\u4e4e\u4e4e00"
getsize
} "[expr $ax*8+$mx*2] $ay"
-test macFont-7.27 {Tk_MeasureChars: rest != NULL in first segment} {gothic} {
+test macFont-7.27 {Tk_MeasureChars: rest != NULL in first segment} {gothic macOnly} {
.b.l config -wrap [expr $ax*5] -text "000000\u4e4e\u4e4f00"
getsize
} "[expr $ax*5] [expr $ay*3]"
-test macFont-7.28 {Tk_MeasureChars: rest != NULL in next segment} {gothic} {
+test macFont-7.28 {Tk_MeasureChars: rest != NULL in next segment} {gothic macOnly} {
# even some of the "0"s would fit after \u4e4d, they should all wrap to next line.
.b.l config -wrap [expr $ax*8] -text "\u4e4d\u4e4d000000\u4e4e\u4e4f00"
getsize
} "[expr $ax*6+$mx] [expr $ay*3]"
-test macFont-7.29 {Tk_MeasureChars: final measure} {gothic} {
+test macFont-7.29 {Tk_MeasureChars: final measure} {gothic macOnly} {
.b.l config -wrap [expr $ax*8] -text "\u4e4e00"
getsize
} "[expr $mx+$ax*2] $ay"
-test macFont-7.30 {Tk_MeasureChars: final measure (no chars)} {gothic} {
+test macFont-7.30 {Tk_MeasureChars: final measure (no chars)} {gothic macOnly} {
.b.l config -wrap [expr $ax*8] -text "\u4e4e"
getsize
} "$mx $ay"
-test macFont-7.31 {Tk_MeasureChars: rest == NULL} {
+test macFont-7.31 {Tk_MeasureChars: rest == NULL} {macOnly} {
.b.l config -wrap [expr $ax*1000] -text 0000
getsize
} "[expr $ax*4] $ay"
-test macFont-7.32 {Tk_MeasureChars: rest != NULL} {
+test macFont-7.32 {Tk_MeasureChars: rest != NULL} {macOnly} {
.b.l config -wrap [expr $ax*6] -text "00000000"
getsize
} "[expr $ax*6] [expr $ay*2]"
-test macFont-8.1 {Tk_DrawChars procedure} {
+test macFont-8.1 {Tk_DrawChars procedure} {macOnly} {
.b.l config -text "a"
update
} {}
-test macFont-9.1 {AllocMacFont: use old font} {
+test macFont-9.1 {AllocMacFont: use old font} {macOnly} {
font create xyz
button .c -font xyz
font configure xyz -family times
@@ -272,13 +269,13 @@ test macFont-9.1 {AllocMacFont: use old font} {
destroy .c
font delete xyz
} {}
-test macFont-9.2 {AllocMacFont: extract info from style} {
+test macFont-9.2 {AllocMacFont: extract info from style} {macOnly} {
font actual {Monaco 9 bold italic underline overstrike}
} {-family Monaco -size 9 -weight bold -slant italic -underline 1 -overstrike 0}
-test macFont-9.3 {AllocMacFont: extract text metrics} {
+test macFont-9.3 {AllocMacFont: extract text metrics} {macOnly} {
font metric {Geneva 10} -fixed
} {0}
-test macFont-9.4 {AllocMacFont: extract text metrics} {
+test macFont-9.4 {AllocMacFont: extract text metrics} {macOnly} {
font metric "Monaco 9" -fixed
} {1}
@@ -287,16 +284,3 @@ destroy .b
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/macMenu.test b/tk/tests/macMenu.test
index 0cbed04c75d..fd2cfbf9a0e 100644
--- a/tk/tests/macMenu.test
+++ b/tk/tests/macMenu.test
@@ -9,49 +9,28 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-if {$tcl_platform(platform) != "macintosh"} {
- puts "skipping: Mac only tests..."
- ::tcltest::cleanupTests
- return
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-proc deleteWindows {} {
- foreach i [winfo children .] {
- catch [destroy $i]
- }
-}
-
-deleteWindows
-wm geometry . {}
-raise .
-
-test macMenu-1.0 {TkMacUseMenuID} {} {
+test macMenu-1.0 {TkMacUseMenuID} {macOnly} {
# Can't really test TkMacUseMenuID; it's only called on startup.
} {}
-test macMenu-2.1 {GetNewID} {
+test macMenu-2.1 {GetNewID} {macOnly} {
catch {destroy .m1}
list [catch {menu .m1} msg] $msg [destroy .m1]
} {0 .m1 {}}
-test macMenu-2.2 {GetNewID - cascade menu} {
+test macMenu-2.2 {GetNewID - cascade menu} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m2
list [catch {menu .m2} msg] $msg [destroy .m1] [destroy .m2]
} {0 .m2 {} {}}
-test macMenu-2.3 {GetNewID - running out of ids} {
+test macMenu-2.3 {GetNewID - running out of ids} {macOnly} {
deleteWindows
menu .menu
for {set i 0} {$i < 230} {incr i} {
@@ -62,18 +41,18 @@ test macMenu-2.3 {GetNewID - running out of ids} {
list [catch {.menu add cascade -menu .breaker} msg] $msg [deleteWindows]
} {1 {No more menus can be allocated.} {}}
-test macMenu-3.1 {FreeID} {
+test macMenu-3.1 {FreeID} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {destroy .m1} msg] $msg
} {0 {}}
# No way to test running out of ids in TkpNewPlatformMenu
-test macMenu-4.1 {TkpNewMenu} {
+test macMenu-4.1 {TkpNewMenu} {macOnly} {
catch {destroy .m1}
list [catch {menu .m1} msg] $msg [catch {destroy .m1} msg2] $msg2
} {0 .m1 0 {}}
-test macMenu-4.2 {TkpNewMenu - checking for help menu when one is there} {
+test macMenu-4.2 {TkpNewMenu - checking for help menu when one is there} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
menu .m1
@@ -84,7 +63,7 @@ test macMenu-4.2 {TkpNewMenu - checking for help menu when one is there} {
update
list [catch {menu .m2} msg] $msg [destroy .m1] [destroy .m2] [. configure -menu ""]
} {0 .m2 {} {} {}}
-test macMenu-4.3 {TkpNewMenu - menubar set but different interp} {
+test macMenu-4.3 {TkpNewMenu - menubar set but different interp} {macOnly} {
catch {interp delete testinterp}
catch {destroy .m1}
interp create testinterp
@@ -95,7 +74,7 @@ test macMenu-4.3 {TkpNewMenu - menubar set but different interp} {
interp eval testinterp {update}
list [catch {menu .m1} msg] $msg [destroy .m1] [interp delete testinterp]
} {0 .m1 {} {}}
-test macMenu-4.4 {TkpNewMenu - menubar set but new menu has different parent} {
+test macMenu-4.4 {TkpNewMenu - menubar set but new menu has different parent} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
menu .m1 -tearoff 0
@@ -107,7 +86,7 @@ test macMenu-4.4 {TkpNewMenu - menubar set but new menu has different parent} {
update
list [catch {menu .m2.help} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .m2]
} {0 .m2.help {} {} {}}
-test macMenu-4.5 {TkpNewMenu - menubar set, same parent, not .help} {
+test macMenu-4.5 {TkpNewMenu - menubar set, same parent, not .help} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.help
@@ -116,7 +95,7 @@ test macMenu-4.5 {TkpNewMenu - menubar set, same parent, not .help} {
update
list [catch {menu .m1.foo} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 .m1.foo {} {}}
-test macMenu-4.6 {TkpNewMenu - creating the help menu} {
+test macMenu-4.6 {TkpNewMenu - creating the help menu} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.help
@@ -126,12 +105,12 @@ test macMenu-4.6 {TkpNewMenu - creating the help menu} {
list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 .m1.help {} {}}
-test macMenu-5.1 {TkpDestroyMenu} {
+test macMenu-5.1 {TkpDestroyMenu} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {destroy .m1} msg] $msg
} {0 {}}
-test macMenu-5.2 {TkpDestroyMenu - help menu} {
+test macMenu-5.2 {TkpDestroyMenu - help menu} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.help
@@ -141,13 +120,13 @@ test macMenu-5.2 {TkpDestroyMenu - help menu} {
update
list [catch {destroy .m1.help} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-5.3 {TkpDestroyMenu - idle handler pending} {
+test macMenu-5.3 {TkpDestroyMenu - idle handler pending} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label test
list [catch {destroy .m1} msg] $msg
} {0 {}}
-test macMenu-5.4 {TkpDestroyMenu - idle handler not pending} {
+test macMenu-5.4 {TkpDestroyMenu - idle handler not pending} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label test
@@ -155,14 +134,14 @@ test macMenu-5.4 {TkpDestroyMenu - idle handler not pending} {
list [catch {destroy .m1} msg] $msg
} {0 {}}
-test macMenu-6.1 {SetMenuCascade} {
+test macMenu-6.1 {SetMenuCascade} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
menu .m1
menu .m2
list [catch {.m2 add cascade -menu .m1} msg] $msg [destroy .m1 .m2]
} {0 {} {}}
-test macMenu-6.2 {SetMenuCascade - running out of ids} {
+test macMenu-6.2 {SetMenuCascade - running out of ids} {macOnly} {
deleteWindows
menu .menu
for {set i 0} {$i < 230} {incr i} {
@@ -173,13 +152,13 @@ test macMenu-6.2 {SetMenuCascade - running out of ids} {
list [catch {.menu add cascade -menu .breaker} msg] $msg [deleteWindows]
} {1 {No more menus can be allocated.} {}}
-test macMenu-7.1 {TkpDestroyMenuEntry} {
+test macMenu-7.1 {TkpDestroyMenuEntry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test"
list [catch {.m1 delete 1} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-7.2 {TkpDestroyMenuEntry - help menu} {
+test macMenu-7.2 {TkpDestroyMenuEntry - help menu} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.help
@@ -191,60 +170,60 @@ test macMenu-7.2 {TkpDestroyMenuEntry - help menu} {
list [catch {.m1.help delete test} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-8.1 {GetEntryText} {
+test macMenu-8.1 {GetEntryText} {macOnly} {
catch {destroy .m1}
list [catch {menu .m1} msg] $msg [destroy .m1]
} {0 .m1 {}}
-test macMenu-8.2 {GetEntryText} {
+test macMenu-8.2 {GetEntryText} {macOnly testImageType} {
catch {destroy .m1}
catch {image delete image1}
menu .m1
image create test image1
list [catch {.m1 add command -image image1} msg] $msg [destroy .m1] [image delete image1]
} {0 {} {} {}}
-test macMenu-8.3 {GetEntryText} {
+test macMenu-8.3 {GetEntryText} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -bitmap questhead} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.4 {GetEntryText} {
+test macMenu-8.4 {GetEntryText} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.5 {GetEntryText} {
+test macMenu-8.5 {GetEntryText} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "foo"
list [catch {.m1 add command -label "foo"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.6 {GetEntryText} {
+test macMenu-8.6 {GetEntryText} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label "This is a very long string. 9012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890"} \
msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.7 {GetEntryText - elipses character} {
+test macMenu-8.7 {GetEntryText - elipses character} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label "foo..."} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.8 {GetEntryText - false elipses character} {
+test macMenu-8.8 {GetEntryText - false elipses character} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label "foo."} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.9 {GetEntryText - false elipses character} {
+test macMenu-8.9 {GetEntryText - false elipses character} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label "foo.."} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.10 {GetEntryText - false elipses character} {
+test macMenu-8.10 {GetEntryText - false elipses character} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label "foo.b"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-8.11 {GetEntryText - false elipses character} {
+test macMenu-8.11 {GetEntryText - false elipses character} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label "foo..b"} msg] $msg [destroy .m1]
@@ -252,7 +231,7 @@ test macMenu-8.11 {GetEntryText - false elipses character} {
# test macMenu-9.1 - assumes some fonts
-test macMenu-9.1 {FindMarkCharacter} {
+test macMenu-9.1 {FindMarkCharacter} {macOnly} {
catch {destroy .m1}
menu .m1 -font "Helvetica 12" -tearoff 0
.m1 add checkbutton -label test
@@ -261,40 +240,40 @@ test macMenu-9.1 {FindMarkCharacter} {
} {0 {} {}}
# All standard fonts have "¥" defined. We can't test further.
-test macMenu-10.1 {SetMenuIndicator - cascade entry} {
+test macMenu-10.1 {SetMenuIndicator - cascade entry} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add cascade -label foo} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-10.2 {SetMenuIndicator - not radio or checkbutton} {
+test macMenu-10.2 {SetMenuIndicator - not radio or checkbutton} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label foo} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-10.3 {SetMenuIndicator - indiatorOn false} {
+test macMenu-10.3 {SetMenuIndicator - indiatorOn false} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add checkbutton -label foo -indicatoron 0} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-10.4 {SetMenuIndicator - entry not selected} {
+test macMenu-10.4 {SetMenuIndicator - entry not selected} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add checkbutton -label foo} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-10.5 {SetMenuIndicator - checkbutton} {
+test macMenu-10.5 {SetMenuIndicator - checkbutton} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
list [catch {.m1 invoke foo} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-10.6 {SetMenuIndicator - radio button} {
+test macMenu-10.6 {SetMenuIndicator - radio button} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label foo
list [catch {.m1 invoke foo} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-11.1 {SetMenuTitle} {
+test macMenu-11.1 {SetMenuTitle} {macOnly} {
catch {destroy .m1}
catch {destroy .container}
menu .container
@@ -303,7 +282,7 @@ test macMenu-11.1 {SetMenuTitle} {
.container add cascade -label "File" -menu .m1
list [catch {. configure -menu .container} msg] $msg [. configure -menu ""] [destroy .container .m1]
} {0 {} {} {}}
-test macMenu-11.2 {SetMenuTitle} {
+test macMenu-11.2 {SetMenuTitle} {macOnly} {
menu .container
menu .m1
. configure -menu ""
@@ -312,14 +291,14 @@ test macMenu-11.2 {SetMenuTitle} {
list [catch {. configure -menu .container} msg] $msg [. configure -menu ""] [destroy .container .m1]
} {0 {} {} {}}
-test macMenu-12.1 {TkpConfigureMenuEntry} {
+test macMenu-12.1 {TkpConfigureMenuEntry} {macOnly} {
catch {destroy .m1}
. configure -menu ""
menu .m1
.m1 add cascade -menu .m3
list [catch {.m1 entryconfigure 1 -menu .m2} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.2 {TkpConfigureMenuEntry} {
+test macMenu-12.2 {TkpConfigureMenuEntry} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
. configure -menu ""
@@ -328,7 +307,7 @@ test macMenu-12.2 {TkpConfigureMenuEntry} {
menu .m2
list [catch {.m1 entryconfigure 1 -menu .m2} msg] $msg [destroy .m1 .m2]
} {0 {} {}}
-test macMenu-12.3 {TkpConfigureMenuEntry - running out of ids} {
+test macMenu-12.3 {TkpConfigureMenuEntry - running out of ids} {macOnly} {
deleteWindows
menu .menu
for {set i 0} {$i < 230} {incr i} {
@@ -338,63 +317,63 @@ test macMenu-12.3 {TkpConfigureMenuEntry - running out of ids} {
menu .breaker
list [catch {.menu add cascade -menu .breaker} msg] $msg [deleteWindows]
} {1 {No more menus can be allocated.} {}}
-test macMenu-12.4 {TkpConfigureMenuEntry - Control} {
+test macMenu-12.4 {TkpConfigureMenuEntry - Control} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Control+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.5 {TkpConfigureMenuEntry - Ctrl} {
+test macMenu-12.5 {TkpConfigureMenuEntry - Ctrl} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Ctrl+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.6 {TkpConfigureMenuEntry - Shift} {
+test macMenu-12.6 {TkpConfigureMenuEntry - Shift} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Shift+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.7 {TkpConfigureMenuEntry - Option} {
+test macMenu-12.7 {TkpConfigureMenuEntry - Option} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Opt+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.8 {TkpConfigureMenuEntry - Command} {
+test macMenu-12.8 {TkpConfigureMenuEntry - Command} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Command+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.9 {TkpConfigureMenuEntry - Cmd} {
+test macMenu-12.9 {TkpConfigureMenuEntry - Cmd} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Cmd+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.10 {TkpConfigureMenuEntry - Alt} {
+test macMenu-12.10 {TkpConfigureMenuEntry - Alt} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Alt+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.11 {TkpConfigureMenuEntry - Meta} {
+test macMenu-12.11 {TkpConfigureMenuEntry - Meta} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Meta+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.12 {TkpConfigureMenuEntry - Two modifiers} {
+test macMenu-12.12 {TkpConfigureMenuEntry - Two modifiers} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Cmd+Shift+S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.13 {TkpConfigureMenuEntry - dash instead of plus} {
+test macMenu-12.13 {TkpConfigureMenuEntry - dash instead of plus} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -accel "Command-S"} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.14 {TkpConfigureMenuEntry - idler pending} {
+test macMenu-12.14 {TkpConfigureMenuEntry - idler pending} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label test
list [catch {.m1 entryconfigure test -label test2} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-12.15 {TkpConfigureMenuEntry - idler not pending} {
+test macMenu-12.15 {TkpConfigureMenuEntry - idler not pending} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label test
@@ -402,13 +381,13 @@ test macMenu-12.15 {TkpConfigureMenuEntry - idler not pending} {
list [catch {.m1 entryconfigure test -label test2} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.1 {ReconfigureIndividualMenu - getting rid of zero items} {
+test macMenu-13.1 {ReconfigureIndividualMenu - getting rid of zero items} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.2 {ReconfigureIndividualMenu - getting rid of one item} {
+test macMenu-13.2 {ReconfigureIndividualMenu - getting rid of one item} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label test
@@ -416,7 +395,7 @@ test macMenu-13.2 {ReconfigureIndividualMenu - getting rid of one item} {
.m1 delete test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.3 {ReconfigureIndividualMenu - getting rid of more than one} {
+test macMenu-13.3 {ReconfigureIndividualMenu - getting rid of more than one} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label test
@@ -425,67 +404,67 @@ test macMenu-13.3 {ReconfigureIndividualMenu - getting rid of more than one} {
.m1 entryconfigure test2 -label "test two"
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.4 {ReconfigureIndividualMenu - separator} {
+test macMenu-13.4 {ReconfigureIndividualMenu - separator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.5 {ReconfigureIndividualMenu - disabled} {
+test macMenu-13.5 {ReconfigureIndividualMenu - disabled} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command
.m1 entryconfigure 1 -state disabled
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.6 {ReconfigureIndividualMenu - active} {
+test macMenu-13.6 {ReconfigureIndividualMenu - active} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command
.m1 entryconfigure 1 -state active
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.7 {ReconfigureIndividualMenu - checkbutton not checked} {
+test macMenu-13.7 {ReconfigureIndividualMenu - checkbutton not checked} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.8 {ReconfigureIndividualMenu - checkbutton - indicator off} {
+test macMenu-13.8 {ReconfigureIndividualMenu - checkbutton - indicator off} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label test -indicatoron 0
.m1 invoke test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.9 {ReconfigureIndividualMenu - checkbutton on} {
+test macMenu-13.9 {ReconfigureIndividualMenu - checkbutton on} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label test
.m1 invoke test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.10 {ReconfigureIndividualMenu - radiobutton not checked} {
+test macMenu-13.10 {ReconfigureIndividualMenu - radiobutton not checked} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.11 {ReconfigureIndividualMenu - radiobutton - indicator off} {
+test macMenu-13.11 {ReconfigureIndividualMenu - radiobutton - indicator off} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label test -indicatoron 0
.m1 invoke test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.12 {ReconfigureIndividualMenu - radiobutton on} {
+test macMenu-13.12 {ReconfigureIndividualMenu - radiobutton on} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label test
.m1 invoke test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.13 {ReconfigureIndividualMenu} {
+test macMenu-13.13 {ReconfigureIndividualMenu} {macOnly} {
catch {destroy .m1}
. configure -menu ""
menu .m1
@@ -493,7 +472,7 @@ test macMenu-13.13 {ReconfigureIndividualMenu} {
.m1 entryconfigure 1 -menu .m2
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.14 {ReconfigureIndividualMenu} {
+test macMenu-13.14 {ReconfigureIndividualMenu} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
. configure -menu ""
@@ -503,13 +482,13 @@ test macMenu-13.14 {ReconfigureIndividualMenu} {
.m1 entryconfigure 1 -menu .m2
list [catch {update idletasks} msg] $msg [destroy .m1 .m2]
} {0 {} {}}
-test macMenu-13.15 {ReconfigureIndividualMenu - accelerator} {
+test macMenu-13.15 {ReconfigureIndividualMenu - accelerator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -accel "Command-S"
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.16 {ReconfigureIndividualMenu - parent is disabled} {
+test macMenu-13.16 {ReconfigureIndividualMenu - parent is disabled} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label .m1.edit -label "Edit" -state disabled
@@ -517,7 +496,7 @@ test macMenu-13.16 {ReconfigureIndividualMenu - parent is disabled} {
.m1.edit add command -label foo
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-13.17 {ReconfigureIndividualMenu - disabling parent} {
+test macMenu-13.17 {ReconfigureIndividualMenu - disabling parent} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label .m1.edit -label Edit
@@ -527,13 +506,13 @@ test macMenu-13.17 {ReconfigureIndividualMenu - disabling parent} {
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-14.1 {ReconfigureMacintoshMenu - normal menu} {
+test macMenu-14.1 {ReconfigureMacintoshMenu - normal menu} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label test
list [catch {update idletasks} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-14.2 {ReconfigureMacintoshMenu - apple menu} {
+test macMenu-14.2 {ReconfigureMacintoshMenu - apple menu} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.apple
@@ -543,7 +522,7 @@ test macMenu-14.2 {ReconfigureMacintoshMenu - apple menu} {
raise .
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-14.3 {ReconfigureMacintoshMenu - help menu} {
+test macMenu-14.3 {ReconfigureMacintoshMenu - help menu} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.help
@@ -553,7 +532,7 @@ test macMenu-14.3 {ReconfigureMacintoshMenu - help menu} {
raise .
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-14.4 {ReconfigureMacintoshMenu - menubar} {
+test macMenu-14.4 {ReconfigureMacintoshMenu - menubar} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.file -label "foo"
@@ -564,20 +543,20 @@ test macMenu-14.4 {ReconfigureMacintoshMenu - menubar} {
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-15.1 {CompleteIdlers - no idle pending} {
+test macMenu-15.1 {CompleteIdlers - no idle pending} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label test
update idletasks
list [catch {.m1 post 40 40} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-15.2 {CompleteIdlers - idle pending} {
+test macMenu-15.2 {CompleteIdlers - idle pending} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label test
list [catch {.m1 post 40 40} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-15.3 {CompleteIdlers - recursive} {
+test macMenu-15.3 {CompleteIdlers - recursive} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.m2 -label test
@@ -587,38 +566,38 @@ test macMenu-15.3 {CompleteIdlers - recursive} {
} {0 {} {}}
#Don't know how to generate nested post menus
-test macMenu-16.1 {TkpPostMenu} {
+test macMenu-16.1 {TkpPostMenu} {macOnly} {
catch {destroy .m1}
menu .m1 -postcommand "destroy .m1"
list [catch {.m1 post 40 40} msg] $msg
} {0 {}}
-test macMenu-16.2 {TkpPostMenu} {
+test macMenu-16.2 {TkpPostMenu} {macOnly} {
catch {destroy .m1}
menu .m1 -postcommand "blork"
list [catch {.m1 post 40 40} msg] $msg [destroy .m1]
} {1 {invalid command name "blork"} {}}
# We need to write the interactive test for menu posting.
-test macMenu-17.1 {TkpMenuNewEntry - no idle pending} {
+test macMenu-17.1 {TkpMenuNewEntry - no idle pending} {macOnly} {
catch {destroy .m1}
menu .m1
list [catch {.m1 add command -label test} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-17.2 {TkpMenuNewEntry - idle pending} {
+test macMenu-17.2 {TkpMenuNewEntry - idle pending} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label test
list [catch {.m1 add command -label test2} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-18.1 {DrawMenuBarWhenIdle} {
+test macMenu-18.1 {DrawMenuBarWhenIdle} {macOnly} {
catch {destroy .m1}
. configure -menu ""
menu .m1
. configure -menu .m1
list [catch {update idletasks} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.2 {DrawMenuBarWhenIdle - clearing old apple menu out} {
+test macMenu-18.2 {DrawMenuBarWhenIdle - clearing old apple menu out} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.apple
@@ -631,7 +610,7 @@ test macMenu-18.2 {DrawMenuBarWhenIdle - clearing old apple menu out} {
raise .
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-18.3 {DrawMenuBarWhenIdle - clearing out old help menu} {
+test macMenu-18.3 {DrawMenuBarWhenIdle - clearing out old help menu} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.help
@@ -644,27 +623,27 @@ test macMenu-18.3 {DrawMenuBarWhenIdle - clearing out old help menu} {
raise .
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-18.4 {DrawMenuBarWhenIdle - menu not there} {
+test macMenu-18.4 {DrawMenuBarWhenIdle - menu not there} {macOnly} {
catch {destroy .m1}
. configure -menu .m1
raise .
list [catch {update} msg] $msg [. configure -menu ""]
} {0 {} {}}
-test macMenu-18.5 {DrawMenuBarWhenIdle - menu there} {
+test macMenu-18.5 {DrawMenuBarWhenIdle - menu there} {macOnly} {
catch {destroy .m1}
menu .m1
. configure -menu .m1
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.6 {DrawMenuBarWhenIdle - no apple menu} {
+test macMenu-18.6 {DrawMenuBarWhenIdle - no apple menu} {macOnly} {
catch {destroy .m1}
menu .m1
. configure -menu .m1
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.7 {DrawMenuBarWhenIdle - apple menu references but not there} {
+test macMenu-18.7 {DrawMenuBarWhenIdle - apple menu references but not there} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.apple
@@ -672,7 +651,7 @@ test macMenu-18.7 {DrawMenuBarWhenIdle - apple menu references but not there} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.8 {DrawMenuBarWhenIdle - apple menu there} {
+test macMenu-18.8 {DrawMenuBarWhenIdle - apple menu there} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.apple
@@ -682,7 +661,7 @@ test macMenu-18.8 {DrawMenuBarWhenIdle - apple menu there} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.9 {DrawMenuBarWhenIdle - apple menu there; no idle handler} {
+test macMenu-18.9 {DrawMenuBarWhenIdle - apple menu there; no idle handler} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.apple
@@ -693,14 +672,14 @@ test macMenu-18.9 {DrawMenuBarWhenIdle - apple menu there; no idle handler} {
update idletasks
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.10 {DrawMenuBarWhenIdle - no help menu} {
+test macMenu-18.10 {DrawMenuBarWhenIdle - no help menu} {macOnly} {
catch {destroy .m1}
menu .m1
. configure -menu .m1
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.11 {DrawMenuBarWhenIdle - help menu referenced but not there} {
+test macMenu-18.11 {DrawMenuBarWhenIdle - help menu referenced but not there} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.help
@@ -708,7 +687,7 @@ test macMenu-18.11 {DrawMenuBarWhenIdle - help menu referenced but not there} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.12 {DrawMenuBarWhenIdle - help menu there} {
+test macMenu-18.12 {DrawMenuBarWhenIdle - help menu there} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.help
@@ -718,7 +697,7 @@ test macMenu-18.12 {DrawMenuBarWhenIdle - help menu there} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.13 {DrawMenuBarWhenIdle - help menu there - no idlers} {
+test macMenu-18.13 {DrawMenuBarWhenIdle - help menu there - no idlers} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.help
@@ -730,7 +709,7 @@ test macMenu-18.13 {DrawMenuBarWhenIdle - help menu there - no idlers} {
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
# Can't generate no menubar clone
-test macMenu-18.14 {DrawMenuBarWhenIdle - apple and help menus in tearoff menubar} {
+test macMenu-18.14 {DrawMenuBarWhenIdle - apple and help menus in tearoff menubar} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -menu .m1.apple
@@ -741,7 +720,7 @@ test macMenu-18.14 {DrawMenuBarWhenIdle - apple and help menus in tearoff menuba
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.15 {DrawMenuBarWhenIdle - apple and help menus in non-tearoff menubar} {
+test macMenu-18.15 {DrawMenuBarWhenIdle - apple and help menus in non-tearoff menubar} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -menu .m1.apple
@@ -752,14 +731,14 @@ test macMenu-18.15 {DrawMenuBarWhenIdle - apple and help menus in non-tearoff me
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.16 {DrawMenuBarWhenIdle - no apple menu} {
+test macMenu-18.16 {DrawMenuBarWhenIdle - no apple menu} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
. configure -menu .m1
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.17 {DrawMenuBarWhenIdle - apple menu} {
+test macMenu-18.17 {DrawMenuBarWhenIdle - apple menu} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
. configure -menu .m1
@@ -770,7 +749,7 @@ test macMenu-18.17 {DrawMenuBarWhenIdle - apple menu} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.18 {DrawMenuBarWhenIdle - big for loop} {
+test macMenu-18.18 {DrawMenuBarWhenIdle - big for loop} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
menu .m1.apple -tearoff 0
@@ -783,7 +762,7 @@ test macMenu-18.18 {DrawMenuBarWhenIdle - big for loop} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-18.19 {DrawMenuBarWhenIdle = disabled menu} {
+test macMenu-18.19 {DrawMenuBarWhenIdle = disabled menu} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
menu .m1.edit -tearoff 0
@@ -794,7 +773,7 @@ test macMenu-18.19 {DrawMenuBarWhenIdle = disabled menu} {
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-19.1 {RecursivelyInsertMenu} {
+test macMenu-19.1 {RecursivelyInsertMenu} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
catch {destroy .main}
@@ -810,7 +789,7 @@ test macMenu-19.1 {RecursivelyInsertMenu} {
.m2 add command -label "Test 3"
list [catch {raise .t2} msg] $msg [destroy .t2 .main .m1 .m2]
} {0 {} {}}
-test macMenu-19.2 {RecursivelyInsertMenu} {
+test macMenu-19.2 {RecursivelyInsertMenu} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
catch {destroy .main}
@@ -827,13 +806,13 @@ test macMenu-19.2 {RecursivelyInsertMenu} {
list [catch {raise .t2} msg] $msg [destroy .t2 .main .m1 .m2]
} {0 {} {}}
-test macMenu-20.1 {SetDefaultMenuBar} {
+test macMenu-20.1 {SetDefaultMenuBar} {macOnly} {
. configure -menu ""
raise .
list [catch {update} msg] $msg
} {0 {}}
-test macMenu-21.1 {TkpSetMainMenubar - not front window} {
+test macMenu-21.1 {TkpSetMainMenubar - not front window} {macOnly} {
catch {destroy .m1}
catch {destroy .t2}
toplevel .t2
@@ -843,16 +822,16 @@ test macMenu-21.1 {TkpSetMainMenubar - not front window} {
update
list [catch {.t2 configure -menu .m1} msg] $msg [destroy .t2] [destroy .m1]
} {0 {} {} {}}
-test macMenu-21.2 {TkpSetMainMenubar - menu null} {
+test macMenu-21.2 {TkpSetMainMenubar - menu null} {macOnly} {
. configure -menu ""
raise .
list [catch {update} msg] $msg
} {0 {}}
-test macMenu-21.3 {TkpSetMainMenubar - different interps} {
+test macMenu-21.3 {TkpSetMainMenubar - different interps} {macOnly} {
catch {destroy .m1}
catch {interp delete testinterp}
interp create testinterp
- load {} tk testinterp
+ load {} Tk testinterp
menu .m1
. configure -menu .m1
raise .
@@ -862,7 +841,7 @@ test macMenu-21.3 {TkpSetMainMenubar - different interps} {
interp eval testinterp {raise .}
list [catch {interp eval testinterp {update}} msg] $msg [interp delete testinterp] [. configure -menu ""] [destroy .m1]
} {0 {} {} {} {}}
-test macMenu-21.4 {TkpSetMainMenubar - different windows} {
+test macMenu-21.4 {TkpSetMainMenubar - different windows} {macOnly} {
catch {destroy .m1}
catch {destroy .t2}
menu .m1
@@ -875,7 +854,7 @@ test macMenu-21.4 {TkpSetMainMenubar - different windows} {
raise .t2
list [catch {update} msg] $msg [destroy .t2] [. configure -menu ""] [destroy .m1]
} {0 {} {} {} {}}
-test macMenu-21.5 {TkpSetMainMenubar - old menu was null} {
+test macMenu-21.5 {TkpSetMainMenubar - old menu was null} {macOnly} {
catch {destroy .m1}
. configure -menu ""
update
@@ -884,7 +863,7 @@ test macMenu-21.5 {TkpSetMainMenubar - old menu was null} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test macMenu-21.6 {TkpSetMainMenubar - old menu different} {
+test macMenu-21.6 {TkpSetMainMenubar - old menu different} {macOnly} {
catch {destroy .m1}
catch {destroy .m2}
menu .m1
@@ -896,7 +875,7 @@ test macMenu-21.6 {TkpSetMainMenubar - old menu different} {
raise .
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .m2]
} {0 {} {} {} {}}
-test macMenu-21.7 {TkpSetMainMenubar - child window NULL - parent window now} {
+test macMenu-21.7 {TkpSetMainMenubar - child window NULL - parent window now} {macOnly} {
catch {destroy .m1}
catch {destroy .t2}
toplevel .t2
@@ -908,7 +887,7 @@ test macMenu-21.7 {TkpSetMainMenubar - child window NULL - parent window now} {
raise .t2
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .t2]
} {0 {} {} {} {}}
-test macMenu-21.8 {TkpSetMainMenubar - tearoff window} {
+test macMenu-21.8 {TkpSetMainMenubar - tearoff window} {macOnly} {
catch {destroy .t2}
toplevel .t2 -menu .t2.m1
menu .t2.m1
@@ -916,210 +895,210 @@ test macMenu-21.8 {TkpSetMainMenubar - tearoff window} {
menu .t2.m1.foo
.t2.m1.foo add command -label foo
raise .t2
- tkTearOffMenu .t2.m1.foo 100 100
+ tk::TearOffMenu .t2.m1.foo 100 100
list [catch {update} msg] $msg [destroy .t2]
} {0 {} {}}
-test macMenu-22.1 {TkSetWindowMenuBar} {
+test macMenu-22.1 {TkSetWindowMenuBar} {macOnly} {
} {}
-test macMenu-23.1 {TkMacDispatchMenuEvent} {
+test macMenu-23.1 {TkMacDispatchMenuEvent} {macOnly} {
# needs to be interactive.
} {}
-test macMenu-24.1 {GetMenuIndicatorGeometry} {
+test macMenu-24.1 {GetMenuIndicatorGeometry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.1 {GetMenuAccelGeometry - cascade entry} {
+test macMenu-25.1 {GetMenuAccelGeometry - cascade entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.2 {GetMenuAccelGeometry - no accel} {
+test macMenu-25.2 {GetMenuAccelGeometry - no accel} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.3 {GetMenuAccelGeometry - no special chars - arbitrary string} {
+test macMenu-25.3 {GetMenuAccelGeometry - no special chars - arbitrary string} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -accel "Test"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.4 {GetMenuAccelGeometry - Command} {
+test macMenu-25.4 {GetMenuAccelGeometry - Command} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Cmd+S"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.5 {GetMenuAccelGeometry - Control} {
+test macMenu-25.5 {GetMenuAccelGeometry - Control} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Ctrl+S"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.6 {GetMenuAccelGeometry - Shift} {
+test macMenu-25.6 {GetMenuAccelGeometry - Shift} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Shift+S"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.7 {GetMenuAccelGeometry - Option} {
+test macMenu-25.7 {GetMenuAccelGeometry - Option} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Opt+S"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.8 {GetMenuAccelGeometry - Combination} {
+test macMenu-25.8 {GetMenuAccelGeometry - Combination} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Cmd+Shift+S"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-25.9 {GetMenuAccelGeometry - extra text} {
+test macMenu-25.9 {GetMenuAccelGeometry - extra text} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Command+Delete"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-26.1 {GetTearoffEntryGeometry} {
+test macMenu-26.1 {GetTearoffEntryGeometry} {macOnly} {
# can't call this on power mac.
} {}
-test macMenu-27.1 {GetMenuSeparatorGeometry} {
+test macMenu-27.1 {GetMenuSeparatorGeometry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test macMenu-28.1 {DrawMenuEntryIndicator - non-checkbutton} {
+test macMenu-28.1 {DrawMenuEntryIndicator - non-checkbutton} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-28.2 {DrawMenuEntryIndicator - indicator off} {
+test macMenu-28.2 {DrawMenuEntryIndicator - indicator off} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo -indicatoron 0
.m1 invoke foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-28.3 {DrawMenuEntryIndicator - not selected} {
+test macMenu-28.3 {DrawMenuEntryIndicator - not selected} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-28.4 {DrawMenuEntryIndicator - checkbutton} {
+test macMenu-28.4 {DrawMenuEntryIndicator - checkbutton} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-28.5 {DrawMenuEntryIndicator - radiobutton} {
+test macMenu-28.5 {DrawMenuEntryIndicator - radiobutton} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label foo
.m1 invoke foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
# Cannot reproduce resources missing or color allocation failing easily.
-test macMenu-29.1 {DrawSICN} {
+test macMenu-29.1 {DrawSICN} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Cmd+S"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
# Cannot reproduce resources missing
-test macMenu-30.1 {DrawMenuEntryAccelerator - cascade entry} {
+test macMenu-30.1 {DrawMenuEntryAccelerator - cascade entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-30.2 {DrawMenuEntryAccelerator - no accel string} {
+test macMenu-30.2 {DrawMenuEntryAccelerator - no accel string} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-30.3 {DrawMenuEntryAccelerator - random accel string} {
+test macMenu-30.3 {DrawMenuEntryAccelerator - random accel string} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-30.4 {DrawMenuEntryAccelerator - Command} {
+test macMenu-30.4 {DrawMenuEntryAccelerator - Command} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Cmd+S"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-30.5 {DrawMenuEntryAccelerator - Option} {
+test macMenu-30.5 {DrawMenuEntryAccelerator - Option} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Opt+S"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-30.6 {DrawMenuEntryAccelerator - Shift} {
+test macMenu-30.6 {DrawMenuEntryAccelerator - Shift} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Shift+S"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-30.7 {DrawMenuEntryAccelerator - Control} {
+test macMenu-30.7 {DrawMenuEntryAccelerator - Control} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Ctrl+S"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-30.8 {DrawMenuEntryAccelerator - combination} {
+test macMenu-30.8 {DrawMenuEntryAccelerator - combination} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Cmd+Shift+S"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-31.1 {DrawMenuSeparator} {
+test macMenu-31.1 {DrawMenuSeparator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test macMenu-32.1 {TkpDrawMenuEntryLabel} {
+test macMenu-32.1 {TkpDrawMenuEntryLabel} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
@@ -1127,7 +1106,7 @@ test macMenu-33.1 {MenuDefProc - No way to test automatically.} {} {}
test macMenu-34.1 {TkMacHandleTearoffMenu - no way to test automatically} {} {}
test macMenu-35.1 {TkpInitializeMenuBindings - nothing to do} {} {}
-test macMenu-36.1 {TkpComputeMenubarGeometry} {
+test macMenu-36.1 {TkpComputeMenubarGeometry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
@@ -1139,256 +1118,256 @@ test macMenu-37.1 {DrawTearoffEntry - can't do automatically} {} {}
test macMenu-38.1 {TkMacSetHelpMenuItemCount - called at boot time} {} {}
test macMenu-39.1 {TkMacMenuClick - can't do automatically} {} {}
-test macMenu-40.1 {TkpDrawMenuEntry - gc for active and not strict motif} {
+test macMenu-40.1 {TkpDrawMenuEntry - gc for active and not strict motif} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} {
+test macMenu-40.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activeforeground red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.3 {TkpDrawMenuEntry - gc for active and strict motif} {
+test macMenu-40.3 {TkpDrawMenuEntry - gc for active and strict motif} {macOnly} {
catch {destroy .m1}
menu .m1
set tk_strictMotif 1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
} {{} {} 0}
-test macMenu-40.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} {
+test macMenu-40.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} {macOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled -background red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {
+test macMenu-40.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {macOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {
+test macMenu-40.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {macOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground ""
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.7 {TkpDrawMenuEntry - gc for normal - custom entry} {
+test macMenu-40.7 {TkpDrawMenuEntry - gc for normal - custom entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -foreground red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.8 {TkpDrawMenuEntry - gc for normal} {
+test macMenu-40.8 {TkpDrawMenuEntry - gc for normal} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {
+test macMenu-40.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo -selectcolor orange
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.10 {TkpDrawMenuEntry - gc for indicator} {
+test macMenu-40.10 {TkpDrawMenuEntry - gc for indicator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.11 {TkpDrawMenuEntry - border - custom entry} {
+test macMenu-40.11 {TkpDrawMenuEntry - border - custom entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activebackground green
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.12 {TkpDrawMenuEntry - border} {
+test macMenu-40.12 {TkpDrawMenuEntry - border} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.13 {TkpDrawMenuEntry - active border - strict motif} {
+test macMenu-40.13 {TkpDrawMenuEntry - active border - strict motif} {macOnly} {
catch {destroy .m1}
set tk_strictMotif 1
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
} {{} {} 0}
-test macMenu-40.14 {TkpDrawMenuEntry - active border - custom entry} {
+test macMenu-40.14 {TkpDrawMenuEntry - active border - custom entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activeforeground yellow
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.15 {TkpDrawMenuEntry - active border} {
+test macMenu-40.15 {TkpDrawMenuEntry - active border} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.16 {TkpDrawMenuEntry - font - custom entry} {
+test macMenu-40.16 {TkpDrawMenuEntry - font - custom entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -font "Helvectica 72"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.17 {TkpDrawMenuEntry - font} {
+test macMenu-40.17 {TkpDrawMenuEntry - font} {macOnly} {
catch {destroy .m1}
menu .m1 -font "Courier 72"
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.18 {TkpDrawMenuEntry - separator} {
+test macMenu-40.18 {TkpDrawMenuEntry - separator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.19 {TkpDrawMenuEntry - standard} {
+test macMenu-40.19 {TkpDrawMenuEntry - standard} {macOnly} {
catch {destroy .mb}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.20 {TkpDrawMenuEntry - disabled cascade item} {
+test macMenu-40.20 {TkpDrawMenuEntry - disabled cascade item} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label File -menu .m1.file
menu .m1.file
.m1.file add command -label foo
.m1 entryconfigure File -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.21 {TkpDrawMenuEntry - indicator} {
+test macMenu-40.21 {TkpDrawMenuEntry - indicator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label macMenu-40.20
.m1 invoke 0
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-40.22 {TkpDrawMenuEntry - indicator - hideMargin} {
+test macMenu-40.22 {TkpDrawMenuEntry - indicator - hideMargin} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label macMenu-40.21 -hidemargin 1
.m1 invoke 0
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-41.1 {TkpComputeStandardMenuGeometry - no entries} {
+test macMenu-41.1 {TkpComputeStandardMenuGeometry - no entries} {macOnly} {
catch {destroy .m1}
menu .m1
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.2 {TkpComputeStandardMenuGeometry - one entry} {
+test macMenu-41.2 {TkpComputeStandardMenuGeometry - one entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "one"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.3 {TkpComputeStandardMenuGeometry - more than one entry} {
+test macMenu-41.3 {TkpComputeStandardMenuGeometry - more than one entry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.4 {TkpComputeStandardMenuGeometry - separator} {
+test macMenu-41.4 {TkpComputeStandardMenuGeometry - separator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.5 {TkpComputeStandardMenuGeometry - standard label geometry} {
+test macMenu-41.5 {TkpComputeStandardMenuGeometry - standard label geometry} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.6 {TkpComputeStandardMenuGeometry - different font for entry} {
+test macMenu-41.6 {TkpComputeStandardMenuGeometry - different font for entry} {macOnly} {
catch {destroy .m1}
menu .m1 -font "Helvetica 12"
.m1 add command -label "test" -font "Courier 12"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.7 {TkpComputeStandardMenuGeometry - second entry larger} {
+test macMenu-41.7 {TkpComputeStandardMenuGeometry - second entry larger} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test"
.m1 add command -label "test test"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.8 {TkpComputeStandardMenuGeometry - first entry larger} {
+test macMenu-41.8 {TkpComputeStandardMenuGeometry - first entry larger} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test test"
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.9 {TkpComputeStandardMenuGeometry - accelerator} {
+test macMenu-41.9 {TkpComputeStandardMenuGeometry - accelerator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test" -accel "Ctrl+S"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.10 {TkpComputeStandardMenuGeometry - second accel larger} {
+test macMenu-41.10 {TkpComputeStandardMenuGeometry - second accel larger} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test" -accel "1"
.m1 add command -label "test" -accel "1 1"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.11 {TkpComputeStandardMenuGeometry - second accel smaller} {
+test macMenu-41.11 {TkpComputeStandardMenuGeometry - second accel smaller} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "test" -accel "1 1"
.m1 add command -label "test" -accel "1"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.12 {TkpComputeStandardMenuGeometry - indicator} {
+test macMenu-41.12 {TkpComputeStandardMenuGeometry - indicator} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label test
.m1 invoke 1
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.13 {TkpComputeStandardMenuGeometry - second indicator less or equal } {
+test macMenu-41.13 {TkpComputeStandardMenuGeometry - second indicator less or equal } {macOnly testImageType} {
catch {destroy .m1}
catch {image delete image1}
image create test image1
@@ -1399,19 +1378,19 @@ test macMenu-41.13 {TkpComputeStandardMenuGeometry - second indicator less or eq
.m1 invoke 2
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
-test macMenu-41.14 {TkpComputeStandardMenuGeometry - hidden margin} {
+test macMenu-41.14 {TkpComputeStandardMenuGeometry - hidden margin} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label macMenu-41.15 -hidemargin 1
.m1 invoke macMenu-41.15
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.15 {TkpComputeStandardMenuGeometry - zero sized menus} {
+test macMenu-41.15 {TkpComputeStandardMenuGeometry - zero sized menus} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.16 {TkpComputeStandardMenuGeometry - first column bigger} {
+test macMenu-41.16 {TkpComputeStandardMenuGeometry - first column bigger} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label one
@@ -1419,7 +1398,7 @@ test macMenu-41.16 {TkpComputeStandardMenuGeometry - first column bigger} {
.m1 add command -label three -columnbreak 1
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.17 {TkpComputeStandardMenuGeometry - second column bigger} {
+test macMenu-41.17 {TkpComputeStandardMenuGeometry - second column bigger} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label one
@@ -1427,7 +1406,7 @@ test macMenu-41.17 {TkpComputeStandardMenuGeometry - second column bigger} {
.m1 add command -label three
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.18 {TkpComputeStandardMenuGeometry - three columns} {
+test macMenu-41.18 {TkpComputeStandardMenuGeometry - three columns} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label one
@@ -1438,14 +1417,14 @@ test macMenu-41.18 {TkpComputeStandardMenuGeometry - three columns} {
.m1 add command -label six
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.19 {TkpComputeStandardMenuGeometry - entry without accel long} {
+test macMenu-41.19 {TkpComputeStandardMenuGeometry - entry without accel long} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label "This is a long item with no accel."
.m1 add command -label foo -accel "Cmd+S"
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-41.20 {TkpComputeStandardMenuGeometry - entry with accel long} {
+test macMenu-41.20 {TkpComputeStandardMenuGeometry - entry with accel long} {macOnly} {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label foo
@@ -1453,23 +1432,23 @@ test macMenu-41.20 {TkpComputeStandardMenuGeometry - entry with accel long} {
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-42.1 {DrawMenuEntryLabel - setting indicatorSpace} {
+test macMenu-42.1 {DrawMenuEntryLabel - setting indicatorSpace} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "foo"
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-42.2 {DrawMenuEntryLabel - drawing image} {
+test macMenu-42.2 {DrawMenuEntryLabel - drawing image} {macOnly testImageType} {
catch {destroy .m1}
catch {image delete image1}
image create test image1
menu .m1
.m1 add command -image image1
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
-test macMenu-42.3 {DrawMenuEntryLabel - drawing select image} {
+test macMenu-42.3 {DrawMenuEntryLabel - drawing select image} {macOnly testImageType} {
catch {destroy .m1}
catch {eval image delete [image names]}
image create test image1
@@ -1477,48 +1456,48 @@ test macMenu-42.3 {DrawMenuEntryLabel - drawing select image} {
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [update idletasks] [destroy .m1] [eval image delete [image names]]
} {{} {} {}}
-test macMenu-42.4 {DrawMenuEntryLabel - drawing a bitmap} {
+test macMenu-42.4 {DrawMenuEntryLabel - drawing a bitmap} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -bitmap questhead
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-42.5 {DrawMenuEntryLabel - drawing null label} {
+test macMenu-42.5 {DrawMenuEntryLabel - drawing null label} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-42.6 {DrawMenuEntryLabel - drawing real label} {
+test macMenu-42.6 {DrawMenuEntryLabel - drawing real label} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "This is a long label" -underline 3
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-42.7 {DrawMenuEntryLabel - drawing disabled label} {
+test macMenu-42.7 {DrawMenuEntryLabel - drawing disabled label} {macOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground ""
.m1 add command -label "This is a long label" -state disabled
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-42.8 {DrawMenuEntryLabel - disabled images} {
+test macMenu-42.8 {DrawMenuEntryLabel - disabled images} {macOnly testImageType} {
catch {destroy .m1}
catch {image delete image1}
image create test image1
menu .m1
.m1 add command -image image1 -state disabled
- set tearoff [tkTearOffMenu .m1 100 100]
+ set tearoff [tk::TearOffMenu .m1 100 100]
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
-test macMenu-43.1 {GetMenuLabelGeometry - image} {
+test macMenu-43.1 {GetMenuLabelGeometry - image} {macOnly testImageType} {
catch {destroy .m1}
catch {image delete image1}
menu .m1
@@ -1526,57 +1505,45 @@ test macMenu-43.1 {GetMenuLabelGeometry - image} {
.m1 add command -image image1
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
-test macMenu-43.2 {GetMenuLabelGeometry - bitmap} {
+test macMenu-43.2 {GetMenuLabelGeometry - bitmap} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -bitmap questhead
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-43.3 {GetMenuLabelGeometry - no text} {
+test macMenu-43.3 {GetMenuLabelGeometry - no text} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-43.4 {GetMenuLabelGeometry - text} {
+test macMenu-43.4 {GetMenuLabelGeometry - text} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label "This is a test."
list [update idletasks] [destroy .m1]
} {{} {}}
-test macMenu-44.1 {DrawMenuEntryBackground} {
+test macMenu-44.1 {DrawMenuEntryBackground} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test macMenu-44.2 {DrawMenuEntryBackground} {
+test macMenu-44.2 {DrawMenuEntryBackground} {macOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff activate 0
list [update] [destroy .m1]
} {{} {}}
-test macMenu-45.1 {TkpMenuInit - called at boot time} {} {}
+test macMenu-45.1 {TkpMenuInit - called at boot time} {macOnly} {
+} {}
# cleanup
deleteWindows
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/macWinMenu.test b/tk/tests/macWinMenu.test
index 8e59d00ce57..23919b3b7a8 100644
--- a/tk/tests/macWinMenu.test
+++ b/tk/tests/macWinMenu.test
@@ -8,32 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-# Some tests require user interaction on non-unix platform
-set ::tcltest::testConfig(nonUnixUserInteraction) \
- [expr {$::tcltest::testConfig(userInteraction) || \
- $::tcltest::testConfig(unixOnly)}]
-
-proc deleteWindows {} {
- foreach i [winfo children .] {
- catch [destroy $i]
- }
-}
-
-deleteWindows
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test macWinMenu-1.1 {PreprocessMenu} {macOrPc nonUnixUserInteraction} {
catch {destroy .m1}
diff --git a/tk/tests/macscrollbar.test b/tk/tests/macscrollbar.test
index 4ebfd79f2af..9c0006ae008 100644
--- a/tk/tests/macscrollbar.test
+++ b/tk/tests/macscrollbar.test
@@ -9,22 +9,13 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-# Only run this test on the Macintosh
-if {$tcl_platform(platform) != "macintosh"} {
- puts "skipping: Mac only tests..."
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
update
# Tests for display and layout
@@ -32,10 +23,10 @@ wm geometry . 50x300
scrollbar .s
pack .s -fill y -expand 1
update
-test macscroll-1.1 {TkpDisplayScrollbar procedure} {
+test macscroll-1.1 {TkpDisplayScrollbar procedure} {macOnly} {
list [.s configure -width] [.s configure -bd]
} {{-width width Width 16 16} {-borderwidth borderWidth BorderWidth 0 0}}
-test macscroll-1.2 {TkpDisplayScrollbar procedure} {
+test macscroll-1.2 {TkpDisplayScrollbar procedure} {macOnly} {
# Exercise drawing 3D relief
pack .s -fill y -expand 1 -anchor center
.s configure -bd 4
@@ -43,7 +34,7 @@ test macscroll-1.2 {TkpDisplayScrollbar procedure} {
focus .s
update
} {}
-test macscroll-1.3 {TkpDisplayScrollbar procedure} {
+test macscroll-1.3 {TkpDisplayScrollbar procedure} {macOnly} {
pack .s -fill y -expand 1 -anchor e
update
set x [.s configure -width]
@@ -51,7 +42,7 @@ test macscroll-1.3 {TkpDisplayScrollbar procedure} {
update
list [.s configure -width] $x
} {{-width width Width 16 16} {-width width Width 16 16}}
-test macscroll-1.4 {TkpDisplayScrollbar procedure} {
+test macscroll-1.4 {TkpDisplayScrollbar procedure} {macOnly} {
wm geometry . 300x50
.s configure -bd 0 -orient horizontal
pack .s -fill x -expand 1 -anchor center
@@ -64,7 +55,7 @@ test macscroll-1.4 {TkpDisplayScrollbar procedure} {
update
list [.s configure -width] $x $y
} {{-width width Width 16 16} {-width width Width 16 16} {-width width Width 16 16}}
-test macscroll-1.5 {TkpDisplayScrollbar procedure} {
+test macscroll-1.5 {TkpDisplayScrollbar procedure} {macOnly} {
wm geometry . 300x16
.s configure -bd 0 -orient horizontal
pack .s -fill x -expand 1 -anchor s
@@ -74,7 +65,7 @@ test macscroll-1.5 {TkpDisplayScrollbar procedure} {
wm geometry . 300x14
update
} {}
-test macscroll-1.6 {TkpDisplayScrollbar procedure} {
+test macscroll-1.6 {TkpDisplayScrollbar procedure} {macOnly} {
# Check the drawing of the resize hack
wm geometry . 20x300
wm resizable . 1 1
@@ -90,7 +81,7 @@ test macscroll-1.6 {TkpDisplayScrollbar procedure} {
update
list $x $y [.s identify 12 295]
} {{} arrow2 arrow2}
-test macscroll-1.7 {TkpDisplayScrollbar procedure} {
+test macscroll-1.7 {TkpDisplayScrollbar procedure} {macOnly} {
wm geometry . 300x300
pack .s -fill y -expand 1 -anchor e
catch {destroy .s2}
@@ -98,23 +89,7 @@ test macscroll-1.7 {TkpDisplayScrollbar procedure} {
place .s2 -x 0 -y 284 -width 300
} {}
-foreach i [winfo children .] {
- destroy $i
-}
-
+deleteWindows
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/main.test b/tk/tests/main.test
index 56b6690e328..dc828b2c18c 100644
--- a/tk/tests/main.test
+++ b/tk/tests/main.test
@@ -10,28 +10,31 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-test main-1.1 {StdinProc} {unixOnly} {
- catch {removeFile script}
- set fd [open script w]
- puts $fd {
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::interpreter
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
+
+test main-1.1 {StdinProc} {unix} {
+ set script [makeFile {
close stdin; exit
- }
- close $fd
- if {[catch {exec $::tcltest::tktest <script} msg]} {
+ } script]
+ if {[catch {exec [interpreter] <$script} msg]} {
set error 1
} else {
set error 0
}
- file delete -force script
+ removeFile script
list $error $msg
} {0 {}}
# cleanup
-catch {removeFile script}
::tcltest::cleanupTests
return
diff --git a/tk/tests/menu.test b/tk/tests/menu.test
index a0163f73f67..6d5aa8b2bb4 100644
--- a/tk/tests/menu.test
+++ b/tk/tests/menu.test
@@ -7,32 +7,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-# Some tests require user interaction on non-unix platform
-set ::tcltest::testConfig(nonUnixUserInteraction) \
- [expr {$::tcltest::testConfig(userInteraction) || \
- $::tcltest::testConfig(unixOnly)}]
-
-proc deleteWindows {} {
- foreach i [winfo children .] {
- catch [destroy $i]
- }
-}
-
-deleteWindows
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test menu-1.1 {Tk_MenuCmd procedure} {
list [catch menu msg] $msg
@@ -730,7 +710,7 @@ test menu-3.36 {MenuWidgetCmd procedure, "entryconfigure" option} {
menu .m1
.m1 add command -label "test"
list [catch {llength [.m1 entryconfigure 1]} msg] $msg [destroy .m1]
-} {0 14 {}}
+} {0 15 {}}
test menu-3.37 {MenuWidgetCmd procedure, "entryconfigure" option} {
catch {destroy .m1}
menu .m1
@@ -911,6 +891,25 @@ test menu-3.67 {MenuWidgetCmd procedure, bad option} {
menu .m1
list [catch {.m1 foo} msg] $msg [destroy .m1]
} {1 {bad option "foo": must be activate, add, cget, clone, configure, delete, entrycget, entryconfigure, index, insert, invoke, post, postcascade, type, unpost, or yposition} {}}
+test menu-3.68 {MenuWidgetCmd procedure, fix for bug#508988} {
+ set t .t
+ set m1 .t.m1
+ set c1 .t.c1
+ set c2 .t.c2
+ toplevel .t
+ menu $m1 -tearoff 1
+ menu $c1 -tearoff 1
+ $c1 add command -label c1
+ menu $c2 -tearoff 1
+ $c2 add command -label c2
+ $m1 add cascade -label c1 -menu $c1
+ $t configure -menu $m1
+ $m1 entryconfigure 1 -menu $c2 -label c2
+ $t configure -menu ""
+ set l [list [winfo exists $c1] [winfo exists $c2]]
+ destroy $t;
+ set l;
+} {1 1}
test menu-4.1 {TkInvokeMenu: disabled} {
catch {destroy .m1}
@@ -1066,20 +1065,20 @@ test menu-5.6 {DestroyMenuInstance - cascades of cloned menus} {
test menu-5.7 {DestroyMenuInstance - basic clones} {
catch {destroy .m1}
menu .m1
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [catch {destroy $tearoff} msg] $msg [destroy .m1]
} {0 {} {}}
test menu-5.8 {DestroyMenuInstance - multiple clones} {
catch {destroy .m1}
menu .m1
- set tearoff1 [tkTearOffMenu .m1]
- set tearoff2 [tkTearOffMenu .m1]
+ set tearoff1 [tk::TearOffMenu .m1]
+ set tearoff2 [tk::TearOffMenu .m1]
list [catch {destroy $tearoff1} msg] $msg [destroy .m1]
} {0 {} {}}
test menu-5.9 {DestroyMenuInstace - master menu} {
catch {destroy .m1}
menu .m1
- tkTearOffMenu .m1
+ tk::TearOffMenu .m1
list [catch {destroy .m1} msg] $msg
} {0 {}}
test menu-5.10 {DestroyMenuInstance - freeing entries} {
@@ -1105,7 +1104,7 @@ test menu-5.13 {DestroyMenuInstance - clones when mismatched tearoffs} {
menu .m1
menu .m2
.m1 add cascade -menu .m2
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [destroy .m2] [destroy .m1]
} {{} {}}
@@ -1356,7 +1355,7 @@ test menu-8.2 {DestroyMenuEntry} {
.m1 add command -image image1a
list [catch {.m1 delete 1} msg] $msg [destroy .m1] [image delete image1a]
} {0 {} {} {}}
-test menu-8.3 {DestroyMenuEntry} {
+test menu-8.3 {DestroyMenuEntry} testImageType {
catch {eval image delete [image names]}
catch {destroy .m1}
image create test image1
@@ -1592,7 +1591,7 @@ test menu-11.17 {ConfigureMenuEntry} {
.m1 add checkbutton
list [catch {.m1 entryconfigure 1 -onvalue "test"} msg] $msg [.m1 entrycget 1 -onvalue] [destroy .m1]
} {0 {} test {}}
-test menu-11.18 {ConfigureMenuEntry} {
+test menu-11.18 {ConfigureMenuEntry} testImageType {
catch {destroy .m1}
catch {image delete image1}
menu .m1
@@ -1600,7 +1599,7 @@ test menu-11.18 {ConfigureMenuEntry} {
image create test image1
list [catch {.m1 entryconfigure 1 -image image1} msg] $msg [destroy .m1] [image delete image1]
} {0 {} {} {}}
-test menu-11.19 {ConfigureMenuEntry} {
+test menu-11.19 {ConfigureMenuEntry} testImageType {
catch {destroy .m1}
catch {image delete image1}
catch {image delete image2}
@@ -1610,7 +1609,7 @@ test menu-11.19 {ConfigureMenuEntry} {
.m1 add command -image image1
list [catch {.m1 entryconfigure 1 -image image2} msg] $msg [destroy .m1] [image delete image1] [image delete image2]
} {0 {} {} {} {}}
-test menu-11.20 {ConfigureMenuEntry} {
+test menu-11.20 {ConfigureMenuEntry} testImageType {
catch {destroy .m1}
catch {image delete image1}
catch {image delete image2}
@@ -1620,7 +1619,7 @@ test menu-11.20 {ConfigureMenuEntry} {
.m1 add checkbutton -image image1
list [catch {.m1 entryconfigure 1 -selectimage image2} msg] $msg [destroy .m1] [image delete image1] [image delete image2]
} {0 {} {} {} {}}
-test menu-11.21 {ConfigureMenuEntry} {
+test menu-11.21 {ConfigureMenuEntry} testImageType {
catch {destroy .m1}
catch {image delete image1}
catch {image delete image2}
@@ -1899,7 +1898,7 @@ test menu-16.16 {MenuAddOrInsert} {
catch {destroy .m2}
menu .m1
menu .m2
- set tearoff [tkTearOffMenu .m2]
+ set tearoff [tk::TearOffMenu .m2]
list [catch {.m2 add cascade -menu .m1} msg] $msg [$tearoff unpost] [catch {destroy .m1} msg2] $msg2 [catch {destroy .m2} msg3] $msg3
} {0 {} {} 0 {} 0 {}}
test menu-16.17 {MenuAddOrInsert} {
@@ -1908,7 +1907,7 @@ test menu-16.17 {MenuAddOrInsert} {
menu .m1
menu .container
. configure -menu .container
- set tearoff [tkTearOffMenu .container]
+ set tearoff [tk::TearOffMenu .container]
list [catch {.container add cascade -label "File" -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1 .container]
} {0 {} {} {}}
test menu-16.18 {MenuAddOrInsert} {
@@ -2300,7 +2299,7 @@ test menu-26.1 {DestroyMenuHashTable} {
test menu-27.1 {GetMenuHashTable} {
catch {interp destroy testinterp}
interp create testinterp
- load {} tk testinterp
+ load {} Tk testinterp
list [catch {interp eval testinterp {menu .m1}} msg] $msg [interp delete testinterp]
} {0 .m1 {}}
@@ -2424,9 +2423,45 @@ test menu-32.7 {DeleteMenuCloneEntries - one entry} {
.m1 add command -label Hello
list [catch {.m1 delete Hello} msg] $msg [destroy .m1]
} {0 {} {}}
+test menu-32.8 {Ensure all menu clone commands are deleted} {knownBug} {
+ # SF bug #465324
+ catch {destroy .menubar}
+ catch {destroy .menubar.test}
+ menu .menubar
+ . configure -menu .menubar
+ menu .menubar.test
+ .menubar.test add command -label "hi"
+ for {set i 0} {$i < 10} {incr i} {
+ .menubar add cascade -menu .menubar.test -label "Test"
+ .menubar delete Test
+ }
+
+ info commands .#menubar*test*
+} {}
+test menu-32.9 {Ensure deleting of clones doesn't corrupt menu refs} {
+ catch {destroy .menubar}
+ catch {destroy .menubar.test}
+
+ menu .menubar
+ . configure -menu .menubar
+ menu .menubar.test
+ .menubar add cascade -menu .menubar.test -label "Test"
+ menu .menubar.cascade
+
+ .menubar.test add cascade -menu .menubar.cascade -label "Cascade"
+ set res {}
+ lappend res [.menubar.test entrycget 1 -menu]
+ lappend res [.#menubar.#menubar#test entrycget 1 -menu]
+ destroy .menubar.test
+ menu .menubar.test
+ .menubar.test add cascade -menu .menubar.cascade -label "Cascade"
+ lappend res [.menubar.test entrycget 1 -menu]
+ lappend res [.#menubar.#menubar#test entrycget 1 -menu]
+ set res
+} {.menubar.cascade .#menubar.#menubar#test.#menubar#cascade .menubar.cascade .#menubar.#menubar#test.#menubar#cascade}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test menu-33.1 {menu vs command hiding} {
catch {destroy .m}
@@ -2441,19 +2476,17 @@ test menu-33.1 {menu vs command hiding} {
# creating menus on two different screens then deleting the
# menu from the first screen crashes Tk8.3.1
#
-test menu-35.1 {menus on multiple screens - crashes tk8.3.1, Bug 5454} {
- if {[info exists ::env(TK_ALT_DISPLAY)]} {
- toplevel .one
- menu .one.m
- toplevel .two -screen $::env(TK_ALT_DISPLAY)
- menu .two.m
- destroy .one
- destroy .two
- }
+test menu-35.1 {menus on multiple screens - crashes tk8.3.1, Bug 5454} \
+ {altDisplay} {
+ toplevel .one
+ menu .one.m
+ toplevel .two -screen $::env(TK_ALT_DISPLAY)
+ menu .two.m
+ destroy .one
+ destroy .two
} {}
# cleanup
deleteWindows
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/menuDraw.test b/tk/tests/menuDraw.test
index f6902a73e0d..61e6afa9a4f 100644
--- a/tk/tests/menuDraw.test
+++ b/tk/tests/menuDraw.test
@@ -7,27 +7,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-proc deleteWindows {} {
- foreach i [winfo children .] {
- catch [destroy $i]
- }
-}
-
-deleteWindows
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test menuDraw-1.1 {TkMenuInitializeDrawingFields} {
catch {destroy .m1}
@@ -168,7 +153,7 @@ test menuDraw-7.1 {TkEventuallyRecomputeMenu} {
catch {destroy .m1}
menu .m1
.m1 add command -label "This is a long label"
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
update idletasks
list [.m1 entryconfigure 1 -label "foo"] [destroy .m1]
} {{} {}}
@@ -176,7 +161,7 @@ test menuDraw-7.2 {TkEventuallyRecomputeMenu - update pending} {
catch {destroy .m1}
menu .m1
.m1 add command -label "This is a long label"
- set tearoff [tkTearOffMenu .m1]
+ set tearoff [tk::TearOffMenu .m1]
list [.m1 entryconfigure 1 -label "foo"] [destroy .m1]
} {{} {}}
@@ -196,14 +181,14 @@ test menuDraw-9.1 {TkEventuallyRedrawMenu - entry test} {
menu .m1
set foo 0
.m1 add radiobutton -variable foo -label test
- tkTearOffMenu .m1
+ tk::TearOffMenu .m1
update idletasks
list [set foo test] [destroy .m1] [unset foo]
} {test {} {}}
test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} {
catch {destroy .m1}
menu .m1
- list [catch {tkTearOffMenu .m1}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1}] [destroy .m1]
} {0 {}}
# Don't know how to test when window has been deleted and ComputeMenuGeometry
@@ -236,7 +221,7 @@ test menuDraw-10.4 {ComputeMenuGeometry - resize not necessary} {
list [update idletasks] [destroy .m1]
} {{} {}}
-test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} {
+test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending} testImageType {
catch {destroy .m1}
catch {eval image delete [image names]}
image create test image1
@@ -244,11 +229,11 @@ test menuDraw-11.1 {TkMenuSelectImageProc - entry selected; redraw not pending}
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
update idletasks
list [image delete image2] [destroy .m1] [eval image delete [image names]]
} {{} {} {}}
-test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} {
+test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} testImageType {
catch {destroy .m1}
catch {eval image delete [image names]}
image create test image1
@@ -256,17 +241,17 @@ test menuDraw-11.2 {TkMenuSelectImageProc - entry selected; redraw pending} {
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [image delete image2] [destroy .m1] [eval image delete [image names]]
} {{} {} {}}
-test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} {
+test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} testImageType {
catch {destroy .m1}
catch {eval image delete [image names]}
image create test image1
image create test image2
menu .m1
.m1 add checkbutton -image image1 -selectimage image2
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
update idletasks
list [image delete image2] [destroy .m1] [eval image delete [image names]]
} {{} {} {}}
@@ -282,14 +267,14 @@ test menuDraw-12.1 {DisplayMenu - menubar background} {unixOnly} {
test menuDraw-12.2 {Display menu - no entries} {
catch {destroy .m1}
menu .m1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.3 {DisplayMenu - one entry} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.4 {DisplayMenu - two entries} {
@@ -297,7 +282,7 @@ test menuDraw-12.4 {DisplayMenu - two entries} {
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test menuDraw.12.5 {DisplayMenu - two columns - first bigger} {
@@ -306,7 +291,7 @@ test menuDraw.12.5 {DisplayMenu - two columns - first bigger} {
.m1 add command -label "one"
.m1 add command -label "two"
.m1 add command -label "three" -columnbreak 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.5 {DisplayMenu - two column - second bigger} {
@@ -315,7 +300,7 @@ test menuDraw-12.5 {DisplayMenu - two column - second bigger} {
.m1 add command -label "one"
.m1 add command -label "two" -columnbreak 1
.m1 add command -label "three"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test menuDraw.12.7 {DisplayMenu - three columns} {
@@ -327,7 +312,7 @@ test menuDraw.12.7 {DisplayMenu - three columns} {
.m1 add command -label "four"
.m1 add command -label "five"
.m1 add command -label "six"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test menuDraw-12.6 {Display menu - testing for extra space and menubars} {unixOnly} {
@@ -341,7 +326,7 @@ test menuDraw-12.7 {Display menu - extra space at end of menu} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
wm geometry $tearoff 200x100
list [update] [destroy .m1]
} {{} {}}
@@ -353,15 +338,15 @@ test menuDraw-13.1 {TkMenuEventProc - Expose} {
.m1 add command -label "one"
menu .m2
.m2 add command -label "two"
- set tearoff1 [tkTearOffMenu .m1 40 40]
- set tearoff2 [tkTearOffMenu .m2 40 40]
+ set tearoff1 [tk::TearOffMenu .m1 40 40]
+ set tearoff2 [tk::TearOffMenu .m2 40 40]
list [raise $tearoff2] [update] [destroy .m1] [destroy .m2]
} {{} {} {} {}}
test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} {
catch {destroy .m1}
menu .m1
.m1 add command -label "foo"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [wm geometry $tearoff 200x100] [update] [destroy .m1]
} {{} {} {}}
test menuDraw-13.3 {TkMenuEventProc - ActivateNotify} {macOnly} {
@@ -369,7 +354,7 @@ test menuDraw-13.3 {TkMenuEventProc - ActivateNotify} {macOnly} {
toplevel .t2 -menu .t2.m1
menu .t2.m1
.t2.m1 add command -label foo
- tkTearOffMenu .t2.m1 40 40
+ tk::TearOffMenu .t2.m1 40 40
list [catch {update} msg] $msg [destroy .t2]
} {0 {} {}}
# Testing deletes is hard, and I am going to do my best. Don't know how
@@ -388,7 +373,7 @@ test menuDraw-13.5 {TkMenuEventProc - nothing pending} {
list [destroy .m1]
} {{}}
-test menuDraw-14.1 {TkMenuImageProc} {
+test menuDraw-14.1 {TkMenuImageProc} testImageType {
catch {destroy .m1}
catch {image delete image1}
menu .m1
@@ -397,7 +382,7 @@ test menuDraw-14.1 {TkMenuImageProc} {
update idletasks
list [image delete image1] [destroy .m1]
} {{} {}}
-test menuDraw-14.2 {TkMenuImageProc} {
+test menuDraw-14.2 {TkMenuImageProc} testImageType {
catch {destroy .m1}
catch {image delete image1}
menu .m1
@@ -410,13 +395,13 @@ test menuDraw-15.1 {TkPostTearoffMenu - Basic posting} {
catch {destroy .m1}
menu .m1
.m1 add command -label "foo"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} {
catch {destroy .m1}
menu .m1
.m1 add command -label "foo" -state active
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [$tearoff index active] [destroy .m1]
} {none {}}
test menuDraw-15.3 {TkPostTearoffMenu - post command} {
@@ -424,27 +409,27 @@ test menuDraw-15.3 {TkPostTearoffMenu - post command} {
catch {unset foo}
menu .m1 -postcommand "set foo .m1"
.m1 add command -label "foo"
- list [catch {tkTearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1]
} {0 .m1 {} {}}
test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} {
catch {destroy .m1}
menu .m1 -postcommand "destroy .m1"
.m1 add command -label "foo"
- list [catch {tkTearOffMenu .m1 40 40} msg] $msg [winfo exists .m1]
+ list [catch {tk::TearOffMenu .m1 40 40} msg] $msg [winfo exists .m1]
} {0 {} 0}
test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} {
catch {destroy .m1}
menu .m1
.m1 add command -label "foo"
set height [winfo screenheight .m1]
- list [catch {tkTearOffMenu .m1 40 $height}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 $height}] [destroy .m1]
} {0 {}}
test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} {
catch {destroy .m1}
menu .m1
.m1 add command -label "foo"
set width [winfo screenwidth .m1]
- list [catch {tkTearOffMenu .m1 $width 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 $width 40}] [destroy .m1]
} {0 {}}
@@ -455,7 +440,7 @@ test menuDraw-16.1 {TkPostSubmenu} {unixOnly} {
.m1 add cascade -label test -menu .m2
menu .m2
.m2 add command -label "Hit ESCAPE to make this menu go away."
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff postcascade 0
list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
} {{} {} {}}
@@ -470,7 +455,7 @@ test menuDraw-16.2 {TkPostSubMenu} {unixOnly} {
.m2 add command -label "two"
menu .m3
.m3 add command -label "three"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff postcascade 0
list [$tearoff postcascade 1] [destroy .m1] [destroy .m2] [destroy .m3]
} {{} {} {} {}}
@@ -484,7 +469,7 @@ test menuDraw-16.4 {TkPostSubMenu} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label test
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [$tearoff postcascade 0] [destroy .m1]
} {{} {}}
test menuDraw-16.5 {TkPostSubMenu} {unixOnly} {
@@ -493,7 +478,7 @@ test menuDraw-16.5 {TkPostSubMenu} {unixOnly} {
menu .m1
.m1 add cascade -label test -menu .m2
menu .m2 -postcommand "glorp"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {$tearoff postcascade test} msg] $msg [destroy .m1] [destroy .m2]
} {1 {invalid command name "glorp"} {} {}}
test menuDraw-16.6 {TkPostSubMenu} {pcOnly userInteraction} {
@@ -503,7 +488,7 @@ test menuDraw-16.6 {TkPostSubMenu} {pcOnly userInteraction} {
.m1 add cascade -label test -menu .m2
menu .m2
.m2 add command -label "Hit ESCAPE to get rid of this menu"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
} {{} {} {}}
@@ -529,7 +514,7 @@ test menuDraw-17.2 {AdjustMenuCoords - menu} {pcOnly userInteraction} {
.m1 add cascade -label test -menu .m2
menu .m2
.m2 add command -label "Hit ESCAPE to make this menu go away"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [$tearoff postcascade 0] [destroy .m1] [destroy .m2]
} {{} {} {}}
diff --git a/tk/tests/menubut.test b/tk/tests/menubut.test
index a3031957544..d927bc18984 100644
--- a/tk/tests/menubut.test
+++ b/tk/tests/menubut.test
@@ -12,23 +12,12 @@
# XXX of a procedure has tests then the whole procedure has tests,
# XXX but many procedures have no tests.
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -41,7 +30,9 @@ option add *Button.highlightThickness 2
option add *Button.font {Helvetica -12 bold}
eval image delete [image names]
-image create test image1
+if {[testConstraint testImageType]} {
+ image create test image1
+}
menubutton .mb -text "Test"
pack .mb
update
@@ -84,7 +75,7 @@ foreach test {
{-wraplength 100 100 6x {bad screen distance "6x"}}
} {
set name [lindex $test 0]
- test menubutton-1.$i {configuration options} {
+ test menubutton-1.$i {configuration options} testImageType {
.mb configure $name [lindex $test 1]
lindex [.mb configure $name] 4
} [lindex $test 2]
@@ -138,7 +129,7 @@ test menubutton-3.6 {ButtonWidgetCmd procedure, "cget" option} {
} {3}
test menubutton-3.7 {ButtonWidgetCmd procedure, "configure" option} {
llength [.mb configure]
-} {32}
+} {33}
test menubutton-3.8 {ButtonWidgetCmd procedure, "configure" option} {
list [catch {.mb configure -gorp} msg] $msg
} {1 {unknown option "-gorp"}}
@@ -181,7 +172,7 @@ test menubutton-4.3 {ConfigureMenuButton procedure} {
(processing -width option)
invoked from within
".mb1 configure -width abc"}}
-test menubutton-4.4 {ConfigureMenuButton procedure} {
+test menubutton-4.4 {ConfigureMenuButton procedure} testImageType {
catch {destroy .mb1}
eval image delete [image names]
image create test image1
@@ -209,7 +200,7 @@ test menubutton-4.6 {ConfigureMenuButton procedure - bad direction} {
# XXX Need to add tests for several procedures here. XXX
test menubutton-5.1 {MenuButtonEventProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
menubutton .mb1 -bg #543210
rename .mb1 .mb2
set x {}
@@ -220,38 +211,38 @@ test menubutton-5.1 {MenuButtonEventProc procedure} {
} {.mb1 #543210 {} {}}
test menubutton-6.1 {MenuButtonCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
menubutton .mb1
rename .mb1 {}
list [info command .mb*] [winfo children .]
} {{} {}}
-test menubutton-7.1 {ComputeMenuButtonGeometry procedure} {
+test menubutton-7.1 {ComputeMenuButtonGeometry procedure} testImageType {
catch {destroy .mb}
menubutton .mb -image image1 -bd 4 -highlightthickness 0
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
} {38 23}
-test menubutton-7.2 {ComputeMenuButtonGeometry procedure} {
+test menubutton-7.2 {ComputeMenuButtonGeometry procedure} testImageType {
catch {destroy .mb}
menubutton .mb -image image1 -bd 1 -highlightthickness 2
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
} {36 21}
-test menubutton-7.3 {ComputeMenuButtonGeometry procedure} {
+test menubutton-7.3 {ComputeMenuButtonGeometry procedure} testImageType {
catch {destroy .mb}
menubutton .mb -image image1 -bd 0 -highlightthickness 2 -padx 5 -pady 5
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
} {34 19}
-test menubutton-7.4 {ComputeMenuButtonGeometry procedure} {
+test menubutton-7.4 {ComputeMenuButtonGeometry procedure} testImageType {
catch {destroy .mb}
menubutton .mb -image image1 -bd 2 -relief raised -width 40 \
-highlightthickness 2
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
} {48 23}
-test menubutton-7.5 {ComputeMenuButtonGeometry procedure} {
+test menubutton-7.5 {ComputeMenuButtonGeometry procedure} testImageType {
catch {destroy .mb}
menubutton .mb -image image1 -bd 2 -relief raised -height 30 \
-highlightthickness 2
@@ -314,7 +305,7 @@ test menubutton-7.13 {ComputeMenuButtonGeometry procedure} {nonPortable fonts} {
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
} {78 28}
-test menubutton-7.14 {ComputeMenuButtonGeometry procedure} {unixOnly nonPortable} {
+test menubutton-7.14 {ComputeMenuButtonGeometry procedure} {testImageType unixOnly nonPortable} {
# The following test is non-portable because the indicator's pixel
# size varies to maintain constant absolute size.
@@ -324,7 +315,7 @@ test menubutton-7.14 {ComputeMenuButtonGeometry procedure} {unixOnly nonPortable
pack .mb
list [winfo reqwidth .mb] [winfo reqheight .mb]
} {64 23}
-test menubutton-7.15 {ComputeMenuButtonGeometry procedure} {pcOnly nonPortable} {
+test menubutton-7.15 {ComputeMenuButtonGeometry procedure} {testImageType pcOnly nonPortable} {
# The following test is non-portable because the indicator's pixel
# size varies to maintain constant absolute size.
@@ -336,7 +327,7 @@ test menubutton-7.15 {ComputeMenuButtonGeometry procedure} {pcOnly nonPortable}
} {65 23}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test menubutton-8.1 {menubutton vs hidden commands} {
catch {destroy .mb}
@@ -347,7 +338,7 @@ test menubutton-8.1 {menubutton vs hidden commands} {
} [list {} $l]
eval image delete [image names]
-eval destroy [winfo children .]
+deleteWindows
option clear
# cleanup
diff --git a/tk/tests/message.test b/tk/tests/message.test
new file mode 100644
index 00000000000..fa2a08621f2
--- /dev/null
+++ b/tk/tests/message.test
@@ -0,0 +1,125 @@
+# This file is a Tcl script to test out the "message" command
+# of Tk. It is organized in the standard fashion for Tcl tests.
+#
+# Copyright (c) 1994 The Regents of the University of California.
+# Copyright (c) 1994-1996 Sun Microsystems, Inc.
+# Copyright (c) 1998-2000 by Ajuba Solutions.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+option add *Message.borderWidth 2
+option add *Message.highlightThickness 2
+option add *Message.font {Helvetica -12 bold}
+
+message .m
+pack .m
+update
+set i 0
+foreach test {
+ {-anchor w w bogus {bad anchor "bogus": must be n, ne, e, se, s, sw, w, nw, or center}}
+ {-aspect 3 3 bogus {expected integer but got "bogus"}}
+ {-background #ff0000 #ff0000 non-existent
+ {unknown color name "non-existent"}}
+ {-bd 4 4 badValue {bad screen distance "badValue"}}
+ {-bg #ff0000 #ff0000 non-existent
+ {unknown color name "non-existent"}}
+ {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
+ {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-fg #00ff00 #00ff00 badValue {unknown color name "badValue"}}
+ {-font fixed fixed {} {font "" doesn't exist}}
+ {-foreground green green badValue {unknown color name "badValue"}}
+ {-highlightbackground #112233 #112233 ugly {unknown color name "ugly"}}
+ {-highlightcolor #123456 #123456 non-existent
+ {unknown color name "non-existent"}}
+ {-highlightthickness 2 2 badValue {bad screen distance "badValue"}}
+ {-justify right right bogus {bad justification "bogus": must be left, right, or center}}
+ {-padx 12m 12m 420x {bad screen distance "420x"}}
+ {-pady 12m 12m 420x {bad screen distance "420x"}}
+ {-relief ridge ridge badValue {bad relief "badValue": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-text "Sample text" {Sample text} {} {} {1 1 1 1}}
+ {-textvariable i i {} {} {1 1 1 1}}
+ {-width 32 32 badValue {bad screen distance "badValue"}}
+} {
+ set name [lindex $test 0]
+ test message-1.$i {configuration options} {
+ .m configure $name [lindex $test 1]
+ lindex [.m configure $name] 4
+ } [lindex $test 2]
+ incr i
+ if {[lindex $test 3] != ""} {
+ test message-1.$i {configuration options} {
+ list [catch {.m configure $name [lindex $test 3]} msg] $msg
+ } [list 1 [lindex $test 4]]
+ }
+ .m configure $name [lindex [.m configure $name] 3]
+ incr i
+}
+destroy .m
+
+test message-2.1 {Tk_MessageObjCmd procedure} {
+ list [catch {message} msg] $msg
+} {1 {wrong # args: should be "message pathName ?options?"}}
+test message-2.2 {Tk_MessageObjCmd procedure} {
+ list [catch {message foo} msg] $msg [winfo child .]
+} {1 {bad window path name "foo"} {}}
+test message-2.3 {Tk_MessageObjCmd procedure} {
+ list [catch {message .s -gorp dumb} msg] $msg [winfo child .]
+} {1 {unknown option "-gorp"} {}}
+
+test message-3.1 {MessageWidgetObjCmd procedure} {
+ message .m
+ set result [list [catch {.m} msg] $msg]
+ destroy .m
+ set result
+} {1 {wrong # args: should be ".m option ?arg arg ...?"}}
+test message-3.2 {MessageWidgetObjCmd procedure, "cget"} {
+ message .m
+ set result [list [catch {.m cget} msg] $msg]
+ destroy .m
+ set result
+} {1 {wrong # args: should be ".m cget option"}}
+test message-3.3 {MessageWidgetObjCmd procedure, "cget"} {
+ message .m
+ set result [list [catch {.m cget -gorp} msg] $msg]
+ destroy .m
+ set result
+} {1 {unknown option "-gorp"}}
+test message-3.4 {MessageWidgetObjCmd procedure, "cget"} {
+ message .m
+ .m configure -text foobar
+ set result [.m cget -text]
+ destroy .m
+ set result
+} "foobar"
+test message-3.5 {MessageWidgetObjCmd procedure, "configure"} {
+ message .m
+ set result [llength [.m configure]]
+ destroy .m
+ set result
+} 21
+test message-3.6 {MessageWidgetObjCmd procedure, "configure"} {
+ message .m
+ set result [list [catch {.m configure -foo} msg] $msg]
+ destroy .m
+ set result
+} {1 {unknown option "-foo"}}
+test message-3.7 {MessageWidgetObjCmd procedure, "configure"} {
+ message .m
+ .m configure -bd 4
+ .m configure -bg #ffffff
+ set result [lindex [.m configure -bd] 4]
+ destroy .m
+ set result
+} {4}
+
+# cleanup
+::tcltest::cleanupTests
+return
diff --git a/tk/tests/msgbox.test b/tk/tests/msgbox.test
index d1be52d21e3..4f7d6a15fd2 100644
--- a/tk/tests/msgbox.test
+++ b/tk/tests/msgbox.test
@@ -8,14 +8,12 @@
# RCS: @(#) $Id$
#
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-# Some tests require user interaction on non-unix platform
-set ::tcltest::testConfig(nonUnixUserInteraction) \
- [expr {$::tcltest::testConfig(userInteraction) || \
- $::tcltest::testConfig(unixOnly)}]
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test msgbox-1.1 {tk_messageBox command} {
list [catch {tk_messageBox -foo} msg] $msg
@@ -72,7 +70,7 @@ test msgbox-1.10 {tk_messageBox command} {
list [catch {tk_messageBox -parent foo.bar} msg] $msg
} {1 {bad window path name "foo.bar"}}
-if {[info commands tkMessageBox] == ""} {
+if {[info commands tk::MessageBox] == ""} {
set isNative 1
} else {
set isNative 0
@@ -185,4 +183,3 @@ wm deiconify .
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/obj.test b/tk/tests/obj.test
index 8edf93bc826..bf983855cde 100644
--- a/tk/tests/obj.test
+++ b/tk/tests/obj.test
@@ -7,15 +7,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test obj-1.1 {TkGetPixelsFromObj} {
} {}
@@ -31,7 +28,7 @@ test obj-4.1 {SetPixelFromAny} {
-eval destroy [winfo children .]
+deleteWindows
# cleanup
::tcltest::cleanupTests
diff --git a/tk/tests/oldpack.test b/tk/tests/oldpack.test
index 7676da2410d..b916d6605ad 100644
--- a/tk/tests/oldpack.test
+++ b/tk/tests/oldpack.test
@@ -9,9 +9,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# First, test a single window packed in various ways in a parent
@@ -449,7 +452,7 @@ test pack-8.16 {syntax errors} {
set msg ""
set result [catch {pack append .pack .pack.blue {frame south}} msg]
concat $result $msg
-} {1 bad anchor position "south": must be n, ne, e, se, s, sw, w, nw, or center}
+} {1 bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center}
test pack-8.17 {syntax errors} {
set msg ""
set result [catch {pack append .pack .pack.blue {padx -2}} msg]
diff --git a/tk/tests/option.test b/tk/tests/option.test
index aaa55ed0ea6..7952c7bac5e 100644
--- a/tk/tests/option.test
+++ b/tk/tests/option.test
@@ -8,9 +8,15 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
catch {destroy .op1}
catch {destroy .op2}
@@ -185,9 +191,8 @@ test option-14.12 {error conditions} {
list [catch {option get .gorp.gorp a A} msg] $msg
} {1 {bad window path name ".gorp.gorp"}}
-set option1 [file join $::tcltest::testsDir option.file1]
-set option2 [file join $::tcltest::testsDir option.file2]
-set option3 [file join $::tcltest::testsDir option.file3]
+set option1 [file join [testsDirectory] option.file1]
+set option2 [file join [testsDirectory] option.file2]
test option-15.1 {database files} {
list [catch {option read non-existent} msg] $msg
@@ -211,7 +216,8 @@ test option-15.9 {database files} {
} {1 {missing colon on line 2}}
test option-16.1 {ReadOptionFile} {
- set file [open "$option3" w]
+ set option3 [makeFile {} option.file3]
+ set file [open $option3 w]
fconfigure $file -translation crlf
puts $file "*x7: true\n*x8: false"
close $file
diff --git a/tk/tests/pack.test b/tk/tests/pack.test
index c325b7d4c2d..e9bd74ab674 100644
--- a/tk/tests/pack.test
+++ b/tk/tests/pack.test
@@ -8,9 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Utility procedures:
@@ -75,6 +78,12 @@ test pack-1.4 {-side option} {
test pack-2.1 {x padding and filling} {
pack1 -side right -padx 20
} {20x40+260+80 240x200+0+0}
+test pack-2.1.1 {x padding and filling} {
+ pack1 -side right -padx {10 30}
+} {20x40+250+80 240x200+0+0}
+test pack-2.1.2 {x padding and filling} {
+ pack1 -side right -padx {35 5}
+} {20x40+275+80 240x200+0+0}
test pack-2.2 {x padding and filling} {
pack1 -side right -ipadx 20
} {60x40+240+80 240x200+0+0}
@@ -84,30 +93,51 @@ test pack-2.3 {x padding and filling} {
test pack-2.4 {x padding and filling} {
pack1 -side right -padx 20 -fill x
} {20x40+260+80 240x200+0+0}
+test pack-2.4.1 {x padding and filling} {
+ pack1 -side right -padx {9 31} -fill x
+} {20x40+249+80 240x200+0+0}
test pack-2.5 {x padding and filling} {
pack1 -side right -ipadx 20 -fill x
} {60x40+240+80 240x200+0+0}
test pack-2.6 {x padding and filling} {
pack1 -side right -ipadx 5 -padx 10 -fill x
} {30x40+260+80 250x200+0+0}
+test pack-2.6.1 {x padding and filling} {
+ pack1 -side right -ipadx 5 -padx {5 15} -fill x
+} {30x40+255+80 250x200+0+0}
test pack-2.7 {x padding and filling} {
pack1 -side top -padx 20
} {20x40+140+0 300x160+0+40}
+test pack-2.7.1 {x padding and filling} {
+ pack1 -side top -padx {0 40}
+} {20x40+120+0 300x160+0+40}
+test pack-2.7.2 {x padding and filling} {
+ pack1 -side top -padx {31 9}
+} {20x40+151+0 300x160+0+40}
test pack-2.8 {x padding and filling} {
pack1 -side top -ipadx 20
} {60x40+120+0 300x160+0+40}
test pack-2.9 {x padding and filling} {
pack1 -side top -ipadx 5 -padx 10
} {30x40+135+0 300x160+0+40}
+test pack-2.9.1 {x padding and filling} {
+ pack1 -side top -ipadx 5 -padx {5 15}
+} {30x40+130+0 300x160+0+40}
test pack-2.10 {x padding and filling} {
pack1 -side top -padx 20 -fill x
} {260x40+20+0 300x160+0+40}
+test pack-2.10.1 {x padding and filling} {
+ pack1 -side top -padx {25 15} -fill x
+} {260x40+25+0 300x160+0+40}
test pack-2.11 {x padding and filling} {
pack1 -side top -ipadx 20 -fill x
} {300x40+0+0 300x160+0+40}
test pack-2.12 {x padding and filling} {
pack1 -side top -ipadx 5 -padx 10 -fill x
} {280x40+10+0 300x160+0+40}
+test pack-2.12 {x padding and filling} {
+ pack1 -side top -ipadx 5 -padx {5 15} -fill x
+} {280x40+5+0 300x160+0+40}
set pad [winfo pixels .pack 1c]
test pack-2.13 {x padding and filling} {
pack forget .pack.a .pack.b .pack.c .pack.d
@@ -125,39 +155,66 @@ test pack-2.14 {x padding and filling} {
test pack-3.1 {y padding and filling} {
pack1 -side right -pady 20
} {20x40+280+80 280x200+0+0}
+test pack-3.1.1 {y padding and filling} {
+ pack1 -side right -pady {5 35}
+} {20x40+280+65 280x200+0+0}
+test pack-3.1.2 {y padding and filling} {
+ pack1 -side right -pady {40 0}
+} {20x40+280+100 280x200+0+0}
test pack-3.2 {y padding and filling} {
pack1 -side right -ipady 20
} {20x80+280+60 280x200+0+0}
test pack-3.3 {y padding and filling} {
pack1 -side right -ipady 5 -pady 10
} {20x50+280+75 280x200+0+0}
+test pack-3.3.1 {y padding and filling} {
+ pack1 -side right -ipady 5 -pady {5 15}
+} {20x50+280+70 280x200+0+0}
test pack-3.4 {y padding and filling} {
pack1 -side right -pady 20 -fill y
} {20x160+280+20 280x200+0+0}
+test pack-3.4.1 {y padding and filling} {
+ pack1 -side right -pady {35 5} -fill y
+} {20x160+280+35 280x200+0+0}
test pack-3.5 {y padding and filling} {
pack1 -side right -ipady 20 -fill y
} {20x200+280+0 280x200+0+0}
test pack-3.6 {y padding and filling} {
pack1 -side right -ipady 5 -pady 10 -fill y
} {20x180+280+10 280x200+0+0}
+test pack-3.6.1 {y padding and filling} {
+ pack1 -side right -ipady 5 -pady {0 20} -fill y
+} {20x180+280+0 280x200+0+0}
test pack-3.7 {y padding and filling} {
pack1 -side top -pady 20
} {20x40+140+20 300x120+0+80}
+test pack-3.7.1 {y padding and filling} {
+ pack1 -side top -pady {40 0}
+} {20x40+140+40 300x120+0+80}
test pack-3.8 {y padding and filling} {
pack1 -side top -ipady 20
} {20x80+140+0 300x120+0+80}
test pack-3.9 {y padding and filling} {
pack1 -side top -ipady 5 -pady 10
} {20x50+140+10 300x130+0+70}
+test pack-3.9.1 {y padding and filling} {
+ pack1 -side top -ipady 5 -pady {3 17}
+} {20x50+140+3 300x130+0+70}
test pack-3.10 {y padding and filling} {
pack1 -side top -pady 20 -fill y
} {20x40+140+20 300x120+0+80}
+test pack-3.10.1 {y padding and filling} {
+ pack1 -side top -pady {39 1} -fill y
+} {20x40+140+39 300x120+0+80}
test pack-3.11 {y padding and filling} {
pack1 -side top -ipady 20 -fill y
} {20x80+140+0 300x120+0+80}
test pack-3.12 {y padding and filling} {
pack1 -side top -ipady 5 -pady 10 -fill y
} {20x50+140+10 300x130+0+70}
+test pack-3.12.1 {y padding and filling} {
+ pack1 -side top -ipady 5 -pady {1 19} -fill y
+} {20x50+140+1 300x130+0+70}
set pad [winfo pixels .pack 1c]
test pack-3.13 {y padding and filling} {
pack forget .pack.a .pack.b .pack.c .pack.d
@@ -595,9 +652,15 @@ test pack-11.11 {info option} {
test pack-11.12 {info option} {
pack4 -padx 2
} 2
+test pack-11.12.1 {info option} {
+ pack4 -padx {2 9}
+} {2 9}
test pack-11.13 {info option} {
pack4 -pady 3
} 3
+test pack-11.13.1 {info option} {
+ pack4 -pady {3 11}
+} {3 11}
test pack-11.14 {info option} {
pack4 -side top
} top
@@ -644,7 +707,7 @@ test pack-12.8 {command options and errors} {
test pack-12.9 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -anchor gorp} msg] $msg
-} {1 {bad anchor position "gorp": must be n, ne, e, se, s, sw, w, nw, or center}}
+} {1 {bad anchor "gorp": must be n, ne, e, se, s, sw, w, nw, or center}}
test pack-12.10 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -before gorp} msg] $msg
@@ -670,34 +733,58 @@ test pack-12.15 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -padx abc} msg] $msg
} {1 {bad pad value "abc": must be positive screen distance}}
+test pack-12.15.1 {command options and errors} {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+ list [catch {pack .pack.a -padx {5 abc}} msg] $msg
+} {1 {bad 2nd pad value "abc": must be positive screen distance}}
test pack-12.16 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -padx -1} msg] $msg
} {1 {bad pad value "-1": must be positive screen distance}}
+test pack-12.16.1 {command options and errors} {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+ list [catch {pack .pack.a -padx {5 -1}} msg] $msg
+} {1 {bad 2nd pad value "-1": must be positive screen distance}}
test pack-12.17 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -pady abc} msg] $msg
} {1 {bad pad value "abc": must be positive screen distance}}
+test pack-12.17.1 {command options and errors} {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+ list [catch {pack .pack.a -pady {0 abc}} msg] $msg
+} {1 {bad 2nd pad value "abc": must be positive screen distance}}
test pack-12.18 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -pady -1} msg] $msg
} {1 {bad pad value "-1": must be positive screen distance}}
+test pack-12.18.1 {command options and errors} {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+ list [catch {pack .pack.a -pady {0 -1}} msg] $msg
+} {1 {bad 2nd pad value "-1": must be positive screen distance}}
test pack-12.19 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -ipadx abc} msg] $msg
-} {1 {bad pad value "abc": must be positive screen distance}}
+} {1 {bad ipadx value "abc": must be positive screen distance}}
test pack-12.20 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -ipadx -1} msg] $msg
-} {1 {bad pad value "-1": must be positive screen distance}}
+} {1 {bad ipadx value "-1": must be positive screen distance}}
+test pack-12.20.1 {command options and errors} {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+ list [catch {pack .pack.a -ipadx {5 5}} msg] $msg
+} {1 {bad ipadx value "5 5": must be positive screen distance}}
test pack-12.21 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -ipady abc} msg] $msg
-} {1 {bad pad value "abc": must be positive screen distance}}
+} {1 {bad ipady value "abc": must be positive screen distance}}
test pack-12.22 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -ipady -1} msg] $msg
-} {1 {bad pad value "-1": must be positive screen distance}}
+} {1 {bad ipady value "-1": must be positive screen distance}}
+test pack-12.22.1 {command options and errors} {
+ pack forget .pack.a .pack.b .pack.c .pack.d
+ list [catch {pack .pack.a -ipady {5 5}} msg] $msg
+} {1 {bad ipady value "5 5": must be positive screen distance}}
test pack-12.23 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -side bac} msg] $msg
@@ -705,7 +792,7 @@ test pack-12.23 {command options and errors} {
test pack-12.24 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -lousy bac} msg] $msg
-} {1 {unknown or ambiguous option "-lousy": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}}
+} {1 {bad option "-lousy": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}}
test pack-12.25 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -padx} msg] $msg
@@ -713,7 +800,7 @@ test pack-12.25 {command options and errors} {
test pack-12.26 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a {} 22} msg] $msg
-} {1 {unknown or ambiguous option "": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}}
+} {1 {bad option "": must be -after, -anchor, -before, -expand, -fill, -in, -ipadx, -ipady, -padx, -pady, or -side}}
test pack-12.27 {command options and errors} {
pack forget .pack.a .pack.b .pack.c .pack.d
list [catch {pack .pack.a -in .} msg] $msg
@@ -976,6 +1063,42 @@ test pack-18.2 {unmap slaves when master unmapped} {
update
lappend result [winfo ismapped .pack.b]
} {1 0 100 30 0 1}
+
+test pack-19.1 {test respect for internalborder} {
+ catch {eval pack forget [pack slaves .pack]}
+ destroy .pack.l .pack.lf
+ wm geometry .pack 200x200
+ frame .pack.l -width 15 -height 10
+ labelframe .pack.lf -labelwidget .pack.l
+ pack .pack.lf -fill both -expand 1
+ frame .pack.lf.f
+ pack .pack.lf.f -fill both -expand 1
+ update
+ set res [list [winfo geometry .pack.lf.f]]
+ .pack.lf configure -labelanchor e -padx 3 -pady 5
+ update
+ lappend res [winfo geometry .pack.lf.f]
+ destroy .pack.l .pack.lf
+ set res
+} {196x188+2+10 177x186+5+7}
+test pack-19.2 {test support for minreqsize} {
+ catch {eval pack forget [pack slaves .pack]}
+ destroy .pack.l .pack.lf
+ wm geometry .pack {}
+ frame .pack.l -width 150 -height 100
+ labelframe .pack.lf -labelwidget .pack.l
+ pack .pack.lf -fill both -expand 1
+ frame .pack.lf.f -width 20 -height 25
+ pack .pack.lf.f
+ update
+ set res [list [winfo geometry .pack.lf]]
+ .pack.lf configure -labelanchor ws
+ update
+ lappend res [winfo geometry .pack.lf]
+ destroy .pack.l .pack.lf
+ set res
+} {162x127+0+0 172x112+0+0}
+
destroy .pack
foreach i {pack1 pack2 pack3 pack4} {
rename $i {}
@@ -984,16 +1107,3 @@ foreach i {pack1 pack2 pack3 pack4} {
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/panedwindow.test b/tk/tests/panedwindow.test
new file mode 100644
index 00000000000..7f7a98fdb85
--- /dev/null
+++ b/tk/tests/panedwindow.test
@@ -0,0 +1,2392 @@
+# This file is a Tcl script to test entry widgets in Tk. It is
+# organized in the standard fashion for Tcl tests.
+#
+# Copyright (c) 1994 The Regents of the University of California.
+# Copyright (c) 1994-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+set i 1
+panedwindow .p
+foreach test {
+ {-background "#ff0000" "#ff0000" non-existent
+ {unknown color name "non-existent"}}
+ {-bd 4 4 badValue {bad screen distance "badValue"}}
+ {-bg "#ff0000" "#ff0000" non-existent {unknown color name "non-existent"}}
+ {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
+ {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-handlesize 20 20 badValue {bad screen distance "badValue"}}
+ {-height 20 20 badValue {bad screen distance "badValue"}}
+ {-opaqueresize true 1 foo {expected boolean value but got "foo"}}
+ {-orient horizontal horizontal badValue
+ {bad orient "badValue": must be horizontal or vertical}}
+ {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-sashcursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-sashpad 1.3 1 badValue {bad screen distance "badValue"}}
+ {-sashrelief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-sashwidth 10 10 badValue {bad screen distance "badValue"}}
+ {-showhandle true 1 foo {expected boolean value but got "foo"}}
+ {-width 402 402 badValue {bad screen distance "badValue"}}
+} {
+ set name [lindex $test 0]
+ test panedwindow-1.$i {configuration options} {
+ .p configure $name [lindex $test 1]
+ list [lindex [.p configure $name] 4] [.p cget $name]
+ } [list [lindex $test 2] [lindex $test 2]]
+ incr i
+ if {[lindex $test 3] != ""} {
+ test entry-1.$i {configuration options} {
+ list [catch {.p configure $name [lindex $test 3]} msg] $msg
+ } [list 1 [lindex $test 4]]
+ }
+ .p configure $name [lindex [.p configure $name] 3]
+ incr i
+}
+.p add [button .b]
+.p add [button .c]
+foreach test {
+ {-after .c .c badValue {bad window path name "badValue"}}
+ {-before .c .c badValue {bad window path name "badValue"}}
+ {-height 10 10 badValue {bad screen distance "badValue"}}
+ {-minsize 10 10 badValue {bad screen distance "badValue"}}
+ {-padx 1.3 1 badValue {bad screen distance "badValue"}}
+ {-pady 1.3 1 badValue {bad screen distance "badValue"}}
+ {-sticky nsew nesw abcd {bad stickyness value "abcd": must be a string containing zero or more of n, e, s, and w}}
+ {-width 10 10 badValue {bad screen distance "badValue"}}
+} {
+ set name [lindex $test 0]
+ test panedwindow-1.$i {configuration options} {
+ .p paneconfigure .b $name [lindex $test 1]
+ list [lindex [.p paneconfigure .b $name] 4] [.p panecget .b $name]
+ } [list [lindex $test 2] [lindex $test 2]]
+ incr i
+ if {[lindex $test 3] != ""} {
+ test entry-1.$i {configuration options} {
+ list [catch {.p paneconfigure .b $name [lindex $test 3]} msg] $msg
+ } [list 1 [lindex $test 4]]
+ }
+ .p paneconfigure .b $name [lindex [.p paneconfigure .b $name] 3]
+ incr i
+}
+destroy .p .b .c
+
+test panedwindow-2.1 {panedwindow widget command} {
+ panedwindow .p
+ set result [list [catch {.p foo} msg] $msg]
+ destroy .p
+ set result
+} {1 {bad command "foo": must be add, cget, configure, forget, identify, panecget, paneconfigure, panes, proxy, or sash}}
+
+test panedwindow-3.1 {panedwindow panes subcommand} {
+ panedwindow .p
+ .p add [button .b]
+ .p add [button .c]
+ set result [list [.p panes]]
+ .p forget .b
+ lappend result [.p panes]
+ destroy .p .b .c
+ set result
+} [list [list .b .c] [list .c]]
+
+test panedwindow-4.1 {forget subcommand} {
+ panedwindow .p
+ set result [list [catch {.p forget} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "wrong # args: should be \".p forget widget ?widget ...?\""]
+test panedwindow-4.2 {forget subcommand, forget one from start} {
+ panedwindow .p
+ .p add [button .b]
+ .p add [button .c]
+ set result [list [.p panes]]
+ .p forget .b
+ lappend result [.p panes]
+ destroy .p .b .c
+ set result
+} [list {.b .c} .c]
+test panedwindow-4.3 {forget subcommand, forget one from end} {
+ panedwindow .p
+ .p add [button .b]
+ .p add [button .c]
+ .p add [button .d]
+ set result [list [.p panes]]
+ .p forget .d
+ update
+ lappend result [.p panes]
+ destroy .p .b .c .d
+ set result
+} [list {.b .c .d} {.b .c}]
+test panedwindow-4.4 {forget subcommand, forget multiple} {
+ panedwindow .p
+ .p add [button .b]
+ .p add [button .c]
+ .p add [button .d]
+ set result [list [.p panes]]
+ .p forget .b .c
+ update
+ lappend result [.p panes]
+ destroy .p .b .c .d
+ set result
+} [list {.b .c .d} .d]
+test panedwindow-4.5 {forget subcommand, panes are unmapped} {
+ panedwindow .p
+ .p add [button .b]
+ .p add [button .c]
+ pack .p
+ update
+
+ set result [list [winfo ismapped .b] [winfo ismapped .c]]
+ .p forget .b
+ update
+
+ lappend result [winfo ismapped .b] [winfo ismapped .c]
+ destroy .p .b .c
+
+ set result
+} [list 1 1 0 1]
+test panedwindow-4.6 {forget subcommand, changes reqsize of panedwindow} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
+ .p add [frame .f -width 20 -height 20] [frame .g -width 20 -height 20]
+ set result [list [winfo reqwidth .p]]
+ .p forget .f
+ lappend result [winfo reqwidth .p]
+ destroy .p .f .g
+ set result
+} [list 44 20]
+
+test panedwindow-5.1 {sash subcommand} {
+ panedwindow .p
+ set result [list [catch {.p sash} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "wrong # args: should be \".p sash option ?arg ...?\""]
+test panedwindow-5.2 {sash subcommand} {
+ panedwindow .p
+ set result [list [catch {.p sash foo} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "bad option \"foo\": must be coord, dragto, mark, or place"]
+
+test panedwindow-6.1 {sash coord subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash coord} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "wrong # args: should be \".p sash coord index\""]
+test panedwindow-6.2 {sash coord subcommand, errors} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
+ set result [list [catch {.p sash coord 0} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "invalid sash index"]
+test panedwindow-6.3 {sash coord subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash coord foo} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-6.4 {sash coord subcommand sashes correctly placed} {
+ panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
+ .p add [frame .p.f -width 20 -height 20] \
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
+ set result [.p sash coord 0]
+ destroy .p .p.f .p.f2 .p.f3
+ set result
+} [list 22 0]
+test panedwindow-6.5 {sash coord subcommand sashes correctly placed} {
+ panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -showhandle false
+ .p add [frame .p.f -width 20 -height 20] \
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
+ set result [.p sash coord 1]
+ destroy .p .p.f .p.f2 .p.f3
+ set result
+} [list 50 0]
+test panedwindow-6.6 {sash coord subcommand, sashes correctly placed} {
+ panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
+ -showhandle false
+ .p add [frame .p.f -width 20 -height 20] \
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
+ set result [.p sash coord 0]
+ destroy .p .p.f .p.f2 .p.f3
+ set result
+} [list 0 22]
+test panedwindow-6.7 {sash coord subcommand, sashes correctly placed} {
+ panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4 -orient vertical \
+ -showhandle false
+ .p add [frame .p.f -width 20 -height 20] \
+ [frame .p.f2 -width 20 -height 20] \
+ [frame .p.f3 -width 20 -height 20]
+ set result [.p sash coord 1]
+ destroy .p .p.f .p.f2 .p.f3
+ set result
+} [list 0 50]
+test panedwindow-6.8 {sash coord subcommand, errors} {
+ panedwindow .p
+ set result [list \
+ [catch {.p sash coord -1} msg] $msg \
+ [catch {.p sash coord 0} msg] $msg \
+ [catch {.p sash coord 1} msg] $msg \
+ ]
+ destroy .p
+ set result
+} [list 1 "invalid sash index" 1 "invalid sash index" 1 "invalid sash index"]
+test panedwindow-6.9 {sash coord subcommand, errors} {
+ panedwindow .p
+ .p add [frame .p.f]
+ set result [list \
+ [catch {.p sash coord -1} msg] $msg \
+ [catch {.p sash coord 0} msg] \
+ [catch {.p sash coord 1} msg] $msg \
+ ]
+ destroy .p
+ set result
+} [list 1 "invalid sash index" 0 1 "invalid sash index"]
+
+test panedwindow-8.1 {sash mark subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash mark} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "wrong # args: should be \".p sash mark index ?x y?\""]
+test panedwindow-8.2 {sash mark subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash mark foo} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-8.3 {sash mark subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash mark 0 foo bar} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "invalid sash index"]
+test panedwindow-8.4 {sash mark subcommand, errors} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [list [catch {.p sash mark 0 foo bar} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-8.5 {sash mark subcommand, errors} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [list [catch {.p sash mark 0 0 bar} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "expected integer but got \"bar\""]
+test panedwindow-8.6 {sash mark subcommand, mark defaults to 0 0} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [.p sash mark 0]
+ destroy .p .b .c
+ set result
+} [list 0 0]
+test panedwindow-8.7 {sash mark subcommand, set mark} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ .p sash mark 0 10 10
+ set result [.p sash mark 0]
+ destroy .p .b .c
+ set result
+} [list 10 10]
+
+test panedwindow-9.1 {sash dragto subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash dragto} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "wrong # args: should be \".p sash dragto index x y\""]
+test panedwindow-9.2 {sash dragto subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash dragto foo bar baz} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-9.3 {sash dragto subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash dragto 0 foo bar} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "invalid sash index"]
+test panedwindow-9.4 {sash dragto subcommand, errors} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [list [catch {.p sash dragto 0 foo bar} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-9.5 {sash dragto subcommand, errors} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [list [catch {.p sash dragto 0 0 bar} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "expected integer but got \"bar\""]
+
+test panedwindow-10.1 {sash mark/sash dragto interaction} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
+ .p add [frame .f -width 20 -height 20] [button .c -text foobar]
+ .p sash mark 0 10 10
+ .p sash dragto 0 20 10
+ set result [.p sash coord 0]
+ destroy .p .f .c
+ set result
+} [list 30 0]
+test panedwindow-10.2 {sash mark/sash dragto interaction} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical \
+ -showhandle false
+ .p add [frame .p.f -width 20 -height 20] [button .p.c -text foobar]
+ .p sash mark 0 10 10
+ .p sash dragto 0 10 20
+ set result [.p sash coord 0]
+ destroy .p .p.f .p.c
+ set result
+} [list 0 30]
+test panedwindow-10.3 {sash mark/sash dragto, respects minsize} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
+ .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
+ .p sash mark 0 20 10
+ .p sash dragto 0 10 10
+ set result [.p sash coord 0]
+ destroy .p .f .c
+ set result
+} [list 15 0]
+
+test panedwindow-11.1 {sash place subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash place} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "wrong # args: should be \".p sash place index x y\""]
+test panedwindow-11.2 {sash place subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash place foo bar baz} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-11.3 {sash place subcommand, errors} {
+ panedwindow .p
+ set result [list [catch {.p sash place 0 foo bar} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "invalid sash index"]
+test panedwindow-11.4 {sash place subcommand, errors} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [list [catch {.p sash place 0 foo bar} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-11.5 {sash place subcommand, errors} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [list [catch {.p sash place 0 0 bar} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "expected integer but got \"bar\""]
+test panedwindow-11.6 {sash place subcommand, moves sash} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 20] [button .c]
+ .p sash place 0 10 0
+ set result [.p sash coord 0]
+ destroy .p .f .c
+ set result
+} [list 10 0]
+test panedwindow-11.7 {sash place subcommand, moves sash} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -orient vertical
+ .p add [frame .f -width 20 -height 20] [button .c]
+ .p sash place 0 0 10
+ set result [.p sash coord 0]
+ destroy .p .f .c
+ set result
+} [list 0 10]
+test panedwindow-11.8 {sash place subcommand, respects minsize} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
+ .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
+ .p sash place 0 10 0
+ set result [.p sash coord 0]
+ destroy .p .f .c
+ set result
+} [list 15 0]
+
+test panedwindow-12.1 {moving sash changes size of pane to left} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 4 -showhandle false
+ .p add [frame .f -width 20 -height 20] [button .c -text foobar] -sticky nsew
+ .p sash place 0 30 0
+ pack .p
+ update
+ set result [winfo width .f]
+ destroy .p .f .c
+ set result
+} 30
+test panedwindow-12.2 {moving sash changes size of pane to right} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
+ pack .p
+ update
+ set result [winfo width .f2]
+ .p sash place 0 30 0
+ update
+ lappend result [winfo width .f2]
+ destroy .p .f .f2
+ set result
+} {20 10}
+test panedwindow-12.3 {moving sash does not change reqsize of panedwindow} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 20] [frame .f2 -width 20 -height 20]
+ .p sash place 0 30 0
+ set result [winfo reqwidth .p]
+ destroy .p .f .f2
+ set result
+} 44
+test panedwindow-12.4 {moving sash changes size of pane above} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ .p add [frame .f -width 20 -height 10] [button .c -text foobar] -sticky nsew
+ .p sash place 0 0 20
+ pack .p
+ update
+ set result [winfo height .f]
+ destroy .p .f .c
+ set result
+} 20
+test panedwindow-12.5 {moving sash changes size of pane below} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
+ pack .p
+ update
+ set result [winfo height .f2]
+ .p sash place 0 0 15
+ update
+ lappend result [winfo height .f2]
+ destroy .p .f .f2
+ set result
+} {10 5}
+test panedwindow-12.6 {moving sash does not change reqsize of panedwindow} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
+ set result [winfo reqheight .p]
+ .p sash place 0 0 20
+ lappend result [winfo reqheight .p]
+ destroy .p .f .f2
+ set result
+} [list 24 24]
+test panedwindow-12.7 {moving sash does not alter reqsize of widget} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ .p add [frame .f -width 20 -height 10] [frame .f2 -width 20 -height 10]
+ set result [winfo reqheight .f]
+ .p sash place 0 0 20
+ lappend result [winfo reqheight .f]
+ destroy .p .f .f2
+ set result
+} [list 10 10]
+test panedwindow-12.8 {moving sash restricted to minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 20] [button .c] -minsize 15
+ .p sash place 0 10 0
+ pack .p
+ update
+ set result [winfo width .f]
+ destroy .p .f .c
+ set result
+} 15
+test panedwindow-12.10 {moving sash restricted to minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ .p add [frame .f -width 20 -height 30] [button .c] -minsize 10
+ .p sash place 0 0 5
+ pack .p
+ update
+ set result [winfo height .f]
+ destroy .p .f .c
+ set result
+} 10
+test panedwindow-12.12 {moving sash in unmapped window restricted to reqsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20]
+ set result [list [.p sash coord 0]]
+ .p sash place 0 100 0
+ lappend result [.p sash coord 0]
+ destroy .p .f .f2
+ set result
+} [list {20 0} {40 0}]
+test panedwindow-12.13 {moving sash right pushes other sashes} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
+ [frame .f3 -width 20 -height 30]
+ .p sash place 0 80 0
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+ destroy .p .f .f2 .f3
+ set result
+} {{60 0} {64 0}}
+test panedwindow-12.14 {moving sash left pushes other sashes} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
+ [frame .f3 -width 20 -height 30]
+ .p sash place 1 0 0
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+ destroy .p .f .f2 .f3
+ set result
+} {{0 0} {4 0}}
+test panedwindow-12.15 {move sash in mapped window restricted to visible win} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
+ [frame .f3 -width 20 -height 30]
+ place .p -width 50
+ update
+ .p sash place 1 100 0
+ update
+ set result [.p sash coord 1]
+ destroy .p .f .f2 .f3
+ set result
+} {46 0}
+test panedwindow-12.16 {move sash in mapped window restricted to visible win} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
+ [frame .f3 -width 20 -height 30]
+ place .p -width 100
+ update
+ .p sash place 1 200 0
+ update
+ set result [.p sash coord 1]
+ destroy .p .f .f2 .f3
+ set result
+} {96 0}
+test panedwindow-12.17 {moving sash into "virtual" space on \
+ last pane increases reqsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .f -width 20 -height 30] [frame .f2 -width 20 -height 20] \
+ [frame .f3 -width 20 -height 30]
+ place .p -width 100
+ set result [winfo reqwidth .p]
+ update
+ .p sash place 1 200 0
+ update
+ lappend result [winfo reqwidth .p]
+ destroy .p .f .f2 .f3
+ set result
+} {68 100}
+
+test panedwindow-13.1 {horizontal panedwindow lays out widgets properly} {
+ panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2
+ foreach win {.p.f .p.f2 .p.f3} {.p add [frame $win -width 20 -height 10]}
+ pack .p
+ update
+ set result {}
+ foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
+ destroy .p .p.f .p.f2 .p.f3
+ set result
+} [list 2 2 28 2 54 2]
+test panedwindow-13.2 {vertical panedwindow lays out widgets properly} {
+ panedwindow .p -showhandle false -borderwidth 2 -sashpad 2 -sashwidth 2 \
+ -orient vertical
+ foreach win {.p.f .p.f2 .p.f3} {.p add [frame $win -width 20 -height 10]}
+ pack .p
+ update
+ set result {}
+ foreach w [.p panes] {lappend result [winfo x $w] [winfo y $w]}
+ destroy .p .p.f .p.f2 .p.f3
+ set result
+} [list 2 2 2 18 2 34]
+test panedwindow-13.3 {horizontal panedwindow lays out widgets properly} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ foreach {win color} {.p.f blue .p.f2 green} {
+ .p add [frame $win -width 20 -height 20 -bg $color] -padx 10 -pady 5 \
+ -sticky ""
+ }
+ pack .p
+ update
+ set result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
+ .p paneconfigure .p.f -padx 0 -pady 0
+ update
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
+ destroy .p .p.f .p.f2
+ set result
+} [list 80 30 10 5 50 5 60 30 0 5 30 5]
+test panedwindow-13.4 {vertical panedwindow lays out widgets properly} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
+ -orient vertical
+ foreach win {.p.f .p.f2} {
+ .p add [frame $win -width 20 -height 20] -padx 10 -pady 5 -sticky ""
+ }
+ pack .p
+ update
+ set result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
+ .p paneconfigure .p.f -padx 0 -pady 0
+ update
+ lappend result [winfo reqwidth .p] [winfo reqheight .p]
+ foreach win {.p.f .p.f2} {lappend result [winfo x $win] [winfo y $win]}
+ destroy .p .p.f .p.f2
+ set result
+} [list 40 60 10 5 10 35 40 50 10 0 10 25]
+test panedwindow-13.5 {panedwindow respects reqsize of panes when possible} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -width 20 -height 20] -sticky ""
+ place .p -width 40
+ update
+ set result [list [winfo width .p.f]]
+ .p.f configure -width 30
+ update
+ lappend result [winfo width .p.f]
+ destroy .p .p.f
+ set result
+} [list 20 30]
+test panedwindow-13.6 {panedwindow takes explicit widget width over reqwidth} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -width 20 -height 20] -width 20 -sticky ""
+ place .p -width 40
+ update
+ set result [list [winfo width .p.f]]
+ .p.f configure -width 30
+ update
+ lappend result [winfo width .p.f]
+ destroy .p .p.f
+ set result
+} [list 20 20]
+test panedwindow-13.7 {horizontal panedwindow reqheight is max slave height} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20]
+ set result [winfo reqheight .p]
+ .p.f config -height 40
+ lappend result [winfo reqheight .p]
+ destroy .p .p.f .p.f2
+ set result
+} {20 40}
+test panedwindow-13.8 {horizontal panedwindow reqheight is max slave height} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
+ .p paneconfigure .p.f -height 15
+ set result [winfo reqheight .p]
+ .p.f config -height 40
+ lappend result [winfo reqheight .p]
+ destroy .p .p.f .p.f2
+ set result
+} {20 20}
+test panedwindow-13.9 {panedwindow pane width overrides widget width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4
+ foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
+ .p sash place 0 10 0
+ pack .p
+ update
+ set result [winfo width .p.f]
+ .p paneconfigure .p.f -width 30
+ lappend result [winfo width .p.f]
+ destroy .p .p.f .p.f2
+ set result
+} [list 10 10]
+test panedwindow-13.10 {panedwindow respects reqsize of panes when possible} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -width 20 -height 20] -sticky ""
+ place .p -height 40
+ update
+ set result [list [winfo height .p.f]]
+ .p.f configure -height 30
+ update
+ lappend result [winfo height .p.f]
+ destroy .p .p.f
+ set result
+} [list 20 30]
+test panedwindow-13.11 {panedwindow takes explicit height over reqheight} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -width 20 -height 20] -height 20 -sticky ""
+ place .p -height 40
+ update
+ set result [list [winfo height .p.f]]
+ .p.f configure -height 30
+ update
+ lappend result [winfo height .p.f]
+ destroy .p .p.f
+ set result
+} [list 20 20]
+test panedwindow-13.12 {vertical panedwindow reqwidth is max slave width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ .p add [frame .p.f -width 20 -height 20] [frame .p.f2 -width 20 -height 20]
+ set result [winfo reqwidth .p]
+ .p.f config -width 40
+ lappend result [winfo reqwidth .p]
+ destroy .p .p.f .p.f2
+ set result
+} {20 40}
+test panedwindow-13.13 {vertical panedwindow reqwidth is max slave width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
+ .p paneconfigure .p.f -width 15
+ set result [winfo reqwidth .p]
+ .p.f config -width 40
+ lappend result [winfo reqwidth .p]
+ destroy .p .p.f .p.f2
+ set result
+} {20 20}
+test panedwindow-13.14 {panedwindow pane height overrides widget width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 4 \
+ -orient vertical
+ foreach win {.p.f .p.f2} {.p add [frame $win -width 20 -height 20]}
+ .p sash place 0 0 10
+ pack .p
+ update
+ set result [winfo height .p.f]
+ .p paneconfigure .p.f -height 30
+ lappend result [winfo height .p.f]
+ destroy .p .p.f .p.f2
+ set result
+} [list 10 10]
+
+
+test panedwindow-14.1 {PanestructureProc, widget yields managements} {
+ # Check that the panedwindow correctly yields geometry management of
+ # a slave when the slave is destroyed.
+
+ # This test should not cause a core dump, and it should not cause
+ # a memory leak.
+ panedwindow .p
+ .p add [button .b]
+ destroy .p
+ pack .b
+ destroy .b
+ set result ""
+} ""
+test panedwindow-14.2 {PanedWindowLostSlaveProc, widget yields management} {
+ # Check that the paned window correctly yields geometry management of
+ # a slave when some other geometry manager steals the slave from us.
+
+ # This test should not cause a core dump, and it should not cause a
+ # memory leak.
+ panedwindow .p
+ .p add [button .b]
+ pack .p
+ update
+ pack .b
+ update
+ set result [.p panes]
+ destroy .p .b
+ set result
+} {}
+
+set stickysets [list n s e w sn ns en ne wn nw esn nse nsw nsew ""]
+set stickygets [list n s e w ns ns ne ne nw nw nes nes nsw nesw ""]
+set i 0
+foreach s $stickysets g $stickygets {
+ test panedwindow-15.[incr i] {panedwindow sticky settings} {
+ panedwindow .p -showhandle false
+ .p add [button .b]
+ .p paneconfigure .b -sticky $s
+ set result [.p panecget .b -sticky]
+ destroy .p .b
+ set result
+ } $g
+}
+
+set i 0
+foreach s [list {} n s e w ns ew nw ne se sw nse nsw sew new news] \
+ x [list 10 10 10 20 0 10 0 0 20 20 0 20 0 0 0 0] \
+ y [list 10 0 20 10 10 0 10 0 0 20 20 0 0 20 0 0] \
+ w [list 20 20 20 20 20 20 40 20 20 20 20 20 20 40 40 40] \
+ h [list 20 20 20 20 20 40 20 20 20 20 20 40 40 20 20 40] {
+ test panedwindow-16.[incr i] {panedwindow sticky works} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ .p add [frame .p.f -height 20 -width 20 -bg red] -sticky $s
+ place .p -width 40 -height 40
+ update
+ set result [list $s [winfo x .p.f] [winfo y .p.f] \
+ [winfo width .p.f] [winfo height .p.f]]
+ destroy .p .p.f
+ set result
+ } [list $s $x $y $w $h]
+}
+
+test panedwindow-17.1 {setting minsize when pane is too small snaps width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .p.f -height 20 -width 20 -bg red]
+ set result [winfo reqwidth .p]
+ .p paneconfigure .p.f -minsize 40
+ lappend result [winfo reqwidth .p]
+ destroy .p .p.f .p.f2
+ set result
+} [list 20 40]
+
+test panedwindow-18.1 {MoveSash, move right} {
+ set result {}
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Get the requested width of the paned window
+ lappend result [winfo reqwidth .p]
+
+ .p sash place 0 30 0
+
+ # Get the reqwidth again, to make sure it hasn't changed
+ lappend result [winfo reqwidth .p]
+
+ # Check that the sash moved
+ lappend result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 42 42 {30 0}]
+test panedwindow-18.2 {MoveSash, move right (unmapped) clipped by reqwidth} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 0 100 0
+
+ # Get the new sash coord; it should be clipped by the reqwidth of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 40 0]
+test panedwindow-18.3 {MoveSash, move right (mapped, width < reqwidth) clipped by width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Put the panedwindow up on the display and give it a width < reqwidth
+ place .p -x 0 -y 0 -width 32
+ update
+
+ .p sash place 0 100 0
+
+ # Get the new sash coord; it should be clipped by the visible width of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 30 0]
+test panedwindow-18.4 {MoveSash, move right (mapped, width > reqwidth) clipped by width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Put the panedwindow up on the display and give it a width > reqwidth
+ place .p -x 0 -y 0 -width 102
+ update
+
+ .p sash place 0 200 0
+
+ # Get the new sash coord; it should be clipped by the visible width of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 100 0]
+test panedwindow-18.5 {MoveSash, move right respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 100 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 30 0]
+test panedwindow-18.6 {MoveSash, move right respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 100 0
+
+ # Get the new sash coord; it should have moved as far as possible.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 40 0]
+test panedwindow-18.7 {MoveSash, move right pushes other sashes} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 0 100 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 62 0]
+test panedwindow-18.8 {MoveSash, move right pushes other sashes, respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 100 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 52 0]
+test panedwindow-18.9 {MoveSash, move right respects minsize, exludes pad} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -padx 5
+ }
+
+ .p sash place 0 100 0
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 50 0]
+test panedwindow-18.10 {MoveSash, move right, negative minsize becomes 0} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
+ }
+
+ .p sash place 0 50 0
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list [list 50 0] [list 52 0]]
+test panedwindow-18.11 {MoveSash, move left} {
+ set result {}
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Get the requested width of the paned window
+ lappend result [winfo reqwidth .p]
+
+ .p sash place 0 10 0
+
+ # Get the reqwidth again, to make sure it hasn't changed
+ lappend result [winfo reqwidth .p]
+
+ # Check that the sash moved
+ lappend result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 42 42 {10 0}]
+test panedwindow-18.12 {MoveSash, move left, can't move outside of window} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 0 -100 0
+
+ # Get the new sash coord; it should be clipped by the reqwidth of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 0 0]
+test panedwindow-18.13 {MoveSash, move left respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 0 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 10 0]
+test panedwindow-18.14 {MoveSash, move left respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 22 0]
+test panedwindow-18.15 {MoveSash, move left pushes other sashes} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 0]
+test panedwindow-18.16 {MoveSash, move left pushes other sashes, respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 10 0]
+test panedwindow-18.17 {MoveSash, move left respects minsize, exludes pad} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -padx 5
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 42 0]
+test panedwindow-18.18 {MoveSash, move left, negative minsize becomes 0} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ foreach w {.f1 .f2 .f3} c {red blue green} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
+ }
+
+ .p sash place 1 10 0
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list [list 8 0] [list 10 0]]
+
+test panedwindow-19.1 {MoveSash, move down} {
+ set result {}
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Get the requested width of the paned window
+ lappend result [winfo reqheight .p]
+
+ .p sash place 0 0 30
+
+ # Get the reqwidth again, to make sure it hasn't changed
+ lappend result [winfo reqheight .p]
+
+ # Check that the sash moved
+ lappend result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 42 42 {0 30}]
+test panedwindow-19.2 {MoveSash, move down (unmapped) clipped by reqheight} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 0 0 100
+
+ # Get the new sash coord; it should be clipped by the reqheight of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 0 40]
+test panedwindow-19.3 {MoveSash, move down (mapped, height < reqheight) clipped by height} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Put the panedwindow up on the display and give it a height < reqheight
+ place .p -x 0 -y 0 -height 32
+ update
+
+ .p sash place 0 0 100
+
+ # Get the new sash coord; it should be clipped by the visible height of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 0 30]
+test panedwindow-19.4 {MoveSash, move down (mapped, height > reqheight) clipped by height} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Put the panedwindow up on the display and give it a width > reqwidth
+ place .p -x 0 -y 0 -height 102
+ update
+
+ .p sash place 0 0 200
+
+ # Get the new sash coord; it should be clipped by the visible width of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 0 100]
+test panedwindow-19.5 {MoveSash, move down respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 0 100
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 0 30]
+test panedwindow-19.6 {MoveSash, move down respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 0 100
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 40]
+test panedwindow-19.7 {MoveSash, move down pushes other sashes} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 0 0 100
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 62]
+test panedwindow-19.8 {MoveSash, move down pushes other sashes, respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 0 100
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 52]
+test panedwindow-19.9 {MoveSash, move down respects minsize, exludes pad} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -pady 5
+ }
+
+ .p sash place 0 0 100
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 50]
+test panedwindow-19.10 {MoveSash, move right, negative minsize becomes 0} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
+ }
+
+ .p sash place 0 0 50
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list [list 0 50] [list 0 52]]
+test panedwindow-19.11 {MoveSash, move up} {
+ set result {}
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ # Get the requested width of the paned window
+ lappend result [winfo reqheight .p]
+
+ .p sash place 0 0 10
+
+ # Get the reqwidth again, to make sure it hasn't changed
+ lappend result [winfo reqheight .p]
+
+ # Check that the sash moved
+ lappend result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 42 42 {0 10}]
+test panedwindow-19.12 {MoveSash, move up, can't move outside of window} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 0 0 -100
+
+ # Get the new sash coord; it should be clipped by the reqwidth of
+ # the panedwindow.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 0 0]
+test panedwindow-19.13 {MoveSash, move up respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 0 0 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2
+
+ set result
+} [list 0 10]
+test panedwindow-19.14 {MoveSash, move up respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 22]
+test panedwindow-19.15 {MoveSash, move up pushes other sashes} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 0]
+test panedwindow-19.16 {MoveSash, move up pushes other sashes, respects minsize} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] -sticky nsew -minsize 10
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible while
+ # respecting minsizes.
+ set result [.p sash coord 0]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 10]
+test panedwindow-19.17 {MoveSash, move up respects minsize, exludes pad} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize 10 -pady 5
+ }
+
+ .p sash place 1 0 0
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [.p sash coord 1]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list 0 42]
+test panedwindow-19.18 {MoveSash, move up, negative minsize becomes 0} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} c {red blue green} {
+ .p add [frame $w -height 20 -width 20 -bg $c] \
+ -sticky nsew -minsize -50
+ }
+
+ .p sash place 1 0 10
+
+ # Get the new sash coord; it should have moved as far as possible,
+ # respecting minsizes.
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+
+ # Cleanup
+ destroy .p .f1 .f2 .f3
+
+ set result
+} [list [list 0 8] [list 0 10]]
+
+# The following tests check that the panedwindow is correctly computing its
+# geometry based on the various configuration options that can affect the
+# geometry.
+
+test panedwindow-20.1 {ComputeGeometry, reqheight taken from widgets} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue]
+ }
+ set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
+ .f3 configure -height 40
+ lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f1 .f2 .f3
+ set result
+} [list [list 60 20] [list 60 40]]
+test panedwindow-20.2 {ComputeGeometry, reqheight taken from widgets} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue]
+ }
+ set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
+ .p paneconfigure .f3 -height 40
+ lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f1 .f2 .f3
+ set result
+} [list [list 60 20] [list 60 40]]
+test panedwindow-20.3 {ComputeGeometry, reqheight taken from widgets} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -pady 20
+ }
+ set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
+ .p paneconfigure .f3 -height 40
+ lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f1 .f2 .f3
+ set result
+} [list [list 60 60] [list 60 80]]
+test panedwindow-20.4 {ComputeGeometry, reqwidth taken from widgets} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue]
+ }
+ set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
+ .f3 configure -width 40
+ lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f1 .f2 .f3
+ set result
+} [list [list 20 60] [list 40 60]]
+test panedwindow-20.5 {ComputeGeometry, reqwidth taken from widgets} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue]
+ }
+ set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
+ .p paneconfigure .f3 -width 40
+ lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f1 .f2 .f3
+ set result
+} [list [list 20 60] [list 40 60]]
+test panedwindow-20.6 {ComputeGeometry, reqwidth taken from widgets} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 0 \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] -padx 20
+ }
+ set result [list [list [winfo reqwidth .p] [winfo reqheight .p]]]
+ .p paneconfigure .f3 -width 40
+ lappend result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f1 .f2 .f3
+ set result
+} [list [list 60 60] [list 80 60]]
+
+set i 6
+foreach bd {0 2} {
+ foreach sp {0 5} {
+ foreach sw {0 3} {
+ foreach h {0 1} {
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry, one slave, reqsize set properly} {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -sashwidth $sw -handlesize 6 -showhandle $h
+ .p add [frame .p.f -width 20 -height 20 -bg red] -padx $h \
+ -sticky ""
+ set result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .p.f
+ set result
+ } [list [expr {(2 * $bd) + 20 + (2 * $h)}] \
+ [expr {(2 * $bd) + 20}]]
+
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry, three panes, reqsize set properly} {
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -sashwidth $sw -handlesize 6 -showhandle $h
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ set result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .p.f1 .p.f2 .p.f3
+ set result
+ } [list [expr {(2 * $bd) + ($h?12:(2*$sw)) + (4*$sp) + 60}] \
+ [expr {(2 * $bd) + 20}]]
+
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry, sash coords} {
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -sashwidth $sw -handlesize 6 -showhandle $h
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+ destroy .p .f1 .f2 .f3
+ set result
+ } [list [list [expr {$bd+20+($h?(6-$sw)/2:0)+$sp}] $bd] \
+ [list [expr {$bd+40+($h?6+(6-$sw)/2:$sw)+(3*$sp)}] \
+ $bd]]
+
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry/ArrangePanes, slave coords} {
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -sashwidth $sw -handlesize 6 -showhandle $h
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky nsew -pady 3 -padx 11
+ }
+ pack .p
+ update
+ set result {}
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ lappend result [list [winfo x $w] [winfo y $w] \
+ [winfo width $w] [winfo height $w]]
+ }
+ destroy .p .p.f1 .p.f2 .p.f3
+ set result
+ } [list [list [expr {$bd+11}] [expr {$bd+3}] 20 20] \
+ [list [expr {$bd+53+($h?6:$sw)+(2*$sp)}] \
+ [expr {$bd+3}] 20 20] \
+ [list [expr {$bd+95+($h?12:2*$sw)+(4*$sp)}] \
+ [expr {$bd+3}] 20 20]]
+
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry, one slave, vertical} {
+ # With just one slave, sashpad and sashwidth should not
+ # affect the panedwindow's geometry, since no sash should
+ # ever be drawn.
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -orient vertical -sashwidth $sw -handlesize 6 \
+ -showhandle $h
+ .p add [frame .f -width 20 -height 20 -bg red] -pady $h \
+ -sticky ""
+ set result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f
+ set result
+ } [list [expr {(2 * $bd) + 20}] \
+ [expr {(2 * $bd) + 20 + (2 * $h)}]]
+
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry, three panes, vertical} {
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -sashwidth $sw -handlesize 6 -showhandle $h \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ set result [list [winfo reqwidth .p] [winfo reqheight .p]]
+ destroy .p .f1 .f2 .f3
+ set result
+ } [list [expr {(2 * $bd) + 20}] \
+ [expr {(2 * $bd) + ($h?12:(2*$sw)) + (4*$sp) + 60}]]
+
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry, sash coords, vertical} {
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -sashwidth $sw -handlesize 6 -showhandle $h \
+ -orient vertical
+ foreach w {.f1 .f2 .f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky ""
+ }
+ set result [list [.p sash coord 0] [.p sash coord 1]]
+ destroy .p .f1 .f2 .f3
+ set result
+ } [list [list $bd [expr {$bd+20+($h?(6-$sw)/2:0)+$sp}]] \
+ [list $bd \
+ [expr {$bd+40+($h?6+(6-$sw)/2:$sw)+(3*$sp)}]]]
+
+ test panedwindow-20.[incr i]-$bd-$sp-$sw-$h \
+ {ComputeGeometry/ArrangePanes, slave coords, vert} {
+ panedwindow .p -borderwidth $bd -sashpad $sp \
+ -sashwidth $sw -handlesize 6 -showhandle $h \
+ -orient vertical
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ .p add [frame $w -width 20 -height 20 -bg blue] \
+ -sticky nsew -pady 11 -padx 3
+ }
+ pack .p
+ update
+ set result {}
+ foreach w {.p.f1 .p.f2 .p.f3} {
+ lappend result [list [winfo x $w] [winfo y $w] \
+ [winfo width $w] [winfo height $w]]
+ }
+ destroy .p .p.f1 .p.f2 .p.f3
+ set result
+ } [list [list [expr {$bd+3}] [expr {$bd+11}] 20 20] \
+ [list [expr {$bd+3}] \
+ [expr {$bd+53+($h?6:$sw)+(2*$sp)}] 20 20] \
+ [list [expr {$bd+3}] \
+ [expr {$bd+95+($h?12:2*$sw)+(4*$sp)}] 20 20]]
+ }
+ }
+ }
+}
+
+test panedwindow-21.1 {destroyed widgets are removed from panedwindow} {
+ panedwindow .p
+ .p add [frame .f -width 20 -height 20 -bg blue]
+ destroy .f
+ set result [.p panes]
+ destroy .p
+ set result
+} {}
+test panedwindow-21.2 {destroyed slave causes geometry recomputation} {
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .f -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 20 -bg red]
+ destroy .f
+ set result [winfo reqwidth .p]
+ destroy .p .f2
+ set result
+} 20
+
+test panedwindow-22.1 {ArrangePanes, extra space is given to the last pane} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .f1 -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
+ place .p -width 100 -x 0 -y 0
+ update
+ set result [winfo width .f2]
+ destroy .p .f1 .f2
+ set result
+} 78
+test panedwindow-22.2 {ArrangePanes, extra space is given to the last pane} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ .p add [frame .f1 -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 20 -bg red] -sticky nsew
+ place .p -height 100 -x 0 -y 0
+ update
+ set result [winfo height .f2]
+ destroy .p .f1 .f2
+ set result
+} 78
+test panedwindow-22.3 {ArrangePanes, explicit height/width are preferred} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .f1 -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 20 -bg red] -sticky ""
+ .p paneconfigure .f1 -width 10 -height 15
+ pack .p
+ update
+ set result [list [winfo width .f1] [winfo height .f1]]
+ destroy .p .f1 .f2
+ set result
+} {10 15}
+test panedwindow-22.4 {ArrangePanes, panes clipped by size of pane} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .f1 -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 20 -bg red]
+ .p sash place 0 10 0
+ pack .p
+ update
+ set result [list [winfo width .f1] [winfo height .f1]]
+ destroy .p .f1 .f2
+ set result
+} {10 20}
+test panedwindow-22.5 {ArrangePanes, panes clipped by size of pane} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ .p add [frame .f1 -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 20 -bg red]
+ .p sash place 0 0 10
+ pack .p
+ update
+ set result [list [winfo width .f1] [winfo height .f1]]
+ destroy .p .f1 .f2
+ set result
+} {20 10}
+test panedwindow-22.6 {ArrangePanes, height of pane taken from total height} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
+ [frame .p.f2 -width 20 -height 40 -bg red] -sticky ""
+ pack .p
+ update
+ set result [list [winfo y .p.f1]]
+ destroy .p .p.f1 .p.f2
+ set result
+} 10
+test panedwindow-22.8 {ArrangePanes, width of pane taken from total width} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 \
+ -orient vertical
+ .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
+ [frame .p.f2 -width 40 -height 40 -bg red] -sticky ""
+ pack .p
+ update
+ set result [list [winfo x .p.f1]]
+ destroy .p .p.f1 .p.f2
+ set result
+} 10
+test panedwindow-22.9 {ArrangePanes, panes with width <= 0 are unmapped} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .f1 -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 40 -bg red]
+ pack .p
+ update
+ set result [winfo ismapped .f1]
+ .p sash place 0 0 0
+ update
+ lappend result [winfo ismapped .f1]
+ destroy .p .f1 .f2
+ set result
+} {1 0}
+test panedwindow-22.10 {ArrangePanes, panes with width <= 0 are unmapped} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
+ [frame .p.f2 -width 20 -height 40 -bg red]
+ pack .p
+ update
+ set result [winfo ismapped .p.f1]
+ .p sash place 0 0 0
+ update
+ lappend result [winfo ismapped .p.f1]
+ destroy .p .p.f1 .p.f2
+ set result
+} {1 0}
+test panedwindow-22.11 {ArrangePanes, panes with width <= 0 are unmapped} {
+ panedwindow .p -showhandle false -borderwidth 0 -sashpad 0 -sashwidth 2 -orient vertical
+ .p add [frame .p.f1 -width 20 -height 20 -bg blue] \
+ [frame .p.f2 -width 20 -height 40 -bg red]
+ pack .p
+ update
+ set result [winfo ismapped .p.f1]
+ .p sash place 0 0 0
+ update
+ lappend result [winfo ismapped .p.f1]
+ destroy .p .p.f1 .p.f2
+ set result
+} {1 0}
+
+test panedwindow-23.1 {PanedWindowReqProc, react to slave geometry changes} {
+ # Basically just want to make sure that the PanedWindowReqProc is called
+ panedwindow .p -borderwidth 0 -sashpad 0 -sashwidth 2
+ .p add [frame .f1 -width 20 -height 20 -bg blue] \
+ [frame .f2 -width 20 -height 40 -bg red]
+ set result [winfo reqheight .p]
+ .f1 configure -height 80
+ lappend result [winfo reqheight .p]
+ destroy .p .f1 .f2
+ set result
+} {40 80}
+
+test panedwindow-24.1 {ConfigurePanes, can't add panedwindow to itself} {
+ panedwindow .p
+ set result [list [catch {.p add .p} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "can't add .p to itself"]
+test panedwindow-24.2 {ConfigurePanes, bad window throws error} {
+ panedwindow .p
+ set result [list [catch {.p add .b} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "bad window path name \".b\""]
+test panedwindow-24.3 {ConfigurePanes, bad window aborts processing} {
+ panedwindow .p
+ button .b
+ catch {.p add .b .a}
+ set result [.p panes]
+ destroy .p .b
+ set result
+} {}
+test panedwindow-24.4 {ConfigurePanes, bad option aborts processing} {
+ panedwindow .p
+ button .b
+ catch {.p add .b -sticky foobar}
+ set result [.p panes]
+ destroy .p .b
+ set result
+} {}
+test panedwindow-24.5 {ConfigurePanes, after win isn't managed by panedwin} {
+ panedwindow .p
+ button .b
+ button .c
+ set result [list [catch {.p add .b -after .c} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "window \".c\" is not managed by .p"]
+test panedwindow-24.6 {ConfigurePanes, before win isn't managed by panedwin} {
+ panedwindow .p
+ button .b
+ button .c
+ set result [list [catch {.p add .b -before .c} msg] $msg]
+ destroy .p .b .c
+ set result
+} [list 1 "window \".c\" is not managed by .p"]
+test panedwindow-24.7 {ConfigurePanes, -after {} is a no-op} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ .p paneconfigure .b -after {}
+ set result [.p panes]
+ destroy .p .b .c
+ set result
+} {.b .c}
+test panedwindow-24.8 {ConfigurePanes, -before {} is a no-op} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ .p paneconfigure .b -before {}
+ set result [.p panes]
+ destroy .p .b .c
+ set result
+} {.b .c}
+test panedwindow-24.9 {ConfigurePanes, new panes are added} {
+ panedwindow .p
+ .p add [button .b] [button .c]
+ set result [.p panes]
+ destroy .p .b .c
+ set result
+} {.b .c}
+test panedwindow-24.10 {ConfigurePanes, options applied to all panes} {
+ panedwindow .p
+ .p add [button .b] [button .c] -sticky ne -height 5 -width 5 -minsize 10
+ set result {}
+ foreach w {.b .c} {
+ set val {}
+ foreach option {-sticky -height -width -minsize} {
+ lappend val $option [.p panecget $w $option]
+ }
+ lappend result $w $val
+ }
+ destroy .p .b .c
+ set result
+} [list .b {-sticky ne -height 5 -width 5 -minsize 10} \
+ .c {-sticky ne -height 5 -width 5 -minsize 10}]
+test panedwindow-24.11 {ConfigurePanes, existing panes are reconfigured} {
+ panedwindow .p
+ .p add [button .b] -sticky nw -height 10
+ .p add .b [button .c] -sticky se -height 2
+ set result [list [.p panes] \
+ [.p panecget .b -sticky] [.p panecget .b -height] \
+ [.p panecget .c -sticky] [.p panecget .c -height]]
+ destroy .p .b .c
+ set result
+} [list {.b .c} es 2 es 2]
+test panedwindow-24.12 {ConfigurePanes, widgets added to end by default} {
+ panedwindow .p
+ .p add [button .b]
+ .p add [button .c]
+ .p add [button .d]
+ set result [.p panes]
+ destroy .p .b .c .d
+ set result
+} {.b .c .d}
+test panedwindow-24.13 {ConfigurePanes, -after, single addition} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+
+ .p add .a .b
+ .p add .c -after .a
+ set result [.p panes]
+ destroy .p .a .b .c
+ set result
+} {.a .c .b}
+test panedwindow-24.14 {ConfigurePanes, -after, multiple additions} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b
+ .p add .c .d -after .a
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.a .c .d .b}
+test panedwindow-24.15 {ConfigurePanes, -after, relocates existing widget} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b .c .d
+ .p add .d -after .a
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.a .d .b .c}
+test panedwindow-24.16 {ConfigurePanes, -after, relocates existing widgets} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b .c .d
+ .p add .b .d -after .a
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.a .b .d .c}
+test panedwindow-24.17 {ConfigurePanes, -after, relocates existing widgets} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b .c .d
+ .p add .d .a -after .b
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.b .d .a .c}
+test panedwindow-24.18 {ConfigurePanes, -after, relocates existing widgets} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b .c .d
+ .p add .d .a -after .a
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.d .a .b .c}
+test panedwindow-24.19 {ConfigurePanes, -after, after last window} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b .c
+ .p add .d -after .c
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.a .b .c .d}
+test panedwindow-24.20 {ConfigurePanes, -before, before first window} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b .c
+ .p add .d -before .a
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.d .a .b .c}
+test panedwindow-24.21 {ConfigurePanes, -before, relocate existing windows} {
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+ button .d
+
+ .p add .a .b .c
+ .p add .d .b -before .a
+ set result [.p panes]
+ destroy .p .a .b .c .d
+ set result
+} {.d .b .a .c}
+test panedwindow-24.22 {ConfigurePanes, slave specified multiple times} {
+ # This test should not cause a core dump
+
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+
+ .p add .a .a .b .c
+ set result [.p panes]
+ destroy .p .a .b .c
+ set result
+} {.a .b .c}
+test panedwindow-22.23 {ConfigurePanes, slave specified multiple times} {
+ # This test should not cause a core dump
+
+ panedwindow .p
+ button .a
+ button .b
+ button .c
+
+ .p add .a .a .b .c
+ .p add .a .b .a -after .c
+ set result [.p panes]
+ destroy .p .a .b .c
+ set result
+} {.c .a .b}
+test panedwindow-22.24 {ConfigurePanes, panedwindow cannot manage toplevels} {
+ panedwindow .p
+ toplevel .t
+ set result [list [catch {.p add .t} msg] $msg]
+ destroy .p .t
+ set result
+} [list 1 "can't add toplevel .t to .p"]
+test panedwindow-22.25 {ConfigurePanes, restrict possible panes} {
+ panedwindow .p
+ frame .f
+ button .f.b
+ set result [list [catch {.p add .f.b} msg] $msg]
+ destroy .p .f .f.b
+ set result
+} [list 1 "can't add .f.b to .p"]
+test panedwindow-22.26 {ConfigurePanes, restrict possible panes} {
+ frame .f
+ panedwindow .f.p
+ button .b
+ set result [list [catch {.f.p add .b} msg] $msg]
+ destroy .f.p .f .b
+ set result
+} [list 0 ""]
+test panedwindow-22.27 {ConfigurePanes, restrict possible panes} {
+ panedwindow .p
+ button .p.b
+ set result [list [catch {.p add .p.b} msg] $msg]
+ destroy .p .p.b
+ set result
+} [list 0 ""]
+test panedwindow-22.28 {ConfigurePanes, restrict possible panes} {
+ frame .f
+ frame .f.f
+ frame .f.f.f
+ panedwindow .f.f.f.p
+ button .b
+ set result [list [catch {.f.f.f.p add .b} msg] $msg]
+ destroy .f .f.f .f.f.f .f.f.f.p .b
+ set result
+} [list 0 ""]
+
+test panedwindow-26.1 {DestroyPanedWindow} {
+ # This test should not result in any memory leaks.
+ panedwindow .p
+ foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .q .r .s .t} {
+ .p add [button $w]
+ }
+ foreach w {.a .b .c .d .e .f .g .h .i .j .k .l .m .n .o .p .q .r .s .t} {
+ destroy $w
+ }
+ set result {}
+} {}
+
+test panedwindow-27.1 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 0 0]
+ destroy .p .f .f2
+ set result
+} {}
+test panedwindow-27.2 {PanedWindowIdentifyCoords, padding is included} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 20 0]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.3 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 22 0]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.4 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 24 0]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.5 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 26 0]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.6 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 26 -1]
+ destroy .p .f .f2
+ set result
+} {}
+test panedwindow-27.7 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 26 100]
+ destroy .p .f .f2
+ set result
+} {}
+test panedwindow-27.8 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 6
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 22 4]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.9 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 6
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 22 5]
+ destroy .p .f .f2
+ set result
+} {0 handle}
+test panedwindow-27.10 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 8
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 20 5]
+ destroy .p .f .f2
+ set result
+} {0 handle}
+test panedwindow-27.11 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 8
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 20 0]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.12 {PanedWindowIdentifyCoords} {
+ panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20] \
+ [frame .f3 -bg green -width 20 -height 20]
+ set result [.p identify 48 0]
+ destroy .p .f .f2 .f3
+ set result
+} {1 sash}
+test panedwindow-27.13 {identify subcommand errors} {
+ panedwindow .p -borderwidth 0 -sashpad 2 -sashwidth 4
+ set result [list [catch {.p identify} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "wrong # args: should be \".p identify x y\""]
+test panedwindow-27.14 {identify subcommand errors} {
+ panedwindow .p
+ set result [list [catch {.p identify foo bar} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "expected integer but got \"foo\""]
+test panedwindow-27.14 {identify subcommand errors} {
+ panedwindow .p
+ set result [list [catch {.p identify 0 bar} msg] $msg]
+ destroy .p
+ set result
+} [list 1 "expected integer but got \"bar\""]
+test panedwindow-27.15 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 0 0]
+ destroy .p .f .f2
+ set result
+} {}
+test panedwindow-27.16 {PanedWindowIdentifyCoords, padding is included} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 0 20]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.17 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 0 22]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.18 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 0 24]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.19 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 0 26]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.20 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify -1 26]
+ destroy .p .f .f2
+ set result
+} {}
+test panedwindow-27.21 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 100 26]
+ destroy .p .f .f2
+ set result
+} {}
+test panedwindow-27.22 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 6 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 4 22]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.23 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 6 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 5 22]
+ destroy .p .f .f2
+ set result
+} {0 handle}
+test panedwindow-27.24 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 8 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 5 20]
+ destroy .p .f .f2
+ set result
+} {0 handle}
+test panedwindow-27.25 {PanedWindowIdentifyCoords} {
+ panedwindow .p -bd 0 -sashwidth 2 -sashpad 2 -showhandle 1 -handlepad 5 \
+ -handlesize 8 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20]
+ set result [.p identify 0 20]
+ destroy .p .f .f2
+ set result
+} {0 sash}
+test panedwindow-27.26 {PanedWindowIdentifyCoords} {
+ panedwindow .p -showhandle false -bd 0 -sashwidth 2 -sashpad 2 -orient vertical
+ .p add [frame .f -bg red -width 20 -height 20] \
+ [frame .f2 -bg blue -width 20 -height 20] \
+ [frame .f3 -bg green -width 20 -height 20]
+ set result [.p identify 0 48]
+ destroy .p .f .f2 .f3
+ set result
+} {1 sash}
+
+
+# cleanup
+::tcltest::cleanupTests
+return
diff --git a/tk/tests/place.test b/tk/tests/place.test
index 0d5722bdd21..18c31af40ed 100644
--- a/tk/tests/place.test
+++ b/tk/tests/place.test
@@ -7,15 +7,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# XXX - This test file is woefully incomplete. At present, only a
# few of the features are tested.
@@ -77,7 +74,11 @@ test place-3.3 {ConfigureSlave procedure, -relheight option} {
test place-4.1 {ConfigureSlave procedure, bad -in options} {
place forget .t.f2
list [catch {place .t.f2 -in .t.f2} msg] $msg
-} {1 {can't place .t.f2 relative to itself}}
+} [list 1 "can't place .t.f2 relative to itself"]
+test place-4.2 {ConfigureSlave procedure, bad -in option} {
+ place forget .t.f2
+ list [catch {place .t.f2 -in .} msg] $msg
+} [list 1 "can't place .t.f2 relative to ."]
test place-5.1 {ConfigureSlave procedure, -relwidth option} {
list [catch {place .t.f2 -relwidth abcd} msg] $msg
@@ -216,21 +217,158 @@ test place-8.2 {MasterStructureProc, mapping and unmapping slaves} {
lappend result [winfo ismapped .t.f2]
} {1 0 42 32 0 1}
+test place-9.1 {PlaceObjCmd} {
+ list [catch {place} msg] $msg
+} [list 1 "wrong # args: should be \"place option|pathName args\""]
+test place-9.2 {PlaceObjCmd} {
+ list [catch {place foo} msg] $msg
+} [list 1 "wrong # args: should be \"place option|pathName args\""]
+test place-9.3 {PlaceObjCmd} {
+ catch {destroy .foo}
+ list [catch {place .foo bar} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+test place-9.4 {PlaceObjCmd} {
+ catch {destroy .foo}
+ list [catch {place bar .foo} msg] $msg
+} [list 1 "bad window path name \".foo\""]
+test place-9.5 {PlaceObjCmd} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place badopt .foo} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "bad option \"badopt\": must be configure, forget, info, or slaves"]
+test place-9.6 {PlaceObjCmd, configure errors} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place configure .foo} msg] $msg]
+ destroy .foo
+ set res
+} [list 0 ""]
+test place-9.7 {PlaceObjCmd, configure errors} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place configure .foo bar} msg] $msg]
+ destroy .foo
+ set res
+} [list 0 ""]
+test place-9.8 {PlaceObjCmd, configure} {
+ catch {destroy .foo}
+ frame .foo
+ place .foo -x 0 -y 0
+ set res [place configure .foo]
+ destroy .foo
+ set res
+} [list {-anchor {} {} nw nw} {-bordermode {} {} inside inside} {-height {} {} {} {}} {-in {} {} {} .} {-relheight {} {} {} {}} {-relwidth {} {} {} {}} {-relx {} {} 0 0.0} {-rely {} {} 0 0.0} {-width {} {} {} {}} {-x {} {} 0 0} {-y {} {} 0 0}]
+test place-9.9 {PlaceObjCmd, configure} {
+ catch {destroy .foo}
+ frame .foo
+ place .foo -x 0 -y 0
+ set res [place configure .foo -x]
+ destroy .foo
+ set res
+} [list -x {} {} 0 0]
+test place-9.10 {PlaceObjCmd, forget errors} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place forget .foo bar} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "wrong # args: should be \"place forget pathName\""]
+test place-9.11 {PlaceObjCmd, info errors} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place info .foo bar} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "wrong # args: should be \"place info pathName\""]
+test place-9.12 {PlaceObjCmd, slaves errors} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place slaves .foo bar} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "wrong # args: should be \"place slaves pathName\""]
+
+test place-10.1 {ConfigureSlave} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place .foo -badopt} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "unknown option \"-badopt\""]
+test place-10.2 {ConfigureSlave} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place .foo -anchor} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "value for \"-anchor\" missing"]
+test place-10.3 {ConfigureSlave} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place .foo -bordermode j} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "bad bordermode \"j\": must be inside, outside, or ignore"]
+test place-10.4 {ConfigureSlave} {
+ catch {destroy .foo}
+ frame .foo
+ set res [list [catch {place configure .foo -x 0 -y} msg] $msg]
+ destroy .foo
+ set res
+} [list 1 "value for \"-y\" missing"]
+
+test place-11.1 {PlaceObjCmd, slaves command} {
+ catch {destroy .foo}
+ frame .foo
+ set res [place slaves .foo]
+ destroy .foo
+ set res
+} {}
+test place-11.2 {PlaceObjCmd, slaves command} {
+ catch {destroy .foo .bar}
+ frame .foo
+ frame .bar
+ place .bar -in .foo
+ set res [place slaves .foo]
+ destroy .foo
+ destroy .bar
+ set res
+} [list .bar]
+
+test place-12.1 {PlaceObjCmd, forget command} {
+ catch {destroy .foo}
+ frame .foo
+ place .foo -width 50 -height 50
+ update
+ set res [winfo ismapped .foo]
+ place forget .foo
+ update
+ lappend res [winfo ismapped .foo]
+ destroy .foo
+ set res
+} [list 1 0]
+
+test place-13.1 {test respect for internalborder} {
+ toplevel .pack
+ wm geometry .pack 200x200
+ frame .pack.l -width 15 -height 10
+ labelframe .pack.lf -labelwidget .pack.l
+ pack .pack.lf -fill both -expand 1
+ frame .pack.lf.f
+ place .pack.lf.f -x 0 -y 0 -relwidth 1.0 -relheight 1.0
+ update
+ set res [list [winfo geometry .pack.lf.f]]
+ .pack.lf configure -labelanchor e -padx 3 -pady 5
+ update
+ lappend res [winfo geometry .pack.lf.f]
+ destroy .pack
+ set res
+} {196x188+2+10 177x186+5+7}
+
catch {destroy .t}
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/raise.test b/tk/tests/raise.test
index b0017ba99e5..670213a8cb3 100644
--- a/tk/tests/raise.test
+++ b/tk/tests/raise.test
@@ -10,17 +10,14 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-if {[info commands testmakeexist] == {}} {
- puts "This application hasn't been compiled with the \"testmakeexist\""
- puts "command, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
+testConstraint testmakeexist [llength [info commands testmakeexist]]
# Procedure to create a bunch of overlapping windows, which should
# make it easy to detect differences in order.
@@ -58,9 +55,7 @@ proc raise_getOrder {} {
# Procedure to set up a collection of top-level windows
proc raise_makeToplevels {} {
- foreach i [winfo child .] {
- destroy $i
- }
+ deleteWindows
foreach i {.raise1 .raise2 .raise3} {
toplevel $i
wm geom $i 150x100+0+0
@@ -68,36 +63,33 @@ proc raise_makeToplevels {} {
}
}
-foreach i [winfo child .] {
- destroy $i
-}
toplevel .raise
wm geom .raise 250x200+0+0
test raise-1.1 {preserve creation order} {
raise_setup
- update
+ tkwait visibility .raise.e
raise_getOrder
} {d d d b c e e e}
-test raise-1.2 {preserve creation order} {
+test raise-1.2 {preserve creation order} testmakeexist {
raise_setup
testmakeexist .raise.a
update
raise_getOrder
} {d d d b c e e e}
-test raise-1.3 {preserve creation order} {
+test raise-1.3 {preserve creation order} testmakeexist {
raise_setup
testmakeexist .raise.c
update
raise_getOrder
} {d d d b c e e e}
-test raise-1.4 {preserve creation order} {
+test raise-1.4 {preserve creation order} testmakeexist {
raise_setup
testmakeexist .raise.e
update
raise_getOrder
} {d d d b c e e e}
-test raise-1.5 {preserve creation order} {
+test raise-1.5 {preserve creation order} testmakeexist {
raise_setup
testmakeexist .raise.d .raise.c .raise.b
update
@@ -141,21 +133,21 @@ test raise-3.1 {raise internal windows after creation} {
raise .raise.a .raise.d
raise_getOrder
} {a d d a c e e e}
-test raise-3.2 {raise internal windows after creation} {
+test raise-3.2 {raise internal windows after creation} testmakeexist {
raise_setup
testmakeexist .raise.a .raise.b
raise .raise.a .raise.b
update
raise_getOrder
} {d d d a c e e e}
-test raise-3.3 {raise internal windows after creation} {
+test raise-3.3 {raise internal windows after creation} testmakeexist {
raise_setup
testmakeexist .raise.a .raise.d
raise .raise.a .raise.b
update
raise_getOrder
} {d d d a c e e e}
-test raise-3.4 {raise internal windows after creation} {
+test raise-3.4 {raise internal windows after creation} testmakeexist {
raise_setup
testmakeexist .raise.a .raise.c .raise.d
raise .raise.a .raise.b
@@ -295,9 +287,7 @@ test raise-7.8 {errors in raise/lower commands} {
list [catch {lower . badName4} msg] $msg
} {1 {bad window path name "badName4"}}
-foreach i [winfo child .] {
- destroy $i
-}
+deleteWindows
# cleanup
::tcltest::cleanupTests
diff --git a/tk/tests/safe.test b/tk/tests/safe.test
index 508bf58e19a..6296530cc16 100644
--- a/tk/tests/safe.test
+++ b/tk/tests/safe.test
@@ -8,22 +8,41 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+## NOTE: Any time tests fail here with an error like:
+
+# Can't find a usable tk.tcl in the following directories:
+# {$p(:26:)}
+#
+# $p(:26:)/tk.tcl: script error
+# script error
+# invoked from within
+# "source {$p(:26:)/tk.tcl}"
+# ("uplevel" body line 1)
+# invoked from within
+# "uplevel #0 [list source $file]"
+#
+#
+# This probably means that tk wasn't installed properly.
+
+## it indicates that something went wrong sourcing tk.tcl.
+## Ensure that any changes that occured to tk.tcl will work or
+## are properly prevented in a safe interpreter. -- hobbs
# The set of hidden commands is platform dependent:
if {"$tcl_platform(platform)" == "macintosh"} {
- set hidden_cmds {beep bell cd clipboard echo encoding exit fconfigure file glob grab load ls menu open pwd selection send socket source tk tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile toplevel wm}
+ set hidden_cmds {beep bell cd clipboard echo encoding exit fconfigure file glob grab load ls menu open pwd selection send socket source tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile toplevel wm}
} elseif {"$tcl_platform(platform)" == "windows"} {
- set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source tk tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel wm}
+ set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection socket source tk_chooseColor tk_chooseDirectory tk_getOpenFile tk_getSaveFile tk_messageBox toplevel wm}
} else {
- set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source tk toplevel wm}
+ set hidden_cmds {bell cd clipboard encoding exec exit fconfigure file glob grab load menu open pwd selection send socket source toplevel wm}
}
test safe-1.1 {Safe Tk loading into an interpreter} {
@@ -72,6 +91,28 @@ test safe-2.2 {Unsafe commands not available} {
safe::interpDelete a
set status
} ok
+test safe-2.3 {Unsafe subcommands not available} {
+ catch {safe::interpDelete a}
+ safe::interpCreate a
+ safe::loadTk a
+ set status broken
+ if {[catch {interp eval a {tk appname}} msg]} {
+ set status ok
+ }
+ safe::interpDelete a
+ list $status $msg
+} {ok {appname not accessible in a safe interpreter}}
+test safe-2.4 {Unsafe subcommands not available} {
+ catch {safe::interpDelete a}
+ safe::interpCreate a
+ safe::loadTk a
+ set status broken
+ if {[catch {interp eval a {tk scaling}} msg]} {
+ set status ok
+ }
+ safe::interpDelete a
+ list $status $msg
+} {ok {scaling not accessible in a safe interpreter}}
test safe-3.1 {Unsafe commands are available hidden} {
catch {safe::interpDelete a}
@@ -176,16 +217,3 @@ test safe-7.1 {canvas printing} {
unset hidden_cmds
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/scale.test b/tk/tests/scale.test
index 73d21846785..a6271ab7037 100644
--- a/tk/tests/scale.test
+++ b/tk/tests/scale.test
@@ -8,15 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -618,7 +615,7 @@ test scale-11.1 {ScaleEventProc procedure} {
set x
} {initial 1 0 {}}
test scale-11.2 {ScaleEventProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
scale .s1 -bg #543210
rename .s1 .s2
set x {}
@@ -629,7 +626,7 @@ test scale-11.2 {ScaleEventProc procedure} {
} {.s1 #543210 {} {}}
test scale-12.1 {ScaleCmdDeletedProc procedure} {
- eval destroy [winfo children .]
+ deleteWindows
scale .s1
rename .s1 {}
list [info command .s*] [winfo children .]
@@ -786,7 +783,7 @@ test scale-15.6 {ScaleVarProc procedure, don't call -command} {
} {untouched 60}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test scale-16.1 {scale widget vs hidden commands} {
catch {destroy .s}
@@ -826,4 +823,3 @@ option clear
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/scrollbar.test b/tk/tests/scrollbar.test
index 025375fdf0d..c8c4a6b93fd 100644
--- a/tk/tests/scrollbar.test
+++ b/tk/tests/scrollbar.test
@@ -9,24 +9,17 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
## testmetrics is a win/mac only test command
##
-if {[string compare unix $tcl_platform(platform)] && \
- [string equal {} [info commands testmetrics]]} {
- puts "\"testmetrics\" isn't defined, skipping scrollbar tests"
- ::tcltest::cleanupTests
- return
-}
+testConstraint testmetrics [llength [info commands testmetrics]]
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
update
proc scroll args {
@@ -35,8 +28,7 @@ proc scroll args {
}
proc getTroughSize {w} {
- global tcl_platform
- if {$tcl_platform(platform) == "windows"} {
+ if {[testConstraint testmetrics]} {
if [string match v* [$w cget -orient]] {
return [expr [winfo height $w] - 2*[testmetrics cyvscroll]]
} else {
@@ -269,13 +261,13 @@ test scrollbar-3.35 {ScrollbarWidgetCmd procedure, "fraction" option} {
test scrollbar-3.36 {ScrollbarWidgetCmd procedure, "fraction" option} {unixOnly} {
.s fraction 4 179
} {1}
-test scrollbar-3.37 {ScrollbarWidgetCmd procedure, "fraction" option} {macOrPc} {
+test scrollbar-3.37 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics} {
.s fraction 4 [expr 200 - [testmetrics cyvscroll .s]]
} {1}
test scrollbar-3.38 {ScrollbarWidgetCmd procedure, "fraction" option} {unixOnly} {
.s fraction 4 178
} {0.993711}
-test scrollbar-3.39 {ScrollbarWidgetCmd procedure, "fraction" option} {pcOnly} {
+test scrollbar-3.39 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics pcOnly} {
expr [.s fraction 4 [expr 200 - [testmetrics cyvscroll .s] - 2]] \
== [format %g [expr (200.0 - [testmetrics cyvscroll .s]*2 - 2) \
/ ($height - 1 - [testmetrics cyvscroll .s]*2)]]
@@ -293,7 +285,7 @@ update
test scrollbar-3.41 {ScrollbarWidgetCmd procedure, "fraction" option} {
.t.s fraction 100 0
} {0.5}
-if {$tcl_platform(platform) == "windows"} {
+if {[testConstraint testmetrics]} {
place configure .t.s -width [expr 2*[testmetrics cxhscroll]+1]
} else {
place configure .t.s -width [expr [winfo reqwidth .t.s] - 4]
@@ -489,7 +481,7 @@ test scrollbar-6.13 {ScrollbarPosition procedure} {macOnly} {
test scrollbar-6.14 {ScrollbarPosition procedure} {pcOnly} {
.s identify [expr [winfo width .s] / 2] 0
} {arrow1}
-test scrollbar-6.15 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.15 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.s identify [expr [winfo width .s] / 2] [expr [testmetrics cyvscroll] - 1]
} {arrow1}
@@ -501,10 +493,10 @@ test scrollbar-6.17 {ScrollbarPosition procedure} {macOrUnix nonPortable} {
# some platforms.
.s identify 8 51
} {trough1}
-test scrollbar-6.18 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.18 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.s identify [expr [winfo width .s] / 2] [testmetrics cyvscroll]
} {trough1}
-test scrollbar-6.19 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.19 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.s identify [expr [winfo width .s] / 2] [expr int(.2 / [.s delta 0 1]) \
+ [testmetrics cyvscroll] - 1]
} {trough1}
@@ -517,11 +509,11 @@ test scrollbar-6.21 {ScrollbarPosition procedure} {macOrUnix nonPortable} {
# some platforms.
.s identify 8 83
} {slider}
-test scrollbar-6.22 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.22 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.s identify [expr [winfo width .s] / 2] [expr int(.2 / [.s delta 0 1]) \
+ [testmetrics cyvscroll]]
} {slider}
-test scrollbar-6.23 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.23 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.s identify [expr [winfo width .s] / 2] [expr int(.4 / [.s delta 0 1]) \
+ [testmetrics cyvscroll] - 1]
} {slider}
@@ -535,11 +527,15 @@ test scrollbar-6.25 {ScrollbarPosition procedure} {unixOnly} {
test scrollbar-6.26 {ScrollbarPosition procedure} {macOnly} {
.s identify 8 179
} {arrow2}
-test scrollbar-6.27 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.27 {ScrollbarPosition procedure} {testmetrics pcOnly knownBug} {
+ # This asks for 8,21, which is actually the slider, but there is a
+ # bug in that GetSystemMetrics(SM_CYVTHUMB) actually returns a value
+ # that is larger than the thumb displayed, skewing the ability to
+ # calculate the trough2 area correctly (Win2k). -- hobbs
.s identify [expr [winfo width .s] / 2] [expr int(.4 / [.s delta 0 1]) \
+ [testmetrics cyvscroll]]
} {trough2}
-test scrollbar-6.28 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.28 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.s identify [expr [winfo width .s] / 2] [expr [winfo height .s] \
- [testmetrics cyvscroll] - 1]
} {trough2}
@@ -553,7 +549,7 @@ test scrollbar-6.30 {ScrollbarPosition procedure} {unixOnly} {
test scrollbar-6.31 {ScrollbarPosition procedure} {macOnly} {
.s identify 8 195
} {}
-test scrollbar-6.32 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.32 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.s identify [expr [winfo width .s] / 2] [expr [winfo height .s] \
- [testmetrics cyvscroll]]
} {arrow2}
@@ -596,7 +592,7 @@ test scrollbar-6.41 {ScrollbarPosition procedure} {unixOnly} {
test scrollbar-6.42 {ScrollbarPosition procedure} {macOnly} {
.t.s identify 82 8
} {}
-test scrollbar-6.43 {ScrollbarPosition procedure} {pcOnly} {
+test scrollbar-6.43 {ScrollbarPosition procedure} {testmetrics pcOnly} {
.t.s identify [expr int(.4 / [.t.s delta 1 0]) + [testmetrics cxhscroll] \
- 1] [expr [winfo height .t.s] / 2]
} {slider}
@@ -660,7 +656,7 @@ test scrollbar-8.2 {TkScrollbarEventProc: recursive deletion} {
} {1 0 1}
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test scrollbar-9.1 {scrollbar widget vs hidden commands} {
catch {destroy .s}
diff --git a/tk/tests/select.test b/tk/tests/select.test
index 1ea604c9d76..c31d0c8822f 100644
--- a/tk/tests/select.test
+++ b/tk/tests/select.test
@@ -13,11 +13,14 @@
# environment variable TK_ALT_DISPLAY is set to an alternate display.
#
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-eval destroy [winfo child .]
+namespace import -force tcltest::interpreter
global longValue selValue selInfo
@@ -129,7 +132,13 @@ test select-1.3 {Tk_CreateSelHandler procedure} {
set selInfo ""
list [selection get TEST] $selInfo
} {{Test value} {TEST 0 4000}}
-test select-1.4 {Tk_CreateSelHandler procedure} {
+test select-1.4.1 {Tk_CreateSelHandler procedure} {unixOnly} {
+ setup
+ selection handle .f1 {handler TEST} TEST
+ selection handle .f1 {handler STRING}
+ lsort [selection get TARGETS]
+} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING}
+test select-1.4.2 {Tk_CreateSelHandler procedure} {macOrPc} {
setup
selection handle .f1 {handler TEST} TEST
selection handle .f1 {handler STRING}
@@ -144,7 +153,20 @@ test select-1.5 {Tk_CreateSelHandler procedure} {
set selInfo ""
list [selection get] $selInfo
} {{} {STRING 0 4000}}
-test select-1.6 {Tk_CreateSelHandler procedure} {
+test select-1.6.1 {Tk_CreateSelHandler procedure} {unixOnly} {
+ global selValue selInfo
+ setup
+ selection handle .f1 {handler TEST} TEST
+ selection handle .f1 {handler STRING}
+ set selValue ""
+ set selInfo ""
+ selection get
+ selection get -type TEST
+ selection handle .f1 {handler TEST2} TEST
+ selection get -type TEST
+ list [set selInfo] [lsort [selection get TARGETS]]
+} {{STRING 0 4000 TEST 0 4000 TEST2 0 4000} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING}}
+test select-1.6.2 {Tk_CreateSelHandler procedure} {macOrPc} {
global selValue selInfo
setup
selection handle .f1 {handler TEST} TEST
@@ -157,7 +179,15 @@ test select-1.6 {Tk_CreateSelHandler procedure} {
selection get -type TEST
list [set selInfo] [lsort [selection get TARGETS]]
} {{STRING 0 4000 TEST 0 4000 TEST2 0 4000} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-1.7 {Tk_CreateSelHandler procedure} {
+test select-1.7.1 {Tk_CreateSelHandler procedure} {unixOnly} {
+ setup
+ selection own -selection CLIPBOARD .f1
+ selection handle -selection CLIPBOARD .f1 {handler TEST} TEST
+ selection handle -selection PRIMARY .f1 {handler TEST2} STRING
+ list [lsort [selection get -selection PRIMARY TARGETS]] \
+ [lsort [selection get -selection CLIPBOARD TARGETS]]
+} {{MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING} {MULTIPLE TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-1.7.2 {Tk_CreateSelHandler procedure} {macOrPc} {
setup
selection own -selection CLIPBOARD .f1
selection handle -selection CLIPBOARD .f1 {handler TEST} TEST
@@ -173,7 +203,34 @@ test select-1.8 {Tk_CreateSelHandler procedure} {
##############################################################################
-test select-2.1 {Tk_DeleteSelHandler procedure} {
+test select-2.1 {Tk_DeleteSelHandler procedure} {unixOnly} {
+ setup
+ selection handle .f1 {handler STRING}
+ selection handle -type TEST .f1 {handler TEST}
+ selection handle -type USER .f1 {handler USER}
+ set result [list [lsort [selection get TARGETS]]]
+ selection handle -type TEST .f1 {}
+ lappend result [lsort [selection get TARGETS]]
+} {{MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW USER UTF8_STRING} {MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW USER UTF8_STRING}}
+test select-2.2 {Tk_DeleteSelHandler procedure} {unixOnly} {
+ setup
+ selection handle .f1 {handler STRING}
+ selection handle -type TEST .f1 {handler TEST}
+ selection handle -type USER .f1 {handler USER}
+ set result [list [lsort [selection get TARGETS]]]
+ selection handle -type USER .f1 {}
+ lappend result [lsort [selection get TARGETS]]
+} {{MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW USER UTF8_STRING} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING}}
+test select-2.3 {Tk_DeleteSelHandler procedure} {unixOnly} {
+ setup
+ selection own -selection CLIPBOARD .f1
+ selection handle -selection PRIMARY .f1 {handler STRING}
+ selection handle -selection CLIPBOARD .f1 {handler STRING}
+ selection handle -selection CLIPBOARD .f1 {}
+ list [lsort [selection get TARGETS]] \
+ [lsort [selection get -selection CLIPBOARD TARGETS]]
+} {{MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW UTF8_STRING} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
+test select-2.4 {Tk_DeleteSelHandler procedure} {macOrPc} {
setup
selection handle .f1 {handler STRING}
selection handle -type TEST .f1 {handler TEST}
@@ -182,7 +239,7 @@ test select-2.1 {Tk_DeleteSelHandler procedure} {
selection handle -type TEST .f1 {}
lappend result [lsort [selection get TARGETS]]
} {{MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW USER} {MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW USER}}
-test select-2.2 {Tk_DeleteSelHandler procedure} {
+test select-2.5 {Tk_DeleteSelHandler procedure} {macOrPc} {
setup
selection handle .f1 {handler STRING}
selection handle -type TEST .f1 {handler TEST}
@@ -191,7 +248,7 @@ test select-2.2 {Tk_DeleteSelHandler procedure} {
selection handle -type USER .f1 {}
lappend result [lsort [selection get TARGETS]]
} {{MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW USER} {MULTIPLE STRING TARGETS TEST TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-2.3 {Tk_DeleteSelHandler procedure} {
+test select-2.6 {Tk_DeleteSelHandler procedure} {macOrPc} {
setup
selection own -selection CLIPBOARD .f1
selection handle -selection PRIMARY .f1 {handler STRING}
@@ -200,7 +257,7 @@ test select-2.3 {Tk_DeleteSelHandler procedure} {
list [lsort [selection get TARGETS]] \
[lsort [selection get -selection CLIPBOARD TARGETS]]
} {{MULTIPLE STRING TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW} {MULTIPLE TARGETS TIMESTAMP TK_APPLICATION TK_WINDOW}}
-test select-2.4 {Tk_DeleteSelHandler procedure} {
+test select-2.7 {Tk_DeleteSelHandler procedure} {
setup
selection handle .f1 {handler STRING}
list [selection handle .f1 {}] [selection handle .f1 {}]
@@ -279,27 +336,24 @@ test select-3.9 {Tk_OwnSelection procedure} {
} {}
# multiple display tests
-if {[info exists env(TK_ALT_DISPLAY)]} {
-
- test select-3.10 {Tk_OwnSelection procedure} {
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- list [selection own -displayof .f1] [selection own -displayof .f2]
- } {.f1 .f2}
- test select-3.11 {Tk_OwnSelection procedure} {
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- setupbg
- update
- set result ""
- lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection own .t; update"]
- lappend result [selection own -displayof .f1] \
+test select-3.10 {Tk_OwnSelection procedure} {altDisplay} {
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ list [selection own -displayof .f1] [selection own -displayof .f2]
+} {.f1 .f2}
+test select-3.11 {Tk_OwnSelection procedure} {altDisplay} {
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ setupbg
+ update
+ set result ""
+ lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection own .t; update"]
+ lappend result [selection own -displayof .f1] \
[selection own -displayof .f2]
- cleanupbg
- set result
- } {{} .f1 {}}
+ cleanupbg
+ set result
+} {{} .f1 {}}
-}
##############################################################################
test select-4.1 {Tk_ClearSelection procedure} {
@@ -333,38 +387,36 @@ test select-4.4 {Tk_ClearSelection procedure} {unixOnly} {
} {{} {}}
# multiple display tests
-if {[info exists env(TK_ALT_DISPLAY)]} {
- test select-4.5 {Tk_ClearSelection procedure} {
- global lostSel lostSel2
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- set lostSel {owned}
- set lostSel2 {owned2}
- selection own -command { set lostSel {lost1} } .f1
- selection own -command { set lostSel2 {lost2} } .f2
- update
- selection clear -displayof .f2
- update
- list $lostSel $lostSel2
- } {owned lost2}
- test select-4.6 {Tk_ClearSelection procedure} {unixOnly} {
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- setupbg
- set lostSel {owned}
- set lostSel2 {owned2}
- selection own -command { set lostSel {lost1} } .f1
- selection own -command { set lostSel2 {lost2} } .f2
- update
- set result ""
- lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection own .t; update"]
- lappend result [selection own -displayof .f1] \
+test select-4.5 {Tk_ClearSelection procedure} {altDisplay} {
+ global lostSel lostSel2
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ set lostSel {owned}
+ set lostSel2 {owned2}
+ selection own -command { set lostSel {lost1} } .f1
+ selection own -command { set lostSel2 {lost2} } .f2
+ update
+ selection clear -displayof .f2
+ update
+ list $lostSel $lostSel2
+} {owned lost2}
+test select-4.6 {Tk_ClearSelection procedure} {unixOnly altDisplay} {
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ setupbg
+ set lostSel {owned}
+ set lostSel2 {owned2}
+ selection own -command { set lostSel {lost1} } .f1
+ selection own -command { set lostSel2 {lost2} } .f2
+ update
+ set result ""
+ lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection own .t; update"]
+ lappend result [selection own -displayof .f1] \
[selection own -displayof .f2] $lostSel $lostSel2
- cleanupbg
- set result
- } {{} .f1 {} owned lost2}
+ cleanupbg
+ set result
+} {{} .f1 {} owned lost2}
-}
##############################################################################
test select-5.1 {Tk_GetSelection procedure} {
@@ -448,80 +500,76 @@ test select-5.10 {Tk_GetSelection procedure} {unixOnly} {
set selInfo ""
selection own .f1
set result ""
- fileevent $::tcltest::fd readable {}
- puts $::tcltest::fd {catch {selection get TEST} msg; update; puts $msg; flush stdout}
- flush $::tcltest::fd
- lappend result [gets $::tcltest::fd]
+ lappend result [dobg {selection get TEST} 1]
cleanupbg
lappend result $selInfo
} {{selection owner didn't respond} {}}
# multiple display tests
-if {[info exists env(TK_ALT_DISPLAY)]} {
- test select-5.11 {Tk_GetSelection procedure} {
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- selection handle -selection PRIMARY .f1 {handler TEST} TEST
- selection handle -selection PRIMARY .f2 {handler TEST2} TEST
- set selValue "Test value"
- set selInfo ""
- set result [list [selection get TEST] $selInfo]
- set selValue "Test value2"
- set selInfo ""
- lappend result [selection get -displayof .f2 TEST] $selInfo
- } {{Test value} {TEST 0 4000} {Test value2} {TEST2 0 4000}}
- test select-5.12 {Tk_GetSelection procedure} {
- global lostSel lostSel2
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- selection handle -selection PRIMARY .f1 {handler TEST} TEST
- selection handle -selection PRIMARY .f2 {} TEST
- set selValue "Test value"
- set selInfo ""
- set result [list [catch {selection get TEST} msg] $msg $selInfo]
- set selValue "Test value2"
- set selInfo ""
- lappend result [catch {selection get -displayof .f2 TEST} msg] $msg \
+
+test select-5.11 {Tk_GetSelection procedure} {altDisplay} {
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ selection handle -selection PRIMARY .f1 {handler TEST} TEST
+ selection handle -selection PRIMARY .f2 {handler TEST2} TEST
+ set selValue "Test value"
+ set selInfo ""
+ set result [list [selection get TEST] $selInfo]
+ set selValue "Test value2"
+ set selInfo ""
+ lappend result [selection get -displayof .f2 TEST] $selInfo
+} {{Test value} {TEST 0 4000} {Test value2} {TEST2 0 4000}}
+test select-5.12 {Tk_GetSelection procedure} {altDisplay} {
+ global lostSel lostSel2
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ selection handle -selection PRIMARY .f1 {handler TEST} TEST
+ selection handle -selection PRIMARY .f2 {} TEST
+ set selValue "Test value"
+ set selInfo ""
+ set result [list [catch {selection get TEST} msg] $msg $selInfo]
+ set selValue "Test value2"
+ set selInfo ""
+ lappend result [catch {selection get -displayof .f2 TEST} msg] $msg \
$selInfo
- } {0 {Test value} {TEST 0 4000} 1 {PRIMARY selection doesn't exist or form "TEST" not defined} {}}
- test select-5.13 {Tk_GetSelection procedure} {unixOnly} {
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- setupbg
- selection handle -selection PRIMARY .f1 {handler TEST} TEST
- selection own .f1
- selection handle -selection PRIMARY .f2 {handler TEST2} TEST
- selection own .f2
- set selValue "Test value"
- set selInfo ""
- update
- set result ""
- lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection get -displayof .t TEST"]
- set selValue "Test value2"
- lappend result [dobg "selection get TEST"]
- cleanupbg
- lappend result $selInfo
- } {{Test value} {Test value2} {TEST2 0 4000 TEST 0 4000}}
- test select-5.14 {Tk_GetSelection procedure} {unixOnly} {
- setup .f1
- setup .f2 $env(TK_ALT_DISPLAY)
- setupbg
- selection handle -selection PRIMARY .f1 {handler TEST} TEST
- selection own .f1
- selection handle -selection PRIMARY .f2 {} TEST
- selection own .f2
- set selValue "Test value"
- set selInfo ""
- update
- set result ""
- lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection get -displayof .t TEST"]
- set selValue "Test value2"
- lappend result [dobg "selection get TEST"]
- cleanupbg
- lappend result $selInfo
- } {{PRIMARY selection doesn't exist or form "TEST" not defined} {Test value2} {TEST 0 4000}}
+} {0 {Test value} {TEST 0 4000} 1 {PRIMARY selection doesn't exist or form "TEST" not defined} {}}
+test select-5.13 {Tk_GetSelection procedure} {unixOnly altDisplay} {
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ setupbg
+ selection handle -selection PRIMARY .f1 {handler TEST} TEST
+ selection own .f1
+ selection handle -selection PRIMARY .f2 {handler TEST2} TEST
+ selection own .f2
+ set selValue "Test value"
+ set selInfo ""
+ update
+ set result ""
+ lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection get -displayof .t TEST"]
+ set selValue "Test value2"
+ lappend result [dobg "selection get TEST"]
+ cleanupbg
+ lappend result $selInfo
+} {{Test value} {Test value2} {TEST2 0 4000 TEST 0 4000}}
+test select-5.14 {Tk_GetSelection procedure} {unixOnly altDisplay} {
+ setup .f1
+ setup .f2 $env(TK_ALT_DISPLAY)
+ setupbg
+ selection handle -selection PRIMARY .f1 {handler TEST} TEST
+ selection own .f1
+ selection handle -selection PRIMARY .f2 {} TEST
+ selection own .f2
+ set selValue "Test value"
+ set selInfo ""
+ update
+ set result ""
+ lappend result [dobg "toplevel .t -screen $env(TK_ALT_DISPLAY); wm geom .t +0+0; selection get -displayof .t TEST"]
+ set selValue "Test value2"
+ lappend result [dobg "selection get TEST"]
+ cleanupbg
+ lappend result $selInfo
+} {{PRIMARY selection doesn't exist or form "TEST" not defined} {Test value2} {TEST 0 4000}}
-}
##############################################################################
test select-6.1 {Tk_SelectionCmd procedure} {
@@ -555,10 +603,10 @@ test select-6.5 {Tk_SelectionCmd procedure} {
} {.f1 . .f1 {}}
test select-6.6 {Tk_SelectionCmd procedure} {
list [catch {selection clear -badopt foo} cmd] $cmd
-} {1 {unknown option "-badopt"}}
+} {1 {bad option "-badopt": must be -displayof or -selection}}
test select-6.7 {Tk_SelectionCmd procedure} {
list [catch {selection clear -selectionfoo foo} cmd] $cmd
-} {1 {unknown option "-selectionfoo"}}
+} {1 {bad option "-selectionfoo": must be -displayof or -selection}}
test select-6.8 {Tk_SelectionCmd procedure} {
catch {destroy .f2}
list [catch {selection clear -displayof .f2} cmd] $cmd
@@ -617,10 +665,10 @@ test select-6.16 {Tk_SelectionCmd procedure} {
} {{Test value} {TEST 0 4000}}
test select-6.17 {Tk_SelectionCmd procedure} {
list [catch {selection get -badopt foo} cmd] $cmd
-} {1 {unknown option "-badopt"}}
+} {1 {bad option "-badopt": must be -displayof, -selection, or -type}}
test select-6.18 {Tk_SelectionCmd procedure} {
list [catch {selection get -selectionfoo foo} cmd] $cmd
-} {1 {unknown option "-selectionfoo"}}
+} {1 {bad option "-selectionfoo": must be -displayof, -selection, or -type}}
test select-6.19 {Tk_SelectionCmd procedure} {
catch { destroy .f2 }
list [catch {selection get -displayof .f2} cmd] $cmd
@@ -652,10 +700,10 @@ test select-6.23 {Tk_SelectionCmd procedure} {
} {{} {Test value} {TEST 0 4000}}
test select-6.24 {Tk_SelectionCmd procedure} {
list [catch {selection handle -badopt foo} cmd] $cmd
-} {1 {unknown option "-badopt"}}
+} {1 {bad option "-badopt": must be -format, -selection, or -type}}
test select-6.25 {Tk_SelectionCmd procedure} {
list [catch {selection handle -selectionfoo foo} cmd] $cmd
-} {1 {unknown option "-selectionfoo"}}
+} {1 {bad option "-selectionfoo": must be -format, -selection, or -type}}
test select-6.26 {Tk_SelectionCmd procedure} {
list [catch {selection handle} cmd] $cmd
} {1 {wrong # args: should be "selection handle ?options? window command"}}
@@ -697,10 +745,10 @@ test select-6.33 {Tk_SelectionCmd procedure} {
} {owned lost}
test select-6.34 {Tk_SelectionCmd procedure} {
list [catch {selection own -badopt foo} cmd] $cmd
-} {1 {unknown option "-badopt"}}
+} {1 {bad option "-badopt": must be -command, -displayof, or -selection}}
test select-6.35 {Tk_SelectionCmd procedure} {
list [catch {selection own -selectionfoo foo} cmd] $cmd
-} {1 {unknown option "-selectionfoo"}}
+} {1 {bad option "-selectionfoo": must be -command, -displayof, or -selection}}
test select-6.36 {Tk_SelectionCmd procedure} {
catch {destroy .f2}
list [catch {selection own -displayof .f2} cmd] $cmd
@@ -808,19 +856,29 @@ test select-9.4 {SelCvtToX and SelCvtFromX procedures} {unixOnly} {
# most control paths have been exercised above
test select-10.1 {ConvertSelection procedure, race with selection clear} {unixOnly} {
setup
- setupbg
+ proc Ready {fd} {
+ variable x
+ lappend x [gets $fd]
+ }
+ set fd [open "|[list [interpreter] -geometry +0+0 -name tktest]" r+]
+ puts $fd "puts foo; flush stdout"
+ flush $fd
+ gets $fd
+ fileevent $fd readable [list Ready $fd]
set selValue "Just a simple test"
set selInfo ""
selection handle .f1 {handler STRING}
update
- puts $::tcltest::fd {puts "[catch {selection get} msg] $msg"; puts **DONE**; flush stdout}
- flush $::tcltest::fd
+ puts $fd {puts "[catch {selection get} msg] $msg"; puts **DONE**; flush stdout}
+ flush $fd
after 200
selection own .
- set ::tcltest::bgData {}
- tkwait variable ::tcltest::bgDone
- cleanupbg
- list $::tcltest::bgData $selInfo
+ set x {}
+ vwait [namespace which -variable x]
+ puts $fd {exit}
+ flush $fd
+ close $fd
+ lappend x $selInfo
} {{1 PRIMARY selection doesn't exist or form "STRING" not defined} {}}
test select-10.2 {ConvertSelection procedure} {unixOnly} {
setup
diff --git a/tk/tests/send.test b/tk/tests/send.test
index 30a7940469b..92bdb890ef7 100644
--- a/tk/tests/send.test
+++ b/tk/tests/send.test
@@ -5,57 +5,22 @@
# Copyright (c) 1994 Sun Microsystems, Inc.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
-# All rights reserved.
+# Copyright (c) 2001 by ActiveState Corporation.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {$tcl_platform(platform) == "macintosh"} {
- puts "send is not available on the Mac - skipping tests"
- ::tcltest::cleanupTests
- return
-}
-if {$tcl_platform(platform) == "window"} {
- puts "send is not available under Windows - skipping tests"
- ::tcltest::cleanupTests
- return
-}
-if {[auto_execok xhost] == ""} {
- puts "xhost application isn't available - skipping tests"
- ::tcltest::cleanupTests
- return
-}
-
-if {[info commands testsend] == "testsend"} {
- set gotTestCmds 1
-} else {
- set gotTestCmds 0
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
-
-# If send is disabled because of inadequate security, don't run any
-# of these tests at all.
-
-setupbg
-set app [dobg {tk appname}]
-if {[catch {send $app set a 0} msg] == 1} {
- if [string match "X server insecure *" $msg] {
- puts -nonewline "Your X server is insecure, so \"send\" can't be used;"
- puts " skipping \"send\" tests."
- cleanupbg
- ::tcltest::cleanupTests
- return
- }
-}
-cleanupbg
+testConstraint xhost [llength [auto_execok xhost]]
+testConstraint testsend [llength [info commands testsend]]
# Compute a script that will load Tk into a child interpreter.
@@ -76,7 +41,8 @@ proc newApp {screen name class} {
}
set name [tk appname]
-if $gotTestCmds {
+set commId ""
+catch {
set registry [testsend prop root InterpRegistry]
set commId [lindex [testsend prop root InterpRegistry] 0]
}
@@ -84,161 +50,160 @@ tk appname tktest
catch {send t_s_1 destroy .}
catch {send t_s_2 destroy .}
-if $gotTestCmds {
- test send-1.1 {RegOpen procedure, bogus property} {
- testsend bogus
- set result [winfo interps]
- tk appname tktest
- list $result [winfo interps]
- } {{} tktest}
- test send-1.2 {RegOpen procedure, bogus property} {
- testsend prop root InterpRegistry {}
- set result [winfo interps]
- tk appname tktest
- list $result [winfo interps]
- } {{} tktest}
- test send-1.3 {RegOpen procedure, bogus property} {
- testsend prop root InterpRegistry abcdefg
- tk appname tktest
- set x [testsend prop root InterpRegistry]
- string range $x [string first " " $x] end
- } " tktest\nabcdefg\n"
-
- frame .f -width 1 -height 1
- set id [string range [winfo id .f] 2 end]
- test send-2.1 {RegFindName procedure} {
- testsend prop root InterpRegistry {}
- list [catch {send foo bar} msg] $msg
- } {1 {no application named "foo"}}
- test send-2.2 {RegFindName procedure} {
- testsend prop root InterpRegistry " abc\n def\nghi\n\n$id foo\n"
- tk appname foo
- } {foo #2}
- test send-2.3 {RegFindName procedure} {
- testsend prop root InterpRegistry "gyz foo\n"
- tk appname foo
- } {foo}
- test send-2.4 {RegFindName procedure} {
- testsend prop root InterpRegistry "${id}z foo\n"
- tk appname foo
- } {foo}
-
- test send-3.1 {RegDeleteName procedure} {
- tk appname tktest
- testsend prop root InterpRegistry "012345 gorp\n12345 foo\n12345 tktest"
- tk appname x
- set x [testsend prop root InterpRegistry]
- string range $x [string first " " $x] end
- } " x\n012345 gorp\n12345 foo\n"
- test send-3.2 {RegDeleteName procedure} {
- tk appname tktest
- testsend prop root InterpRegistry "012345 gorp\n12345 tktest\n23456 tktest"
- tk appname x
- set x [testsend prop root InterpRegistry]
- string range $x [string first " " $x] end
- } " x\n012345 gorp\n23456 tktest\n"
- test send-3.3 {RegDeleteName procedure} {
- tk appname tktest
- testsend prop root InterpRegistry "012345 tktest\n12345 bar\n23456 tktest"
- tk appname x
- set x [testsend prop root InterpRegistry]
- string range $x [string first " " $x] end
- } " x\n12345 bar\n23456 tktest\n"
- test send-3.4 {RegDeleteName procedure} {
- tk appname tktest
- testsend prop root InterpRegistry "foo"
- tk appname x
- set x [testsend prop root InterpRegistry]
- string range $x [string first " " $x] end
- } " x\nfoo\n"
- test send-3.5 {RegDeleteName procedure} {
- tk appname tktest
- testsend prop root InterpRegistry ""
- tk appname x
- set x [testsend prop root InterpRegistry]
- string range $x [string first " " $x] end
- } " x\n"
-
- test send-4.1 {RegAddName procedure} {
- testsend prop root InterpRegistry ""
- tk appname bar
- testsend prop root InterpRegistry
- } "$commId bar\n"
- test send-4.2 {RegAddName procedure} {
- testsend prop root InterpRegistry "abc def"
- tk appname bar
- tk appname foo
- testsend prop root InterpRegistry
- } "$commId foo\nabc def\n"
-
- # Previous checks should already cover the Regclose procedure.
-
- test send-5.1 {ValidateName procedure} {
- testsend prop root InterpRegistry "123 abc\n"
- winfo interps
- } {}
- test send-5.2 {ValidateName procedure} {
- testsend prop root InterpRegistry "$id Hi there"
- winfo interps
- } {{Hi there}}
- test send-5.3 {ValidateName procedure} {
- testsend prop root InterpRegistry "$id Bogus"
- list [catch {send Bogus set a 44} msg] $msg
- } {1 {target application died or uses a Tk version before 4.0}}
- test send-5.4 {ValidateName procedure} {
- tk appname test
- testsend prop root InterpRegistry "$commId Bogus\n$commId test\n"
- winfo interps
- } {test}
-}
+test send-1.1 {RegOpen procedure, bogus property} {secureserver testsend} {
+ testsend bogus
+ set result [winfo interps]
+ tk appname tktest
+ list $result [winfo interps]
+} {{} tktest}
+test send-1.2 {RegOpen procedure, bogus property} {secureserver testsend} {
+ testsend prop root InterpRegistry {}
+ set result [winfo interps]
+ tk appname tktest
+ list $result [winfo interps]
+} {{} tktest}
+test send-1.3 {RegOpen procedure, bogus property} {secureserver testsend} {
+ testsend prop root InterpRegistry abcdefg
+ tk appname tktest
+ set x [testsend prop root InterpRegistry]
+ string range $x [string first " " $x] end
+} " tktest\nabcdefg\n"
-winfo interps
-tk appname tktest
-update
-setupbg
-set x [split [exec xhost] \n]
-foreach i [lrange $x 1 end] {
- exec xhost - $i
+frame .f -width 1 -height 1
+set id [string range [winfo id .f] 2 end]
+test send-2.1 {RegFindName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry {}
+ list [catch {send foo bar} msg] $msg
+} {1 {no application named "foo"}}
+test send-2.2 {RegFindName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry " abc\n def\nghi\n\n$id foo\n"
+ tk appname foo
+} {foo #2}
+test send-2.3 {RegFindName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry "gyz foo\n"
+ tk appname foo
+} {foo}
+test send-2.4 {RegFindName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry "${id}z foo\n"
+ tk appname foo
+} {foo}
+
+test send-3.1 {RegDeleteName procedure} {secureserver testsend} {
+ tk appname tktest
+ testsend prop root InterpRegistry "012345 gorp\n12345 foo\n12345 tktest"
+ tk appname x
+ set x [testsend prop root InterpRegistry]
+ string range $x [string first " " $x] end
+} " x\n012345 gorp\n12345 foo\n"
+test send-3.2 {RegDeleteName procedure} {secureserver testsend} {
+ tk appname tktest
+ testsend prop root InterpRegistry "012345 gorp\n12345 tktest\n23456 tktest"
+ tk appname x
+ set x [testsend prop root InterpRegistry]
+ string range $x [string first " " $x] end
+} " x\n012345 gorp\n23456 tktest\n"
+test send-3.3 {RegDeleteName procedure} {secureserver testsend} {
+ tk appname tktest
+ testsend prop root InterpRegistry "012345 tktest\n12345 bar\n23456 tktest"
+ tk appname x
+ set x [testsend prop root InterpRegistry]
+ string range $x [string first " " $x] end
+} " x\n12345 bar\n23456 tktest\n"
+test send-3.4 {RegDeleteName procedure} {secureserver testsend} {
+ tk appname tktest
+ testsend prop root InterpRegistry "foo"
+ tk appname x
+ set x [testsend prop root InterpRegistry]
+ string range $x [string first " " $x] end
+} " x\nfoo\n"
+test send-3.5 {RegDeleteName procedure} {secureserver testsend} {
+ tk appname tktest
+ testsend prop root InterpRegistry ""
+ tk appname x
+ set x [testsend prop root InterpRegistry]
+ string range $x [string first " " $x] end
+} " x\n"
+
+test send-4.1 {RegAddName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry ""
+ tk appname bar
+ testsend prop root InterpRegistry
+} "$commId bar\n"
+test send-4.2 {RegAddName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry "abc def"
+ tk appname bar
+ tk appname foo
+ testsend prop root InterpRegistry
+} "$commId foo\nabc def\n"
+
+# Previous checks should already cover the Regclose procedure.
+
+test send-5.1 {ValidateName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry "123 abc\n"
+ winfo interps
+} {}
+test send-5.2 {ValidateName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry "$id Hi there"
+ winfo interps
+} {{Hi there}}
+test send-5.3 {ValidateName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry "$id Bogus"
+ list [catch {send Bogus set a 44} msg] $msg
+} {1 {target application died or uses a Tk version before 4.0}}
+test send-5.4 {ValidateName procedure} {secureserver testsend} {
+ tk appname test
+ testsend prop root InterpRegistry "$commId Bogus\n$commId test\n"
+ winfo interps
+} {test}
+
+if {[testConstraint xhost]} {
+ winfo interps
+ tk appname tktest
+ update
+ setupbg
+ set x [split [exec xhost] \n]
+ foreach i [lrange $x 1 end] {
+ exec xhost - $i
+ }
}
-test send-6.1 {ServerSecure procedure} {nonPortable} {
+
+test send-6.1 {ServerSecure procedure} {nonPortable secureserver} {
set a 44
list [dobg [list send [tk appname] set a 55]] $a
} {55 55}
-test send-6.2 {ServerSecure procedure} {nonPortable} {
+test send-6.2 {ServerSecure procedure} {nonPortable secureserver} {
set a 22
exec xhost [exec hostname]
list [catch {dobg [list send [tk appname] set a 33]} msg] $a $msg
} {0 22 {X server insecure (must use xauth-style authorization); command ignored}}
-test send-6.3 {ServerSecure procedure} {nonPortable} {
+test send-6.3 {ServerSecure procedure} {nonPortable secureserver} {
set a abc
exec xhost - [exec hostname]
list [dobg [list send [tk appname] set a new]] $a
} {new new}
cleanupbg
-if $gotTestCmds {
- test send-7.1 {Tk_SetAppName procedure} {
- testsend prop root InterpRegistry ""
- tk appname newName
- list [tk appname oldName] [testsend prop root InterpRegistry]
- } "oldName {$commId oldName\n}"
- test send-7.2 {Tk_SetAppName procedure, name not in use} {
- testsend prop root InterpRegistry ""
- list [tk appname gorp] [testsend prop root InterpRegistry]
- } "gorp {$commId gorp\n}"
- test send-7.3 {Tk_SetAppName procedure, name in use by us} {
- tk appname name1
- testsend prop root InterpRegistry "$commId name2\n"
- list [tk appname name2] [testsend prop root InterpRegistry]
- } "name2 {$commId name2\n}"
- test send-7.4 {Tk_SetAppName procedure, name in use} {
- tk appname name1
- testsend prop root InterpRegistry "$id foo\n$id foo #2\n$id foo #3\n"
- list [tk appname foo] [testsend prop root InterpRegistry]
- } "{foo #4} {$commId foo #4\n$id foo\n$id foo #2\n$id foo #3\n}"
-}
-
-test send-8.1 {Tk_SendCmd procedure, options} {
+test send-7.1 {Tk_SetAppName procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry ""
+ tk appname newName
+ list [tk appname oldName] [testsend prop root InterpRegistry]
+} "oldName {$commId oldName\n}"
+test send-7.2 {Tk_SetAppName procedure, name not in use} {secureserver testsend} {
+ testsend prop root InterpRegistry ""
+ list [tk appname gorp] [testsend prop root InterpRegistry]
+} "gorp {$commId gorp\n}"
+test send-7.3 {Tk_SetAppName procedure, name in use by us} {secureserver testsend} {
+ tk appname name1
+ testsend prop root InterpRegistry "$commId name2\n"
+ list [tk appname name2] [testsend prop root InterpRegistry]
+} "name2 {$commId name2\n}"
+test send-7.4 {Tk_SetAppName procedure, name in use} {secureserver testsend} {
+ tk appname name1
+ testsend prop root InterpRegistry "$id foo\n$id foo #2\n$id foo #3\n"
+ list [tk appname foo] [testsend prop root InterpRegistry]
+} "{foo #4} {$commId foo #4\n$id foo\n$id foo #2\n$id foo #3\n}"
+
+test send-8.1 {Tk_SendCmd procedure, options} {secureserver} {
setupbg
set app [dobg {tk appname}]
set a 66
@@ -249,45 +214,43 @@ test send-8.1 {Tk_SendCmd procedure, options} {
cleanupbg
lappend result $a
} {66 77}
-if [info exists env(TK_ALT_DISPLAY)] {
- test send-8.2 {Tk_SendCmd procedure, options} {
- setupbg -display $env(TK_ALT_DISPLAY)
- tk appname xyzgorp
- set a homeDisplay
- set result [dobg "
- toplevel .t -screen [winfo screen .]
- wm geometry .t +0+0
- set a altDisplay
- tk appname xyzgorp
- list \[send xyzgorp set a\] \[send -displayof .t xyzgorp set a\]
- "]
- cleanupbg
- set result
- } {altDisplay homeDisplay}
-}
-test send-8.3 {Tk_SendCmd procedure, options} {
+test send-8.2 {Tk_SendCmd procedure, options} {secureserver altDisplay} {
+ setupbg -display $env(TK_ALT_DISPLAY)
+ tk appname xyzgorp
+ set a homeDisplay
+ set result [dobg "
+ toplevel .t -screen [winfo screen .]
+ wm geometry .t +0+0
+ set a altDisplay
+ tk appname xyzgorp
+ list \[send xyzgorp set a\] \[send -displayof .t xyzgorp set a\]
+ "]
+ cleanupbg
+ set result
+} {altDisplay homeDisplay}
+test send-8.3 {Tk_SendCmd procedure, options} {secureserver} {
list [catch {send -- -async foo bar baz} msg] $msg
} {1 {no application named "-async"}}
-test send-8.4 {Tk_SendCmd procedure, options} {
+test send-8.4 {Tk_SendCmd procedure, options} {secureserver} {
list [catch {send -gorp foo bar baz} msg] $msg
} {1 {bad option "-gorp": must be -async, -displayof, or --}}
-test send-8.5 {Tk_SendCmd procedure, options} {
+test send-8.5 {Tk_SendCmd procedure, options} {secureserver} {
list [catch {send -async foo} msg] $msg
} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}}
-test send-8.6 {Tk_SendCmd procedure, options} {
+test send-8.6 {Tk_SendCmd procedure, options} {secureserver} {
list [catch {send foo} msg] $msg
} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}}
-test send-8.7 {Tk_SendCmd procedure, local execution} {
+test send-8.7 {Tk_SendCmd procedure, local execution} {secureserver} {
set a initial
send [tk appname] {set a new}
set a
} {new}
-test send-8.8 {Tk_SendCmd procedure, local execution} {
+test send-8.8 {Tk_SendCmd procedure, local execution} {secureserver} {
set a initial
send [tk appname] set a new
set a
} {new}
-test send-8.9 {Tk_SendCmd procedure, local execution} {
+test send-8.9 {Tk_SendCmd procedure, local execution} {secureserver} {
set a initial
string tolower [list [catch {send [tk appname] open bad_file} msg] \
$msg $errorInfo $errorCode]
@@ -296,52 +259,58 @@ test send-8.9 {Tk_SendCmd procedure, local execution} {
"open bad_file"
invoked from within
"send [tk appname] open bad_file"} {posix enoent {no such file or directory}}}
-test send-8.10 {Tk_SendCmd procedure, no such interpreter} {
+test send-8.10 {Tk_SendCmd procedure, no such interpreter} {secureserver} {
list [catch {send bogus_name bogus_command} msg] $msg
} {1 {no application named "bogus_name"}}
-if $gotTestCmds {
+
+catch {
newApp "" t_s_1 Test
t_s_1 eval wm withdraw .
- test send-8.11 {Tk_SendCmd procedure, local execution, different interp} {
- set a us
- send t_s_1 set a them
- list $a [send t_s_1 set a]
- } {us them}
- test send-8.12 {Tk_SendCmd procedure, local execution, different interp} {
- set a us
- send t_s_1 {set a them}
- list $a [send t_s_1 {set a}]
- } {us them}
- test send-8.13 {Tk_SendCmd procedure, local execution, different interp} {
- set a us
- send t_s_1 {set a them}
- list $a [send t_s_1 {set a}]
- } {us them}
- test send-8.14 {Tk_SendCmd procedure, local interp killed by send} {
- newApp "" t_s_2 Test
- list [catch {send t_s_2 {destroy .; concat result}} msg] $msg
- } {0 result}
- interp delete t_s_2
- test send-8.15 {Tk_SendCmd procedure, local interp, error info} {
- catch {error foo}
- list [catch {send t_s_1 {if 1 {open bogus_file_name}}} msg] $msg $errorInfo $errorCode
- } {1 {couldn't open "bogus_file_name": no such file or directory} {couldn't open "bogus_file_name": no such file or directory
+}
+
+test send-8.11 {Tk_SendCmd procedure, local execution, different interp} {secureserver testsend} {
+ set a us
+ send t_s_1 set a them
+ list $a [send t_s_1 set a]
+} {us them}
+test send-8.12 {Tk_SendCmd procedure, local execution, different interp} {secureserver testsend} {
+ set a us
+ send t_s_1 {set a them}
+ list $a [send t_s_1 {set a}]
+} {us them}
+test send-8.13 {Tk_SendCmd procedure, local execution, different interp} {secureserver testsend} {
+ set a us
+ send t_s_1 {set a them}
+ list $a [send t_s_1 {set a}]
+} {us them}
+test send-8.14 {Tk_SendCmd procedure, local interp killed by send} {secureserver testsend} {
+ newApp "" t_s_2 Test
+ list [catch {send t_s_2 {destroy .; concat result}} msg] $msg
+} {0 result}
+
+catch {interp delete t_s_2}
+
+test send-8.15 {Tk_SendCmd procedure, local interp, error info} {secureserver testsend} {
+ catch {error foo}
+ list [catch {send t_s_1 {if 1 {open bogus_file_name}}} msg] $msg $errorInfo $errorCode
+} {1 {couldn't open "bogus_file_name": no such file or directory} {couldn't open "bogus_file_name": no such file or directory
while executing
"open bogus_file_name"
invoked from within
"if 1 {open bogus_file_name}"
invoked from within
"send t_s_1 {if 1 {open bogus_file_name}}"} {POSIX ENOENT {no such file or directory}}}
- test send-8.16 {Tk_SendCmd procedure, bogusCommWindow} {
- testsend prop root InterpRegistry "10234 bogus\n"
- set result [list [catch {send bogus bogus command} msg] $msg]
- winfo interps
- tk appname tktest
- set result
- } {1 {no application named "bogus"}}
- interp delete t_s_1
-}
-test send-8.17 {Tk_SendCmd procedure, deferring events} {nonPortable} {
+test send-8.16 {Tk_SendCmd procedure, bogusCommWindow} {secureserver testsend} {
+ testsend prop root InterpRegistry "10234 bogus\n"
+ set result [list [catch {send bogus bogus command} msg] $msg]
+ winfo interps
+ tk appname tktest
+ set result
+} {1 {no application named "bogus"}}
+
+catch {interp delete t_s_1}
+
+test send-8.17 {Tk_SendCmd procedure, deferring events} {secureserver nonPortable} {
# Non-portable because some window managers ignore "raise"
# requests so can't guarantee that new app's window won't
# obscure .f, thereby masking the Expose event.
@@ -361,7 +330,7 @@ test send-8.17 {Tk_SendCmd procedure, deferring events} {nonPortable} {
cleanupbg
lappend result $a
} {{no event yet} {no event yet} exposed}
-test send-8.18 {Tk_SendCmd procedure, error in remote app} {
+test send-8.18 {Tk_SendCmd procedure, error in remote app} {secureserver} {
setupbg
set app [dobg {tk appname}]
set result [string tolower [list [catch {send $app open bad_name} msg] \
@@ -373,7 +342,7 @@ test send-8.18 {Tk_SendCmd procedure, error in remote app} {
"open bad_name"
invoked from within
"send $app open bad_name"} {posix enoent {no such file or directory}}}
-test send-8.19 {Tk_SendCmd, using modal timeouts} {
+test send-8.19 {Tk_SendCmd, using modal timeouts} {secureserver} {
setupbg
set app [dobg {tk appname}]
set x no
@@ -390,74 +359,75 @@ tk appname tktest
catch {destroy .f}
frame .f
set id [string range [winfo id .f] 2 end]
-if $gotTestCmds {
- test send-9.1 {Tk_GetInterpNames procedure} {
- testsend prop root InterpRegistry \
- "$commId tktest\nfoo bar\n$commId tktest\n$id frame .f\n\n\n"
- list [winfo interps] [testsend prop root InterpRegistry]
- } "{tktest tktest {frame .f}} {$commId tktest\n$commId tktest\n$id frame .f
+
+test send-9.1 {Tk_GetInterpNames procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry \
+ "$commId tktest\nfoo bar\n$commId tktest\n$id frame .f\n\n\n"
+ list [winfo interps] [testsend prop root InterpRegistry]
+} "{tktest tktest {frame .f}} {$commId tktest\n$commId tktest\n$id frame .f
}"
- test send-9.2 {Tk_GetInterpNames procedure} {
- testsend prop root InterpRegistry \
- "$commId tktest\nfoobar\n$commId gorp\n"
- list [winfo interps] [testsend prop root InterpRegistry]
- } "tktest {$commId tktest\n}"
- test send-9.3 {Tk_GetInterpNames procedure} {
- testsend prop root InterpRegistry {}
- list [winfo interps] [testsend prop root InterpRegistry]
- } {{} {}}
-
- testsend prop root InterpRegistry "$commId tktest\n$id dummy\n"
- test send-10.1 {SendEventProc procedure, bogus comm property} {
- testsend prop comm Comm {abc def}
- testsend prop comm Comm {}
- update
- } {}
- test send-10.2 {SendEventProc procedure, simultaneous messages} {
- testsend prop comm Comm \
- "c\n-n tktest\n-s set a 44\nc\n-n tktest\n-s set b 45\n"
- set a null
- set b xyzzy
- update
- list $a $b
- } {44 45}
- test send-10.3 {SendEventProc procedure, simultaneous messages} {
- testsend prop comm Comm \
- "c\n-n tktest\n-s set a newA\nr\n-s [testsend serial]\n-r 12345\nc\n-n tktest\n-s set b newB\n"
- set a null
- set b xyzzy
- set x [send dummy bogus]
- list $x $a $b
- } {12345 newA newB}
- test send-10.4 {SendEventProc procedure, leading nulls, bogus commands} {
- testsend prop comm Comm \
- "\n\nx\n-bogus\n\nc\n-n tktest\n-s set a 44\n"
- set a null
- update
- set a
- } {44}
- test send-10.5 {SendEventProc procedure, extraneous command options} {
- testsend prop comm Comm \
- "c\n-n tktest\n-x miscellanous\n-y who knows?\n-s set a new\n"
- set a null
- update
- set a
- } {new}
- test send-10.6 {SendEventProc procedure, unknown interpreter} {
- testsend prop [winfo id .f] Comm {}
- testsend prop comm Comm \
- "c\n-n unknown\n-r $id 44\n-s set a new\n"
- set a null
- update
- list [testsend prop [winfo id .f] Comm] $a
- } "{\nr\n-s 44\n-r receiver never heard of interpreter \"unknown\"\n-c 1\n} null"
- test send-10.7 {SendEventProc procedure, error in script} {
- testsend prop [winfo id .f] Comm {}
- testsend prop comm Comm \
- "c\n-n tktest\n-r $id 62\n-s foreach i {1 2 3} {error {test error} {Initial errorInfo} {test code}}\n"
- update
- testsend prop [winfo id .f] Comm
- } {
+test send-9.2 {Tk_GetInterpNames procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry \
+ "$commId tktest\nfoobar\n$commId gorp\n"
+ list [winfo interps] [testsend prop root InterpRegistry]
+} "tktest {$commId tktest\n}"
+test send-9.3 {Tk_GetInterpNames procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry {}
+ list [winfo interps] [testsend prop root InterpRegistry]
+} {{} {}}
+
+catch {testsend prop root InterpRegistry "$commId tktest\n$id dummy\n"}
+
+test send-10.1 {SendEventProc procedure, bogus comm property} {secureserver testsend} {
+ testsend prop comm Comm {abc def}
+ testsend prop comm Comm {}
+ update
+} {}
+test send-10.2 {SendEventProc procedure, simultaneous messages} {secureserver testsend} {
+ testsend prop comm Comm \
+ "c\n-n tktest\n-s set a 44\nc\n-n tktest\n-s set b 45\n"
+ set a null
+ set b xyzzy
+ update
+ list $a $b
+} {44 45}
+test send-10.3 {SendEventProc procedure, simultaneous messages} {secureserver testsend} {
+ testsend prop comm Comm \
+ "c\n-n tktest\n-s set a newA\nr\n-s [testsend serial]\n-r 12345\nc\n-n tktest\n-s set b newB\n"
+ set a null
+ set b xyzzy
+ set x [send dummy bogus]
+ list $x $a $b
+} {12345 newA newB}
+test send-10.4 {SendEventProc procedure, leading nulls, bogus commands} {secureserver testsend} {
+ testsend prop comm Comm \
+ "\n\nx\n-bogus\n\nc\n-n tktest\n-s set a 44\n"
+ set a null
+ update
+ set a
+} {44}
+test send-10.5 {SendEventProc procedure, extraneous command options} {secureserver testsend} {
+ testsend prop comm Comm \
+ "c\n-n tktest\n-x miscellanous\n-y who knows?\n-s set a new\n"
+ set a null
+ update
+ set a
+} {new}
+test send-10.6 {SendEventProc procedure, unknown interpreter} {secureserver testsend} {
+ testsend prop [winfo id .f] Comm {}
+ testsend prop comm Comm \
+ "c\n-n unknown\n-r $id 44\n-s set a new\n"
+ set a null
+ update
+ list [testsend prop [winfo id .f] Comm] $a
+} "{\nr\n-s 44\n-r receiver never heard of interpreter \"unknown\"\n-c 1\n} null"
+test send-10.7 {SendEventProc procedure, error in script} {secureserver testsend} {
+ testsend prop [winfo id .f] Comm {}
+ testsend prop comm Comm \
+ "c\n-n tktest\n-r $id 62\n-s foreach i {1 2 3} {error {test error} {Initial errorInfo} {test code}}\n"
+ update
+ testsend prop [winfo id .f] Comm
+} {
r
-s 62
-r test error
@@ -468,143 +438,141 @@ r
-e test code
-c 1
}
- test send-10.8 {SendEventProc procedure, exceptional return} {
- testsend prop [winfo id .f] Comm {}
- testsend prop comm Comm \
- "c\n-n tktest\n-r $id 62\n-s break\n"
- update
- testsend prop [winfo id .f] Comm
- } {
+test send-10.8 {SendEventProc procedure, exceptional return} {secureserver testsend} {
+ testsend prop [winfo id .f] Comm {}
+ testsend prop comm Comm \
+ "c\n-n tktest\n-r $id 62\n-s break\n"
+ update
+ testsend prop [winfo id .f] Comm
+} {
r
-s 62
-r
-c 3
}
- test send-10.9 {SendEventProc procedure, empty return} {
- testsend prop [winfo id .f] Comm {}
- testsend prop comm Comm \
- "c\n-n tktest\n-r $id 62\n-s concat\n"
- update
- testsend prop [winfo id .f] Comm
- } {
+test send-10.9 {SendEventProc procedure, empty return} {secureserver testsend} {
+ testsend prop [winfo id .f] Comm {}
+ testsend prop comm Comm \
+ "c\n-n tktest\n-r $id 62\n-s concat\n"
+ update
+ testsend prop [winfo id .f] Comm
+} {
r
-s 62
-r
}
- test send-10.10 {SendEventProc procedure, asynchronous calls} {
- testsend prop [winfo id .f] Comm {}
- testsend prop comm Comm \
- "c\n-n tktest\n-s foreach i {1 2 3} {error {test error} {Initial errorInfo} {test code}}\n"
- update
- testsend prop [winfo id .f] Comm
- } {}
- test send-10.11 {SendEventProc procedure, exceptional return} {
- testsend prop [winfo id .f] Comm {}
- testsend prop comm Comm \
- "c\n-n tktest\n-s break\n"
- update
- testsend prop [winfo id .f] Comm
- } {}
- test send-10.12 {SendEventProc procedure, empty return} {
- testsend prop [winfo id .f] Comm {}
- testsend prop comm Comm \
- "c\n-n tktest\n-s concat\n"
- update
- testsend prop [winfo id .f] Comm
- } {}
- test send-10.13 {SendEventProc procedure, return processing} {
- testsend prop comm Comm \
- "r\n-c 1\n-e test1\n-i test2\n-r test3\n-s [testsend serial]\n"
- list [catch {send dummy foo} msg] $msg $errorInfo $errorCode
- } {1 test3 {test2
+test send-10.10 {SendEventProc procedure, asynchronous calls} {secureserver testsend} {
+ testsend prop [winfo id .f] Comm {}
+ testsend prop comm Comm \
+ "c\n-n tktest\n-s foreach i {1 2 3} {error {test error} {Initial errorInfo} {test code}}\n"
+ update
+ testsend prop [winfo id .f] Comm
+} {}
+test send-10.11 {SendEventProc procedure, exceptional return} {secureserver testsend} {
+ testsend prop [winfo id .f] Comm {}
+ testsend prop comm Comm \
+ "c\n-n tktest\n-s break\n"
+ update
+ testsend prop [winfo id .f] Comm
+} {}
+test send-10.12 {SendEventProc procedure, empty return} {secureserver testsend} {
+ testsend prop [winfo id .f] Comm {}
+ testsend prop comm Comm \
+ "c\n-n tktest\n-s concat\n"
+ update
+ testsend prop [winfo id .f] Comm
+} {}
+test send-10.13 {SendEventProc procedure, return processing} {secureserver testsend} {
+ testsend prop comm Comm \
+ "r\n-c 1\n-e test1\n-i test2\n-r test3\n-s [testsend serial]\n"
+ list [catch {send dummy foo} msg] $msg $errorInfo $errorCode
+} {1 test3 {test2
invoked from within
"send dummy foo"} test1}
- test send-10.14 {SendEventProc procedure, extraneous return options} {
- testsend prop comm Comm \
- "r\n-x test1\n-y test2\n-r result\n-s [testsend serial]\n"
- list [catch {send dummy foo} msg] $msg
- } {0 result}
- test send-10.15 {SendEventProc procedure, serial number} {
- testsend prop comm Comm \
- "r\n-r response\n"
- list [catch {send dummy foo} msg] $msg
- } {1 {target application died or uses a Tk version before 4.0}}
- test send-10.16 {SendEventProc procedure, serial number} {
- testsend prop comm Comm \
- "r\n-r response\n\n-s 0"
- list [catch {send dummy foo} msg] $msg
- } {1 {target application died or uses a Tk version before 4.0}}
- test send-10.17 {SendEventProc procedure, errorCode and errorInfo} {
- testsend prop comm Comm \
- "r\n-i test1\n-e test2\n-c 4\n-s [testsend serial]\n"
- set errorCode oldErrorCode
- set errorInfo oldErrorInfo
- list [catch {send dummy foo} msg] $msg $errorInfo $errorCode
- } {4 {} oldErrorInfo oldErrorCode}
- test send-10.18 {SendEventProc procedure, send kills application} {
- setupbg
- dobg {tk appname t_s_3}
- set x [list [catch {send t_s_3 destroy .} msg] $msg]
- cleanupbg
- set x
- } {0 {}}
- test send-10.19 {SendEventProc procedure, send exits} {
- setupbg
- dobg {tk appname t_s_3}
- set x [list [catch {send t_s_3 exit} msg] $msg]
- close $::tcltest::fd
- set x
- } {1 {target application died}}
-
- test send-11.1 {AppendPropCarefully and AppendErrorProc procedures} {
- testsend prop root InterpRegistry "0x21447 dummy\n"
- list [catch {send dummy foo} msg] $msg
- } {1 {no application named "dummy"}}
- test send-11.2 {AppendPropCarefully and AppendErrorProc procedures} {
- testsend prop comm Comm "c\n-r0x123 44\n-n tktest\n-s concat a b c\n"
- update
- } {}
-}
+test send-10.14 {SendEventProc procedure, extraneous return options} {secureserver testsend} {
+ testsend prop comm Comm \
+ "r\n-x test1\n-y test2\n-r result\n-s [testsend serial]\n"
+ list [catch {send dummy foo} msg] $msg
+} {0 result}
+test send-10.15 {SendEventProc procedure, serial number} {secureserver testsend} {
+ testsend prop comm Comm \
+ "r\n-r response\n"
+ list [catch {send dummy foo} msg] $msg
+} {1 {target application died or uses a Tk version before 4.0}}
+test send-10.16 {SendEventProc procedure, serial number} {secureserver testsend} {
+ testsend prop comm Comm \
+ "r\n-r response\n\n-s 0"
+ list [catch {send dummy foo} msg] $msg
+} {1 {target application died or uses a Tk version before 4.0}}
+test send-10.17 {SendEventProc procedure, errorCode and errorInfo} {secureserver testsend} {
+ testsend prop comm Comm \
+ "r\n-i test1\n-e test2\n-c 4\n-s [testsend serial]\n"
+ set errorCode oldErrorCode
+ set errorInfo oldErrorInfo
+ list [catch {send dummy foo} msg] $msg $errorInfo $errorCode
+} {4 {} oldErrorInfo oldErrorCode}
+test send-10.18 {SendEventProc procedure, send kills application} {secureserver testsend} {
+ setupbg
+ dobg {tk appname t_s_3}
+ set x [list [catch {send t_s_3 destroy .} msg] $msg]
+ cleanupbg
+ set x
+} {0 {}}
+test send-10.19 {SendEventProc procedure, send exits} {secureserver testsend} {
+ setupbg
+ dobg {tk appname t_s_3}
+ set x [list [catch {send t_s_3 exit} msg] $msg]
+ cleanupbg
+ set x
+} {1 {target application died}}
+
+test send-11.1 {AppendPropCarefully and AppendErrorProc procedures} {secureserver testsend} {
+ testsend prop root InterpRegistry "0x21447 dummy\n"
+ list [catch {send dummy foo} msg] $msg
+} {1 {no application named "dummy"}}
+test send-11.2 {AppendPropCarefully and AppendErrorProc procedures} {secureserver testsend} {
+ testsend prop comm Comm "c\n-r0x123 44\n-n tktest\n-s concat a b c\n"
+ update
+} {}
winfo interps
tk appname tktest
catch {destroy .f}
frame .f
set id [string range [winfo id .f] 2 end]
-if $gotTestCmds {
- test send-12.1 {TimeoutProc procedure} {
- testsend prop root InterpRegistry "$id dummy\n"
- list [catch {send dummy foo} msg] $msg
- } {1 {target application died or uses a Tk version before 4.0}}
- testsend prop root InterpRegistry ""
-}
-test send-12.2 {TimeoutProc procedure} {
+
+test send-12.1 {TimeoutProc procedure} {secureserver testsend} {
+ testsend prop root InterpRegistry "$id dummy\n"
+ list [catch {send dummy foo} msg] $msg
+} {1 {target application died or uses a Tk version before 4.0}}
+
+catch {testsend prop root InterpRegistry ""}
+
+test send-12.2 {TimeoutProc procedure} {secureserver} {
winfo interps
tk appname tktest
update
setupbg
- puts $::tcltest::fd {after 10 {after 5000; exit}; puts [tk appname]; puts **DONE**; flush stdout}
- set ::tcltest::bgDone 0
- set ::tcltest::bgData {}
- flush $::tcltest::fd
- tkwait variable ::tcltest::bgDone
- set app $::tcltest::bgData
+ set app [dobg {
+ after 10 {after 10 {after 5000; exit}}
+ tk appname
+ }]
after 200
set result [list [catch {send $app foo} msg] $msg]
- close $::tcltest::fd
+ cleanupbg
set result
} {1 {target application died}}
winfo interps
tk appname tktest
-test send-13.1 {DeleteProc procedure} {
+test send-13.1 {DeleteProc procedure} {secureserver} {
setupbg
set app [dobg {rename send {}; tk appname}]
set result [list [catch {send $app foo} msg] $msg [winfo interps]]
cleanupbg
set result
} {1 {no application named "tktest #2"} tktest}
-test send-13.2 {DeleteProc procedure} {
+test send-13.2 {DeleteProc procedure} {secureserver} {
winfo interps
tk appname tktest
rename send {}
@@ -614,49 +582,45 @@ test send-13.2 {DeleteProc procedure} {
lappend result [winfo interps] [info commands send]
} {{} {} foo send}
-if [info exists env(TK_ALT_DISPLAY)] {
- test send-14.1 {SendRestrictProc procedure, sends crossing from different displays} {
- setupbg -display $env(TK_ALT_DISPLAY)
- set result [dobg "
- toplevel .t -screen [winfo screen .]
- wm geometry .t +0+0
- tk appname xyzgorp1
- set x child
- "]
- toplevel .t -screen $env(TK_ALT_DISPLAY)
- wm geometry .t +0+0
- tk appname xyzgorp2
- update
- set y parent
- set result [send -displayof .t xyzgorp1 {list $x [send -displayof .t xyzgorp2 set y]}]
- destroy .t
- cleanupbg
- set result
- } {child parent}
-}
+test send-14.1 {SendRestrictProc procedure, sends crossing from different displays} {secureserver altDisplay} {
+ setupbg -display $env(TK_ALT_DISPLAY)
+ set result [dobg "
+ toplevel .t -screen [winfo screen .]
+ wm geometry .t +0+0
+ tk appname xyzgorp1
+ set x child
+ "]
+ toplevel .t -screen $env(TK_ALT_DISPLAY)
+ wm geometry .t +0+0
+ tk appname xyzgorp2
+ update
+ set y parent
+ set result [send -displayof .t xyzgorp1 {list $x [send -displayof .t xyzgorp2 set y]}]
+ destroy .t
+ cleanupbg
+ set result
+} {child parent}
-if $gotTestCmds {
+catch {
testsend prop root InterpRegister $registry
tk appname tktest
- test send-15.1 {UpdateCommWindow procedure} {
- set x [list [testsend prop comm TK_APPLICATION]]
- newApp "" t_s_1 Test
- send t_s_1 wm withdraw .
- newApp "" t_s_2 Test
- send t_s_2 wm withdraw .
- lappend x [testsend prop comm TK_APPLICATION]
- interp delete t_s_1
- lappend x [testsend prop comm TK_APPLICATION]
- interp delete t_s_2
- lappend x [testsend prop comm TK_APPLICATION]
- } {tktest {t_s_2 t_s_1 tktest} {t_s_2 tktest} tktest}
}
+test send-15.1 {UpdateCommWindow procedure} {secureserver testsend} {
+ set x [list [testsend prop comm TK_APPLICATION]]
+ newApp "" t_s_1 Test
+ send t_s_1 wm withdraw .
+ newApp "" t_s_2 Test
+ send t_s_2 wm withdraw .
+ lappend x [testsend prop comm TK_APPLICATION]
+ interp delete t_s_1
+ lappend x [testsend prop comm TK_APPLICATION]
+ interp delete t_s_2
+ lappend x [testsend prop comm TK_APPLICATION]
+} {tktest {t_s_2 t_s_1 tktest} {t_s_2 tktest} tktest}
-tk appname $name
-if $gotTestCmds {
+catch {
+ tk appname $name
testsend prop root InterpRegistry $registry
-}
-if $gotTestCmds {
testdeleteapps
}
rename newApp {}
@@ -664,16 +628,3 @@ rename newApp {}
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/spinbox.test b/tk/tests/spinbox.test
new file mode 100644
index 00000000000..aebcb4b0c19
--- /dev/null
+++ b/tk/tests/spinbox.test
@@ -0,0 +1,1589 @@
+# This file is a Tcl script to test spinbox widgets in Tk. It is
+# organized in the standard fashion for Tcl tests.
+#
+# Copyright (c) 1998-2000 by Scriptics Corporation.
+# All rights reserved.
+#
+# RCS: @(#) $Id$
+
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+proc scroll args {
+ global scrollInfo
+ set scrollInfo $args
+}
+
+# Create additional widget that's used to hold the selection at times.
+
+spinbox .sel
+.sel insert end "This is some sample text"
+
+# Font names
+
+set big -adobe-helvetica-medium-r-normal--24-240-75-75-p-*-iso8859-1
+set fixed -adobe-courier-medium-r-normal--12-120-75-75-m-*-iso8859-1
+
+# Create entries in the option database to be sure that geometry options
+# like border width have predictable values.
+
+option add *Spinbox.borderWidth 2
+option add *Spinbox.highlightThickness 2
+option add *Spinbox.font {Helvetica -12}
+
+spinbox .e -bd 2 -relief sunken
+pack .e
+update
+
+set i 1
+foreach test {
+ {-activebackground #ff0000 #ff0000 non-existent
+ {unknown color name "non-existent"}}
+ {-background #ff0000 #ff0000 non-existent
+ {unknown color name "non-existent"}}
+ {-bd 4 4 badValue {bad screen distance "badValue"}}
+ {-bg #ff0000 #ff0000 non-existent {unknown color name "non-existent"}}
+ {-borderwidth 1.3 1 badValue {bad screen distance "badValue"}}
+ {-buttonbackground #ff0000 #ff0000 non-existent
+ {unknown color name "non-existent"}}
+ {-buttoncursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-command {a command} {a command} {} {}}
+ {-cursor arrow arrow badValue {bad cursor spec "badValue"}}
+ {-disabledbackground green green non-existent
+ {unknown color name "non-existent"}}
+ {-disabledforeground #110022 #110022 bogus {unknown color name "bogus"}}
+ {-exportselection yes 1 xyzzy {expected boolean value but got "xyzzy"}}
+ {-fg #110022 #110022 bogus {unknown color name "bogus"}}
+ {-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
+ -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* {}
+ {font "" doesn't exist}}
+ {-foreground #110022 #110022 bogus {unknown color name "bogus"}}
+ {-format %0.5f %0.5f %d {bad spinbox format specifier "%d"}}
+ {-from -10 -10.0 bogus {expected floating-point number but got "bogus"}}
+ {-highlightbackground #123456 #123456 ugly {unknown color name "ugly"}}
+ {-highlightcolor #123456 #123456 bogus {unknown color name "bogus"}}
+ {-highlightthickness 6 6 bogus {bad screen distance "bogus"}}
+ {-highlightthickness -2 0 {} {}}
+ {-increment 1.0 1.0 bogus {expected floating-point number but got "bogus"}}
+ {-insertbackground #110022 #110022 bogus {unknown color name "bogus"}}
+ {-insertborderwidth 1.3 1 2.6x {bad screen distance "2.6x"}}
+ {-insertofftime 100 100 3.2 {expected integer but got "3.2"}}
+ {-insertontime 100 100 3.2 {expected integer but got "3.2"}}
+ {-invalidcommand "a command" "a command" {} {}}
+ {-invcmd "a command" "a command" {} {}}
+ {-justify right right bogus {bad justification "bogus": must be left, right, or center}}
+ {-readonlybackground green green non-existent
+ {unknown color name "non-existent"}}
+ {-relief groove groove 1.5 {bad relief "1.5": must be flat, groove, raised, ridge, solid, or sunken}}
+ {-repeatdelay 500 500 3p {expected integer but got "3p"}}
+ {-repeatinterval -500 -500 3p {expected integer but got "3p"}}
+ {-selectbackground #110022 #110022 bogus {unknown color name "bogus"}}
+ {-selectborderwidth 1.3 1 badValue {bad screen distance "badValue"}}
+ {-selectforeground #654321 #654321 bogus {unknown color name "bogus"}}
+ {-state n normal bogus {bad state "bogus": must be disabled, normal, or readonly}}
+ {-takefocus "any string" "any string" {} {}}
+ {-textvariable i i {} {}}
+ {-to 14.9 14.9 bogus {expected floating-point number but got "bogus"}}
+ {-validate "key" "key" "bogus" {bad validate "bogus": must be all, key, focus, focusin, focusout, or none}}
+ {-validatecommand "a command" "a command" {} {}}
+ {-values {mon tue wed thur} {mon tue wed thur} {bad {}list} {list element in braces followed by "list" instead of space}}
+ {-vcmd "a command" "a command" {} {}}
+ {-width 402 402 3p {expected integer but got "3p"}}
+ {-wrap yes 1 xyzzy {expected boolean value but got "xyzzy"}}
+ {-xscrollcommand {Some command} {Some command} {} {}}
+} {
+ set name [lindex $test 0]
+ test spinbox-1.$i {configuration options} {
+ .e configure $name [lindex $test 1]
+ list [lindex [.e configure $name] 4] [.e cget $name]
+ } [list [lindex $test 2] [lindex $test 2]]
+ incr i
+ if {[lindex $test 3] != ""} {
+ test spinbox-1.$i {configuration options} {
+ list [catch {.e configure $name [lindex $test 3]} msg] $msg
+ } [list 1 [lindex $test 4]]
+ }
+ .e configure $name [lindex [.e configure $name] 3]
+ incr i
+}
+
+test spinbox-2.1 {Tk_SpinboxCmd procedure} {
+ list [catch {spinbox} msg] $msg
+} {1 {wrong # args: should be "spinbox pathName ?options?"}}
+test spinbox-2.2 {Tk_SpinboxCmd procedure} {
+ list [catch {spinbox gorp} msg] $msg
+} {1 {bad window path name "gorp"}}
+test spinbox-2.3 {Tk_SpinboxCmd procedure} {
+ catch {destroy .e}
+ spinbox .e
+ list [winfo exists .e] [winfo class .e] [info commands .e]
+} {1 Spinbox .e}
+test spinbox-2.4 {Tk_SpinboxCmd procedure} {
+ catch {destroy .e}
+ list [catch {spinbox .e -gorp foo} msg] $msg [winfo exists .e] \
+ [info commands .e]
+} {1 {unknown option "-gorp"} 0 {}}
+test spinbox-2.5 {Tk_SpinboxCmd procedure} {
+ catch {destroy .e}
+ spinbox .e
+} {.e}
+
+catch {destroy .e}
+spinbox .e -font $fixed
+pack .e
+update
+
+set cx [font measure $fixed a]
+set cy [font metrics $fixed -linespace]
+set ux [font measure $fixed \u4e4e]
+
+test spinbox-3.1 {SpinboxWidgetCmd procedure} {
+ list [catch {.e} msg] $msg
+} {1 {wrong # args: should be ".e option ?arg arg ...?"}}
+test spinbox-3.2 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ list [catch {.e bbox} msg] $msg
+} {1 {wrong # args: should be ".e bbox index"}}
+test spinbox-3.3 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ list [catch {.e bbox a b} msg] $msg
+} {1 {wrong # args: should be ".e bbox index"}}
+test spinbox-3.4 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ list [catch {.e bbox bogus} msg] $msg
+} {1 {bad spinbox index "bogus"}}
+test spinbox-3.5 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ .e delete 0 end
+ .e bbox 0
+} [list 5 5 0 $cy]
+test spinbox-3.6 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ # Tcl_UtfAtIndex(): no utf chars
+
+ .e delete 0 end
+ .e insert 0 "abc"
+ list [.e bbox 3] [.e bbox end]
+} [list "[expr 5+2*$cx] 5 $cx $cy" "[expr 5+2*$cx] 5 $cx $cy"]
+test spinbox-3.7 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ # Tcl_UtfAtIndex(): utf at end
+ .e delete 0 end
+ .e insert 0 "ab\u4e4e"
+ .e bbox end
+} "[expr 5+2*$cx] 5 $ux $cy"
+test spinbox-3.8 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ # Tcl_UtfAtIndex(): utf before index
+ .e delete 0 end
+ .e insert 0 "ab\u4e4ec"
+ .e bbox 3
+} "[expr 5+2*$cx+$ux] 5 $cx $cy"
+test spinbox-3.9 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ # Tcl_UtfAtIndex(): no chars
+ .e delete 0 end
+ .e bbox end
+} "5 5 0 $cy"
+test spinbox-3.10 {SpinboxWidgetCmd procedure, "bbox" widget command} {
+ .e delete 0 end
+ .e insert 0 "abcdefghij\u4e4eklmnop"
+ list [.e bbox 0] [.e bbox 1] [.e bbox 10] [.e bbox end]
+} [list "5 5 $cx $cy" "[expr 5+$cx] 5 $cx $cy" "[expr 5+10*$cx] 5 $ux $cy" "[expr 5+$ux+15*$cx] 5 $cx $cy"]
+test spinbox-3.11 {SpinboxWidgetCmd procedure, "cget" widget command} {
+ list [catch {.e cget} msg] $msg
+} {1 {wrong # args: should be ".e cget option"}}
+test spinbox-3.12 {SpinboxWidgetCmd procedure, "cget" widget command} {
+ list [catch {.e cget a b} msg] $msg
+} {1 {wrong # args: should be ".e cget option"}}
+test spinbox-3.13 {SpinboxWidgetCmd procedure, "cget" widget command} {
+ list [catch {.e cget -gorp} msg] $msg
+} {1 {unknown option "-gorp"}}
+test spinbox-3.14 {SpinboxWidgetCmd procedure, "cget" widget command} {
+ .e configure -bd 4
+ .e cget -bd
+} {4}
+test spinbox-3.15 {SpinboxWidgetCmd procedure, "configure" widget command} {
+ llength [.e configure]
+} {49}
+test spinbox-3.16 {SpinboxWidgetCmd procedure, "configure" widget command} {
+ list [catch {.e configure -foo} msg] $msg
+} {1 {unknown option "-foo"}}
+test spinbox-3.17 {SpinboxWidgetCmd procedure, "configure" widget command} {
+ .e configure -bd 4
+ .e configure -bg #ffffff
+ lindex [.e configure -bd] 4
+} {4}
+test spinbox-3.18 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ list [catch {.e delete} msg] $msg
+} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}}
+test spinbox-3.19 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ list [catch {.e delete a b c} msg] $msg
+} {1 {wrong # args: should be ".e delete firstIndex ?lastIndex?"}}
+test spinbox-3.20 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ list [catch {.e delete foo} msg] $msg
+} {1 {bad spinbox index "foo"}}
+test spinbox-3.21 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ list [catch {.e delete 0 bar} msg] $msg
+} {1 {bad spinbox index "bar"}}
+test spinbox-3.22 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e delete 2 4
+ .e get
+} {014567890}
+test spinbox-3.23 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e delete 6
+ .e get
+} {0123457890}
+test spinbox-3.24 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ # UTF
+ set x {}
+ .e delete 0 end
+ .e insert end "01234\u4e4e67890"
+ .e delete 6
+ lappend x [.e get]
+ .e delete 0 end
+ .e insert end "012345\u4e4e7890"
+ .e delete 6
+ lappend x [.e get]
+ .e delete 0 end
+ .e insert end "0123456\u4e4e890"
+ .e delete 6
+ lappend x [.e get]
+} [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"]
+test spinbox-3.25 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e delete 6 5
+ .e get
+} {01234567890}
+test spinbox-3.26 {SpinboxWidgetCmd procedure, "delete" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e configure -state disabled
+ .e delete 2 8
+ .e configure -state normal
+ .e get
+} {01234567890}
+test spinbox-3.27 {SpinboxWidgetCmd procedure, "get" widget command} {
+ list [catch {.e get foo} msg] $msg
+} {1 {wrong # args: should be ".e get"}}
+test spinbox-3.28 {SpinboxWidgetCmd procedure, "icursor" widget command} {
+ list [catch {.e icursor} msg] $msg
+} {1 {wrong # args: should be ".e icursor pos"}}
+test spinbox-3.29 {SpinboxWidgetCmd procedure, "icursor" widget command} {
+ list [catch {.e icursor foo} msg] $msg
+} {1 {bad spinbox index "foo"}}
+test spinbox-3.30 {SpinboxWidgetCmd procedure, "icursor" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e icursor 4
+ .e index insert
+} {4}
+test spinbox-3.31 {SpinboxWidgetCmd procedure, "index" widget command} {
+ list [catch {.e in} msg] $msg
+} {1 {ambiguous option "in": must be bbox, cget, configure, delete, get, icursor, identify, index, insert, invoke, scan, selection, set, validate, or xview}}
+test spinbox-3.32 {SpinboxWidgetCmd procedure, "index" widget command} {
+ list [catch {.e index} msg] $msg
+} {1 {wrong # args: should be ".e index string"}}
+test spinbox-3.33 {SpinboxWidgetCmd procedure, "index" widget command} {
+ list [catch {.e index foo} msg] $msg
+} {1 {bad spinbox index "foo"}}
+test spinbox-3.34 {SpinboxWidgetCmd procedure, "index" widget command} {
+ list [catch {.e index 0} msg] $msg
+} {0 0}
+test spinbox-3.35 {SpinboxWidgetCmd procedure, "index" widget command} {
+ # UTF
+ .e delete 0 end
+ .e insert 0 abc\u4e4e\u0153def
+ list [.e index 3] [.e index 4] [.e index end]
+} {3 4 8}
+test spinbox-3.36 {SpinboxWidgetCmd procedure, "insert" widget command} {
+ list [catch {.e insert a} msg] $msg
+} {1 {wrong # args: should be ".e insert index text"}}
+test spinbox-3.37 {SpinboxWidgetCmd procedure, "insert" widget command} {
+ list [catch {.e insert a b c} msg] $msg
+} {1 {wrong # args: should be ".e insert index text"}}
+test spinbox-3.38 {SpinboxWidgetCmd procedure, "insert" widget command} {
+ list [catch {.e insert foo Text} msg] $msg
+} {1 {bad spinbox index "foo"}}
+test spinbox-3.39 {SpinboxWidgetCmd procedure, "insert" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e insert 3 xxx
+ .e get
+} {012xxx34567890}
+test spinbox-3.40 {SpinboxWidgetCmd procedure, "insert" widget command} {
+ .e delete 0 end
+ .e insert end "01234567890"
+ .e configure -state disabled
+ .e insert 3 xxx
+ .e configure -state normal
+ .e get
+} {01234567890}
+test spinbox-3.41 {SpinboxWidgetCmd procedure, "insert" widget command} {
+ list [catch {.e insert a b c} msg] $msg
+} {1 {wrong # args: should be ".e insert index text"}}
+test spinbox-3.42 {SpinboxWidgetCmd procedure, "scan" widget command} {
+ list [catch {.e scan a} msg] $msg
+} {1 {wrong # args: should be ".e scan mark|dragto x"}}
+test spinbox-3.43 {SpinboxWidgetCmd procedure, "scan" widget command} {
+ list [catch {.e scan a b c} msg] $msg
+} {1 {wrong # args: should be ".e scan mark|dragto x"}}
+test spinbox-3.44 {SpinboxWidgetCmd procedure, "scan" widget command} {
+ list [catch {.e scan foobar 20} msg] $msg
+} {1 {bad scan option "foobar": must be mark or dragto}}
+test spinbox-3.45 {SpinboxWidgetCmd procedure, "scan" widget command} {
+ list [catch {.e scan mark 20.1} msg] $msg
+} {1 {expected integer but got "20.1"}}
+# This test is non-portable because character sizes vary.
+
+test spinbox-3.46 {SpinboxWidgetCmd procedure, "scan" widget command} {fonts} {
+ .e delete 0 end
+ update
+ .e insert end "This is quite a long string, in fact a "
+ .e insert end "very very long string"
+ .e scan mark 30
+ .e scan dragto 28
+ .e index @0
+} {2}
+test spinbox-3.47 {SpinboxWidgetCmd procedure, "select" widget command} {
+ list [catch {.e select} msg] $msg
+} {1 {wrong # args: should be ".e selection option ?index?"}}
+test spinbox-3.48 {SpinboxWidgetCmd procedure, "select" widget command} {
+ list [catch {.e select foo} msg] $msg
+} {1 {bad selection option "foo": must be adjust, clear, element, from, present, range, or to}}
+test spinbox-3.49 {SpinboxWidgetCmd procedure, "select clear" widget command} {
+ list [catch {.e select clear gorp} msg] $msg
+} {1 {wrong # args: should be ".e selection clear"}}
+test spinbox-3.50 {SpinboxWidgetCmd procedure, "select clear" widget command} {
+ .e delete 0 end
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 4
+ update
+ .e select clear
+ list [catch {selection get} msg] $msg [selection own]
+} {1 {PRIMARY selection doesn't exist or form "STRING" not defined} .e}
+test spinbox-3.51 {SpinboxWidgetCmd procedure, "selection present" widget command} {
+ list [catch {.e selection present foo} msg] $msg
+} {1 {wrong # args: should be ".e selection present"}}
+test spinbox-3.52 {SpinboxWidgetCmd procedure, "selection present" widget command} {
+ .e delete 0 end
+ .e insert end 0123456789
+ .e select from 3
+ .e select to 6
+ .e selection present
+} {1}
+test spinbox-3.53 {SpinboxWidgetCmd procedure, "selection present" widget command} {
+ .e delete 0 end
+ .e insert end 0123456789
+ .e select from 3
+ .e select to 6
+ .e configure -exportselection false
+ .e selection present
+} {1}
+.e configure -exportselection true
+test spinbox-3.54 {SpinboxWidgetCmd procedure, "selection present" widget command} {
+ .e delete 0 end
+ .e insert end 0123456789
+ .e select from 3
+ .e select to 6
+ .e delete 0 end
+ .e selection present
+} {0}
+test spinbox-3.55 {SpinboxWidgetCmd procedure, "selection adjust" widget command} {
+ list [catch {.e select adjust x} msg] $msg
+} {1 {bad spinbox index "x"}}
+test spinbox-3.56 {SpinboxWidgetCmd procedure, "selection adjust" widget command} {
+ list [catch {.e select adjust 2 3} msg] $msg
+} {1 {wrong # args: should be ".e selection adjust index"}}
+test spinbox-3.57 {SpinboxWidgetCmd procedure, "selection adjust" widget command} {
+ .e delete 0 end
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 5
+ update
+ .e select adjust 4
+ selection get
+} {123}
+test spinbox-3.58 {SpinboxWidgetCmd procedure, "selection adjust" widget command} {
+ .e delete 0 end
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 5
+ update
+ .e select adjust 2
+ selection get
+} {234}
+test spinbox-3.59 {SpinboxWidgetCmd procedure, "selection from" widget command} {
+ list [catch {.e select from 2 3} msg] $msg
+} {1 {wrong # args: should be ".e selection from index"}}
+test spinbox-3.60 {SpinboxWidgetCmd procedure, "selection range" widget command} {
+ list [catch {.e select range 2} msg] $msg
+} {1 {wrong # args: should be ".e selection range start end"}}
+test spinbox-3.61 {SpinboxWidgetCmd procedure, "selection range" widget command} {
+ list [catch {.e selection range 2 3 4} msg] $msg
+} {1 {wrong # args: should be ".e selection range start end"}}
+test spinbox-3.62 {SpinboxWidgetCmd procedure, "selection range" widget command} {
+ .e delete 0 end
+ .e insert end 0123456789
+ .e select from 1
+ .e select to 5
+ .e select range 4 4
+ list [catch {.e index sel.first} msg] $msg
+} {1 {selection isn't in widget .e}}
+test spinbox-3.63 {SpinboxWidgetCmd procedure, "selection range" widget command} {
+ .e delete 0 end
+ .e insert end 0123456789
+ .e select from 3
+ .e select to 7
+ .e select range 2 9
+ list [.e index sel.first] [.e index sel.last] [.e index anchor]
+} {2 9 3}
+.e delete 0 end
+.e insert end "This is quite a long text string, so long that it "
+.e insert end "runs off the end of the window quite a bit."
+test spinbox-3.64 {SpinboxWidgetCmd procedure, "selection to" widget command} {
+ list [catch {.e select to 2 3} msg] $msg
+} {1 {wrong # args: should be ".e selection to index"}}
+test spinbox-3.65 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview 5
+ .e xview
+} {0.0537634 0.268817}
+test spinbox-3.66 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ list [catch {.e xview gorp} msg] $msg
+} {1 {bad spinbox index "gorp"}}
+test spinbox-3.67 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview 0
+ .e icursor 10
+ .e xview insert
+ .e xview
+} {0.107527 0.322581}
+test spinbox-3.68 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ list [catch {.e xview moveto foo bar} msg] $msg
+} {1 {wrong # args: should be ".e xview moveto fraction"}}
+test spinbox-3.69 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ list [catch {.e xview moveto foo} msg] $msg
+} {1 {expected floating-point number but got "foo"}}
+test spinbox-3.70 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview moveto 0.5
+ .e xview
+} {0.505376 0.72043}
+test spinbox-3.71 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ list [catch {.e xview scroll 24} msg] $msg
+} {1 {wrong # args: should be ".e xview scroll number units|pages"}}
+test spinbox-3.72 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ list [catch {.e xview scroll gorp units} msg] $msg
+} {1 {expected integer but got "gorp"}}
+test spinbox-3.73 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview moveto 0
+ .e xview scroll 1 pages
+ .e xview
+} {0.193548 0.408602}
+test spinbox-3.74 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview moveto .9
+ update
+ .e xview scroll -2 p
+ .e xview
+} {0.397849 0.612903}
+test spinbox-3.75 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview 30
+ update
+ .e xview scroll 2 units
+ .e index @0
+} {32}
+test spinbox-3.76 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview 30
+ update
+ .e xview scroll -1 units
+ .e index @0
+} {29}
+test spinbox-3.77 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ list [catch {.e xview scroll 23 foobars} msg] $msg
+} {1 {bad argument "foobars": must be units or pages}}
+test spinbox-3.78 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ list [catch {.e xview eat 23 hamburgers} msg] $msg
+} {1 {unknown option "eat": must be moveto or scroll}}
+test spinbox-3.79 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview 0
+ update
+ .e xview -4
+ .e index @0
+} {0}
+test spinbox-3.80 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ .e xview 300
+ .e index @0
+} {73}
+.e insert 10 \u4e4e
+test spinbox-3.81 {SpinboxWidgetCmd procedure, "xview" widget command} {
+ # UTF
+ # If Tcl_NumUtfChars wasn't used, wrong answer would be:
+ # 0.106383 0.117021 0.117021
+
+ set x {}
+ .e xview moveto .1
+ lappend x [lindex [.e xview] 0]
+ .e xview moveto .11
+ lappend x [lindex [.e xview] 0]
+ .e xview moveto .12
+ lappend x [lindex [.e xview] 0]
+} {0.0957447 0.106383 0.117021}
+test spinbox-3.82 {SpinboxWidgetCmd procedure} {
+ list [catch {.e gorp} msg] $msg
+} {1 {bad option "gorp": must be bbox, cget, configure, delete, get, icursor, identify, index, insert, invoke, scan, selection, set, validate, or xview}}
+
+frame .f -width 200 -height 50 -relief raised -bd 2
+pack .f -side right
+test spinbox-5.1 {ConfigureSpinbox procedure, -textvariable} {
+ catch {destroy .e}
+ set x 12345
+ spinbox .e -textvariable x
+ .e get
+} {12345}
+test spinbox-5.2 {ConfigureSpinbox procedure, -textvariable} {
+ catch {destroy .e}
+ set x 12345
+ spinbox .e -textvariable x
+ set y abcde
+ .e configure -textvariable y
+ set x 54321
+ .e get
+} {abcde}
+test spinbox-5.3 {ConfigureSpinbox procedure, -textvariable} {
+ catch {destroy .e}
+ catch {unset x}
+ spinbox .e
+ .e insert 0 "Some text"
+ .e configure -textvariable x
+ set x
+} {Some text}
+test spinbox-5.4 {ConfigureSpinbox procedure, -textvariable} {
+ proc override args {
+ global x
+ set x 12345
+ }
+ catch {destroy .e}
+ catch {unset x}
+ trace variable x w override
+ spinbox .e
+ .e insert 0 "Some text"
+ .e configure -textvariable x
+ set result [list $x [.e get]]
+ unset x; rename override {}
+ set result
+} {12345 12345}
+test spinbox-5.5 {ConfigureSpinbox procedure} {
+ catch {destroy .e}
+ spinbox .e -exportselection false
+ pack .e
+ .e insert end "0123456789"
+ .sel select from 0
+ .sel select to 10
+ set x {}
+ lappend x [selection get]
+ .e select from 1
+ .e select to 5
+ lappend x [selection get]
+ .e configure -exportselection 1
+ lappend x [selection get]
+ set x
+} {{This is so} {This is so} 1234}
+test spinbox-5.6 {ConfigureSpinbox procedure} {
+ catch {destroy .e}
+ spinbox .e
+ pack .e
+ .e insert end "0123456789"
+ .e select from 1
+ .e select to 5
+ .e configure -exportselection 0
+ list [catch {selection get} msg] $msg [.e index sel.first] \
+ [.e index sel.last]
+} {1 {PRIMARY selection doesn't exist or form "STRING" not defined} 1 5}
+test spinbox-5.7 {ConfigureSpinbox procedure} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -width 4 -xscrollcommand scroll
+ pack .e
+ .e insert end "01234567890"
+ update
+ .e configure -width 5
+ set scrollInfo
+} {0 0.363636}
+test spinbox-5.8 {ConfigureSpinbox procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -width 0
+ pack .e
+ .e insert end "0123"
+ update
+ .e configure -font $big
+ update
+ winfo geom .e
+} {79x37+0+0}
+test spinbox-5.9 {ConfigureSpinbox procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief raised
+ pack .e
+ .e insert end "0123"
+ update
+ list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
+} {0 0 1 1}
+test spinbox-5.10 {ConfigureSpinbox procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief flat
+ pack .e
+ .e insert end "0123"
+ update
+ list [.e index @10] [.e index @11] [.e index @12] [.e index @13]
+} {0 0 1 1}
+test spinbox-5.11 {ConfigureSpinbox procedure} {
+ # If "0" in selected font had 0 width, caused divide-by-zero error.
+
+ catch {destroy .e}
+ pack [spinbox .e -font {{open look glyph}}]
+ .e scan dragto 30
+ update
+} {}
+
+# No tests for DisplaySpinbox.
+
+test spinbox-6.1 {SpinboxComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief raised -width 20 -highlightthickness 3
+ pack .e
+ .e insert end 012\t45
+ update
+ list [.e index @61] [.e index @62]
+} {3 4}
+test spinbox-6.2 {SpinboxComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief raised -width 20 -justify center \
+ -highlightthickness 3
+ pack .e
+ .e insert end 012\t45
+ update
+ list [.e index @96] [.e index @97]
+} {3 4}
+test spinbox-6.3 {SpinboxComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief raised -width 20 -justify right \
+ -highlightthickness 3
+ pack .e
+ .e insert end 012\t45
+ update
+ list [.e index @131] [.e index @132]
+} {3 4}
+test spinbox-6.4 {SpinboxComputeGeometry procedure} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief raised -width 5
+ pack .e
+ .e insert end "01234567890"
+ update
+ .e xview 6
+ .e index @0
+} {6}
+test spinbox-6.5 {SpinboxComputeGeometry procedure} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief raised -width 5
+ pack .e
+ .e insert end "01234567890"
+ update
+ .e xview 7
+ .e index @0
+} {6}
+test spinbox-6.6 {SpinboxComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $fixed -bd 2 -relief raised -width 10
+ pack .e
+ .e insert end "01234\t67890"
+ update
+ .e xview 3
+ list [.e index @39] [.e index @40]
+} {5 6}
+test spinbox-6.7 {SpinboxComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $big -bd 3 -relief raised -width 5
+ pack .e
+ .e insert end "01234567"
+ update
+ list [winfo reqwidth .e] [winfo reqheight .e]
+} {94 39}
+test spinbox-6.8 {SpinboxComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $big -bd 3 -relief raised -width 0
+ pack .e
+ .e insert end "01234567"
+ update
+ list [winfo reqwidth .e] [winfo reqheight .e]
+} {133 39}
+test spinbox-6.9 {SpinboxComputeGeometry procedure} {fonts} {
+ catch {destroy .e}
+ spinbox .e -font $big -bd 3 -relief raised -width 0 -highlightthickness 2
+ pack .e
+ update
+ list [winfo reqwidth .e] [winfo reqheight .e]
+} {42 39}
+
+catch {destroy .e}
+spinbox .e -width 10 -font $fixed -textvariable contents -xscrollcommand scroll
+pack .e
+focus .e
+test spinbox-7.1 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 abcde
+ .e insert 2 XXX
+ update
+ list [.e get] $contents $scrollInfo
+} {abXXXcde abXXXcde {0 1}}
+test spinbox-7.2 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 abcde
+ .e insert 500 XXX
+ update
+ list [.e get] $contents $scrollInfo
+} {abcdeXXX abcdeXXX {0 1}}
+test spinbox-7.3 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789
+ .e select from 2
+ .e select to 6
+ .e insert 2 XXX
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 8
+ lappend x [.e index sel.first] [.e index sel.last]
+} {5 9 5 8}
+test spinbox-7.4 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789
+ .e select from 2
+ .e select to 6
+ .e insert 3 XXX
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 8
+ lappend x [.e index sel.first] [.e index sel.last]
+} {2 9 2 8}
+test spinbox-7.5 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789
+ .e select from 2
+ .e select to 6
+ .e insert 5 XXX
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 8
+ lappend x [.e index sel.first] [.e index sel.last]
+} {2 9 2 8}
+test spinbox-7.6 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789
+ .e select from 2
+ .e select to 6
+ .e insert 6 XXX
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 5
+ lappend x [.e index sel.first] [.e index sel.last]
+} {2 6 2 5}
+test spinbox-7.7 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789
+ .e icursor 4
+ .e insert 4 XXX
+ .e index insert
+} {7}
+test spinbox-7.8 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789
+ .e icursor 4
+ .e insert 5 XXX
+ .e index insert
+} {4}
+test spinbox-7.9 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 "This is a very long string"
+ update
+ .e xview 4
+ .e insert 3 XXX
+ .e index @0
+} {7}
+test spinbox-7.10 {InsertChars procedure} {
+ .e delete 0 end
+ .e insert 0 "This is a very long string"
+ update
+ .e xview 4
+ .e insert 4 XXX
+ .e index @0
+} {4}
+.e configure -width 0
+test spinbox-7.11 {InsertChars procedure} {fonts} {
+ .e delete 0 end
+ .e insert 0 "xyzzy"
+ update
+ .e insert 2 00
+ winfo reqwidth .e
+} {70}
+
+.e configure -width 10
+test spinbox-8.1 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 abcde
+ .e delete 2 4
+ update
+ list [.e get] $contents $scrollInfo
+} {abe abe {0 1}}
+test spinbox-8.2 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 abcde
+ .e delete -2 2
+ update
+ list [.e get] $contents $scrollInfo
+} {cde cde {0 1}}
+test spinbox-8.3 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 abcde
+ .e delete 3 1000
+ update
+ list [.e get] $contents $scrollInfo
+} {abc abc {0 1}}
+test spinbox-8.4 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 3
+ .e select to 8
+ .e delete 1 3
+ update
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 5
+ lappend x [.e index sel.first] [.e index sel.last]
+} {1 6 1 5}
+test spinbox-8.5 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 3
+ .e select to 8
+ .e delete 1 4
+ update
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 4
+ lappend x [.e index sel.first] [.e index sel.last]
+} {1 5 1 4}
+test spinbox-8.6 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 3
+ .e select to 8
+ .e delete 1 7
+ update
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 5
+ lappend x [.e index sel.first] [.e index sel.last]
+} {1 2 1 5}
+test spinbox-8.7 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 3
+ .e select to 8
+ .e delete 1 8
+ list [catch {.e index sel.first} msg] $msg
+} {1 {selection isn't in widget .e}}
+test spinbox-8.8 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 3
+ .e select to 8
+ .e delete 3 7
+ update
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 8
+ lappend x [.e index sel.first] [.e index sel.last]
+} {3 4 3 8}
+test spinbox-8.9 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 3
+ .e select to 8
+ .e delete 3 8
+ list [catch {.e index sel.first} msg] $msg
+} {1 {selection isn't in widget .e}}
+test spinbox-8.10 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 8
+ .e select to 3
+ .e delete 5 8
+ update
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 8
+ lappend x [.e index sel.first] [.e index sel.last]
+} {3 5 5 8}
+test spinbox-8.11 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e select from 8
+ .e select to 3
+ .e delete 8 10
+ update
+ set x "[.e index sel.first] [.e index sel.last]"
+ .e select to 4
+ lappend x [.e index sel.first] [.e index sel.last]
+} {3 8 4 8}
+test spinbox-8.12 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e icursor 4
+ .e delete 1 4
+ .e index insert
+} {1}
+test spinbox-8.13 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e icursor 4
+ .e delete 1 5
+ .e index insert
+} {1}
+test spinbox-8.14 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcde
+ .e icursor 4
+ .e delete 4 6
+ .e index insert
+} {4}
+test spinbox-8.15 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 "This is a very long string"
+ .e xview 4
+ .e delete 1 4
+ .e index @0
+} {1}
+test spinbox-8.16 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 "This is a very long string"
+ .e xview 4
+ .e delete 1 5
+ .e index @0
+} {1}
+test spinbox-8.17 {DeleteChars procedure} {
+ .e delete 0 end
+ .e insert 0 "This is a very long string"
+ .e xview 4
+ .e delete 4 6
+ .e index @0
+} {4}
+.e configure -width 0
+test spinbox-8.18 {DeleteChars procedure} {fonts} {
+ .e delete 0 end
+ .e insert 0 "xyzzy"
+ update
+ .e delete 2 4
+ winfo reqwidth .e
+} {42}
+
+test spinbox-9.1 {SpinboxValueChanged procedure} {
+ catch {destroy .e}
+ proc override args {
+ global x
+ set x 12345
+ }
+ catch {unset x}
+ trace variable x w override
+ spinbox .e -textvariable x
+ .e insert 0 foo
+ set result [list $x [.e get]]
+ unset x; rename override {}
+ set result
+} {12345 12345}
+
+catch {destroy .e}
+spinbox .e
+pack .e
+.e configure -width 0
+test spinbox-10.1 {SpinboxSetValue procedure} {fonts} {
+ set x abcde
+ set y ab
+ .e configure -textvariable x
+ update
+ .e configure -textvariable y
+ update
+ list [.e get] [winfo reqwidth .e]
+} {ab 35}
+test spinbox-10.2 {SpinboxSetValue procedure, updating selection} {
+ catch {destroy .e}
+ spinbox .e -textvariable x
+ .e insert 0 "abcdefghjklmnopqrstu"
+ .e selection range 4 10
+ set x "a"
+ list [catch {.e index sel.first} msg] $msg
+} {1 {selection isn't in widget .e}}
+test spinbox-10.3 {SpinboxSetValue procedure, updating selection} {
+ catch {destroy .e}
+ spinbox .e -textvariable x
+ .e insert 0 "abcdefghjklmnopqrstu"
+ .e selection range 4 10
+ set x "abcdefg"
+ list [.e index sel.first] [.e index sel.last]
+} {4 7}
+test spinbox-10.4 {SpinboxSetValue procedure, updating selection} {
+ catch {destroy .e}
+ spinbox .e -textvariable x
+ .e insert 0 "abcdefghjklmnopqrstu"
+ .e selection range 4 10
+ set x "abcdefghijklmn"
+ list [.e index sel.first] [.e index sel.last]
+} {4 10}
+test spinbox-10.5 {SpinboxSetValue procedure, updating display position} {
+ catch {destroy .e}
+ spinbox .e -width 10 -font $fixed -textvariable x
+ pack .e
+ .e insert 0 "abcdefghjklmnopqrstuvwxyz"
+ .e xview 10
+ update
+ set x "abcdefg"
+ update
+ .e index @0
+} {0}
+test spinbox-10.6 {SpinboxSetValue procedure, updating display position} {
+ catch {destroy .e}
+ spinbox .e -width 10 -font $fixed -textvariable x
+ pack .e
+ .e insert 0 "abcdefghjklmnopqrstuvwxyz"
+ .e xview 10
+ update
+ set x "1234567890123456789012"
+ update
+ .e index @0
+} {10}
+test spinbox-10.7 {SpinboxSetValue procedure, updating insertion cursor} {
+ catch {destroy .e}
+ spinbox .e -width 10 -font $fixed -textvariable x
+ pack .e
+ .e insert 0 "abcdefghjklmnopqrstuvwxyz"
+ .e icursor 5
+ set x "123"
+ .e index insert
+} {3}
+test spinbox-10.8 {SpinboxSetValue procedure, updating insertion cursor} {
+ catch {destroy .e}
+ spinbox .e -width 10 -font $fixed -textvariable x
+ pack .e
+ .e insert 0 "abcdefghjklmnopqrstuvwxyz"
+ .e icursor 5
+ set x "123456"
+ .e index insert
+} {5}
+
+test spinbox-11.1 {SpinboxEventProc procedure} {
+ catch {destroy .e}
+ spinbox .e
+ .e insert 0 abcdefg
+ destroy .e
+ update
+} {}
+test spinbox-11.2 {SpinboxEventProc procedure} {
+ deleteWindows
+ spinbox .e1 -fg #112233
+ rename .e1 .e2
+ set x {}
+ lappend x [winfo children .]
+ lappend x [.e2 cget -fg]
+ destroy .e1
+ lappend x [info command .e*] [winfo children .]
+} {.e1 #112233 {} {}}
+
+test spinbox-12.1 {SpinboxCmdDeletedProc procedure} {
+ deleteWindows
+ button .e1 -text "xyz_123"
+ rename .e1 {}
+ list [info command .e*] [winfo children .]
+} {{} {}}
+
+catch {destroy .e}
+spinbox .e -font $fixed -width 5 -bd 2 -relief sunken
+pack .e
+.e insert 0 012345678901234567890
+.e xview 4
+update
+test spinbox-13.1 {GetSpinboxIndex procedure} {
+ .e index end
+} {21}
+test spinbox-13.2 {GetSpinboxIndex procedure} {
+ list [catch {.e index abogus} msg] $msg
+} {1 {bad spinbox index "abogus"}}
+test spinbox-13.3 {GetSpinboxIndex procedure} {
+ .e select from 1
+ .e select to 6
+ .e index anchor
+} {1}
+test spinbox-13.4 {GetSpinboxIndex procedure} {
+ .e select from 4
+ .e select to 1
+ .e index anchor
+} {4}
+test spinbox-13.5 {GetSpinboxIndex procedure} {
+ .e select from 3
+ .e select to 15
+ .e select adjust 4
+ .e index anchor
+} {15}
+test spinbox-13.6 {GetSpinboxIndex procedure} {
+ list [catch {.e index ebogus} msg] $msg
+} {1 {bad spinbox index "ebogus"}}
+test spinbox-13.7 {GetSpinboxIndex procedure} {
+ .e icursor 2
+ .e index insert
+} {2}
+test spinbox-13.8 {GetSpinboxIndex procedure} {
+ list [catch {.e index ibogus} msg] $msg
+} {1 {bad spinbox index "ibogus"}}
+test spinbox-13.9 {GetSpinboxIndex procedure} {
+ .e select from 1
+ .e select to 6
+ list [.e index sel.first] [.e index sel.last]
+} {1 6}
+selection clear .e
+test spinbox-13.10 {GetSpinboxIndex procedure} {unixOnly} {
+ # On unix, when selection is cleared, spinbox widget's internal
+ # selection range is reset.
+
+ list [catch {.e index sel.first} msg] $msg
+} {1 {selection isn't in widget .e}}
+test spinbox-13.11 {GetSpinboxIndex procedure} {macOrPc} {
+ # On mac and pc, when selection is cleared, spinbox widget remembers
+ # last selected range. When selection ownership is restored to
+ # spinbox, the old range will be rehighlighted.
+
+ list [catch {selection get}] [.e index sel.first]
+} {1 1}
+test spinbox-13.12 {GetSpinboxIndex procedure} {unixOnly} {
+ list [catch {.e index sbogus} msg] $msg
+} {1 {selection isn't in widget .e}}
+test spinbox-13.13 {GetSpinboxIndex procedure} {macOrPc} {
+ list [catch {.e index sbogus} msg] $msg
+} {1 {bad spinbox index "sbogus"}}
+test spinbox-13.14 {GetSpinboxIndex procedure} {macOrPc} {
+ list [catch {selection get}] [catch {.e index sbogus}]
+} {1 1}
+test spinbox-13.15 {GetSpinboxIndex procedure} {
+ list [catch {.e index @xyz} msg] $msg
+} {1 {bad spinbox index "@xyz"}}
+test spinbox-13.16 {GetSpinboxIndex procedure} {fonts} {
+ .e index @4
+} {4}
+test spinbox-13.17 {GetSpinboxIndex procedure} {fonts} {
+ .e index @11
+} {4}
+test spinbox-13.18 {GetSpinboxIndex procedure} {fonts} {
+ .e index @12
+} {5}
+test spinbox-13.19 {GetSpinboxIndex procedure} {fonts} {
+ # 11 is the minimum button width
+ .e index @[expr [winfo width .e] - 6 - 11]
+} {8}
+test spinbox-13.20 {GetSpinboxIndex procedure} {fonts} {
+ .e index @[expr [winfo width .e] - 5]
+} {9}
+test spinbox-13.21 {GetSpinboxIndex procedure} {
+ .e index @1000
+} {9}
+test spinbox-13.22 {GetSpinboxIndex procedure} {
+ list [catch {.e index 1xyz} msg] $msg
+} {1 {bad spinbox index "1xyz"}}
+test spinbox-13.23 {GetSpinboxIndex procedure} {
+ .e index -10
+} {0}
+test spinbox-13.24 {GetSpinboxIndex procedure} {
+ .e index 12
+} {12}
+test spinbox-13.25 {GetSpinboxIndex procedure} {
+ .e index 49
+} {21}
+
+# XXX Still need to write tests for SpinboxScanTo and SpinboxSelectTo.
+
+set x {}
+for {set i 1} {$i <= 500} {incr i} {
+ append x "This is line $i, out of 500\n"
+}
+test spinbox-14.1 {SpinboxFetchSelection procedure} {
+ catch {destroy .e}
+ spinbox .e
+ .e insert end "This is a test string"
+ .e select from 1
+ .e select to 18
+ selection get
+} {his is a test str}
+test spinbox-14.3 {SpinboxFetchSelection procedure} {
+ catch {destroy .e}
+ spinbox .e
+ .e insert end $x
+ .e select from 0
+ .e select to end
+ string compare [selection get] $x
+} 0
+
+test spinbox-15.1 {SpinboxLostSelection} {
+ catch {destroy .e}
+ spinbox .e
+ .e insert 0 "Text"
+ .e select from 0
+ .e select to 4
+ set result [selection get]
+ selection clear
+ .e select from 0
+ .e select to 4
+ lappend result [selection get]
+} {Text Text}
+
+# No tests for EventuallyRedraw.
+
+catch {destroy .e}
+spinbox .e -width 10 -xscrollcommand scroll
+pack .e
+update
+
+test spinbox-16.1 {SpinboxVisibleRange procedure} {fonts} {
+ .e delete 0 end
+ .e insert 0 .............................
+ .e xview
+} {0 0.827586}
+test spinbox-15.4 {SpinboxVisibleRange procedure} {
+ .e delete 0 end
+ .e xview
+} {0 1}
+
+catch {destroy .e}
+spinbox .e -width 10 -xscrollcommand scroll -font $fixed
+pack .e
+update
+test spinbox-17.1 {SpinboxUpdateScrollbar procedure} {
+ .e delete 0 end
+ .e insert 0 123
+ update
+ set scrollInfo
+} {0 1}
+test spinbox-17.2 {SpinboxUpdateScrollbar procedure} {
+ .e delete 0 end
+ .e insert 0 0123456789abcdef
+ .e xview 3
+ update
+ set scrollInfo
+} {0.1875 0.8125}
+test spinbox-17.3 {SpinboxUpdateScrollbar procedure} {
+ .e delete 0 end
+ .e insert 0 abcdefghijklmnopqrs
+ .e xview 6
+ update
+ set scrollInfo
+} {0.315789 0.842105}
+test spinbox-17.4 {SpinboxUpdateScrollbar procedure} {
+ destroy .e
+ proc bgerror msg {
+ global x
+ set x $msg
+ }
+ spinbox .e -width 5 -xscrollcommand thisisnotacommand
+ pack .e
+ update
+ rename bgerror {}
+ list $x $errorInfo
+} {{invalid command name "thisisnotacommand"} {invalid command name "thisisnotacommand"
+ while executing
+"thisisnotacommand 0 1"
+ (horizontal scrolling command executed by .e)}}
+
+set l [interp hidden]
+deleteWindows
+
+test spinbox-18.1 {Spinbox widget vs hiding} {
+ destroy .e
+ spinbox .e
+ interp hide {} .e
+ destroy .e
+ list [winfo children .] [interp hidden]
+} [list {} $l]
+
+##
+## Spinbox widget VALIDATION tests
+##
+
+destroy .e
+catch {unset ::e}
+catch {unset ::vVals}
+spinbox .e -validate all \
+ -validatecommand [list doval %W %d %i %P %s %S %v %V] \
+ -invalidcommand bell \
+ -textvariable ::e \
+ -background red -foreground white
+pack .e
+proc doval {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ return 1
+}
+
+# The validation tests build each one upon the previous, so cascading
+# failures aren't good
+#
+test spinbox-19.1 {spinbox widget validation} {
+ .e insert 0 a
+ set ::vVals
+} {.e 1 0 a {} a all key}
+test spinbox-19.2 {spinbox widget validation} {
+ .e insert 1 b
+ set ::vVals
+} {.e 1 1 ab a b all key}
+test spinbox-19.3 {spinbox widget validation} {
+ .e insert end c
+ set ::vVals
+} {.e 1 2 abc ab c all key}
+test spinbox-19.4 {spinbox widget validation} {
+ .e insert 1 123
+ list $::vVals $::e
+} {{.e 1 1 a123bc abc 123 all key} a123bc}
+test spinbox-19.5 {spinbox widget validation} {
+ .e delete 2
+ set ::vVals
+} {.e 0 2 a13bc a123bc 2 all key}
+test spinbox-19.6 {spinbox widget validation} {
+ .e configure -validate key
+ .e delete 1 3
+ set ::vVals
+} {.e 0 1 abc a13bc 13 key key}
+test spinbox-19.7 {spinbox widget validation} {
+ set ::vVals {}
+ .e configure -validate focus
+ .e insert end d
+ set ::vVals
+} {}
+test spinbox-19.8 {spinbox widget validation} {
+ focus -force .e
+ # update necessary to process FocusIn event
+ update
+ set ::vVals
+} {.e -1 -1 abcd abcd {} focus focusin}
+test spinbox-19.9 {spinbox widget validation} {
+ focus -force .
+ # update necessary to process FocusOut event
+ update
+ set ::vVals
+} {.e -1 -1 abcd abcd {} focus focusout}
+.e configure -validate all
+test spinbox-19.10 {spinbox widget validation} {
+ focus -force .e
+ # update necessary to process FocusIn event
+ update
+ set ::vVals
+} {.e -1 -1 abcd abcd {} all focusin}
+test spinbox-19.11 {spinbox widget validation} {
+ focus -force .
+ # update necessary to process FocusOut event
+ update
+ set ::vVals
+} {.e -1 -1 abcd abcd {} all focusout}
+.e configure -validate focusin
+test spinbox-19.12 {spinbox widget validation} {
+ focus -force .e
+ # update necessary to process FocusIn event
+ update
+ set ::vVals
+} {.e -1 -1 abcd abcd {} focusin focusin}
+test spinbox-19.13 {spinbox widget validation} {
+ set ::vVals {}
+ focus -force .
+ # update necessary to process FocusOut event
+ update
+ set ::vVals
+} {}
+.e configure -validate focuso
+test spinbox-19.14 {spinbox widget validation} {
+ focus -force .e
+ # update necessary to process FocusIn event
+ update
+ set ::vVals
+} {}
+test spinbox-19.15 {spinbox widget validation} {
+ focus -force .
+ # update necessary to process FocusOut event
+ update
+ set ::vVals
+} {.e -1 -1 abcd abcd {} focusout focusout}
+test spinbox-19.16 {spinbox widget validation} {
+ list [.e validate] $::vVals
+} {1 {.e -1 -1 abcd abcd {} all forced}}
+test spinbox-19.17 {spinbox widget validation} {
+ set ::e newdata
+ list [.e cget -validate] $::vVals
+} {focusout {.e -1 -1 newdata abcd {} focusout forced}}
+
+proc doval {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ return 0
+}
+.e configure -validate all
+
+test spinbox-19.18 {spinbox widget validation} {
+ set ::e nextdata
+ list [.e cget -validate] $::vVals
+} {none {.e -1 -1 nextdata newdata {} all forced}}
+
+proc doval {W d i P s S v V} {
+ set ::vVals [list $W $d $i $P $s $S $v $V]
+ set ::e mydata
+ return 1
+}
+.e configure -validate all
+
+## This sets validate to none because it shows that we prevent a possible
+## loop condition in the validation, when the spinbox textvar is also set
+test spinbox-19.19 {spinbox widget validation} {
+ .e validate
+ list [.e cget -validate] [.e get] $::vVals
+} {none mydata {.e -1 -1 nextdata nextdata {} all forced}}
+
+.e configure -validate all
+
+## This leaves validate alone because we trigger validation through the
+## textvar (a write trace), and the write during validation triggers
+## nothing (by definition of avoiding loops on var traces). This is
+## one of those "dangerous" conditions where the user will have a
+## different value in the spinbox widget shown as is in the textvar.
+test spinbox-19.20 {spinbox widget validation} {
+ set ::e testdata
+ list [.e cget -validate] [.e get] $::e $::vVals
+} {all testdata mydata {.e -1 -1 testdata mydata {} all forced}}
+
+# A format specifier is allowed to be of the form %[-+ 0]{0,1}\d.?\d?f
+#
+destroy .e
+spinbox .e
+test spinbox-20.1 {spinbox config, -format specifier} {
+ list [catch {.e config -format %2f} msg] $msg
+} {0 {}}
+test spinbox-20.2 {spinbox config, -format specifier} {
+ list [catch {.e config -format %2.2f} msg] $msg
+} {0 {}}
+test spinbox-20.3 {spinbox config, -format specifier} {
+ list [catch {.e config -format %.2f} msg] $msg
+} {0 {}}
+test spinbox-20.4 {spinbox config, -format specifier} {
+ list [catch {.e config -format %2.f} msg] $msg
+} {0 {}}
+test spinbox-20.5 {spinbox config, -format specifier} {
+ list [catch {.e config -format %2e-1f} msg] $msg
+} {1 {bad spinbox format specifier "%2e-1f"}}
+test spinbox-20.6 {spinbox config, -format specifier} {
+ list [catch {.e config -format 2.2} msg] $msg
+} {1 {bad spinbox format specifier "2.2"}}
+test spinbox-20.7 {spinbox config, -format specifier} {
+ list [catch {.e config -format %2.-2f} msg] $msg
+} {1 {bad spinbox format specifier "%2.-2f"}}
+test spinbox-20.8 {spinbox config, -format specifier} {
+ list [catch {.e config -format %-2.02f} msg] $msg
+} {0 {}}
+test spinbox-20.9 {spinbox config, -format specifier} {
+ list [catch {.e config -format "% 2.02f"} msg] $msg
+} {0 {}}
+test spinbox-20.10 {spinbox config, -format specifier} {
+ list [catch {.e config -format "% -2.200f"} msg] $msg
+} {0 {}}
+test spinbox-20.11 {spinbox config, -format specifier} {
+ list [catch {.e config -format "%09.200f"} msg] $msg
+} {0 {}}
+test spinbox-20.12 {spinbox config, -format specifier does something} {
+ set out {}
+ .e config -format "%02.f"
+ .e config -values {} -from 0 -to 10 -increment 1
+ lappend out [.e set 0]; # set currently doesn't force format
+ .e invoke buttonup
+ lappend out [.e set]; # but after invoke it should be formatted
+ lappend out [.e set 3]; # set currently doesn't force format
+ .e config -format "%03.f"
+ lappend out [.e set]; # changing -format should cause formatting
+} {0 01 3 003}
+
+test spinbox-21.1 {spinbox button, out of range checking} {
+ destroy .e
+ spinbox .e -from -10 -to 20 -increment 2
+ set out {}
+ lappend out [.e get]; # -10
+ .e delete 0 end
+ .e insert 0 25; # set outside of range
+ .e invoke buttondown; # should constrain
+ lappend out [.e get]; # 20
+ .e delete 0 end
+ .e insert 0 25; # set outside of range
+ .e invoke buttonup; # should constrain
+ lappend out [.e get]; # 20
+ .e delete 0 end
+ .e insert 0 -100; # set outside of range
+ .e invoke buttonup; # should constrain
+ lappend out [.e get]; # -10
+ .e delete 0 end
+ .e insert 0 -100; # set outside of range
+ .e invoke buttondown; # should constrain
+ lappend out [.e get]; # -10
+ .e delete 0 end
+ .e insert 0 bogus; # set to a bogus value
+ .e invoke buttondown; # should use fromValue
+ lappend out [.e get]; # -10
+ .e delete 0 end
+ .e insert 0 19; # set just inside of range
+ .e invoke buttonup; # no wrap
+ lappend out [.e get]; # 20
+ .e invoke buttonup; # no wrap
+ lappend out [.e get]; # 20
+ .e invoke buttondown
+ lappend out [.e get]; # 18
+ .e delete 0 end
+ .e insert 0 -9; # set just inside of range
+ .e invoke buttondown; # no wrap
+ lappend out [.e get]; # -10
+ .e invoke buttondown; # no wrap
+ lappend out [.e get]; # -10
+ .e invoke buttonup; # no wrap
+ lappend out [.e get]; # -8
+
+ .e configure -wrap 1
+ .e delete 0 end
+ .e insert 0 19; # set just inside of range
+ .e invoke buttonup; # wrap
+ lappend out [.e get]; # -10
+ .e invoke buttonup
+ lappend out [.e get]; # -8
+ .e invoke buttondown
+ lappend out [.e get]; # -10
+ .e delete 0 end
+ .e insert 0 -9; # set just inside of range
+ .e invoke buttondown; # wrap
+ lappend out [.e get]; # 20
+ .e invoke buttondown
+ lappend out [.e get]; # 18
+ .e invoke buttonup; # no wrap
+ lappend out [.e get]; # 20
+
+} {-10 20 20 -10 -10 -10 20 20 18 -10 -10 -8 -10 -8 -10 20 18 20}
+
+test spinbox-22.1 {spinbox config, -from changes SF bug 559078} {
+ set val 5
+ destroy .s
+ spinbox .s -from 1 -to 10 -textvariable val
+ set val
+} {5}
+test spinbox-22.2 {spinbox config, -from changes SF bug 559078} {
+ .s configure -from 3 -to 10
+ set val
+} {5}
+test spinbox-22.3 {spinbox config, -from changes SF bug 559078} {
+ .s configure -from 6 -to 10
+ set val
+} {6}
+
+destroy .e
+catch {unset ::e ::vVals}
+
+##
+## End validation tests
+##
+
+# XXX Still need to write tests for SpinboxBlinkProc, SpinboxFocusProc,
+# and SpinboxTextVarProc.
+
+option clear
+
+# cleanup
+::tcltest::cleanupTests
+return
diff --git a/tk/tests/text.test b/tk/tests/text.test
index e002c7e43b5..730a3182927 100644
--- a/tk/tests/text.test
+++ b/tk/tests/text.test
@@ -8,11 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-eval destroy [winfo child .]
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -51,6 +52,7 @@ catch {destroy .t2}
text .t2
set i 0
foreach test {
+ {-autoseparators yes 1 nah}
{-background #ff00ff #ff00ff <gorp>}
{-bd 4 4 foo}
{-bg blue blue #xx}
@@ -69,6 +71,7 @@ foreach test {
{-insertofftime 100 100 2.4}
{-insertontime 47 47 e1}
{-insertwidth 2.3 2 47d}
+ {-maxundo 5 5 noway}
{-padx 3.4 3 2.4.}
{-pady 82 82 bogus}
{-relief raised raised bumpy}
@@ -83,6 +86,7 @@ foreach test {
{-spacing3 -10 0 bogus}
{-state d disabled foo}
{-tabs {1i 2i 3i 4i} {1i 2i 3i 4i} bad_tabs}
+ {-undo 1 1 eh}
{-width 73 73 2.4}
{-wrap w word bad_wrap}
} {
@@ -111,7 +115,7 @@ test text-1.[incr i] {text options} {
lappend result [lindex $i 4]
}
set result
-} {blue {} {} 7 watch 0 {} fixed #012 5 #123 #234 0 green 45 100 47 2 3 82 raised #ffff01234567 21 yellow 0 0 0 0 disabled {1i 2i 3i 4i} {any old thing} 73 word {x scroll command} {test command}}
+} {1 blue {} {} 7 watch 0 {} fixed #012 5 #123 #234 0 green 45 100 47 2 5 3 82 raised #ffff01234567 21 yellow 0 0 0 0 disabled {1i 2i 3i 4i} {any old thing} 1 73 word {x scroll command} {test command}}
test text-2.1 {Tk_TextCmd procedure} {
list [catch {text} msg] $msg
@@ -150,7 +154,7 @@ test text-3.1 {TextWidgetCmd procedure, basics} {
} {1 {wrong # args: should be ".t option ?arg arg ...?"}}
test text-3.2 {TextWidgetCmd procedure} {
list [catch {.t gorp 1.0 z 1.2} msg] $msg
-} {1 {bad option "gorp": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
+} {1 {bad option "gorp": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
test text-4.1 {TextWidgetCmd procedure, "bbox" option} {
list [catch {.t bbox} msg] $msg
@@ -218,7 +222,7 @@ test text-6.13 {TextWidgetCmd procedure, "compare" option} {
} {1 {bad comparison operator "z": must be <, <=, ==, >=, >, or !=}}
test text-6.14 {TextWidgetCmd procedure, "compare" option} {
list [catch {.t co 1.0 z 1.2} msg] $msg
-} {1 {bad option "co": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
+} {1 {bad option "co": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
# "configure" option is already covered above
@@ -227,7 +231,7 @@ test text-7.1 {TextWidgetCmd procedure, "debug" option} {
} {1 {wrong # args: should be ".t debug boolean"}}
test text-7.2 {TextWidgetCmd procedure, "debug" option} {
list [catch {.t de 0 1} msg] $msg
-} {1 {bad option "de": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
+} {1 {bad option "de": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
test text-7.3 {TextWidgetCmd procedure, "debug" option} {
.t debug true
.t deb
@@ -240,10 +244,10 @@ test text-7.4 {TextWidgetCmd procedure, "debug" option} {
test text-8.1 {TextWidgetCmd procedure, "delete" option} {
list [catch {.t delete} msg] $msg
-} {1 {wrong # args: should be ".t delete index1 ?index2?"}}
+} {1 {wrong # args: should be ".t delete index1 ?index2 ...?"}}
test text-8.2 {TextWidgetCmd procedure, "delete" option} {
list [catch {.t delete a b c} msg] $msg
-} {1 {wrong # args: should be ".t delete index1 ?index2?"}}
+} {1 {bad text index "a"}}
test text-8.3 {TextWidgetCmd procedure, "delete" option} {
list [catch {.t delete @x 2.2} msg] $msg
} {1 {bad text index "@x"}}
@@ -251,11 +255,11 @@ test text-8.4 {TextWidgetCmd procedure, "delete" option} {
list [catch {.t delete 2.3 @y} msg] $msg
} {1 {bad text index "@y"}}
test text-8.5 {TextWidgetCmd procedure, "delete" option} {
- .t con -state disabled
+ .t configure -state disabled
.t delete 2.3
.t g 2.0 2.end
} abcdefghijklm
-.t con -state normal
+.t configure -state normal
test text-8.6 {TextWidgetCmd procedure, "delete" option} {
.t delete 2.3
.t get 2.0 2.end
@@ -264,13 +268,71 @@ test text-8.7 {TextWidgetCmd procedure, "delete" option} {
.t delete 2.1 2.3
.t get 2.0 2.end
} aefghijklm
+test text-8.8 {TextWidgetCmd procedure, "delete" option} {
+ # All indices are checked before we actually delete anything
+ list [catch {.t delete 2.1 2.3 foo} msg] $msg \
+ [.t get 2.0 2.end]
+} {1 {bad text index "foo"} aefghijklm}
+set prevtext [.t get 1.0 end-1c]
+test text-8.9 {TextWidgetCmd procedure, "delete" option} {
+ # auto-forward one byte if the last "pair" is just one
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.1 2.3 2.3
+ .t get 1.0 end-1c
+} foo\naefghijklm
+test text-8.10 {TextWidgetCmd procedure, "delete" option} {
+ # all indices will be ordered before deletion
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.0 2.3 2.7 2.9 2.4
+ .t get 1.0 end-1c
+} foo\ndfgjklm
+test text-8.11 {TextWidgetCmd procedure, "delete" option} {
+ # and check again with even pairs
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.0 2.2 2.7 2.9 2.4 2.5
+ .t get 1.0 end-1c
+} foo\ncdfgjklm
+test text-8.12 {TextWidgetCmd procedure, "delete" option} {
+ # we should get the longest range on equal start indices
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.0 2.2 2.0 2.5 2.0 2.3 2.8 2.7
+ .t get 1.0 end-1c
+} foo\nfghijklm
+test text-8.13 {TextWidgetCmd procedure, "delete" option} {
+ # we should get the longest range on equal start indices
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.0 2.2 1.2 2.6 2.0 2.5
+ .t get 1.0 end-1c
+} foghijklm
+test text-8.14 {TextWidgetCmd procedure, "delete" option} {
+ # we should get the longest range on equal start indices
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.0 2.2 2.0 2.5 1.1 2.3 2.8 2.7
+ .t get 1.0 end-1c
+} ffghijklm
+test text-8.15 {TextWidgetCmd procedure, "delete" option} {
+ # we should get the watch for overlapping ranges - they should
+ # essentially be merged into one span.
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.0 2.6 2.2 2.8
+ .t get 1.0 end-1c
+} foo\nijklm
+test text-8.16 {TextWidgetCmd procedure, "delete" option} {
+ # we should get the watch for overlapping ranges - they should
+ # essentially be merged into one span.
+ .t delete 1.0 end; .t insert 1.0 "foo\nabcdefghijklm"
+ .t delete 2.0 2.6 2.2 2.4
+ .t get 1.0 end-1c
+} foo\nghijklm
+
+.t delete 1.0 end; .t insert 1.0 $prevtext
test text-9.1 {TextWidgetCmd procedure, "get" option} {
list [catch {.t get} msg] $msg
-} {1 {wrong # args: should be ".t get index1 ?index2?"}}
+} {1 {wrong # args: should be ".t get index1 ?index2 ...?"}}
test text-9.2 {TextWidgetCmd procedure, "get" option} {
list [catch {.t get a b c} msg] $msg
-} {1 {wrong # args: should be ".t get index1 ?index2?"}}
+} {1 {bad text index "a"}}
test text-9.3 {TextWidgetCmd procedure, "get" option} {
list [catch {.t get @q 3.1} msg] $msg
} {1 {bad text index "@q"}}
@@ -301,6 +363,25 @@ test text-9.9 {TextWidgetCmd procedure, "get" option} {
test text-9.10 {TextWidgetCmd procedure, "get" option} {
.t get 5.2 5.4
} {y }
+test text-9.11 {TextWidgetCmd procedure, "get" option} {
+ .t get 5.2 5.4 5.4
+} {{y } G}
+test text-9.12 {TextWidgetCmd procedure, "get" option} {
+ .t get 5.2 5.4 5.4 5.5
+} {{y } G}
+test text-9.13 {TextWidgetCmd procedure, "get" option} {
+ .t get 5.2 5.4 5.5 "5.5+5c"
+} {{y } {Irl .}}
+test text-9.14 {TextWidgetCmd procedure, "get" option} {
+ .t get 5.2 5.4 5.4 5.5 end-3c
+} {{y } G { }}
+test text-9.15 {TextWidgetCmd procedure, "get" option} {
+ .t get 5.2 5.4 5.4 5.5 end-3c end
+} {{y } G { 7
+}}
+test text-9.17 {TextWidgetCmd procedure, "get" option} {
+ list [catch {.t get 5.2 5.4 5.5 foo} msg] $msg
+} {1 {bad text index "foo"}}
test text-10.1 {TextWidgetCmd procedure, "index" option} {
list [catch {.t index} msg] $msg
@@ -310,7 +391,7 @@ test text-10.2 {TextWidgetCmd procedure, "index" option} {
} {1 {wrong # args: should be ".t index index"}}
test text-10.3 {TextWidgetCmd procedure, "index" option} {
list [catch {.t in a b} msg] $msg
-} {1 {bad option "in": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
+} {1 {bad option "in": must be bbox, cget, compare, configure, debug, delete, dlineinfo, dump, edit, get, image, index, insert, mark, scan, search, see, tag, window, xview, or yview}}
test text-10.4 {TextWidgetCmd procedure, "index" option} {
list [catch {.t index @xyz} msg] $msg
} {1 {bad text index "@xyz"}}
@@ -369,7 +450,7 @@ test text-11.10 {TextWidgetCmd procedure, "insert" option} {
list [.t get 1.0 1.end] [.t tag ranges bold] [.t tag ranges silly]
} {{First second} {1.0 1.5} {1.5 1.12}}
-# Mark, scan, search, see, tag, window, xview, and yview actions are tested elsewhere.
+# Edit, mark, scan, search, see, tag, window, xview, and yview actions are tested elsewhere.
test text-12.1 {ConfigureText procedure} {
list [catch {.t2 configure -state foobar} msg] $msg
@@ -964,7 +1045,7 @@ test text-20.35 {TextSearchCmd procedure, firstChar and lastChar} {
test text-20.36 {TextSearchCmd procedure, regexp finds empty lines} {
# Test for fix of bug #1643
.t insert end "\n"
- tkTextSetCursor .t 4.0
+ tk::TextSetCursor .t 4.0
.t search -forward -regexp {^$} insert end
} {4.0}
@@ -1111,13 +1192,13 @@ test text-20.65 {TextSearchCmd, unicode with non-text segments} {
} {1.3 3}
test text-20.66 {TextSearchCmd, hidden text does not affect match index} {
- eval destroy [winfo child .]
+ deleteWindows
pack [text .t2]
.t2 insert end "12345H7890"
.t2 search 7 1.0
} 1.6
test text-20.67 {TextSearchCmd, hidden text does not affect match index} {
- eval destroy [winfo child .]
+ deleteWindows
pack [text .t2]
.t2 insert end "12345H7890"
.t2 tag configure hidden -elide true
@@ -1125,13 +1206,13 @@ test text-20.67 {TextSearchCmd, hidden text does not affect match index} {
.t2 search 7 1.0
} 1.6
test text-20.68 {TextSearchCmd, hidden text does not affect match index} {
- eval destroy [winfo child .]
+ deleteWindows
pack [text .t2]
.t2 insert end "foobar\nbarbaz\nbazboo"
.t2 search boo 1.0
} 3.3
test text-20.69 {TextSearchCmd, hidden text does not affect match index} {
- eval destroy [winfo child .]
+ deleteWindows
pack [text .t2]
.t2 insert end "foobar\nbarbaz\nbazboo"
.t2 tag configure hidden -elide true
@@ -1164,7 +1245,7 @@ test text-20.72 {TextSearchCmd, -regexp -nocase searches} {
set res
} 1.0
-eval destroy [winfo child .]
+deleteWindows
text .t2 -highlightthickness 0 -bd 0 -relief flat -padx 0 -width 100
pack .t2
.t2 insert end "1\t2\t3\t4\t55.5"
@@ -1202,7 +1283,7 @@ test text-21.7 {TkTextGetTabs procedure} {
list [catch {.t2 configure -tabs {100 !44 200 lork}} msg] $msg
} {1 {bad screen distance "!44"}}
-eval destroy [winfo child .]
+deleteWindows
text .t
pack .t
.t insert 1.0 "One Line"
@@ -1343,7 +1424,7 @@ test text-22.26 {TextDumpCmd procedure, unicode characters} {
} "text abc\xb1\xb1\xb1 1.0 mark insert 1.6 mark current 1.6 text {\n} 1.6"
set l [interp hidden]
-eval destroy [winfo children .]
+deleteWindows
test text-23.1 {text widget vs hidden commands} {
catch {destroy .t}
@@ -1362,11 +1443,137 @@ test text-24.1 {bug fix - 1642} {
.t insert end "line 3\n"
.t insert end "line 4\n"
.t insert end "line 5\n"
- tkTextSetCursor .t 3.0
+ tk::TextSetCursor .t 3.0
.t search -backward -regexp "\$" insert 1.0
} {2.6}
-eval destroy [winfo child .]
+test text-25.1 {TextEditCmd procedure, argument parsing} {
+ list [catch {.t edit} msg] $msg
+} {1 {wrong # args: should be ".t edit option ?arg arg ...?"}}
+
+test text-25.2 {TextEditCmd procedure, argument parsing} {
+ list [catch {.t edit gorp} msg] $msg
+} {1 {bad edit option "gorp": must be modified, redo, reset, separator or undo}}
+
+test text-25.3 {TextEditUndo procedure, undoing changes} {
+ catch {destroy .t}
+ text .t -undo 1
+ pack .t
+ .t insert end "line 1\n"
+ .t delete 1.4 1.6
+ .t insert end "should be gone after undo\n"
+ .t edit undo
+ .t get 1.0 end
+} "line\n\n"
+
+test text-25.4 {TextEditRedo procedure, redoing changes} {
+ catch {destroy .t}
+ text .t -undo 1
+ pack .t
+ .t insert end "line 1\n"
+ .t delete 1.4 1.6
+ .t insert end "should be back after redo\n"
+ .t edit undo
+ .t edit redo
+ .t get 1.0 end
+} "line\nshould be back after redo\n\n"
+
+test text-25.5 {TextEditUndo procedure, resetting stack} {
+ catch {destroy .t}
+ text .t -undo 1
+ pack .t
+ .t insert end "line 1\n"
+ .t delete 1.4 1.6
+ .t insert end "should be back after redo\n"
+ .t edit reset
+ catch {.t edit undo} msg
+ set msg
+} "nothing to undo"
+
+test text-25.6 {TextEditCmd procedure, insert separator} {
+ catch {destroy .t}
+ text .t -undo 1
+ pack .t
+ .t insert end "line 1\n"
+ .t edit separator
+ .t insert end "line 2\n"
+ .t edit undo
+ .t get 1.0 end
+} "line 1\n\n"
+
+test text-25.7 {-autoseparators configuration option} {
+ catch {destroy .t}
+ text .t -undo 1 -autoseparators 0
+ pack .t
+ .t insert end "line 1\n"
+ .t delete 1.4 1.6
+ .t insert end "line 2\n"
+ .t edit undo
+ .t get 1.0 end
+} "\n"
+
+test text-25.8 {TextEditCmd procedure, modified flag} {
+ catch {destroy .t}
+ text .t
+ pack .t
+ .t insert end "line 1\n"
+ .t edit modified
+} {1}
+
+test text-25.9 {TextEditCmd procedure, reset modified flag} {
+ catch {destroy .t}
+ text .t
+ pack .t
+ .t insert end "line 1\n"
+ .t edit modified 0
+ .t edit modified
+} {0}
+
+test text-25.10 {TextEditCmd procedure, set modified flag} {
+ catch {destroy .t}
+ text .t
+ pack .t
+ .t edit modified 1
+ .t edit modified
+} {1}
+
+test text-25.11 {<<Modified>> virtual event} {
+ set ::retval unmodified
+ catch {destroy .t}
+ text .t -undo 1
+ pack .t
+ bind .t <<Modified>> "set ::retval modified"
+ update idletasks
+ .t insert end "nothing special\n"
+ set ::retval
+} {modified}
+
+test text-25.12 {<<Selection>> virtual event} {
+ set ::retval no_selection
+ catch {destroy .t}
+ text .t -undo 1
+ pack .t
+ bind .t <<Selection>> "set ::retval selection_changed"
+ update idletasks
+ .t insert end "nothing special\n"
+ .t tag add sel 1.0 1.1
+ set ::retval
+} {selection_changed}
+
+test text-25.13 {-maxundo configuration option} {
+ catch {destroy .t}
+ text .t -undo 1 -autoseparators 1 -maxundo 2
+ pack .t
+ .t insert end "line 1\n"
+ .t delete 1.4 1.6
+ .t insert end "line 2\n"
+ catch {.t edit undo}
+ catch {.t edit undo}
+ catch {.t edit undo}
+ .t get 1.0 end
+} "line 1\n\n"
+
+deleteWindows
option clear
# cleanup
@@ -1385,4 +1592,3 @@ return
-
diff --git a/tk/tests/textBTree.test b/tk/tests/textBTree.test
index a59960d555b..548361e1d04 100644
--- a/tk/tests/textBTree.test
+++ b/tk/tests/textBTree.test
@@ -10,9 +10,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .t}
text .t
diff --git a/tk/tests/textDisp.test b/tk/tests/textDisp.test
index 95d3e90ff29..dd91c2c95a5 100644
--- a/tk/tests/textDisp.test
+++ b/tk/tests/textDisp.test
@@ -8,12 +8,16 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-if {$::tcltest::testConfig(fonts) == 0} {
- puts "skipping font-sensitive tests"
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::interpreter
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
# The procedure below is used as the scrolling command for the text;
# it just saves the scrolling information in a variable "scrollInfo".
@@ -40,17 +44,10 @@ option add *Text.highlightThickness 2
# because some window managers don't allow the overall width of a window
# to get very narrow.
-foreach i [winfo child .] {
- destroy $i
-}
frame .f -width 100 -height 20
pack append . .f left
-if {$tcl_platform(platform) == "windows"} {
- set fixedFont {Courier -14}
-} else {
- set fixedFont {Courier -12}
-}
+set fixedFont {Courier -12}
set fixedHeight [font metrics $fixedFont -linespace]
set fixedWidth [font measure $fixedFont m]
@@ -557,7 +554,7 @@ test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} {
} {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}}
test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} {
.t delete 1.0 end
- .t insert end "1\n2\n3\n4\n5\n7\n8\n9\n10\n11\n12"
+ .t insert end "1\n2\n3\n4\n5\n7\n8\n9\n10\n11\n12\n13"
button .b -text "Test" -bd 2 -highlightthickness 2
.t window create 3.end -window .b
.t yview moveto 1
@@ -2861,24 +2858,9 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} {fonts} {
list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} {{0.536667 1} 300x50+-156+18 {}}
-foreach i [winfo children .] {
- catch {destroy $i}
-}
+deleteWindows
option clear
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/textImage.test b/tk/tests/textImage.test
index 7bc8e4b3557..835c4f80b93 100644
--- a/tk/tests/textImage.test
+++ b/tk/tests/textImage.test
@@ -9,27 +9,15 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-# Test Arguments:
-# name - Name of test, in the form foo-1.2.
-# description - Short textual description of the test, to
-# help humans understand what it does.
-# constraints - A list of one or more keywords, each of
-# which must be the name of an element in
-# the array "::tcltest::testConfig". If any of these
-# elements is zero, the test is skipped.
-# This argument may be omitted.
-# script - Script to run to carry out the test. It must
-# return a result that can be checked for
-# correctness.
-# answer - Expected result from script.
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# One time setup. Create a font to insure the tests are font metric invariant.
-wm geometry . {}
catch {destroy .t}
font create test_font -family courier -size 14
text .t -font test_font
diff --git a/tk/tests/textIndex.test b/tk/tests/textIndex.test
index 67b9ba816c1..93fea9301e8 100644
--- a/tk/tests/textIndex.test
+++ b/tk/tests/textIndex.test
@@ -8,14 +8,15 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Some tests require the testtext command
-
-set ::tcltest::testConfig(testtext) \
- [expr {[info commands testtext] != {}}]
+testConstraint testtext [llength [info commands testtext]]
catch {destroy .t}
text .t -font {Courier -12} -width 20 -height 10
diff --git a/tk/tests/textMark.test b/tk/tests/textMark.test
index 02f1208091c..faac3697f48 100644
--- a/tk/tests/textMark.test
+++ b/tk/tests/textMark.test
@@ -8,17 +8,17 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .t}
-if [catch {text .t -font {Courier 12} -width 20 -height 10}] {
- puts "The font needed by these tests isn't available, so I'm"
- puts "going to skip the tests."
- ::tcltest::cleanupTests
- return
-}
+testConstraint courier12 [expr {[catch {
+ text .t -font {Courier 12} -width 20 -height 10
+ }] == 0}]
pack append . .t {top expand fill}
update
.t debug on
@@ -41,83 +41,83 @@ bOy GIrl .#@? x_yz
!@#$%
Line 7"
-test textMark-1.1 {TkTextMarkCmd - missing option} {
+test textMark-1.1 {TkTextMarkCmd - missing option} courier12 {
list [catch {.t mark} msg] $msg
} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}}
-test textMark-1.2 {TkTextMarkCmd - bogus option} {
+test textMark-1.2 {TkTextMarkCmd - bogus option} courier12 {
list [catch {.t mark gorp} msg] $msg
} {1 {bad mark option "gorp": must be gravity, names, next, previous, set, or unset}}
-test textMark-1.3 {TkTextMarkCmd - "gravity" option} {
+test textMark-1.3 {TkTextMarkCmd - "gravity" option} courier12 {
list [catch {.t mark gravity foo} msg] $msg
} {1 {there is no mark named "foo"}}
-test textMark-1.4 {TkTextMarkCmd - "gravity" option} {
+test textMark-1.4 {TkTextMarkCmd - "gravity" option} courier12 {
.t mark unset x
.t mark set x 1.3
.t insert 1.3 x
list [.t mark gravity x] [.t index x]
} {right 1.4}
-test textMark-1.5 {TkTextMarkCmd - "gravity" option} {
+test textMark-1.5 {TkTextMarkCmd - "gravity" option} courier12 {
.t mark unset x
.t mark set x 1.3
.t mark g x left
.t insert 1.3 x
list [.t mark gravity x] [.t index x]
} {left 1.3}
-test textMark-1.6 {TkTextMarkCmd - "gravity" option} {
+test textMark-1.6 {TkTextMarkCmd - "gravity" option} courier12 {
.t mark unset x
.t mark set x 1.3
.t mark gravity x right
.t insert 1.3 x
list [.t mark gravity x] [.t index x]
} {right 1.4}
-test textMark-1.7 {TkTextMarkCmd - "gravity" option} {
+test textMark-1.7 {TkTextMarkCmd - "gravity" option} courier12 {
list [catch {.t mark gravity x gorp} msg] $msg
} {1 {bad mark gravity "gorp": must be left or right}}
-test textMark-1.8 {TkTextMarkCmd - "gravity" option} {
+test textMark-1.8 {TkTextMarkCmd - "gravity" option} courier12 {
list [catch {.t mark gravity} msg] $msg
} {1 {wrong # args: should be ".t mark gravity markName ?gravity?"}}
-test textMark-2.1 {TkTextMarkCmd - "names" option} {
+test textMark-2.1 {TkTextMarkCmd - "names" option} courier12 {
list [catch {.t mark names 2} msg] $msg
} {1 {wrong # args: should be ".t mark names"}}
.t mark unset x
-test textMark-2.2 {TkTextMarkCmd - "names" option} {
+test textMark-2.2 {TkTextMarkCmd - "names" option} courier12 {
lsort [.t mark n]
} {current insert}
-test textMark-2.3 {TkTextMarkCmd - "names" option} {
+test textMark-2.3 {TkTextMarkCmd - "names" option} courier12 {
.t mark set a 1.1
.t mark set "b c" 2.3
lsort [.t mark names]
} {a {b c} current insert}
-test textMark-3.1 {TkTextMarkCmd - "set" option} {
+test textMark-3.1 {TkTextMarkCmd - "set" option} courier12 {
list [catch {.t mark set a} msg] $msg
} {1 {wrong # args: should be ".t mark set markName index"}}
-test textMark-3.2 {TkTextMarkCmd - "set" option} {
+test textMark-3.2 {TkTextMarkCmd - "set" option} courier12 {
list [catch {.t mark s a b c} msg] $msg
} {1 {wrong # args: should be ".t mark set markName index"}}
-test textMark-3.3 {TkTextMarkCmd - "set" option} {
+test textMark-3.3 {TkTextMarkCmd - "set" option} courier12 {
list [catch {.t mark set a @x} msg] $msg
} {1 {bad text index "@x"}}
-test textMark-3.4 {TkTextMarkCmd - "set" option} {
+test textMark-3.4 {TkTextMarkCmd - "set" option} courier12 {
.t mark set a 1.2
.t index a
} 1.2
-test textMark-3.5 {TkTextMarkCmd - "set" option} {
+test textMark-3.5 {TkTextMarkCmd - "set" option} courier12 {
.t mark set a end
.t index a
} {8.0}
-test textMark-4.1 {TkTextMarkCmd - "unset" option} {
+test textMark-4.1 {TkTextMarkCmd - "unset" option} courier12 {
list [catch {.t mark unset} msg] $msg
} {0 {}}
-test textMark-4.2 {TkTextMarkCmd - "unset" option} {
+test textMark-4.2 {TkTextMarkCmd - "unset" option} courier12 {
.t mark set a 1.2
.t mark set b 2.3
.t mark unset a b
list [catch {.t index a} msg] $msg [catch {.t index b} msg2] $msg2
} {1 {bad text index "a"} 1 {bad text index "b"}}
-test textMark-4.3 {TkTextMarkCmd - "unset" option} {
+test textMark-4.3 {TkTextMarkCmd - "unset" option} courier12 {
.t mark set a 1.2
.t mark set b 2.3
.t mark set 49ers 3.1
@@ -125,14 +125,14 @@ test textMark-4.3 {TkTextMarkCmd - "unset" option} {
lsort [.t mark names]
} {current insert}
-test textMark-5.1 {TkTextMarkCmd - miscellaneous} {
+test textMark-5.1 {TkTextMarkCmd - miscellaneous} courier12 {
list [catch {.t mark} msg] $msg
} {1 {wrong # args: should be ".t mark option ?arg arg ...?"}}
-test textMark-5.2 {TkTextMarkCmd - miscellaneous} {
+test textMark-5.2 {TkTextMarkCmd - miscellaneous} courier12 {
list [catch {.t mark foo} msg] $msg
} {1 {bad mark option "foo": must be gravity, names, next, previous, set, or unset}}
-test textMark-6.1 {TkTextMarkSegToIndex} {
+test textMark-6.1 {TkTextMarkSegToIndex} courier12 {
.t mark set a 1.2
.t mark set b 1.2
.t mark set c 1.2
@@ -141,79 +141,79 @@ test textMark-6.1 {TkTextMarkSegToIndex} {
} {1.2 1.2 1.2 1.4}
catch {eval {.t mark unset} [.t mark names]}
-test textMark-7.1 {MarkFindNext - invalid mark name} {
+test textMark-7.1 {MarkFindNext - invalid mark name} courier12 {
catch {.t mark next bogus} x
set x
} {bad text index "bogus"}
-test textMark-7.2 {MarkFindNext - marks at same location} {
+test textMark-7.2 {MarkFindNext - marks at same location} courier12 {
.t mark set insert 2.0
.t mark set current 2.0
.t mark next current
} {insert}
-test textMark-7.3 {MarkFindNext - numerical starting mark} {
+test textMark-7.3 {MarkFindNext - numerical starting mark} courier12 {
.t mark set current 1.0
.t mark set insert 1.0
.t mark next 1.0
} {insert}
-test textMark-7.4 {MarkFindNext - mark on the same line} {
+test textMark-7.4 {MarkFindNext - mark on the same line} courier12 {
.t mark set current 1.0
.t mark set insert 1.1
.t mark next current
} {insert}
-test textMark-7.5 {MarkFindNext - mark on the next line} {
+test textMark-7.5 {MarkFindNext - mark on the next line} courier12 {
.t mark set current 1.end
.t mark set insert 2.0
.t mark next current
} {insert}
-test textMark-7.6 {MarkFindNext - mark far away} {
+test textMark-7.6 {MarkFindNext - mark far away} courier12 {
.t mark set current 1.2
.t mark set insert 7.0
.t mark next current
} {insert}
-test textMark-7.7 {MarkFindNext - mark on top of end} {
+test textMark-7.7 {MarkFindNext - mark on top of end} courier12 {
.t mark set current end
.t mark next end
} {current}
-test textMark-7.8 {MarkFindNext - no next mark} {
+test textMark-7.8 {MarkFindNext - no next mark} courier12 {
.t mark set current 1.0
.t mark set insert 3.0
.t mark next insert
} {}
-test textMark-8.1 {MarkFindPrev - invalid mark name} {
+test textMark-8.1 {MarkFindPrev - invalid mark name} courier12 {
catch {.t mark prev bogus} x
set x
} {bad text index "bogus"}
-test textMark-8.2 {MarkFindPrev - marks at same location} {
+test textMark-8.2 {MarkFindPrev - marks at same location} courier12 {
.t mark set insert 2.0
.t mark set current 2.0
.t mark prev insert
} {current}
-test textMark-8.3 {MarkFindPrev - numerical starting mark} {
+test textMark-8.3 {MarkFindPrev - numerical starting mark} courier12 {
.t mark set current 1.0
.t mark set insert 1.0
.t mark prev 1.1
} {current}
-test textMark-8.4 {MarkFindPrev - mark on the same line} {
+test textMark-8.4 {MarkFindPrev - mark on the same line} courier12 {
.t mark set current 1.0
.t mark set insert 1.1
.t mark prev insert
} {current}
-test textMark-8.5 {MarkFindPrev - mark on the previous line} {
+test textMark-8.5 {MarkFindPrev - mark on the previous line} courier12 {
.t mark set current 1.end
.t mark set insert 2.0
.t mark prev insert
} {current}
-test textMark-8.6 {MarkFindPrev - mark far away} {
+test textMark-8.6 {MarkFindPrev - mark far away} courier12 {
.t mark set current 1.2
.t mark set insert 7.0
.t mark prev insert
} {current}
-test textMark-8.7 {MarkFindPrev - mark on top of end} {
+test textMark-8.7 {MarkFindPrev - mark on top of end} courier12 {
.t mark set insert 3.0
.t mark set current end
.t mark prev end
} {insert}
-test textMark-8.8 {MarkFindPrev - no previous mark} {
+test textMark-8.8 {MarkFindPrev - no previous mark} courier12 {
.t mark set current 1.0
.t mark set insert 3.0
.t mark prev current
diff --git a/tk/tests/textTag.test b/tk/tests/textTag.test
index ed642da6b87..ca7a5d0ad86 100644
--- a/tk/tests/textTag.test
+++ b/tk/tests/textTag.test
@@ -8,17 +8,18 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .t}
-if [catch {text .t -font {Courier 12} -width 20 -height 10}] {
- puts "The font needed by these tests isn't available, so I'm"
- puts "going to skip the tests."
- ::tcltest::cleanupTests
- return
-}
+testConstraint courier12 [expr {[catch {
+ text .t -font {Courier 12} -width 20 -height 10
+ }] == 0}]
+
pack append . .t {top expand fill}
update
.t debug on
@@ -85,219 +86,219 @@ foreach test {
{expected boolean value but got "stupid"}}
} {
set name [lindex $test 0]
- test textTag-1.$i {tag configuration options} {
+ test textTag-1.$i {tag configuration options} courier12 {
.t tag configure x $name [lindex $test 1]
.t tag cget x $name
} [lindex $test 2]
incr i
if {[lindex $test 3] != ""} {
- test textTag-1.$i {configuration options} {
+ test textTag-1.$i {configuration options} courier12 {
list [catch {.t tag configure x $name [lindex $test 3]} msg] $msg
} [list 1 [lindex $test 4]]
}
.t tag configure x $name [lindex [.t tag configure x $name] 3]
incr i
}
-test textTag-2.1 {TkTextTagCmd - "add" option} {
+test textTag-2.1 {TkTextTagCmd - "add" option} courier12 {
list [catch {.t tag} msg] $msg
} {1 {wrong # args: should be ".t tag option ?arg arg ...?"}}
-test textTag-2.2 {TkTextTagCmd - "add" option} {
+test textTag-2.2 {TkTextTagCmd - "add" option} courier12 {
list [catch {.t tag gorp} msg] $msg
} {1 {bad tag option "gorp": must be add, bind, cget, configure, delete, lower, names, nextrange, raise, ranges, or remove}}
-test textTag-2.3 {TkTextTagCmd - "add" option} {
+test textTag-2.3 {TkTextTagCmd - "add" option} courier12 {
list [catch {.t tag add foo} msg] $msg
} {1 {wrong # args: should be ".t tag add tagName index1 ?index2 index1 index2 ...?"}}
-test textTag-2.4 {TkTextTagCmd - "add" option} {
+test textTag-2.4 {TkTextTagCmd - "add" option} courier12 {
list [catch {.t tag add x gorp} msg] $msg
} {1 {bad text index "gorp"}}
-test textTag-2.5 {TkTextTagCmd - "add" option} {
+test textTag-2.5 {TkTextTagCmd - "add" option} courier12 {
list [catch {.t tag add x 1.2 gorp} msg] $msg
} {1 {bad text index "gorp"}}
-test textTag-2.6 {TkTextTagCmd - "add" option} {
+test textTag-2.6 {TkTextTagCmd - "add" option} courier12 {
.t tag add sel 3.2 3.4
.t tag add sel 3.2 3.0
.t tag ranges sel
} {3.2 3.4}
-test textTag-2.7 {TkTextTagCmd - "add" option} {
+test textTag-2.7 {TkTextTagCmd - "add" option} courier12 {
.t tag add x 1.0 1.end
.t tag ranges x
} {1.0 1.6}
-test textTag-2.8 {TkTextTagCmd - "add" option} {
+test textTag-2.8 {TkTextTagCmd - "add" option} courier12 {
.t tag remove x 1.0 end
.t tag add x 1.2
.t tag ranges x
} {1.2 1.3}
-test textTag-2.9 {TkTextTagCmd - "add" option} {
+test textTag-2.9 {TkTextTagCmd - "add" option} courier12 {
.t.e select from 0
.t.e select to 4
.t tag add sel 3.2 3.4
selection get
} 34
-test textTag-2.11 {TkTextTagCmd - "add" option} {
+test textTag-2.11 {TkTextTagCmd - "add" option} courier12 {
.t.e select from 0
.t.e select to 4
.t configure -exportselection 0
.t tag add sel 3.2 3.4
selection get
} Text
-test textTag-2.12 {TkTextTagCmd - "add" option} {
+test textTag-2.12 {TkTextTagCmd - "add" option} courier12 {
.t tag remove sel 1.0 end
.t tag add sel 1.1 1.5 2.4 3.1 4.2 4.4
.t tag ranges sel
} {1.1 1.5 2.4 3.1 4.2 4.4}
-test textTag-2.13 {TkTextTagCmd - "add" option} {
+test textTag-2.13 {TkTextTagCmd - "add" option} courier12 {
.t tag remove sel 1.0 end
.t tag add sel 1.1 1.5 2.4
.t tag ranges sel
} {1.1 1.5 2.4 2.5}
catch {.t tag delete x}
-test textTag-3.1 {TkTextTagCmd - "bind" option} {
+test textTag-3.1 {TkTextTagCmd - "bind" option} courier12 {
list [catch {.t tag bind} msg] $msg
} {1 {wrong # args: should be ".t tag bind tagName ?sequence? ?command?"}}
-test textTag-3.2 {TkTextTagCmd - "bind" option} {
+test textTag-3.2 {TkTextTagCmd - "bind" option} courier12 {
list [catch {.t tag bind 1 2 3 4} msg] $msg
} {1 {wrong # args: should be ".t tag bind tagName ?sequence? ?command?"}}
-test textTag-3.3 {TkTextTagCmd - "bind" option} {
+test textTag-3.3 {TkTextTagCmd - "bind" option} courier12 {
.t tag bind x <Enter> script1
.t tag bind x <Enter>
} script1
-test textTag-3.4 {TkTextTagCmd - "bind" option} {
+test textTag-3.4 {TkTextTagCmd - "bind" option} courier12 {
list [catch {.t tag bind x <Gorp> script2} msg] $msg
} {1 {bad event type or keysym "Gorp"}}
-test textTag-3.5 {TkTextTagCmd - "bind" option} {
+test textTag-3.5 {TkTextTagCmd - "bind" option} courier12 {
.t tag delete x
.t tag bind x <Enter> script1
list [catch {.t tag bind x <FocusIn> script2} msg] $msg [.t tag bind x]
} {1 {requested illegal events; only key, button, motion, enter, leave, and virtual events may be used} <Enter>}
-test textTag-3.6 {TkTextTagCmd - "bind" option} {
+test textTag-3.6 {TkTextTagCmd - "bind" option} courier12 {
.t tag delete x
.t tag bind x <Enter> script1
.t tag bind x <Leave> script2
.t tag bind x a xyzzy
list [lsort [.t tag bind x]] [.t tag bind x <Enter>] [.t tag bind x a]
} {{<Enter> <Leave> a} script1 xyzzy}
-test textTag-3.7 {TkTextTagCmd - "bind" option} {
+test textTag-3.7 {TkTextTagCmd - "bind" option} courier12 {
.t tag delete x
.t tag bind x <Enter> script1
.t tag bind x <Enter> +script2
.t tag bind x <Enter>
} {script1
script2}
-test textTag-3.7 {TkTextTagCmd - "bind" option} {
+test textTag-3.7 {TkTextTagCmd - "bind" option} courier12 {
.t tag delete x
list [catch {.t tag bind x <Enter>} msg] $msg
} {0 {}}
-test textTag-3.8 {TkTextTagCmd - "bind" option} {
+test textTag-3.8 {TkTextTagCmd - "bind" option} courier12 {
.t tag delete x
list [catch {.t tag bind x <} msg] $msg
} {1 {no event type or button # or keysym}}
-test textTag-4.1 {TkTextTagCmd - "cget" option} {
+test textTag-4.1 {TkTextTagCmd - "cget" option} courier12 {
list [catch {.t tag cget a} msg] $msg
} {1 {wrong # args: should be ".t tag cget tagName option"}}
-test textTag-4.2 {TkTextTagCmd - "cget" option} {
+test textTag-4.2 {TkTextTagCmd - "cget" option} courier12 {
list [catch {.t tag cget a b c} msg] $msg
} {1 {wrong # args: should be ".t tag cget tagName option"}}
-test textTag-4.3 {TkTextTagCmd - "cget" option} {
+test textTag-4.3 {TkTextTagCmd - "cget" option} courier12 {
.t tag delete foo
list [catch {.t tag cget foo bar} msg] $msg
} {1 {tag "foo" isn't defined in text widget}}
-test textTag-4.4 {TkTextTagCmd - "cget" option} {
+test textTag-4.4 {TkTextTagCmd - "cget" option} courier12 {
list [catch {.t tag cget sel bogus} msg] $msg
} {1 {unknown option "bogus"}}
-test textTag-4.5 {TkTextTagCmd - "cget" option} {
+test textTag-4.5 {TkTextTagCmd - "cget" option} courier12 {
.t tag delete x
.t tag configure x -background red
list [catch {.t tag cget x -background} msg] $msg
} {0 red}
-test textTag-5.1 {TkTextTagCmd - "configure" option} {
+test textTag-5.1 {TkTextTagCmd - "configure" option} courier12 {
list [catch {.t tag configure} msg] $msg
} {1 {wrong # args: should be ".t tag configure tagName ?option? ?value? ?option value ...?"}}
-test textTag-5.2 {TkTextTagCmd - "configure" option} {
+test textTag-5.2 {TkTextTagCmd - "configure" option} courier12 {
list [catch {.t tag configure x -foo} msg] $msg
} {1 {unknown option "-foo"}}
-test textTag-5.3 {TkTextTagCmd - "configure" option} {
+test textTag-5.3 {TkTextTagCmd - "configure" option} courier12 {
list [catch {.t tag configure x -background red -underline} msg] $msg
} {1 {value for "-underline" missing}}
-test textTag-5.4 {TkTextTagCmd - "configure" option} {
+test textTag-5.4 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
.t tag configure x -underline yes
.t tag configure x -underline
} {-underline {} {} {} yes}
-test textTag-5.5 {TkTextTagCmd - "configure" option} {
+test textTag-5.5 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
.t tag configure x -overstrike on
.t tag cget x -overstrike
} {on}
-test textTag-5.6 {TkTextTagCmd - "configure" option} {
+test textTag-5.6 {TkTextTagCmd - "configure" option} courier12 {
list [catch {.t tag configure x -overstrike foo} msg] $msg
} {1 {expected boolean value but got "foo"}}
-test textTag-5.7 {TkTextTagCmd - "configure" option} {
+test textTag-5.7 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -underline stupid} msg] $msg
} {1 {expected boolean value but got "stupid"}}
-test textTag-5.8 {TkTextTagCmd - "configure" option} {
+test textTag-5.8 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
.t tag configure x -justify left
.t tag configure x -justify
} {-justify {} {} {} left}
-test textTag-5.9 {TkTextTagCmd - "configure" option} {
+test textTag-5.9 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -justify bogus} msg] $msg
} {1 {bad justification "bogus": must be left, right, or center}}
-test textTag-5.10 {TkTextTagCmd - "configure" option} {
+test textTag-5.10 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -justify fill} msg] $msg
} {1 {bad justification "fill": must be left, right, or center}}
-test textTag-5.11 {TkTextTagCmd - "configure" option} {
+test textTag-5.11 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
.t tag configure x -offset 2
.t tag configure x -offset
} {-offset {} {} {} 2}
-test textTag-5.12 {TkTextTagCmd - "configure" option} {
+test textTag-5.12 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -offset 1.0q} msg] $msg
} {1 {bad screen distance "1.0q"}}
-test textTag-5.13 {TkTextTagCmd - "configure" option} {
+test textTag-5.13 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
.t tag configure x -lmargin1 2 -lmargin2 4 -rmargin 5
list [.t tag configure x -lmargin1] [.t tag configure x -lmargin2] \
[.t tag configure x -rmargin]
} {{-lmargin1 {} {} {} 2} {-lmargin2 {} {} {} 4} {-rmargin {} {} {} 5}}
-test textTag-5.14 {TkTextTagCmd - "configure" option} {
+test textTag-5.14 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -lmargin1 2.0x} msg] $msg
} {1 {bad screen distance "2.0x"}}
-test textTag-5.15 {TkTextTagCmd - "configure" option} {
+test textTag-5.15 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -lmargin2 gorp} msg] $msg
} {1 {bad screen distance "gorp"}}
-test textTag-5.16 {TkTextTagCmd - "configure" option} {
+test textTag-5.16 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -rmargin 140.1.1} msg] $msg
} {1 {bad screen distance "140.1.1"}}
.t tag delete x
-test textTag-5.17 {TkTextTagCmd - "configure" option} {
+test textTag-5.17 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
.t tag configure x -spacing1 2 -spacing2 4 -spacing3 6
list [.t tag configure x -spacing1] [.t tag configure x -spacing2] \
[.t tag configure x -spacing3]
} {{-spacing1 {} {} {} 2} {-spacing2 {} {} {} 4} {-spacing3 {} {} {} 6}}
-test textTag-5.18 {TkTextTagCmd - "configure" option} {
+test textTag-5.18 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -spacing1 2.0x} msg] $msg
} {1 {bad screen distance "2.0x"}}
-test textTag-5.19 {TkTextTagCmd - "configure" option} {
+test textTag-5.19 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -spacing1 lousy} msg] $msg
} {1 {bad screen distance "lousy"}}
-test textTag-5.20 {TkTextTagCmd - "configure" option} {
+test textTag-5.20 {TkTextTagCmd - "configure" option} courier12 {
.t tag delete x
list [catch {.t tag configure x -spacing1 4.2.3} msg] $msg
} {1 {bad screen distance "4.2.3"}}
-test textTag-5.21 {TkTextTagCmd - "configure" option} {
+test textTag-5.21 {TkTextTagCmd - "configure" option} courier12 {
.t configure -selectborderwidth 2 -selectforeground blue \
-selectbackground black
.t tag configure sel -borderwidth 4 -foreground green -background yellow
@@ -307,19 +308,19 @@ test textTag-5.21 {TkTextTagCmd - "configure" option} {
}
set x
} {4 green yellow}
-test textTag-5.22 {TkTextTagCmd - "configure" option} {
+test textTag-5.22 {TkTextTagCmd - "configure" option} courier12 {
.t configure -selectborderwidth 20
.t tag configure sel -borderwidth {}
.t cget -selectborderwidth
} {}
-test textTag-6.1 {TkTextTagCmd - "delete" option} {
+test textTag-6.1 {TkTextTagCmd - "delete" option} courier12 {
list [catch {.t tag delete} msg] $msg
} {1 {wrong # args: should be ".t tag delete tagName tagName ..."}}
-test textTag-6.2 {TkTextTagCmd - "delete" option} {
+test textTag-6.2 {TkTextTagCmd - "delete" option} courier12 {
list [catch {.t tag delete zork} msg] $msg
} {0 {}}
-test textTag-6.3 {TkTextTagCmd - "delete" option} {
+test textTag-6.3 {TkTextTagCmd - "delete" option} courier12 {
.t tag delete x
.t tag config x -background black
.t tag config y -foreground white
@@ -327,14 +328,14 @@ test textTag-6.3 {TkTextTagCmd - "delete" option} {
.t tag delete y z
lsort [.t tag names]
} {sel x}
-test textTag-6.4 {TkTextTagCmd - "delete" option} {
+test textTag-6.4 {TkTextTagCmd - "delete" option} courier12 {
.t tag config x -background black
.t tag config y -foreground white
.t tag config z -background black
eval .t tag delete [.t tag names]
.t tag names
} {sel}
-test textTag-6.5 {TkTextTagCmd - "delete" option} {
+test textTag-6.5 {TkTextTagCmd - "delete" option} courier12 {
.t tag bind x <Enter> foo
.t tag delete x
.t tag configure x -background black
@@ -348,39 +349,39 @@ proc tagsetup {} {
.t tag configure $i -background black
}
}
-test textTag-7.1 {TkTextTagCmd - "lower" option} {
+test textTag-7.1 {TkTextTagCmd - "lower" option} courier12 {
list [catch {.t tag lower} msg] $msg
} {1 {wrong # args: should be ".t tag lower tagName ?belowThis?"}}
-test textTag-7.2 {TkTextTagCmd - "lower" option} {
+test textTag-7.2 {TkTextTagCmd - "lower" option} courier12 {
list [catch {.t tag lower foo} msg] $msg
} {1 {tag "foo" isn't defined in text widget}}
-test textTag-7.3 {TkTextTagCmd - "lower" option} {
+test textTag-7.3 {TkTextTagCmd - "lower" option} courier12 {
list [catch {.t tag lower sel bar} msg] $msg
} {1 {tag "bar" isn't defined in text widget}}
-test textTag-7.4 {TkTextTagCmd - "lower" option} {
+test textTag-7.4 {TkTextTagCmd - "lower" option} courier12 {
tagsetup
.t tag lower c
.t tag names
} {c sel a b d}
-test textTag-7.5 {TkTextTagCmd - "lower" option} {
+test textTag-7.5 {TkTextTagCmd - "lower" option} courier12 {
tagsetup
.t tag lower d b
.t tag names
} {sel a d b c}
-test textTag-7.6 {TkTextTagCmd - "lower" option} {
+test textTag-7.6 {TkTextTagCmd - "lower" option} courier12 {
tagsetup
.t tag lower a c
.t tag names
} {sel b a c d}
-test textTag-8.1 {TkTextTagCmd - "names" option} {
+test textTag-8.1 {TkTextTagCmd - "names" option} courier12 {
list [catch {.t tag names a b} msg] $msg
} {1 {wrong # args: should be ".t tag names ?index?"}}
-test textTag-8.2 {TkTextTagCmd - "names" option} {
+test textTag-8.2 {TkTextTagCmd - "names" option} courier12 {
tagsetup
.t tag names
} {sel a b c d}
-test textTag-8.3 {TkTextTagCmd - "names" option} {
+test textTag-8.3 {TkTextTagCmd - "names" option} courier12 {
tagsetup
.t tag add "a b" 2.1 2.6
.t tag add c 2.4 2.7
@@ -391,148 +392,148 @@ test textTag-8.3 {TkTextTagCmd - "names" option} {
.t tag add x 2.3 2.5
.t tag add x 2.9 3.1
.t tag add x 7.2
-test textTag-9.1 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.1 {TkTextTagCmd - "nextrange" option} courier12 {
list [catch {.t tag nextrange x} msg] $msg
} {1 {wrong # args: should be ".t tag nextrange tagName index1 ?index2?"}}
-test textTag-9.2 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.2 {TkTextTagCmd - "nextrange" option} courier12 {
list [catch {.t tag nextrange x 1 2 3} msg] $msg
} {1 {wrong # args: should be ".t tag nextrange tagName index1 ?index2?"}}
-test textTag-9.3 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.3 {TkTextTagCmd - "nextrange" option} courier12 {
list [catch {.t tag nextrange foo 1.0} msg] $msg
} {0 {}}
-test textTag-9.4 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.4 {TkTextTagCmd - "nextrange" option} courier12 {
list [catch {.t tag nextrange x foo} msg] $msg
} {1 {bad text index "foo"}}
-test textTag-9.5 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.5 {TkTextTagCmd - "nextrange" option} courier12 {
list [catch {.t tag nextrange x 1.0 bar} msg] $msg
} {1 {bad text index "bar"}}
-test textTag-9.6 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.6 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 1.0
} {2.3 2.5}
-test textTag-9.7 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.7 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 2.2
} {2.3 2.5}
-test textTag-9.8 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.8 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 2.3
} {2.3 2.5}
-test textTag-9.9 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.9 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 2.4
} {2.9 3.1}
-test textTag-9.10 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.10 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 2.4 2.9
} {}
-test textTag-9.11 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.11 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 2.4 2.10
} {2.9 3.1}
-test textTag-9.12 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.12 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 2.4 2.11
} {2.9 3.1}
-test textTag-9.13 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.13 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 7.0
} {7.2 7.3}
-test textTag-9.14 {TkTextTagCmd - "nextrange" option} {
+test textTag-9.14 {TkTextTagCmd - "nextrange" option} courier12 {
.t tag nextrange x 7.3
} {}
-test textTag-10.1 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.1 {TkTextTagCmd - "prevrange" option} courier12 {
list [catch {.t tag prevrange x} msg] $msg
} {1 {wrong # args: should be ".t tag prevrange tagName index1 ?index2?"}}
-test textTag-10.2 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.2 {TkTextTagCmd - "prevrange" option} courier12 {
list [catch {.t tag prevrange x 1 2 3} msg] $msg
} {1 {wrong # args: should be ".t tag prevrange tagName index1 ?index2?"}}
-test textTag-10.3 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.3 {TkTextTagCmd - "prevrange" option} courier12 {
list [catch {.t tag prevrange foo end} msg] $msg
} {0 {}}
-test textTag-10.4 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.4 {TkTextTagCmd - "prevrange" option} courier12 {
list [catch {.t tag prevrange x foo} msg] $msg
} {1 {bad text index "foo"}}
-test textTag-10.5 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.5 {TkTextTagCmd - "prevrange" option} courier12 {
list [catch {.t tag prevrange x end bar} msg] $msg
} {1 {bad text index "bar"}}
-test textTag-10.6 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.6 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x end
} {7.2 7.3}
-test textTag-10.7 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.7 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 2.4
} {2.3 2.5}
-test textTag-10.8 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.8 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 2.5
} {2.3 2.5}
-test textTag-10.9 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.9 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 2.9
} {2.3 2.5}
-test textTag-10.10 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.10 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 2.9 2.6
} {}
-test textTag-10.11 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.11 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 2.9 2.5
} {}
-test textTag-10.12 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.12 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 2.9 2.3
} {2.3 2.5}
-test textTag-10.13 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.13 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 7.0
} {2.9 3.1}
-test textTag-10.14 {TkTextTagCmd - "prevrange" option} {
+test textTag-10.14 {TkTextTagCmd - "prevrange" option} courier12 {
.t tag prevrange x 2.3
} {}
-test textTag-11.1 {TkTextTagCmd - "raise" option} {
+test textTag-11.1 {TkTextTagCmd - "raise" option} courier12 {
list [catch {.t tag raise} msg] $msg
} {1 {wrong # args: should be ".t tag raise tagName ?aboveThis?"}}
-test textTag-11.2 {TkTextTagCmd - "raise" option} {
+test textTag-11.2 {TkTextTagCmd - "raise" option} courier12 {
list [catch {.t tag raise foo} msg] $msg
} {1 {tag "foo" isn't defined in text widget}}
-test textTag-11.3 {TkTextTagCmd - "raise" option} {
+test textTag-11.3 {TkTextTagCmd - "raise" option} courier12 {
list [catch {.t tag raise sel bar} msg] $msg
} {1 {tag "bar" isn't defined in text widget}}
-test textTag-11.4 {TkTextTagCmd - "raise" option} {
+test textTag-11.4 {TkTextTagCmd - "raise" option} courier12 {
tagsetup
.t tag raise c
.t tag names
} {sel a b d c}
-test textTag-11.5 {TkTextTagCmd - "raise" option} {
+test textTag-11.5 {TkTextTagCmd - "raise" option} courier12 {
tagsetup
.t tag raise d b
.t tag names
} {sel a b d c}
-test textTag-11.6 {TkTextTagCmd - "raise" option} {
+test textTag-11.6 {TkTextTagCmd - "raise" option} courier12 {
tagsetup
.t tag raise a c
.t tag names
} {sel b c a d}
-test textTag-12.1 {TkTextTagCmd - "ranges" option} {
+test textTag-12.1 {TkTextTagCmd - "ranges" option} courier12 {
list [catch {.t tag ranges} msg] $msg
} {1 {wrong # args: should be ".t tag ranges tagName"}}
-test textTag-12.2 {TkTextTagCmd - "ranges" option} {
+test textTag-12.2 {TkTextTagCmd - "ranges" option} courier12 {
.t tag delete x
.t tag ranges x
} {}
-test textTag-12.3 {TkTextTagCmd - "ranges" option} {
+test textTag-12.3 {TkTextTagCmd - "ranges" option} courier12 {
.t tag delete x
.t tag add x 2.2
.t tag add x 2.7 4.15
.t tag add x 5.2 5.5
.t tag ranges x
} {2.2 2.3 2.7 4.6 5.2 5.5}
-test textTag-12.4 {TkTextTagCmd - "ranges" option} {
+test textTag-12.4 {TkTextTagCmd - "ranges" option} courier12 {
.t tag delete x
.t tag add x 1.0 3.0
.t tag add x 4.0 end
.t tag ranges x
} {1.0 3.0 4.0 8.0}
-test textTag-13.1 {TkTextTagCmd - "remove" option} {
+test textTag-13.1 {TkTextTagCmd - "remove" option} courier12 {
list [catch {.t tag remove} msg] $msg
} {1 {wrong # args: should be ".t tag remove tagName index1 ?index2 index1 index2 ...?"}}
-test textTag-13.2 {TkTextTagCmd - "remove" option} {
+test textTag-13.2 {TkTextTagCmd - "remove" option} courier12 {
.t tag delete x
.t tag add x 2.2 2.11
.t tag remove x 2.3 2.7
.t tag ranges x
} {2.2 2.3 2.7 2.11}
-test textTag-13.3 {TkTextTagCmd - "remove" option} {
+test textTag-13.3 {TkTextTagCmd - "remove" option} courier12 {
.t configure -exportselection 1
.t tag remove sel 1.0 end
.t tag add sel 2.4 3.3
@@ -542,14 +543,14 @@ test textTag-13.3 {TkTextTagCmd - "remove" option} {
} Text
.t tag delete x a b c d
-test textTag-14.1 {SortTags} {
+test textTag-14.1 {SortTags} courier12 {
foreach i {a b c d} {
.t tag add $i 2.0 2.2
}
.t tag names 2.1
} {a b c d}
.t tag delete a b c d
-test textTag-14.2 {SortTags} {
+test textTag-14.2 {SortTags} courier12 {
foreach i {a b c d} {
.t tag configure $i -background black
}
@@ -559,13 +560,13 @@ test textTag-14.2 {SortTags} {
.t tag names 2.1
} {a b c d}
.t tag delete x a b c d
-test textTag-14.3 {SortTags} {
+test textTag-14.3 {SortTags} courier12 {
for {set i 0} {$i < 30} {incr i} {
.t tag add x$i 2.0 2.2
}
.t tag names 2.1
} {x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29}
-test textTag-14.4 {SortTags} {
+test textTag-14.4 {SortTags} courier12 {
for {set i 0} {$i < 30} {incr i} {
.t tag configure x$i -background black
}
@@ -588,7 +589,7 @@ set c [.t bbox 4.3]
set x3 [expr [lindex $c 0] + [lindex $c 2]/2]
set y3 [expr [lindex $c 1] + [lindex $c 3]/2]
-test textTag-15.1 {TkTextBindProc} {
+test textTag-15.1 {TkTextBindProc} courier12 {
bind .t <ButtonRelease> {lappend x up}
.t tag bind x <ButtonRelease> {lappend x x-up}
.t tag bind y <ButtonRelease> {lappend x y-up}
@@ -607,7 +608,7 @@ test textTag-15.1 {TkTextBindProc} {
bind .t <ButtonRelease> {}
set x
} {x-up up up y-up up}
-test textTag-15.2 {TkTextBindProc} {
+test textTag-15.2 {TkTextBindProc} courier12 {
catch {.t tag delete x}
catch {.t tag delete y}
.t tag bind x <Enter> {lappend x x-enter}
@@ -631,7 +632,7 @@ test textTag-15.2 {TkTextBindProc} {
event gen .t <ButtonRelease> -x $x3 -y $y3
set x
} {x-enter | x-down | | x-up x-leave y-enter}
-test textTag-15.3 {TkTextBindProc} {
+test textTag-15.3 {TkTextBindProc} courier12 {
catch {.t tag delete x}
catch {.t tag delete y}
.t tag bind x <Enter> {lappend x x-enter}
@@ -664,7 +665,7 @@ foreach tag [.t tag names] {
catch {.t tag delete $tag}
}
.t tag configure big -font $bigFont
-test textTag-16.1 {TkTextPickCurrent procedure} {
+test textTag-16.1 {TkTextPickCurrent procedure} courier12 {
event gen .t <ButtonRelease-1> -state 0x100 -x $x1 -y $y1
set x [.t index current]
event gen .t <Motion> -x $x2 -y $y2
@@ -680,7 +681,7 @@ test textTag-16.1 {TkTextPickCurrent procedure} {
event gen .t <ButtonRelease-1> -state 0x100 -x $x3 -y $y3
lappend x [.t index current]
} {2.1 3.2 3.2 3.2 3.2 3.2 4.3}
-test textTag-16.2 {TkTextPickCurrent procedure} {
+test textTag-16.2 {TkTextPickCurrent procedure} courier12 {
event gen .t <ButtonRelease-1> -state 0x100 -x $x1 -y $y1
event gen .t <Motion> -x $x2 -y $y2
set x [.t index current]
@@ -693,7 +694,7 @@ foreach i {a b c d} {
.t tag bind $i <Enter> "lappend x enter-$i"
.t tag bind $i <Leave> "lappend x leave-$i"
}
-test textTag-16.3 {TkTextPickCurrent procedure} {
+test textTag-16.3 {TkTextPickCurrent procedure} courier12 {
foreach i {a b c d} {
.t tag remove $i 1.0 end
}
@@ -711,7 +712,7 @@ test textTag-16.3 {TkTextPickCurrent procedure} {
event gen .t <Motion> -x $x3 -y $y3
set x
} {enter-a enter-b | leave-b enter-c | leave-a leave-c}
-test textTag-16.4 {TkTextPickCurrent procedure} {
+test textTag-16.4 {TkTextPickCurrent procedure} courier12 {
foreach i {a b c d} {
.t tag remove $i 1.0 end
}
@@ -731,7 +732,7 @@ test textTag-16.4 {TkTextPickCurrent procedure} {
foreach i {a b c d} {
.t tag delete $i
}
-test textTag-16.5 {TkTextPickCurrent procedure} {
+test textTag-16.5 {TkTextPickCurrent procedure} courier12 {
foreach i {a b c d} {
.t tag remove $i 1.0 end
}
@@ -741,7 +742,7 @@ test textTag-16.5 {TkTextPickCurrent procedure} {
event gen .t <Motion> -x $x2 -y $y2
.t index current
} {3.2}
-test textTag-16.6 {TkTextPickCurrent procedure} {
+test textTag-16.6 {TkTextPickCurrent procedure} courier12 {
foreach i {a b c d} {
.t tag remove $i 1.0 end
}
@@ -752,7 +753,7 @@ test textTag-16.6 {TkTextPickCurrent procedure} {
update
.t index current
} {3.1}
-test textTag-16.7 {TkTextPickCurrent procedure} {
+test textTag-16.7 {TkTextPickCurrent procedure} courier12 {
foreach i {a b c d} {
.t tag remove $i 1.0 end
}
diff --git a/tk/tests/textWind.test b/tk/tests/textWind.test
index 85a959b6bd4..22780ecccc3 100644
--- a/tk/tests/textWind.test
+++ b/tk/tests/textWind.test
@@ -8,14 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo child .] {
- catch {destroy $i}
-}
-
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
diff --git a/tk/tests/tk.test b/tk/tests/tk.test
index 0d0ec2b9839..a4fe6832ec6 100644
--- a/tk/tests/tk.test
+++ b/tk/tests/tk.test
@@ -3,20 +3,23 @@
#
# Copyright (c) 1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
-# All rights reserved.
+# Copyright (c) 2002 ActiveState Corporation.
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test tk-1.1 {tk command: general} {
list [catch {tk} msg] $msg
} {1 {wrong # args: should be "tk option ?arg?"}}
test tk-1.2 {tk command: general} {
list [catch {tk xyz} msg] $msg
-} {1 {bad option "xyz": must be appname, scaling, or useinputmethods}}
+} {1 {bad option "xyz": must be appname, caret, scaling, useinputmethods, or windowingsystem}}
set appname [tk appname]
test tk-2.1 {tk command: appname} {
@@ -101,9 +104,8 @@ test tk-4.6 {tk command: useinputmethods: set new} {unixOnly} {
if {[tk useinputmethods 1] == 0} {
puts "this wish doesn't have XIM (X Input Methods) support"
}
- # We should always start with XIM support off
set useim
-} 0
+} $useim
test tk-4.7 {tk command: useinputmethods: set new} {macOrPc} {
# Mac and Windows don't have X Input Methods, so this should
# always return 0
@@ -111,6 +113,25 @@ test tk-4.7 {tk command: useinputmethods: set new} {macOrPc} {
} 0
tk useinputmethods $useim
+test tk-5.1 {tk caret} {
+ list [catch {tk caret} msg] $msg
+} {1 {wrong # args: should be "tk caret window ?-x x? ?-y y? ?-height height?"}}
+test tk-5.2 {tk caret} {
+ list [catch {tk caret bogus} msg] $msg
+} {1 {bad window path name "bogus"}}
+test tk-5.3 {tk caret} {
+ list [catch {tk caret . -foo} msg] $msg
+} {1 {bad caret option "-foo": must be -x, -y, or -height}}
+test tk-5.4 {tk caret} {
+ list [catch {tk caret . -x 0 -y} msg] $msg
+} {1 {wrong # args: should be "tk caret window ?-x x? ?-y y? ?-height height?"}}
+test tk-5.5 {tk caret} {
+ list [catch {tk caret . -x 10 -y 11 -h 12; tk caret .} msg] $msg
+} {0 {-height 12 -x 10 -y 11}}
+test tk-5.6 {tk caret} {
+ list [catch {tk caret . -x 20 -y 25 -h 30; tk caret . -hei} msg] $msg
+} {0 30}
+
# cleanup
::tcltest::cleanupTests
return
diff --git a/tk/tests/unixButton.test b/tk/tests/unixButton.test
index 087b7d1a1cc..d3354afb79f 100644
--- a/tk/tests/unixButton.test
+++ b/tk/tests/unixButton.test
@@ -10,29 +10,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {$tcl_platform(platform)!="unix"} {
- puts "skipping: Unix only tests..."
- ::tcltest::cleanupTests
- return
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\""
- puts "image, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Create entries in the option database to be sure that geometry options
# like border width have predictable values.
@@ -58,7 +41,6 @@ catch {unset value}
catch {unset value2}
eval image delete [image names]
-image create test image1
label .l -text Label
button .b -text Button
checkbutton .c -text Checkbutton
@@ -66,8 +48,8 @@ radiobutton .r -text Radiobutton
pack .l .b .c .r
update
-test unixbutton-1.1 {TkpComputeButtonGeometry procedure} {
- eval destroy [winfo children .]
+test unixbutton-1.1 {TkpComputeButtonGeometry procedure} {unix testImageType} {
+ deleteWindows
image create test image1
image1 changed 0 0 0 0 60 40
label .b1 -image image1 -bd 4 -padx 0 -pady 2
@@ -81,8 +63,8 @@ test unixbutton-1.1 {TkpComputeButtonGeometry procedure} {
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
} {68 48 74 54 112 52 112 52}
-test unixbutton-1.2 {TkpComputeButtonGeometry procedure} {
- eval destroy [winfo children .]
+test unixbutton-1.2 {TkpComputeButtonGeometry procedure} unix {
+ deleteWindows
label .b1 -bitmap question -bd 3 -padx 0 -pady 2
button .b2 -bitmap question -bd 3 -padx 0 -pady 2
checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1
@@ -94,8 +76,8 @@ test unixbutton-1.2 {TkpComputeButtonGeometry procedure} {
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
} {23 33 29 39 54 37 54 37}
-test unixbutton-1.3 {TkpComputeButtonGeometry procedure} {
- eval destroy [winfo children .]
+test unixbutton-1.3 {TkpComputeButtonGeometry procedure} unix {
+ deleteWindows
label .b1 -bitmap question -bd 3 -highlightthickness 4
button .b2 -bitmap question -bd 3 -highlightthickness 0
checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \
@@ -109,8 +91,8 @@ test unixbutton-1.3 {TkpComputeButtonGeometry procedure} {
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
} {31 41 25 35 25 35 25 35}
-test unixbutton-1.4 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
- eval destroy [winfo children .]
+test unixbutton-1.4 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ deleteWindows
label .b1 -text Xagqpim -padx 0 -pady 2 -font {Helvetica -18 bold}
button .b2 -text Xagqpim -padx 0 -pady 2 -font {Helvetica -18 bold}
checkbutton .b3 -text Xagqpim -padx 1 -pady 1 -font {Helvetica -18 bold}
@@ -122,22 +104,22 @@ test unixbutton-1.4 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
} {82 29 88 35 114 31 121 29}
-test unixbutton-1.5 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
- eval destroy [winfo children .]
+test unixbutton-1.5 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ deleteWindows
label .l1 -text "This is a long string that will wrap around on several lines.\n\nIt also has a blank line (above)." -wraplength 1.5i -padx 0 -pady 0
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
} {136 88}
-test unixbutton-1.6 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
- eval destroy [winfo children .]
+test unixbutton-1.6 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ deleteWindows
label .l1 -text "This is a long string without wrapping.\n\nIt also has a blank line (above)." -padx 0 -pady 0
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
} {231 46}
-test unixbutton-1.7 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
- eval destroy [winfo children .]
+test unixbutton-1.7 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ deleteWindows
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 -width 10
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 -height 5
checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 -width 20 -height 2
@@ -149,8 +131,8 @@ test unixbutton-1.7 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
} {74 22 60 84 168 38 61 22}
-test unixbutton-1.8 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
- eval destroy [winfo children .]
+test unixbutton-1.8 {TkpComputeButtonGeometry procedure} {unix nonPortable fonts} {
+ deleteWindows
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 \
-highlightthickness 4
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 \
@@ -165,23 +147,23 @@ test unixbutton-1.8 {TkpComputeButtonGeometry procedure} {nonPortable fonts} {
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
} {62 30 56 24 58 22 62 22}
-test unixbutton-1.9 {TkpComputeButtonGeometry procedure} {
- eval destroy [winfo children .]
+test unixbutton-1.9 {TkpComputeButtonGeometry procedure} unix {
+ deleteWindows
button .b2 -bitmap question -default active
list [winfo reqwidth .b2] [winfo reqheight .b2]
} {37 47}
-test unixbutton-1.10 {TkpComputeButtonGeometry procedure} {
- eval destroy [winfo children .]
+test unixbutton-1.10 {TkpComputeButtonGeometry procedure} unix {
+ deleteWindows
button .b2 -bitmap question -default normal
list [winfo reqwidth .b2] [winfo reqheight .b2]
} {37 47}
-test unixbutton-1.11 {TkpComputeButtonGeometry procedure} {
- eval destroy [winfo children .]
+test unixbutton-1.11 {TkpComputeButtonGeometry procedure} unix {
+ deleteWindows
button .b2 -bitmap question -default disabled
list [winfo reqwidth .b2] [winfo reqheight .b2]
} {27 37}
-eval destroy [winfo children .]
+deleteWindows
# cleanup
::tcltest::cleanupTests
diff --git a/tk/tests/unixEmbed.test b/tk/tests/unixEmbed.test
index 54d548a4cda..c9475e84e47 100644
--- a/tk/tests/unixEmbed.test
+++ b/tk/tests/unixEmbed.test
@@ -8,19 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {$tcl_platform(platform) != "unix"} {
- puts "skipping: Unix only tests..."
- ::tcltest::cleanupTests
- return
-}
-
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
setupbg
dobg {wm withdraw .}
@@ -65,15 +58,15 @@ proc colorsFree {w {red 31} {green 245} {blue 192}} {
&& ([lindex $vals 2]/256 == $blue)
}
-test unixEmbed-1.1 {TkpUseWindow procedure, bad window identifier} {
+test unixEmbed-1.1 {TkpUseWindow procedure, bad window identifier} unix {
catch {destroy .t}
list [catch {toplevel .t -use xyz} msg] $msg
} {1 {expected integer but got "xyz"}}
-test unixEmbed-1.2 {TkpUseWindow procedure, bad window identifier} {
+test unixEmbed-1.2 {TkpUseWindow procedure, bad window identifier} unix {
catch {destroy .t}
list [catch {toplevel .t -use 47} msg] $msg
} {1 {couldn't create child of window "47"}}
-test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} {nonPortable} {
+test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} {unix nonPortable} {
catch {destroy .t}
catch {destroy .x}
toplevel .t -colormap new
@@ -85,7 +78,7 @@ test unixEmbed-1.3 {TkpUseWindow procedure, inheriting colormap} {nonPortable} {
destroy .t
set result
} {0}
-test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} {nonPortable} {
+test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} {unix nonPortable} {
catch {destroy .t}
catch {destroy .t2}
catch {destroy .x}
@@ -98,16 +91,8 @@ test unixEmbed-1.4 {TkpUseWindow procedure, inheriting colormap} {nonPortable} {
set result
} {1}
-if {[string compare testembed [info commands testembed]] != 0} {
- puts "This application hasn't been compiled with the testembed command,"
- puts "therefore I am skipping all of these tests."
- cleanupbg
- ::tcltest::cleanupTests
- return
-}
-
-test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} {
- eval destroy [winfo child .]
+test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -118,8 +103,8 @@ test unixEmbed-1.5 {TkpUseWindow procedure, creating Container records} {
list [testembed] [expr [lindex [lindex [testembed all] 0] 0] - $w]
}
} {{{XXX {} {} .t}} 0}
-test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} {
- eval destroy [winfo child .]
+test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -132,8 +117,8 @@ test unixEmbed-1.6 {TkpUseWindow procedure, creating Container records} {
testembed
}
} {{XXX {} {} .t2} {XXX {} {} .t1}}
-test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} {
- eval destroy [winfo child .]
+test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
pack .f1 .f2
@@ -145,10 +130,8 @@ test unixEmbed-1.7 {TkpUseWindow procedure, container and embedded in same app}
# Can't think of any way to test the procedures TkpMakeWindow,
# TkpMakeContainer, or EmbedErrorProc.
-test unixEmbed-2.1 {EmbeddedEventProc procedure} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-2.1 {EmbeddedEventProc procedure} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -163,10 +146,8 @@ test unixEmbed-2.1 {EmbeddedEventProc procedure} {
testembed
}
} {}
-test unixEmbed-2.2 {EmbeddedEventProc procedure} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-2.2 {EmbeddedEventProc procedure} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -178,10 +159,8 @@ test unixEmbed-2.2 {EmbeddedEventProc procedure} {
testembed
}
} {}
-test unixEmbed-2.3 {EmbeddedEventProc procedure} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-2.3 {EmbeddedEventProc procedure} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -189,10 +168,8 @@ test unixEmbed-2.3 {EmbeddedEventProc procedure} {
destroy .f1
testembed
} {}
-test unixEmbed-2.4 {EmbeddedEventProc procedure} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-2.4 {EmbeddedEventProc procedure} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1]
@@ -204,10 +181,8 @@ test unixEmbed-2.4 {EmbeddedEventProc procedure} {
} {{{XXX .f1 {} {}}} {}}
test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} \
- {nonPortable} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ {unix testembed nonPortable} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -219,20 +194,16 @@ test unixEmbed-3.1 {ContainerEventProc procedure, detect creation} \
}
list $x [testembed]
} {{{XXX .f1 {} {}}} {{XXX .f1 XXX {}}}}
-test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-3.2 {ContainerEventProc procedure, set size on creation} unix {
+ deleteWindows
toplevel .t1 -container 1
wm geometry .t1 +0+0
toplevel .t2 -use [winfo id .t1] -bg red
update
wm geometry .t2
} {200x200+0+0}
-test unixEmbed-3.2 {ContainerEventProc procedure, disallow position changes} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-3.2 {ContainerEventProc procedure, disallow position changes} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -247,10 +218,8 @@ test unixEmbed-3.2 {ContainerEventProc procedure, disallow position changes} {
wm geometry .t1
}
} {200x200+0+0}
-test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -265,10 +234,8 @@ test unixEmbed-3.3 {ContainerEventProc procedure, disallow position changes} {
wm geometry .t1
}
} {300x100+0+0}
-test unixEmbed-3.4 {ContainerEventProc procedure, geometry requests} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-3.4 {ContainerEventProc procedure, geometry requests} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -283,10 +250,8 @@ test unixEmbed-3.4 {ContainerEventProc procedure, geometry requests} {
update
list [winfo width .f1] [winfo height .f1] [dobg {wm geometry .t1}]
} {300 80 300x80+0+0}
-test unixEmbed-3.5 {ContainerEventProc procedure, map requests} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-3.5 {ContainerEventProc procedure, map requests} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -303,10 +268,8 @@ test unixEmbed-3.5 {ContainerEventProc procedure, map requests} {
set x
}
} {mapped}
-test unixEmbed-3.6 {ContainerEventProc procedure, destroy events} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-3.6 {ContainerEventProc procedure, destroy events} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -324,10 +287,8 @@ test unixEmbed-3.6 {ContainerEventProc procedure, destroy events} {
list $x [winfo exists .f1]
} {dead 0}
-test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -344,10 +305,8 @@ test unixEmbed-4.1 {EmbedStructureProc procedure, configure events} {
winfo geometry .t1
}
} {180x100+0+0}
-test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -361,10 +320,8 @@ test unixEmbed-4.2 {EmbedStructureProc procedure, destroy events} {
list $x [testembed]
} {{{XXX .f1 XXX {}}} {}}
-test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -379,10 +336,8 @@ test unixEmbed-5.1 {EmbedFocusProc procedure, FocusIn events} {
update
dobg {set x}
} {{focus in .t1}}
-test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -398,10 +353,8 @@ test unixEmbed-5.2 {EmbedFocusProc procedure, focusing on dead window} {
focus -force .f1
update
} {}
-test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -420,10 +373,8 @@ test unixEmbed-5.3 {EmbedFocusProc procedure, FocusOut events} {
list $x [dobg {update; set x}]
} {{{focus in .t1}} {{focus in .t1} {focus out .t1}}}
-test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -440,10 +391,8 @@ test unixEmbed-6.1 {EmbedGeometryRequest procedure, window changes size} {
list $x [winfo geom .t1]
}
} {{{configure .t1 300 120}} 300x120+0+0}
-test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
place .f1 -width 200 -height 200
dobg "set w1 [winfo id .f1]"
@@ -464,10 +413,8 @@ test unixEmbed-6.2 {EmbedGeometryRequest procedure, window changes size} {
# Can't think up any tests for TkpGetOtherWindow procedure.
-test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -489,10 +436,8 @@ test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} {
bind . <KeyPress> {}
list $x $y
} {{{key a 1}} {}}
-test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -517,10 +462,8 @@ test unixEmbed-7.2 {TkpRedirectKeyEvent procedure, don't forward keystroke width
list $x $y
} {{} {{key b}}}
-test unixEmbed-8.1 {TkpClaimFocus procedure} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-8.1 {TkpClaimFocus procedure} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
@@ -540,17 +483,15 @@ test unixEmbed-8.1 {TkpClaimFocus procedure} {
lappend x [focus]
}] [focus]
} {{{} .t1} .f1}
-test unixEmbed-8.2 {TkpClaimFocus procedure} {
+test unixEmbed-8.2 {TkpClaimFocus procedure} unix {
catch {interp delete child}
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -width 200 -height 50
pack .f1 .f2
interp create child
child eval "set argv {-use [winfo id .f1]}"
- load {} tk child
+ load {} Tk child
child eval {
. configure -bd 2 -highlightthickness 2 -relief sunken
}
@@ -565,10 +506,8 @@ test unixEmbed-8.2 {TkpClaimFocus procedure} {
} {{{} .} .f1}
catch {interp delete child}
-test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
frame .f2 -container 1 -width 200 -height 50
frame .f3 -container 1 -width 200 -height 50
@@ -582,10 +521,8 @@ test unixEmbed-9.1 {EmbedWindowDeleted procedure, check parentPtr} {
}
set x
} {{{XXX .f4 {} {}} {XXX .f3 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f4 {} {}} {XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}} {XXX .f1 {} {}}} {{XXX .f2 {} {}}} {}}
-test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} {unix testembed} {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
dobg "set w1 [winfo id .f1]"
@@ -599,10 +536,8 @@ test unixEmbed-9.2 {EmbedWindowDeleted procedure, check embeddedPtr} {
}
} {{{XXX {} {} .t1}} {}}
-test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -611,10 +546,8 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {
update
wm geometry .t1
} {150x80+0+0}
-test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {
- foreach w [winfo child .] {
- catch {destroy $w}
- }
+test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} unix {
+ deleteWindows
frame .f1 -container 1 -width 200 -height 50
pack .f1
toplevel .t1 -use [winfo id .f1] -width 150 -height 80
@@ -625,9 +558,7 @@ test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} {
} {70x300+0+0}
# cleanup
-foreach w [winfo child .] {
- catch {destroy $w}
-}
+deleteWindows
cleanupbg
::tcltest::cleanupTests
return
diff --git a/tk/tests/unixFont.test b/tk/tests/unixFont.test
index b39697a9a79..43a3d137eb6 100644
--- a/tk/tests/unixFont.test
+++ b/tk/tests/unixFont.test
@@ -14,14 +14,31 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {$tcl_platform(platform)!="unix"} {
- puts "skipping: Unix only tests..."
- ::tcltest::cleanupTests
- return
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+testConstraint hasArial 1
+testConstraint hasCourierNew 1
+testConstraint hasTimesNew 1
+set xlsf [auto_execok xlsfonts]
+if {[llength $xlsf]} {
+ foreach {constraint font} {
+ hasArial arial
+ hasCourierNew "courier new"
+ hasTimesNew "times new roman"
+ } {
+ if {![catch {eval exec $xlsf [list *-$font-*]} res]
+ && ![string match *unmatched* $res]} {
+ # Newer Unix systems have more default fonts installed,
+ # so we can't rely on fallbacks for fonts to need to
+ # fall back on anything.
+ testConstraint $constraint 0
+ }
+ }
}
catch {destroy .b}
@@ -50,58 +67,58 @@ proc getsize {} {
return "[winfo reqwidth .b.l] [winfo reqheight .b.l]"
}
-test unixfont-1.1 {TkpGetNativeFont procedure: not native} {noExceed} {
+test unixfont-1.1 {TkpGetNativeFont procedure: not native} {unix noExceed} {
list [catch {font measure {} xyz} msg] $msg
} {1 {font "" doesn't exist}}
-test unixfont-1.2 {TkpGetNativeFont procedure: native} {
+test unixfont-1.2 {TkpGetNativeFont procedure: native} unix {
font measure fixed 0
} {6}
-test unixfont-2.1 {TkpGetFontFromAttributes procedure: no family} {
+test unixfont-2.1 {TkpGetFontFromAttributes procedure: no family} unix {
font actual {-size 10}
set x {}
} {}
test unixfont-2.2 {TkpGetFontFromAttributes procedure: Times relatives} \
- {noExceed} {
+ {unix noExceed hasTimesNew} {
set x {}
lappend x [lindex [font actual {-family "Times New Roman"}] 1]
lappend x [lindex [font actual {-family "New York"}] 1]
lappend x [lindex [font actual {-family "Times"}] 1]
} {times times times}
test unixfont-2.3 {TkpGetFontFromAttributes procedure: Courier relatives} \
- {noExceed} {
+ {unix noExceed hasCourierNew} {
set x {}
lappend x [lindex [font actual {-family "Courier New"}] 1]
lappend x [lindex [font actual {-family "Monaco"}] 1]
lappend x [lindex [font actual {-family "Courier"}] 1]
} {courier courier courier}
test unixfont-2.4 {TkpGetFontFromAttributes procedure: Helvetica relatives} \
- {noExceed} {
+ {unix noExceed hasArial} {
set x {}
lappend x [lindex [font actual {-family "Arial"}] 1]
lappend x [lindex [font actual {-family "Geneva"}] 1]
lappend x [lindex [font actual {-family "Helvetica"}] 1]
} {helvetica helvetica helvetica}
-test unixfont-2.5 {TkpGetFontFromAttributes procedure: fallback} {
+test unixfont-2.5 {TkpGetFontFromAttributes procedure: fallback} unix {
font actual {-xyz-xyz-*-*-*-*-*-*-*-*-*-*-*-*}
set x {}
} {}
-test unixfont-2.6 {TkpGetFontFromAttributes: fallback to fixed family} {
+test unixfont-2.6 {TkpGetFontFromAttributes: fallback to fixed family} unix {
lindex [font actual {-family fixed -size 10}] 1
} {fixed}
-test unixfont-2.7 {TkpGetFontFromAttributes: fixed family not available!} {
+test unixfont-2.7 {TkpGetFontFromAttributes: fixed family not available!} unix {
# no test available
} {}
-test unixfont-2.8 {TkpGetFontFromAttributes: loop over returned font names} {
+test unixfont-2.8 {TkpGetFontFromAttributes: loop over returned font names} unix {
lindex [font actual {-family fixed -size 31}] 1
} {fixed}
-test unixfont-2.9 {TkpGetFontFromAttributes: reject adobe courier if possible} {noExceed} {
+test unixfont-2.9 {TkpGetFontFromAttributes: reject adobe courier if possible} {unix noExceed} {
lindex [font actual {-family courier}] 1
} {courier}
-test unixfont-2.10 {TkpGetFontFromAttributes: scalable font found} {
+test unixfont-2.10 {TkpGetFontFromAttributes: scalable font found} unix {
lindex [font actual {-family courier -size 37}] 3
} {37}
-test unixfont-2.11 {TkpGetFontFromAttributes: font cannot be loaded} {
+test unixfont-2.11 {TkpGetFontFromAttributes: font cannot be loaded} unix {
# On Linux, XListFonts() was returning names for fonts that do not
# actually exist, causing the subsequent XLoadQueryFont() to fail
# unexpectedly. Now falls back to another font if that happens.
@@ -110,114 +127,114 @@ test unixfont-2.11 {TkpGetFontFromAttributes: font cannot be loaded} {
set x {}
} {}
-test unixfont-3.1 {TkpDeleteFont procedure} {
+test unixfont-3.1 {TkpDeleteFont procedure} unix {
font actual {-family xyz}
set x {}
} {}
-test unixfont-4.1 {TkpGetFontFamilies procedure} {
+test unixfont-4.1 {TkpGetFontFamilies procedure} unix {
font families
set x {}
} {}
-test unixfont-5.1 {Tk_MeasureChars procedure: no chars to be measured} {
+test unixfont-5.1 {Tk_MeasureChars procedure: no chars to be measured} unix {
.b.l config -text "000000" -wrap [expr $ax*3]
.b.l config -wrap 0
} {}
-test unixfont-5.2 {Tk_MeasureChars procedure: no right margin} {
+test unixfont-5.2 {Tk_MeasureChars procedure: no right margin} unix {
.b.l config -text "000000"
} {}
-test unixfont-5.3 {Tk_MeasureChars procedure: loop over chars} {
+test unixfont-5.3 {Tk_MeasureChars procedure: loop over chars} unix {
.b.l config -text "0"
.b.l config -text "\377"
.b.l config -text "0\3770\377"
.b.l config -text "000000000000000"
} {}
.b.l config -wrap [expr $ax*10]
-test unixfont-5.4 {Tk_MeasureChars procedure: reached right edge} {
+test unixfont-5.4 {Tk_MeasureChars procedure: reached right edge} unix {
.b.l config -text "0000000000000"
getsize
} "[expr $ax*10] [expr $ay*2]"
-test unixfont-5.5 {Tk_MeasureChars procedure: ran out of chars} {
+test unixfont-5.5 {Tk_MeasureChars procedure: ran out of chars} unix {
.b.l config -text "000000"
getsize
} "[expr $ax*6] $ay"
-test unixfont-5.6 {Tk_MeasureChars procedure: find last word} {
+test unixfont-5.6 {Tk_MeasureChars procedure: find last word} unix {
.b.l config -text "000000 00000"
getsize
} "[expr $ax*6] [expr $ay*2]"
-test unixfont-5.7 {Tk_MeasureChars procedure: already saw space in line} {
+test unixfont-5.7 {Tk_MeasureChars procedure: already saw space in line} unix {
.b.l config -text "000000 00000"
getsize
} "[expr $ax*6] [expr $ay*2]"
-test unixfont-5.8 {Tk_MeasureChars procedure: internal spaces significant} {
+test unixfont-5.8 {Tk_MeasureChars procedure: internal spaces significant} unix {
.b.l config -text "00 000 00000"
getsize
} "[expr $ax*7] [expr $ay*2]"
-test unixfont-5.9 {Tk_MeasureChars procedure: TK_PARTIAL_OK} {
+test unixfont-5.9 {Tk_MeasureChars procedure: TK_PARTIAL_OK} unix {
.b.c dchars $t 0 end
.b.c insert $t 0 "0000"
.b.c index $t @[expr int($ax*2.5)],1
} {2}
-test unixfont-5.10 {Tk_MeasureChars procedure: TK_AT_LEAST_ONE} {
+test unixfont-5.10 {Tk_MeasureChars procedure: TK_AT_LEAST_ONE} unix {
.b.l config -text "000000000000"
getsize
} "[expr $ax*10] [expr $ay*2]"
-test unixfont-5.11 {Tk_MeasureChars: TK_AT_LEAST_ONE + not even one char fit!} {
+test unixfont-5.11 {Tk_MeasureChars: TK_AT_LEAST_ONE + not even one char fit!} unix {
set a [.b.l cget -wrap]
.b.l config -text "000000" -wrap 1
set x [getsize]
.b.l config -wrap $a
set x
} "$ax [expr $ay*6]"
-test unixfont-5.12 {Tk_MeasureChars procedure: include eol spaces} {
+test unixfont-5.12 {Tk_MeasureChars procedure: include eol spaces} unix {
.b.l config -text "000 \n000"
getsize
} "[expr $ax*6] [expr $ay*2]"
-test unixfont-6.1 {Tk_DrawChars procedure: loop test} {
+test unixfont-6.1 {Tk_DrawChars procedure: loop test} unix {
.b.l config -text "a"
update
} {}
-test unixfont-6.2 {Tk_DrawChars procedure: loop test} {
+test unixfont-6.2 {Tk_DrawChars procedure: loop test} unix {
.b.l config -text "abcd"
update
} {}
-test unixfont-6.3 {Tk_DrawChars procedure: special char} {
+test unixfont-6.3 {Tk_DrawChars procedure: special char} unix {
.b.l config -text "\001"
update
} {}
-test unixfont-6.4 {Tk_DrawChars procedure: normal then special} {
+test unixfont-6.4 {Tk_DrawChars procedure: normal then special} unix {
.b.l config -text "ab\001"
update
} {}
-test unixfont-6.5 {Tk_DrawChars procedure: ends with special} {
+test unixfont-6.5 {Tk_DrawChars procedure: ends with special} unix {
.b.l config -text "ab\001"
update
} {}
-test unixfont-6.6 {Tk_DrawChars procedure: more normal chars at end} {
+test unixfont-6.6 {Tk_DrawChars procedure: more normal chars at end} unix {
.b.l config -text "ab\001def"
update
} {}
-test unixfont-7.1 {DrawChars procedure: no effects} {
+test unixfont-7.1 {DrawChars procedure: no effects} unix {
.b.l config -text "abc"
update
} {}
-test unixfont-7.2 {DrawChars procedure: underlining} {
+test unixfont-7.2 {DrawChars procedure: underlining} unix {
set f [.b.l cget -font]
.b.l config -text "abc" -font "courier 10 underline"
update
.b.l config -font $f
} {}
-test unixfont-7.3 {DrawChars procedure: overstrike} {
+test unixfont-7.3 {DrawChars procedure: overstrike} unix {
set f [.b.l cget -font]
.b.l config -text "abc" -font "courier 10 overstrike"
update
.b.l config -font $f
} {}
-test unixfont-8.1 {AllocFont procedure: use old font} {
+test unixfont-8.1 {AllocFont procedure: use old font} unix {
font create xyz
button .c -font xyz
font configure xyz -family times
@@ -225,10 +242,10 @@ test unixfont-8.1 {AllocFont procedure: use old font} {
destroy .c
font delete xyz
} {}
-test unixfont-8.2 {AllocFont procedure: parse information from XLFD} {
+test unixfont-8.2 {AllocFont procedure: parse information from XLFD} unix {
expr {[lindex [font actual {-family times -size 0}] 3] == 0}
} {0}
-test unixfont-8.3 {AllocFont procedure: can't parse info from name} {
+test unixfont-8.3 {AllocFont procedure: can't parse info from name} unix {
catch {unset fontArray}
# check that font actual returns the correct attributes.
# the values of those attributes are system dependent.
@@ -237,7 +254,7 @@ test unixfont-8.3 {AllocFont procedure: can't parse info from name} {
catch {unset fontArray}
set result
} {-family -overstrike -size -slant -underline -weight}
-test unixfont-8.4 {AllocFont procedure: classify characters} {
+test unixfont-8.4 {AllocFont procedure: classify characters} unix {
set x 0
incr x [font measure $courier "\u4000"] ;# 6
incr x [font measure $courier "\002"] ;# 4
@@ -245,38 +262,38 @@ test unixfont-8.4 {AllocFont procedure: classify characters} {
incr x [font measure $courier "\101"] ;# 1
set x
} [expr $cx*13]
-test unixfont-8.5 {AllocFont procedure: setup widths of normal chars} {
+test unixfont-8.5 {AllocFont procedure: setup widths of normal chars} unix {
font metrics $courier -fixed
} {1}
-test unixfont-8.6 {AllocFont procedure: setup widths of special chars} {
+test unixfont-8.6 {AllocFont procedure: setup widths of special chars} unix {
set x 0
incr x [font measure $courier "\001"] ;# 4
incr x [font measure $courier "\002"] ;# 4
incr x [font measure $courier "\012"] ;# 2
set x
} [expr $cx*10]
-test unixfont-8.7 {AllocFont procedure: XA_UNDERLINE_POSITION} {
+test unixfont-8.7 {AllocFont procedure: XA_UNDERLINE_POSITION} unix {
catch {font actual -adobe-courier-bold-i-normal--0-0-0-0-m-0-iso8859-1}
set x {}
} {}
-test unixfont-8.8 {AllocFont procedure: no XA_UNDERLINE_POSITION} {
+test unixfont-8.8 {AllocFont procedure: no XA_UNDERLINE_POSITION} unix {
catch {font actual --symbol-medium-r-normal--0-0-0-0-p-0-sun-fontspecific}
set x {}
} {}
-test unixfont-8.9 {AllocFont procedure: XA_UNDERLINE_THICKNESS} {
+test unixfont-8.9 {AllocFont procedure: XA_UNDERLINE_THICKNESS} unix {
catch {font actual -adobe-courier-bold-i-normal--0-0-0-0-m-0-iso8859-1}
set x {}
} {}
-test unixfont-8.10 {AllocFont procedure: no XA_UNDERLINE_THICKNESS} {
+test unixfont-8.10 {AllocFont procedure: no XA_UNDERLINE_THICKNESS} unix {
catch {font actual --symbol-medium-r-normal--0-0-0-0-p-0-sun-fontspecific}
set x {}
} {}
-test unixfont-8.11 {AllocFont procedure: XA_UNDERLINE_POSITION was 0} {
+test unixfont-8.11 {AllocFont procedure: XA_UNDERLINE_POSITION was 0} unix {
catch {font actual -adobe-courier-bold-i-normal--0-0-0-0-m-0-iso8859-1}
set x {}
} {}
-test unixfont-9.1 {GetControlCharSubst procedure: 2 chars subst} {
+test unixfont-9.1 {GetControlCharSubst procedure: 2 chars subst} unix {
.b.c dchars $t 0 end
.b.c insert $t 0 "0\a0"
set x {}
@@ -285,7 +302,7 @@ test unixfont-9.1 {GetControlCharSubst procedure: 2 chars subst} {
lappend x [.b.c index $t @[expr $ax*2],0]
lappend x [.b.c index $t @[expr $ax*3],0]
} {0 1 1 2}
-test unixfont-9.2 {GetControlCharSubst procedure: 4 chars subst} {
+test unixfont-9.2 {GetControlCharSubst procedure: 4 chars subst} unix {
.b.c dchars $t 0 end
.b.c insert $t 0 "0\0010"
set x {}
diff --git a/tk/tests/unixMenu.test b/tk/tests/unixMenu.test
index f93e2a14402..863d576e23b 100644
--- a/tk/tests/unixMenu.test
+++ b/tk/tests/unixMenu.test
@@ -9,39 +9,18 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-if {$tcl_platform(platform) != "unix"} {
- puts "skipping: Unix only tests..."
- ::tcltest::cleanupTests
- return
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-proc deleteWindows {} {
- foreach i [winfo children .] {
- catch [destroy $i]
- }
-}
-
-deleteWindows
-wm geometry . {}
-raise .
-
-test unixMenu-1.1 {TkpNewMenu - normal menu} {
+test unixMenu-1.1 {TkpNewMenu - normal menu} unix {
catch {destroy .m1}
list [catch {menu .m1} msg] $msg [destroy .m1]
} {0 .m1 {}}
-test unixMenu-1.2 {TkpNewMenu - help menu} {
+test unixMenu-1.2 {TkpNewMenu - help menu} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
. configure -menu .m1
@@ -52,13 +31,13 @@ test unixMenu-1.2 {TkpNewMenu - help menu} {
test unixMenu-2.1 {TkpDestroyMenu - nothing to do} {} {}
test unixMenu-3.1 {TkpDestroymenuEntry - nothing to do} {} {}
-test unixMenu-4.1 {TkpConfigureMenuEntry - non-cascade entry} {
+test unixMenu-4.1 {TkpConfigureMenuEntry - non-cascade entry} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label test
list [catch {.m1 entryconfigure test -label foo} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-4.2 {TkpConfigureMenuEntry - cascade entry} {
+test unixMenu-4.2 {TkpConfigureMenuEntry - cascade entry} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -menu .m2 -label test
@@ -68,14 +47,14 @@ test unixMenu-4.2 {TkpConfigureMenuEntry - cascade entry} {
test unixMenu-5.1 {TkpMenuNewEntry - nothing to do} {} {}
-test unixMenu-6.1 {TkpSetWindowMenuBar - null menu} {
+test unixMenu-6.1 {TkpSetWindowMenuBar - null menu} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
. configure -menu .m1
list [catch {. configure -menu ""} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-6.2 {TkpSetWindowMenuBar - menu} {
+test unixMenu-6.2 {TkpSetWindowMenuBar - menu} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
@@ -84,92 +63,92 @@ test unixMenu-6.2 {TkpSetWindowMenuBar - menu} {
test unixMenu-7.1 {TkpSetMainMenubar - nothing to do} {} {}
-test unixMenu-8.1 {GetMenuIndicatorGeometry - indicator off} {
+test unixMenu-8.1 {GetMenuIndicatorGeometry - indicator off} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo -indicatoron 0
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-8.2 {GetMenuIndicatorGeometry - not checkbutton or radio} {
+test unixMenu-8.2 {GetMenuIndicatorGeometry - not checkbutton or radio} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-8.3 {GetMenuIndicatorGeometry - checkbutton image} {
+test unixMenu-8.3 {GetMenuIndicatorGeometry - checkbutton image} {unix testImageType} {
catch {destroy .m1}
catch {image delete image1}
menu .m1
image create test image1
.m1 add checkbutton -image image1 -label foo
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
} {0 {} {}}
-test unixMenu-8.4 {GetMenuIndicatorGeometry - checkbutton bitmap} {
+test unixMenu-8.4 {GetMenuIndicatorGeometry - checkbutton bitmap} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -bitmap questhead -label foo
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-8.5 {GetMenuIndicatorGeometry - checkbutton} {
+test unixMenu-8.5 {GetMenuIndicatorGeometry - checkbutton} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-8.6 {GetMenuIndicatorGeometry - radiobutton image} {
+test unixMenu-8.6 {GetMenuIndicatorGeometry - radiobutton image} {unix testImageType} {
catch {destroy .m1}
catch {image delete image1}
menu .m1
image create test image1
.m1 add radiobutton -image image1 -label foo
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] [image delete image1]
} {0 {} {}}
-test unixMenu-8.7 {GetMenuIndicatorGeometry - radiobutton bitmap} {
+test unixMenu-8.7 {GetMenuIndicatorGeometry - radiobutton bitmap} unix {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -bitmap questhead -label foo
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-8.8 {GetMenuIndicatorGeometry - radiobutton} {
+test unixMenu-8.8 {GetMenuIndicatorGeometry - radiobutton} unix {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label foo
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} {
+test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} unix {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label foo -hidemargin 1
.m1 invoke foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} {
+test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-9.2 {GetMenuAccelGeometry - non-null label} {
+test unixMenu-9.2 {GetMenuAccelGeometry - non-null label} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Ctrl+S"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-9.3 {GetMenuAccelGeometry - null label} {
+test unixMenu-9.3 {GetMenuAccelGeometry - null label} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} {
+test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
@@ -177,23 +156,23 @@ test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} {
.m1 activate 1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-10.2 {DrawMenuEntryBackground - active} {
+test unixMenu-10.2 {DrawMenuEntryBackground - active} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff activate 0
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-10.3 {DrawMenuEntryBackground - non-active} {
+test unixMenu-10.3 {DrawMenuEntryBackground - non-active} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-11.1 {DrawMenuEntryAccelerator - menubar} {
+test unixMenu-11.1 {DrawMenuEntryAccelerator - menubar} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
@@ -201,179 +180,179 @@ test unixMenu-11.1 {DrawMenuEntryAccelerator - menubar} {
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
# drawArrow parameter is never false under Unix
-test unixMenu-11.2 {DrawMenuEntryAccelerator - cascade entry} {
+test unixMenu-11.2 {DrawMenuEntryAccelerator - cascade entry} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-11.3 {DrawMenuEntryAccelerator - normal entry} {
+test unixMenu-11.3 {DrawMenuEntryAccelerator - normal entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} {
+test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-12.1 {DrawMenuEntryIndicator - non-check or radio} {
+test unixMenu-12.1 {DrawMenuEntryIndicator - non-check or radio} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-12.2 {DrawMenuEntryIndicator - checkbutton - indicator off} {
+test unixMenu-12.2 {DrawMenuEntryIndicator - checkbutton - indicator off} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo -indicatoron 0
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-12.3 {DrawMenuEntryIndicator - checkbutton - not selected} {
+test unixMenu-12.3 {DrawMenuEntryIndicator - checkbutton - not selected} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-12.4 {DrawMenuEntryIndicator - checkbutton - selected} {
+test unixMenu-12.4 {DrawMenuEntryIndicator - checkbutton - selected} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-12.5 {DrawMenuEntryIndicator - radiobutton - indicator off} {
+test unixMenu-12.5 {DrawMenuEntryIndicator - radiobutton - indicator off} unix {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label foo -indicatoron 0
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-12.6 {DrawMenuEntryIndicator - radiobutton - not selected} {
+test unixMenu-12.6 {DrawMenuEntryIndicator - radiobutton - not selected} unix {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} {
+test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} unix {
catch {destroy .m1}
menu .m1
.m1 add radiobutton -label foo
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-13.1 {DrawMenuSeparator - menubar case} {
+test unixMenu-13.1 {DrawMenuSeparator - menubar case} unix {
catch {destroy .m1}
menu .m1
.m1 add separator
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-13.2 {DrawMenuSepartor - normal menu} {
+test unixMenu-13.2 {DrawMenuSepartor - normal menu} unix {
catch {destroy .m1}
menu .m1
.m1 add separator
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-14.1 {DrawMenuEntryLabel} {
+test unixMenu-14.1 {DrawMenuEntryLabel} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-15.1 {DrawMenuUnderline - menubar} {
+test unixMenu-15.1 {DrawMenuUnderline - menubar} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -underline 0
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-15.2 {DrawMenuUnderline - no menubar} {
+test unixMenu-15.2 {DrawMenuUnderline - no menubar} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -underline 0
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [catch {update} msg] $msg [destroy .m1]
} {0 {} {}}
-test unixMenu-16.1 {TkpPostMenu} {
+test unixMenu-16.1 {TkpPostMenu} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-17.1 {GetMenuSeparatorGeometry} {
+test unixMenu-17.1 {GetMenuSeparatorGeometry} unix {
catch {destroy .m1}
menu .m1
.m1 add separator
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
-test unixMenu-18.1 {GetTearoffEntryGeometry} {
+test unixMenu-18.1 {GetTearoffEntryGeometry} unix {
catch {destroy .m1}
menubutton .mb -text "test" -menu .mb.m
menu .mb.m
.mb.m add command -label test
pack .mb
raise .
- list [catch {tkMbPost .mb} msg] $msg [tkMenuUnpost .mb.m] [destroy .mb]
+ list [catch {tk::MbPost .mb} msg] $msg [tk::MenuUnpost .mb.m] [destroy .mb]
} {0 {} {} {}}
# Don't know how to reproduce the case where the tkwin has been deleted.
-test unixMenu-19.1 {TkpComputeMenubarGeometry - zero entries} {
+test unixMenu-19.1 {TkpComputeMenubarGeometry - zero entries} unix {
catch {destroy .m1}
menu .m1
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
# Don't know how to generate one width windows
-test unixMenu-19.2 {TkpComputeMenubarGeometry - one entry} {
+test unixMenu-19.2 {TkpComputeMenubarGeometry - one entry} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label File
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.3 {TkpComputeMenubarGeometry - entry with different font} {
+test unixMenu-19.3 {TkpComputeMenubarGeometry - entry with different font} unix {
catch {destroy .m1}
menu .m1 -font "Courier 24"
.m1 add cascade -label File -font "Helvetica 18"
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.4 {TkpComputeMenubarGeometry - separator} {
+test unixMenu-19.4 {TkpComputeMenubarGeometry - separator} unix {
catch {destroy .m1}
menu .m1
.m1 add separator
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.5 {TkpComputeMenubarGeometry - First entry} {
+test unixMenu-19.5 {TkpComputeMenubarGeometry - First entry} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.6 {TkpComputeMenubarGeometry - First entry too wide} {
+test unixMenu-19.6 {TkpComputeMenubarGeometry - First entry too wide} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File -font "Times 72"
@@ -381,7 +360,7 @@ test unixMenu-19.6 {TkpComputeMenubarGeometry - First entry too wide} {
wm geometry . 10x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.7 {TkpComputeMenubarGeometry - two entries fit} {
+test unixMenu-19.7 {TkpComputeMenubarGeometry - two entries fit} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File
@@ -390,7 +369,7 @@ test unixMenu-19.7 {TkpComputeMenubarGeometry - two entries fit} {
wm geometry . 200x200
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.8 {TkpComputeMenubarGeometry - two entries; 2nd don't fit} {
+test unixMenu-19.8 {TkpComputeMenubarGeometry - two entries; 2nd don't fit} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File
@@ -399,7 +378,7 @@ test unixMenu-19.8 {TkpComputeMenubarGeometry - two entries; 2nd don't fit} {
wm geometry . 100x100
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.9 {TkpComputeMenubarGeometry - two entries; 1st dont fit} {
+test unixMenu-19.9 {TkpComputeMenubarGeometry - two entries; 1st dont fit} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File -font "Times 72"
@@ -408,7 +387,7 @@ test unixMenu-19.9 {TkpComputeMenubarGeometry - two entries; 1st dont fit} {
wm geometry . 100x100
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.10 {TkpComputeMenubarGeometry - two entries; neither fit} {
+test unixMenu-19.10 {TkpComputeMenubarGeometry - two entries; neither fit} unix {
catch {destroy .m1}
menu .m1 -tearoff 0 -font "Times 72"
.m1 add cascade -label File
@@ -419,7 +398,7 @@ test unixMenu-19.10 {TkpComputeMenubarGeometry - two entries; neither fit} {
} {0 {} {} {}}
# ABC notation; capital A means first window fits, small a means it
# does not. capital B menu means second window fist, etc.
-test unixMenu-19.11 {TkpComputeMenubarGeometry - abc} {
+test unixMenu-19.11 {TkpComputeMenubarGeometry - abc} unix {
catch {destroy .m1}
menu .m1 -tearoff 0 -font "Times 72"
.m1 add cascade -label "aaaaa"
@@ -429,7 +408,7 @@ test unixMenu-19.11 {TkpComputeMenubarGeometry - abc} {
wm geometry . 10x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.12 {TkpComputeMenubarGeometry - abC} {
+test unixMenu-19.12 {TkpComputeMenubarGeometry - abC} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label "aaaaa" -font "Times 72"
@@ -439,7 +418,7 @@ test unixMenu-19.12 {TkpComputeMenubarGeometry - abC} {
wm geometry . 10x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.13 {TkpComputeMenubarGeometry - aBc} {
+test unixMenu-19.13 {TkpComputeMenubarGeometry - aBc} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label "aaaaa" -font "Times 72"
@@ -449,7 +428,7 @@ test unixMenu-19.13 {TkpComputeMenubarGeometry - aBc} {
wm geometry . 10x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.14 {TkpComputeMenubarGeometry - aBC} {
+test unixMenu-19.14 {TkpComputeMenubarGeometry - aBC} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label "aaaaa" -font "Times 72"
@@ -459,7 +438,7 @@ test unixMenu-19.14 {TkpComputeMenubarGeometry - aBC} {
wm geometry . 60x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.15 {TkpComputeMenubarGeometry - Abc} {
+test unixMenu-19.15 {TkpComputeMenubarGeometry - Abc} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label "A"
@@ -469,7 +448,7 @@ test unixMenu-19.15 {TkpComputeMenubarGeometry - Abc} {
wm geometry . 60x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.16 {TkpComputeMenubarGeometry - AbC} {
+test unixMenu-19.16 {TkpComputeMenubarGeometry - AbC} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label "A"
@@ -479,7 +458,7 @@ test unixMenu-19.16 {TkpComputeMenubarGeometry - AbC} {
wm geometry . 60x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.17 {TkpComputeMenubarGeometry - ABc} {
+test unixMenu-19.17 {TkpComputeMenubarGeometry - ABc} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label "A"
@@ -489,7 +468,7 @@ test unixMenu-19.17 {TkpComputeMenubarGeometry - ABc} {
wm geometry . 60x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.18 {TkpComputeMenubarGeometry - ABC} {
+test unixMenu-19.18 {TkpComputeMenubarGeometry - ABC} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label "A"
@@ -499,7 +478,7 @@ test unixMenu-19.18 {TkpComputeMenubarGeometry - ABC} {
wm geometry . 100x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.19 {TkpComputeMenubarGeometry - help menu in first position} {
+test unixMenu-19.19 {TkpComputeMenubarGeometry - help menu in first position} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label Help -menu .m1.help
@@ -512,7 +491,7 @@ test unixMenu-19.19 {TkpComputeMenubarGeometry - help menu in first position} {
wm geometry . 100x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.20 {TkpComputeMenubarGeometry - help menu in middle} {
+test unixMenu-19.20 {TkpComputeMenubarGeometry - help menu in middle} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label Edit -menu .m1.edit
@@ -525,7 +504,7 @@ test unixMenu-19.20 {TkpComputeMenubarGeometry - help menu in middle} {
wm geometry . 100x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.21 {TkpComputeMenubarGeometry - help menu in first position} {
+test unixMenu-19.21 {TkpComputeMenubarGeometry - help menu in first position} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File -menu .m1.file
@@ -538,7 +517,7 @@ test unixMenu-19.21 {TkpComputeMenubarGeometry - help menu in first position} {
wm geometry . 100x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.22 {TkpComputeMenubarGeometry - help item fits} {
+test unixMenu-19.22 {TkpComputeMenubarGeometry - help item fits} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File -menu .m1.file
@@ -549,7 +528,7 @@ test unixMenu-19.22 {TkpComputeMenubarGeometry - help item fits} {
wm geometry . 100x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.23 {TkpComputeMenubarGeometry - help item does not fit} {
+test unixMenu-19.23 {TkpComputeMenubarGeometry - help item does not fit} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label File -menu .m1.file
@@ -560,7 +539,7 @@ test unixMenu-19.23 {TkpComputeMenubarGeometry - help item does not fit} {
wm geometry . 100x10
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-19.24 {TkpComputeMenubarGeometry - help item only one} {
+test unixMenu-19.24 {TkpComputeMenubarGeometry - help item only one} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label Help -menu .m1.help
@@ -570,14 +549,14 @@ test unixMenu-19.24 {TkpComputeMenubarGeometry - help item only one} {
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-20.1 {DrawTearoffEntry - menubar} {
+test unixMenu-20.1 {DrawTearoffEntry - menubar} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label File
. configure -menu .m1
list [catch {update} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 {} {} {}}
-test unixMenu-20.2 {DrawTearoffEntry - non-menubar} {
+test unixMenu-20.2 {DrawTearoffEntry - non-menubar} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
@@ -587,28 +566,28 @@ test unixMenu-20.2 {DrawTearoffEntry - non-menubar} {
test unixMenu-21.1 {TkpInitializeMenuBindings - nothing to do} {} {}
-test unixMenu-22.1 {SetHelpMenu - no menubars} {
+test unixMenu-22.1 {SetHelpMenu - no menubars} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add cascade -label test -menu .m1.test
list [catch {menu .m1.test} msg] $msg [destroy .m1]
} {0 .m1.test {}}
# Don't know how to automate missing tkwins
-test unixMenu-22.2 {SetHelpMenu - menubar but no help menu} {
+test unixMenu-22.2 {SetHelpMenu - menubar but no help menu} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
. configure -menu .m1
.m1 add cascade -label .m1.file
list [catch {menu .m1.file} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 .m1.file {} {}}
-test unixMenu-22.3 {SetHelpMenu - menubar with help menu} {
+test unixMenu-22.3 {SetHelpMenu - menubar with help menu} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
. configure -menu .m1
.m1 add cascade -label .m1.help
list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1]
} {0 .m1.help {} {}}
-test unixMenu-22.4 {SetHelpMenu - multiple menubars with same help menu} {
+test unixMenu-22.4 {SetHelpMenu - multiple menubars with same help menu} unix {
catch {destroy .m1}
catch {destroy .t2}
toplevel .t2
@@ -620,179 +599,179 @@ test unixMenu-22.4 {SetHelpMenu - multiple menubars with same help menu} {
list [catch {menu .m1.help} msg] $msg [. configure -menu ""] [destroy .m1] [destroy .t2]
} {0 .m1.help {} {} {}}
-test unixMenu-23.1 {TkpDrawMenuEntry - gc for active and not strict motif} {
+test unixMenu-23.1 {TkpDrawMenuEntry - gc for active and not strict motif} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} {
+test unixMenu-23.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activeforeground red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.3 {TkpDrawMenuEntry - gc for active and strict motif} {
+test unixMenu-23.3 {TkpDrawMenuEntry - gc for active and strict motif} unix {
catch {destroy .m1}
menu .m1
set tk_strictMotif 1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
} {{} {} 0}
-test unixMenu-23.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} {
+test unixMenu-23.4 {TkpDrawMenuEntry - gc for disabled with disabledfg and custom entry} unix {
catch {destroy .m1}
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled -background red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {
+test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} unix {
catch {destroy .m1}
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {
+test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} unix {
catch {destroy .m1}
menu .m1 -disabledforeground ""
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} {
+test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -foreground red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} {
+test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {
+test unixMenu-23.9 {TkpDrawMenuEntry - gc for indicator - custom entry} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo -selectcolor orange
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.10 {TkpDrawMenuEntry - gc for indicator} {
+test unixMenu-23.10 {TkpDrawMenuEntry - gc for indicator} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.11 {TkpDrawMenuEntry - border - custom entry} {
+test unixMenu-23.11 {TkpDrawMenuEntry - border - custom entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activebackground green
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.12 {TkpDrawMenuEntry - border} {
+test unixMenu-23.12 {TkpDrawMenuEntry - border} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.13 {TkpDrawMenuEntry - active border - strict motif} {
+test unixMenu-23.13 {TkpDrawMenuEntry - active border - strict motif} unix {
catch {destroy .m1}
set tk_strictMotif 1
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
} {{} {} 0}
-test unixMenu-23.14 {TkpDrawMenuEntry - active border - custom entry} {
+test unixMenu-23.14 {TkpDrawMenuEntry - active border - custom entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activeforeground yellow
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.15 {TkpDrawMenuEntry - active border} {
+test unixMenu-23.15 {TkpDrawMenuEntry - active border} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.16 {TkpDrawMenuEntry - font - custom entry} {
+test unixMenu-23.16 {TkpDrawMenuEntry - font - custom entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -font "Helvectica 72"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.17 {TkpDrawMenuEntry - font} {
+test unixMenu-23.17 {TkpDrawMenuEntry - font} unix {
catch {destroy .m1}
menu .m1 -font "Courier 72"
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.18 {TkpDrawMenuEntry - separator} {
+test unixMenu-23.18 {TkpDrawMenuEntry - separator} unix {
catch {destroy .m1}
menu .m1
.m1 add separator
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.19 {TkpDrawMenuEntry - standard} {
+test unixMenu-23.19 {TkpDrawMenuEntry - standard} unix {
catch {destroy .mb}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} {
+test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} unix {
catch {destroy .m1}
menu .m1
.m1 add cascade -label File -menu .m1.file
menu .m1.file
.m1.file add command -label foo
.m1 entryconfigure File -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.21 {TkpDrawMenuEntry - indicator} {
+test unixMenu-23.21 {TkpDrawMenuEntry - indicator} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label Foo
.m1 invoke Foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} {
+test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label Foo -hidemargin 1
.m1 invoke Foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test unixMenu-24.1 {GetMenuLabelGeometry - image} {
+test unixMenu-24.1 {GetMenuLabelGeometry - image} {testImageType unix} {
catch {destroy .m1}
catch {image delete image1}
menu .m1
@@ -800,44 +779,44 @@ test unixMenu-24.1 {GetMenuLabelGeometry - image} {
.m1 add command -image image1
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
-test unixMenu-24.2 {GetMenuLabelGeometry - bitmap} {
+test unixMenu-24.2 {GetMenuLabelGeometry - bitmap} unix {
catch {destroy .m1}
menu .m1
.m1 add command -bitmap questhead
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-24.3 {GetMenuLabelGeometry - no text} {
+test unixMenu-24.3 {GetMenuLabelGeometry - no text} unix {
catch {destroy .m1}
menu .m1
.m1 add command
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-24.4 {GetMenuLabelGeometry - text} {
+test unixMenu-24.4 {GetMenuLabelGeometry - text} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "This is a test."
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.1 {TkpComputeStandardMenuGeometry - no entries} {
+test unixMenu-25.1 {TkpComputeStandardMenuGeometry - no entries} unix {
catch {destroy .m1}
menu .m1
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.2 {TkpComputeStandardMenuGeometry - one entry} {
+test unixMenu-25.2 {TkpComputeStandardMenuGeometry - one entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "one"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.3 {TkpComputeStandardMenuGeometry - more than one entry} {
+test unixMenu-25.3 {TkpComputeStandardMenuGeometry - more than one entry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "one"
.m1 add command -label "two"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.4 {TkpComputeStandardMenuGeometry - separator} {
+test unixMenu-25.4 {TkpComputeStandardMenuGeometry - separator} unix {
catch {destroy .m1}
menu .m1
.m1 add separator
@@ -849,63 +828,63 @@ test unixMenu-25.5 {TkpComputeStandardMenuGeometry - tearoff entry} {unixOnly} {
menu .mb.m
.mb.m add command -label test
pack .mb
- catch {tkMbPost .mb}
- list [update] [tkMenuUnpost .mb.m] [destroy .mb]
+ catch {tk::MbPost .mb}
+ list [update] [tk::MenuUnpost .mb.m] [destroy .mb]
} {{} {} {}}
-test unixMenu-25.6 {TkpComputeStandardMenuGeometry - standard label geometry} {
+test unixMenu-25.6 {TkpComputeStandardMenuGeometry - standard label geometry} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.7 {TkpComputeStandardMenuGeometry - different font for entry} {
+test unixMenu-25.7 {TkpComputeStandardMenuGeometry - different font for entry} unix {
catch {destroy .m1}
menu .m1 -font "Helvetica 12"
.m1 add command -label "test" -font "Courier 12"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.8 {TkpComputeStandardMenuGeometry - second entry larger} {
+test unixMenu-25.8 {TkpComputeStandardMenuGeometry - second entry larger} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "test"
.m1 add command -label "test test"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.9 {TkpComputeStandardMenuGeometry - first entry larger} {
+test unixMenu-25.9 {TkpComputeStandardMenuGeometry - first entry larger} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "test test"
.m1 add command -label "test"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.10 {TkpComputeStandardMenuGeometry - accelerator} {
+test unixMenu-25.10 {TkpComputeStandardMenuGeometry - accelerator} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "test" -accel "Ctrl+S"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.11 {TkpComputeStandardMenuGeometry - second accel larger} {
+test unixMenu-25.11 {TkpComputeStandardMenuGeometry - second accel larger} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "test" -accel "1"
.m1 add command -label "test" -accel "1 1"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.12 {TkpComputeStandardMenuGeometry - second accel smaller} {
+test unixMenu-25.12 {TkpComputeStandardMenuGeometry - second accel smaller} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label "test" -accel "1 1"
.m1 add command -label "test" -accel "1"
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.13 {TkpComputeStandardMenuGeometry - indicator} {
+test unixMenu-25.13 {TkpComputeStandardMenuGeometry - indicator} unix {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label test
.m1 invoke 1
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.14 {TkpComputeStandardMenuGeometry - second indicator less or equal } {
+test unixMenu-25.14 {TkpComputeStandardMenuGeometry - second indicator less or equal } {unix testImageType} {
catch {destroy .m1}
catch {image delete image1}
image create test image1
@@ -916,7 +895,7 @@ test unixMenu-25.14 {TkpComputeStandardMenuGeometry - second indicator less or e
.m1 invoke 2
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
-test unixMenu-25.15 {TkpComputeStandardMenuGeometry - second indicator larger } {unixOnly} {
+test unixMenu-25.15 {TkpComputeStandardMenuGeometry - second indicator larger } {unixOnly testImageType} {
catch {destroy .m1}
catch {image delete image1}
image create test image1
@@ -927,12 +906,12 @@ test unixMenu-25.15 {TkpComputeStandardMenuGeometry - second indicator larger }
.m1 invoke 2
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
-test unixMenu-25.16 {TkpComputeStandardMenuGeometry - zero sized menus} {
+test unixMenu-25.16 {TkpComputeStandardMenuGeometry - zero sized menus} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.17 {TkpComputeStandardMenuGeometry - first column bigger} {
+test unixMenu-25.17 {TkpComputeStandardMenuGeometry - first column bigger} unix {
catch {destroy .m1}
menu .m1
.m1 add command -label one
@@ -940,7 +919,7 @@ test unixMenu-25.17 {TkpComputeStandardMenuGeometry - first column bigger} {
.m1 add command -label three -columnbreak 1
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.18 {TkpComputeStandardMenuGeometry - second column bigger} {
+test unixMenu-25.18 {TkpComputeStandardMenuGeometry - second column bigger} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label one
@@ -948,7 +927,7 @@ test unixMenu-25.18 {TkpComputeStandardMenuGeometry - second column bigger} {
.m1 add command -label three
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.19 {TkpComputeStandardMenuGeometry - three columns} {
+test unixMenu-25.19 {TkpComputeStandardMenuGeometry - three columns} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add command -label one
@@ -959,7 +938,7 @@ test unixMenu-25.19 {TkpComputeStandardMenuGeometry - three columns} {
.m1 add command -label six
list [update idletasks] [destroy .m1]
} {{} {}}
-test unixMenu-25.20 {TkpComputeStandardMenuGeometry - hide margin} {
+test unixMenu-25.20 {TkpComputeStandardMenuGeometry - hide margin} unix {
catch {destroy .m1}
menu .m1 -tearoff 0
.m1 add checkbutton -label one -hidemargin 1
diff --git a/tk/tests/unixSelect.test b/tk/tests/unixSelect.test
index 9a29d0abcdc..4599caf2d51 100644
--- a/tk/tests/unixSelect.test
+++ b/tk/tests/unixSelect.test
@@ -11,17 +11,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {$tcl_platform(platform) != "unix"} {
- puts "skipping: Unix only tests..."
- ::tcltest::cleanupTests
- return
-}
-
-eval destroy [winfo child .]
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
global longValue selValue selInfo
diff --git a/tk/tests/unixWm.test b/tk/tests/unixWm.test
index 78cb9e4b058..08e5660f63e 100644
--- a/tk/tests/unixWm.test
+++ b/tk/tests/unixWm.test
@@ -9,15 +9,16 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.2
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-if {$tcl_platform(platform) != "unix"} {
- puts "skipping: Unix only tests..."
- ::tcltest::cleanupTests
- return
-}
+namespace import -force tcltest::interpreter
+namespace import -force tcltest::makeFile
+namespace import -force tcltest::removeFile
proc sleep ms {
global x
@@ -28,9 +29,7 @@ proc sleep ms {
# Procedure to set up a collection of top-level windows
proc makeToplevels {} {
- foreach i [winfo child .] {
- destroy $i
- }
+ deleteWindows
foreach i {.raise1 .raise2 .raise3} {
toplevel $i
wm geom $i 150x100+0+0
@@ -41,7 +40,7 @@ proc makeToplevels {} {
set i 1
foreach geom {+20+80 +80+20 +0+0} {
catch {destroy .t}
- test unixWm-1.$i {initial window position} {
+ test unixWm-1.$i {initial window position} unix {
toplevel .t -width 200 -height 150
wm geom .t $geom
update
@@ -66,7 +65,7 @@ scan [wm geom .t] %dx%d+%d+%d width height x y
set xerr [expr 150-$x]
set yerr [expr 150-$y]
foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
- test unixWm-2.$i {moving window while mapped} {
+ test unixWm-2.$i {moving window while mapped} unix {
wm geom .t $geom
update
scan [wm geom .t] %dx%d%1s%d%1s%d width height xsign x ysign y
@@ -78,7 +77,7 @@ foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
set i 1
foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
- test unixWm-3.$i {moving window while iconified} {
+ test unixWm-3.$i {moving window while iconified} unix {
wm iconify .t
sleep 200
wm geom .t $geom
@@ -93,7 +92,7 @@ foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
set i 1
foreach geom {+20+80 +100+40 +0+0} {
- test unixWm-4.$i {moving window while withdrawn} {
+ test unixWm-4.$i {moving window while withdrawn} unix {
wm withdraw .t
sleep 200
wm geom .t $geom
@@ -104,7 +103,7 @@ foreach geom {+20+80 +100+40 +0+0} {
incr i
}
-test unixWm-5.1 {compounded state changes} {nonPortable} {
+test unixWm-5.1 {compounded state changes} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +100+100
@@ -113,7 +112,7 @@ test unixWm-5.1 {compounded state changes} {nonPortable} {
wm deiconify .t
list [winfo ismapped .t] [wm state .t]
} {1 normal}
-test unixWm-5.2 {compounded state changes} {nonPortable} {
+test unixWm-5.2 {compounded state changes} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +100+100
@@ -123,7 +122,7 @@ test unixWm-5.2 {compounded state changes} {nonPortable} {
wm withdraw .t
list [winfo ismapped .t] [wm state .t]
} {0 withdrawn}
-test unixWm-5.3 {compounded state changes} {nonPortable} {
+test unixWm-5.3 {compounded state changes} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +100+100
@@ -134,7 +133,7 @@ test unixWm-5.3 {compounded state changes} {nonPortable} {
wm deiconify .t
list [winfo ismapped .t] [wm state .t]
} {1 normal}
-test unixWm-5.4 {compounded state changes} {nonPortable} {
+test unixWm-5.4 {compounded state changes} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +100+100
@@ -144,7 +143,7 @@ test unixWm-5.4 {compounded state changes} {nonPortable} {
wm iconify .t
list [winfo ismapped .t] [wm state .t]
} {0 iconic}
-test unixWm-5.5 {compounded state changes} {nonPortable} {
+test unixWm-5.5 {compounded state changes} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +100+100
@@ -153,7 +152,7 @@ test unixWm-5.5 {compounded state changes} {nonPortable} {
wm withdraw .t
list [winfo ismapped .t] [wm state .t]
} {0 withdrawn}
-test unixWm-5.6 {compounded state changes} {nonPortable} {
+test unixWm-5.6 {compounded state changes} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +100+100
@@ -163,7 +162,7 @@ test unixWm-5.6 {compounded state changes} {nonPortable} {
wm deiconify .t
list [winfo ismapped .t] [wm state .t]
} {1 normal}
-test unixWm-5.7 {compounded state changes} {nonPortable} {
+test unixWm-5.7 {compounded state changes} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 200 -height 100
wm geometry .t +100+100
@@ -178,25 +177,25 @@ toplevel .t -width 200 -height 100
wm geom .t +10+10
wm minsize .t 1 1
update
-test unixWm-6.1 {size changes} {
+test unixWm-6.1 {size changes} unix {
.t config -width 180 -height 150
update
wm geom .t
} 180x150+10+10
-test unixWm-6.2 {size changes} {
+test unixWm-6.2 {size changes} unix {
wm geom .t 250x60
.t config -width 170 -height 140
update
wm geom .t
} 250x60+10+10
-test unixWm-6.3 {size changes} {
+test unixWm-6.3 {size changes} unix {
wm geom .t 250x60
.t config -width 170 -height 140
wm geom .t {}
update
wm geom .t
} 170x140+10+10
-test unixWm-6.4 {size changes} {nonPortable userInteraction} {
+test unixWm-6.4 {size changes} {unix nonPortable userInteraction} {
wm minsize .t 1 1
update
puts stdout "Please resize window \"t\" with the mouse (but don't move it!),"
@@ -223,7 +222,7 @@ test unixWm-6.4 {size changes} {nonPortable userInteraction} {
# fails under twm.
sleep 200
-test unixWm-6.5 {window initially iconic} {nonPortable} {
+test unixWm-6.5 {window initially iconic} {unix nonPortable} {
catch {destroy .t}
toplevel .t -width 100 -height 30
wm geometry .t +0+0
@@ -243,22 +242,22 @@ foreach i {{Test label} Another {Yet another} {Last label}} j {1 2 3} {
}
wm geometry .m +[expr 100 - [winfo vrootx .]]+[expr 200 - [winfo vrooty .]]
update
-test unixWm-7.1 {override_redirect and Tk_MoveTopLevelWindow} {
+test unixWm-7.1 {override_redirect and Tk_MoveTopLevelWindow} unix {
list [winfo ismapped .m] [wm state .m] [winfo x .m] [winfo y .m]
} {1 normal 100 200}
wm geometry .m +[expr 150 - [winfo vrootx .]]+[expr 210 - [winfo vrooty .]]
update
-test unixWm-7.2 {override_redirect and Tk_MoveTopLevelWindow} {
+test unixWm-7.2 {override_redirect and Tk_MoveTopLevelWindow} unix {
list [winfo ismapped .m] [wm state .m] [winfo x .m] [winfo y .m]
} {1 normal 150 210}
wm withdraw .m
-test unixWm-7.3 {override_redirect and Tk_MoveTopLevelWindow} {
+test unixWm-7.3 {override_redirect and Tk_MoveTopLevelWindow} unix {
list [winfo ismapped .m]
} 0
destroy .m
catch {destroy .t}
-test unixWm-8.1 {icon windows} {
+test unixWm-8.1 {icon windows} unix {
catch {destroy .t}
catch {destroy .icon}
toplevel .t -width 100 -height 30
@@ -267,17 +266,17 @@ test unixWm-8.1 {icon windows} {
wm iconwindow .t .icon
list [catch {wm withdraw .icon} msg] $msg
} {1 {can't withdraw .icon: it is an icon for .t}}
-test unixWm-8.2 {icon windows} {
+test unixWm-8.2 {icon windows} unix {
catch {destroy .t}
toplevel .t -width 100 -height 30
list [catch {wm iconwindow} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-test unixWm-8.3 {icon windows} {
+test unixWm-8.3 {icon windows} unix {
catch {destroy .t}
toplevel .t -width 100 -height 30
list [catch {wm iconwindow .t b c} msg] $msg
-} {1 {wrong # arguments: must be "wm iconwindow window ?pathName?"}}
-test unixWm-8.4 {icon windows} {
+} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
+test unixWm-8.4 {icon windows} unix {
catch {destroy .t}
catch {destroy .icon}
toplevel .t -width 100 -height 30
@@ -294,18 +293,18 @@ test unixWm-8.4 {icon windows} {
update
lappend result [winfo ismapped .t] [winfo ismapped .icon]
} {.icon icon {} withdrawn 1 0 0 0}
-test unixWm-8.5 {icon windows} {
+test unixWm-8.5 {icon windows} unix {
catch {destroy .t}
toplevel .t -width 100 -height 30
list [catch {wm iconwindow .t .gorp} msg] $msg
} {1 {bad window path name ".gorp"}}
-test unixWm-8.6 {icon windows} {
+test unixWm-8.6 {icon windows} unix {
catch {destroy .t}
toplevel .t -width 100 -height 30
frame .t.icon -width 50 -height 50 -bg red
list [catch {wm iconwindow .t .t.icon} msg] $msg
} {1 {can't use .t.icon as icon window: not at top level}}
-test unixWm-8.7 {icon windows} {
+test unixWm-8.7 {icon windows} unix {
catch {destroy .t}
catch {destroy .icon}
toplevel .t -width 100 -height 30
@@ -318,7 +317,7 @@ test unixWm-8.7 {icon windows} {
lappend result [wm iconwindow .t] [wm state .icon] [wm state .icon2]
} {.icon icon normal .icon2 withdrawn icon}
catch {destroy .icon2}
-test unixWm-8.8 {icon windows} {
+test unixWm-8.8 {icon windows} unix {
catch {destroy .t}
catch {destroy .icon}
toplevel .icon -width 50 -height 50 -bg red
@@ -332,7 +331,7 @@ test unixWm-8.8 {icon windows} {
sleep 500
lappend result [winfo ismapped .t] [winfo ismapped .icon]
} {1 1 0}
-test unixWm-8.9 {icon windows} {nonPortable} {
+test unixWm-8.9 {icon windows} {unix nonPortable} {
# This test is non-portable because some window managers will
# destroy an icon window when it's associated window is destroyed.
@@ -353,7 +352,7 @@ test unixWm-8.9 {icon windows} {nonPortable} {
lappend result [winfo ismapped .icon] [wm state .icon]
} {icon 1 0 0 withdrawn 1 normal}
-test unixWm-59.1 {test for memory leaks} {
+test unixWm-8.10.1 {test for memory leaks} unix {
wm title .t "This is a long long long long long long title"
wm title .t "This is a long long long long long long title"
wm title .t "This is a long long long long long long title"
@@ -364,7 +363,7 @@ test unixWm-59.1 {test for memory leaks} {
wm title .t "This is a long long long long long long title"
set x 1
} 1
-test unixWm-59.2 {test for memory leaks} {
+test unixWm-8.10.2 {test for memory leaks} unix {
wm group .t .
wm group .t .
wm group .t .
@@ -378,14 +377,7 @@ test unixWm-59.2 {test for memory leaks} {
set x 1
} 1
-if {[string compare testwrapper [info commands testwrapper]] != 0} {
- puts "This application hasn't been compiled with the testwrapper command,"
- puts "therefore I am skipping all of these tests."
- ::tcltest::cleanupTests
- return
-}
-
-test unixWm-9.1 {TkWmMapWindow procedure, client property} {unixOnly} {
+test unixWm-9.1 {TkWmMapWindow procedure, client property} {unix testwrapper} {
catch {destroy .t}
toplevel .t -width 100 -height 50
wm geom .t +0+0
@@ -393,7 +385,7 @@ test unixWm-9.1 {TkWmMapWindow procedure, client property} {unixOnly} {
update
testprop [testwrapper .t] WM_CLIENT_MACHINE
} {Test_String}
-test unixWm-9.2 {TkWmMapWindow procedure, command property} {unixOnly} {
+test unixWm-9.2 {TkWmMapWindow procedure, command property} {unix testwrapper} {
catch {destroy .t}
toplevel .t -width 100 -height 50
wm geom .t +0+0
@@ -427,6 +419,8 @@ test unixWm-9.5 {TkWmMapWindow procedure, normal windows} {
winfo ismapped .t
} {1}
+testConstraint testmenubar [llength [info commands testmenubar]]
+
test unixWm-10.1 {TkWmDeadWindow procedure, canceling UpdateGeometry idle handler} {
catch {destroy .t}
toplevel .t -width 100 -height 50
@@ -435,7 +429,7 @@ test unixWm-10.1 {TkWmDeadWindow procedure, canceling UpdateGeometry idle handle
.t configure -width 200 -height 100
destroy .t
} {}
-test unixWm-10.2 {TkWmDeadWindow procedure, destroying menubar} {unixOnly} {
+test unixWm-10.2 {TkWmDeadWindow procedure, destroying menubar} {unix testmenubar} {
catch {destroy .t}
catch {destroy .f}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
@@ -454,10 +448,10 @@ test unixWm-11.1 {Tk_WmCmd procedure, miscellaneous errors} {
list [catch {wm} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
test unixWm-11.2 {Tk_WmCmd procedure, miscellaneous errors} {
- list [catch {wm foo} msg] $msg
+ list [catch {wm aspect} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
test unixWm-11.3 {Tk_WmCmd procedure, miscellaneous errors} {
- list [catch {wm foo bogus} msg] $msg
+ list [catch {wm iconify bogus} msg] $msg
} {1 {bad window path name "bogus"}}
test unixWm-11.4 {Tk_WmCmd procedure, miscellaneous errors} {
catch {destroy .b}
@@ -474,10 +468,10 @@ update
test unixWm-12.1 {Tk_WmCmd procedure, "aspect" option} {
list [catch {wm aspect .t 12} msg] $msg
-} {1 {wrong # arguments: must be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
+} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
test unixWm-12.2 {Tk_WmCmd procedure, "aspect" option} {
list [catch {wm aspect .t 12 13 14 15 16} msg] $msg
-} {1 {wrong # arguments: must be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
+} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
test unixWm-12.3 {Tk_WmCmd procedure, "aspect" option} {
set result {}
lappend result [wm aspect .t]
@@ -513,8 +507,8 @@ test unixWm-12.11 {Tk_WmCmd procedure, "aspect" option} {
test unixWm-13.1 {Tk_WmCmd procedure, "client" option} {
list [catch {wm client .t x y} msg] $msg
-} {1 {wrong # arguments: must be "wm client window ?name?"}}
-test unixWm-13.2 {Tk_WmCmd procedure, "client" option} {unixOnly} {
+} {1 {wrong # args: should be "wm client window ?name?"}}
+test unixWm-13.2 {Tk_WmCmd procedure, "client" option} {unix testwrapper} {
set result {}
lappend result [wm client .t]
wm client .t Test_String
@@ -535,7 +529,7 @@ test unixWm-13.3 {Tk_WmCmd procedure, "client" option, unmapped window} {
test unixWm-14.1 {Tk_WmCmd procedure, "colormapwindows" option} {
list [catch {wm colormapwindows .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm colormapwindows window ?windowList?"}}
+} {1 {wrong # args: should be "wm colormapwindows window ?windowList?"}}
test unixWm-14.2 {Tk_WmCmd procedure, "colormapwindows" option} {
catch {destroy .t2}
toplevel .t2 -width 200 -height 200 -colormap new
@@ -590,11 +584,11 @@ catch {destroy .t2}
test unixWm-15.1 {Tk_WmCmd procedure, "command" option} {
list [catch {wm command .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm command window ?value?"}}
+} {1 {wrong # args: should be "wm command window ?value?"}}
test unixWm-15.2 {Tk_WmCmd procedure, "command" option} {
list [catch {wm command .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm command window ?value?"}}
-test unixWm-15.3 {Tk_WmCmd procedure, "command" option} {unixOnly} {
+} {1 {wrong # args: should be "wm command window ?value?"}}
+test unixWm-15.3 {Tk_WmCmd procedure, "command" option} {unix testwrapper} {
set result {}
lappend result [wm command .t]
wm command .t "test command"
@@ -621,7 +615,7 @@ test unixWm-15.5 {Tk_WmCmd procedure, "command" option} {
test unixWm-16.1 {Tk_WmCmd procedure, "deiconify" option} {
list [catch {wm deiconify .t 12} msg] $msg
-} {1 {wrong # arguments: must be "wm deiconify window"}}
+} {1 {wrong # args: should be "wm deiconify window"}}
test unixWm-16.2 {Tk_WmCmd procedure, "deiconify" option} {
catch {destroy .icon}
toplevel .icon -width 50 -height 50 -bg red
@@ -640,7 +634,7 @@ test unixWm-16.3 {Tk_WmCmd procedure, "deiconify" option} {
test unixWm-17.1 {Tk_WmCmd procedure, "focusmodel" option} {
list [catch {wm focusmodel .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm focusmodel window ?active|passive?"}}
+} {1 {wrong # args: should be "wm focusmodel window ?active|passive?"}}
test unixWm-17.2 {Tk_WmCmd procedure, "focusmodel" option} {
list [catch {wm focusmodel .t bogus} msg] $msg
} {1 {bad argument "bogus": must be active or passive}}
@@ -656,7 +650,7 @@ test unixWm-17.3 {Tk_WmCmd procedure, "focusmodel" option} {
test unixWm-18.1 {Tk_WmCmd procedure, "frame" option} {
list [catch {wm frame .t 12} msg] $msg
-} {1 {wrong # arguments: must be "wm frame window"}}
+} {1 {wrong # args: should be "wm frame window"}}
test unixWm-18.2 {Tk_WmCmd procedure, "frame" option} nonPortable {
expr [wm frame .t] == [winfo id .t]
} {0}
@@ -673,7 +667,7 @@ test unixWm-18.3 {Tk_WmCmd procedure, "frame" option} nonPortable {
test unixWm-19.1 {Tk_WmCmd procedure, "geometry" option} {
list [catch {wm geometry .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm geometry window ?newGeometry?"}}
+} {1 {wrong # args: should be "wm geometry window ?newGeometry?"}}
test unixWm-19.2 {Tk_WmCmd procedure, "geometry" option} nonPortable {
wm geometry .t -1+5
update
@@ -710,10 +704,10 @@ test unixWm-19.6 {Tk_WmCmd procedure, "geometry" option} {
test unixWm-20.1 {Tk_WmCmd procedure, "grid" option} {
list [catch {wm grid .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
+} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
test unixWm-20.2 {Tk_WmCmd procedure, "grid" option} {
list [catch {wm grid .t 12 13 14 15 16} msg] $msg
-} {1 {wrong # arguments: must be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
+} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
test unixWm-20.3 {Tk_WmCmd procedure, "grid" option} {
set result {}
lappend result [wm grid .t]
@@ -755,11 +749,11 @@ update
test unixWm-21.1 {Tk_WmCmd procedure, "group" option} {
list [catch {wm group .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm group window ?pathName?"}}
+} {1 {wrong # args: should be "wm group window ?pathName?"}}
test unixWm-21.2 {Tk_WmCmd procedure, "group" option} {
list [catch {wm group .t bogus} msg] $msg
} {1 {bad window path name "bogus"}}
-test unixWm-21.3 {Tk_WmCmd procedure, "group" option} {unixOnly} {
+test unixWm-21.3 {Tk_WmCmd procedure, "group" option} {unix testwrapper} {
set result {}
lappend result [wm group .t]
wm group .t .
@@ -771,7 +765,7 @@ test unixWm-21.3 {Tk_WmCmd procedure, "group" option} {unixOnly} {
WM_HINTS] 0]]]
lappend result [wm group .t] $bit
} {{} . 0x40 {} 0x0}
-test unixWm-21.4 {Tk_WmCmd procedure, "group" option, make window exist} {unixOnly} {
+test unixWm-21.4 {Tk_WmCmd procedure, "group" option, make window exist} {unix testwrapper} {
catch {destroy .t2}
toplevel .t2
wm geom .t2 +0+0
@@ -781,7 +775,7 @@ test unixWm-21.4 {Tk_WmCmd procedure, "group" option, make window exist} {unixOn
destroy .t2
set result
} {0}
-test unixWm-21.5 {Tk_WmCmd procedure, "group" option, create leader wrapper} {unixOnly} {
+test unixWm-21.5 {Tk_WmCmd procedure, "group" option, create leader wrapper} {unix testwrapper} {
catch {destroy .t2}
catch {destroy .t3}
toplevel .t2 -width 120 -height 300
@@ -795,10 +789,10 @@ test unixWm-21.5 {Tk_WmCmd procedure, "group" option, create leader wrapper} {un
set result
} {{} 0}
-test unixWm-22.1 {Tk_WmCmd procedure, "iconbitmap" option} {
+test unixWm-22.1 {Tk_WmCmd procedure, "iconbitmap" option} unix {
list [catch {wm iconbitmap .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm iconbitmap window ?bitmap?"}}
-test unixWm-22.2 {Tk_WmCmd procedure, "iconbitmap" option} {unixOnly} {
+} {1 {wrong # args: should be "wm iconbitmap window ?bitmap?"}}
+test unixWm-22.2 {Tk_WmCmd procedure, "iconbitmap" option} {unix testwrapper} {
set result {}
lappend result [wm iconbitmap .t]
wm iconbitmap .t questhead
@@ -816,7 +810,7 @@ test unixWm-22.3 {Tk_WmCmd procedure, "iconbitmap" option} {
test unixWm-23.1 {Tk_WmCmd procedure, "iconify" option} {
list [catch {wm iconify .t 12} msg] $msg
-} {1 {wrong # arguments: must be "wm iconify window"}}
+} {1 {wrong # args: should be "wm iconify window"}}
test unixWm-23.2 {Tk_WmCmd procedure, "iconify" option} {
catch {destroy .t2}
toplevel .t2
@@ -869,8 +863,8 @@ test unixWm-23.6 {Tk_WmCmd procedure, "iconify" option} {
test unixWm-24.1 {Tk_WmCmd procedure, "iconmask" option} {
list [catch {wm iconmask .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm iconmask window ?bitmap?"}}
-test unixWm-24.2 {Tk_WmCmd procedure, "iconmask" option} {unixOnly} {
+} {1 {wrong # args: should be "wm iconmask window ?bitmap?"}}
+test unixWm-24.2 {Tk_WmCmd procedure, "iconmask" option} {unix testwrapper} {
set result {}
lappend result [wm iconmask .t]
wm iconmask .t questhead
@@ -888,11 +882,11 @@ test unixWm-24.3 {Tk_WmCmd procedure, "iconmask" option} {
test unixWm-25.1 {Tk_WmCmd procedure, "iconname" option} {
list [catch {wm icon .t} msg] $msg
-} {1 {unknown or ambiguous option "icon": must be aspect, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, state, title, transient, or withdraw}}
+} {1 {ambiguous option "icon": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
test unixWm-25.2 {Tk_WmCmd procedure, "iconname" option} {
list [catch {wm iconname .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm iconname window ?newName?"}}
-test unixWm-25.3 {Tk_WmCmd procedure, "iconname" option} {unixOnly} {
+} {1 {wrong # args: should be "wm iconname window ?newName?"}}
+test unixWm-25.3 {Tk_WmCmd procedure, "iconname" option} {unix testwrapper} {
set result {}
lappend result [wm iconname .t]
wm iconname .t test_name
@@ -903,11 +897,11 @@ test unixWm-25.3 {Tk_WmCmd procedure, "iconname" option} {unixOnly} {
test unixWm-26.1 {Tk_WmCmd procedure, "iconposition" option} {
list [catch {wm iconposition .t 12} msg] $msg
-} {1 {wrong # arguments: must be "wm iconposition window ?x y?"}}
+} {1 {wrong # args: should be "wm iconposition window ?x y?"}}
test unixWm-26.2 {Tk_WmCmd procedure, "iconposition" option} {
list [catch {wm iconposition .t 12 13 14} msg] $msg
-} {1 {wrong # arguments: must be "wm iconposition window ?x y?"}}
-test unixWm-26.3 {Tk_WmCmd procedure, "iconposition" option} {unixOnly} {
+} {1 {wrong # args: should be "wm iconposition window ?x y?"}}
+test unixWm-26.3 {Tk_WmCmd procedure, "iconposition" option} {unix testwrapper} {
set result {}
lappend result [wm iconposition .t]
wm iconposition .t 10 15
@@ -928,8 +922,8 @@ test unixWm-26.5 {Tk_WmCmd procedure, "iconposition" option} {
test unixWm-27.1 {Tk_WmCmd procedure, "iconwindow" option} {
list [catch {wm iconwindow .t 12 13} msg] $msg
-} {1 {wrong # arguments: must be "wm iconwindow window ?pathName?"}}
-test unixWm-27.2 {Tk_WmCmd procedure, "iconwindow" option} {unixOnly} {
+} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
+test unixWm-27.2 {Tk_WmCmd procedure, "iconwindow" option} {unix testwrapper} {
catch {destroy .icon}
toplevel .icon -width 50 -height 50 -bg green
set result {}
@@ -994,29 +988,11 @@ test unixWm-27.7 {Tk_WmCmd procedure, "iconwindow" option, withdrawing icon} {
set result
} {normal 1 icon 0}
-test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option} {
- list [catch {wm maxsize} msg] $msg
-} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option} {
- list [catch {wm maxsize . a} msg] $msg
-} {1 {wrong # arguments: must be "wm maxsize window ?width height?"}}
-test unixWm-28.3 {Tk_WmCmd procedure, "maxsize" option} {
- list [catch {wm maxsize . a b c} msg] $msg
-} {1 {wrong # arguments: must be "wm maxsize window ?width height?"}}
-test unixWm-28.4 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
+test unixWm-28.1 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
wm maxsize .t
} {1137 870}
-test unixWm-28.5 {Tk_WmCmd procedure, "maxsize" option} {
- list [catch {wm maxsize . x 100} msg] $msg
-} {1 {expected integer but got "x"}}
-test unixWm-28.6 {Tk_WmCmd procedure, "maxsize" option} {
- list [catch {wm maxsize . 100 bogus} msg] $msg
-} {1 {expected integer but got "bogus"}}
-test unixWm-28.7 {Tk_WmCmd procedure, "maxsize" option} {
- wm maxsize .t 200 150
- wm maxsize .t
-} {200 150}
-test unixWm-28.8 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
+
+test unixWm-28.2 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
# Not portable, because some window managers let applications override
# minsize and maxsize.
@@ -1032,29 +1008,7 @@ toplevel .t -width 100 -height 50
wm geom .t +0+0
update
-test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option} {
- list [catch {wm minsize} msg] $msg
-} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-test unixWm-29.2 {Tk_WmCmd procedure, "minsize" option} {
- list [catch {wm minsize . a} msg] $msg
-} {1 {wrong # arguments: must be "wm minsize window ?width height?"}}
-test unixWm-29.3 {Tk_WmCmd procedure, "minsize" option} {
- list [catch {wm minsize . a b c} msg] $msg
-} {1 {wrong # arguments: must be "wm minsize window ?width height?"}}
-test unixWm-29.4 {Tk_WmCmd procedure, "minsize" option} {
- wm minsize .t
-} {1 1}
-test unixWm-29.5 {Tk_WmCmd procedure, "minsize" option} {
- list [catch {wm minsize . x 100} msg] $msg
-} {1 {expected integer but got "x"}}
-test unixWm-29.6 {Tk_WmCmd procedure, "minsize" option} {
- list [catch {wm minsize . 100 bogus} msg] $msg
-} {1 {expected integer but got "bogus"}}
-test unixWm-29.7 {Tk_WmCmd procedure, "minsize" option} {
- wm minsize .t 200 150
- wm minsize .t
-} {200 150}
-test unixWm-29.8 {Tk_WmCmd procedure, "minsize" option} {nonPortable} {
+test unixWm-29.1 {Tk_WmCmd procedure, "minsize" option} {nonPortable} {
# Not portable, because some window managers let applications override
# minsize and maxsize.
@@ -1072,7 +1026,7 @@ update
test unixWm-30.1 {Tk_WmCmd procedure, "overrideredirect" option} {
list [catch {wm overrideredirect .t 1 2} msg] $msg
-} {1 {wrong # arguments: must be "wm overrideredirect window ?boolean?"}}
+} {1 {wrong # args: should be "wm overrideredirect window ?boolean?"}}
test unixWm-30.2 {Tk_WmCmd procedure, "overrideredirect" option} {
list [catch {wm overrideredirect .t boo} msg] $msg
} {1 {expected boolean value but got "boo"}}
@@ -1087,8 +1041,8 @@ test unixWm-30.3 {Tk_WmCmd procedure, "overrideredirect" option} {
test unixWm-31.1 {Tk_WmCmd procedure, "positionfrom" option} {
list [catch {wm positionfrom .t 1 2} msg] $msg
-} {1 {wrong # arguments: must be "wm positionfrom window ?user/program?"}}
-test unixWm-31.2 {Tk_WmCmd procedure, "positionfrom" option} {unixOnly} {
+} {1 {wrong # args: should be "wm positionfrom window ?user/program?"}}
+test unixWm-31.2 {Tk_WmCmd procedure, "positionfrom" option} {unix testwrapper} {
set result {}
lappend result [wm positionfrom .t]
wm positionfrom .t program
@@ -1108,7 +1062,7 @@ test unixWm-31.3 {Tk_WmCmd procedure, "positionfrom" option} {
test unixWm-32.1 {Tk_WmCmd procedure, "protocol" option} {
list [catch {wm protocol .t 1 2 3} msg] $msg
-} {1 {wrong # arguments: must be "wm protocol window ?name? ?command?"}}
+} {1 {wrong # args: should be "wm protocol window ?name? ?command?"}}
test unixWm-32.2 {Tk_WmCmd procedure, "protocol" option} {
wm protocol .t {foo a} {a b c}
wm protocol .t bar {test script for bar}
@@ -1117,7 +1071,7 @@ test unixWm-32.2 {Tk_WmCmd procedure, "protocol" option} {
wm protocol .t bar {}
set result
} {bar {foo a}}
-test unixWm-32.3 {Tk_WmCmd procedure, "protocol" option} {unixOnly} {
+test unixWm-32.3 {Tk_WmCmd procedure, "protocol" option} {unix testwrapper} {
set result {}
lappend result [wm protocol .t]
set x {}
@@ -1159,10 +1113,10 @@ test unixWm-32.5 {Tk_WmCmd procedure, "protocol" option} {
test unixWm-33.1 {Tk_WmCmd procedure, "resizable" option} {
list [catch {wm resizable . a} msg] $msg
-} {1 {wrong # arguments: must be "wm resizable window ?width height?"}}
+} {1 {wrong # args: should be "wm resizable window ?width height?"}}
test unixWm-33.2 {Tk_WmCmd procedure, "resizable" option} {
list [catch {wm resizable . a b c} msg] $msg
-} {1 {wrong # arguments: must be "wm resizable window ?width height?"}}
+} {1 {wrong # args: should be "wm resizable window ?width height?"}}
test unixWm-33.3 {Tk_WmCmd procedure, "resizable" option} {
list [catch {wm resizable .foo a b c} msg] $msg
} {1 {bad window path name ".foo"}}
@@ -1190,8 +1144,8 @@ test unixWm-33.6 {Tk_WmCmd procedure, "resizable" option} {
test unixWm-34.1 {Tk_WmCmd procedure, "sizefrom" option} {
list [catch {wm sizefrom .t 1 2} msg] $msg
-} {1 {wrong # arguments: must be "wm sizefrom window ?user|program?"}}
-test unixWm-34.2 {Tk_WmCmd procedure, "sizefrom" option} {unixOnly} {
+} {1 {wrong # args: should be "wm sizefrom window ?user|program?"}}
+test unixWm-34.2 {Tk_WmCmd procedure, "sizefrom" option} {unix testwrapper} {
set result {}
lappend result [wm sizefrom .t]
wm sizefrom .t program
@@ -1209,12 +1163,12 @@ test unixWm-34.3 {Tk_WmCmd procedure, "sizefrom" option} {
list [catch {wm sizefrom .t none} msg] $msg
} {1 {bad argument "none": must be program or user}}
-test unixWm-35.1 {Tk_WmCmd procedure, "state" option} {
+test unixWm-35.1 {Tk_WmCmd procedure, "state" option} unix {
list [catch {wm state .t 1} msg] $msg
-} {1 {bad argument "1": must be normal, iconic or withdrawn}}
+} {1 {bad argument "1": must be normal, iconic, or withdrawn}}
test unixWm-35.2 {Tk_WmCmd procedure, "state" option} {
list [catch {wm state .t iconic 1} msg] $msg
-} {1 {wrong # arguments: must be "wm state window ?state?"}}
+} {1 {wrong # args: should be "wm state window ?state?"}}
test unixWm-35.3 {Tk_WmCmd procedure, "state" option} {
set result {}
catch {destroy .t2}
@@ -1252,8 +1206,8 @@ test unixWm-35.4 {Tk_WmCmd procedure, "state" option} {
test unixWm-36.1 {Tk_WmCmd procedure, "title" option} {
list [catch {wm title .t 1 2} msg] $msg
-} {1 {wrong # arguments: must be "wm title window ?newTitle?"}}
-test unixWm-36.2 {Tk_WmCmd procedure, "title" option} {unixOnly} {
+} {1 {wrong # args: should be "wm title window ?newTitle?"}}
+test unixWm-36.2 {Tk_WmCmd procedure, "title" option} {unix testwrapper} {
set result {}
lappend result [wm title .t] [testprop [testwrapper .t] WM_NAME]
wm title .t "Test window"
@@ -1262,13 +1216,7 @@ test unixWm-36.2 {Tk_WmCmd procedure, "title" option} {unixOnly} {
lappend result [wm title .t] [testprop [testwrapper .t] WM_NAME]
} {t t {Test window} {Test window}}
-test unixWm-37.1 {Tk_WmCmd procedure, "transient" option} {
- list [catch {wm transient .t 1 2} msg] $msg
-} {1 {wrong # arguments: must be "wm transient window ?master?"}}
-test unixWm-37.2 {Tk_WmCmd procedure, "transient" option} {
- list [catch {wm transient .t foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test unixWm-37.3 {Tk_WmCmd procedure, "transient" option} {unixOnly} {
+test unixWm-37.3 {Tk_WmCmd procedure, "transient" option} {unix testwrapper} {
set result {}
catch {destroy .t2}
toplevel .t2 -width 120 -height 300
@@ -1285,7 +1233,18 @@ test unixWm-37.3 {Tk_WmCmd procedure, "transient" option} {unixOnly} {
destroy .t2
set result
} {{} {} .t 0 {} 0x0}
-test unixWm-37.4 {Tk_WmCmd procedure, "transient" option, create master wrapper} {unixOnly} {
+test unixWm-37.4 {TkWmDeadWindow, destroy on master should clear transient} {unix testwrapper} {
+ catch {destroy .t2}
+ toplevel .t2
+ catch {destroy .t3}
+ toplevel .t3
+ wm transient .t2 .t3
+ update
+ destroy .t3
+ update
+ list [wm transient .t2] [testprop [testwrapper .t2] WM_TRANSIENT_FOR]
+} {{} 0x0}
+test unixWm-37.5 {Tk_WmCmd procedure, "transient" option, create master wrapper} {unix testwrapper} {
catch {destroy .t2}
catch {destroy .t3}
toplevel .t2 -width 120 -height 300
@@ -1301,7 +1260,7 @@ test unixWm-37.4 {Tk_WmCmd procedure, "transient" option, create master wrapper}
test unixWm-38.1 {Tk_WmCmd procedure, "withdraw" option} {
list [catch {wm withdraw .t 1} msg] $msg
-} {1 {wrong # arguments: must be "wm withdraw window"}}
+} {1 {wrong # args: should be "wm withdraw window"}}
test unixWm-38.2 {Tk_WmCmd procedure, "withdraw" option} {
catch {destroy .t2}
toplevel .t2 -width 120 -height 300
@@ -1321,7 +1280,7 @@ test unixWm-38.3 {Tk_WmCmd procedure, "withdraw" option} {
test unixWm-39.1 {Tk_WmCmd procedure, miscellaneous} {
list [catch {wm unknown .t} msg] $msg
-} {1 {unknown or ambiguous option "unknown": must be aspect, client, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, state, title, transient, or withdraw}}
+} {1 {bad option "unknown": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
catch {destroy .t}
catch {destroy .icon}
@@ -1358,7 +1317,7 @@ test unixWm-41.1 {ConfigureEvent procedure, internally generated size changes} {
sleep 500
lappend result [winfo width .t] [winfo height .t]
} {400 150 200 300}
-test unixWm-41.2 {ConfigureEvent procedure, menubars} {nonPortable} {
+test unixWm-41.2 {ConfigureEvent procedure, menubars} {nonPortable testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
@@ -1542,7 +1501,7 @@ test unixWm-44.8 {UpdateGeometryInfo procedure, computing position} {
} [list [expr [winfo screenwidth .t] - 110] 2]
catch {destroy .t}
-test unixWm-44.9 {UpdateGeometryInfo procedure, updating fixed dimensions} {unixOnly} {
+test unixWm-44.9 {UpdateGeometryInfo procedure, updating fixed dimensions} {unix testwrapper} {
catch {destroy .t}
toplevel .t -width 80 -height 60
wm resizable .t 0 0
@@ -1554,7 +1513,7 @@ test unixWm-44.9 {UpdateGeometryInfo procedure, updating fixed dimensions} {unix
list [expr [lindex $property 5]] [expr [lindex $property 6]] \
[expr [lindex $property 7]] [expr [lindex $property 8]]
} {180 20 180 20}
-test unixWm-44.10 {UpdateGeometryInfo procedure, menubar changing} {
+test unixWm-44.10 {UpdateGeometryInfo procedure, menubar changing} testmenubar {
catch {destroy .t}
toplevel .t -width 80 -height 60
wm resizable .t 0 0
@@ -1569,7 +1528,7 @@ test unixWm-44.10 {UpdateGeometryInfo procedure, menubar changing} {
list [update] [destroy .t]
} {{} {}}
-test unixWm-45.1 {UpdateSizeHints procedure, grid information} {unixOnly} {
+test unixWm-45.1 {UpdateSizeHints procedure, grid information} {unix testwrapper} {
catch {destroy .t}
toplevel .t -width 80 -height 60
wm grid .t 6 10 10 5
@@ -1582,7 +1541,7 @@ test unixWm-45.1 {UpdateSizeHints procedure, grid information} {unixOnly} {
[expr [lindex $property 7]] [expr [lindex $property 8]] \
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {40 30 320 210 10 5}
-test unixWm-45.2 {UpdateSizeHints procedure} {unixOnly} {
+test unixWm-45.2 {UpdateSizeHints procedure} {unix testwrapper} {
catch {destroy .t}
toplevel .t -width 80 -height 60
wm minsize .t 30 40
@@ -1594,7 +1553,7 @@ test unixWm-45.2 {UpdateSizeHints procedure} {unixOnly} {
[expr [lindex $property 7]] [expr [lindex $property 8]] \
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {30 40 200 500 1 1}
-test unixWm-45.3 {UpdateSizeHints procedure, grid with menu} {
+test unixWm-45.3 {UpdateSizeHints procedure, grid with menu} {testmenubar testwrapper} {
catch {destroy .t}
toplevel .t -width 80 -height 60
frame .t.menu -height 23 -width 50
@@ -1610,7 +1569,7 @@ test unixWm-45.3 {UpdateSizeHints procedure, grid with menu} {
[expr [lindex $property 7]] [expr [lindex $property 8]] \
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {60 40 53 320 233 10 5}
-test unixWm-45.4 {UpdateSizeHints procedure, not resizable with menu} {
+test unixWm-45.4 {UpdateSizeHints procedure, not resizable with menu} {testmenubar testwrapper} {
catch {destroy .t}
toplevel .t -width 80 -height 60
frame .t.menu -height 23 -width 50
@@ -1737,7 +1696,7 @@ test unixWm-49.1 {Tk_GetRootCoords procedure} {
tkwait visibility .t
list [winfo rootx .t.f.f] [winfo rooty .t.f.f]
} {202 192}
-test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unixOnly} {
+test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
@@ -1755,12 +1714,10 @@ test unixWm-49.2 {Tk_GetRootCoords procedure, menubars} {unixOnly} {
[expr [winfo rootx .t.f] - $x] [expr [winfo rooty .t.f] - $y]
} {52 7 12 62}
-foreach w [winfo children .] {
- catch {destroy $w}
-}
+deleteWindows
wm iconify .
test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords} {
- eval destroy [winfo children .]
+ deleteWindows
toplevel .t -width 300 -height 400 -bg green
wm geom .t +40+0
tkwait visibility .t
@@ -1780,7 +1737,7 @@ test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords} {
[winfo containing [expr $x + 220] [expr $y + 250]]
} {{} {} .t {} .t2 .t2 {} .t}
test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and overrideredirect} {
- eval destroy [winfo children .]
+ deleteWindows
toplevel .t -width 300 -height 400 -bg yellow
wm geom .t +0+50
tkwait visibility .t
@@ -1801,14 +1758,17 @@ test unixWm-50.2 {Tk_CoordsToWindow procedure, finding a toplevel, y-coords and
[winfo containing [expr $x +150] [expr $y2 + 80]] \
[winfo containing [expr $x +150] [expr $y + 450]]
} {{} {} .t .t .t2 .t2 .t {}}
-test unixWm-50.3 {Tk_CoordsToWindow procedure, finding a toplevel with embedding} {
- eval destroy [winfo children .]
+test unixWm-50.3 {
+ Tk_CoordsToWindow procedure, finding a toplevel with embedding
+} -constraints tempNotWin -setup {
+ deleteWindows
toplevel .t -width 300 -height 400 -bg blue
wm geom .t +0+50
frame .t.f -container 1
place .t.f -x 150 -y 50
tkwait visibility .t.f
setupbg
+} -body {
dobg "
wm withdraw .
toplevel .x -width 100 -height 80 -use [winfo id .t.f] -bg yellow
@@ -1823,8 +1783,9 @@ test unixWm-50.3 {Tk_CoordsToWindow procedure, finding a toplevel with embedding
set y [winfo rooty .t]
lappend result [winfo containing [expr $x + 200] [expr $y + 49]] \
[winfo containing [expr $x + 200] [expr $y +50]]
-} {{} .x .t .t.f}
-cleanupbg
+} -cleanup {
+ cleanupbg
+} -result {{} .x .t .t.f}
test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} {
catch {destroy .t}
catch {interp delete slave}
@@ -1832,15 +1793,15 @@ test unixWm-50.4 {Tk_CoordsToWindow procedure, window in other application} {
wm geometry .t +0+0
tkwait visibility .t
interp create slave
- load {} tk slave
+ load {} Tk slave
slave eval {wm geometry . 200x200+0+0; tkwait visibility .}
set result [list [winfo containing 100 100] \
[slave eval {winfo containing 100 100}]]
interp delete slave
set result
} {{} .}
-test unixWm-50.5 {Tk_CoordsToWindow procedure, handling menubars} {unixOnly} {
- eval destroy [winfo children .]
+test unixWm-50.5 {Tk_CoordsToWindow procedure, handling menubars} {unix testmenubar} {
+ deleteWindows
toplevel .t -width 300 -height 400 -bd 2 -relief raised
frame .t.f -width 150 -height 120 -bg green
place .t.f -x 10 -y 150
@@ -1862,7 +1823,7 @@ test unixWm-50.5 {Tk_CoordsToWindow procedure, handling menubars} {unixOnly} {
[winfo containing [expr $x + 12] [expr $y + 152]]
} {{} .t.menu .t.menu .t.menu.f .t .t .t.f}
test unixWm-50.6 {Tk_CoordsToWindow procedure, embedding within one app.} {
- eval destroy [winfo children .]
+ deleteWindows
toplevel .t -width 300 -height 400 -bg orange
wm geom .t +0+50
frame .t.f -container 1
@@ -1938,7 +1899,7 @@ test unixWm-50.10 {Tk_CoordsToWindow procedure, unmapped windows} {
update
lappend result [winfo containing 100 100]
} {.t.f .t}
-eval destroy [winfo children .]
+deleteWindows
wm deiconify .
# No tests for UpdateVRootGeometry, Tk_GetVRootGeometry,
@@ -1995,9 +1956,7 @@ test unixWm-51.5 {TkWmRestackToplevel procedure, basic tests} {nonPortable} {
list $result [winfo containing [winfo rootx .raise2] \
[winfo rooty .raise2]]
} {.raise1 .raise3}
-foreach w [winfo children .] {
- catch {destroy $w}
-}
+deleteWindows
test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapped} {
catch {destroy .t}
toplevel .t -width 200 -height 200 -bg green
@@ -2156,7 +2115,7 @@ test unixWm-53.2 {TkWmRemoveFromColormapWindows procedure} {
wm colormap .t
} {}
-test unixWm-54.1 {TkpMakeMenuWindow procedure, setting save_under} {
+test unixWm-54.1 {TkpMakeMenuWindow procedure, setting save_under} unix {
catch {destroy .t}
catch {destroy .m}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
@@ -2173,7 +2132,7 @@ test unixWm-54.1 {TkpMakeMenuWindow procedure, setting save_under} {
destroy .m
set x
} {no event}
-test unixWm-54.2 {TkpMakeMenuWindow procedure, setting override_redirect} {
+test unixWm-54.2 {TkpMakeMenuWindow procedure, setting override_redirect} unix {
catch {destroy .m}
menu .m
.m add command -label First
@@ -2188,7 +2147,7 @@ test unixWm-54.2 {TkpMakeMenuWindow procedure, setting override_redirect} {
# No tests for TkGetPointerCoords, CreateWrapper, or GetMaxSize.
-test unixWm-55.1 {TkUnixSetMenubar procedure} {unixOnly} {
+test unixWm-55.1 {TkUnixSetMenubar procedure} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
@@ -2200,7 +2159,7 @@ test unixWm-55.1 {TkUnixSetMenubar procedure} {unixOnly} {
[expr [winfo rootx .t] - [winfo rootx .t.f]] \
[expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
-test unixWm-55.2 {TkUnixSetMenubar procedure, removing menubar} {unixOnly} {
+test unixWm-55.2 {TkUnixSetMenubar procedure, removing menubar} {unix testmenubar} {
catch {destroy .t}
catch {destroy .f}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
@@ -2219,7 +2178,7 @@ test unixWm-55.2 {TkUnixSetMenubar procedure, removing menubar} {unixOnly} {
[expr [winfo rootx .] - [winfo rootx .f]] \
[expr [winfo rooty .] - [winfo rooty .f]]
} {0 300x30+0+0 0 0 0 0}
-test unixWm-55.3 {TkUnixSetMenubar procedure, removing geometry manager} {unixOnly} {
+test unixWm-55.3 {TkUnixSetMenubar procedure, removing geometry manager} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
@@ -2236,7 +2195,7 @@ test unixWm-55.3 {TkUnixSetMenubar procedure, removing geometry manager} {unixOn
update
lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 0 0 0}
-test unixWm-55.4 {TkUnixSetMenubar procedure, toplevel not yet created} {unixOnly} {
+test unixWm-55.4 {TkUnixSetMenubar procedure, toplevel not yet created} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
@@ -2247,7 +2206,7 @@ test unixWm-55.4 {TkUnixSetMenubar procedure, toplevel not yet created} {unixOnl
[expr [winfo rootx .t] - [winfo rootx .t.f]] \
[expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
-test unixWm-55.5 {TkUnixSetMenubar procedure, changing menubar} {unixOnly} {
+test unixWm-55.5 {TkUnixSetMenubar procedure, changing menubar} {unix testmenubar} {
catch {destroy .t}
catch {destroy .f}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
@@ -2266,7 +2225,7 @@ test unixWm-55.5 {TkUnixSetMenubar procedure, changing menubar} {unixOnly} {
lappend result [winfo ismapped .f] [winfo ismapped .t.f]
lappend result [expr [winfo rooty .f] - $y]
} {0 1 0 1 0 0}
-test unixWm-55.6 {TkUnixSetMenubar procedure, changing menubar to self} {unixOnly} {
+test unixWm-55.6 {TkUnixSetMenubar procedure, changing menubar to self} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
frame .t.f -width 400 -height 30 -bd 2 -relief raised -bg green
@@ -2279,7 +2238,7 @@ test unixWm-55.6 {TkUnixSetMenubar procedure, changing menubar to self} {unixOnl
[expr [winfo rootx .t] - [winfo rootx .t.f]] \
[expr [winfo rooty .t] - [winfo rooty .t.f]]
} {1 300x30+0+0 0 30}
-test unixWm-55.7 {TkUnixSetMenubar procedure, unsetting event handler} {unixOnly} {
+test unixWm-55.7 {TkUnixSetMenubar procedure, unsetting event handler} {unix testmenubar} {
catch {destroy .t}
catch {destroy .f}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
@@ -2299,7 +2258,7 @@ test unixWm-55.7 {TkUnixSetMenubar procedure, unsetting event handler} {unixOnly
lappend result [expr [winfo rooty .t] - $y]
} {30 40 40}
-test unixWm-56.1 {MenubarDestroyProc procedure} {unixOnly} {
+test unixWm-56.1 {MenubarDestroyProc procedure} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
@@ -2314,7 +2273,7 @@ test unixWm-56.1 {MenubarDestroyProc procedure} {unixOnly} {
lappend result [expr [winfo rooty .t] - $y]
} {30 0}
-test unixWm-57.1 {MenubarReqProc procedure} {unixOnly} {
+test unixWm-57.1 {MenubarReqProc procedure} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
@@ -2329,7 +2288,7 @@ test unixWm-57.1 {MenubarReqProc procedure} {unixOnly} {
update
lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 10 0 100}
-test unixWm-57.2 {MenubarReqProc procedure} {unixOnly} {
+test unixWm-57.2 {MenubarReqProc procedure} {unix testmenubar} {
catch {destroy .t}
toplevel .t -width 300 -height 200 -bd 2 -relief raised
wm geom .t +0+0
@@ -2345,7 +2304,7 @@ test unixWm-57.2 {MenubarReqProc procedure} {unixOnly} {
lappend result [expr [winfo rootx .t] - $x] [expr [winfo rooty .t] - $y]
} {0 20 0 1}
-test unixWm-58.1 {UpdateCommand procedure, DString gets reallocated} {unixOnly} {
+test unixWm-58.1 {UpdateCommand procedure, DString gets reallocated} {unix testwrapper} {
catch {destroy .t}
toplevel .t -width 100 -height 50
wm geom .t +0+0
@@ -2378,44 +2337,38 @@ argumentNumber18
# Test exit processing and cleanup:
-test unixWm-58.1 {exit processing} {
- catch {removeFile script}
- set fd [open script w]
- puts $fd {
+test unixWm-59.1 {exit processing} {
+ set script [makeFile {
update
exit
- }
- close $fd
- if {[catch {exec $::tcltest::tktest script -geometry 10x10+0+0} msg]} {
+ } script]
+ if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
set error 0
}
+ removeFile script
list $error $msg
} {0 {}}
-test unixWm-58.2 {exit processing} {
- catch {removeFile script}
- set fd [open script w]
- puts $fd {
+test unixWm-59.2 {exit processing} {
+ set script [makeFile {
interp create x
x eval {set argc 2}
x eval {set argv "-geometry 10x10+0+0"}
x eval {load {} Tk}
update
exit
- }
- close $fd
- if {[catch {exec $::tcltest::tktest script -geometry 10x10+0+0} msg]} {
+ } script]
+ if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
set error 0
}
+ removeFile script
list $error $msg
} {0 {}}
-test unixWm-58.3 {exit processing} {
- catch {removeFile script}
- set fd [open script w]
- puts $fd {
+test unixWm-59.3 {exit processing} {
+ set script [makeFile {
interp create x
x eval {set argc 2}
x eval {set argv "-geometry 10x10+0+0"}
@@ -2428,33 +2381,28 @@ test unixWm-58.3 {exit processing} {
proc destroy_x {} {interp delete x}
update
exit
- }
- close $fd
- if {[catch {exec $::tcltest::tktest script -geometry 10x10+0+0} msg]} {
+ } script]
+ if {[catch {exec [interpreter] $script -geometry 10x10+0+0} msg]} {
set error 1
} else {
set error 0
}
+ removeFile script
list $error $msg
} {0 {}}
+test unixWm-60.1 {wm attributes} unix {
+ destroy .t
+ toplevel .t
+ wm attributes .t
+} {}
+test unixWm-60.2 {wm attributes} unix {
+ destroy .t
+ toplevel .t
+ list [catch {wm attributes .t -foo} msg] $msg
+} {1 {wrong # args: should be "wm attributes window"}}
# cleanup
catch {destroy .t}
-catch {removeFile script}
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/util.test b/tk/tests/util.test
index b7399427898..25e7213d7fb 100644
--- a/tk/tests/util.test
+++ b/tk/tests/util.test
@@ -8,15 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
listbox .l -width 20 -height 5 -relief sunken -bd 2
pack .l
diff --git a/tk/tests/visual.test b/tk/tests/visual.test
index 4b2ef3e05b6..1ba896e708d 100644
--- a/tk/tests/visual.test
+++ b/tk/tests/visual.test
@@ -9,15 +9,13 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
update
# eatColors --
@@ -272,9 +270,7 @@ if {([winfo visual .] == "pseudocolor") && ([winfo depth .] == 8)} {
}
test visual-8.1 {Tk_FreeColormap procedure} {
- foreach w [winfo child .] {
- destroy $w
- }
+ deleteWindows
toplevel .t1 -width 300 -height 180 -colormap new
wm geometry .t1 +0+0
foreach i {.t2 .t3 .t4} {
@@ -288,9 +284,7 @@ test visual-8.1 {Tk_FreeColormap procedure} {
} {}
if {$other != {}} {
test visual-8.2 {Tk_FreeColormap procedure} {
- foreach w [winfo child .] {
- destroy $w
- }
+ deleteWindows
toplevel .t1 -width 300 -height 180 -visual $other
wm geometry .t1 +0+0
foreach i {.t2 .t3 .t4} {
@@ -304,9 +298,7 @@ if {$other != {}} {
} {}
}
-foreach w [winfo child .] {
- destroy $w
-}
+deleteWindows
rename eatColors {}
rename colorsFree {}
diff --git a/tk/tests/visual_bb.test b/tk/tests/visual_bb.test
index e0eea2fc5b2..16680222901 100644
--- a/tk/tests/visual_bb.test
+++ b/tk/tests/visual_bb.test
@@ -8,9 +8,14 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::cleanupTests
set auto_path ". $auto_path"
wm title . "Visual Tests for Tk"
@@ -23,7 +28,7 @@ proc runTest {file} {
global testNum
test "2.$testNum" "testing $file" {userInteraction} {
- uplevel \#0 source [file join $::tcltest::testsDir $file]
+ uplevel \#0 source [file join [testsDirectory] $file]
concat ""
} {}
incr testNum
@@ -31,15 +36,16 @@ proc runTest {file} {
# The following procedure is invoked to print the contents of a canvas:
-proc lpr c {
- exec rm -f tmp.ps
- $c postscript -file tmp.ps
- exec lpr tmp.ps
- exec rm -f tmp.ps
+proc lpr {c args} {
+ exec lpr <<[eval [list $c postscript] $args]
}
-test 1.1 "running visual tests" {userInteraction} {
+proc end {} {
+ cleanupTests
+ set ::EndOfVisualTests 1
+}
+test 1.1 "running visual tests" {userInteraction} {
#-------------------------------------------------------
# The code below create the main window, consisting of a
# menu bar and a message explaining the basic operation
@@ -60,7 +66,7 @@ test 1.1 "running visual tests" {userInteraction} {
menubutton .menu.file -text "File" -menu .menu.file.m
menu .menu.file.m
- .menu.file.m add command -label "Quit" -command ::tcltest::cleanupTests
+ .menu.file.m add command -label "Quit" -command end
menubutton .menu.group1 -text "Group 1" -menu .menu.group1.m
menu .menu.group1.m
@@ -83,7 +89,7 @@ test 1.1 "running visual tests" {userInteraction} {
.menu.ps.m add command -label "Bitmaps" \
-command {runTest canvPsBmap.tcl}
.menu.ps.m add command -label "Images" \
- -command {source canvPsImg.tcl}
+ -command {runTest canvPsImg.tcl}
.menu.ps.m add command -label "Arcs" \
-command {runTest canvPsArc.tcl}
@@ -106,6 +112,8 @@ test 1.1 "running visual tests" {userInteraction} {
concat ""
} {}
-if {!$::tcltest::testConfig(userInteraction)} {
- ::tcltest::cleanupTests
+if {![testConstraint userInteraction]} {
+ cleanupTests
+} else {
+ vwait EndOfVisualTests
}
diff --git a/tk/tests/winButton.test b/tk/tests/winButton.test
index 9e2a2e17b88..f8b7c13af3a 100644
--- a/tk/tests/winButton.test
+++ b/tk/tests/winButton.test
@@ -10,23 +10,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\""
- puts "image, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
proc bogusTrace args {
error "trace aborted"
@@ -35,7 +24,9 @@ catch {unset value}
catch {unset value2}
eval image delete [image names]
-image create test image1
+if {[testConstraint testImageType]} {
+ image create test image1
+}
label .l -text Label
button .b -text Button
checkbutton .c -text Checkbutton
@@ -43,8 +34,8 @@ radiobutton .r -text Radiobutton
pack .l .b .c .r
update
-test winbutton-1.1 {TkpComputeButtonGeometry procedure} {pcOnly} {
- eval destroy [winfo children .]
+test winbutton-1.1 {TkpComputeButtonGeometry procedure} {testImageType pcOnly} {
+ deleteWindows
image create test image1
image1 changed 0 0 0 0 60 40
label .b1 -image image1 -bd 4 -padx 0 -pady 2
@@ -53,26 +44,30 @@ test winbutton-1.1 {TkpComputeButtonGeometry procedure} {pcOnly} {
radiobutton .b4 -image image1 -bd 4 -padx 2 -pady 0
pack .b1 .b2 .b3 .b4
update
+ # with patch 463234 with native L&F enabled, this returns:
+ # {68 48 70 50 88 50 88 50}
list [winfo reqwidth .b1] [winfo reqheight .b1] \
[winfo reqwidth .b2] [winfo reqheight .b2] \
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
-} {68 48 71 51 96 50 96 50}
+} {68 48 70 50 90 52 90 52}
test winbutton-1.2 {TkpComputeButtonGeometry procedure} {pcOnly} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -bitmap question -bd 3 -padx 0 -pady 2
button .b2 -bitmap question -bd 3 -padx 0 -pady 2
checkbutton .b3 -bitmap question -bd 3 -padx 1 -pady 1
radiobutton .b4 -bitmap question -bd 3 -padx 2 -pady 0
pack .b1 .b2 .b3 .b4
update
+ # with patch 463234 with native L&F enabled, this returns:
+ # {23 33 25 35 43 35 43 35}
list [winfo reqwidth .b1] [winfo reqheight .b1] \
[winfo reqwidth .b2] [winfo reqheight .b2] \
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
-} {23 33 26 36 51 35 51 35}
+} {23 33 25 35 45 37 45 37}
test winbutton-1.3 {TkpComputeButtonGeometry procedure} {pcOnly} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -bitmap question -bd 3 -highlightthickness 4
button .b2 -bitmap question -bd 3 -highlightthickness 0
checkbutton .b3 -bitmap question -bd 3 -highlightthickness 1 \
@@ -80,13 +75,15 @@ test winbutton-1.3 {TkpComputeButtonGeometry procedure} {pcOnly} {
radiobutton .b4 -bitmap question -bd 3 -indicatoron false
pack .b1 .b2 .b3 .b4
update
+ # with patch 463234 with native L&F enabled, this returns:
+ # {31 41 23 33 25 35 25 35}
list [winfo reqwidth .b1] [winfo reqheight .b1] \
[winfo reqwidth .b2] [winfo reqheight .b2] \
[winfo reqwidth .b3] [winfo reqheight .b3] \
[winfo reqwidth .b4] [winfo reqheight .b4]
-} {31 41 24 34 26 36 26 36}
+} {31 41 23 33 27 37 27 37}
test winbutton-1.4 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 -font {{MS Sans Serif} 8}
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 -font {{MS Sans Serif} 8}
checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 -font {{MS Sans Serif} 8}
@@ -99,21 +96,21 @@ test winbutton-1.4 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
[winfo reqwidth .b4] [winfo reqheight .b4]
} {58 24 67 33 88 30 90 28}
test winbutton-1.5 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
- eval destroy [winfo children .]
+ deleteWindows
label .l1 -text "This is a long string that will wrap around on several lines.\n\nIt also has a blank line (above)." -wraplength 1.5i -padx 0 -pady 0
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
} {178 84}
test winbutton-1.6 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
- eval destroy [winfo children .]
+ deleteWindows
label .l1 -text "This is a long string without wrapping.\n\nIt also has a blank line (above)." -padx 0 -pady 0
pack .l1
update
list [winfo reqwidth .l1] [winfo reqheight .l1]
} {222 52}
test winbutton-1.7 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 -width 10
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 -height 5
checkbutton .b3 -text Xagqpim -bd 2 -padx 1 -pady 1 -width 20 -height 2
@@ -126,7 +123,7 @@ test winbutton-1.7 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
[winfo reqwidth .b4] [winfo reqheight .b4]
} {74 24 67 97 174 46 64 28}
test winbutton-1.8 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
- eval destroy [winfo children .]
+ deleteWindows
label .b1 -text Xagqpim -bd 2 -padx 0 -pady 2 \
-highlightthickness 4
button .b2 -text Xagqpim -bd 2 -padx 0 -pady 2 \
@@ -142,25 +139,12 @@ test winbutton-1.8 {TkpComputeButtonGeometry procedure} {pcOnly nonPortable} {
[winfo reqwidth .b4] [winfo reqheight .b4]
} {66 32 65 31 69 31 71 29}
test winbutton-1.9 {TkpComputeButtonGeometry procedure} {pcOnly} {
- eval destroy [winfo children .]
+ deleteWindows
button .b2 -bitmap question -default normal
list [winfo reqwidth .b2] [winfo reqheight .b2]
-} {24 34}
+} {23 33}
# cleanup
-eval destroy [winfo children .]
+deleteWindows
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/winClipboard.test b/tk/tests/winClipboard.test
index aaf29678ece..9db36915d7f 100644
--- a/tk/tests/winClipboard.test
+++ b/tk/tests/winClipboard.test
@@ -12,75 +12,74 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
+namespace import -force tcltest::bytestring
# Note that these tests may fail if another application is grabbing the
# clipboard (e.g. an X server)
-if {[llength [info command testclipboard]] == 0} {
- puts "\"testclipboard\" isn't defined, skipping winClipboard tests"
- ::tcltest::cleanupTests
- return
-}
+testConstraint testclipboard [llength [info commands testclipboard]]
test winClipboard-1.1 {TkSelGetSelection} {pcOnly} {
clipboard clear
catch {selection get -selection CLIPBOARD} msg
set msg
} {CLIPBOARD selection doesn't exist or form "STRING" not defined}
-test winClipboard-1.2 {TkSelGetSelection} {pcOnly} {
+test winClipboard-1.2 {TkSelGetSelection} {pcOnly testclipboard} {
clipboard clear
clipboard append {}
- list [selection get -selection CLIPBOARD] [testclipboard]
+ catch {selection get -selection CLIPBOARD} r1
+ catch {testclipboard} r2
+ list $r1 $r2
} {{} {}}
-test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
+test winClipboard-1.3 {TkSelGetSelection & TkWinClipboardRender} {pcOnly testclipboard} {
clipboard clear
clipboard append abcd
update
- list [selection get -selection CLIPBOARD] [testclipboard]
+ catch {selection get -selection CLIPBOARD} r1
+ catch {testclipboard} r2
+ list $r1 $r2
} {abcd abcd}
-test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
+test winClipboard-1.4 {TkSelGetSelection & TkWinClipboardRender} {pcOnly testclipboard} {
clipboard clear
clipboard append "line 1\nline 2"
- list [selection get -selection CLIPBOARD] [testclipboard]
+ catch {selection get -selection CLIPBOARD} r1
+ catch {testclipboard} r2
+ list $r1 $r2
} [list "line 1\nline 2" "line 1\r\nline 2"]
-test winClipboard-1.5 {TkSelGetSelection & TkWinClipboardRender} {pcOnly} {
+test winClipboard-1.5 {TkSelGetSelection & TkWinClipboardRender} {pcOnly testclipboard} {
clipboard clear
clipboard append "line 1\u00c7\nline 2"
- list [selection get -selection CLIPBOARD] [testclipboard]
+ catch {selection get -selection CLIPBOARD} r1
+ catch {testclipboard} r2
+ list $r1 $r2
} [list "line 1\u00c7\nline 2" [bytestring "line 1\u00c7\r\nline 2"]]
-test winClipboard-2.1 {TkSelUpdateClipboard reentrancy problem} {pcOnly} {
+test winClipboard-2.1 {TkSelUpdateClipboard reentrancy problem} {pcOnly testclipboard} {
clipboard clear
clipboard append -type OUR_ACTION "action data"
clipboard append "string data"
update
- list [selection get -selection CLIPBOARD -type OUR_ACTION] [testclipboard]
+ catch {selection get -selection CLIPBOARD -type OUR_ACTION} r1
+ catch {testclipboard} r2
+ list $r1 $r2
} [list "action data" "string data"]
-test winClipboard-2.2 {TkSelUpdateClipboard reentrancy problem} {pcOnly} {
+test winClipboard-2.2 {TkSelUpdateClipboard reentrancy problem} {pcOnly testclipboard} {
clipboard clear
clipboard append -type OUR_ACTION "new data"
clipboard append "more data in string"
update
- list [testclipboard] [selection get -selection CLIPBOARD -type OUR_ACTION]
+ catch {testclipboard} r1
+ catch {selection get -selection CLIPBOARD -type OUR_ACTION} r2
+ list $r1 $r2
} [list "more data in string" "new data"]
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/winDialog.test b/tk/tests/winDialog.test
index 4d01ae9d1c3..038c301963c 100644
--- a/tk/tests/winDialog.test
+++ b/tk/tests/winDialog.test
@@ -4,25 +4,20 @@
#
# Copyright (c) 1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
-# All rights reserved.
+# Copyright (c) 1998-1999 ActiveState Corporation.
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[info command testwinevent] == ""} {
- puts "skipping: tests require the testwinevent command"
- ::tcltest::cleanupTests
- return
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-testwinevent debug 1
+testConstraint testwinevent [llength [info commands testwinevent]]
-eval destroy [winfo children .]
-wm geometry . {}
-raise .
+catch {testwinevent debug 1}
proc start {arg} {
set ::tk_dialog 0
@@ -46,16 +41,16 @@ proc afterbody {} {
set ::dialogresult ">30 iterations waiting on tk_dialog"
return
}
- after 100 {afterbody}
+ after 150 {afterbody}
return
}
uplevel #0 {set dialogresult [eval $command]}
-}
+}
proc Click {button} {
testwinevent $::tk_dialog $button WM_LBUTTONDOWN 1 0x000a000b
testwinevent $::tk_dialog $button WM_LBUTTONUP 0 0x000a000b
-}
+}
proc GetText {button} {
return [testwinevent $::tk_dialog $button WM_GETTEXT]
@@ -71,7 +66,7 @@ test winDialog-1.1 {Tk_ChooseColorObjCmd} {nt} {
test winDialog-2.1 {ColorDlgHookProc} {nt} {
} {}
-test winDialog-3.1 {Tk_GetOpenFileObjCmd} {nt} {
+test winDialog-3.1 {Tk_GetOpenFileObjCmd} {nt testwinevent} {
start {tk_getOpenFile}
then {
set x [GetText 2]
@@ -80,7 +75,7 @@ test winDialog-3.1 {Tk_GetOpenFileObjCmd} {nt} {
set x
} {Cancel}
-test winDialog-4.1 {Tk_GetSaveFileObjCmd} {nt} {
+test winDialog-4.1 {Tk_GetSaveFileObjCmd} {nt testwinevent} {
start {tk_getSaveFile}
then {
set x [GetText 2]
@@ -89,7 +84,7 @@ test winDialog-4.1 {Tk_GetSaveFileObjCmd} {nt} {
set x
} {Cancel}
-test winDialog-5.1 {GetFileName: no arguments} {nt} {
+test winDialog-5.1 {GetFileName: no arguments} {nt testwinevent} {
start {tk_getOpenFile -title Open}
then {
Click cancel
@@ -97,8 +92,8 @@ test winDialog-5.1 {GetFileName: no arguments} {nt} {
} {0}
test winDialog-5.2 {GetFileName: one argument} {nt} {
list [catch {tk_getOpenFile -foo} msg] $msg
-} {1 {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, or -title}}
-test winDialog-5.4 {GetFileName: many arguments} {nt} {
+} {1 {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, or -title}}
+test winDialog-5.4 {GetFileName: many arguments} {nt testwinevent} {
start {tk_getOpenFile -initialdir c:/ -parent . -title test -initialfile foo}
then {
Click cancel
@@ -106,8 +101,8 @@ test winDialog-5.4 {GetFileName: many arguments} {nt} {
} {0}
test winDialog-5.5 {GetFileName: Tcl_GetIndexFromObj() != TCL_OK} {nt} {
list [catch {tk_getOpenFile -foo bar -abc} msg] $msg
-} {1 {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, or -title}}
-test winDialog-5.6 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} {nt} {
+} {1 {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, or -title}}
+test winDialog-5.6 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} {nt testwinevent} {
start {tk_getOpenFile -title bar}
then {
Click cancel
@@ -116,7 +111,7 @@ test winDialog-5.6 {GetFileName: Tcl_GetIndexFromObj() == TCL_OK} {nt} {
test winDialog-5.7 {GetFileName: valid option, but missing value} {nt} {
list [catch {tk_getOpenFile -initialdir bar -title} msg] $msg
} {1 {value for "-title" missing}}
-test winDialog-5.8 {GetFileName: extension begins with .} {nt} {
+test winDialog-5.8 {GetFileName: extension begins with .} {nt testwinevent} {
# if (string[0] == '.') {
# string++;
# }
@@ -126,17 +121,17 @@ test winDialog-5.8 {GetFileName: extension begins with .} {nt} {
SetText 0x480 bar
Click 1
}
- set x
-} [file join [pwd] bar.foo]
-test winDialog-5.9 {GetFileName: extension doesn't begin with .} {nt} {
+ string totitle $x
+} [string totitle [file join [pwd] bar.foo]]
+test winDialog-5.9 {GetFileName: extension doesn't begin with .} {nt testwinevent} {
start {set x [tk_getSaveFile -defaultextension foo -title Save]}
then {
SetText 0x480 bar
Click 1
}
- set x
-} [file join [pwd] bar.foo]
-test winDialog-5.10 {GetFileName: file types} {nt} {
+ string totitle $x
+} [string totitle [file join [pwd] bar.foo]]
+test winDialog-5.10 {GetFileName: file types} {nt testwinevent} {
# case FILE_TYPES:
start {tk_getSaveFile -filetypes {{"foo files" .foo FOOF}} -title Foo}
@@ -151,7 +146,7 @@ test winDialog-5.11 {GetFileName: file types: MakeFilter() fails} {nt} {
list [catch {tk_getSaveFile -filetypes {{"foo" .foo FOO}}} msg] $msg
} {1 {bad Macintosh file type "FOO"}}
-test winDialog-5.12 {GetFileName: initial directory} {nt} {
+test winDialog-5.12 {GetFileName: initial directory} {nt testwinevent} {
# case FILE_INITDIR:
start {set x [tk_getSaveFile -initialdir c:/ -initialfile "12x 455" -title Foo]}
@@ -166,15 +161,15 @@ test winDialog-5.13 {GetFileName: initial directory: Tcl_TranslateFilename()} \
list [catch {tk_getOpenFile -initialdir ~12x/455} msg] $msg
} {1 {user "12x" doesn't exist}}
-test winDialog-5.14 {GetFileName: initial file} {nt} {
+test winDialog-5.14 {GetFileName: initial file} {nt testwinevent} {
# case FILE_INITFILE:
start {set x [tk_getSaveFile -initialfile "12x 456" -title Foo]}
then {
Click 1
}
- set x
-} [file join [pwd] "12x 456"]
+ string totitle $x
+} [string totitle [file join [pwd] "12x 456"]]
test winDialog-5.15 {GetFileName: initial file: Tcl_TranslateFileName()} {nt} {
# if (Tcl_TranslateFileName(interp, string, &ds) == NULL)
list [catch {tk_getOpenFile -initialfile ~12x/455} msg] $msg
@@ -184,13 +179,13 @@ append a $a
append a $a
append a $a
append a $a
-test winDialog-5.16 {GetFileName: initial file: long name} {nt} {
+test winDialog-5.16 {GetFileName: initial file: long name} {nt testwinevent} {
start {set x [tk_getSaveFile -initialfile $a -title Long]}
then {
Click 1
}
- set x
-} [string range [file join [pwd] $a] 0 257]
+ string totitle $x
+} [string totitle [string range [file join [pwd] $a] 0 257]]
test winDialog-5.17 {GetFileName: parent} {nt} {
# case FILE_PARENT:
@@ -202,7 +197,7 @@ test winDialog-5.17 {GetFileName: parent} {nt} {
}
set x
} {1}
-test winDialog-5.18 {GetFileName: title} {nt} {
+test winDialog-5.18 {GetFileName: title} {nt testwinevent} {
# case FILE_TITLE:
start {tk_getOpenFile -title Narf}
@@ -210,7 +205,7 @@ test winDialog-5.18 {GetFileName: title} {nt} {
Click 2
}
} {0}
-test winDialog-5.19 {GetFileName: no filter specified} {nt} {
+test winDialog-5.19 {GetFileName: no filter specified} {nt testwinevent} {
# if (ofn.lpstrFilter == NULL)
start {tk_getOpenFile -title Filter}
@@ -237,7 +232,7 @@ test winDialog-5.21 {GetFileName: parent HWND already exists} {nt} {
destroy .t
}
} {}
-test winDialog-5.22 {GetFileName: call GetOpenFileName} {nt} {
+test winDialog-5.22 {GetFileName: call GetOpenFileName} {nt testwinevent} {
# winCode = GetOpenFileName(&ofn);
start {tk_getOpenFile -title Open}
@@ -247,7 +242,7 @@ test winDialog-5.22 {GetFileName: call GetOpenFileName} {nt} {
}
set x
} {&Open}
-test winDialog-5.23 {GetFileName: call GetSaveFileName} {nt} {
+test winDialog-5.23 {GetFileName: call GetSaveFileName} {nt testwinevent} {
# winCode = GetSaveFileName(&ofn);
start {tk_getSaveFile -title Save}
@@ -257,7 +252,7 @@ test winDialog-5.23 {GetFileName: call GetSaveFileName} {nt} {
}
set x
} {&Save}
-test winDialog-5.24 {GetFileName: convert \ to /} {nt} {
+test winDialog-5.24 {GetFileName: convert \ to /} {nt testwinevent} {
start {set x [tk_getSaveFile -title Back]}
then {
SetText 0x480 "c:\\12x 457"
@@ -276,7 +271,7 @@ test winDialog-8.1 {OFNHookProc} {emptyTest nt} {} {}
## because somehow the GetOpenFileName ends up a noop in the static
## build.
##
-test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} {nt} {
+test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} {nt testwinevent} {
start {tk_chooseDirectory}
then {
Click cancel
@@ -285,7 +280,7 @@ test winDialog-9.1 {Tk_ChooseDirectoryObjCmd: no arguments} {nt} {
test winDialog-9.2 {Tk_ChooseDirectoryObjCmd: one argument} {nt} {
list [catch {tk_chooseDirectory -foo} msg] $msg
} {1 {bad option "-foo": must be -initialdir, -mustexist, -parent, or -title}}
-test winDialog-9.3 {Tk_ChooseDirectoryObjCmd: many arguments} {nt} {
+test winDialog-9.3 {Tk_ChooseDirectoryObjCmd: many arguments} {nt testwinevent} {
start {
tk_chooseDirectory -initialdir c:/ -mustexist 1 -parent . -title test
}
@@ -298,7 +293,7 @@ test winDialog-9.4 {Tk_ChooseDirectoryObjCmd:\
list [catch {tk_chooseDirectory -foo bar -abc} msg] $msg
} {1 {bad option "-foo": must be -initialdir, -mustexist, -parent, or -title}}
test winDialog-9.5 {Tk_ChooseDirectoryObjCmd:\
- Tcl_GetIndexFromObj() == TCL_OK} {nt} {
+ Tcl_GetIndexFromObj() == TCL_OK} {nt testwinevent} {
start {tk_chooseDirectory -title bar}
then {
Click cancel
@@ -308,7 +303,7 @@ test winDialog-9.6 {Tk_ChooseDirectoryObjCmd:\
valid option, but missing value} {nt} {
list [catch {tk_chooseDirectory -initialdir bar -title} msg] $msg
} {1 {value for "-title" missing}}
-test winDialog-9.7 {Tk_ChooseDirectoryObjCmd: -initialdir} {nt} {
+test winDialog-9.7 {Tk_ChooseDirectoryObjCmd: -initialdir} {nt testwinevent} {
# case DIR_INITIAL:
start {set x [tk_chooseDirectory -initialdir c:/ -title Foo]}
@@ -325,9 +320,8 @@ test winDialog-9.8 {Tk_ChooseDirectoryObjCmd:\
list [catch {tk_chooseDirectory -initialdir ~12x/455} msg] $msg
} {1 {user "12x" doesn't exist}}
-testwinevent debug 0
+catch {testwinevent debug 0}
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/winFont.test b/tk/tests/winFont.test
index 9e8949a7d30..d1776d8a90e 100644
--- a/tk/tests/winFont.test
+++ b/tk/tests/winFont.test
@@ -12,9 +12,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
catch {destroy .b}
catch {font delete xyz}
@@ -183,15 +186,3 @@ test winfont-7.4 {AllocFont procedure: extract info from textmetric} {pcOnly} {
destroy .b
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tk/tests/winMenu.test b/tk/tests/winMenu.test
index ae9d74a0d92..50c75304009 100644
--- a/tk/tests/winMenu.test
+++ b/tk/tests/winMenu.test
@@ -9,27 +9,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {[lsearch [image types] test] < 0} {
- puts "This application hasn't been compiled with the \"test\" image"
- puts "type, so I can't run this test. Are you sure you're using"
- puts "tktest instead of wish?"
- ::tcltest::cleanupTests
- return
-}
-
-proc deleteWindows {} {
- foreach i [winfo children .] {
- catch [destroy $i]
- }
-}
-
-deleteWindows
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
test winMenu-1.1 {GetNewID} {pcOnly} {
catch {destroy .m1}
@@ -81,7 +66,7 @@ test winMenu-6.1 {GetEntryText} {pcOnly} {
catch {destroy .m1}
list [catch {menu .m1} msg] $msg [destroy .m1]
} {0 .m1 {}}
-test winMenu-6.2 {GetEntryText} {pcOnly} {
+test winMenu-6.2 {GetEntryText} {testImageType pcOnly} {
catch {destroy .m1}
catch {image delete image1}
menu .m1
@@ -322,7 +307,7 @@ test winMenu-8.4 {TkpPostMenu - menu button} {pcOnly userInteraction} {
menu .mb.menu
.mb.menu add command -label "winMenu-8.4 - Hit ESCAPE."
pack .mb
- list [tkMbPost .mb] [destroy .m1]
+ list [tk::MbPost .mb] [destroy .m1]
} {{} {}}
test winMenu-8.5 {TkpPostMenu - update not pending} {pcOnly userInteraction} {
catch {destroy .m1}
@@ -440,32 +425,32 @@ test winMenu-14.1 {GetMenuIndicatorGeometry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
test winMenu-14.2 {GetMenuIndicatorGeometry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo -hidemargin 1
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
test winMenu-15.1 {GetMenuAccelGeometry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo -accel Ctrl+U
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
test winMenu-15.2 {GetMenuAccelGeometry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
test winMenu-15.3 {GetMenuAccelGeometry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
test winMenu-16.1 {GetTearoffEntryGeometry} {pcOnly userInteraction} {
@@ -479,7 +464,7 @@ test winMenu-17.1 {GetMenuSeparatorGeometry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
- list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1]
+ list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1]
} {0 {}}
# Currently, the only callers to DrawWindowsSystemBitmap want things
@@ -489,14 +474,14 @@ test winMenu-18.1 {DrawWindowsSystemBitmap - center aligned} {pcOnly} {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-18.2 {DrawWindowsSystemBitmap - right aligned} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
@@ -505,14 +490,14 @@ test winMenu-19.1 {DrawMenuEntryIndicator - not checkbutton or radiobutton} \
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-19.2 {DrawMenuEntryIndicator - not selected} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add checkbutton -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-19.3 {DrawMenuEntryIndicator - checkbutton} {pcOnly} {
@@ -520,7 +505,7 @@ test winMenu-19.3 {DrawMenuEntryIndicator - checkbutton} {pcOnly} {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-19.4 {DrawMenuEntryIndicator - radiobutton} {pcOnly} {
@@ -528,7 +513,7 @@ test winMenu-19.4 {DrawMenuEntryIndicator - radiobutton} {pcOnly} {
menu .m1
.m1 add radiobutton -label foo
.m1 invoke foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-19.5 {DrawMenuEntryIndicator - disabled} {pcOnly} {
@@ -537,7 +522,7 @@ test winMenu-19.5 {DrawMenuEntryIndicator - disabled} {pcOnly} {
.m1 add checkbutton -label foo
.m1 invoke foo
.m1 entryconfigure foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-19.6 {DrawMenuEntryIndicator - indicator not on} {pcOnly} {
@@ -545,7 +530,7 @@ test winMenu-19.6 {DrawMenuEntryIndicator - indicator not on} {pcOnly} {
menu .m1
.m1 add checkbutton -label foo -indicatoron 0
.m1 invoke foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
@@ -553,14 +538,14 @@ test winMenu-20.1 {DrawMenuEntryAccelerator - disabled} {pcOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground red
.m1 add command -label foo -accel "Ctrl+U" -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-20.2 {DrawMenuEntryAccelerator - normal text} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -accel "Ctrl+U"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} \
@@ -568,14 +553,14 @@ test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} \
catch {destroy .m1}
menu .m1 -disabledforeground ""
.m1 add command -label foo -accel "Ctrl+U" -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-20.4 {DrawMenuEntryAccelerator - cascade, drawArrow true} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add cascade -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-20.5 {DrawMenuEntryAccelerator - cascade, drawArrow false} \
@@ -590,7 +575,7 @@ test winMenu-21.1 {DrawMenuSeparator} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
@@ -598,7 +583,7 @@ test winMenu-22.1 {DrawMenuUnderline} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -underline 0
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
@@ -611,21 +596,21 @@ test winMenu-25.1 {DrawMenuEntryLabel - normal} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-25.2 {DrawMenuEntryLabel - disabled with fg} {pcOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground red
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-25.3 {DrawMenuEntryLabel - disabled with no fg} {pcOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground ""
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
@@ -662,7 +647,7 @@ test winMenu-29.1 {TkpDrawMenuEntry - gc for active and not strict motif} \
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
@@ -671,7 +656,7 @@ test winMenu-29.2 {TkpDrawMenuEntry - gc for active menu item with its own gc} \
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activeforeground red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
@@ -680,7 +665,7 @@ test winMenu-29.3 {TkpDrawMenuEntry - gc for active and strict motif} {pcOnly} {
menu .m1
set tk_strictMotif 1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
} {{} {} 0}
@@ -690,35 +675,35 @@ test winMenu-29.4 \
catch {destroy .m1}
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled -background red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {pcOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground blue
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {pcOnly} {
catch {destroy .m1}
menu .m1 -disabledforeground ""
.m1 add command -label foo -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.7 {TkpDrawMenuEntry - gc for normal - custom entry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -foreground red
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.8 {TkpDrawMenuEntry - gc for normal} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {pcOnly} {
@@ -726,7 +711,7 @@ test winMenu-29.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {pcOnly}
menu .m1
.m1 add checkbutton -label foo -selectcolor orange
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.10 {TkpDrawMenuEntry - gc for indicator} {pcOnly} {
@@ -734,14 +719,14 @@ test winMenu-29.10 {TkpDrawMenuEntry - gc for indicator} {pcOnly} {
menu .m1
.m1 add checkbutton -label foo
.m1 invoke 1
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.11 {TkpDrawMenuEntry - border - custom entry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activebackground green
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
@@ -749,7 +734,7 @@ test winMenu-29.12 {TkpDrawMenuEntry - border} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
@@ -758,7 +743,7 @@ test winMenu-29.13 {TkpDrawMenuEntry - active border - strict motif} {pcOnly} {
set tk_strictMotif 1
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1] [set tk_strictMotif 0]
} {{} {} 0}
@@ -766,7 +751,7 @@ test winMenu-29.14 {TkpDrawMenuEntry - active border - custom entry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -activeforeground yellow
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
@@ -774,7 +759,7 @@ test winMenu-29.15 {TkpDrawMenuEntry - active border} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
.m1 entryconfigure 1 -state active
list [update] [destroy .m1]
} {{} {}}
@@ -782,28 +767,28 @@ test winMenu-29.16 {TkpDrawMenuEntry - font - custom entry} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo -font "Helvectica 72"
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.17 {TkpDrawMenuEntry - font} {pcOnly} {
catch {destroy .m1}
menu .m1 -font "Courier 72"
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.18 {TkpDrawMenuEntry - separator} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add separator
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.19 {TkpDrawMenuEntry - standard} {pcOnly} {
catch {destroy .mb}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.20 {TkpDrawMenuEntry - disabled cascade item} {pcOnly} {
@@ -813,7 +798,7 @@ test winMenu-29.20 {TkpDrawMenuEntry - disabled cascade item} {pcOnly} {
menu .m1.file
.m1.file add command -label foo
.m1 entryconfigure File -state disabled
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.21 {TkpDrawMenuEntry - indicator} {pcOnly} {
@@ -821,7 +806,7 @@ test winMenu-29.21 {TkpDrawMenuEntry - indicator} {pcOnly} {
menu .m1
.m1 add checkbutton -label winMenu-31.20
.m1 invoke winMenu-31.20
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-29.22 {TkpDrawMenuEntry - indicator} {pcOnly} {
@@ -829,11 +814,11 @@ test winMenu-29.22 {TkpDrawMenuEntry - indicator} {pcOnly} {
menu .m1
.m1 add checkbutton -label winMenu-31.21 -hidemargin 1
.m1 invoke winMenu-31.21
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
-test winMenu-30.1 {GetMenuLabelGeometry - image} {pcOnly} {
+test winMenu-30.1 {GetMenuLabelGeometry - image} {testImageType pcOnly} {
catch {destroy .m1}
catch {image delete image1}
menu .m1
@@ -864,14 +849,14 @@ test winMenu-31.1 {DrawMenuEntryBackground} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
list [update] [destroy .m1]
} {{} {}}
test winMenu-31.2 {DrawMenuEntryBackground} {pcOnly} {
catch {destroy .m1}
menu .m1
.m1 add command -label foo
- set tearoff [tkTearOffMenu .m1 40 40]
+ set tearoff [tk::TearOffMenu .m1 40 40]
$tearoff activate 0
list [update] [destroy .m1]
} {{} {}}
@@ -906,7 +891,7 @@ test winMenu-32.5 {TkpComputeStandardMenuGeometry - tearoff entry} {unixOnly} {
menu .mb.m
.mb.m add command -label test
pack .mb
- catch {tkMbPost .mb}
+ catch {tk::MbPost .mb}
list [update] [destroy .mb]
} {{} {}}
test winMenu-32.6 {TkpComputeStandardMenuGeometry - standard label geometry} \
@@ -967,7 +952,7 @@ test winMenu-32.13 {TkpComputeStandardMenuGeometry - indicator} {pcOnly} {
} {{} {}}
test winMenu-32.14 \
{TkpComputeStandardMenuGeometry - second indicator less or equal} \
- {pcOnly} {
+ {testImageType pcOnly} {
catch {destroy .m1}
catch {image delete image1}
image create test image1
@@ -979,7 +964,7 @@ test winMenu-32.14 \
list [update idletasks] [destroy .m1] [image delete image1]
} {{} {} {}}
test winMenu-32.15 {TkpComputeStandardMenuGeometry - second indicator larger} \
- {unixOnly} {
+ {testImageType unixOnly} {
catch {destroy .m1}
catch {image delete image1}
image create test image1
diff --git a/tk/tests/winSend.test b/tk/tests/winSend.test
index 54cec4ce8ff..17ff7828d48 100644
--- a/tk/tests/winSend.test
+++ b/tk/tests/winSend.test
@@ -9,35 +9,14 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-if {$tcl_platform(platform) != "windows"} {
- puts "skipping: Windows only tests..."
- ::tcltest::cleanupTests
- return
-}
-
-if {[info commands send] != "send"} {
- puts "skipping: Unimplemented send command"
- ::tcltest::cleanupTests
- return
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
-
-set currentInterps [winfo interps]
-
-if {[catch {exec tktest &}] == 1} {
- puts "Could not run winSend.test because another instance of tktest could not be loaded."
- ::tcltest::cleanupTests
- return;
-}
+namespace import -force tcltest::interpreter
# Compute a script that will load Tk into a child interpreter.
@@ -61,86 +40,91 @@ proc newApp {name {safe {}}} {
catch {eval $loadTk $name}
}
-# Wait until the child application has launched.
+set currentInterps [winfo interps]
+if {[testConstraint win] && [llength [info commands send]]} {
-while {[llength [winfo interps]] == [llength $currentInterps]} {
-}
+ if {[catch {exec [interpreter] &}] == 0} {
-# Now find an interp to send to
-set newInterps [winfo interps]
-foreach interp $newInterps {
- if {[lsearch -exact $currentInterps $interp] < 0} {
- break
- }
-}
+ # Wait until the child application has launched.
+ while {[llength [winfo interps]] == [llength $currentInterps]} {}
+
+ # Now find an interp to send to
+ set newInterps [winfo interps]
+ foreach interp $newInterps {
+ if {[lsearch -exact $currentInterps $interp] < 0} {
+ break
+ }
+ }
-# Now we have found our interpreter we are going to send to. Make sure that
-# it works first.
-if {[catch {send $interp {console hide; update}}] == 1} {
- puts "Could not send to child interpreter $interp"
- ::tcltest::cleanupTests
- return
+ # Now we have found our interpreter we are going to send to.
+ # Make sure that it works first.
+ testConstraint winSend [expr {[catch {
+ send $interp {console hide; update}
+ }] == 0}]
+ }
}
# setting up dde server is done when the first interp is created and
# cannot be tested very easily.
-test winSend-1.1 {Tk_SetAppName - changing name of interp} {
+test winSend-1.1 {Tk_SetAppName - changing name of interp} winSend {
newApp testApp
list [testApp eval tk appname testApp2] [interp delete testApp]
} {testApp2 {}}
test winSend-1.2 {Tk_SetAppName - changing name - not front of linked list} {
+ winSend
+} {
newApp testApp
newApp testApp2
list [testApp eval tk appname testApp3] [interp delete testApp] [interp delete testApp2]
} {testApp3 {} {}}
-test winSend-1.3 {Tk_SetAppName - unique name - no conflicts} {
+test winSend-1.3 {Tk_SetAppName - unique name - no conflicts} winSend {
newApp testApp
list [testApp eval tk appname testApp] [interp delete testApp]
} {testApp {}}
-test winSend-1.4 {Tk_SetAppName - unique name - one conflict} {
+test winSend-1.4 {Tk_SetAppName - unique name - one conflict} winSend {
newApp testApp
newApp foobar
list [foobar eval tk appname testApp] [interp delete foobar] [interp delete testApp]
} {{testApp #2} {} {}}
-test winSend-1.5 {Tk_SetAppName - unique name - one conflict} {
+test winSend-1.5 {Tk_SetAppName - unique name - one conflict} winSend {
newApp testApp
newApp foobar
newApp blaz
foobar eval tk appname testApp
list [blaz eval tk appname testApp] [interp delete foobar] [interp delete testApp] [interp delete blaz]
} {{testApp #3} {} {} {}}
-test winSend-1.6 {Tk_SetAppName - safe interps} {
+test winSend-1.6 {Tk_SetAppName - safe interps} winSend {
newApp testApp -safe
list [catch {testApp eval send testApp {set foo a}} msg] $msg [interp delete testApp]
} {1 {invalid command name "send"} {}}
-test winSend-2.1 {Tk_SendObjCmd - # of args} {
+test winSend-2.1 {Tk_SendObjCmd - # of args} winSend {
list [catch {send tktest} msg] $msg
} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}}
-test winSend-2.1 {Tk_SendObjCmd: arguments} {
+test winSend-2.1 {Tk_SendObjCmd: arguments} winSend {
list [catch {send -bogus tktest} msg] $msg
} {1 {bad option "-bogus": must be -async, -displayof, or --}}
-test winSend-2.1 {Tk_SendObjCmd: arguments} {
+test winSend-2.1 {Tk_SendObjCmd: arguments} winSend {
list [catch {send -async bogus foo} msg] $msg
} {1 {no registered server named "bogus"}}
-test winSend-2.1 {Tk_SendObjCmd: arguments} {
+test winSend-2.1 {Tk_SendObjCmd: arguments} winSend {
list [catch {send -displayof . bogus foo} msg] $msg
} {1 {no registered server named "bogus"}}
-test winSend-2.1 {Tk_SendObjCmd: arguments} {
+test winSend-2.1 {Tk_SendObjCmd: arguments} winSend {
list [catch {send -- -bogus foo} msg] $msg
} {1 {no registered server named "-bogus"}}
-test winSend-2.2 {Tk_SendObjCmd - sending to ourselves} {
+test winSend-2.2 {Tk_SendObjCmd - sending to ourselves} winSend {
list [send [tk appname] {set foo a}]
} {a}
-test winSend-2.3 {Tk_SendObjCmd - sending to ourselves in a different interpreter} {
+test winSend-2.3 {Tk_SendObjCmd - sending to ourselves in a different interpreter} winSend {
newApp testApp
list [catch {send testApp {set foo b}} msg] $msg [interp delete testApp]
} {0 b {}}
-test winSend-2.4 {Tk_SendObjCmd - sending to ourselves in a different interp with errors} {
+test winSend-2.4 {Tk_SendObjCmd - sending to ourselves in a different interp with errors} winSend {
newApp testApp
list [catch {send testApp {expr 2 / 0}} msg] $msg $errorCode $errorInfo [interp delete testApp]
} "1 {divide by zero} {ARITH DIVZERO {divide by zero}} {divide by zero\n while executing\n\"expr 2 / 0\"\n invoked from within\n\"send testApp {expr 2 / 0}\"} {}"
-test winSend-2.5 {Tk_SendObjCmd - sending to another app async} {
+test winSend-2.5 {Tk_SendObjCmd - sending to another app async} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -149,7 +133,7 @@ test winSend-2.5 {Tk_SendObjCmd - sending to another app async} {
}
list [catch {send -async $interp {set foo a}} msg] $msg
} {0 {}}
-test winSend-2.6 {Tk_SendObjCmd - sending to another app sync - no error} {
+test winSend-2.6 {Tk_SendObjCmd - sending to another app sync - no error} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -158,7 +142,7 @@ test winSend-2.6 {Tk_SendObjCmd - sending to another app sync - no error} {
}
list [catch {send $interp {set foo a}} msg] $msg
} {0 a}
-test winSend-2.7 {Tk_SendObjCmd - sending to another app - error} {
+test winSend-2.7 {Tk_SendObjCmd - sending to another app - error} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -168,22 +152,22 @@ test winSend-2.7 {Tk_SendObjCmd - sending to another app - error} {
list [catch {send $interp {expr 2 / 0}} msg] $msg $errorCode $errorInfo
} "1 {divide by zero} {ARITH DIVZERO {divide by zero}} {divide by zero\n while executing\n\"expr 2 / 0\"\n invoked from within\n\"send \$interp {expr 2 / 0}\"}"
-test winSend-3.1 {TkGetInterpNames} {
+test winSend-3.1 {TkGetInterpNames} winSend {
set origLength [llength $currentInterps]
set newLength [llength [winfo interps]]
expr {($newLength - 2) == $origLength}
} {1}
-test winSend-4.1 {DeleteProc - changing name of app} {
+test winSend-4.1 {DeleteProc - changing name of app} winSend {
newApp a
list [a eval tk appname foo] [interp delete a]
} {foo {}}
-test winSend-4.2 {DeleteProc - normal} {
+test winSend-4.2 {DeleteProc - normal} winSend {
newApp a
list [interp delete a]
} {{}}
-test winSend-5.1 {ExecuteRemoteObject - no error} {
+test winSend-5.1 {ExecuteRemoteObject - no error} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -192,7 +176,7 @@ test winSend-5.1 {ExecuteRemoteObject - no error} {
}
list [send $interp {send [tk appname] {expr 2 / 1}}]
} {2}
-test winSend-5.2 {ExecuteRemoteObject - error} {
+test winSend-5.2 {ExecuteRemoteObject - error} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -202,7 +186,7 @@ test winSend-5.2 {ExecuteRemoteObject - error} {
list [catch {send $interp {send [tk appname] {expr 2 / 0}}} msg] $msg
} {1 {divide by zero}}
-test winSend-6.1 {SendDDEServer - XTYP_CONNECT} {
+test winSend-6.1 {SendDDEServer - XTYP_CONNECT} winSend {
set foo "Hello, World"
set newInterps [winfo interps]
foreach interp $newInterps {
@@ -213,7 +197,7 @@ test winSend-6.1 {SendDDEServer - XTYP_CONNECT} {
set command "dde request Tk [tk appname] foo"
list [catch "send \{$interp\} \{$command\}" msg] $msg
} {0 {Hello, World}}
-test winSend-6.2 {SendDDEServer - XTYP_CONNECT_CONFIRM} {
+test winSend-6.2 {SendDDEServer - XTYP_CONNECT_CONFIRM} winSend {
set foo "Hello, World"
set newInterps [winfo interps]
foreach interp $newInterps {
@@ -224,7 +208,7 @@ test winSend-6.2 {SendDDEServer - XTYP_CONNECT_CONFIRM} {
set command "dde request Tk [tk appname] foo"
list [catch "send \{$interp\} \{$command\}" msg] $msg
} {0 {Hello, World}}
-test winSend-6.3 {SendDDEServer - XTYP_DISCONNECT} {
+test winSend-6.3 {SendDDEServer - XTYP_DISCONNECT} winSend {
set foo "Hello, World"
set newInterps [winfo interps]
foreach interp $newInterps {
@@ -235,7 +219,7 @@ test winSend-6.3 {SendDDEServer - XTYP_DISCONNECT} {
set command "dde request Tk [tk appname] foo"
list [catch "send \{$interp\} \{$command\}" msg] $msg
} {0 {Hello, World}}
-test winSend-6.4 {SendDDEServer - XTYP_REQUEST variable} {
+test winSend-6.4 {SendDDEServer - XTYP_REQUEST variable} winSend {
set foo "Hello, World"
set newInterps [winfo interps]
foreach interp $newInterps {
@@ -246,7 +230,7 @@ test winSend-6.4 {SendDDEServer - XTYP_REQUEST variable} {
set command "dde request Tk [tk appname] foo"
list [catch "send \{$interp\} \{$command\}" msg] $msg
} {0 {Hello, World}}
-test winSend-6.5 {SendDDEServer - XTYP_REQUEST array} {
+test winSend-6.5 {SendDDEServer - XTYP_REQUEST array} winSend {
catch {unset foo}
set foo(test) "Hello, World"
set newInterps [winfo interps]
@@ -258,7 +242,7 @@ test winSend-6.5 {SendDDEServer - XTYP_REQUEST array} {
set command "dde request Tk [tk appname] foo(test)"
list [catch "send \{$interp\} \{$command\}" msg] $msg [catch {unset foo}]
} {0 {Hello, World} 0}
-test winSend-6.6 {SendDDEServer - XTYP_REQUEST return results} {
+test winSend-6.6 {SendDDEServer - XTYP_REQUEST return results} winSend {
set foo 3
set newInterps [winfo interps]
foreach interp $newInterps {
@@ -269,7 +253,7 @@ test winSend-6.6 {SendDDEServer - XTYP_REQUEST return results} {
set command "send [tk appname] {expr $foo + 1}"
list [catch "send \{$interp\} \{$command\}" msg] $msg
} {0 4}
-test winSend-6.7 {SendDDEServer - XTYP_EXECUTE} {
+test winSend-6.7 {SendDDEServer - XTYP_EXECUTE} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -279,7 +263,7 @@ test winSend-6.7 {SendDDEServer - XTYP_EXECUTE} {
set command "send [tk appname] {expr 4 / 2}"
list [catch "send \{$interp\} \{$command\}" msg] $msg
} {0 2}
-test winSend-6.8 {SendDDEServer - XTYP_WILDCONNECT} {
+test winSend-6.8 {SendDDEServer - XTYP_WILDCONNECT} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -290,12 +274,12 @@ test winSend-6.8 {SendDDEServer - XTYP_WILDCONNECT} {
list [catch "send \{$interp\} \{$command\}"]
} {0}
-test winSend-7.1 {DDEExitProc} {
+test winSend-7.1 {DDEExitProc} winSend {
newApp testApp
list [interp delete testApp]
} {{}}
-test winSend-8.1 {SendDdeConnect} {
+test winSend-8.1 {SendDdeConnect} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -305,38 +289,38 @@ test winSend-8.1 {SendDdeConnect} {
list [send $interp {set tk foo}]
} {foo}
-test winSend-9.1 {SetDDEError} {
+test winSend-9.1 {SetDDEError} winSend {
list [catch {dde execute Tk foo {set foo hello}} msg] $msg
} {1 {dde command failed}}
-test winSend-10.1 {Tk_DDEObjCmd - wrong num args} {
+test winSend-10.1 {Tk_DDEObjCmd - wrong num args} winSend {
list [catch {dde} msg] $msg
} {1 {wrong # args: should be "dde ?-async? serviceName topicName value"}}
-test winSend-10.2 {Tk_DDEObjCmd - unknown subcommand} {
+test winSend-10.2 {Tk_DDEObjCmd - unknown subcommand} winSend {
list [catch {dde foo} msg] $msg
} {1 {bad command "foo": must be execute, request, or services}}
-test winSend-10.3 {Tk_DDEObjCmd - execute - wrong num args} {
+test winSend-10.3 {Tk_DDEObjCmd - execute - wrong num args} winSend {
list [catch {dde execute} msg] $msg
} {1 {wrong # args: should be "dde execute ?-async? serviceName topicName value"}}
-test winSend-10.4 {Tk_DDEObjCmd - execute - wrong num args} {
+test winSend-10.4 {Tk_DDEObjCmd - execute - wrong num args} winSend {
list [catch {dde execute 3 4 5 6 7} msg] $msg
} {1 {wrong # args: should be "dde execute ?-async? serviceName topicName value"}}
-test winSend-10.5 {Tk_DDEObjCmd - execute async - wrong num args} {
+test winSend-10.5 {Tk_DDEObjCmd - execute async - wrong num args} winSend {
list [catch {dde execute -async} msg] $msg
} {1 {wrong # args: should be "dde execute ?-async? serviceName topicName value"}}
-test winSend-10.6 {Tk_DDEObjCmd - request - wrong num args} {
+test winSend-10.6 {Tk_DDEObjCmd - request - wrong num args} winSend {
list [catch {dde request} msg] $msg
} {1 {wrong # args: should be "dde request serviceName topicName value"}}
-test winSend-10.7 {Tk_DDEObjCmd - services wrong num args} {
+test winSend-10.7 {Tk_DDEObjCmd - services wrong num args} winSend {
list [catch {dde services} msg] $msg
} {1 {wrong # args: should be "dde services serviceName topicName"}}
-test winSend-10.8 {Tk_DDEObjCmd - null service name} {
+test winSend-10.8 {Tk_DDEObjCmd - null service name} winSend {
list [catch {dde services {} {tktest #2}}]
} {0}
-test winSend-10.9 {Tk_DDEObjCmd - null topic name} {
+test winSend-10.9 {Tk_DDEObjCmd - null topic name} winSend {
list [catch {dde services {Tk} {}}]
} {0}
-test winSend-10.10 {Tk_DDEObjCmd - execute - nothing to execute} {
+test winSend-10.10 {Tk_DDEObjCmd - execute - nothing to execute} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -345,10 +329,10 @@ test winSend-10.10 {Tk_DDEObjCmd - execute - nothing to execute} {
}
list [catch {dde execute Tk $interp {}} msg] $msg
} {1 {cannot execute null data}}
-test winSend-10.11 {Tk_DDEObjCmd - execute - no such conversation} {
+test winSend-10.11 {Tk_DDEObjCmd - execute - no such conversation} winSend {
list [catch {dde execute Tk foo {set foo hello}} msg] $msg
} {1 {dde command failed}}
-test winSend-10.12 {Tk_DDEObjCmd - execute - async} {
+test winSend-10.12 {Tk_DDEObjCmd - execute - async} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -357,7 +341,7 @@ test winSend-10.12 {Tk_DDEObjCmd - execute - async} {
}
list [catch {dde execute -async Tk $interp {set foo hello}} msg] $msg
} {0 {}}
-test winSend-10.13 {Tk_DDEObjCmd - execute} {
+test winSend-10.13 {Tk_DDEObjCmd - execute} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -366,7 +350,7 @@ test winSend-10.13 {Tk_DDEObjCmd - execute} {
}
list [catch {dde execute Tk $interp {set foo goodbye}} msg] $msg
} {0 {}}
-test winSend-10.14 {Tk_DDEObjCmd - request - nothing to request} {
+test winSend-10.14 {Tk_DDEObjCmd - request - nothing to request} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -375,7 +359,7 @@ test winSend-10.14 {Tk_DDEObjCmd - request - nothing to request} {
}
list [catch {dde request Tk $interp {}} msg] $msg
} {1 {cannot request value of null data}}
-test winSend-10.15 {Tk_DDEObjCmd - request - invalid interp} {
+test winSend-10.15 {Tk_DDEObjCmd - request - invalid interp} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -384,7 +368,7 @@ test winSend-10.15 {Tk_DDEObjCmd - request - invalid interp} {
}
list [catch {dde request Tk foo foo} msg] $msg
} {1 {dde command failed}}
-test winSend-10.16 {Tk_DDEObjCmd - invalid variable} {
+test winSend-10.16 {Tk_DDEObjCmd - invalid variable} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -394,7 +378,7 @@ test winSend-10.16 {Tk_DDEObjCmd - invalid variable} {
send $interp {unset foo}
list [catch {dde request Tk $interp foo} msg] $msg
} {1 {remote server cannot handle this command}}
-test winSend-10.17 {Tk_DDEObjCmd - valid variable} {
+test winSend-10.17 {Tk_DDEObjCmd - valid variable} winSend {
set newInterps [winfo interps]
foreach interp $newInterps {
if {[lsearch $currentInterps $interp] < 0} {
@@ -404,7 +388,7 @@ test winSend-10.17 {Tk_DDEObjCmd - valid variable} {
send $interp {set foo winSend-10.17}
list [catch {dde request Tk $interp foo} msg] $msg
} {0 winSend-10.17}
-test winSend-10.18 {Tk_DDEObjCmd - services} {
+test winSend-10.18 {Tk_DDEObjCmd - services} winSend {
set currentService [list Tk [tk appname]]
list [catch {dde services Tk {}} msg] [expr [lsearch $msg $currentService] >= 0]
} {0 1}
diff --git a/tk/tests/winWm.test b/tk/tests/winWm.test
index e3d15ea5529..e5d9a8e20fe 100644
--- a/tk/tests/winWm.test
+++ b/tk/tests/winWm.test
@@ -11,13 +11,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- catch {destroy $i}
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# Measure the height of a single menu line
@@ -229,18 +228,49 @@ test winWm-5.2 {UpdateGeometryInfo: menu resizing} {pcOnly} {
set result
} {50 50 0}
-# cleanup
-::tcltest::cleanupTests
-return
-
-
-
-
-
-
-
+test winWm-6.1 {wm attributes} {pcOnly} {
+ destroy .t
+ toplevel .t
+ wm attributes .t
+} {-disabled 0 -toolwindow 0 -topmost 0}
+test winWm-6.2 {wm attributes} {pcOnly} {
+ destroy .t
+ toplevel .t
+ wm attributes .t -disabled
+} {0}
+test winWm-6.3 {wm attributes} {pcOnly} {
+ # This isn't quite the correct error message yet, but it works.
+ destroy .t
+ toplevel .t
+ list [catch {wm attributes .t -foo} msg] $msg
+} {1 {wrong # args: should be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+destroy .t
+test winWm-6.1 {deiconify on an unmapped toplevel
+ will raise the window and set the focus} {pcOnly} {
+ destroy .t
+ toplevel .t
+ lower .t
+ focus -force .
+ wm deiconify .t
+ update
+ list [wm stackorder .t isabove .] [focus]
+} {1 .t}
+test winWm-6.2 {deiconify on an already mapped toplevel
+ will raise the window and set the focus} {pcOnly} {
+ destroy .t
+ toplevel .t
+ lower .t
+ update
+ focus -force .
+ wm deiconify .t
+ update
+ list [wm stackorder .t isabove .] [focus]
+} {1 .t}
+# cleanup
+::tcltest::cleanupTests
+return
diff --git a/tk/tests/window.test b/tk/tests/window.test
index 6d9371ba14d..3f57861d748 100644
--- a/tk/tests/window.test
+++ b/tk/tests/window.test
@@ -7,15 +7,13 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- destroy $i
-}
-wm geometry . {}
-raise .
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
+
update
# XXX This file is woefully incomplete. Right now it only tests
@@ -80,8 +78,7 @@ test window-2.3 {Tk_DestroyWindow procedure, destroy handler deletes parent} {
} {}
# Some tests require the testmenubar command
-set ::tcltest::testConfig(testmenubar) \
- [expr {[info commands testmenubar] != {}}]
+testConstraint testmenubar [llength [info commands testmenubar]]
test window-3.1 {Tk_MakeWindowExist procedure, stacking order and menubars} \
{unixOnly testmenubar} {
diff --git a/tk/tests/winfo.test b/tk/tests/winfo.test
index 12af58b4f6f..c0e8a827704 100644
--- a/tk/tests/winfo.test
+++ b/tk/tests/winfo.test
@@ -8,19 +8,12 @@
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
-
-foreach i [winfo children .] {
- catch {destroy $i}
-}
-wm geometry . {}
-raise .
-
-# Some tests require the testwrapper command
-set ::tcltest::testConfig(testwrapper) \
- [expr {[info commands testwrapper] != {}}]
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
# eatColors --
# Creates a toplevel window and allocates enough colors in it to
@@ -92,8 +85,8 @@ test winfo-2.7 {"winfo atom" command} {
} SECONDARY
# Some tests require the "pseudocolor" visual class.
-set ::tcltest::testConfig(pseudocolor) \
- [expr {([winfo depth .] == 8) && ([winfo visual .] == "pseudocolor")}]
+testConstraint pseudocolor [expr { ([winfo depth .] == 8)
+ && ([winfo visual .] == "pseudocolor")}]
test winfo-3.1 {"winfo colormapfull" command} {pseudocolor} {
list [catch {winfo colormapfull} msg] $msg
@@ -247,7 +240,7 @@ test winfo-9.5 {"winfo viewable" command} {
list [winfo viewable .f1] [winfo viewable .f1.f2]
} {1 1}
test winfo-9.6 {"winfo viewable" command} {
- eval destroy [winfo child .]
+ deleteWindows
frame .f1 -width 100 -height 100 -relief raised -bd 2
frame .f1.f2 -width 50 -height 50 -relief raised -bd 2
place .f1.f2 -x 0 -y 0
@@ -255,7 +248,7 @@ test winfo-9.6 {"winfo viewable" command} {
list [winfo viewable .f1] [winfo viewable .f1.f2]
} {0 0}
test winfo-9.7 {"winfo viewable" command} {
- eval destroy [winfo child .]
+ deleteWindows
frame .f1 -width 100 -height 100 -relief raised -bd 2
place .f1 -x 0 -y 0
frame .f1.f2 -width 50 -height 50 -relief raised -bd 2
@@ -265,7 +258,7 @@ test winfo-9.7 {"winfo viewable" command} {
list [winfo viewable .f1] [winfo viewable .f1.f2]
} {0 0}
wm deiconify .
-eval destroy [winfo child .]
+deleteWindows
test winfo-10.1 {"winfo visualid" command} {
list [catch {winfo visualid} msg] $msg
@@ -329,9 +322,7 @@ test winfo-13.2 {destroying embedded toplevel} {
expr [winfo exists .emb.b] || [winfo exists .con]
} 0
-foreach i [winfo children .] {
- destroy $i
-}
+deleteWindows
test winfo-13.3 {destroying container window} {
MakeEmbed
@@ -343,9 +334,7 @@ test winfo-13.3 {destroying container window} {
set z
} 0
-foreach i [winfo children .] {
- destroy $i
-}
+deleteWindows
test winfo-13.4 {[winfo containing] with embedded windows} {
MakeEmbed
@@ -360,11 +349,28 @@ test winfo-13.4 {[winfo containing] with embedded windows} {
set z
} 0
-foreach i [winfo children .] {
- catch {destroy $i}
-}
+test winfo-14.1 {usage} {
+ list [catch {winfo ismapped} msg] $msg
+} {1 {wrong # args: should be "winfo ismapped window"}}
+test winfo-14.2 {usage} {
+ list [catch {winfo ismapped . .} msg] $msg
+} {1 {wrong # args: should be "winfo ismapped window"}}
+
+test winfo-14.3 {initially unmapped} {
+ catch {destroy .t}
+ toplevel .t
+ winfo ismapped .t
+} 0
+
+test winfo-14.4 {mapped at idle time} {
+ catch {destroy .t}
+ toplevel .t
+ update idletasks
+ winfo ismapped .t
+} 1
+
+deleteWindows
# cleanup
::tcltest::cleanupTests
return
-
diff --git a/tk/tests/wm.test b/tk/tests/wm.test
index e6963548346..d0c1232ea44 100644
--- a/tk/tests/wm.test
+++ b/tk/tests/wm.test
@@ -3,672 +3,1634 @@
# in the standard fashion for Tcl tests.
#
# Copyright (c) 1992-1994 The Regents of the University of California.
-# Copyright (c) 1994-1995 Sun Microsystems, Inc.
+# Copyright (c) 1994-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+# All rights reserved.
#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# SCCS: @(#) wm.test 1.31 96/03/01 11:36:58
+# RCS: @(#) $Id$
-if {[string compare test [info procs test]] == 1} {
- source defs
-}
+# This file tests window manager interactions that work across
+# platforms. Window manager tests that only work on a specific
+# platform should be placed in unixWm.test or winWm.test.
-proc sleep ms {
- global x
- after $ms {set x 1}
- tkwait variable x
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
-set i 1
-foreach geom {+20+80 +80+20 +0+0} {
- catch {destroy .t}
- test wm-1.$i {initial window position} {
- toplevel .t -width 200 -height 150
- wm geom .t $geom
- update
- wm geom .t
- } 200x150$geom
- incr i
+wm deiconify .
+if {![winfo ismapped .]} {
+ tkwait visibility .
}
-# The tests below are tricky because window managers don't all move
-# windows correctly. Try one motion and compute the window manager's
-# error, then factor this error into the actual tests. In other words,
-# this just makes sure that things are consistent between moves.
-
-set i 1
-catch {destroy .t}
-toplevel .t -width 100 -height 150
-wm geom .t +200+200
-update
-wm geom .t +150+150
-update
-scan [wm geom .t] %dx%d+%d+%d width height x y
-set xerr [expr 150-$x]
-set yerr [expr 150-$y]
-foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
- test wm-2.$i {moving window while mapped} {
- wm geom .t $geom
- update
- scan [wm geom .t] %dx%d%1s%d%1s%d width height xsign x ysign y
- format "%s%d%s%d" $xsign [expr $x$xsign$xerr] $ysign \
- [expr $y$ysign$yerr]
- } $geom
- incr i
+proc stdWindow {} {
+ destroy .t
+ toplevel .t -width 100 -height 50
+ wm geom .t +0+0
+ update
}
-set i 1
-foreach geom {+20+80 +80+20 +0+0 -0-0 +0-0 -0+0 -10-5 -10+5 +10-5} {
- test wm-3.$i {moving window while iconified} {
- wm iconify .t
- sleep 200
- wm geom .t $geom
- update
- wm deiconify .t
- scan [wm geom .t] %dx%d%1s%d%1s%d width height xsign x ysign y
- format "%s%d%s%d" $xsign [expr $x$xsign$xerr] $ysign \
- [expr $y$ysign$yerr]
- } $geom
- incr i
-}
+# [raise] and [lower] may return before the window manager
+# has completed the operation. The raiseDelay procedure
+# idles for a while to give the operation a chance to complete.
+#
-set i 1
-foreach geom {+20+80 +100+40 +0+0} {
- test wm-4.$i {moving window while withdrawn} {
- wm withdraw .t
- sleep 200
- wm geom .t $geom
- update
- wm deiconify .t
- wm geom .t
- } 100x150$geom
- incr i
+proc raiseDelay {} {
+ after 100; update
}
-test wm-5.1 {compounded state changes} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 200 -height 100
- wm geometry .t +100+100
+
+deleteWindows
+stdWindow
+
+test wm-1.1 {Tk_WmObjCmd procedure, miscellaneous errors} {
+ list [catch {wm} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-1.2 {Tk_WmObjCmd procedure, miscellaneous errors} {
+ list [catch {wm foo} msg] $msg
+} {1 {bad option "foo": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, frame, geometry, grid, group, iconbitmap, iconify, iconmask, iconname, iconposition, iconwindow, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}}
+
+test wm-1.3 {Tk_WmObjCmd procedure, miscellaneous errors} {
+ list [catch {wm command} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-1.4 {Tk_WmObjCmd procedure, miscellaneous errors} {
+ list [catch {wm aspect bogus} msg] $msg
+} {1 {bad window path name "bogus"}}
+
+test wm-1.5 {Tk_WmObjCmd procedure, miscellaneous errors} {
+ catch {destroy .b}
+ button .b -text hello
+ list [catch {wm geometry .b} msg] $msg
+} {1 {window ".b" isn't a top-level window}}
+
+
+test wm-aspect-1.1 {usage} {
+ list [catch {wm aspect} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-aspect-1.2 {usage} {
+ list [catch {wm aspect . _} err] $err
+} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
+
+test wm-aspect-1.3 {usage} {
+ list [catch {wm aspect . _ _ _} err] $err
+} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
+
+test wm-aspect-1.4 {usage} {
+ list [catch {wm aspect . _ _ _ _ _} err] $err
+} {1 {wrong # args: should be "wm aspect window ?minNumer minDenom maxNumer maxDenom?"}}
+
+test wm-aspect-1.5 {usage} {
+ list [catch {wm aspect . bad 14 15 16} msg] $msg
+} {1 {expected integer but got "bad"}}
+
+test wm-aspect-1.6 {usage} {
+ list [catch {wm aspect . 13 foo 15 16} msg] $msg
+} {1 {expected integer but got "foo"}}
+
+test wm-aspect-1.7 {usage} {
+ list [catch {wm aspect . 13 14 bar 16} msg] $msg
+} {1 {expected integer but got "bar"}}
+
+test wm-aspect-1.8 {usage} {
+ list [catch {wm aspect . 13 14 15 baz} msg] $msg
+} {1 {expected integer but got "baz"}}
+
+test wm-aspect-1.9 {usage} {
+ list [catch {wm aspect . 0 14 15 16} msg] $msg
+} {1 {aspect number can't be <= 0}}
+
+test wm-aspect-1.10 {usage} {
+ list [catch {wm aspect . 13 0 15 16} msg] $msg
+} {1 {aspect number can't be <= 0}}
+
+test wm-aspect-1.11 {usage} {
+ list [catch {wm aspect . 13 14 0 16} msg] $msg
+} {1 {aspect number can't be <= 0}}
+
+test wm-aspect-1.12 {usage} {
+ list [catch {wm aspect . 13 14 15 0} msg] $msg
+} {1 {aspect number can't be <= 0}}
+
+test wm-aspect-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm aspect .t]
+ wm aspect .t 3 4 10 2
+ lappend result [wm aspect .t]
+ wm aspect .t {} {} {} {}
+ lappend result [wm aspect .t]
+} [list {} {3 4 10 2} {}]
+
+
+test wm-attributes-1.1 {usage} {
+ list [catch {wm attributes} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-attributes-1.2.1 {usage} {pcOnly} {
+ list [catch {wm attributes . _} err] $err
+} {1 {wrong # args: should be "wm attributes window ?-disabled ?bool?? ?-toolwindow ?bool?? ?-topmost ?bool??"}}
+
+test wm-attributes-1.2.2 {usage} {macOrUnix} {
+ list [catch {wm attributes . _} err] $err
+} {1 {wrong # args: should be "wm attributes window"}}
+
+
+test wm-client-1.1 {usage} {
+ list [catch {wm client} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-client-1.2 {usage} {
+ list [catch {wm client . _ _} err] $err
+} {1 {wrong # args: should be "wm client window ?name?"}}
+
+test wm-client-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm client .t]
+ wm client .t Miffo
+ lappend result [wm client .t]
+ wm client .t {}
+ lappend result [wm client .t]
+} [list {} Miffo {}]
+
+
+test wm-colormapwindows-1.1 {usage} {
+ list [catch {wm colormapwindows} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-colormapwindows-1.2 {usage} {
+ list [catch {wm colormapwindows . _ _} err] $err
+} {1 {wrong # args: should be "wm colormapwindows window ?windowList?"}}
+
+test wm-colormapwindows-1.3 {usage} {
+ list [catch {wm colormapwindows . "a \{"} msg] $msg
+} {1 {unmatched open brace in list}}
+
+test wm-colormapwindows-1.4 {usage} {
+ list [catch {wm colormapwindows . foo} msg] $msg
+} {1 {bad window path name "foo"}}
+
+test wm-colormapwindows-2.1 {reading values} {
+ catch {destroy .t2}
+ toplevel .t2 -width 200 -height 200 -colormap new
+ wm geom .t2 +0+0
+ frame .t2.a -width 100 -height 30
+ frame .t2.b -width 100 -height 30 -colormap new
+ pack .t2.a .t2.b -side top
update
- wm withdraw .t
- wm deiconify .t
- list [winfo ismapped .t] [wm state .t]
-} {1 normal}
-test wm-5.2 {compounded state changes} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 200 -height 100
- wm geometry .t +100+100
+ set x [wm colormapwindows .t2]
+ frame .t2.c -width 100 -height 30 -colormap new
+ pack .t2.c -side top
update
- wm withdraw .t
+ list $x [wm colormapwindows .t2]
+} {{.t2.b .t2} {.t2.b .t2.c .t2}}
+
+test wm-colormapwindows-2.2 {setting and reading values} {
+ catch {destroy .t2}
+ toplevel .t2 -width 200 -height 200
+ wm geom .t2 +0+0
+ frame .t2.a -width 100 -height 30
+ frame .t2.b -width 100 -height 30
+ frame .t2.c -width 100 -height 30
+ pack .t2.a .t2.b .t2.c -side top
+ wm colormapwindows .t2 {.t2.b .t2.a}
+ wm colormapwindows .t2
+} {.t2.b .t2.a}
+
+
+test wm-command-1.1 {usage} {
+ list [catch {wm command} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-command-1.2 {usage} {
+ list [catch {wm command . _ _} err] $err
+} {1 {wrong # args: should be "wm command window ?value?"}}
+
+test wm-command-1.3 {usage} {
+ list [catch {wm command . "a \{"} msg] $msg
+} {1 {unmatched open brace in list}}
+
+test wm-command-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm command .t]
+ wm command .t [list Miffo Foo]
+ lappend result [wm command .t]
+ wm command .t {}
+ lappend result [wm command .t]
+} [list {} [list Miffo Foo] {}]
+
+
+test wm-deiconify-1.1 {usage} {
+ list [catch {wm deiconify} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-deiconify-1.2 {usage} {
+ list [catch {wm deiconify . _} err] $err
+} {1 {wrong # args: should be "wm deiconify window"}}
+
+test wm-deiconify-1.3 {usage} {
+ list [catch {wm deiconify _} err] $err
+} {1 {bad window path name "_"}}
+
+test wm-deiconify-1.4 {usage} {
+ catch {destroy .icon}
+ toplevel .icon -width 50 -height 50 -bg red
+ wm iconwindow .t .icon
+ set result [list [catch {wm deiconify .icon} msg] $msg]
+ destroy .icon
+ set result
+} {1 {can't deiconify .icon: it is an icon for .t}}
+
+test wm-deiconify-1.5 {usage} {
+ catch {destroy .embed}
+ frame .t.f -container 1
+ toplevel .embed -use [winfo id .t.f]
+ set result [list [catch {wm deiconify .embed} msg] $msg]
+ destroy .t.f .embed
+ set result
+} {1 {can't deiconify .embed: it is an embedded window}}
+
+test wm-deiconify-2.1 {a window that has never been mapped
+ should not be mapped by a call to deiconify} {
+ deleteWindows
+ toplevel .t
wm deiconify .t
+ winfo ismapped .t
+} 0
+
+test wm-deiconify-2.2 {a window that has already been
+ mapped should be mapped by deiconify} {
+ deleteWindows
+ toplevel .t
+ update idletasks
wm withdraw .t
- list [winfo ismapped .t] [wm state .t]
-} {0 withdrawn}
-test wm-5.3 {compounded state changes} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 200 -height 100
- wm geometry .t +100+100
- update
- wm iconify .t
wm deiconify .t
- wm iconify .t
+ winfo ismapped .t
+} 1
+
+test wm-deiconify-2.3 {geometry for an unmapped window
+ should not be calculated by a call to deiconify,
+ it should be done at idle time} {
+ deleteWindows
+ set results {}
+ toplevel .t -width 200 -height 200
+ lappend results [wm geometry .t]
wm deiconify .t
- list [winfo ismapped .t] [wm state .t]
-} {1 normal}
-test wm-5.4 {compounded state changes} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 200 -height 100
- wm geometry .t +100+100
- update
- wm iconify .t
+ lappend results [wm geometry .t]
+ update idletasks
+ lappend results [lindex [split \
+ [wm geometry .t] +] 0]
+} {1x1+0+0 1x1+0+0 200x200}
+
+test wm-deiconify-2.4 {invoking destroy after a deiconify
+ should not result in a crash because of a callback
+ set on the toplevel} {
+ deleteWindows
+ toplevel .t
+ wm withdraw .t
wm deiconify .t
- wm iconify .t
- list [winfo ismapped .t] [wm state .t]
-} {0 iconic}
-test wm-5.5 {compounded state changes} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 200 -height 100
- wm geometry .t +100+100
+ destroy .t
update
- wm iconify .t
- wm withdraw .t
- list [winfo ismapped .t] [wm state .t]
-} {0 withdrawn}
-test wm-5.6 {compounded state changes} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 200 -height 100
- wm geometry .t +100+100
+} {}
+
+
+test wm-focusmodel-1.1 {usage} {
+ list [catch {wm focusmodel} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-focusmodel-1.2 {usage} {
+ list [catch {wm focusmodel . _ _} err] $err
+} {1 {wrong # args: should be "wm focusmodel window ?active|passive?"}}
+
+test wm-focusmodel-1.3 {usage} {
+ list [catch {wm focusmodel . bogus} msg] $msg
+} {1 {bad argument "bogus": must be active or passive}}
+
+stdWindow
+
+test wm-focusmodel-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm focusmodel .t]
+ wm focusmodel .t active
+ lappend result [wm focusmodel .t]
+ wm focusmodel .t passive
+ lappend result [wm focusmodel .t]
+ set result
+} {passive active passive}
+
+
+test wm-frame-1.1 {usage} {
+ list [catch {wm frame} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-frame-1.2 {usage} {
+ list [catch {wm frame . _} err] $err
+} {1 {wrong # args: should be "wm frame window"}}
+
+
+test wm-geometry-1.1 {usage} {
+ list [catch {wm geometry} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-geometry-1.2 {usage} {
+ list [catch {wm geometry . _ _} err] $err
+} {1 {wrong # args: should be "wm geometry window ?newGeometry?"}}
+
+test wm-geometry-1.3 {usage} {
+ list [catch {wm geometry . bogus} msg] $msg
+} {1 {bad geometry specifier "bogus"}}
+
+test wm-geometry-2.1 {setting values} {
+ set result {}
+ wm geometry .t 150x150+50+50
update
- wm iconify .t
- wm withdraw .t
- wm deiconify .t
- list [winfo ismapped .t] [wm state .t]
-} {1 normal}
-test wm-5.7 {compounded state changes} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 200 -height 100
- wm geometry .t +100+100
+ lappend result [wm geometry .t]
+ wm geometry .t {}
update
- wm withdraw .t
- wm iconify .t
- list [winfo ismapped .t] [wm state .t]
-} {0 iconic}
-
-catch {destroy .t}
-toplevel .t -width 200 -height 100
-wm geom .t +10+10
-wm minsize .t 1 1
-update
-test wm-6.1 {size changes} {
- .t config -width 180 -height 150
- update
- wm geom .t
-} 180x150+10+10
-test wm-6.2 {size changes} {
- wm geom .t 250x60
- .t config -width 170 -height 140
- update
- wm geom .t
-} 250x60+10+10
-test wm-6.3 {size changes} {
- wm geom .t 250x60
- .t config -width 170 -height 140
- wm geom .t {}
- update
- wm geom .t
-} 170x140+10+10
-test wm-6.4 {size changes} {nonPortable} {
- wm minsize .t 1 1
- update
- puts stdout "Please resize window \"t\" with the mouse (but don't move it!),"
- puts -nonewline stdout "then hit return: "
- flush stdout
- gets stdin
- update
- set width [winfo width .t]
- set height [winfo height .t]
- .t config -width 230 -height 110
- update
- incr width -[winfo width .t]
- incr height -[winfo height .t]
- wm geom .t {}
- update
- set w2 [winfo width .t]
- set h2 [winfo height .t]
- .t config -width 114 -height 261
- update
- list $width $height $w2 $h2 [wm geom .t]
-} {0 0 230 110 114x261+10+10}
-
-test wm-7.1 {window initially withdrawn} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- wm geometry .t +0+0
- wm withdraw .t
- sleep 200
- set result [winfo ismapped .t]
- wm deiconify .t
- list $result [winfo ismapped .t]
-} {0 1}
-test wm-7.2 {window initially withdrawn} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- wm geometry .t +0+0
- wm withdraw .t
- wm deiconify .t
- sleep 200
- winfo ismapped .t
-} 1
+ lappend result [string equal [wm geometry .t] "150x150+50+50"]
+} [list 150x150+50+50 0]
-test wm-8.1 {window initially iconic} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- wm geometry .t +0+0
- wm title .t 1
- wm iconify .t
- update idletasks
- list [winfo ismapped .t] [wm state .t]
-} {0 iconic}
-# I don't know why the wait below is needed, but without it the test
-# fails under twm.
-sleep 200
+test wm-grid-1.1 {usage} {
+ list [catch {wm grid} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-test wm-8.2 {window initially iconic} {nonPortable} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- wm geometry .t +0+0
- wm title .t 2
- wm iconify .t
- update idletasks
- wm withdraw .t
- wm deiconify .t
- list [winfo ismapped .t] [wm state .t]
-} {1 normal}
+test wm-grid-1.2 {usage} {
+ list [catch {wm grid . _} err] $err
+} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
-catch {destroy .m}
-menu .m
-foreach i {{Test label} Another {Yet another} {Last label}} {
- .m add command -label $i
-}
-.m post 100 200
-test wm-9.1 {override_redirect and Tk_MoveTopLevelWindow} {
- list [winfo ismapped .m] [wm state .m] [winfo x .m] [winfo y .m]
-} {1 normal 100 200}
-.m post 150 210
-test wm-9.2 {override_redirect and Tk_MoveTopLevelWindow} {
- list [winfo ismapped .m] [wm state .m] [winfo x .m] [winfo y .m]
-} {1 normal 150 210}
-.m unpost
-test wm-9.3 {override_redirect and Tk_MoveTopLevelWindow} {
- list [winfo ismapped .m]
-} 0
-destroy .m
-catch {destroy .t}
+test wm-grid-1.3 {usage} {
+ list [catch {wm grid . _ _ _} err] $err
+} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
-test wm-10.1 {icon windows} {
- catch {destroy .t}
- catch {destroy .icon}
- toplevel .t -width 100 -height 30
- wm geometry .t +0+0
- toplevel .icon -width 50 -height 50 -bg red
- wm iconwindow .t .icon
- list [catch {wm iconify .icon} msg] $msg
-} {1 {can't iconify .icon: it is an icon for .icon}}
-test wm-10.2 {icon windows} {
- catch {destroy .t}
- catch {destroy .icon}
- toplevel .t -width 100 -height 30
- wm geometry .t +0+0
- toplevel .icon -width 50 -height 50 -bg red
- wm iconwindow .t .icon
- list [catch {wm deiconify .icon} msg] $msg
-} {1 {can't deiconify .icon: it is an icon for .icon}}
-test wm-10.3 {icon windows} {
- catch {destroy .t}
- catch {destroy .icon}
- toplevel .t -width 100 -height 30
- wm geometry .t +0+0
- toplevel .icon -width 50 -height 50 -bg red
- wm iconwindow .t .icon
- list [catch {wm withdraw .icon} msg] $msg
-} {1 {can't withdraw .icon: it is an icon for .t}}
-test wm-10.4 {icon windows} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- list [catch {wm iconwindow} msg] $msg
+test wm-grid-1.4 {usage} {
+ list [catch {wm grid . _ _ _ _ _} err] $err
+} {1 {wrong # args: should be "wm grid window ?baseWidth baseHeight widthInc heightInc?"}}
+
+test wm-grid-1.5 {usage} {
+ list [catch {wm grid . bad 14 15 16} msg] $msg
+} {1 {expected integer but got "bad"}}
+
+test wm-grid-1.6 {usage} {
+ list [catch {wm grid . 13 foo 15 16} msg] $msg
+} {1 {expected integer but got "foo"}}
+
+test wm-grid-1.7 {usage} {
+ list [catch {wm grid . 13 14 bar 16} msg] $msg
+} {1 {expected integer but got "bar"}}
+
+test wm-grid-1.8 {usage} {
+ list [catch {wm grid . 13 14 15 baz} msg] $msg
+} {1 {expected integer but got "baz"}}
+
+test wm-grid-1.9 {usage} {
+ list [catch {wm grid . -1 14 15 16} msg] $msg
+} {1 {baseWidth can't be < 0}}
+
+test wm-grid-1.10 {usage} {
+ list [catch {wm grid . 13 -1 15 16} msg] $msg
+} {1 {baseHeight can't be < 0}}
+
+test wm-grid-1.11 {usage} {
+ list [catch {wm grid . 13 14 -1 16} msg] $msg
+} {1 {widthInc can't be < 0}}
+
+test wm-grid-1.12 {usage} {
+ list [catch {wm grid . 13 14 15 -1} msg] $msg
+} {1 {heightInc can't be < 0}}
+
+test wm-grid-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm grid .t]
+ wm grid .t 3 4 10 2
+ lappend result [wm grid .t]
+ wm grid .t {} {} {} {}
+ lappend result [wm grid .t]
+} [list {} {3 4 10 2} {}]
+
+
+test wm-group-1.1 {usage} {
+ list [catch {wm group} err] $err
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-test wm-10.5 {icon windows} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- list [catch {wm iconwindow .t b c} msg] $msg
-} {1 {wrong # arguments: must be "wm iconwindow window ?pathName?"}}
-test wm-10.6 {icon windows} {
- catch {destroy .t}
- catch {destroy .icon}
- toplevel .t -width 100 -height 30
- wm geom .t +0+0
- set result [wm iconwindow .t]
- toplevel .icon -width 50 -height 50 -bg red
- wm iconwindow .t .icon
- lappend result [wm iconwindow .t] [wm state .icon]
- wm iconwindow .t {}
- lappend result [wm iconwindow .t] [wm state .icon]
+
+test wm-group-1.2 {usage} {
+ list [catch {wm group .t 12 13} msg] $msg
+} {1 {wrong # args: should be "wm group window ?pathName?"}}
+
+test wm-group-1.3 {usage} {
+ list [catch {wm group .t bogus} msg] $msg
+} {1 {bad window path name "bogus"}}
+
+test wm-group-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm group .t]
+ wm group .t .
+ lappend result [wm group .t]
+ wm group .t {}
+ lappend result [wm group .t]
+} [list {} . {}]
+
+
+test wm-iconbitmap-1.1 {usage} {
+ list [catch {wm iconbitmap} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-iconbitmap-1.2.1 {usage} {macOrUnix} {
+ list [catch {wm iconbitmap .t 12 13} msg] $msg
+} {1 {wrong # args: should be "wm iconbitmap window ?bitmap?"}}
+
+test wm-iconbitmap-1.2.2 {usage} {pcOnly} {
+ list [catch {wm iconbitmap .t 12 13 14} msg] $msg
+} {1 {wrong # args: should be "wm iconbitmap window ?-default? ?image?"}}
+
+test wm-iconbitmap-1.3 {usage} {pcOnly} {
+ list [catch {wm iconbitmap .t 12 13} msg] $msg
+} {1 {illegal option "12" must be "-default"}}
+
+test wm-iconbitmap-1.4 {usage} {
+ list [catch {wm iconbitmap .t bad-bitmap} msg] $msg
+} {1 {bitmap "bad-bitmap" not defined}}
+
+test wm-iconbitmap-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm iconbitmap .t]
+ wm iconbitmap .t hourglass
+ lappend result [wm iconbitmap .t]
+ wm iconbitmap .t {}
+ lappend result [wm iconbitmap .t]
+} [list {} hourglass {}]
+
+
+test wm-iconify-1.1 {usage} {
+ list [catch {wm iconify} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-iconify-1.2 {usage} {
+ list [catch {wm iconify .t _} msg] $msg
+} {1 {wrong # args: should be "wm iconify window"}}
+
+test wm-iconify-2.1 {Misc errors} {
+ catch {destroy .t2}
+ toplevel .t2
+ wm overrideredirect .t2 1
+ set result [list [catch {wm iconify .t2} msg] $msg]
+ destroy .t2
+ set result
+} {1 {can't iconify ".t2": override-redirect flag is set}}
+
+test wm-iconify-2.2 {Misc errors} {
+ catch {destroy .t2}
+ toplevel .t2
+ wm geom .t2 +0+0
+ wm transient .t2 .t
+ set result [list [catch {wm iconify .t2} msg] $msg]
+ destroy .t2
+ set result
+} {1 {can't iconify ".t2": it is a transient}}
+
+test wm-iconify-2.3 {Misc errors} {
+ catch {destroy .t2}
+ toplevel .t2
+ wm geom .t2 +0+0
+ wm iconwindow .t .t2
+ set result [list [catch {wm iconify .t2} msg] $msg]
+ destroy .t2
+ set result
+} {1 {can't iconify .t2: it is an icon for .t}}
+
+test wm-iconify-2.4 {Misc errors} {
+ catch {destroy .t2}
+ frame .t.f -container 1
+ toplevel .t2 -use [winfo id .t.f]
+ set result [list [catch {wm iconify .t2} msg] $msg]
+ destroy .t2 .r.f
+ set result
+} {1 {can't iconify .t2: it is an embedded window}}
+
+test wm-iconify-3.1 {} {
+ catch {destroy .t2}
+ toplevel .t2
+ wm geom .t2 -0+0
update
- lappend result [winfo ismapped .t] [winfo ismapped .icon]
- wm iconify .t
+ set result [winfo ismapped .t2]
+ wm iconify .t2
update
- lappend result [winfo ismapped .t] [winfo ismapped .icon]
-} {.icon icon {} withdrawn 1 0 0 0}
-test wm-10.7 {icon windows} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- list [catch {wm iconwindow .t .gorp} msg] $msg
-} {1 {bad window path name ".gorp"}}
-test wm-10.8 {icon windows} {
- catch {destroy .t}
- toplevel .t -width 100 -height 30
- frame .t.icon -width 50 -height 50 -bg red
- list [catch {wm iconwindow .t .t.icon} msg] $msg
-} {1 {can't use .t.icon as icon window: not at top level}}
-test wm-10.9 {icon windows} {
- catch {destroy .t}
- catch {destroy .icon}
- toplevel .t -width 100 -height 30
- wm geom .t +0+0
- toplevel .icon -width 50 -height 50 -bg red
- toplevel .icon2 -width 50 -height 50 -bg green
- wm iconwindow .t .icon
- set result "[wm iconwindow .t] [wm state .icon] [wm state .icon2]"
- wm iconwindow .t .icon2
- lappend result [wm iconwindow .t] [wm state .icon] [wm state .icon2]
-} {.icon icon normal .icon2 withdrawn icon}
-catch {destroy .icon2}
-test wm-10.10 {icon windows} {
- catch {destroy .t}
+ lappend result [winfo ismapped .t2]
+ destroy .t2
+ set result
+} {1 0}
+
+
+test wm-iconmask-1.1 {usage} {
+ list [catch {wm iconmask} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-iconmask-1.2 {usage} {
+ list [catch {wm iconmask .t 12 13} msg] $msg
+} {1 {wrong # args: should be "wm iconmask window ?bitmap?"}}
+
+test wm-iconmask-1.3 {usage} {
+ list [catch {wm iconmask .t bad-bitmap} msg] $msg
+} {1 {bitmap "bad-bitmap" not defined}}
+
+test wm-iconmask-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm iconmask .t]
+ wm iconmask .t hourglass
+ lappend result [wm iconmask .t]
+ wm iconmask .t {}
+ lappend result [wm iconmask .t]
+} [list {} hourglass {}]
+
+
+test wm-iconname-1.1 {usage} {
+ list [catch {wm iconname} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-iconname-1.2 {usage} {
+ list [catch {wm iconname .t 12 13} msg] $msg
+} {1 {wrong # args: should be "wm iconname window ?newName?"}}
+
+test wm-iconname-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm iconname .t]
+ wm iconname .t ThisIconHasAName
+ lappend result [wm iconname .t]
+ wm iconname .t {}
+ lappend result [wm iconname .t]
+} [list {} ThisIconHasAName {}]
+
+
+test wm-iconposition-1.1 {usage} {
+ list [catch {wm iconposition} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-iconposition-1.2 {usage} {
+ list [catch {wm iconposition .t 12} msg] $msg
+} {1 {wrong # args: should be "wm iconposition window ?x y?"}}
+
+test wm-iconposition-1.3 {usage} {
+ list [catch {wm iconposition .t 12 13 14} msg] $msg
+} {1 {wrong # args: should be "wm iconposition window ?x y?"}}
+
+test wm-iconposition-1.4 {usage} {
+ list [catch {wm iconposition .t bad 13} msg] $msg
+} {1 {expected integer but got "bad"}}
+
+test wm-iconposition-1.5 {usage} {
+ list [catch {wm iconposition .t 13 lousy} msg] $msg
+} {1 {expected integer but got "lousy"}}
+
+test wm-iconposition-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm iconposition .t]
+ wm iconposition .t 10 20
+ lappend result [wm iconposition .t]
+ wm iconposition .t {} {}
+ lappend result [wm iconposition .t]
+} [list {} {10 20} {}]
+
+
+test wm-iconwindow-1.1 {usage} {
+ list [catch {wm iconwindow} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-iconwindow-1.2 {usage} {
+ list [catch {wm iconwindow .t 12 13} msg] $msg
+} {1 {wrong # args: should be "wm iconwindow window ?pathName?"}}
+
+test wm-iconwindow-1.3 {usage} {
+ list [catch {wm iconwindow .t bogus} msg] $msg
+} {1 {bad window path name "bogus"}}
+
+test wm-iconwindow-1.4 {usage} {
+ catch {destroy .b}
+ button .b -text Help
+ set result [list [catch {wm iconwindow .t .b} msg] $msg]
+ destroy .b
+ set result
+} {1 {can't use .b as icon window: not at top level}}
+
+test wm-iconwindow-1.5 {usage} {
catch {destroy .icon}
- toplevel .icon -width 50 -height 50 -bg red
- wm geom .icon +0+0
- update
- set result [winfo ismapped .icon]
- toplevel .t -width 100 -height 30
- wm geom .t +0+0
- wm iconwindow .t .icon
- after 500 {set x 1}
- tkwait variable x
- lappend result [winfo ismapped .t] [winfo ismapped .icon]
-} {1 1 0}
-test wm-10.11 {icon windows} {nonPortable} {
- # This test is non-portable because some window managers will
- # destroy an icon window when it's associated window is destroyed.
+ toplevel .icon -width 50 -height 50 -bg green
+ catch {destroy .t2}
+ toplevel .t2
+ wm geom .t2 -0+0
+ wm iconwindow .t2 .icon
+ set result [list [catch {wm iconwindow .t .icon} msg] $msg]
+ destroy .t2
+ destroy .icon
+ set result
+} {1 {.icon is already an icon for .t2}}
- catch {destroy .t}
+test wm-iconwindow-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm iconwindow .t]
catch {destroy .icon}
- toplevel .t -width 100 -height 30
- toplevel .icon -width 50 -height 50 -bg red
- wm geom .t +0+0
+ toplevel .icon -width 50 -height 50 -bg green
wm iconwindow .t .icon
- update
- set result "[wm state .icon] [winfo ismapped .t] [winfo ismapped .icon]"
- destroy .t
- wm geom .icon +0+0
- update
- lappend result [winfo ismapped .icon] [wm state .icon]
- wm deiconify .icon
- update
- lappend result [winfo ismapped .icon] [wm state .icon]
-} {icon 1 0 0 withdrawn 1 normal}
+ lappend result [wm iconwindow .t]
+ wm iconwindow .t {}
+ destroy .icon
+ lappend result [wm iconwindow .t]
+} [list {} .icon {}]
-test wm-11.1 {colormapwindows} {
- catch {destroy .t}
- toplevel .t -width 200 -height 200 -colormap new
- wm geom .t +0+0
- frame .t.a -width 100 -height 30
- frame .t.b -width 100 -height 30 -colormap new
- pack .t.a .t.b -side top
- update
- set x [wm colormapwindows .t]
- frame .t.c -width 100 -height 30 -colormap new
- pack .t.c -side top
- update
- list $x [wm colormapwindows .t]
-} {{.t.b .t} {.t.b .t.c .t}}
-test wm-11.2 {colormapwindows} {
- list [catch {wm colormapwindows . 1 2} msg] $msg
-} {1 {wrong # arguments: must be "wm colormapwindows window ?windowList?"}}
-test wm-11.3 {colormapwindows} {
- list [catch {wm col . "a \{"} msg] $msg
-} {1 {unmatched open brace in list}}
-test wm-11.4 {colormapwindows} {
- list [catch {wm colormapwindows . foo} msg] $msg
-} {1 {bad window path name "foo"}}
-test wm-11.5 {colormapwindows} {
- catch {destroy .t}
- toplevel .t -width 200 -height 200 -colormap new
- wm geom .t +0+0
- frame .t.a -width 100 -height 30
- frame .t.b -width 100 -height 30
- frame .t.c -width 100 -height 30
- pack .t.a .t.b .t.c -side top
- wm colormapwindows .t {.t.c .t .t.a}
- wm colormapwindows .t
-} {.t.c .t .t.a}
-test wm-11.6 {colormapwindows} {
- catch {destroy .t}
- toplevel .t -width 200 -height 200
- wm geom .t +0+0
- frame .t.a -width 100 -height 30
- frame .t.b -width 100 -height 30
- frame .t.c -width 100 -height 30
- pack .t.a .t.b .t.c -side top
- wm colormapwindows .t {.t.b .t.a}
- wm colormapwindows .t
-} {.t.b .t.a}
-test wm-11.7 {colormapwindows} {
- catch {destroy .t}
- toplevel .t -width 200 -height 200 -colormap new
- wm geom .t +0+0
- set x [wm colormapwindows .t]
- wm colormapwindows .t {}
- list $x [wm colormapwindows .t]
-} {{} {}}
-
-catch {destroy .t}
-catch {destroy .icon}
-
-toplevel .t -width 100 -height 50
-wm geom .t +0+0
-update
-test wm-12.1 {Tk_WmCmd procedure, "maxsize" option} {
+
+test wm-maxsize-1.1 {usage} {
list [catch {wm maxsize} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-test wm-12.2 {Tk_WmCmd procedure, "maxsize" option} {
+
+test wm-maxsize-1.2 {usage} {
list [catch {wm maxsize . a} msg] $msg
-} {1 {wrong # arguments: must be "wm maxsize window ?width height?"}}
-test wm-12.3 {Tk_WmCmd procedure, "maxsize" option} {
+} {1 {wrong # args: should be "wm maxsize window ?width height?"}}
+
+test wm-maxsize-1.3 {usage} {
list [catch {wm maxsize . a b c} msg] $msg
-} {1 {wrong # arguments: must be "wm maxsize window ?width height?"}}
-test wm-12.4 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
- wm maxsize .t
-} {1137 870}
-test wm-12.5 {Tk_WmCmd procedure, "maxsize" option} {
+} {1 {wrong # args: should be "wm maxsize window ?width height?"}}
+
+test wm-maxsize-1.4 {usage} {
list [catch {wm maxsize . x 100} msg] $msg
} {1 {expected integer but got "x"}}
-test wm-12.6 {Tk_WmCmd procedure, "maxsize" option} {
+
+test wm-maxsize-1.5 {usage} {
list [catch {wm maxsize . 100 bogus} msg] $msg
} {1 {expected integer but got "bogus"}}
-test wm-12.7 {Tk_WmCmd procedure, "maxsize" option} {
- wm maxsize .t 200 150
- wm maxsize .t
-} {200 150}
-test wm-12.8 {Tk_WmCmd procedure, "maxsize" option} {nonPortable} {
- # Not portable, because some window managers let applications override
- # minsize and maxsize.
- wm maxsize .t 200 150
- wm geom .t 300x200
- update
- list [winfo width .t] [winfo height .t]
+test wm-maxsize-1.6 {usage} {
+ catch {destroy .t2}
+ toplevel .t2
+ wm maxsize .t2 200 150
+ set result [wm maxsize .t2]
+ destroy .t2
+ set result
} {200 150}
-destroy .t
-toplevel .t -width 300 -height 200
-wm geom .t +0+0
-update
-test wm-13.1 {Tk_WmCmd procedure, "minsize" option} {
+
+test wm-minsize-1.1 {usage} {
list [catch {wm minsize} msg] $msg
} {1 {wrong # args: should be "wm option window ?arg ...?"}}
-test wm-13.2 {Tk_WmCmd procedure, "minsize" option} {
+
+test wm-minsize-1.2 {usage} {
list [catch {wm minsize . a} msg] $msg
-} {1 {wrong # arguments: must be "wm minsize window ?width height?"}}
-test wm-13.3 {Tk_WmCmd procedure, "minsize" option} {
+} {1 {wrong # args: should be "wm minsize window ?width height?"}}
+
+test wm-minsize-1.3 {usage} {
list [catch {wm minsize . a b c} msg] $msg
-} {1 {wrong # arguments: must be "wm minsize window ?width height?"}}
-test wm-13.4 {Tk_WmCmd procedure, "minsize" option} {
- wm minsize .t
-} {1 1}
-test wm-13.5 {Tk_WmCmd procedure, "minsize" option} {
+} {1 {wrong # args: should be "wm minsize window ?width height?"}}
+
+test wm-minsize-1.4 {usage} {
list [catch {wm minsize . x 100} msg] $msg
} {1 {expected integer but got "x"}}
-test wm-13.6 {Tk_WmCmd procedure, "minsize" option} {
+
+test wm-minsize-1.5 {usage} {
list [catch {wm minsize . 100 bogus} msg] $msg
} {1 {expected integer but got "bogus"}}
-test wm-13.7 {Tk_WmCmd procedure, "minsize" option} {
- wm minsize .t 200 150
- wm minsize .t
+
+test wm-minsize-1.6 {usage} {
+ catch {destroy .t2}
+ toplevel .t2
+ wm minsize .t2 200 150
+ set result [wm minsize .t2]
+ destroy .t2
+ set result
} {200 150}
-test wm-13.8 {Tk_WmCmd procedure, "minsize" option} {nonPortable} {
- # Not portable, because some window managers let applications override
- # minsize and maxsize.
-
- wm minsize .t 150 100
- wm geom .t 50x50
- update
- list [winfo width .t] [winfo height .t]
-} {150 100}
-test wm-13.9 {Tk_WmCmd procedure, "resizable" option} {
- list [catch {wm resizable . a} msg] $msg
-} {1 {wrong # arguments: must be "wm resizable window ?width height?"}}
-test wm-13.10 {Tk_WmCmd procedure, "resizable" option} {
- list [catch {wm resizable . a b c} msg] $msg
-} {1 {wrong # arguments: must be "wm resizable window ?width height?"}}
-test wm-13.11 {Tk_WmCmd procedure, "resizable" option} {
- list [catch {wm resizable .foo a b c} msg] $msg
-} {1 {bad window path name ".foo"}}
-test wm-13.12 {Tk_WmCmd procedure, "resizable" option} {
- list [catch {wm resizable . x 1} msg] $msg
-} {1 {expected boolean value but got "x"}}
-test wm-13.13 {Tk_WmCmd procedure, "resizable" option} {
- list [catch {wm resizable . 0 gorp} msg] $msg
-} {1 {expected boolean value but got "gorp"}}
-test wm-13.14 {Tk_WmCmd procedure, "resizable" option} {
+
+
+test wm-overrideredirect-1.1 {usage} {
+ list [catch {wm overrideredirect} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-overrideredirect-1.2 {usage} {
+ list [catch {wm overrideredirect .t 1 2} msg] $msg
+} {1 {wrong # args: should be "wm overrideredirect window ?boolean?"}}
+
+test wm-overrideredirect-1.3 {usage} {
+ list [catch {wm overrideredirect .t boo} msg] $msg
+} {1 {expected boolean value but got "boo"}}
+
+test wm-overrideredirect-2.1 {setting and reading values} {
+ set result {}
+ lappend result [wm overrideredirect .t]
+ wm overrideredirect .t true
+ lappend result [wm overrideredirect .t]
+ wm overrideredirect .t off
+ lappend result [wm overrideredirect .t]
+} {0 1 0}
+
+
+test wm-positionfrom-1.1 {usage} {
+ list [catch {wm positionfrom} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-positionfrom-1.2 {usage} {
+ list [catch {wm positionfrom .t 1 2} msg] $msg
+} {1 {wrong # args: should be "wm positionfrom window ?user/program?"}}
+
+test wm-positionfrom-1.3 {usage} {
+ list [catch {wm positionfrom .t none} msg] $msg
+} {1 {bad argument "none": must be program or user}}
+
+test wm-positionfrom-2.1 {setting and reading values} {
catch {destroy .t2}
- toplevel .t2 -width 200 -height 100
- wm geom .t2 +0+0
- set result ""
- lappend result [wm resizable .t2]
- wm resizable .t2 1 0
- lappend result [wm resizable .t2]
- wm resizable .t2 no off
- lappend result [wm resizable .t2]
- wm resizable .t2 false true
- lappend result [wm resizable .t2]
-} {{1 1} {1 0} {0 0} {0 1}}
-destroy .t2
-
-test wm-14.1 {TopLevelReqProc procedure, resize causes window to move} \
- {nonPortable} {
+ toplevel .t2
+ set result {}
+ wm positionfrom .t user
+ lappend result [wm positionfrom .t]
+ wm positionfrom .t program
+ lappend result [wm positionfrom .t]
+ wm positionfrom .t {}
+ lappend result [wm positionfrom .t]
+ destroy .t2
+ set result
+} {user program {}}
+
+
+test wm-protocol-1.1 {usage} {
+ list [catch {wm protocol} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-protocol-1.2 {usage} {
+ list [catch {wm protocol .t 1 2 3} msg] $msg
+} {1 {wrong # args: should be "wm protocol window ?name? ?command?"}}
+
+test wm-protocol-2.1 {setting and reading values} {
+ wm protocol .t {foo a} {a b c}
+ wm protocol .t bar {test script for bar}
+ set result [wm protocol .t]
+ wm protocol .t {foo a} {}
+ wm protocol .t bar {}
+ set result
+} {bar {foo a}}
+
+test wm-protocol-2.2 {setting and reading values} {
+ set result {}
+ wm protocol .t foo {a b c}
+ wm protocol .t bar {test script for bar}
+ lappend result [wm protocol .t foo] [wm protocol .t bar]
+ wm protocol .t foo {}
+ wm protocol .t bar {}
+ lappend result [wm protocol .t foo] [wm protocol .t bar]
+} {{a b c} {test script for bar} {} {}}
+
+test wm-protocol-2.3 {setting and reading values} {
+ wm protocol .t foo {a b c}
+ wm protocol .t foo {test script}
+ set result [wm protocol .t foo]
+ wm protocol .t foo {}
+ set result
+} {test script}
+
+
+test wm-resizable-1.1 {usage} {
+ list [catch {wm resizable} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-resizable-1.2 {usage} {
+ list [catch {wm resizable .t 1} msg] $msg
+} {1 {wrong # args: should be "wm resizable window ?width height?"}}
+
+test wm-resizable-1.3 {usage} {
+ list [catch {wm resizable .t 1 2 3} msg] $msg
+} {1 {wrong # args: should be "wm resizable window ?width height?"}}
+
+test wm-resizable-1.4 {usage} {
+ list [catch {wm resizable .t bad 0} msg] $msg
+} {1 {expected boolean value but got "bad"}}
+
+test wm-resizable-1.5 {usage} {
+ list [catch {wm resizable .t 1 bad} msg] $msg
+} {1 {expected boolean value but got "bad"}}
+
+test wm-resizable-2.1 {setting and reading values} {
+ wm resizable .t 0 1
+ set result [wm resizable .t]
+ wm resizable .t 1 0
+ lappend result [wm resizable .t]
+ wm resizable .t 1 1
+ lappend result [wm resizable .t]
+} {0 1 {1 0} {1 1}}
+
+
+test wm-sizefrom-1.1 {usage} {
+ list [catch {wm sizefrom} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-sizefrom-1.2 {usage} {
+ list [catch {wm sizefrom .t 1 2} msg] $msg
+} {1 {wrong # args: should be "wm sizefrom window ?user|program?"}}
+
+test wm-sizefrom-1.4 {usage} {
+ list [catch {wm sizefrom .t bad} msg] $msg
+} {1 {bad argument "bad": must be program or user}}
+
+test wm-sizefrom-2.1 {setting and reading values} {
+ set result [list [wm sizefrom .t]]
+ wm sizefrom .t user
+ lappend result [wm sizefrom .t]
+ wm sizefrom .t program
+ lappend result [wm sizefrom .t]
+ wm sizefrom .t {}
+ lappend result [wm sizefrom .t]
+} {{} user program {}}
+
+
+
+test wm-stackorder-1.1 {usage} {
+ list [catch {wm stackorder} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-stackorder-1.2 {usage} {
+ list [catch {wm stackorder . _} err] $err
+} {1 {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}}
+
+test wm-stackorder-1.3 {usage} {
+ list [catch {wm stackorder . _ _ _} err] $err
+} {1 {wrong # args: should be "wm stackorder window ?isabove|isbelow window?"}}
+
+test wm-stackorder-1.4 {usage} {
+ list [catch {wm stackorder . is .} err] $err
+} {1 {ambiguous argument "is": must be isabove or isbelow}}
+
+test wm-stackorder-1.5 {usage} {
+ list [catch {wm stackorder _} err] $err
+} {1 {bad window path name "_"}}
+
+test wm-stackorder-1.6 {usage} {
+ list [catch {wm stackorder . isabove _} err] $err
+} {1 {bad window path name "_"}}
+
+test wm-stackorder-1.7 {usage} {
catch {destroy .t}
- toplevel .t -width 200 -height 200
- wm geom .t +0+0
+ toplevel .t
+ button .t.b
+ list [catch {wm stackorder .t.b} err] $err
+} {1 {window ".t.b" isn't a top-level window}}
+
+test wm-stackorder-1.8 {usage} {
+ catch {destroy .t}
+ toplevel .t
+ button .t.b
+ pack .t.b
update
- wm geom .t -0-0
+ list [catch {wm stackorder . isabove .t.b} err] $err
+} {1 {window ".t.b" isn't a top-level window}}
+
+test wm-stackorder-1.9 {usage} {
+ catch {destroy .t}
+ toplevel .t
+ button .t.b
+ pack .t.b
update
- set x [winfo x .t]
- set y [winfo y .t]
- .t configure -width 300 -height 150
+ list [catch {wm stackorder . isbelow .t.b} err] $err
+} {1 {window ".t.b" isn't a top-level window}}
+
+test wm-stackorder-1.10 {usage, isabove|isbelow toplevels must be mapped} {
+ catch {destroy .t}
+ toplevel .t ; update
+ wm withdraw .t
+ list [catch {wm stackorder .t isabove .} err] $err
+} {1 {window ".t" isn't mapped}}
+
+test wm-stackorder-1.11 {usage, isabove|isbelow toplevels must be mapped} {
+ catch {destroy .t}
+ toplevel .t ; update
+ wm withdraw .t
+ list [catch {wm stackorder . isbelow .t} err] $err
+} {1 {window ".t" isn't mapped}}
+
+
+deleteWindows
+
+
+test wm-stackorder-2.1 {} {
+ catch {destroy .t}
+ toplevel .t ; update
+ wm stackorder .
+} {. .t}
+
+test wm-stackorder-2.2 {} {
+ catch {destroy .t}
+ toplevel .t ; update
+ raise .
+ raiseDelay
+ wm stackorder .
+} {.t .}
+
+test wm-stackorder-2.3 {} {
+ catch {destroy .t}
+ toplevel .t ; update
+ catch {destroy .t2}
+ toplevel .t2 ; update
+ raise .
+ raise .t2
+ raiseDelay
+ wm stackorder .
+} {.t . .t2}
+
+test wm-stackorder-2.4 {} {
+ catch {destroy .t}
+ toplevel .t ; update
+ catch {destroy .t2}
+ toplevel .t2 ; update
+ raise .
+ lower .t2
+ raiseDelay
+ wm stackorder .
+} {.t2 .t .}
+
+test wm-stackorder-2.5 {} {
+ catch {destroy .parent}
+ toplevel .parent ; update
+ catch {destroy .parent.child1}
+ toplevel .parent.child1 ; update
+ catch {destroy .parent.child2}
+ toplevel .parent.child2 ; update
+ catch {destroy .extra}
+ toplevel .extra ; update
+ raise .parent
+ lower .parent.child2
+ raiseDelay
+ wm stackorder .parent
+} {.parent.child2 .parent.child1 .parent}
+
+deleteWindows
+
+test wm-stackorder-2.6 {non-toplevel widgets ignored} {
+ catch {destroy .t1}
+ toplevel .t1
+ button .t1.b
+ pack .t1.b
update
- list [expr [winfo x .t] - $x] [expr [winfo y .t] - $y] \
- [winfo width .t] [winfo height .t]
-} {-100 50 300 150}
+ wm stackorder .
+} {. .t1}
+
+deleteWindows
-test wm-15.1 {Tk_SetGrid procedure, set grid dimensions before turning on grid} {nonPortable} {
+test wm-stackorder-2.7 {no children returns self} {
+ wm stackorder .
+} {.}
+
+deleteWindows
+
+
+test wm-stackorder-3.1 {unmapped toplevel} {
+ catch {destroy .t1}
+ toplevel .t1 ; update
+ catch {destroy .t2}
+ toplevel .t2 ; update
+ wm iconify .t1
+ wm stackorder .
+} {. .t2}
+
+test wm-stackorder-3.2 {unmapped toplevel} {
+ catch {destroy .t1}
+ toplevel .t1 ; update
+ catch {destroy .t2}
+ toplevel .t2 ; update
+ wm withdraw .t2
+ wm stackorder .
+} {. .t1}
+
+test wm-stackorder-3.3 {unmapped toplevel} {
+ catch {destroy .t1}
+ toplevel .t1 ; update
+ catch {destroy .t2}
+ toplevel .t2 ; update
+ wm withdraw .t2
+ wm stackorder .t2
+} {}
+
+test wm-stackorder-3.4 {unmapped toplevel} {
+ catch {destroy .t1}
+ toplevel .t1 ; update
+ toplevel .t1.t2 ; update
+ wm withdraw .t1.t2
+ wm stackorder .t1
+} {.t1}
+
+test wm-stackorder-3.5 {unmapped toplevel} {
+ catch {destroy .t1}
+ toplevel .t1 ; update
+ toplevel .t1.t2 ; update
+ wm withdraw .t1
+ wm stackorder .t1
+} {.t1.t2}
+
+test wm-stackorder-3.6 {unmapped toplevel} {
+ catch {destroy .t1}
+ toplevel .t1 ; update
+ toplevel .t1.t2 ; update
+ toplevel .t1.t2.t3 ; update
+ wm withdraw .t1.t2
+ wm stackorder .t1
+} {.t1 .t1.t2.t3}
+
+test wm-stackorder-3.7 {unmapped toplevel, mapped children returned} {
+ catch {destroy .t1}
+ toplevel .t1 ; update
+ toplevel .t1.t2 ; update
+ wm withdraw .t1
+ wm stackorder .t1
+} {.t1.t2}
+
+test wm-stackorder-3.8 {toplevel mapped in idle callback } {
+ catch {destroy .t1}
+ toplevel .t1
+ wm stackorder .
+} {.}
+
+
+deleteWindows
+
+
+test wm-stackorder-4.1 {wm stackorder isabove|isbelow} {
+ catch {destroy .t}
+ toplevel .t ; update
+ raise .t
+ wm stackorder . isabove .t
+} {0}
+
+test wm-stackorder-4.2 {wm stackorder isabove|isbelow} {
+ catch {destroy .t}
+ toplevel .t ; update
+ raise .t
+ wm stackorder . isbelow .t
+} {1}
+
+test wm-stackorder-4.3 {wm stackorder isabove|isbelow} {
+ catch {destroy .t}
+ toplevel .t ; update
+ raise .
+ raiseDelay
+ wm stackorder .t isa .
+} {0}
+
+test wm-stackorder-4.4 {wm stackorder isabove|isbelow} {
+ catch {destroy .t}
+ toplevel .t ; update
+ raise .
+ raiseDelay
+ wm stackorder .t isb .
+} {1}
+
+deleteWindows
+
+test wm-stackorder-5.1 {a menu is not a toplevel} {
catch {destroy .t}
toplevel .t
- wm geometry .t 30x10+0+0
- listbox .t.l -height 20 -width 20 -setgrid 1
- pack .t.l -fill both -expand 1
+ menu .t.m -type menubar
+ .t.m add cascade -label "File"
+ .t configure -menu .t.m
update
- wm geometry .t
-} {30x10+0+0}
-test wm-15.2 {Tk_SetGrid procedure, turning on grid when dimensions already set} {
+ raise .
+ raiseDelay
+ wm stackorder .
+} {.t .}
+
+test wm-stackorder-5.2 {A normal toplevel can't be
+ raised above an overrideredirect toplevel } {
catch {destroy .t}
toplevel .t
- wm geometry .t 200x100+0+0
- listbox .t.l -height 20 -width 20
- pack .t.l -fill both -expand 1
+ wm overrideredirect .t 1
+ raise .
update
- .t.l configure -setgrid 1
- update
- wm geometry .t
-} {20x20+0+0}
+ raiseDelay
+ wm stackorder . isabove .t
+} 0
-test wm-16.1 {WaitForEvent procedure, use of modal timeout} {
+test wm-stackorder-5.3 {An overrideredirect window
+ can be explicitly lowered } {
catch {destroy .t}
- toplevel .t -width 200 -height 200
- wm geom .t +0+0
+ toplevel .t
+ wm overrideredirect .t 1
+ lower .t
update
- wm iconify .t
- set x no
- after 0 {set x yes}
- wm deiconify .t
- set result $x
+ raiseDelay
+ wm stackorder .t isbelow .
+} 1
+
+test wm-stackorder-6.1 {An embedded toplevel does not
+ appear in the stacking order} {
+ deleteWindows
+ toplevel .real -container 1
+ toplevel .embd -bg blue -use [winfo id .real]
update
- list $result $x
-} {no yes}
+ wm stackorder .
+} {. .real}
-test wm-17.1 {ParseGeometry procedure, resize causes window to move} {
- catch {destroy .t}
- toplevel .t -width 200 -height 200
- wm geom .t +0+0
+stdWindow
+
+test wm-title-1.1 {usage} {
+ list [catch {wm title} msg] $msg
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-title-1.2 {usage} {
+ list [catch {wm title . 1 2} msg] $msg
+} {1 {wrong # args: should be "wm title window ?newTitle?"}}
+
+test wm-title-2.1 {setting and reading values} {
+ destroy .t
+ toplevel .t
+ set result [wm title .t]
+ wm title .t Apa
+ lappend result [wm title .t]
+ wm title .t {}
+ lappend result [wm title .t]
+} {t Apa {}}
+
+
+test wm-transient-1.1 {usage} {
+ catch {destroy .t} ; toplevel .t
+ list [catch {wm transient .t 1 2} msg] $msg
+} {1 {wrong # args: should be "wm transient window ?master?"}}
+
+test wm-transient-1.2 {usage} {
+ catch {destroy .t} ; toplevel .t
+ list [catch {wm transient .t foo} msg] $msg
+} {1 {bad window path name "foo"}}
+
+test wm-transient-1.3 {usage} {
+ catch {destroy .t} ; toplevel .t
+ list [catch {wm transient foo .t} msg] $msg
+} {1 {bad window path name "foo"}}
+
+test wm-transient-1.4 {usage} {
+ deleteWindows
+ toplevel .master
+ toplevel .subject
+ wm transient .subject .master
+ list [catch {wm iconify .subject} msg] $msg
+} {1 {can't iconify ".subject": it is a transient}}
+
+test wm-transient-1.5 {usage} {
+ deleteWindows
+ toplevel .icon -bg blue
+ toplevel .top
+ wm iconwindow .top .icon
+ toplevel .dummy
+ list [catch {wm transient .icon .dummy} msg] $msg
+} {1 {can't make ".icon" a transient: it is an icon for .top}}
+
+test wm-transient-1.6 {usage} {
+ deleteWindows
+ toplevel .icon -bg blue
+ toplevel .top
+ wm iconwindow .top .icon
+ toplevel .dummy
+ list [catch {wm transient .dummy .icon} msg] $msg
+} {1 {can't make ".icon" a master: it is an icon for .top}}
+
+test wm-transient-1.7 {usage} {
+ deleteWindows
+ toplevel .master
+ list [catch {wm transient .master .master} err] $err
+} {1 {can't make ".master" its own master}}
+
+test wm-transient-1.8 {usage} {
+ deleteWindows
+ toplevel .master
+ frame .master.f
+ list [catch {wm transient .master .master.f} err] $err
+} {1 {can't make ".master" its own master}}
+
+test wm-transient-2.1 { basic get/set of master } {
+ deleteWindows
+ set results [list]
+ toplevel .master
+ toplevel .subject
+ lappend results [wm transient .subject]
+ wm transient .subject .master
+ lappend results [wm transient .subject]
+ wm transient .subject {}
+ lappend results [wm transient .subject]
+ set results
+} {{} .master {}}
+
+test wm-transient-2.2 { first toplevel parent of
+ non-toplevel master is used } {
+ deleteWindows
+ toplevel .master
+ frame .master.f
+ toplevel .subject
+ wm transient .subject .master.f
+ wm transient .subject
+} {.master}
+
+test wm-transient-3.1 { transient toplevel is withdrawn
+ when mapped if master is withdrawn } {
+ deleteWindows
+ toplevel .master
+ wm withdraw .master
update
- wm geom .t -0-0
+ toplevel .subject
+ wm transient .subject .master
update
- set x [winfo x .t]
- set y [winfo y .t]
- wm geometry .t 150x300
+ list [wm state .subject] [winfo ismapped .subject]
+} {withdrawn 0}
+
+test wm-transient-3.2 { already mapped transient toplevel
+ takes on withdrawn state of master } {
+ deleteWindows
+ toplevel .master
+ wm withdraw .master
+ update
+ toplevel .subject
update
- list [expr [winfo x .t] - $x] [expr [winfo y .t] - $y] \
- [winfo width .t] [winfo height .t]
-} {50 -100 150 300}
+ wm transient .subject .master
+ update
+ list [wm state .subject] [winfo ismapped .subject]
+} {withdrawn 0}
-test wm-18.1 {TkWmAddToColormapWindows procedure} {
- catch {destroy .t}
- toplevel .t -width 200 -height 200 -colormap new -relief raised -bd 2
- wm geom .t +0+0
+test wm-transient-3.3 { withdraw/deiconify on the master
+ also does a withdraw/deiconify on the transient } {
+ deleteWindows
+ set results [list]
+ toplevel .master
+ toplevel .subject
+ update
+ wm transient .subject .master
+ wm withdraw .master
+ update
+ lappend results [wm state .subject] \
+ [winfo ismapped .subject]
+ wm deiconify .master
+ update
+ lappend results [wm state .subject] \
+ [winfo ismapped .subject]
+ set results
+} {withdrawn 0 normal 1}
+
+test wm-transient-4.1 { transient toplevel is withdrawn
+ when mapped if master is iconic } {
+ deleteWindows
+ toplevel .master
+ wm iconify .master
+ update
+ toplevel .subject
+ wm transient .subject .master
+ update
+ list [wm state .subject] [winfo ismapped .subject]
+} {withdrawn 0}
+
+test wm-transient-4.2 { already mapped transient toplevel
+ is withdrawn if master is iconic } {
+ deleteWindows
+ toplevel .master
+ wm iconify .master
+ update
+ toplevel .subject
update
- wm colormap .t
+ wm transient .subject .master
+ update
+ list [wm state .subject] [winfo ismapped .subject]
+} {withdrawn 0}
+
+test wm-transient-4.3 { iconify/deiconify on the master
+ does a withdraw/deiconify on the transient } {
+ deleteWindows
+ set results [list]
+ toplevel .master
+ toplevel .subject
+ update
+ wm transient .subject .master
+ wm iconify .master
+ update
+ lappend results [wm state .subject] \
+ [winfo ismapped .subject]
+ wm deiconify .master
+ update
+ lappend results [wm state .subject] \
+ [winfo ismapped .subject]
+ set results
+} {withdrawn 0 normal 1}
+
+test wm-transient-5.1 { an error during transient command should not
+ cause the map/unmap binding to be deleted } {
+ deleteWindows
+ set results [list]
+ toplevel .master
+ toplevel .subject
+ update
+ wm transient .subject .master
+ # Expect a bad window path error here
+ lappend results [catch {wm transient .subject .bad}]
+ wm withdraw .master
+ update
+ lappend results [wm state .subject]
+ wm deiconify .master
+ update
+ lappend results [wm state .subject]
+ set results
+} {1 withdrawn normal}
+
+test wm-transient-5.2 { remove transient property when master
+ is destroyed } {
+ deleteWindows
+ toplevel .master
+ toplevel .subject
+ wm transient .subject .master
+ update
+ destroy .master
+ update
+ wm transient .subject
} {}
-test wm-18.2 {TkWmAddToColormapWindows procedure} {
- catch {destroy .t}
- toplevel .t -colormap new -relief raised -bd 2
- wm geom .t +0+0
- frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f
+
+test wm-transient-5.3 { remove transient property from window
+ that had never been mapped when master is destroyed } {
+ deleteWindows
+ toplevel .master
+ toplevel .subject
+ wm transient .subject .master
+ destroy .master
+ wm transient .subject
+} {}
+
+test wm-transient-6.1 { a withdrawn transient does not track
+ state changes in the master } {
+ deleteWindows
+ toplevel .master
+ toplevel .subject
update
- wm colormap .t
-} {.t.f .t}
-test wm-18.3 {TkWmAddToColormapWindows procedure} {
- catch {destroy .t}
- toplevel .t -colormap new
- wm geom .t +0+0
- frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f
- frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f2
- update
- wm colormap .t
-} {.t.f .t.f2 .t}
-test wm-18.4 {TkWmAddToColormapWindows procedure} {
- catch {destroy .t}
- toplevel .t -colormap new
- wm geom .t +0+0
- frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f
+ wm transient .subject .master
+ wm withdraw .subject
+ wm withdraw .master
+ wm deiconify .master
+ # idle handler should not map the transient
update
- wm colormapwindows .t .t.f
- frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f2
+ wm state .subject
+} {withdrawn}
+
+test wm-transient-6.2 { a withdrawn transient does not track
+ state changes in the master } {
+ set results [list]
+ deleteWindows
+ toplevel .master
+ toplevel .subject
update
- wm colormapwindows .t
-} {.t.f}
+ wm transient .subject .master
+ wm withdraw .subject
+ wm withdraw .master
+ wm deiconify .master
+ # idle handler should not map the transient
+ update
+ lappend results [wm state .subject]
+ wm deiconify .subject
+ lappend results [wm state .subject]
+ wm withdraw .master
+ lappend results [wm state .subject]
+ wm deiconify .master
+ # idle handler should map transient
+ update
+ lappend results [wm state .subject]
+} {withdrawn normal withdrawn normal}
-test wm-19.1 {TkWmRemoveFromColormapWindows procedure} {
- catch {destroy .t}
- toplevel .t -colormap new
- wm geom .t +0+0
- frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f
- frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f2
- update
- destroy .t.f2
- wm colormap .t
-} {.t.f .t}
-test wm-19.2 {TkWmRemoveFromColormapWindows procedure} {
- catch {destroy .t}
- toplevel .t -colormap new
- wm geom .t +0+0
- frame .t.f -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f
- frame .t.f2 -width 100 -height 100 -colormap new -relief sunken -bd 2
- pack .t.f2
- update
- wm colormapwindows .t .t.f2
- destroy .t.f2
- wm colormap .t
+
+# wm-transient-7.*: See SF Tk Bug #592201 "wm transient fails with two masters"
+# wm-transient-7.3 through 7.5 all caused panics on Unix in Tk 8.4b1.
+# 7.1 and 7.2 added to catch (potential) future errors.
+#
+test wm-transient-7.1 {Destroying transient} {
+ deleteWindows
+ toplevel .t
+ toplevel .transient
+ wm transient .transient .t
+ destroy .transient
+ destroy .t
+ # OK: the above did not cause a panic.
+} {}
+
+test wm-transient-7.2 {Destroying master} {
+ deleteWindows
+ toplevel .t
+ toplevel .transient
+ wm transient .transient .t
+ destroy .t
+ set result [wm transient .transient]
+ destroy .transient
+ set result
+} {}
+
+test wm-transient-7.3 {Reassign transient, destroy old master} {
+ deleteWindows
+ toplevel .t1
+ toplevel .t2
+ toplevel .transient
+ wm transient .transient .t1
+ wm transient .transient .t2
+ destroy .t1 ;# Caused panic in 8.4b1
+ destroy .t2
+ destroy .transient
+} {}
+
+test wm-transient-7.4 {Reassign transient, destroy new master} {
+ deleteWindows
+ toplevel .t1
+ toplevel .t2
+ toplevel .transient
+ wm transient .transient .t1
+ wm transient .transient .t2
+ destroy .t2 ;# caused panic in 8.4b1
+ destroy .t1
+ destroy .transient
} {}
-catch {destroy .t}
-concat {}
+test wm-transient-7.5 {Reassign transient, destroy transient} {
+ deleteWindows
+ toplevel .t1
+ toplevel .t2
+ toplevel .transient
+ wm transient .transient .t1
+ wm transient .transient .t2
+ destroy .transient
+ destroy .t2 ;# caused panic in 8.4b1
+ destroy .t1 ;# so did this
+} {}
+
+test wm-state-1.1 {usage} {
+ list [catch {wm state} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-state-1.2 {usage} {
+ list [catch {wm state . _ _} err] $err
+} {1 {wrong # args: should be "wm state window ?state?"}}
+
+test wm-state-2.1 {initial state} {
+ deleteWindows
+ toplevel .t
+ wm state .t
+} {normal}
+
+test wm-state-2.2 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm state .t withdrawn
+ wm state .t
+} {withdrawn}
+
+test wm-state-2.3 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm withdraw .t
+ wm state .t
+} {withdrawn}
+
+test wm-state-2.4 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm state .t withdrawn
+ wm state .t
+} {withdrawn}
+
+test wm-state-2.5 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm withdraw .t
+ wm state .t
+} {withdrawn}
+
+test wm-state-2.6 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm state .t iconic
+ wm state .t
+} {iconic}
+
+test wm-state-2.7 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm iconify .t
+ wm state .t
+} {iconic}
+
+test wm-state-2.8 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm state .t iconic
+ wm state .t
+} {iconic}
+
+test wm-state-2.9 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm iconify .t
+ wm state .t
+} {iconic}
+
+test wm-state-2.10 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm withdraw .t
+ wm state .t normal
+ wm state .t
+} {normal}
+
+test wm-state-2.11 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm withdraw .t
+ wm deiconify .t
+ wm state .t
+} {normal}
+
+test wm-state-2.12 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm withdraw .t
+ wm state .t normal
+ wm state .t
+} {normal}
+
+test wm-state-2.13 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm withdraw .t
+ wm deiconify .t
+ wm state .t
+} {normal}
+
+test wm-state-2.14 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm iconify .t
+ wm state .t normal
+ wm state .t
+} {normal}
+
+test wm-state-2.15 {state change before map} {
+ deleteWindows
+ toplevel .t
+ wm iconify .t
+ wm deiconify .t
+ wm state .t
+} {normal}
+
+test wm-state-2.16 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm iconify .t
+ wm state .t normal
+ wm state .t
+} {normal}
+
+test wm-state-2.17 {state change after map} {
+ deleteWindows
+ toplevel .t
+ update
+ wm iconify .t
+ wm deiconify .t
+ wm state .t
+} {normal}
+
+
+test wm-withdraw-1.1 {usage} {
+ list [catch {wm withdraw} err] $err
+} {1 {wrong # args: should be "wm option window ?arg ...?"}}
+
+test wm-withdraw-1.2 {usage} {
+ list [catch {wm withdraw . _} msg] $msg
+} {1 {wrong # args: should be "wm withdraw window"}}
+
+test wm-withdraw-2.1 {Misc errors} {
+ deleteWindows
+ toplevel .t
+ toplevel .t2
+ wm iconwindow .t .t2
+ set result [list [catch {wm withdraw .t2} msg] $msg]
+ destroy .t2
+ set result
+} {1 {can't withdraw .t2: it is an icon for .t}}
+
+test wm-withdraw-3.1 {} {
+ update
+ set result {}
+ wm withdraw .t
+ lappend result [wm state .t] [winfo ismapped .t]
+ wm deiconify .t
+ lappend result [wm state .t] [winfo ismapped .t]
+} {withdrawn 0 normal 1}
+
+
+# FIXME:
+
+# Test delivery of virtual events to the WM. We could check to see
+# if the window was raised after a button click for example.
+# This sort of testing may not be possible.
+
+
+deleteWindows
+tcltest::cleanupTests
+return
+
+
+
diff --git a/tk/tests/xmfbox.test b/tk/tests/xmfbox.test
index fd20939c959..6273af5ff91 100644
--- a/tk/tests/xmfbox.test
+++ b/tk/tests/xmfbox.test
@@ -7,16 +7,19 @@
#
# Copyright (c) 1997 Sun Microsystems, Inc.
# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Contributions from Don Porter, NIST, 2002. (not subject to US copyright)
# All rights reserved.
#
# RCS: @(#) $Id$
-if {[lsearch [namespace children] ::tcltest] == -1} {
- source [file join [pwd] [file dirname [info script]] defs.tcl]
-}
+package require tcltest 2.1
+namespace import -force tcltest::configure
+namespace import -force tcltest::testsDirectory
+configure -testdir [file join [pwd] [file dirname [info script]]]
+configure -loadfile [file join [testsDirectory] constraints.tcl]
+tcltest::loadTestedCommands
set testPWD [pwd]
-eval destroy [winfo children .]
catch {unset foo}
catch {unset data foo}
@@ -59,82 +62,82 @@ proc cleanup {} {
catch {destroy .foo}
}
-test xmfbox-1.1 {tkMotifFDialog_Create, -parent switch} {unixOnly} {
+test xmfbox-1.1 {tk::MotifFDialog_Create, -parent switch} {unixOnly} {
catch {unset foo}
- set x [tkMotifFDialog_Create foo open {-parent .}]
+ set x [tk::MotifFDialog_Create foo open {-parent .}]
catch {destroy $x}
set x
} .foo
-test xmfbox-1.2 {tkMotifFDialog_Create, -parent switch} {unixOnly} {
+test xmfbox-1.2 {tk::MotifFDialog_Create, -parent switch} {unixOnly} {
catch {unset foo}
toplevel .bar
wm geometry .bar +0+0
- set x [tkMotifFDialog_Create foo open {-parent .bar}]
+ set x [tk::MotifFDialog_Create foo open {-parent .bar}]
catch {destroy $x}
catch {destroy .bar}
set x
} .bar.foo
-test xmfbox-2.1 {tkMotifFDialog_InterpFilter, ~ in dir names} {unixOnly} {
+test xmfbox-2.1 {tk::MotifFDialog_InterpFilter, ~ in dir names} {unixOnly} {
cleanup
file mkdir ./~nosuchuser1
- set x [tkMotifFDialog_Create foo open {}]
+ set x [tk::MotifFDialog_Create foo open {}]
$::tk::dialog::file::foo(fEnt) delete 0 end
$::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1
- set kk [tkMotifFDialog_InterpFilter $x]
+ set kk [tk::MotifFDialog_InterpFilter $x]
} [list $testPWD/~nosuchuser1 *]
-test xmfbox-2.2 {tkMotifFDialog_InterpFilter, ~ in file names} {unixOnly} {
+test xmfbox-2.2 {tk::MotifFDialog_InterpFilter, ~ in file names} {unixOnly} {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
- set x [tkMotifFDialog_Create foo open {}]
+ set x [tk::MotifFDialog_Create foo open {}]
$::tk::dialog::file::foo(fEnt) delete 0 end
$::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1
- set kk [tkMotifFDialog_InterpFilter $x]
+ set kk [tk::MotifFDialog_InterpFilter $x]
} [list $testPWD ./~nosuchuser1]
-test xmfbox-2.3 {tkMotifFDialog_Update, ~ in file names} {unixOnly} {
+test xmfbox-2.3 {tk::MotifFDialog_Update, ~ in file names} {unixOnly} {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
- set x [tkMotifFDialog_Create foo open {}]
+ set x [tk::MotifFDialog_Create foo open {}]
$::tk::dialog::file::foo(fEnt) delete 0 end
$::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1
- tkMotifFDialog_InterpFilter $x
- tkMotifFDialog_Update $x
+ tk::MotifFDialog_InterpFilter $x
+ tk::MotifFDialog_Update $x
$::tk::dialog::file::foo(fList) get end
} ~nosuchuser1
-test xmfbox-2.4 {tkMotifFDialog_LoadFile, ~ in file names} {unixOnly} {
+test xmfbox-2.4 {tk::MotifFDialog_LoadFile, ~ in file names} {unixOnly} {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
- set x [tkMotifFDialog_Create foo open {}]
+ set x [tk::MotifFDialog_Create foo open {}]
set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1]
expr {$i >= 0}
} 1
-test xmfbox-2.5 {tkMotifFDialog_BrowseFList, ~ in file names} {unixOnly} {
+test xmfbox-2.5 {tk::MotifFDialog_BrowseFList, ~ in file names} {unixOnly} {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
- set x [tkMotifFDialog_Create foo open {}]
+ set x [tk::MotifFDialog_Create foo open {}]
set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1]
$::tk::dialog::file::foo(fList) selection clear 0 end
$::tk::dialog::file::foo(fList) selection set $i
- tkMotifFDialog_BrowseFList $x
+ tk::MotifFDialog_BrowseFList $x
$::tk::dialog::file::foo(sEnt) get
} $testPWD/~nosuchuser1
-test xmfbox-2.5 {tkMotifFDialog_ActivateFList, ~ in file names} {unixOnly} {
+test xmfbox-2.6 {tk::MotifFDialog_ActivateFList, ~ in file names} {unixOnly} {
cleanup
close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}]
- set x [tkMotifFDialog_Create foo open {}]
+ set x [tk::MotifFDialog_Create foo open {}]
set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1]
$::tk::dialog::file::foo(fList) selection clear 0 end
$::tk::dialog::file::foo(fList) selection set $i
- tkMotifFDialog_BrowseFList $x
- tkMotifFDialog_ActivateFList $x
+ tk::MotifFDialog_BrowseFList $x
+ tk::MotifFDialog_ActivateFList $x
list $::tk::dialog::file::foo(selectPath) \
- $::tk::dialog::file::foo(selectFile) $tkPriv(selectFilePath)
+ $::tk::dialog::file::foo(selectFile) $tk::Priv(selectFilePath)
} [list $testPWD ~nosuchuser1 $testPWD/~nosuchuser1]
# cleanup
@@ -153,4 +156,3 @@ return
-
diff --git a/tk/unix/Makefile.in b/tk/unix/Makefile.in
index 5c80ea51a65..ac5ad95234e 100644
--- a/tk/unix/Makefile.in
+++ b/tk/unix/Makefile.in
@@ -11,6 +11,10 @@
TCLVERSION = @TCL_VERSION@
VERSION = @TK_VERSION@
+MAJOR_VERSION = @TK_MAJOR_VERSION@
+MINOR_VERSION = @TK_MINOR_VERSION@
+PATCH_LEVEL = @TK_PATCH_LEVEL@
+LOCALES = @LOCALES@
#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
@@ -42,34 +46,25 @@ INSTALL_ROOT =
# Directory from which applications will reference the library of Tcl
# scripts (note: you can set the TK_LIBRARY environment variable at
# run-time to override the compiled-in location):
-TK_LIBRARY = @datadir@/tk$(VERSION)
-
-# CYGNUS LOCAL location independence
-# What is appended to the prefix to get the library name. Note that
-# this MUST begin with a "/".
-TK_LIB_TRAILER = /lib/tk$(VERSION)
-# END CYGNUS LOCAL
-
-# Path name to use when installing library scripts:
-SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)/$(TK_LIBRARY)
-
-# Directory in which to install the .a or .so binary for the Tk library:
-LIB_INSTALL_DIR = $(INSTALL_ROOT)@libdir@
+TK_LIBRARY = $(prefix)/lib/tk$(VERSION)
# Path to use at runtime to refer to LIB_INSTALL_DIR:
-LIB_RUNTIME_DIR = @libdir@
+LIB_RUNTIME_DIR = $(libdir)
# Directory in which to install the program wish:
-BIN_INSTALL_DIR = $(INSTALL_ROOT)@bindir@
+BIN_INSTALL_DIR = $(INSTALL_ROOT)$(bindir)
+
+# Directory in which to install the .a or .so binary for the Tk library:
+LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir)
-# Directory from which the program wish should be referenced by scripts:
-BIN_DIR = @bindir@
+# Path name to use when installing library scripts:
+SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY)
# Directory in which to install the include file tk.h:
-INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)@includedir@
+INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir)
# Top-level directory for manual entries:
-MAN_INSTALL_DIR = $(INSTALL_ROOT)@mandir@
+MAN_INSTALL_DIR = $(INSTALL_ROOT)$(mandir)
# Directory in which to install manual entry for wish:
MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1
@@ -91,9 +86,21 @@ TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
# for this version of Tk:
TCL_BIN_DIR = @TCL_BIN_DIR@
+# The linker flags needed to link in the Tcl library (ex: -ltcl8.2)
+TCL_LIB_FLAG = @TCL_LIB_FLAG@
+
# Libraries built with optimization switches have this additional extension
TK_DBGX = @TK_DBGX@
+# Flag, 1: we're building a shared lib, 0 we're not
+TK_SHARED_BUILD = @TK_SHARED_BUILD@
+
+# Directory in which to install the pkgIndex.tcl file for loadable Tk
+PKG_INSTALL_DIR = $(LIB_INSTALL_DIR)/tk$(VERSION)$(TK_DBGX)
+
+# Package index file for loadable Tk
+PKG_INDEX = $(PKG_INSTALL_DIR)/pkgIndex.tcl
+
# warning flags
CFLAGS_WARNING = @CFLAGS_WARNING@
@@ -158,7 +165,7 @@ NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED
# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
-SHELL = @SHELL@
+SHELL = /bin/sh
# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
@@ -167,16 +174,16 @@ SHELL = @SHELL@
INSTALL = @srcdir@/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
+INSTALL_LIBRARY = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
-# The following specifies which Tcl executable to use for make targets
-# below. This can generally be 'tclsh', meaning all targets will work
-# once we have created the initial executable, but in some cases you
-# may want to use a target without having made tclsh on these sources
-# (like for make genstubs)
+# TCL_EXE is the name of a tclsh executable that is available *BEFORE*
+# running make for the first time. Certain build targets (make genstubs)
+# need it to be available on the PATH. This executable should *NOT* be
+# required just to do a normal build although it can be required to run
+# make dist.
TCL_EXE = tclsh
-
# The symbols below provide support for dynamic loading and shared
# libraries. The values of the symbols are normally set by the
# configure script. You shouldn't normally need to modify any of
@@ -190,17 +197,24 @@ STUB_LIB_FILE = @TK_STUB_LIB_FILE@
TK_STUB_LIB_FILE = @TK_STUB_LIB_FILE@
#TK_STUB_LIB_FILE = libtkstub.a
+# Generic stub lib name used in rules that apply to tcl and tk
+STUB_LIB_FILE = ${TK_STUB_LIB_FILE}
+
TK_STUB_LIB_FLAG = @TK_STUB_LIB_FLAG@
#TK_STUB_LIB_FLAG = -ltkstub
TK_LIB_FILE = @TK_LIB_FILE@
#TK_LIB_FILE = libtk.a
+# Generic lib name used in rules that apply to tcl and tk
+LIB_FILE = ${TK_LIB_FILE}
+
TK_LIB_FLAG = @TK_LIB_FLAG@
#TK_LIB_FLAG = -ltk
-TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@
-
+TCL_LIB_SPEC = @TCL_LIB_SPEC@
+TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
+TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@
TK_EXP_FILE = @TK_EXP_FILE@
TK_BUILD_EXP_FILE = @TK_BUILD_EXP_FILE@
@@ -208,35 +222,26 @@ TCL_STUB_FLAGS = @TCL_STUB_FLAGS@
# Libraries to use when linking. This definition is determined by the
# configure script.
-LIBS = @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -lc
-WISH_LIBS = $(TCL_BUILD_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -lc
+LIBS = @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@
+WISH_LIBS = $(TCL_LIB_SPEC) @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@
# The symbol below provides support for dynamic loading and shared
# libraries. See configure.in for a description of what it means.
# The values of the symbolis normally set by the configure script.
-STLIB_LD = @STLIB_LD@
-SHLIB_LD = @SHLIB_LD@
-SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
-
-# CYGNUS LOCAL
-# Defines for building libtk
-SHLIB_SUFFIX = @SHLIB_SUFFIX@
-TCL_SHARED_LIB_SUFFIX = @TCL_SHARED_LIB_SUFFIX@
-TCL_UNSHARED_LIB_SUFFIX = @TCL_UNSHARED_LIB_SUFFIX@
-TK_SHARED_LIB_FILE = @TK_SHARED_LIB_FILE@
-TK_UNSHARED_LIB_FILE = @TK_UNSHARED_LIB_FILE@
-# END CYGNUS LOCAL
-
+STLIB_LD = @STLIB_LD@
SHLIB_LD = @SHLIB_LD@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
-
+TK_SHLIB_LD_EXTRAS = @TK_SHLIB_LD_EXTRAS@
# Additional search flags needed to find the various shared libraries
# at run-time. The first symbol is for use when creating a binary
# with cc, and the second is for use when running ld directly.
-TK_CC_SEARCH_FLAGS = @TK_CC_SEARCH_FLAGS@
-TK_LD_SEARCH_FLAGS = @TK_LD_SEARCH_FLAGS@
+CC_SEARCH_FLAGS = @CC_SEARCH_FLAGS@
+LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@
+
+# support for embedded libraries on Darwin / Mac OS X
+DYLIB_INSTALL_DIR = ${LIB_RUNTIME_DIR}
#----------------------------------------------------------------
# The information below is modified by the configure script when
@@ -260,6 +265,10 @@ TOOL_DIR = @TCL_SRC_DIR@/tools
# either.
#----------------------------------------------------------------
+# Flags to be passed to mkLinks to control whether the manpages
+# should be compressed and linked with softlinks
+MKLINKS_FLAGS = @MKLINKS_FLAGS@
+
CC = @CC@
CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
@@ -278,13 +287,11 @@ ${KEYSYM_FLAGS}
WISH_OBJS = tkAppInit.o
-TCLTEST_OBJS = ${TCL_BIN_DIR}/tclTest.o ${TCL_BIN_DIR}/tclThreadTest.o \
- ${TCL_BIN_DIR}/tclUnixTest.o
-TKTEST_OBJS = $(TCLTEST_OBJS) tkTestInit.o tkTest.o tkSquare.o
+TKTEST_OBJS = tkTestInit.o tkTest.o tkSquare.o
WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \
- tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o tkScale.o \
- tkScrollbar.o
+ tkMenu.o tkMenubutton.o tkMenuDraw.o tkMessage.o \
+ tkPanedWindow.o tkScale.o tkScrollbar.o
CANVOBJS = tkCanvas.o tkCanvArc.o tkCanvBmap.o tkCanvImg.o \
tkCanvLine.o tkCanvPoly.o tkCanvPs.o tkCanvText.o \
@@ -307,7 +314,7 @@ OBJS = tk3d.o tkArgv.o tkAtom.o tkBind.o tkBitmap.o tkClipboard.o tkCmds.o \
tkColor.o tkConfig.o tkConsole.o tkCursor.o tkError.o tkEvent.o \
tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o tkGrid.o \
tkMain.o tkObj.o tkOldConfig.o tkOption.o tkPack.o tkPlace.o \
- tkSelect.o tkUtil.o tkVisual.o tkWindow.o \
+ tkSelect.o tkStyle.o tkUndo.o tkUtil.o tkVisual.o tkWindow.o \
$(UNIXOBJS) $(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS)
TK_DECLS = \
@@ -327,13 +334,14 @@ SRCS = \
$(GENERIC_DIR)/tkGrid.c $(GENERIC_DIR)/tkConsole.c \
$(GENERIC_DIR)/tkMain.c $(GENERIC_DIR)/tkOption.c \
$(GENERIC_DIR)/tkPack.c $(GENERIC_DIR)/tkPlace.c \
- $(GENERIC_DIR)/tkSelect.c $(GENERIC_DIR)/tkUtil.c \
+ $(GENERIC_DIR)/tkSelect.c $(GENERIC_DIR)/tkStyle.c \
+ $(GENERIC_DIR)/tkUndo.c $(GENERIC_DIR)/tkUtil.c \
$(GENERIC_DIR)/tkVisual.c $(GENERIC_DIR)/tkWindow.c \
$(GENERIC_DIR)/tkButton.c $(GENERIC_DIR)/tkObj.c \
$(GENERIC_DIR)/tkEntry.c $(GENERIC_DIR)/tkFrame.c \
$(GENERIC_DIR)/tkListbox.c $(GENERIC_DIR)/tkMenu.c \
$(GENERIC_DIR)/tkMenubutton.c $(GENERIC_DIR)/tkMenuDraw.c \
- $(GENERIC_DIR)/tkMessage.c \
+ $(GENERIC_DIR)/tkMessage.c $(GENERIC_DIR)/tkPanedWindow.c \
$(GENERIC_DIR)/tkScale.c $(GENERIC_DIR)/tkScrollbar.c \
$(GENERIC_DIR)/tkCanvas.c $(GENERIC_DIR)/tkCanvArc.c \
$(GENERIC_DIR)/tkCanvBmap.c $(GENERIC_DIR)/tkCanvImg.c \
@@ -373,16 +381,11 @@ HDRS = bltList.h \
default.h ks_names.h tkPatch.h tk.h tkButton.h tkCanvas.h tkInt.h \
tkPort.h tkScrollbar.h tkText.h
-INSTALL_HDRS = $(GENERIC_DIR)/tk.h \
- $(GENERIC_DIR)/tkInt.h \
- $(GENERIC_DIR)/tkDecls.h \
- $(GENERIC_DIR)/tkIntXlibDecls.h
-
DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget
all: binaries libraries doc
-binaries: ${TK_LIB_FILE} ${STUB_LIB_FILE} wish
+binaries: ${LIB_FILE} ${STUB_LIB_FILE} wish
libraries:
@@ -394,15 +397,13 @@ doc: $(SRC_DIR)/doc/man.macros
# The following target is configured by autoconf to generate either
# a shared library or non-shared library for Tk.
-${TK_LIB_FILE}: ${OBJS}
- rm -f ${TK_LIB_FILE}
+${LIB_FILE}: ${OBJS}
+ rm -f $@
@MAKE_LIB@
- $(RANLIB) ${TK_LIB_FILE}
${STUB_LIB_FILE}: ${STUB_LIB_OBJS}
- rm -f ${STUB_LIB_FILE}
+ rm -f $@
@MAKE_STUB_LIB@
- $(RANLIB) ${STUB_LIB_FILE}
# Make target which outputs the list of the .o contained in the Tk lib
# usefull to build a single big shared library containing Tcl/Tk and other
@@ -415,51 +416,81 @@ tkLibObjs:
objs: ${OBJS}
-wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) @TCL_LIB_FULL_PATH@
+wish: $(WISH_OBJS) $(TK_LIB_FILE) $(TK_STUB_LIB_FILE)
$(CC) $(LDFLAGS) $(WISH_OBJS) \
@TK_BUILD_LIB_SPEC@ \
- $(WISH_LIBS) $(TK_CC_SEARCH_FLAGS) -o wish
+ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o wish
-# This rule is executed if the user tried to run tktest without first
-# building tcltest in the Tcl bin directory. Just do it for them.
-${TCL_BIN_DIR}/tcltest:
- cd ${TCL_BIN_DIR} ; \
- make tcltest
+# Resetting the LIB_RUNTIME_DIR below is required so that
+# the generated tktest executable gets the build directory
+# burned into its ld search path. This keeps tktest from
+# picking up an already installed version of the Tcl or
+# Tk shared libraries.
-tktest: ${TCL_BIN_DIR}/tcltest $(TKTEST_OBJS) $(TK_LIB_FILE) @TCL_LIB_FULL_PATH@
+tktest: $(TKTEST_OBJS) $(TK_LIB_FILE)
+ $(MAKE) tktest-real LIB_RUNTIME_DIR=`pwd`:$(TCL_BIN_DIR)
+
+tktest-real:
${CC} $(LDFLAGS) $(TKTEST_OBJS) \
@TK_BUILD_LIB_SPEC@ \
- $(WISH_LIBS) $(TK_CC_SEARCH_FLAGS) -o tktest
+ $(WISH_LIBS) $(CC_SEARCH_FLAGS) -o tktest
-xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE) @TCL_LIB_FULL_PATH@
+# FIXME: This xttest rule seems to be broken in a number of ways.
+# It should use CC_SEARCH_FLAGS, it does not include the shared
+# lib location logic from tktest, and it is not clear where this
+# test.o object file comes from.
+xttest: test.o tkTest.o tkSquare.o $(TK_LIB_FILE)
${CC} $(LDFLAGS) test.o tkTest.o tkSquare.o \
@TK_BUILD_LIB_SPEC@ \
- $(WISH_LIBS) $(TK_LD_SEARCH_FLAGS) -lXt -o xttest
+ $(WISH_LIBS) $(LD_SEARCH_FLAGS) -lXt -o xttest
# Note, in the target below TCL_LIBRARY needs to be set or else
# "make test" won't work in the case where the compilation directory
# isn't the same as the source directory.
+# Specifying TESTFLAGS on the command line is the standard way to pass
+# args to tcltest, ie:
+# % make test TESTFLAGS="-verbose bps -file fileName.test"
test: tktest
- LD_LIBRARY_PATH=`pwd`:${TCL_BIN_DIR}:${LD_LIBRARY_PATH}; \
- export LD_LIBRARY_PATH; \
- LIBPATH=`pwd`:${TCL_BIN_DIR}:${LIBPATH}; export LIBPATH; \
- SHLIB_PATH=`pwd`:${TCL_BIN_DIR}:${SHLIB_PATH}; \
- export SHLIB_PATH; \
TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
- ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 $(TCLTESTARGS)
+ ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \
+ $(TESTFLAGS) $(TCLTESTARGS)
+
+# Tests with different languages
+testlang: tktest
+ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
+ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
+ for lang in $(LOCALES) ; \
+ do \
+ LANG=$(lang); export LANG; \
+ ./tktest $(TOP_DIR)/tests/all.tcl -geometry +0+0 \
+ $(TESTFLAGS) $(TCLTESTARGS); \
+ done
# Useful target to launch a built tktest with the proper path,...
runtest: tktest
- LD_LIBRARY_PATH=`pwd`:${TCL_BIN_DIR}:${LD_LIBRARY_PATH}; \
- export LD_LIBRARY_PATH; \
- LIBPATH=`pwd`:${TCL_BIN_DIR}:${LIBPATH}; export LIBPATH; \
- SHLIB_PATH=`pwd`:${TCL_BIN_DIR}:${SHLIB_PATH}; export SHLIB_PATH; \
TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
./tktest
+# This target can be used to run wish from the build directory
+# via `make shell` or `make shell SCRIPT=/tmp/foo.tcl`
+shell: wish
+ @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}; \
+ export @LD_LIBRARY_PATH_VAR@; \
+ TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
+ TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY; \
+ ./wish $(SCRIPT)
+
+# This target can be used to run wish inside either gdb or insight
+gdb: wish
+ @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:${TCL_BIN_DIR}:${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+ @echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run
+ @echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run
+ gdb ./wish --command=gdb.run
+ rm gdb.run
+
install: all install-binaries install-libraries install-demos install-doc
# Note: before running ranlib below, must cd to target directory because
@@ -467,7 +498,7 @@ install: all install-binaries install-libraries install-demos install-doc
# possible (e.g. if installing as root).
install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
- @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
+ @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) $(PKG_INSTALL_DIR); \
do \
if [ ! -d $$i ] ; then \
echo "Making directory $$i"; \
@@ -479,13 +510,19 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
@if test ! -x $(UNIX_DIR)/install-sh; then \
chmod +x $(UNIX_DIR)/install-sh; \
fi
- @if test ! -x $(UNIX_DIR)/mkLinks; then \
- chmod +x $(UNIX_DIR)/mkLinks; \
+ @if test "x$(TK_SHARED_BUILD)" = "x1"; then \
+ echo "Creating package index $(PKG_INDEX)"; \
+ rm -f $(PKG_INDEX); \
+ (\
+ echo "if {[package vcompare [package provide Tcl]\
+ $(TCLVERSION)] != 0} { return }";\
+ echo "package ifneeded Tk $(VERSION)\
+ [list load [file join \$$dir .. $(TK_LIB_FILE)] Tk]";\
+ ) > $(PKG_INDEX); \
fi
- @echo "Installing $(TK_LIB_FILE) to $(LIB_INSTALL_DIR)/"
- @$(INSTALL_DATA) $(TK_LIB_FILE) $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
- @(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TK_LIB_FILE))
- @chmod 555 $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
+ @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/"
+ @@INSTALL_LIB@
+ @chmod 555 $(LIB_INSTALL_DIR)/$(LIB_FILE)
@echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)"
@$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION)
@echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/"
@@ -494,16 +531,16 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
echo "Installing $(TK_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \
$(INSTALL_DATA) $(TK_BUILD_EXP_FILE) \
$(LIB_INSTALL_DIR)/$(TK_EXP_FILE); \
- fi
- @if test "$(TK_STUB_LIB_FILE)" != "" ; then \
- echo "Installing $(TK_STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \
- $(INSTALL_DATA) $(STUB_LIB_FILE) \
- $(LIB_INSTALL_DIR)/$(TK_STUB_LIB_FILE); \
- fi
+ fi
+ @if test "$(STUB_LIB_FILE)" != "" ; then \
+ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \
+ @INSTALL_STUB_LIB@ ; \
+ fi
install-libraries:
- @for i in $(INSTALL_ROOT)@datadir@ $(INCLUDE_INSTALL_DIR) \
- $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images; \
+ @for i in $(INCLUDE_INSTALL_DIR) \
+ $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images \
+ $(SCRIPT_INSTALL_DIR)/msgs; \
do \
if [ ! -d $$i ] ; then \
echo "Making directory $$i"; \
@@ -516,7 +553,8 @@ install-libraries:
chmod +x $(UNIX_DIR)/install-sh; \
fi
@echo "Installing header files";
- @for i in $(INSTALL_HDRS) ; \
+ @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \
+ $(GENERIC_DIR)/tkPlatDecls.h ; \
do \
$(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \
done;
@@ -533,27 +571,16 @@ install-libraries:
$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/images; \
fi; \
done;
-
-# CYGNUS LOCAL: install-minimal target.
-install-minimal:
- @for i in $(INSTALL_ROOT)@datadir@ $(INCLUDE_INSTALL_DIR) \
- $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images; \
- do \
- if [ ! -d $$i ] ; then \
- echo "Making directory $$i"; \
- mkdir $$i; \
- chmod 755 $$i; \
- else true; \
- fi; \
- done;
- for i in $(SRC_DIR)/library/*.tcl $(SRC_DIR)/library/tclIndex $(SRC_DIR)/library/prolog.ps; \
+ @echo "Installing translation directory";
+ @for i in $(SRC_DIR)/library/msgs/*.msg; \
do \
- echo "Installing $$i"; \
- $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
+ if [ -f $$i ] ; then \
+ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/msgs; \
+ fi; \
done;
install-demos:
- @for i in $(INSTALL_ROOT)@datadir@ $(SCRIPT_INSTALL_DIR) \
+ @for i in $(SCRIPT_INSTALL_DIR) \
$(SCRIPT_INSTALL_DIR)/demos \
$(SCRIPT_INSTALL_DIR)/demos/images ; \
do \
@@ -585,6 +612,9 @@ install-demos:
done;
install-doc:
+ @if test ! -x $(UNIX_DIR)/mkLinks; then \
+ chmod +x $(UNIX_DIR)/mkLinks; \
+ fi
@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \
do \
if [ ! -d $$i ] ; then \
@@ -600,37 +630,34 @@ install-doc:
rm -f $(MAN1_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
$$i > $(MAN1_INSTALL_DIR)/$$i; \
- chmod 644 $(MAN1_INSTALL_DIR)/$$i; \
+ chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
done;
@echo "Cross-linking top-level (.1) docs";
- @$(UNIX_DIR)/mkLinks $(MAN1_INSTALL_DIR)
+ @$(UNIX_DIR)/mkLinks $(MKLINKS_FLAGS) $(MAN1_INSTALL_DIR)
@echo "Installing C API (.3) docs";
@cd $(SRC_DIR)/doc; for i in *.3; \
do \
rm -f $(MAN3_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
$$i > $(MAN3_INSTALL_DIR)/$$i; \
- chmod 644 $(MAN3_INSTALL_DIR)/$$i; \
+ chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
done;
@echo "Cross-linking top-level (.3) docs";
- @$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR)
+ @$(UNIX_DIR)/mkLinks $(MKLINKS_FLAGS) $(MAN3_INSTALL_DIR)
@echo "Installing command (.n) docs";
@cd $(SRC_DIR)/doc; for i in *.n; \
do \
rm -f $(MANN_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
- $$i > $(MAN3_INSTALL_DIR)/$$name; \
- chmod 644 $(MAN3_INSTALL_DIR)/$$name; \
+ $$i > $(MANN_INSTALL_DIR)/$$i; \
+ chmod 444 $(MANN_INSTALL_DIR)/$$i; \
done;
@echo "Cross-linking command (.n) docs";
- @$(UNIX_DIR)/mkLinks $(MANN_INSTALL_DIR)
+ @$(UNIX_DIR)/mkLinks $(MKLINKS_FLAGS) $(MANN_INSTALL_DIR)
-Makefile: $(UNIX_DIR)/Makefile.in config.status
+Makefile: $(UNIX_DIR)/Makefile.in
$(SHELL) config.status
-config.status: $(UNIX_DIR)/configure
- ./config.status --recheck
-
clean:
rm -f *.a *.o libtk* core errs *~ \#* TAGS *.E a.out errors \
tktest wish config.info lib.exp
@@ -742,6 +769,9 @@ tkPlace.o: $(GENERIC_DIR)/tkPlace.c
tkSelect.o: $(GENERIC_DIR)/tkSelect.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkSelect.c
+tkStyle.o: $(GENERIC_DIR)/tkStyle.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkStyle.c
+
tkUtil.o: $(GENERIC_DIR)/tkUtil.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkUtil.c
@@ -775,6 +805,9 @@ tkMenuDraw.o: $(GENERIC_DIR)/tkMenuDraw.c
tkMessage.o: $(GENERIC_DIR)/tkMessage.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkMessage.c
+tkPanedWindow.o: $(GENERIC_DIR)/tkPanedWindow.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkPanedWindow.c
+
tkScale.o: $(GENERIC_DIR)/tkScale.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkScale.c
@@ -874,6 +907,9 @@ tkStubLib.o: $(GENERIC_DIR)/tkStubLib.c
tkStubImg.o: $(GENERIC_DIR)/tkStubImg.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkStubImg.c
+tkUndo.o: $(GENERIC_DIR)/tkUndo.c
+ $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkUndo.c
+
tkUnix.o: $(UNIX_DIR)/tkUnix.c
$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnix.c
@@ -956,9 +992,17 @@ checkuchar:
checkexports: $(TK_LIB_FILE)
-nm -p $(TK_LIB_FILE) | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k'
-# Target to regenerate header files and stub files from the *.decls tables.
+
+#
+# Regenerate the stubs files.
#
+$(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \
+ $(GENERIC_DIR)/tkInt.decls
+ @echo "Warning: tkStubInit.c may be out of date."
+ @echo "Developers may want to run \"make genstubs\" to regenerate."
+ @echo "This warning can be safely ignored, do not report as a bug!"
+
genstubs:
$(TCL_EXE) $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \
$(GENERIC_DIR)/tk.decls $(GENERIC_DIR)/tkInt.decls
@@ -996,6 +1040,11 @@ rpm: all /bin/rpm
mv RPMS/i386/*.rpm .
rm -rf RPMS THIS.TK.SPEC
+mklinks:
+ $(TCL_EXE) $(TCLDIR)/unix/mkLinks.tcl \
+ $(UNIX_DIR)/../doc/*.[13n] > $(UNIX_DIR)/mkLinks
+ chmod +x $(UNIX_DIR)/mkLinks
+
#
# Target to create a proper Tk distribution from information in the
# master source directory. DISTDIR must be defined to indicate where
@@ -1003,29 +1052,26 @@ rpm: all /bin/rpm
#
DISTROOT = /tmp/dist
-DISTNAME = tk@TK_VERSION@@TK_PATCH_LEVEL@
-ZIPNAME = tk@TK_MAJOR_VERSION@@TK_MINOR_VERSION@@TK_PATCH_LEVEL@.zip
+DISTNAME = tk${VERSION}${PATCH_LEVEL}
+ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}.zip
DISTDIR = $(DISTROOT)/$(DISTNAME)
TCLDIR = @TCL_SRC_DIR@
-$(UNIX_DIR)/configure:
+$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in
autoconf $(UNIX_DIR)/configure.in > $(UNIX_DIR)/configure
-dist: $(UNIX_DIR)/configure
+dist: $(UNIX_DIR)/configure mklinks
rm -rf $(DISTDIR)
mkdir -p $(DISTDIR)
mkdir $(DISTDIR)/unix
cp -p $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix
cp $(TOP_DIR)/license.terms $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix
chmod 664 $(DISTDIR)/unix/Makefile.in
- cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in \
- $(UNIX_DIR)/aclocal.m4 \
+ cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in $(UNIX_DIR)/tk.spec \
+ $(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \
$(UNIX_DIR)/tkConfig.sh.in $(TCLDIR)/unix/install-sh \
- $(UNIX_DIR)/README $(DISTDIR)/unix
+ $(UNIX_DIR)/README $(UNIX_DIR)/mkLinks $(DISTDIR)/unix
chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in
chmod +x $(DISTDIR)/unix/install-sh
- $(TCL_EXE) $(TCLDIR)/unix/mkLinks.tcl $(TOP_DIR)/doc/*.[13n] \
- > $(DISTDIR)/unix/mkLinks
- chmod +x $(DISTDIR)/unix/mkLinks
mkdir $(DISTDIR)/bitmaps
@(cd $(TOP_DIR); for i in bitmaps/* ; do \
if [ -f $$i ] ; then \
@@ -1046,17 +1092,25 @@ dist: $(UNIX_DIR)/configure
cp $(TOP_DIR)/win/configure.in \
$(TOP_DIR)/win/configure \
$(TOP_DIR)/win/tkConfig.sh.in \
- $(TOP_DIR)/win/aclocal.m4 \
+ $(TOP_DIR)/win/aclocal.m4 $(TOP_DIR)/win/tcl.m4 \
$(DISTDIR)/win
cp -p $(TOP_DIR)/win/*.c $(TOP_DIR)/win/*.h $(DISTDIR)/win
cp -p $(TOP_DIR)/win/*.bat $(DISTDIR)/win
+ $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/*.bat
cp -p $(TOP_DIR)/win/makefile.* $(DISTDIR)/win
+ $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/makefile.*
+ cp -p $(TOP_DIR)/win/rules.vc $(DISTDIR)/win
+ $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rules.vc
cp -p $(TOP_DIR)/win/README $(DISTDIR)/win
+ cp -p $(TOP_DIR)/win/lamp.bmp $(DISTDIR)/win
cp -p $(TOP_DIR)/license.terms $(DISTDIR)/win
mkdir $(DISTDIR)/win/rc
+ cp -p $(TOP_DIR)/win/rc/wish.exe.manifest $(DISTDIR)/win/rc/
cp -p $(TOP_DIR)/win/rc/*.rc $(TOP_DIR)/win/rc/*.cur \
$(TOP_DIR)/win/rc/*.ico $(TOP_DIR)/win/rc/*.bmp \
$(DISTDIR)/win/rc
+ $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/*.rc
+ $(TCL_EXE) $(TOOL_DIR)/eolFix.tcl -crlf $(DISTDIR)/win/rc/wish.exe.manifest
mkdir $(DISTDIR)/mac
cp -p $(TOP_DIR)/mac/tkMacProjects.sea.hqx $(DISTDIR)/mac
cp -p $(TOP_DIR)/mac/*.c $(TOP_DIR)/mac/*.h $(TOP_DIR)/mac/*.r \
@@ -1065,8 +1119,14 @@ dist: $(UNIX_DIR)/configure
cp -p $(TOP_DIR)/license.terms $(DISTDIR)/mac
cp -p $(TOP_DIR)/mac/*.pch $(DISTDIR)/mac
cp -p $(TOP_DIR)/mac/*.doc $(DISTDIR)/mac
- cp -p $(TOP_DIR)/mac/*.exp $(DISTDIR)/mac
cp -p $(TOP_DIR)/mac/*.tcl $(DISTDIR)/mac
+ mkdir $(DISTDIR)/macosx
+ cp -p $(TOP_DIR)/macosx/Makefile $(TOP_DIR)/macosx/Wish.icns \
+ $(TOP_DIR)/macosx/*.c $(TOP_DIR)/macosx/*.h \
+ $(TOP_DIR)/macosx/*.r $(DISTDIR)/macosx
+ mkdir $(DISTDIR)/macosx/Wish.pbproj
+ cp -p $(TOP_DIR)/macosx/Wish.pbproj/*.pbx* \
+ $(DISTDIR)/macosx/Wish.pbproj
mkdir $(DISTDIR)/compat
cp -p $(TOP_DIR)/license.terms $(TCLDIR)/compat/unistd.h \
$(TCLDIR)/compat/stdlib.h $(TCLDIR)/compat/limits.h \
@@ -1087,6 +1147,12 @@ dist: $(UNIX_DIR)/configure
cp $$i $(DISTDIR)/$$i; \
fi; \
done;)
+ mkdir $(DISTDIR)/library/msgs
+ @(cd $(TOP_DIR); for i in library/msgs/*.msg ; do \
+ if [ -f $$i ] ; then \
+ cp $$i $(DISTDIR)/$$i; \
+ fi; \
+ done;)
mkdir $(DISTDIR)/library/demos
cp -pr $(TOP_DIR)/library/demos/*.tcl \
$(TOP_DIR)/library/demos/tclIndex \
@@ -1244,4 +1310,3 @@ package-generate:
rm -rf $(PACKAGE)
# DO NOT DELETE THIS LINE -- make depend depends on it.
-
diff --git a/tk/unix/README b/tk/unix/README
index 994c1bc54ed..73ba968277b 100644
--- a/tk/unix/README
+++ b/tk/unix/README
@@ -6,11 +6,11 @@ UNIX versions of Tk. This directory also contains source files for Tk
that are specific to UNIX.
The information in this file is maintained at:
- http://dev.scriptics.com/doc/howto/compile.html
+ http://www.tcl.tk/doc/howto/compile.html
For information on platforms where Tcl/Tk is known to compile, along
with any porting notes for getting it to work on those platforms, see:
- http://dev.scriptics.com/software/tcltk/platforms.html
+ http://www.tcl.tk/software/tcltk/platforms.html
The rest of this file contains instructions on how to do this. The
release should compile and run either "out of the box" or with trivial
@@ -25,9 +25,9 @@ RCS: @(#) $Id$
How To Compile And Install Tk:
------------------------------
-(a) Make sure that the Tcl 8.3 release is present in the directory
- ../../tcl8.3 (or else use the "--with-tcl" switch described below).
- This release of Tk will only work with Tcl 8.3. Also, be sure that
+(a) Make sure that the Tcl 8.4 release is present in the directory
+ ../../tcl8.4 (or else use the "--with-tcl" switch described below).
+ This release of Tk will only work with Tcl 8.4. Also, be sure that
you have configured Tcl before you configure Tk.
(b) Check for patches as described in ../README.
@@ -44,17 +44,13 @@ How To Compile And Install Tk:
type "./configure -help" or refer to the autoconf documentation (not
included here). Tk's "configure" script supports the following
special switches in addition to the standard ones:
- --enable-gcc If this switch is set, Tk will configure
- itself to use gcc if it is available on your
- system. Note: it is not safe to modify the
- Makefile to use gcc after configure is run.
- --enable-threads Tk on Unix currently does not support
- threaded builds.
--with-tcl=DIR Specifies the directory containing the Tcl
binaries and Tcl's platform-dependent
configuration information. By default
the Tcl directory is assumed to be in the
location given by (a) above.
+ --enable-threads If this switch is set, Tcl will compile
+ itself with multithreading support.
--enable-shared If this switch is specified, Tk will compile
itself as a shared library if it can figure
out how to do that on this platform. This
@@ -62,8 +58,24 @@ How To Compile And Install Tk:
how to build shared libraries.
--disable-shared If this switch is specified, Tk will compile
itself as a static library.
+ --enable-symbols build with debugging symbols
+ --disable-symbols build without debugging symbols
+ --enable-64bit enable 64bit support (where applicable)
+ --disable-64bit disable 64bit support (where applicable)
+ --enable-64bit-vis enable 64bit Sparc VIS support
+ --disable-64bit-vis disable 64bit Sparc VIS support
+ --enable-man-symlinks Use symlinks for linking the manpages that
+ should be reachable under several names.
+ --enable-man-compression=PROG
+ Compress the manpages using PROG.
+
+ Note: by default gcc will be used if it can be located on the PATH.
+ if you want to use cc instead of gcc, set the CC environment variable
+ to "cc" before running configure. It is not safe to change the Makefile
+ to use gcc after configure is run.
+
Note: be sure to use only absolute path names (those starting with "/")
- in the --prefix and --exec_prefix options.
+ in the --prefix and --exec-prefix options.
(e) Type "make". This will create a library archive called
"libtk<version>.a" or "libtk<version>.so" and an interpreter
@@ -81,7 +93,7 @@ How To Compile And Install Tk:
standard places. You'll need write permission on the installation
directoryies to do this. The installation directories are
determined by the "configure" script and may be specified with
- the --prefix and --exec_prefix options to "configure". See the
+ the --prefix and --exec-prefix options to "configure". See the
Makefile for information on what directories were chosen; you
can override these choices by modifying the "prefix" and
"exec_prefix" variables in the Makefile.
@@ -94,9 +106,9 @@ How To Compile And Install Tk:
TCL_LIBRARY environment variable as well (see the Tcl README file
for information on this). Note that installed versions of wish,
libtk.a, libtk.so, and the Tk library have a version number in their
- names, such as "wish8.3" or "libtk8.3.so"; to use the installed
+ names, such as "wish8.4" or "libtk8.4.so"; to use the installed
versions, either specify the version number or create a symbolic
- link (e.g. from "wish" to "wish8.3").
+ link (e.g. from "wish" to "wish8.4").
If you have trouble compiling Tk, see the URL noted above about working
platforms. It contains information that people have provided about changes
@@ -127,9 +139,9 @@ safe to conclude that any errors represent portability problems in the
test suite and not fundamental flaws with Tk.
There are also a number of visual tests for things such as screen layout,
-Postscript generation, etc. These tests all have to be run manually and
-the results have to be verified visually. To run the tests, cd to the
-"tests" directory and run the script "visual". It will present a main
-window with a bunch of menus, which you can use to select various tests.
-
-
+Postscript generation, etc. These tests all have to be run by manually
+enabling the "userInteraction" constraint when testing, and the results
+have to be verified visually.. This can be done with
+ make test TESTFLAGS="-constraints userInteraction"
+Some tests will present a main window with a bunch of menus, which you can
+use to select various tests.
diff --git a/tk/unix/aclocal.m4 b/tk/unix/aclocal.m4
index 005783c4aae..bc7540da6cc 100644
--- a/tk/unix/aclocal.m4
+++ b/tk/unix/aclocal.m4
@@ -1,2 +1 @@
builtin(include,tcl.m4)
-builtin(include,../cygtcl.m4)
diff --git a/tk/unix/configure b/tk/unix/configure
index aa9968aab13..b3377628607 100755
--- a/tk/unix/configure
+++ b/tk/unix/configure
@@ -12,10 +12,17 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
+ --enable-man-symlinks use symlinks for the manpages"
+ac_help="$ac_help
+ --enable-man-compression=PROG
+ compress the manpages with PROG"
+ac_help="$ac_help
--enable-threads build with threads"
ac_help="$ac_help
--with-tcl directory containing tcl configuration (tclConfig.sh)"
ac_help="$ac_help
+ --enable-shared build and link with shared libraries [--enable-shared]"
+ac_help="$ac_help
--enable-64bit enable 64bit support (where applicable)"
ac_help="$ac_help
--enable-64bit-vis enable 64bit Sparc VIS support"
@@ -25,8 +32,6 @@ ac_help="$ac_help
--enable-symbols build with debugging symbols [--disable-symbols]"
ac_help="$ac_help
--with-x use the X Window System"
-ac_help="$ac_help
- --enable-shared build and link with shared libraries [--enable-shared]"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -44,7 +49,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -159,7 +163,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -330,11 +333,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -500,16 +498,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -548,13 +542,18 @@ else
fi
-# RCS: @(#) $Id$
-TK_VERSION=8.3
+
+TK_VERSION=8.4
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=3
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=4
+TK_PATCH_LEVEL=".0"
VERSION=${TK_VERSION}
+LOCALES="cs de el en en_gb es fr it nl ru"
+
+#------------------------------------------------------------------------
+# Handle the --prefix=... option
+#------------------------------------------------------------------------
if test "${prefix}" = "NONE"; then
prefix=/usr/local
@@ -562,72 +561,59 @@ fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
+# libdir must be a fully qualified path and (not ${exec_prefix}/lib)
+eval libdir="$libdir"
# Make sure srcdir is fully qualified!
srcdir=`cd $srcdir ; pwd`
+TK_SRC_DIR=`cd $srcdir/..; pwd`
- val="`cd $srcdir/..; pwd`"
+#------------------------------------------------------------------------
+# Compress and/or soft link the manpages?
+#------------------------------------------------------------------------
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_SRC_DIR" 1>&2; exit 1; }
- fi
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_SRC_DIR=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_SRC_DIR="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_SRC_DIR=$val
- ;;
- esac
+ echo $ac_n "checking whether to use symlinks for manpages""... $ac_c" 1>&6
+echo "configure:577: checking whether to use symlinks for manpages" >&5
+ # Check whether --enable-man-symlinks or --disable-man-symlinks was given.
+if test "${enable_man_symlinks+set}" = set; then
+ enableval="$enable_man_symlinks"
+ test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --symlinks"
+else
+ enableval="no"
+fi
+ echo "$ac_t""$enableval" 1>&6
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:601: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ echo $ac_n "checking compression for manpages""... $ac_c" 1>&6
+echo "configure:589: checking compression for manpages" >&5
+ # Check whether --enable-man-compression or --disable-man-compression was given.
+if test "${enable_man_compression+set}" = set; then
+ enableval="$enable_man_compression"
+ test "$enableval" = "yes" && echo && { echo "configure: error: missing argument to --enable-man-compression" 1>&2; exit 1; }
+ test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --compress $enableval"
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
-fi
+ enableval="no"
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
+
+ echo "$ac_t""$enableval" 1>&6
+
+
+
+
+#------------------------------------------------------------------------
+# Standard compiler checks
+#------------------------------------------------------------------------
+
+# If the user did not set CFLAGS, set it now to keep
+# the AC_PROG_CC macro from adding "-g -O2".
+if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:631: checking for $ac_word" >&5
+echo "configure:617: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -657,7 +643,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:661: checking for $ac_word" >&5
+echo "configure:647: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -708,7 +694,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:712: checking for $ac_word" >&5
+echo "configure:698: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -740,7 +726,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:744: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -751,12 +737,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 755 "configure"
+#line 741 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -782,12 +768,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:786: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:791: checking whether we are using GNU C" >&5
+echo "configure:777: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -796,7 +782,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -815,7 +801,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:819: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:805: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -847,8 +833,12 @@ else
fi
+#------------------------------------------------------------------------
+# I'm not sure why these need to come before all of the other tests
+#------------------------------------------------------------------------
+
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:852: checking how to run the C preprocessor" >&5
+echo "configure:842: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -863,13 +853,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 867 "configure"
+#line 857 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -880,13 +870,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 884 "configure"
+#line 874 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -897,13 +887,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 901 "configure"
+#line 891 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:907: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -931,17 +921,17 @@ for ac_hdr in unistd.h limits.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:935: checking for $ac_hdr" >&5
+echo "configure:925: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 940 "configure"
+#line 930 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -974,7 +964,7 @@ done
echo $ac_n "checking for building with threads""... $ac_c" 1>&6
-echo "configure:978: checking for building with threads" >&5
+echo "configure:968: checking for building with threads" >&5
# Check whether --enable-threads or --disable-threads was given.
if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
@@ -991,6 +981,12 @@ fi
#define TCL_THREADS 1
EOF
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+ cat >> confdefs.h <<\EOF
+#define USE_THREAD_ALLOC 1
+EOF
+
cat >> confdefs.h <<\EOF
#define _REENTRANT 1
EOF
@@ -1000,7 +996,7 @@ EOF
EOF
echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6
-echo "configure:1004: checking for pthread_mutex_init in -lpthread" >&5
+echo "configure:1000: checking for pthread_mutex_init in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1008,7 +1004,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1012 "configure"
+#line 1008 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1019,7 +1015,7 @@ int main() {
pthread_mutex_init()
; return 0; }
EOF
-if { (eval echo configure:1023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1047,7 +1043,7 @@ fi
# pthread.h, but that will work with libpthread really doesn't
# exist, like AIX 4.2. [Bug: 4359]
echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6
-echo "configure:1051: checking for __pthread_mutex_init in -lpthread" >&5
+echo "configure:1047: checking for __pthread_mutex_init in -lpthread" >&5
ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1055,7 +1051,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1059 "configure"
+#line 1055 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1066,7 +1062,7 @@ int main() {
__pthread_mutex_init()
; return 0; }
EOF
-if { (eval echo configure:1070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1094,7 +1090,7 @@ fi
THREADS_LIBS=" -lpthread"
else
echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6
-echo "configure:1098: checking for pthread_mutex_init in -lpthreads" >&5
+echo "configure:1094: checking for pthread_mutex_init in -lpthreads" >&5
ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1102,7 +1098,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpthreads $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1106 "configure"
+#line 1102 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1113,7 +1109,7 @@ int main() {
pthread_mutex_init()
; return 0; }
EOF
-if { (eval echo configure:1117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1139,7 +1135,7 @@ fi
THREADS_LIBS=" -lpthreads"
else
echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6
-echo "configure:1143: checking for pthread_mutex_init in -lc" >&5
+echo "configure:1139: checking for pthread_mutex_init in -lc" >&5
ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1147,7 +1143,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1151 "configure"
+#line 1147 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1158,7 +1154,7 @@ int main() {
pthread_mutex_init()
; return 0; }
EOF
-if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1180,8 +1176,54 @@ tcl_ok=no
fi
if test "$tcl_ok" = "no"; then
- TCL_THREADS=0
- echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2
+ echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6
+echo "configure:1181: checking for pthread_mutex_init in -lc_r" >&5
+ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lc_r $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1189 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char pthread_mutex_init();
+
+int main() {
+pthread_mutex_init()
+; return 0; }
+EOF
+if { (eval echo configure:1200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ tcl_ok=yes
+else
+ echo "$ac_t""no" 1>&6
+tcl_ok=no
+fi
+
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2
+ fi
fi
fi
fi
@@ -1192,12 +1234,67 @@ fi
for ac_func in pthread_attr_setstacksize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1196: checking for $ac_func" >&5
+echo "configure:1238: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1243 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* 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
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in readdir_r
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1293: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1201 "configure"
+#line 1298 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1220,7 +1317,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1248,6 +1345,7 @@ done
TCL_THREADS=0
echo "$ac_t""no (default)" 1>&6
fi
+
#------------------------------------------------------------------------------
@@ -1258,18 +1356,18 @@ done
if test -z "$no_pipe"; then
if test -n "$GCC"; then
echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6
-echo "configure:1262: checking if the compiler understands -pipe" >&5
+echo "configure:1360: checking if the compiler understands -pipe" >&5
OLDCC="$CC"
CC="$CC -pipe"
cat > conftest.$ac_ext <<EOF
-#line 1266 "configure"
+#line 1364 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
else
@@ -1284,6 +1382,281 @@ fi
fi
#--------------------------------------------------------------------
+# Detect what compiler flags to set for 64-bit support.
+#--------------------------------------------------------------------
+
+
+ echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6
+echo "configure:1391: checking for required early compiler flags" >&5
+ tcl_flags=""
+
+ if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1398 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int main() {
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+; return 0; }
+EOF
+if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_flag__isoc99_source=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 1413 "configure"
+#include "confdefs.h"
+#define _ISOC99_SOURCE 1
+#include <stdlib.h>
+int main() {
+char *p = (char *)strtoll; char *q = (char *)strtoull;
+; return 0; }
+EOF
+if { (eval echo configure:1421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_flag__isoc99_source=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ tcl_cv_flag__isoc99_source=no
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+
+ if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then
+ cat >> confdefs.h <<\EOF
+#define _ISOC99_SOURCE 1
+EOF
+
+ tcl_flags="$tcl_flags _ISOC99_SOURCE"
+ fi
+
+ if eval "test \"`echo '$''{'tcl_cv_flag__largefile64_source'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1447 "configure"
+#include "confdefs.h"
+#include <sys/stat.h>
+int main() {
+struct stat64 buf; int i = stat64("/", &buf);
+; return 0; }
+EOF
+if { (eval echo configure:1454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_flag__largefile64_source=no
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ cat > conftest.$ac_ext <<EOF
+#line 1462 "configure"
+#include "confdefs.h"
+#define _LARGEFILE64_SOURCE 1
+#include <sys/stat.h>
+int main() {
+struct stat64 buf; int i = stat64("/", &buf);
+; return 0; }
+EOF
+if { (eval echo configure:1470: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_flag__largefile64_source=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ tcl_cv_flag__largefile64_source=no
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+
+ if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then
+ cat >> confdefs.h <<\EOF
+#define _LARGEFILE64_SOURCE 1
+EOF
+
+ tcl_flags="$tcl_flags _LARGEFILE64_SOURCE"
+ fi
+ if test "x${tcl_flags}" = "x" ; then
+ echo "$ac_t""none" 1>&6
+ else
+ echo "$ac_t""${tcl_flags}" 1>&6
+ fi
+
+
+ echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6
+echo "configure:1499: checking for 64-bit integer type" >&5
+ if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1505 "configure"
+#include "confdefs.h"
+
+int main() {
+__int64 value = (__int64) 0;
+; return 0; }
+EOF
+if { (eval echo configure:1512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_type_64bit=__int64
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ tcl_cv_type_64bit=none
+ if test "$cross_compiling" = yes; then
+ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1524 "configure"
+#include "confdefs.h"
+#include <unistd.h>
+ int main() {exit(!(sizeof(long long) > sizeof(long)));}
+
+EOF
+if { (eval echo configure:1530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ tcl_cv_type_64bit="long long"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -fr conftest*
+fi
+
+fi
+rm -f conftest*
+fi
+
+ if test "${tcl_cv_type_64bit}" = none ; then
+ echo "$ac_t""using long" 1>&6
+ else
+ cat >> confdefs.h <<EOF
+#define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit}
+EOF
+
+ echo "$ac_t""${tcl_cv_type_64bit}" 1>&6
+
+ # Now check for auxiliary declarations
+ echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6
+echo "configure:1555: checking for struct dirent64" >&5
+ if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1561 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/dirent.h>
+int main() {
+struct dirent64 p;
+; return 0; }
+EOF
+if { (eval echo configure:1569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_struct_dirent64=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ tcl_cv_struct_dirent64=no
+fi
+rm -f conftest*
+fi
+
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_DIRENT64 1
+EOF
+
+ fi
+ echo "$ac_t""${tcl_cv_struct_dirent64}" 1>&6
+
+ echo $ac_n "checking for struct stat64""... $ac_c" 1>&6
+echo "configure:1590: checking for struct stat64" >&5
+ if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1596 "configure"
+#include "confdefs.h"
+#include <sys/stat.h>
+int main() {
+struct stat64 p;
+
+; return 0; }
+EOF
+if { (eval echo configure:1604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_struct_stat64=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ tcl_cv_struct_stat64=no
+fi
+rm -f conftest*
+fi
+
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_STAT64 1
+EOF
+
+ fi
+ echo "$ac_t""${tcl_cv_struct_stat64}" 1>&6
+
+ echo $ac_n "checking for off64_t""... $ac_c" 1>&6
+echo "configure:1625: checking for off64_t" >&5
+ if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ cat > conftest.$ac_ext <<EOF
+#line 1631 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int main() {
+off64_t offset;
+
+; return 0; }
+EOF
+if { (eval echo configure:1639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ tcl_cv_type_off64_t=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ tcl_cv_type_off64_t=no
+fi
+rm -f conftest*
+fi
+
+ if test "x${tcl_cv_type_off64_t}" = "xyes" ; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_TYPE_OFF64_T 1
+EOF
+
+ fi
+ echo "$ac_t""${tcl_cv_type_off64_t}" 1>&6
+ fi
+
+#--------------------------------------------------------------------
# Find and load the tclConfig.sh file
#--------------------------------------------------------------------
@@ -1304,13 +1677,13 @@ if test "${with_tcl+set}" = set; then
fi
echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:1308: checking for Tcl configuration" >&5
+echo "configure:1681: checking for Tcl configuration" >&5
if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- # First check to see if --with-tclconfig was specified.
+ # First check to see if --with-tcl was specified.
if test x"${with_tclconfig}" != x ; then
if test -f "${with_tclconfig}/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
@@ -1332,17 +1705,16 @@ else
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
fi
- if test -f "$i/win/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/win; pwd)`
- break
- fi
done
fi
# check in a few common install locations
if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` ; do
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ ; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
@@ -1358,11 +1730,7 @@ else
if test -f "$i/unix/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
- fi
- if test -f "$i/win/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/win; pwd)`
- break
- fi
+ fi
done
fi
@@ -1371,7 +1739,7 @@ fi
if test x"${ac_cv_c_tclconfig}" = x ; then
TCL_BIN_DIR="# no Tcl configs found"
- { echo "configure: error: Can't find Tcl configuration definitions" 1>&2; exit 1; }
+ echo "configure: warning: Can't find Tcl configuration definitions" 1>&2
exit 0
else
no_tcl=
@@ -1382,7 +1750,7 @@ fi
echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6
-echo "configure:1386: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
+echo "configure:1754: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
echo "$ac_t""loading" 1>&6
@@ -1392,12 +1760,39 @@ echo "configure:1386: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
fi
#
- # The eval is required to do the TCL_DBGX substitution in the
- # TCL_LIB_FILE variable
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f $TCL_BIN_DIR/Makefile ; then
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
+ fi
+
+ #
+ # eval is required to do the TCL_DBGX substitution
#
- eval TCL_LIB_FILE=${TCL_LIB_FILE}
- eval TCL_LIB_FLAG=${TCL_LIB_FLAG}
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+
+
+
+
+
+
+
@@ -1409,11 +1804,73 @@ echo "configure:1386: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
#--------------------------------------------------------------------
+ echo $ac_n "checking how to build libraries""... $ac_c" 1>&6
+echo "configure:1809: checking how to build libraries" >&5
+ # Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+else
+ tcl_ok=yes
+fi
+
+
+ if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ tcl_ok=$enableval
+ else
+ tcl_ok=yes
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ echo "$ac_t""shared" 1>&6
+ SHARED_BUILD=1
+ else
+ echo "$ac_t""static" 1>&6
+ SHARED_BUILD=0
+ cat >> confdefs.h <<\EOF
+#define STATIC_BUILD 1
+EOF
+
+ fi
+
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1842: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
# Step 0.a: Enable 64 bit support?
echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6
-echo "configure:1417: checking if 64bit support is requested" >&5
+echo "configure:1874: checking if 64bit support is requested" >&5
# Check whether --enable-64bit or --disable-64bit was given.
if test "${enable_64bit+set}" = set; then
enableval="$enable_64bit"
@@ -1433,7 +1890,7 @@ fi
# Step 0.b: Enable Solaris 64 bit VIS support?
echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6
-echo "configure:1437: checking if 64bit Sparc VIS support is requested" >&5
+echo "configure:1894: checking if 64bit Sparc VIS support is requested" >&5
# Check whether --enable-64bit-vis or --disable-64bit-vis was given.
if test "${enable_64bit_vis+set}" = set; then
enableval="$enable_64bit_vis"
@@ -1457,7 +1914,7 @@ fi
# there are a few systems, like Next, where this doesn't work.
echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6
-echo "configure:1461: checking system version (for dynamic loading)" >&5
+echo "configure:1918: checking system version (for dynamic loading)" >&5
if test -f /usr/lib/NextStep/software_version; then
system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
else
@@ -1479,21 +1936,11 @@ echo "configure:1461: checking system version (for dynamic loading)" >&5
fi
fi
- echo $ac_n "checking if gcc is being used""... $ac_c" 1>&6
-echo "configure:1484: checking if gcc is being used" >&5
- if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- using_gcc="yes"
- else
- using_gcc="no"
- fi
-
- echo "$ac_t""$using_gcc ($CC)" 1>&6
-
# Step 2: check for existence of -ldl library. This is needed because
# Linux can use either -ldl or -ldld for dynamic loading.
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1497: checking for dlopen in -ldl" >&5
+echo "configure:1944: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1501,7 +1948,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1505 "configure"
+#line 1952 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1512,7 +1959,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:1516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1537,7 +1984,6 @@ fi
# Step 3: set configuration options based on system name and version.
do64bit_ok=no
- fullSrcDir=`cd $srcdir; pwd`
EXTRA_CFLAGS=""
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
@@ -1546,7 +1992,7 @@ fi
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
- if test "$using_gcc" = "yes" ; then
+ if test "$GCC" = "yes" ; then
CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
else
CFLAGS_WARNING=""
@@ -1557,7 +2003,7 @@ fi
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1561: checking for $ac_word" >&5
+echo "configure:2007: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1584,45 +2030,150 @@ else
fi
STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ PLAT_OBJS=""
case $system in
- AIX-4.[2-9])
- if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then
+ AIX-5.*)
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
if test "${CC}" != "cc_r" ; then
CC=${CC}_r
fi
echo "$ac_t""Using $CC for compiling with threads" 1>&6
fi
+ LIBS="$LIBS -lc"
+ # AIX-5 uses ELF style dynamic libraries
SHLIB_CFLAGS=""
- SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+
+ # Note: need the LIBS below, otherwise Tk won't find Tcl's
+ # symbols when dynamically loaded into tclsh.
+
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
+ # AIX-5 has dl* in libc.so
+ DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
+
+ if test "$GCC" = "yes" ; then
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ else
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ fi
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
+ else
+ do64bit_ok=yes
+ EXTRA_CFLAGS="-q64"
+ LDFLAGS="-q64"
+ fi
+ fi
;;
AIX-*)
- if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
if test "${CC}" != "cc_r" ; then
CC=${CC}_r
fi
echo "$ac_t""Using $CC for compiling with threads" 1>&6
fi
+ LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
- SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
+ SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
- LIBOBJS="$LIBOBJS tclLoadAix.o"
- DL_LIBS="-lld"
+ DL_LIBS="-ldl"
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ LD_LIBRARY_PATH_VAR="LIBPATH"
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
+
+ # AIX v<=4.1 has some different flags than 4.2+
+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
+ LIBOBJS="$LIBOBJS tclLoadAix.o"
+ DL_LIBS="-lld"
+ fi
+
+ # On AIX <=v4 systems, libbsd.a has to be linked in to support
+ # non-blocking file IO. This library has to be linked in after
+ # the MATH_LIBS or it breaks the pow() function. The way to
+ # insure proper sequencing, is to add it to the tail of MATH_LIBS.
+ # This library also supplies gettimeofday.
+ #
+ # AIX does not have a timezone field in struct tm. When the AIX
+ # bsd library is used, the timezone global and the gettimeofday
+ # methods are to be avoided for timezone deduction instead, we
+ # deduce the timezone by comparing the localtime result on a
+ # known GMT value.
+
+ echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
+echo "configure:2120: checking for gettimeofday in -lbsd" >&5
+ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lbsd $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2128 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gettimeofday();
+
+int main() {
+gettimeofday()
+; return 0; }
+EOF
+if { (eval echo configure:2139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ libbsd=yes
+else
+ echo "$ac_t""no" 1>&6
+libbsd=no
+fi
+
+ if test $libbsd = yes; then
+ MATH_LIBS="$MATH_LIBS -lbsd"
+ cat >> confdefs.h <<\EOF
+#define USE_DELTA_FOR_TZ 1
+EOF
+
+ fi
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
+ else
+ do64bit_ok=yes
+ EXTRA_CFLAGS="-q64"
+ LDFLAGS="-q64"
+ fi
+ fi
;;
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
@@ -1632,6 +2183,7 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
BSD/OS-4.*)
@@ -1642,6 +2194,7 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-export-dynamic"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
dgux*)
@@ -1652,12 +2205,19 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
- HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*|HP-UX-*.11.*)
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+ cat >> confdefs.h <<\EOF
+#define _XOPEN_SOURCE_EXTENDED 1
+EOF
+
+
SHLIB_SUFFIX=".sl"
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:1661: checking for shl_load in -ldld" >&5
+echo "configure:2221: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1665,7 +2225,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1669 "configure"
+#line 2229 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1676,7 +2236,88 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:1680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ tcl_ok=yes
+else
+ echo "$ac_t""no" 1>&6
+tcl_ok=no
+fi
+
+ if test "$tcl_ok" = yes; then
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+ SHLIB_LD_LIBS='${LIBS}'
+ DL_OBJS="tclLoadShl.o"
+ DL_LIBS="-ldld"
+ LDFLAGS="-Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+ fi
+
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #EXTRA_CFLAGS="+DAportable"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ hpux_arch='`gcc -dumpmachine`'
+ case $hpux_arch in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD="gcc -shared"
+ SHLIB_LD_LIBS=""
+ LD_SEARCH_FLAGS=''
+ ;;
+ *)
+ echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
+ ;;
+ esac
+ else
+ do64bit_ok=yes
+ EXTRA_CFLAGS="+DA2.0W"
+ LDFLAGS="+DA2.0W $LDFLAGS"
+ fi
+ fi
+ ;;
+ HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
+ SHLIB_SUFFIX=".sl"
+ echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+echo "configure:2302: checking for shl_load in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2310 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load();
+
+int main() {
+shl_load()
+; return 0; }
+EOF
+if { (eval echo configure:2321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1704,7 +2345,9 @@ fi
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="-Wl,-E"
- LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
;;
IRIX-4.*)
@@ -1715,18 +2358,32 @@ fi
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
;;
- IRIX-5.*|IRIX-6.*|IRIX64-6.5*)
+ IRIX-5.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -shared -rdata_shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ EXTRA_CFLAGS=""
+ LDFLAGS=""
+ ;;
+ IRIX-6.*|IRIX64-6.5*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- if test "$using_gcc" = "yes" ; then
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
EXTRA_CFLAGS="-mabi=n32"
LDFLAGS="-mabi=n32"
else
@@ -1744,13 +2401,28 @@ fi
;;
IRIX64-6.*)
SHLIB_CFLAGS=""
- SHLIB_LD="ld -32 -shared -rdata_shared"
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ echo "configure: warning: 64bit mode not supported by gcc" 1>&2
+ else
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ EXTRA_CFLAGS="-64"
+ LDFLAGS="-64"
+ fi
+ fi
+
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
@@ -1768,21 +2440,22 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-rdynamic"
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
else
ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dld.h""... $ac_c" 1>&6
-echo "configure:1776: checking for dld.h" >&5
+echo "configure:2449: checking for dld.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1781 "configure"
+#line 2454 "configure"
#include "confdefs.h"
#include <dld.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1803,6 +2476,76 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
DL_OBJS="tclLoadDld.o"
DL_LIBS="-ldld"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ if test "`uname -m`" = "alpha" ; then
+ EXTRA_CFLAGS="-mieee"
+ fi
+
+ # The combo of gcc + glibc has a bug related
+ # to inlining of functions like strtod(). The
+ # -fno-builtin flag should address this problem
+ # but it does not work. The -fno-inline flag
+ # is kind of overkill but it works.
+ # Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+ if test x"${LIBOBJS}" != x ; then
+ EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
+ fi
+
+ ;;
+ GNU*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+
+ if test "$have_dl" = yes; then
+ SHLIB_LD="${CC} -shared"
+ DL_OBJS=""
+ DL_LIBS="-ldl"
+ LDFLAGS="-rdynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ else
+ ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for dld.h""... $ac_c" 1>&6
+echo "configure:2518: checking for dld.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2523 "configure"
+#include "confdefs.h"
+#include <dld.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+
+ SHLIB_LD="ld -shared"
+ DL_OBJS=""
+ DL_LIBS="-ldld"
+ LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
else
echo "$ac_t""no" 1>&6
@@ -1821,6 +2564,7 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
MP-RAS-*)
@@ -1831,23 +2575,24 @@ fi
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-Wl,-Bexport"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[1-2].*|OpenBSD-*)
# Not available on all versions: check for include file.
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:1841: checking for dlfcn.h" >&5
+echo "configure:2586: checking for dlfcn.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1846 "configure"
+#line 2591 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2596: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1872,11 +2617,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
echo $ac_n "checking for ELF""... $ac_c" 1>&6
-echo "configure:1878: checking for ELF" >&5
+echo "configure:2624: checking for ELF" >&5
cat > conftest.$ac_ext <<EOF
-#line 1880 "configure"
+#line 2626 "configure"
#include "confdefs.h"
#ifdef __ELF__
@@ -1908,7 +2654,8 @@ else
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
fi
@@ -1923,12 +2670,47 @@ fi
# FreeBSD 3.* and greater have ELF.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS=""
+ SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="-export-dynamic"
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "${TCL_THREADS}" = "1" ; then
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ EXTRA_CFLAGS="-pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ fi
+ case $system in
+ FreeBSD-3.*)
+ # FreeBSD-3 doesn't handle version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ esac
+ ;;
+ Rhapsody-*|Darwin-*)
+ SHLIB_CFLAGS="-fno-common"
+ SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
+ TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000"
+ TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TK_LIB_FILE} -prebind -seg1addr 0xb000000"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".dylib"
+ DL_OBJS="tclLoadDyld.o"
+ PLAT_OBJS="tclMacOSXBundle.o"
+ DL_LIBS=""
+ LDFLAGS="-prebind"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
+ CFLAGS_OPTIMIZE="-Os"
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # for compatibility with autoconf vers 2.13 :
+ HACK=""
+ EXTRA_CFLAGS="-DMA${HACK}C_OSX_TCL -DHAVE_CFBUNDLE -DTCL_DEFAULT_ENCODING=\\\"utf-8\\\""
+ LIBS="$LIBS -framework CoreFoundation"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
@@ -1938,6 +2720,7 @@ fi
DL_OBJS="tclLoadNext.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OS/390-*)
@@ -1957,45 +2740,71 @@ EOF
DL_OBJS="tclLoadOSF.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="ld -shared"
+ if test "$SHARED_BUILD" = "1" ; then
+ SHLIB_LD="ld -shared"
+ else
+ SHLIB_LD="ld -non_shared"
+ fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
- SHLIB_LD='ld -shared -expect_unresolved "*"'
+ if test "$SHARED_BUILD" = "1" ; then
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+ else
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+ fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- if test "$using_gcc" = "no" ; then
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "$GCC" != "yes" ; then
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
fi
# see pthread_intro(3) for pthread support on osf1, k.furukawa
if test "${TCL_THREADS}" = "1" ; then
+ EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
- if test "$using_gcc" = "no" ; then
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ if test "$GCC" = "yes" ; then
+ LIBS="$LIBS -lpthread -lmach -lexc"
+ else
EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread"
LDFLAGS="-pthread"
- else
- LIBS=`echo $LIBS | sed s/-lpthreads//`
- LIBS="$LIBS -lpthread -lmach -lexc"
fi
fi
;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ # dlopen is in -lc on QNX
+ DL_LIBS=""
+ LDFLAGS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
RISCos-*)
SHLIB_CFLAGS="-G 0"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
@@ -2004,13 +2813,14 @@ EOF
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
SCO_SV-3.2*)
# 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.
- if test "$using_gcc" = "yes" ; then
+ if test "$GCC" = "yes" ; then
SHLIB_CFLAGS="-fPIC -melf"
LDFLAGS="-melf -Wl,-Bexport"
else
@@ -2022,7 +2832,7 @@ EOF
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LDFLAGS="-belf -Wl,-Bexport"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SINIX*5.4*)
@@ -2033,6 +2843,7 @@ EOF
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SunOS-4*)
@@ -2043,7 +2854,8 @@ EOF
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
# SunOS can't handle version numbers with dots in them in library
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
@@ -2055,8 +2867,20 @@ EOF
TCL_LIB_VERSIONS_OK=nodots
;;
SunOS-5.[0-6]*)
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+EOF
+
+
SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
@@ -2066,18 +2890,40 @@ EOF
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="$CC -shared"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ else
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ fi
;;
SunOS-5*)
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ cat >> confdefs.h <<\EOF
+#define _REENTRANT 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _POSIX_PTHREAD_SEMANTICS 1
+EOF
+
+
SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
LDFLAGS=""
- do64bit_ok=no
+ # Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
arch=`isainfo`
if test "$arch" = "sparcv9 sparc" ; then
- if test "$using_gcc" = "no" ; then
+ if test "$GCC" = "yes" ; then
+ echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
+ else
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
EXTRA_CFLAGS="-xarch=v9a"
@@ -2086,8 +2932,6 @@ EOF
EXTRA_CFLAGS="-xarch=v9"
LDFLAGS="-xarch=v9"
fi
- else
- echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2
fi
else
echo "configure: warning: "64bit mode only supported sparcv9 system"" 1>&2
@@ -2101,9 +2945,13 @@ EOF
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
- if test "$using_gcc" = "yes" ; then
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="$CC -shared"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
else
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
@@ -2115,8 +2963,9 @@ EOF
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- if test "$using_gcc" = "no" ; then
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$GCC" != "yes" ; then
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
fi
;;
@@ -2131,17 +2980,17 @@ EOF
# that don't grok the -Bexport option. Test that it does.
hold_ldflags=$LDFLAGS
echo $ac_n "checking for ld accepts -Bexport flag""... $ac_c" 1>&6
-echo "configure:2135: checking for ld accepts -Bexport flag" >&5
+echo "configure:2984: checking for ld accepts -Bexport flag" >&5
LDFLAGS="${LDFLAGS} -Wl,-Bexport"
cat > conftest.$ac_ext <<EOF
-#line 2138 "configure"
+#line 2987 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
found=yes
else
@@ -2158,6 +3007,7 @@ rm -f conftest*
else
LDFLAGS=""
fi
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
esac
@@ -2187,9 +3037,9 @@ rm -f conftest*
if test "x$DL_OBJS" = "xtclLoadAout.o" ; then
echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6
-echo "configure:2191: checking sys/exec.h" >&5
+echo "configure:3041: checking sys/exec.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2193 "configure"
+#line 3043 "configure"
#include "confdefs.h"
#include <sys/exec.h>
int main() {
@@ -2207,7 +3057,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:2211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
tcl_ok=usable
else
@@ -2225,9 +3075,9 @@ EOF
else
echo $ac_n "checking a.out.h""... $ac_c" 1>&6
-echo "configure:2229: checking a.out.h" >&5
+echo "configure:3079: checking a.out.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2231 "configure"
+#line 3081 "configure"
#include "confdefs.h"
#include <a.out.h>
int main() {
@@ -2245,7 +3095,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:2249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
tcl_ok=usable
else
@@ -2263,9 +3113,9 @@ EOF
else
echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6
-echo "configure:2267: checking sys/exec_aout.h" >&5
+echo "configure:3117: checking sys/exec_aout.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2269 "configure"
+#line 3119 "configure"
#include "confdefs.h"
#include <sys/exec_aout.h>
int main() {
@@ -2283,7 +3133,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:2287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
tcl_ok=usable
else
@@ -2331,6 +3181,7 @@ fi
DL_OBJS="tclLoadNone.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
BUILD_DLTEST=""
fi
@@ -2340,7 +3191,7 @@ fi
# standard manufacturer compiler.
if test "$DL_OBJS" != "tclLoadNone.o" ; then
- if test "$using_gcc" = "yes" ; then
+ if test "$GCC" = "yes" ; then
case $system in
AIX-*)
;;
@@ -2350,6 +3201,8 @@ fi
;;
NetBSD-*|FreeBSD-*|OpenBSD-*)
;;
+ Rhapsody-*|Darwin-*)
+ ;;
RISCos-*)
;;
SCO_SV-3.2*)
@@ -2370,20 +3223,71 @@ fi
UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
fi
-# CYGNUS LOCAL
- TCL_LIB_SUFFIX=.a
-# END CYGNUS LOCAL
+
+ if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
+ LIB_SUFFIX=${SHARED_LIB_SUFFIX}
+ MAKE_LIB='${SHLIB_LD} -o $@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ else
+ LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
+
+ if test "$RANLIB" = "" ; then
+ MAKE_LIB='$(STLIB_LD) $@ ${OBJS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ else
+ MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
+ fi
+
+ fi
+
+
+ # Stub lib does not depend on shared/static configuration
+ if test "$RANLIB" = "" ; then
+ MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)'
+ else
+ MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))'
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
-echo "configure:2387: checking for build with symbols" >&5
+echo "configure:3291: checking for build with symbols" >&5
# Check whether --enable-symbols or --disable-symbols was given.
if test "${enable_symbols+set}" = set; then
enableval="$enable_symbols"
@@ -2392,6 +3296,7 @@ else
tcl_ok=no
fi
+# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
if test "$tcl_ok" = "yes"; then
CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
@@ -2403,6 +3308,8 @@ fi
DBGX=""
echo "$ac_t""no" 1>&6
fi
+
+
LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
@@ -2426,12 +3333,12 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for sin""... $ac_c" 1>&6
-echo "configure:2430: checking for sin" >&5
+echo "configure:3337: checking for sin" >&5
if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2435 "configure"
+#line 3342 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char sin(); below. */
@@ -2454,7 +3361,7 @@ sin();
; return 0; }
EOF
-if { (eval echo configure:2458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_sin=yes"
else
@@ -2475,7 +3382,7 @@ MATH_LIBS="-lm"
fi
echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6
-echo "configure:2479: checking for main in -lieee" >&5
+echo "configure:3386: checking for main in -lieee" >&5
ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2483,14 +3390,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lieee $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2487 "configure"
+#line 3394 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2521,7 +3428,7 @@ fi
libbsd=no
if test "`uname -s`" = "AIX" ; then
echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6
-echo "configure:2525: checking for gettimeofday in -lbsd" >&5
+echo "configure:3432: checking for gettimeofday in -lbsd" >&5
ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2529,7 +3436,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbsd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2533 "configure"
+#line 3440 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2540,7 +3447,7 @@ int main() {
gettimeofday()
; return 0; }
EOF
-if { (eval echo configure:2544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2571,9 +3478,9 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking stdlib.h""... $ac_c" 1>&6
-echo "configure:2575: checking stdlib.h" >&5
+echo "configure:3482: checking stdlib.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2577 "configure"
+#line 3484 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2588,7 +3495,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2592 "configure"
+#line 3499 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2602,7 +3509,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 2606 "configure"
+#line 3513 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2634,16 +3541,16 @@ echo "$ac_t""$tk_ok" 1>&6
#--------------------------------------------------------------------
echo $ac_n "checking fd_set and sys/select""... $ac_c" 1>&6
-echo "configure:2638: checking fd_set and sys/select" >&5
+echo "configure:3545: checking fd_set and sys/select" >&5
cat > conftest.$ac_ext <<EOF
-#line 2640 "configure"
+#line 3547 "configure"
#include "confdefs.h"
#include <sys/types.h>
int main() {
fd_set readMask, writeMask;
; return 0; }
EOF
-if { (eval echo configure:2647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
tk_ok=yes
else
@@ -2655,7 +3562,7 @@ fi
rm -f conftest*
if test $tk_ok = no; then
cat > conftest.$ac_ext <<EOF
-#line 2659 "configure"
+#line 3566 "configure"
#include "confdefs.h"
#include <sys/select.h>
EOF
@@ -2687,12 +3594,12 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2691: checking for ANSI C header files" >&5
+echo "configure:3598: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2696 "configure"
+#line 3603 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2700,7 +3607,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2717,7 +3624,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2721 "configure"
+#line 3628 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2735,7 +3642,7 @@ 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 <<EOF
-#line 2739 "configure"
+#line 3646 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2756,7 +3663,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2760 "configure"
+#line 3667 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2767,7 +3674,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2791,12 +3698,12 @@ EOF
fi
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:2795: checking for mode_t" >&5
+echo "configure:3702: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2800 "configure"
+#line 3707 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2824,12 +3731,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2828: checking for pid_t" >&5
+echo "configure:3735: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2833 "configure"
+#line 3740 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2857,12 +3764,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2861: checking for size_t" >&5
+echo "configure:3768: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2866 "configure"
+#line 3773 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2890,12 +3797,12 @@ EOF
fi
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2894: checking for uid_t in sys/types.h" >&5
+echo "configure:3801: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2899 "configure"
+#line 3806 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2932,17 +3839,17 @@ for ac_hdr in sys/time.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2936: checking for $ac_hdr" >&5
+echo "configure:3843: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2941 "configure"
+#line 3848 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2969,12 +3876,12 @@ fi
done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2973: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3880: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2978 "configure"
+#line 3885 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2983,7 +3890,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -3009,16 +3916,16 @@ fi
#-------------------------------------------
echo $ac_n "checking pw_gecos in struct pwd""... $ac_c" 1>&6
-echo "configure:3013: checking pw_gecos in struct pwd" >&5
+echo "configure:3920: checking pw_gecos in struct pwd" >&5
cat > conftest.$ac_ext <<EOF
-#line 3015 "configure"
+#line 3922 "configure"
#include "confdefs.h"
#include <pwd.h>
int main() {
struct passwd pwd; pwd.pw_gecos;
; return 0; }
EOF
-if { (eval echo configure:3022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
tk_ok=yes
else
@@ -3051,7 +3958,7 @@ fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:3055: checking for X" >&5
+echo "configure:3962: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -3113,12 +4020,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 3117 "configure"
+#line 4024 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3122: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3187,14 +4094,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3191 "configure"
+#line 4098 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:3198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@@ -3284,12 +4191,12 @@ fi
if test "$no_x" = ""; then
if test "$x_includes" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3288 "configure"
+#line 4195 "configure"
#include "confdefs.h"
#include <X11/XIntrinsic.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4200: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -3309,51 +4216,51 @@ rm -f conftest*
fi
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
echo $ac_n "checking for X11 header files""... $ac_c" 1>&6
-echo "configure:3313: checking for X11 header files" >&5
- XINCLUDES="# no special path needed"
+echo "configure:4220: checking for X11 header files" >&5
+ found_xincludes="no"
cat > conftest.$ac_ext <<EOF
-#line 3316 "configure"
+#line 4223 "configure"
#include "confdefs.h"
#include <X11/Intrinsic.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
- :
+ rm -rf conftest*
+ found_xincludes="yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- XINCLUDES="nope"
+ found_xincludes="no"
fi
rm -f conftest*
- if test "$XINCLUDES" = nope; then
+ if test "$found_xincludes" = "no"; then
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
for i in $dirs ; do
if test -r $i/X11/Intrinsic.h; then
echo "$ac_t""$i" 1>&6
XINCLUDES=" -I$i"
+ found_xincludes="yes"
break
fi
done
fi
else
if test "$x_includes" != ""; then
- XINCLUDES=-I$x_includes
- else
- XINCLUDES="# no special path needed"
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
fi
fi
- if test "$XINCLUDES" = nope; then
+ if test found_xincludes = "no"; then
echo "$ac_t""couldn't find any!" 1>&6
- XINCLUDES="# no include files found"
fi
if test "$no_x" = yes; then
echo $ac_n "checking for X11 libraries""... $ac_c" 1>&6
-echo "configure:3357: checking for X11 libraries" >&5
+echo "configure:4264: checking for X11 libraries" >&5
XLIBSW=nope
dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
for i in $dirs ; do
@@ -3373,7 +4280,7 @@ echo "configure:3357: checking for X11 libraries" >&5
fi
if test "$XLIBSW" = nope ; then
echo $ac_n "checking for XCreateWindow in -lXwindow""... $ac_c" 1>&6
-echo "configure:3377: checking for XCreateWindow in -lXwindow" >&5
+echo "configure:4284: checking for XCreateWindow in -lXwindow" >&5
ac_lib_var=`echo Xwindow'_'XCreateWindow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3381,7 +4288,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXwindow $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3385 "configure"
+#line 4292 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3392,7 +4299,7 @@ int main() {
XCreateWindow()
; return 0; }
EOF
-if { (eval echo configure:3396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3441,91 +4348,11 @@ if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
fi
# The statement below is very tricky! It actually *evaluates* the
-# string in TCL_LD_SEARCH_FLAGS, which causes a substitution of the
-# variable LIB_RUNTIME_DIR.
-
-eval "TK_CC_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
-
-#
-# CYGNUS LOCAL: statically link on Solaris, HPUX & SunOS so that
-# we don't have problems with people not having libraries
-# installed or not having LD_LIBRARY_PATH set.
-#
-
- case "$host" in
-#
-# gdb linked statically w/ Solaris iff GCC and GNU ld are used,
-# otherwise dynamic
-#
- sparc-sun-solaris2*)
- sol_xlibsw=
- if test "x$GCC" = "xyes" ; then
- # This is probably the simplest way to test for GNU ld.
- # It only works with relatively recent versions of GNU
- # ld.
- gld_text=`$CC -Wl,--version 2>&1 | sed 1q`
- case "$gld_text" in
- GNU* | *BFD*)
- # sol2.* has libX*.so files in /usr/lib,
- # but not libX*.a files, so we need to force a
- # -L/usr/openwin/lib option, sometimes.
- # FIXME: this won't work right if someone has
- # their own X libraries in say /usr/local/lib.
- case "$XLIBSW" in
- *-L*) ;;
- *) if test ! -f /usr/lib/libXt.a; then
- XLIBSW="-L/usr/openwin/lib $XLIBSW"
- fi
- ;;
- esac
-
- # Why do we link against libX11 twice? Because the
- # Openwin X11 and Xext libraries are seriously broken.
- sol_xlibsw="-Wl,-Bstatic $XLIBSW -lXext -lX11 -Wl,-Bdynamic"
- ;;
- esac
- fi
- if test -z "$sol_xlibsw"; then
- if test "x$x_libraries" != "x"; then
- XLIBSW="$XLIBSW -R$x_libraries"
- fi
- else
- XLIBSW=$sol_xlibsw
- suppress_enable_shared=yes
- fi
- ;;
-#
-# gdb linked statically w/ SunOS or HPUX
-#
- m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
- if test "x$x_libraries" != "x" ;
- then
- XLIBSW="$x_libraries/libX11.a"
- else
- XLIBSW="/usr/lib/libX11.a"
- fi
- suppress_enable_shared=yes
- ;;
-#
-# default is to link dynamically
-#
- *)
- ;;
- esac
-#
-# END CYGNUS LOCAL
-
-# The following case handles the differences between linking with "ld"
-# and the compiler
+# string in TCL_CC_SEARCH_FLAGS and TCL_LD_SEARCH_FLAGS which
+# causes a substitution of the variable LIB_RUNTIME_DIR.
-case $SHLIB_LD in
- *ld*)
- TK_LD_SEARCH_FLAGS=`echo ${TK_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"`
- ;;
- *)
- TK_LD_SEARCH_FLAGS="${TK_CC_SEARCH_FLAGS}"
- ;;
-esac
+eval "CC_SEARCH_FLAGS=\"$TCL_CC_SEARCH_FLAGS\""
+eval "LD_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
#--------------------------------------------------------------------
# Check for the existence of various libraries. The order here
@@ -3546,7 +4373,7 @@ esac
#--------------------------------------------------------------------
echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:3550: checking for main in -lXbsd" >&5
+echo "configure:4377: checking for main in -lXbsd" >&5
ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3554,14 +4381,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXbsd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3558 "configure"
+#line 4385 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3582,23 +4409,14 @@ else
fi
-# CYGNUS LOCAL: Store any socket library(ies) in the cache, and don't
-# mess up the cache values of the functions we check for.
-echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:3589: checking for socket libraries" >&5
-if eval "test \"`echo '$''{'tcl_cv_lib_sockets'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- tcl_cv_lib_sockets=
- tk_checkBoth=0
- unset ac_cv_func_connect
- echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3597: checking for connect" >&5
+tk_checkBoth=0
+echo $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:4415: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3602 "configure"
+#line 4420 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -3621,7 +4439,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:3625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@@ -3641,10 +4459,9 @@ else
tk_checkSocket=1
fi
- if test "$tk_checkSocket" = 1; then
- unset ac_cv_func_connect
- echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:3648: checking for main in -lsocket" >&5
+if test "$tk_checkSocket" = 1; then
+ echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
+echo "configure:4465: checking for main in -lsocket" >&5
ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3652,14 +4469,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3656 "configure"
+#line 4473 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3674,24 +4491,23 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- tcl_cv_lib_sockets="-lsocket"
+ LIBS="$LIBS -lsocket"
else
echo "$ac_t""no" 1>&6
tk_checkBoth=1
fi
- fi
- if test "$tk_checkBoth" = 1; then
- tk_oldLibs=$LIBS
- LIBS="$LIBS -lsocket -lnsl"
- unset ac_cv_func_accept
- echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:3690: checking for accept" >&5
+fi
+if test "$tk_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ echo $ac_n "checking for accept""... $ac_c" 1>&6
+echo "configure:4506: checking for accept" >&5
if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3695 "configure"
+#line 4511 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -3714,7 +4530,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:3718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_accept=yes"
else
@@ -3728,25 +4544,20 @@ fi
if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then
echo "$ac_t""yes" 1>&6
- tcl_checkNsl=0
- tcl_cv_lib_sockets="-lsocket -lnsl"
+ tk_checkNsl=0
else
echo "$ac_t""no" 1>&6
+LIBS=$tk_oldLibs
fi
- unset ac_cv_func_accept
- LIBS=$tk_oldLibs
- fi
- unset ac_cv_func_gethostbyname
- tk_oldLibs=$LIBS
- LIBS="$LIBS $tk_cv_lib_sockets"
- echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3745: checking for gethostbyname" >&5
+fi
+echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
+echo "configure:4556: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3750 "configure"
+#line 4561 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -3769,7 +4580,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:3773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -3787,7 +4598,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:3791: checking for main in -lnsl" >&5
+echo "configure:4602: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3795,14 +4606,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3799 "configure"
+#line 4610 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3817,20 +4628,13 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- tcl_cv_lib_sockets="$tcl_cv_lib_sockets -lnsl"
+ LIBS="$LIBS -lnsl"
else
echo "$ac_t""no" 1>&6
fi
fi
- unset ac_cv_func_gethostbyname
- LIBS=$tcl_oldLIBS
-
-fi
-
-echo "$ac_t""$tcl_cv_lib_sockets" 1>&6
-test -z "$tcl_cv_lib_sockets" || LIBS="$LIBS $tcl_cv_lib_sockets"
# Add the threads support libraries
@@ -3849,13 +4653,13 @@ LIBS="$LIBS$THREADS_LIBS"
if test -d /usr/include/mit ; then
echo $ac_n "checking MIT X libraries""... $ac_c" 1>&6
-echo "configure:3853: checking MIT X libraries" >&5
+echo "configure:4657: checking MIT X libraries" >&5
tk_oldCFlags=$CFLAGS
CFLAGS="$CFLAGS -I/usr/include/mit"
tk_oldLibs=$LIBS
LIBS="$LIBS -lX11-mit"
cat > conftest.$ac_ext <<EOF
-#line 3859 "configure"
+#line 4663 "configure"
#include "confdefs.h"
#include <X11/Xlib.h>
@@ -3866,7 +4670,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:3870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
@@ -3893,12 +4697,12 @@ fi
MATH_LIBS=""
echo $ac_n "checking for sin""... $ac_c" 1>&6
-echo "configure:3897: checking for sin" >&5
+echo "configure:4701: checking for sin" >&5
if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3902 "configure"
+#line 4706 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char sin(); below. */
@@ -3921,7 +4725,7 @@ sin();
; return 0; }
EOF
-if { (eval echo configure:3925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_sin=yes"
else
@@ -3942,7 +4746,7 @@ MATH_LIBS="-lm"
fi
echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6
-echo "configure:3946: checking for main in -lieee" >&5
+echo "configure:4750: checking for main in -lieee" >&5
ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3950,14 +4754,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lieee $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3954 "configure"
+#line 4758 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3984,14 +4788,14 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3988: checking whether char is unsigned" >&5
+echo "configure:4792: checking whether char is unsigned" >&5
if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
-#line 3995 "configure"
+#line 4799 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -4013,7 +4817,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 4017 "configure"
+#line 4821 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -4023,7 +4827,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_c_char_unsigned=yes
else
@@ -4056,12 +4860,12 @@ fi
echo $ac_n "checking for strtod""... $ac_c" 1>&6
-echo "configure:4060: checking for strtod" >&5
+echo "configure:4864: checking for strtod" >&5
if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4065 "configure"
+#line 4869 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strtod(); below. */
@@ -4084,7 +4888,7 @@ strtod();
; return 0; }
EOF
-if { (eval echo configure:4088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_strtod=yes"
else
@@ -4106,44 +4910,53 @@ fi
if test "$tcl_strtod" = 1; then
echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6
-echo "configure:4110: checking for Solaris2.4/Tru64 strtod bugs" >&5
- if test "$cross_compiling" = yes; then
- tcl_ok=0
+echo "configure:4914: checking for Solaris2.4/Tru64 strtod bugs" >&5
+ if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+
+ if test "$cross_compiling" = yes; then
+ tcl_cv_strtod_buggy=0
else
cat > conftest.$ac_ext <<EOF
-#line 4115 "configure"
+#line 4923 "configure"
#include "confdefs.h"
- extern double strtod();
- int main()
- {
- char *string = "NaN", *spaceString = " ";
- char *term;
- double value;
- value = strtod(string, &term);
- if ((term != string) && (term[-1] == 0)) {
- exit(1);
- }
- value = strtod(spaceString, &term);
- if (term == (spaceString+1)) {
- exit(1);
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
}
- exit(0);
- }
EOF
-if { (eval echo configure:4135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
- tcl_ok=1
+ tcl_cv_strtod_buggy=1
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -fr conftest*
- tcl_ok=0
+ tcl_cv_strtod_buggy=0
fi
rm -fr conftest*
fi
- if test "$tcl_ok" = 1; then
+fi
+
+ if test "$tcl_cv_strtod_buggy" = 1; then
echo "$ac_t""ok" 1>&6
else
echo "$ac_t""buggy" 1>&6
@@ -4161,100 +4974,17 @@ EOF
# building libtk as a shared library instead of a static library.
#--------------------------------------------------------------------
-
- echo $ac_n "checking how to build libraries""... $ac_c" 1>&6
-echo "configure:4167: checking how to build libraries" >&5
- # Check whether --enable-shared or --disable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- tcl_ok=$enableval
-else
- tcl_ok=no
-fi
-
-
- if test "${enable_shared+set}" = set; then
- enableval="$enable_shared"
- tcl_ok=$enableval
- else
- tcl_ok=no
- fi
-
- if test "$tcl_ok" = "yes" ; then
- echo "$ac_t""shared" 1>&6
- SHARED_BUILD=1
- else
- echo "$ac_t""static" 1>&6
- SHARED_BUILD=0
- cat >> confdefs.h <<\EOF
-#define STATIC_BUILD 1
-EOF
-
- fi
-
-
eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
- TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
-
- libname=tk
- suffix=${TK_SHARED_LIB_SUFFIX}
-
- case "${host}" in
- *windows32* | *mingw32* | *cygwin*)
- eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- *)
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- esac
-
- eval "long_libname=${long_libname}"
-
- # Trick to replace DBGX with TCL_DBGX
- DBGX='${TCL_DBGX}'
- eval "long_libname=${long_libname}"
-
- TK_LIB_FILE=$long_libname
-
- MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${LIBS}"
- RANLIB=":"
-
-# TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
- TCL_STUB_FLAGS=""
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_STUB_LIB_SPEC}"
+ TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
else
- TK_SHLIB_CFLAGS=""
-
- libname=tk
- suffix=${TK_UNSHARED_LIB_SUFFIX}
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- else
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- fi
- ;;
- *)
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- esac
-
- eval "long_libname=${long_libname}"
-
- # Trick to replace DBGX with TCL_DBGX
- DBGX='${TCL_DBGX}'
- eval "long_libname=${long_libname}"
-
- TK_LIB_FILE=$long_libname
-
- MAKE_LIB="\${STLIB_LD} \${TK_LIB_FILE} \${OBJS}"
-
TCL_STUB_FLAGS=""
fi
+TK_LIB_FILE=libtk${LIB_SUFFIX}
+eval "TK_LIB_FILE=${TK_LIB_FILE}"
# Note: in the following variable, it's important to use the absolute
# path name of the Tcl directory rather than "..": this is because
@@ -4262,189 +4992,29 @@ fi
# up the Tcl library.
if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then
-
- libname=tk
- version=$TK_VERSION
-
- if test "$TCL_LIB_SUFFIX" = "" ; then
- { echo "configure: error: The TCL_LIB_SUFFIX variable is not defined" 1>&2; exit 1; }
- fi
-
- # If the . character is not allowed in lib name, remove it from version
- if test "${TCL_LIB_VERSIONS_OK}" != "ok"; then
- version=`echo $version | tr -d .`
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "short_libname=\"${TCL_VENDOR_PREFIX}${libname}${version}${TCL_LIB_SUFFIX}\""
- else
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}${TCL_DBGX}"
- fi
- ;;
- *)
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}\${TCL_DBGX}"
- ;;
- esac
-
- TK_LIB_FLAG=$short_libname
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="`pwd`/${TK_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_BUILD_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_BUILD_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_BUILD_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_BUILD_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=`pwd`
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_BUILD_LIB_SPEC="-L${dirname} ${TK_LIB_FLAG}"
- fi
- ;;
- *)
- TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
- ;;
- esac
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="${exec_prefix}/lib/${TK_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=${exec_prefix}/lib
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_LIB_SPEC="-L${dirname} ${TK_LIB_FLAG}"
- fi
- ;;
- *)
- TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_FLAG}"
- ;;
- esac
-
+ if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
+ else
+ eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
+ fi
+ TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
+ TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
TK_BUILD_EXP_FILE=""
TK_EXP_FILE=""
else
TK_BUILD_EXP_FILE="lib.exp"
eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}"
-
- TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
- TK_LIB_SPEC="-bI:${exec_prefix}/lib/${TK_EXP_FILE}"
+
+ if test "$GCC" = "yes" ; then
+ TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`"
+ TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`"
+ else
+ TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
+ TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}"
+ fi
fi
TK_SHARED_BUILD=${SHARED_BUILD}
-TK_BUILD_INCLUDES="-I`cd $srcdir/../generic; pwd`"
-
#--------------------------------------------------------------------
# The statements below define various symbols relating to creating
# the stub'd version of the Tk library
@@ -4454,300 +5024,21 @@ TK_BUILD_INCLUDES="-I`cd $srcdir/../generic; pwd`"
# extension, linking the the Tcl stubs will be supported.
#--------------------------------------------------------------------
+# Replace ${VERSION} with contents of ${TK_VERSION}
+eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}"
- libname=tkstub
- suffix=${TK_UNSHARED_LIB_SUFFIX}
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- else
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- fi
- ;;
- *)
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- esac
-
- eval "long_libname=${long_libname}"
-
- # Trick to replace DBGX with TCL_DBGX
- DBGX='${TCL_DBGX}'
- eval "long_libname=${long_libname}"
-
- TK_STUB_LIB_FILE=$long_libname
-
-
-MAKE_STUB_LIB="\${STLIB_LD} \${STUB_LIB_FILE} \${STUB_LIB_OBJS}"
-
-
- libname=tkstub
- version=${TK_VERSION}
-
- if test "$TCL_LIB_SUFFIX" = "" ; then
- { echo "configure: error: The TCL_LIB_SUFFIX variable is not defined" 1>&2; exit 1; }
- fi
-
- # If the . character is not allowed in lib name, remove it from version
- if test "${TCL_LIB_VERSIONS_OK}" != "ok"; then
- version=`echo $version | tr -d .`
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "short_libname=\"${TCL_VENDOR_PREFIX}${libname}${version}${TCL_LIB_SUFFIX}\""
- else
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}${TCL_DBGX}"
- fi
- ;;
- *)
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}\${TCL_DBGX}"
- ;;
- esac
-
- TK_STUB_LIB_FLAG=$short_libname
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="`pwd`/${TK_STUB_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_BUILD_STUB_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_BUILD_STUB_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_BUILD_STUB_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_BUILD_STUB_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=`pwd`
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_BUILD_STUB_LIB_SPEC="-L${dirname} ${TK_STUB_LIB_FLAG}"
- fi
- ;;
- *)
- TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}"
- ;;
- esac
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="${exec_prefix}/lib/${TK_STUB_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_STUB_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_STUB_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_STUB_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_STUB_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=${exec_prefix}/lib
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_STUB_LIB_SPEC="-L${dirname} ${TK_STUB_LIB_FLAG}"
- fi
- ;;
- *)
- TK_STUB_LIB_SPEC="-L${exec_prefix}/lib ${TK_STUB_LIB_FLAG}"
- ;;
- esac
-
-
-
-
- val="`pwd`/${TK_STUB_LIB_FILE}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_BUILD_STUB_LIB_PATH" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_BUILD_STUB_LIB_PATH=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_BUILD_STUB_LIB_PATH="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_BUILD_STUB_LIB_PATH=$val
- ;;
- esac
-
-
-
-
- val="`pwd`/${TK_STUB_LIB_FILE}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_STUB_LIB_PATH" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_STUB_LIB_PATH=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_STUB_LIB_PATH="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_STUB_LIB_PATH=$val
- ;;
- esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ eval TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}\${TK_DBGX}"
+else
+ eval TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`\${TK_DBGX}"
+fi
+TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}"
+TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}"
+TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}"
+TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}"
+eval "TK_LIB_FILE=${TK_LIB_FILE}"
@@ -4777,13 +5068,10 @@ MAKE_STUB_LIB="\${STLIB_LD} \${STUB_LIB_FILE} \${STUB_LIB_OBJS}"
-# CYGNUS LOCAL
-# Need more variables to keep shared/static linking separate.
-# END CYGNUS LOCAL
trap '' 1 2 15
cat > confcache <<\EOF
@@ -4929,71 +5217,72 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
-s%@RANLIB@%$RANLIB%g
+s%@MKLINKS_FLAGS@%$MKLINKS_FLAGS%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
+s%@TCL_THREADS@%$TCL_THREADS%g
+s%@TCL_VERSION@%$TCL_VERSION%g
s%@TCL_BIN_DIR@%$TCL_BIN_DIR%g
s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g
s%@TCL_LIB_FILE@%$TCL_LIB_FILE%g
+s%@TCL_LIB_FLAG@%$TCL_LIB_FLAG%g
+s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
+s%@TCL_STUB_LIB_FILE@%$TCL_STUB_LIB_FILE%g
+s%@TCL_STUB_LIB_FLAG@%$TCL_STUB_LIB_FLAG%g
+s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g
s%@AR@%$AR%g
-s%@TCL_LIB_SUFFIX@%$TCL_LIB_SUFFIX%g
+s%@RANLIB@%$RANLIB%g
s%@DL_LIBS@%$DL_LIBS%g
+s%@DL_OBJS@%$DL_OBJS%g
+s%@PLAT_OBJS@%$PLAT_OBJS%g
s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g
s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g
s%@CFLAGS_WARNING@%$CFLAGS_WARNING%g
+s%@EXTRA_CFLAGS@%$EXTRA_CFLAGS%g
+s%@LDFLAGS_DEBUG@%$LDFLAGS_DEBUG%g
+s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ARCH_FLAGS@%$TK_CC_SEARCH_FLAGS%g
-s%@TK_LD_SEARCH_FLAGS@%$TK_LD_SEARCH_FLAGS%g
s%@TK_LIB_FILE@%$TK_LIB_FILE%g
s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g
s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
-s%@TK_MAJOR_VERSION@%$TK_MAJOR_VERSION%g
-s%@TK_MINOR_VERSION@%$TK_MINOR_VERSION%g
-s%@TK_PATCH_LEVEL@%$TK_PATCH_LEVEL%g
s%@TK_SRC_DIR@%$TK_SRC_DIR%g
-s%@TK_VERSION@%$TK_VERSION%g
s%@XINCLUDES@%$XINCLUDES%g
s%@XLIBSW@%$XLIBSW%g
s%@TK_SHARED_BUILD@%$TK_SHARED_BUILD%g
-s%@TK_BUILD_INCLUDES@%$TK_BUILD_INCLUDES%g
-s%@TCL_SHARED_LIB_SUFFIX@%$TCL_SHARED_LIB_SUFFIX%g
-s%@TCL_UNSHARED_LIB_SUFFIX@%$TCL_UNSHARED_LIB_SUFFIX%g
-s%@TK_SHARED_LIB_FILE@%$TK_SHARED_LIB_FILE%g
-s%@TK_UNSHARED_LIB_FILE@%$TK_UNSHARED_LIB_FILE%g
+s%@LOCALES@%$LOCALES%g
CEOF
EOF
@@ -5101,4 +5390,3 @@ chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
diff --git a/tk/unix/configure.in b/tk/unix/configure.in
index cdc7eabfe47..7841d8d2097 100755
--- a/tk/unix/configure.in
+++ b/tk/unix/configure.in
@@ -2,20 +2,22 @@
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
+#
# RCS: @(#) $Id$
-# CYGNUS LOCAL, autoconf 2.5 or higher to get --bindir et al
-AC_PREREQ(2.5)
-# END CYGNUS LOCAL
-
AC_INIT(../generic/tk.h)
-# RCS: @(#) $Id$
+AC_PREREQ(2.13)
-TK_VERSION=8.3
+TK_VERSION=8.4
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=3
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=4
+TK_PATCH_LEVEL=".0"
VERSION=${TK_VERSION}
+LOCALES="cs de el en en_gb es fr it nl ru"
+
+#------------------------------------------------------------------------
+# Handle the --prefix=... option
+#------------------------------------------------------------------------
if test "${prefix}" = "NONE"; then
prefix=/usr/local
@@ -23,13 +25,33 @@ fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
+# libdir must be a fully qualified path and (not ${exec_prefix}/lib)
+eval libdir="$libdir"
# Make sure srcdir is fully qualified!
srcdir=`cd $srcdir ; pwd`
-TCL_TOOL_PATH(TK_SRC_DIR, "`cd $srcdir/..; pwd`")
+TK_SRC_DIR=`cd $srcdir/..; pwd`
+
+#------------------------------------------------------------------------
+# Compress and/or soft link the manpages?
+#------------------------------------------------------------------------
+SC_CONFIG_MANPAGES
+
+#------------------------------------------------------------------------
+# Standard compiler checks
+#------------------------------------------------------------------------
+
+# If the user did not set CFLAGS, set it now to keep
+# the AC_PROG_CC macro from adding "-g -O2".
+if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+fi
-AC_PROG_RANLIB
AC_PROG_CC
+#------------------------------------------------------------------------
+# I'm not sure why these need to come before all of the other tests
+#------------------------------------------------------------------------
+
AC_HAVE_HEADERS(unistd.h limits.h)
#------------------------------------------------------------------------
@@ -56,6 +78,14 @@ fi
fi
#--------------------------------------------------------------------
+# Detect what compiler flags to set for 64-bit support.
+#--------------------------------------------------------------------
+
+SC_TCL_EARLY_FLAGS
+
+SC_TCL_64BIT_FLAGS
+
+#--------------------------------------------------------------------
# Find and load the tclConfig.sh file
#--------------------------------------------------------------------
@@ -66,6 +96,8 @@ SC_LOAD_TCLCONFIG
# Recompute the necessary flags to run the compiler
#--------------------------------------------------------------------
+SC_ENABLE_SHARED
+
SC_CONFIG_CFLAGS
SC_ENABLE_SYMBOLS
@@ -208,91 +240,11 @@ if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
fi
# The statement below is very tricky! It actually *evaluates* the
-# string in TCL_LD_SEARCH_FLAGS, which causes a substitution of the
-# variable LIB_RUNTIME_DIR.
-
-eval "TK_CC_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
-
-#
-# CYGNUS LOCAL: statically link on Solaris, HPUX & SunOS so that
-# we don't have problems with people not having libraries
-# installed or not having LD_LIBRARY_PATH set.
-#
-
- case "$host" in
-#
-# gdb linked statically w/ Solaris iff GCC and GNU ld are used,
-# otherwise dynamic
-#
- sparc-sun-solaris2*)
- sol_xlibsw=
- if test "x$GCC" = "xyes" ; then
- # This is probably the simplest way to test for GNU ld.
- # It only works with relatively recent versions of GNU
- # ld.
- gld_text=`$CC -Wl,--version 2>&1 | sed 1q`
- case "$gld_text" in
- GNU* | *BFD*)
- # sol2.* has libX*.so files in /usr/lib,
- # but not libX*.a files, so we need to force a
- # -L/usr/openwin/lib option, sometimes.
- # FIXME: this won't work right if someone has
- # their own X libraries in say /usr/local/lib.
- case "$XLIBSW" in
- *-L*) ;;
- *) if test ! -f /usr/lib/libXt.a; then
- XLIBSW="-L/usr/openwin/lib $XLIBSW"
- fi
- ;;
- esac
-
- # Why do we link against libX11 twice? Because the
- # Openwin X11 and Xext libraries are seriously broken.
- sol_xlibsw="-Wl,-Bstatic $XLIBSW -lXext -lX11 -Wl,-Bdynamic"
- ;;
- esac
- fi
- if test -z "$sol_xlibsw"; then
- if test "x$x_libraries" != "x"; then
- XLIBSW="$XLIBSW -R$x_libraries"
- fi
- else
- XLIBSW=$sol_xlibsw
- suppress_enable_shared=yes
- fi
- ;;
-#
-# gdb linked statically w/ SunOS or HPUX
-#
- m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
- if test "x$x_libraries" != "x" ;
- then
- XLIBSW="$x_libraries/libX11.a"
- else
- XLIBSW="/usr/lib/libX11.a"
- fi
- suppress_enable_shared=yes
- ;;
-#
-# default is to link dynamically
-#
- *)
- ;;
- esac
-#
-# END CYGNUS LOCAL
+# string in TCL_CC_SEARCH_FLAGS and TCL_LD_SEARCH_FLAGS which
+# causes a substitution of the variable LIB_RUNTIME_DIR.
-# The following case handles the differences between linking with "ld"
-# and the compiler
-
-case $SHLIB_LD in
- *ld*)
- TK_LD_SEARCH_FLAGS=`echo ${TK_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"`
- ;;
- *)
- TK_LD_SEARCH_FLAGS="${TK_CC_SEARCH_FLAGS}"
- ;;
-esac
+eval "CC_SEARCH_FLAGS=\"$TCL_CC_SEARCH_FLAGS\""
+eval "LD_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\""
#--------------------------------------------------------------------
# Check for the existence of various libraries. The order here
@@ -314,38 +266,17 @@ esac
AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"])
-# CYGNUS LOCAL: Store any socket library(ies) in the cache, and don't
-# mess up the cache values of the functions we check for.
-AC_CACHE_CHECK([for socket libraries], tcl_cv_lib_sockets,
- [tcl_cv_lib_sockets=
- tk_checkBoth=0
- unset ac_cv_func_connect
- AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
- if test "$tk_checkSocket" = 1; then
- unset ac_cv_func_connect
- AC_CHECK_LIB(socket, main, tcl_cv_lib_sockets="-lsocket",
- tk_checkBoth=1)
- fi
- if test "$tk_checkBoth" = 1; then
- tk_oldLibs=$LIBS
- LIBS="$LIBS -lsocket -lnsl"
- unset ac_cv_func_accept
- AC_CHECK_FUNC(accept,
- [tcl_checkNsl=0
- tcl_cv_lib_sockets="-lsocket -lnsl"])
- unset ac_cv_func_accept
- LIBS=$tk_oldLibs
- fi
- unset ac_cv_func_gethostbyname
- tk_oldLibs=$LIBS
- LIBS="$LIBS $tk_cv_lib_sockets"
- AC_CHECK_FUNC(gethostbyname, ,
- [AC_CHECK_LIB(nsl, main,
- [tcl_cv_lib_sockets="$tcl_cv_lib_sockets -lnsl"])])
- unset ac_cv_func_gethostbyname
- LIBS=$tcl_oldLIBS
-])
-test -z "$tcl_cv_lib_sockets" || LIBS="$LIBS $tcl_cv_lib_sockets"
+tk_checkBoth=0
+AC_CHECK_FUNC(connect, tk_checkSocket=0, tk_checkSocket=1)
+if test "$tk_checkSocket" = 1; then
+ AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tk_checkBoth=1)
+fi
+if test "$tk_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ AC_CHECK_FUNC(accept, tk_checkNsl=0, [LIBS=$tk_oldLibs])
+fi
+AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])])
# Add the threads support libraries
@@ -413,26 +344,17 @@ SC_BUGGY_STRTOD
# building libtk as a shared library instead of a static library.
#--------------------------------------------------------------------
-SC_ENABLE_SHARED
-
eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
- TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
- TCL_TOOL_SHARED_LIB_LONGNAME(TK_LIB_FILE, tk, ${TK_SHARED_LIB_SUFFIX})
- MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${LIBS}"
- RANLIB=":"
-
-# TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
- TCL_STUB_FLAGS=""
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_STUB_LIB_SPEC}"
+ TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
else
- TK_SHLIB_CFLAGS=""
- TCL_TOOL_STATIC_LIB_LONGNAME(TK_LIB_FILE, tk, ${TK_UNSHARED_LIB_SUFFIX})
- MAKE_LIB="\${STLIB_LD} \${TK_LIB_FILE} \${OBJS}"
-
TCL_STUB_FLAGS=""
fi
+TK_LIB_FILE=libtk${LIB_SUFFIX}
+eval "TK_LIB_FILE=${TK_LIB_FILE}"
# Note: in the following variable, it's important to use the absolute
# path name of the Tcl directory rather than "..": this is because
@@ -440,24 +362,29 @@ fi
# up the Tcl library.
if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then
- TCL_TOOL_LIB_SHORTNAME(TK_LIB_FLAG, tk, $TK_VERSION)
- TCL_TOOL_LIB_SPEC(TK_BUILD_LIB_SPEC, `pwd`, ${TK_LIB_FLAG})
- TCL_TOOL_LIB_SPEC(TK_LIB_SPEC, ${exec_prefix}/lib, ${TK_LIB_FLAG})
+ if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ eval TK_LIB_FLAG="-ltk${VERSION}\${TK_DBGX}"
+ else
+ eval TK_LIB_FLAG="-ltk`echo ${VERSION} | tr -d .`\${TK_DBGX}"
+ fi
+ TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
+ TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}"
TK_BUILD_EXP_FILE=""
TK_EXP_FILE=""
else
TK_BUILD_EXP_FILE="lib.exp"
eval "TK_EXP_FILE=libtk${TCL_EXPORT_FILE_SUFFIX}"
-
- TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
- TK_LIB_SPEC="-bI:${exec_prefix}/lib/${TK_EXP_FILE}"
+
+ if test "$GCC" = "yes" ; then
+ TK_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TK_BUILD_EXP_FILE} -L`pwd`"
+ TK_LIB_SPEC="-Wl,-bI:${libdir}/${TK_EXP_FILE} -L`pwd`"
+ else
+ TK_BUILD_LIB_SPEC="-bI:`pwd`/${TK_BUILD_EXP_FILE}"
+ TK_LIB_SPEC="-bI:${libdir}/${TK_EXP_FILE}"
+ fi
fi
TK_SHARED_BUILD=${SHARED_BUILD}
-dnl CYGNUS LOCAL
-TK_BUILD_INCLUDES="-I`cd $srcdir/../generic; pwd`"
-dnl END CYGNUS LOCAL
-
#--------------------------------------------------------------------
# The statements below define various symbols relating to creating
# the stub'd version of the Tk library
@@ -467,16 +394,27 @@ dnl END CYGNUS LOCAL
# extension, linking the the Tcl stubs will be supported.
#--------------------------------------------------------------------
-TCL_TOOL_STATIC_LIB_LONGNAME(TK_STUB_LIB_FILE, tkstub, ${TK_UNSHARED_LIB_SUFFIX})
+# Replace ${VERSION} with contents of ${TK_VERSION}
+eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}"
+
+if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
+ eval TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}\${TK_DBGX}"
+else
+ eval TK_STUB_LIB_FLAG="-ltkstub`echo ${TK_VERSION} | tr -d .`\${TK_DBGX}"
+fi
-MAKE_STUB_LIB="\${STLIB_LD} \${STUB_LIB_FILE} \${STUB_LIB_OBJS}"
+TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}"
+TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}"
+TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}"
+TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}"
-TCL_TOOL_LIB_SHORTNAME(TK_STUB_LIB_FLAG, tkstub, ${TK_VERSION})
-TCL_TOOL_LIB_SPEC(TK_BUILD_STUB_LIB_SPEC, `pwd`, ${TK_STUB_LIB_FLAG})
-TCL_TOOL_LIB_SPEC(TK_STUB_LIB_SPEC, ${exec_prefix}/lib, ${TK_STUB_LIB_FLAG})
+eval "TK_LIB_FILE=${TK_LIB_FILE}"
-TCL_TOOL_LIB_PATH(TK_BUILD_STUB_LIB_PATH, `pwd`, ${TK_STUB_LIB_FILE})
-TCL_TOOL_LIB_PATH(TK_STUB_LIB_PATH, `pwd`, ${TK_STUB_LIB_FILE})
+AC_SUBST(TK_VERSION)
+AC_SUBST(TK_MAJOR_VERSION)
+AC_SUBST(TK_MINOR_VERSION)
+AC_SUBST(TK_PATCH_LEVEL)
+AC_SUBST(TK_DBGX)
AC_SUBST(TK_STUB_LIB_FILE)
AC_SUBST(TK_STUB_LIB_FLAG)
@@ -484,7 +422,6 @@ AC_SUBST(TK_BUILD_STUB_LIB_SPEC)
AC_SUBST(TK_STUB_LIB_SPEC)
AC_SUBST(TK_BUILD_STUB_LIB_PATH)
AC_SUBST(TK_STUB_LIB_PATH)
-AC_SUBST(MAKE_STUB_LIB)
AC_SUBST(TK_STUB_FLAGS)
AC_SUBST(TK_BUILD_EXP_FILE)
AC_SUBST(TK_EXP_FILE)
@@ -493,61 +430,17 @@ AC_SUBST(TCL_STUB_FLAGS)
AC_SUBST(TK_BUILD_EXP_FILE)
AC_SUBST(TK_EXP_FILE)
-AC_SUBST(CFLAGS_DEFAULT)
-AC_SUBST(CFLAGS_DEBUG)
-AC_SUBST(CFLAGS_OPTIMIZE)
-AC_SUBST(LDFLAGS_DEFAULT)
-AC_SUBST(LDFLAGS_DEBUG)
-AC_SUBST(LDFLAGS_OPTIMIZE)
-AC_SUBST(TK_DBGX)
-AC_SUBST(DL_LIBS)
-AC_SUBST(EXTRA_CFLAGS)
+AC_SUBST(LD_LIBRARY_PATH_VAR)
+
AC_SUBST(MATH_LIBS)
-AC_SUBST(AR)
-AC_SUBST(RANLIB)
-AC_SUBST(MAKE_LIB)
-AC_SUBST(SHLIB_CFLAGS)
-AC_SUBST(TK_SHLIB_CFLAGS)
-AC_SUBST(STLIB_LD)
-AC_SUBST(SHLIB_LD)
-AC_SUBST(SHLIB_LD_LIBS)
-AC_SUBST(SHLIB_SUFFIX)
-AC_SUBST(SHLIB_VERSION)
-AC_SUBST(TCL_BIN_DIR)
-AC_SUBST(TCL_LIB_FULL_PATH)
-AC_SUBST(TCL_LIB_SPEC)
-AC_SUBST(TCL_LIB_FLAG)
-AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
-AC_SUBST(TCL_BUILD_LIB_SPEC)
-AC_SUBST(TCL_DBGX)
-AC_SUBST(TCL_LIB_FLAG)
-AC_SUBST(TCL_SRC_DIR)
-AC_SUBST(TCL_VERSION)
AC_SUBST(TK_BUILD_LIB_SPEC)
-AC_SUBST(TK_LIB_FULL_PATH)
-AC_SUBST(TK_CC_SEARCH_FLAGS)
-AC_SUBST(TK_LD_SEARCH_FLAGS)
AC_SUBST(TK_LIB_FILE)
AC_SUBST(TK_LIB_FLAG)
AC_SUBST(TK_LIB_SPEC)
-AC_SUBST(TK_MAJOR_VERSION)
-AC_SUBST(TK_MINOR_VERSION)
-AC_SUBST(TK_PATCH_LEVEL)
AC_SUBST(TK_SRC_DIR)
-AC_SUBST(TK_VERSION)
AC_SUBST(XINCLUDES)
AC_SUBST(XLIBSW)
AC_SUBST(TK_SHARED_BUILD)
-dnl CYGNUS LOCAL
-AC_SUBST(TK_BUILD_INCLUDES)
-dnl END CYGNUS LOCAL
-# CYGNUS LOCAL
-# Need more variables to keep shared/static linking separate.
-AC_SUBST(TCL_SHARED_LIB_SUFFIX)
-AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
-AC_SUBST(TK_SHARED_LIB_FILE)
-AC_SUBST(TK_UNSHARED_LIB_FILE)
-# END CYGNUS LOCAL
+AC_SUBST(LOCALES)
AC_OUTPUT(Makefile tkConfig.sh)
-
diff --git a/tk/unix/install-sh b/tk/unix/install-sh
index 32efb2cc882..a9a1f276493 100755
--- a/tk/unix/install-sh
+++ b/tk/unix/install-sh
@@ -1,19 +1,10 @@
#!/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
+# This comes from X11R5; it is not part of GNU.
#
-# 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.
+# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
@@ -71,6 +62,11 @@ while [ x"$1" != x ]; do
shift
continue;;
+ -S) stripcmd="$stripprog $2"
+ shift
+ shift
+ continue;;
+
*) if [ x"$src" = x ]
then
src=$1
diff --git a/tk/unix/mkLinks b/tk/unix/mkLinks
index 95356941219..adb3559b721 100755
--- a/tk/unix/mkLinks
+++ b/tk/unix/mkLinks
@@ -15,705 +15,1169 @@
# The script takes one argument, which is the name of the directory
# where the manual entries have been installed.
+ZIP=true
+while true; do
+ case $1 in
+ -s | --symlinks )
+ S=-s
+ ;;
+ -z | --compress )
+ ZIP=$2
+ shift
+ ;;
+ *) break
+ ;;
+ esac
+ shift
+done
+
if test $# != 1; then
- echo "Usage: mkLinks dir"
+ echo "Usage: mkLinks <options> dir"
exit 1
fi
+if test "x$ZIP" != "xtrue"; then
+ touch TeST
+ $ZIP TeST
+ Z=`ls TeST* | sed 's/^[^.]*//'`
+ rm -f TeST*
+fi
+
cd $1
echo foo > xyzzyTestingAVeryLongFileName.foo
x=`echo xyzzyTe*`
+echo foo > xyzzyTestingaverylongfilename.foo
+y=`echo xyzzyTestingav*`
rm xyzzyTe*
if test "$x" != "xyzzyTestingAVeryLongFileName.foo"; then
exit
fi
+if test "$y" != "xyzzyTestingaverylongfilename.foo"; then
+ CASEINSENSITIVEFS=1
+fi
if test -r 3DBorder.3; then
- rm -f Tk_Alloc3DBorderFromObj.3
- rm -f Tk_Get3DBorder.3
- rm -f Tk_Get3DBorderFromObj.3
- rm -f Tk_Draw3DRectangle.3
- rm -f Tk_Fill3DRectangle.3
- rm -f Tk_Draw3DPolygon.3
- rm -f Tk_Fill3DPolygon.3
- rm -f Tk_3DVerticalBevel.3
- rm -f Tk_3DHorizontalBevel.3
- rm -f Tk_SetBackgroundFromBorder.3
- rm -f Tk_NameOf3DBorder.3
- rm -f Tk_3DBorderColor.3
- rm -f Tk_3DBorderGC.3
- rm -f Tk_Free3DBorderFromObj.3
- rm -f Tk_Free3DBorder.3
- cp 3DBorder.3 Tk_Alloc3DBorderFromObj.3
- cp 3DBorder.3 Tk_Get3DBorder.3
- cp 3DBorder.3 Tk_Get3DBorderFromObj.3
- cp 3DBorder.3 Tk_Draw3DRectangle.3
- cp 3DBorder.3 Tk_Fill3DRectangle.3
- cp 3DBorder.3 Tk_Draw3DPolygon.3
- cp 3DBorder.3 Tk_Fill3DPolygon.3
- cp 3DBorder.3 Tk_3DVerticalBevel.3
- cp 3DBorder.3 Tk_3DHorizontalBevel.3
- cp 3DBorder.3 Tk_SetBackgroundFromBorder.3
- cp 3DBorder.3 Tk_NameOf3DBorder.3
- cp 3DBorder.3 Tk_3DBorderColor.3
- cp 3DBorder.3 Tk_3DBorderGC.3
- cp 3DBorder.3 Tk_Free3DBorderFromObj.3
- cp 3DBorder.3 Tk_Free3DBorder.3
+ rm -f 3DBorder.3.*
+ $ZIP 3DBorder.3
+ rm -f Tk_Alloc3DBorderFromObj.3 Tk_Alloc3DBorderFromObj.3.*
+ rm -f Tk_Get3DBorder.3 Tk_Get3DBorder.3.*
+ rm -f Tk_Get3DBorderFromObj.3 Tk_Get3DBorderFromObj.3.*
+ rm -f Tk_Draw3DRectangle.3 Tk_Draw3DRectangle.3.*
+ rm -f Tk_Fill3DRectangle.3 Tk_Fill3DRectangle.3.*
+ rm -f Tk_Draw3DPolygon.3 Tk_Draw3DPolygon.3.*
+ rm -f Tk_Fill3DPolygon.3 Tk_Fill3DPolygon.3.*
+ rm -f Tk_3DVerticalBevel.3 Tk_3DVerticalBevel.3.*
+ rm -f Tk_3DHorizontalBevel.3 Tk_3DHorizontalBevel.3.*
+ rm -f Tk_SetBackgroundFromBorder.3 Tk_SetBackgroundFromBorder.3.*
+ rm -f Tk_NameOf3DBorder.3 Tk_NameOf3DBorder.3.*
+ rm -f Tk_3DBorderColor.3 Tk_3DBorderColor.3.*
+ rm -f Tk_3DBorderGC.3 Tk_3DBorderGC.3.*
+ rm -f Tk_Free3DBorderFromObj.3 Tk_Free3DBorderFromObj.3.*
+ rm -f Tk_Free3DBorder.3 Tk_Free3DBorder.3.*
+ ln $S 3DBorder.3$Z Tk_Alloc3DBorderFromObj.3$Z
+ ln $S 3DBorder.3$Z Tk_Get3DBorder.3$Z
+ ln $S 3DBorder.3$Z Tk_Get3DBorderFromObj.3$Z
+ ln $S 3DBorder.3$Z Tk_Draw3DRectangle.3$Z
+ ln $S 3DBorder.3$Z Tk_Fill3DRectangle.3$Z
+ ln $S 3DBorder.3$Z Tk_Draw3DPolygon.3$Z
+ ln $S 3DBorder.3$Z Tk_Fill3DPolygon.3$Z
+ ln $S 3DBorder.3$Z Tk_3DVerticalBevel.3$Z
+ ln $S 3DBorder.3$Z Tk_3DHorizontalBevel.3$Z
+ ln $S 3DBorder.3$Z Tk_SetBackgroundFromBorder.3$Z
+ ln $S 3DBorder.3$Z Tk_NameOf3DBorder.3$Z
+ ln $S 3DBorder.3$Z Tk_3DBorderColor.3$Z
+ ln $S 3DBorder.3$Z Tk_3DBorderGC.3$Z
+ ln $S 3DBorder.3$Z Tk_Free3DBorderFromObj.3$Z
+ ln $S 3DBorder.3$Z Tk_Free3DBorder.3$Z
fi
if test -r AddOption.3; then
- rm -f Tk_AddOption.3
- cp AddOption.3 Tk_AddOption.3
+ rm -f AddOption.3.*
+ $ZIP AddOption.3
+ rm -f Tk_AddOption.3 Tk_AddOption.3.*
+ ln $S AddOption.3$Z Tk_AddOption.3$Z
fi
if test -r BindTable.3; then
- rm -f Tk_CreateBindingTable.3
- rm -f Tk_DeleteBindingTable.3
- rm -f Tk_CreateBinding.3
- rm -f Tk_DeleteBinding.3
- rm -f Tk_GetBinding.3
- rm -f Tk_GetAllBindings.3
- rm -f Tk_DeleteAllBindings.3
- rm -f Tk_BindEvent.3
- cp BindTable.3 Tk_CreateBindingTable.3
- cp BindTable.3 Tk_DeleteBindingTable.3
- cp BindTable.3 Tk_CreateBinding.3
- cp BindTable.3 Tk_DeleteBinding.3
- cp BindTable.3 Tk_GetBinding.3
- cp BindTable.3 Tk_GetAllBindings.3
- cp BindTable.3 Tk_DeleteAllBindings.3
- cp BindTable.3 Tk_BindEvent.3
+ rm -f BindTable.3.*
+ $ZIP BindTable.3
+ rm -f Tk_CreateBindingTable.3 Tk_CreateBindingTable.3.*
+ rm -f Tk_DeleteBindingTable.3 Tk_DeleteBindingTable.3.*
+ rm -f Tk_CreateBinding.3 Tk_CreateBinding.3.*
+ rm -f Tk_DeleteBinding.3 Tk_DeleteBinding.3.*
+ rm -f Tk_GetBinding.3 Tk_GetBinding.3.*
+ rm -f Tk_GetAllBindings.3 Tk_GetAllBindings.3.*
+ rm -f Tk_DeleteAllBindings.3 Tk_DeleteAllBindings.3.*
+ rm -f Tk_BindEvent.3 Tk_BindEvent.3.*
+ ln $S BindTable.3$Z Tk_CreateBindingTable.3$Z
+ ln $S BindTable.3$Z Tk_DeleteBindingTable.3$Z
+ ln $S BindTable.3$Z Tk_CreateBinding.3$Z
+ ln $S BindTable.3$Z Tk_DeleteBinding.3$Z
+ ln $S BindTable.3$Z Tk_GetBinding.3$Z
+ ln $S BindTable.3$Z Tk_GetAllBindings.3$Z
+ ln $S BindTable.3$Z Tk_DeleteAllBindings.3$Z
+ ln $S BindTable.3$Z Tk_BindEvent.3$Z
fi
if test -r CanvPsY.3; then
- rm -f Tk_CanvasPsY.3
- rm -f Tk_CanvasPsBitmap.3
- rm -f Tk_CanvasPsColor.3
- rm -f Tk_CanvasPsFont.3
- rm -f Tk_CanvasPsPath.3
- rm -f Tk_CanvasPsStipple.3
- cp CanvPsY.3 Tk_CanvasPsY.3
- cp CanvPsY.3 Tk_CanvasPsBitmap.3
- cp CanvPsY.3 Tk_CanvasPsColor.3
- cp CanvPsY.3 Tk_CanvasPsFont.3
- cp CanvPsY.3 Tk_CanvasPsPath.3
- cp CanvPsY.3 Tk_CanvasPsStipple.3
+ rm -f CanvPsY.3.*
+ $ZIP CanvPsY.3
+ rm -f Tk_CanvasPsY.3 Tk_CanvasPsY.3.*
+ rm -f Tk_CanvasPsBitmap.3 Tk_CanvasPsBitmap.3.*
+ rm -f Tk_CanvasPsColor.3 Tk_CanvasPsColor.3.*
+ rm -f Tk_CanvasPsFont.3 Tk_CanvasPsFont.3.*
+ rm -f Tk_CanvasPsPath.3 Tk_CanvasPsPath.3.*
+ rm -f Tk_CanvasPsStipple.3 Tk_CanvasPsStipple.3.*
+ ln $S CanvPsY.3$Z Tk_CanvasPsY.3$Z
+ ln $S CanvPsY.3$Z Tk_CanvasPsBitmap.3$Z
+ ln $S CanvPsY.3$Z Tk_CanvasPsColor.3$Z
+ ln $S CanvPsY.3$Z Tk_CanvasPsFont.3$Z
+ ln $S CanvPsY.3$Z Tk_CanvasPsPath.3$Z
+ ln $S CanvPsY.3$Z Tk_CanvasPsStipple.3$Z
fi
if test -r CanvTkwin.3; then
- rm -f Tk_CanvasTkwin.3
- rm -f Tk_CanvasGetCoord.3
- rm -f Tk_CanvasDrawableCoords.3
- rm -f Tk_CanvasSetStippleOrigin.3
- rm -f Tk_CanvasWindowCoords.3
- rm -f Tk_CanvasEventuallyRedraw.3
- rm -f Tk_CanvasTagsOption.3
- cp CanvTkwin.3 Tk_CanvasTkwin.3
- cp CanvTkwin.3 Tk_CanvasGetCoord.3
- cp CanvTkwin.3 Tk_CanvasDrawableCoords.3
- cp CanvTkwin.3 Tk_CanvasSetStippleOrigin.3
- cp CanvTkwin.3 Tk_CanvasWindowCoords.3
- cp CanvTkwin.3 Tk_CanvasEventuallyRedraw.3
- cp CanvTkwin.3 Tk_CanvasTagsOption.3
+ rm -f CanvTkwin.3.*
+ $ZIP CanvTkwin.3
+ rm -f Tk_CanvasTkwin.3 Tk_CanvasTkwin.3.*
+ rm -f Tk_CanvasGetCoord.3 Tk_CanvasGetCoord.3.*
+ rm -f Tk_CanvasDrawableCoords.3 Tk_CanvasDrawableCoords.3.*
+ rm -f Tk_CanvasSetStippleOrigin.3 Tk_CanvasSetStippleOrigin.3.*
+ rm -f Tk_CanvasWindowCoords.3 Tk_CanvasWindowCoords.3.*
+ rm -f Tk_CanvasEventuallyRedraw.3 Tk_CanvasEventuallyRedraw.3.*
+ rm -f Tk_CanvasTagsOption.3 Tk_CanvasTagsOption.3.*
+ ln $S CanvTkwin.3$Z Tk_CanvasTkwin.3$Z
+ ln $S CanvTkwin.3$Z Tk_CanvasGetCoord.3$Z
+ ln $S CanvTkwin.3$Z Tk_CanvasDrawableCoords.3$Z
+ ln $S CanvTkwin.3$Z Tk_CanvasSetStippleOrigin.3$Z
+ ln $S CanvTkwin.3$Z Tk_CanvasWindowCoords.3$Z
+ ln $S CanvTkwin.3$Z Tk_CanvasEventuallyRedraw.3$Z
+ ln $S CanvTkwin.3$Z Tk_CanvasTagsOption.3$Z
fi
if test -r CanvTxtInfo.3; then
- rm -f Tk_CanvasTextInfo.3
- cp CanvTxtInfo.3 Tk_CanvasTextInfo.3
+ rm -f CanvTxtInfo.3.*
+ $ZIP CanvTxtInfo.3
+ rm -f Tk_CanvasTextInfo.3 Tk_CanvasTextInfo.3.*
+ ln $S CanvTxtInfo.3$Z Tk_CanvasTextInfo.3$Z
fi
if test -r Clipboard.3; then
- rm -f Tk_ClipboardClear.3
- rm -f Tk_ClipboardAppend.3
- cp Clipboard.3 Tk_ClipboardClear.3
- cp Clipboard.3 Tk_ClipboardAppend.3
+ rm -f Clipboard.3.*
+ $ZIP Clipboard.3
+ rm -f Tk_ClipboardClear.3 Tk_ClipboardClear.3.*
+ rm -f Tk_ClipboardAppend.3 Tk_ClipboardAppend.3.*
+ ln $S Clipboard.3$Z Tk_ClipboardClear.3$Z
+ ln $S Clipboard.3$Z Tk_ClipboardAppend.3$Z
fi
if test -r ClrSelect.3; then
- rm -f Tk_ClearSelection.3
- cp ClrSelect.3 Tk_ClearSelection.3
+ rm -f ClrSelect.3.*
+ $ZIP ClrSelect.3
+ rm -f Tk_ClearSelection.3 Tk_ClearSelection.3.*
+ ln $S ClrSelect.3$Z Tk_ClearSelection.3$Z
fi
if test -r ConfigWidg.3; then
- rm -f Tk_ConfigureWidget.3
- rm -f Tk_Offset.3
- rm -f Tk_ConfigureInfo.3
- rm -f Tk_ConfigureValue.3
- rm -f Tk_FreeOptions.3
- cp ConfigWidg.3 Tk_ConfigureWidget.3
- cp ConfigWidg.3 Tk_Offset.3
- cp ConfigWidg.3 Tk_ConfigureInfo.3
- cp ConfigWidg.3 Tk_ConfigureValue.3
- cp ConfigWidg.3 Tk_FreeOptions.3
+ rm -f ConfigWidg.3.*
+ $ZIP ConfigWidg.3
+ rm -f Tk_ConfigureWidget.3 Tk_ConfigureWidget.3.*
+ rm -f Tk_Offset.3 Tk_Offset.3.*
+ rm -f Tk_ConfigureInfo.3 Tk_ConfigureInfo.3.*
+ rm -f Tk_ConfigureValue.3 Tk_ConfigureValue.3.*
+ rm -f Tk_FreeOptions.3 Tk_FreeOptions.3.*
+ ln $S ConfigWidg.3$Z Tk_ConfigureWidget.3$Z
+ ln $S ConfigWidg.3$Z Tk_Offset.3$Z
+ ln $S ConfigWidg.3$Z Tk_ConfigureInfo.3$Z
+ ln $S ConfigWidg.3$Z Tk_ConfigureValue.3$Z
+ ln $S ConfigWidg.3$Z Tk_FreeOptions.3$Z
fi
if test -r ConfigWind.3; then
- rm -f Tk_ConfigureWindow.3
- rm -f Tk_MoveWindow.3
- rm -f Tk_ResizeWindow.3
- rm -f Tk_MoveResizeWindow.3
- rm -f Tk_SetWindowBorderWidth.3
- rm -f Tk_ChangeWindowAttributes.3
- rm -f Tk_SetWindowBackground.3
- rm -f Tk_SetWindowBackgroundPixmap.3
- rm -f Tk_SetWindowBorder.3
- rm -f Tk_SetWindowBorderPixmap.3
- rm -f Tk_SetWindowColormap.3
- rm -f Tk_DefineCursor.3
- rm -f Tk_UndefineCursor.3
- cp ConfigWind.3 Tk_ConfigureWindow.3
- cp ConfigWind.3 Tk_MoveWindow.3
- cp ConfigWind.3 Tk_ResizeWindow.3
- cp ConfigWind.3 Tk_MoveResizeWindow.3
- cp ConfigWind.3 Tk_SetWindowBorderWidth.3
- cp ConfigWind.3 Tk_ChangeWindowAttributes.3
- cp ConfigWind.3 Tk_SetWindowBackground.3
- cp ConfigWind.3 Tk_SetWindowBackgroundPixmap.3
- cp ConfigWind.3 Tk_SetWindowBorder.3
- cp ConfigWind.3 Tk_SetWindowBorderPixmap.3
- cp ConfigWind.3 Tk_SetWindowColormap.3
- cp ConfigWind.3 Tk_DefineCursor.3
- cp ConfigWind.3 Tk_UndefineCursor.3
+ rm -f ConfigWind.3.*
+ $ZIP ConfigWind.3
+ rm -f Tk_ConfigureWindow.3 Tk_ConfigureWindow.3.*
+ rm -f Tk_MoveWindow.3 Tk_MoveWindow.3.*
+ rm -f Tk_ResizeWindow.3 Tk_ResizeWindow.3.*
+ rm -f Tk_MoveResizeWindow.3 Tk_MoveResizeWindow.3.*
+ rm -f Tk_SetWindowBorderWidth.3 Tk_SetWindowBorderWidth.3.*
+ rm -f Tk_ChangeWindowAttributes.3 Tk_ChangeWindowAttributes.3.*
+ rm -f Tk_SetWindowBackground.3 Tk_SetWindowBackground.3.*
+ rm -f Tk_SetWindowBackgroundPixmap.3 Tk_SetWindowBackgroundPixmap.3.*
+ rm -f Tk_SetWindowBorder.3 Tk_SetWindowBorder.3.*
+ rm -f Tk_SetWindowBorderPixmap.3 Tk_SetWindowBorderPixmap.3.*
+ rm -f Tk_SetWindowColormap.3 Tk_SetWindowColormap.3.*
+ rm -f Tk_DefineCursor.3 Tk_DefineCursor.3.*
+ rm -f Tk_UndefineCursor.3 Tk_UndefineCursor.3.*
+ ln $S ConfigWind.3$Z Tk_ConfigureWindow.3$Z
+ ln $S ConfigWind.3$Z Tk_MoveWindow.3$Z
+ ln $S ConfigWind.3$Z Tk_ResizeWindow.3$Z
+ ln $S ConfigWind.3$Z Tk_MoveResizeWindow.3$Z
+ ln $S ConfigWind.3$Z Tk_SetWindowBorderWidth.3$Z
+ ln $S ConfigWind.3$Z Tk_ChangeWindowAttributes.3$Z
+ ln $S ConfigWind.3$Z Tk_SetWindowBackground.3$Z
+ ln $S ConfigWind.3$Z Tk_SetWindowBackgroundPixmap.3$Z
+ ln $S ConfigWind.3$Z Tk_SetWindowBorder.3$Z
+ ln $S ConfigWind.3$Z Tk_SetWindowBorderPixmap.3$Z
+ ln $S ConfigWind.3$Z Tk_SetWindowColormap.3$Z
+ ln $S ConfigWind.3$Z Tk_DefineCursor.3$Z
+ ln $S ConfigWind.3$Z Tk_UndefineCursor.3$Z
fi
if test -r CoordToWin.3; then
- rm -f Tk_CoordsToWindow.3
- cp CoordToWin.3 Tk_CoordsToWindow.3
+ rm -f CoordToWin.3.*
+ $ZIP CoordToWin.3
+ rm -f Tk_CoordsToWindow.3 Tk_CoordsToWindow.3.*
+ ln $S CoordToWin.3$Z Tk_CoordsToWindow.3$Z
+fi
+if test -r CrtCmHdlr.3; then
+ rm -f CrtCmHdlr.3.*
+ $ZIP CrtCmHdlr.3
+ rm -f Tk_CreateClientMessageHandler.3 Tk_CreateClientMessageHandler.3.*
+ rm -f Tk_DeleteClientMessageHandler.3 Tk_DeleteClientMessageHandler.3.*
+ ln $S CrtCmHdlr.3$Z Tk_CreateClientMessageHandler.3$Z
+ ln $S CrtCmHdlr.3$Z Tk_DeleteClientMessageHandler.3$Z
fi
if test -r CrtErrHdlr.3; then
- rm -f Tk_CreateErrorHandler.3
- rm -f Tk_DeleteErrorHandler.3
- cp CrtErrHdlr.3 Tk_CreateErrorHandler.3
- cp CrtErrHdlr.3 Tk_DeleteErrorHandler.3
+ rm -f CrtErrHdlr.3.*
+ $ZIP CrtErrHdlr.3
+ rm -f Tk_CreateErrorHandler.3 Tk_CreateErrorHandler.3.*
+ rm -f Tk_DeleteErrorHandler.3 Tk_DeleteErrorHandler.3.*
+ ln $S CrtErrHdlr.3$Z Tk_CreateErrorHandler.3$Z
+ ln $S CrtErrHdlr.3$Z Tk_DeleteErrorHandler.3$Z
fi
if test -r CrtGenHdlr.3; then
- rm -f Tk_CreateGenericHandler.3
- rm -f Tk_DeleteGenericHandler.3
- cp CrtGenHdlr.3 Tk_CreateGenericHandler.3
- cp CrtGenHdlr.3 Tk_DeleteGenericHandler.3
+ rm -f CrtGenHdlr.3.*
+ $ZIP CrtGenHdlr.3
+ rm -f Tk_CreateGenericHandler.3 Tk_CreateGenericHandler.3.*
+ rm -f Tk_DeleteGenericHandler.3 Tk_DeleteGenericHandler.3.*
+ ln $S CrtGenHdlr.3$Z Tk_CreateGenericHandler.3$Z
+ ln $S CrtGenHdlr.3$Z Tk_DeleteGenericHandler.3$Z
fi
if test -r CrtImgType.3; then
- rm -f Tk_CreateImageType.3
- rm -f Tk_GetImageMasterData.3
- rm -f Tk_InitImageArgs.3
- cp CrtImgType.3 Tk_CreateImageType.3
- cp CrtImgType.3 Tk_GetImageMasterData.3
- cp CrtImgType.3 Tk_InitImageArgs.3
+ rm -f CrtImgType.3.*
+ $ZIP CrtImgType.3
+ rm -f Tk_CreateImageType.3 Tk_CreateImageType.3.*
+ rm -f Tk_GetImageMasterData.3 Tk_GetImageMasterData.3.*
+ rm -f Tk_InitImageArgs.3 Tk_InitImageArgs.3.*
+ ln $S CrtImgType.3$Z Tk_CreateImageType.3$Z
+ ln $S CrtImgType.3$Z Tk_GetImageMasterData.3$Z
+ ln $S CrtImgType.3$Z Tk_InitImageArgs.3$Z
fi
if test -r CrtItemType.3; then
- rm -f Tk_CreateItemType.3
- rm -f Tk_GetItemTypes.3
- cp CrtItemType.3 Tk_CreateItemType.3
- cp CrtItemType.3 Tk_GetItemTypes.3
+ rm -f CrtItemType.3.*
+ $ZIP CrtItemType.3
+ rm -f Tk_CreateItemType.3 Tk_CreateItemType.3.*
+ rm -f Tk_GetItemTypes.3 Tk_GetItemTypes.3.*
+ ln $S CrtItemType.3$Z Tk_CreateItemType.3$Z
+ ln $S CrtItemType.3$Z Tk_GetItemTypes.3$Z
fi
if test -r CrtPhImgFmt.3; then
- rm -f Tk_CreatePhotoImageFormat.3
- cp CrtPhImgFmt.3 Tk_CreatePhotoImageFormat.3
+ rm -f CrtPhImgFmt.3.*
+ $ZIP CrtPhImgFmt.3
+ rm -f Tk_CreatePhotoImageFormat.3 Tk_CreatePhotoImageFormat.3.*
+ ln $S CrtPhImgFmt.3$Z Tk_CreatePhotoImageFormat.3$Z
fi
if test -r CrtSelHdlr.3; then
- rm -f Tk_CreateSelHandler.3
- rm -f Tk_DeleteSelHandler.3
- cp CrtSelHdlr.3 Tk_CreateSelHandler.3
- cp CrtSelHdlr.3 Tk_DeleteSelHandler.3
+ rm -f CrtSelHdlr.3.*
+ $ZIP CrtSelHdlr.3
+ rm -f Tk_CreateSelHandler.3 Tk_CreateSelHandler.3.*
+ rm -f Tk_DeleteSelHandler.3 Tk_DeleteSelHandler.3.*
+ ln $S CrtSelHdlr.3$Z Tk_CreateSelHandler.3$Z
+ ln $S CrtSelHdlr.3$Z Tk_DeleteSelHandler.3$Z
fi
if test -r CrtWindow.3; then
- rm -f Tk_CreateWindow.3
- rm -f Tk_CreateWindowFromPath.3
- rm -f Tk_DestroyWindow.3
- rm -f Tk_MakeWindowExist.3
- cp CrtWindow.3 Tk_CreateWindow.3
- cp CrtWindow.3 Tk_CreateWindowFromPath.3
- cp CrtWindow.3 Tk_DestroyWindow.3
- cp CrtWindow.3 Tk_MakeWindowExist.3
+ rm -f CrtWindow.3.*
+ $ZIP CrtWindow.3
+ rm -f Tk_CreateWindow.3 Tk_CreateWindow.3.*
+ rm -f Tk_CreateWindowFromPath.3 Tk_CreateWindowFromPath.3.*
+ rm -f Tk_DestroyWindow.3 Tk_DestroyWindow.3.*
+ rm -f Tk_MakeWindowExist.3 Tk_MakeWindowExist.3.*
+ ln $S CrtWindow.3$Z Tk_CreateWindow.3$Z
+ ln $S CrtWindow.3$Z Tk_CreateWindowFromPath.3$Z
+ ln $S CrtWindow.3$Z Tk_DestroyWindow.3$Z
+ ln $S CrtWindow.3$Z Tk_MakeWindowExist.3$Z
fi
if test -r DeleteImg.3; then
- rm -f Tk_DeleteImage.3
- cp DeleteImg.3 Tk_DeleteImage.3
+ rm -f DeleteImg.3.*
+ $ZIP DeleteImg.3
+ rm -f Tk_DeleteImage.3 Tk_DeleteImage.3.*
+ ln $S DeleteImg.3$Z Tk_DeleteImage.3$Z
fi
if test -r DrawFocHlt.3; then
- rm -f Tk_DrawFocusHighlight.3
- cp DrawFocHlt.3 Tk_DrawFocusHighlight.3
+ rm -f DrawFocHlt.3.*
+ $ZIP DrawFocHlt.3
+ rm -f Tk_DrawFocusHighlight.3 Tk_DrawFocusHighlight.3.*
+ ln $S DrawFocHlt.3$Z Tk_DrawFocusHighlight.3$Z
fi
if test -r EventHndlr.3; then
- rm -f Tk_CreateEventHandler.3
- rm -f Tk_DeleteEventHandler.3
- cp EventHndlr.3 Tk_CreateEventHandler.3
- cp EventHndlr.3 Tk_DeleteEventHandler.3
+ rm -f EventHndlr.3.*
+ $ZIP EventHndlr.3
+ rm -f Tk_CreateEventHandler.3 Tk_CreateEventHandler.3.*
+ rm -f Tk_DeleteEventHandler.3 Tk_DeleteEventHandler.3.*
+ ln $S EventHndlr.3$Z Tk_CreateEventHandler.3$Z
+ ln $S EventHndlr.3$Z Tk_DeleteEventHandler.3$Z
fi
if test -r FindPhoto.3; then
- rm -f Tk_FindPhoto.3
- rm -f Tk_PhotoPutBlock.3
- rm -f Tk_PhotoPutZoomedBlock.3
- rm -f Tk_PhotoGetImage.3
- rm -f Tk_PhotoBlank.3
- rm -f Tk_PhotoExpand.3
- rm -f Tk_PhotoGetSize.3
- rm -f Tk_PhotoSetSize.3
- cp FindPhoto.3 Tk_FindPhoto.3
- cp FindPhoto.3 Tk_PhotoPutBlock.3
- cp FindPhoto.3 Tk_PhotoPutZoomedBlock.3
- cp FindPhoto.3 Tk_PhotoGetImage.3
- cp FindPhoto.3 Tk_PhotoBlank.3
- cp FindPhoto.3 Tk_PhotoExpand.3
- cp FindPhoto.3 Tk_PhotoGetSize.3
- cp FindPhoto.3 Tk_PhotoSetSize.3
+ rm -f FindPhoto.3.*
+ $ZIP FindPhoto.3
+ rm -f Tk_FindPhoto.3 Tk_FindPhoto.3.*
+ rm -f Tk_PhotoPutBlock.3 Tk_PhotoPutBlock.3.*
+ rm -f Tk_PhotoPutZoomedBlock.3 Tk_PhotoPutZoomedBlock.3.*
+ rm -f Tk_PhotoGetImage.3 Tk_PhotoGetImage.3.*
+ rm -f Tk_PhotoBlank.3 Tk_PhotoBlank.3.*
+ rm -f Tk_PhotoExpand.3 Tk_PhotoExpand.3.*
+ rm -f Tk_PhotoGetSize.3 Tk_PhotoGetSize.3.*
+ rm -f Tk_PhotoSetSize.3 Tk_PhotoSetSize.3.*
+ ln $S FindPhoto.3$Z Tk_FindPhoto.3$Z
+ ln $S FindPhoto.3$Z Tk_PhotoPutBlock.3$Z
+ ln $S FindPhoto.3$Z Tk_PhotoPutZoomedBlock.3$Z
+ ln $S FindPhoto.3$Z Tk_PhotoGetImage.3$Z
+ ln $S FindPhoto.3$Z Tk_PhotoBlank.3$Z
+ ln $S FindPhoto.3$Z Tk_PhotoExpand.3$Z
+ ln $S FindPhoto.3$Z Tk_PhotoGetSize.3$Z
+ ln $S FindPhoto.3$Z Tk_PhotoSetSize.3$Z
fi
if test -r FontId.3; then
- rm -f Tk_FontId.3
- rm -f Tk_FontMetrics.3
- rm -f Tk_PostscriptFontName.3
- cp FontId.3 Tk_FontId.3
- cp FontId.3 Tk_FontMetrics.3
- cp FontId.3 Tk_PostscriptFontName.3
+ rm -f FontId.3.*
+ $ZIP FontId.3
+ rm -f Tk_FontId.3 Tk_FontId.3.*
+ rm -f Tk_GetFontMetrics.3 Tk_GetFontMetrics.3.*
+ rm -f Tk_PostscriptFontName.3 Tk_PostscriptFontName.3.*
+ ln $S FontId.3$Z Tk_FontId.3$Z
+ ln $S FontId.3$Z Tk_GetFontMetrics.3$Z
+ ln $S FontId.3$Z Tk_PostscriptFontName.3$Z
fi
if test -r FreeXId.3; then
- rm -f Tk_FreeXId.3
- cp FreeXId.3 Tk_FreeXId.3
+ rm -f FreeXId.3.*
+ $ZIP FreeXId.3
+ rm -f Tk_FreeXId.3 Tk_FreeXId.3.*
+ ln $S FreeXId.3$Z Tk_FreeXId.3$Z
fi
if test -r GeomReq.3; then
- rm -f Tk_GeometryRequest.3
- rm -f Tk_SetInternalBorder.3
- cp GeomReq.3 Tk_GeometryRequest.3
- cp GeomReq.3 Tk_SetInternalBorder.3
+ rm -f GeomReq.3.*
+ $ZIP GeomReq.3
+ rm -f Tk_GeometryRequest.3 Tk_GeometryRequest.3.*
+ rm -f Tk_SetMinimumRequestSize.3 Tk_SetMinimumRequestSize.3.*
+ rm -f Tk_SetInternalBorder.3 Tk_SetInternalBorder.3.*
+ rm -f Tk_SetInternalBorderEx.3 Tk_SetInternalBorderEx.3.*
+ ln $S GeomReq.3$Z Tk_GeometryRequest.3$Z
+ ln $S GeomReq.3$Z Tk_SetMinimumRequestSize.3$Z
+ ln $S GeomReq.3$Z Tk_SetInternalBorder.3$Z
+ ln $S GeomReq.3$Z Tk_SetInternalBorderEx.3$Z
fi
if test -r GetAnchor.3; then
- rm -f Tk_GetAnchorFromObj.3
- rm -f Tk_GetAnchor.3
- rm -f Tk_NameOfAnchor.3
- cp GetAnchor.3 Tk_GetAnchorFromObj.3
- cp GetAnchor.3 Tk_GetAnchor.3
- cp GetAnchor.3 Tk_NameOfAnchor.3
+ rm -f GetAnchor.3.*
+ $ZIP GetAnchor.3
+ rm -f Tk_GetAnchorFromObj.3 Tk_GetAnchorFromObj.3.*
+ rm -f Tk_GetAnchor.3 Tk_GetAnchor.3.*
+ rm -f Tk_NameOfAnchor.3 Tk_NameOfAnchor.3.*
+ ln $S GetAnchor.3$Z Tk_GetAnchorFromObj.3$Z
+ ln $S GetAnchor.3$Z Tk_GetAnchor.3$Z
+ ln $S GetAnchor.3$Z Tk_NameOfAnchor.3$Z
fi
if test -r GetBitmap.3; then
- rm -f Tk_AllocBitmapFromObj.3
- rm -f Tk_GetBitmap.3
- rm -f Tk_GetBitmapFromObj.3
- rm -f Tk_DefineBitmap.3
- rm -f Tk_NameOfBitmap.3
- rm -f Tk_SizeOfBitmap.3
- rm -f Tk_FreeBitmapFromObj.3
- rm -f Tk_FreeBitmap.3
- rm -f Tk_GetBitmapFromData.3
- cp GetBitmap.3 Tk_AllocBitmapFromObj.3
- cp GetBitmap.3 Tk_GetBitmap.3
- cp GetBitmap.3 Tk_GetBitmapFromObj.3
- cp GetBitmap.3 Tk_DefineBitmap.3
- cp GetBitmap.3 Tk_NameOfBitmap.3
- cp GetBitmap.3 Tk_SizeOfBitmap.3
- cp GetBitmap.3 Tk_FreeBitmapFromObj.3
- cp GetBitmap.3 Tk_FreeBitmap.3
- cp GetBitmap.3 Tk_GetBitmapFromData.3
+ rm -f GetBitmap.3.*
+ $ZIP GetBitmap.3
+ rm -f Tk_AllocBitmapFromObj.3 Tk_AllocBitmapFromObj.3.*
+ rm -f Tk_GetBitmap.3 Tk_GetBitmap.3.*
+ rm -f Tk_GetBitmapFromObj.3 Tk_GetBitmapFromObj.3.*
+ rm -f Tk_DefineBitmap.3 Tk_DefineBitmap.3.*
+ rm -f Tk_NameOfBitmap.3 Tk_NameOfBitmap.3.*
+ rm -f Tk_SizeOfBitmap.3 Tk_SizeOfBitmap.3.*
+ rm -f Tk_FreeBitmapFromObj.3 Tk_FreeBitmapFromObj.3.*
+ rm -f Tk_FreeBitmap.3 Tk_FreeBitmap.3.*
+ ln $S GetBitmap.3$Z Tk_AllocBitmapFromObj.3$Z
+ ln $S GetBitmap.3$Z Tk_GetBitmap.3$Z
+ ln $S GetBitmap.3$Z Tk_GetBitmapFromObj.3$Z
+ ln $S GetBitmap.3$Z Tk_DefineBitmap.3$Z
+ ln $S GetBitmap.3$Z Tk_NameOfBitmap.3$Z
+ ln $S GetBitmap.3$Z Tk_SizeOfBitmap.3$Z
+ ln $S GetBitmap.3$Z Tk_FreeBitmapFromObj.3$Z
+ ln $S GetBitmap.3$Z Tk_FreeBitmap.3$Z
fi
if test -r GetCapStyl.3; then
- rm -f Tk_GetCapStyle.3
- rm -f Tk_NameOfCapStyle.3
- cp GetCapStyl.3 Tk_GetCapStyle.3
- cp GetCapStyl.3 Tk_NameOfCapStyle.3
+ rm -f GetCapStyl.3.*
+ $ZIP GetCapStyl.3
+ rm -f Tk_GetCapStyle.3 Tk_GetCapStyle.3.*
+ rm -f Tk_NameOfCapStyle.3 Tk_NameOfCapStyle.3.*
+ ln $S GetCapStyl.3$Z Tk_GetCapStyle.3$Z
+ ln $S GetCapStyl.3$Z Tk_NameOfCapStyle.3$Z
fi
if test -r GetClrmap.3; then
- rm -f Tk_GetColormap.3
- rm -f Tk_FreeColormap.3
- cp GetClrmap.3 Tk_GetColormap.3
- cp GetClrmap.3 Tk_FreeColormap.3
+ rm -f GetClrmap.3.*
+ $ZIP GetClrmap.3
+ rm -f Tk_GetColormap.3 Tk_GetColormap.3.*
+ rm -f Tk_FreeColormap.3 Tk_FreeColormap.3.*
+ ln $S GetClrmap.3$Z Tk_GetColormap.3$Z
+ ln $S GetClrmap.3$Z Tk_FreeColormap.3$Z
fi
if test -r GetColor.3; then
- rm -f Tk_AllocColorFromObj.3
- rm -f Tk_GetColor.3
- rm -f Tk_GetColorFromObj.3
- rm -f Tk_GetColorByValue.3
- rm -f Tk_NameOfColor.3
- rm -f Tk_FreeColorFromObj.3
- rm -f Tk_FreeColor.3
- cp GetColor.3 Tk_AllocColorFromObj.3
- cp GetColor.3 Tk_GetColor.3
- cp GetColor.3 Tk_GetColorFromObj.3
- cp GetColor.3 Tk_GetColorByValue.3
- cp GetColor.3 Tk_NameOfColor.3
- cp GetColor.3 Tk_FreeColorFromObj.3
- cp GetColor.3 Tk_FreeColor.3
+ rm -f GetColor.3.*
+ $ZIP GetColor.3
+ rm -f Tk_AllocColorFromObj.3 Tk_AllocColorFromObj.3.*
+ rm -f Tk_GetColor.3 Tk_GetColor.3.*
+ rm -f Tk_GetColorFromObj.3 Tk_GetColorFromObj.3.*
+ rm -f Tk_GetColorByValue.3 Tk_GetColorByValue.3.*
+ rm -f Tk_NameOfColor.3 Tk_NameOfColor.3.*
+ rm -f Tk_FreeColorFromObj.3 Tk_FreeColorFromObj.3.*
+ rm -f Tk_FreeColor.3 Tk_FreeColor.3.*
+ ln $S GetColor.3$Z Tk_AllocColorFromObj.3$Z
+ ln $S GetColor.3$Z Tk_GetColor.3$Z
+ ln $S GetColor.3$Z Tk_GetColorFromObj.3$Z
+ ln $S GetColor.3$Z Tk_GetColorByValue.3$Z
+ ln $S GetColor.3$Z Tk_NameOfColor.3$Z
+ ln $S GetColor.3$Z Tk_FreeColorFromObj.3$Z
+ ln $S GetColor.3$Z Tk_FreeColor.3$Z
fi
if test -r GetCursor.3; then
- rm -f Tk_AllocCursorFromObj.3
- rm -f Tk_GetCursor.3
- rm -f Tk_GetCursorFromObj.3
- rm -f Tk_GetCursorFromData.3
- rm -f Tk_NameOfCursor.3
- rm -f Tk_FreeCursorFromObj.3
- rm -f Tk_FreeCursor.3
- cp GetCursor.3 Tk_AllocCursorFromObj.3
- cp GetCursor.3 Tk_GetCursor.3
- cp GetCursor.3 Tk_GetCursorFromObj.3
- cp GetCursor.3 Tk_GetCursorFromData.3
- cp GetCursor.3 Tk_NameOfCursor.3
- cp GetCursor.3 Tk_FreeCursorFromObj.3
- cp GetCursor.3 Tk_FreeCursor.3
+ rm -f GetCursor.3.*
+ $ZIP GetCursor.3
+ rm -f Tk_AllocCursorFromObj.3 Tk_AllocCursorFromObj.3.*
+ rm -f Tk_GetCursor.3 Tk_GetCursor.3.*
+ rm -f Tk_GetCursorFromObj.3 Tk_GetCursorFromObj.3.*
+ rm -f Tk_GetCursorFromData.3 Tk_GetCursorFromData.3.*
+ rm -f Tk_NameOfCursor.3 Tk_NameOfCursor.3.*
+ rm -f Tk_FreeCursorFromObj.3 Tk_FreeCursorFromObj.3.*
+ rm -f Tk_FreeCursor.3 Tk_FreeCursor.3.*
+ ln $S GetCursor.3$Z Tk_AllocCursorFromObj.3$Z
+ ln $S GetCursor.3$Z Tk_GetCursor.3$Z
+ ln $S GetCursor.3$Z Tk_GetCursorFromObj.3$Z
+ ln $S GetCursor.3$Z Tk_GetCursorFromData.3$Z
+ ln $S GetCursor.3$Z Tk_NameOfCursor.3$Z
+ ln $S GetCursor.3$Z Tk_FreeCursorFromObj.3$Z
+ ln $S GetCursor.3$Z Tk_FreeCursor.3$Z
fi
if test -r GetDash.3; then
- rm -f Tk_GetDash.3
- cp GetDash.3 Tk_GetDash.3
+ rm -f GetDash.3.*
+ $ZIP GetDash.3
+ rm -f Tk_GetDash.3 Tk_GetDash.3.*
+ ln $S GetDash.3$Z Tk_GetDash.3$Z
fi
if test -r GetFont.3; then
- rm -f Tk_AllocFontFromObj.3
- rm -f Tk_GetFont.3
- rm -f Tk_GetFontFromObj.3
- rm -f Tk_NameOfFont.3
- rm -f Tk_FreeFontFromObj.3
- rm -f Tk_FreeFont.3
- cp GetFont.3 Tk_AllocFontFromObj.3
- cp GetFont.3 Tk_GetFont.3
- cp GetFont.3 Tk_GetFontFromObj.3
- cp GetFont.3 Tk_NameOfFont.3
- cp GetFont.3 Tk_FreeFontFromObj.3
- cp GetFont.3 Tk_FreeFont.3
+ rm -f GetFont.3.*
+ $ZIP GetFont.3
+ rm -f Tk_AllocFontFromObj.3 Tk_AllocFontFromObj.3.*
+ rm -f Tk_GetFont.3 Tk_GetFont.3.*
+ rm -f Tk_GetFontFromObj.3 Tk_GetFontFromObj.3.*
+ rm -f Tk_NameOfFont.3 Tk_NameOfFont.3.*
+ rm -f Tk_FreeFontFromObj.3 Tk_FreeFontFromObj.3.*
+ rm -f Tk_FreeFont.3 Tk_FreeFont.3.*
+ ln $S GetFont.3$Z Tk_AllocFontFromObj.3$Z
+ ln $S GetFont.3$Z Tk_GetFont.3$Z
+ ln $S GetFont.3$Z Tk_GetFontFromObj.3$Z
+ ln $S GetFont.3$Z Tk_NameOfFont.3$Z
+ ln $S GetFont.3$Z Tk_FreeFontFromObj.3$Z
+ ln $S GetFont.3$Z Tk_FreeFont.3$Z
fi
if test -r GetGC.3; then
- rm -f Tk_GetGC.3
- rm -f Tk_FreeGC.3
- cp GetGC.3 Tk_GetGC.3
- cp GetGC.3 Tk_FreeGC.3
+ rm -f GetGC.3.*
+ $ZIP GetGC.3
+ rm -f Tk_GetGC.3 Tk_GetGC.3.*
+ rm -f Tk_FreeGC.3 Tk_FreeGC.3.*
+ ln $S GetGC.3$Z Tk_GetGC.3$Z
+ ln $S GetGC.3$Z Tk_FreeGC.3$Z
fi
if test -r GetHINSTANCE.3; then
- rm -f Tk_GetHINSTANCE.3
- cp GetHINSTANCE.3 Tk_GetHINSTANCE.3
+ rm -f GetHINSTANCE.3.*
+ $ZIP GetHINSTANCE.3
+ rm -f Tk_GetHINSTANCE.3 Tk_GetHINSTANCE.3.*
+ ln $S GetHINSTANCE.3$Z Tk_GetHINSTANCE.3$Z
fi
if test -r GetHWND.3; then
- rm -f Tk_GetHWND.3
- cp GetHWND.3 Tk_GetHWND.3
+ rm -f GetHWND.3.*
+ $ZIP GetHWND.3
+ rm -f Tk_GetHWND.3 Tk_GetHWND.3.*
+ ln $S GetHWND.3$Z Tk_GetHWND.3$Z
fi
if test -r GetImage.3; then
- rm -f Tk_GetImage.3
- rm -f Tk_RedrawImage.3
- rm -f Tk_SizeOfImage.3
- rm -f Tk_FreeImage.3
- cp GetImage.3 Tk_GetImage.3
- cp GetImage.3 Tk_RedrawImage.3
- cp GetImage.3 Tk_SizeOfImage.3
- cp GetImage.3 Tk_FreeImage.3
+ rm -f GetImage.3.*
+ $ZIP GetImage.3
+ rm -f Tk_GetImage.3 Tk_GetImage.3.*
+ rm -f Tk_RedrawImage.3 Tk_RedrawImage.3.*
+ rm -f Tk_SizeOfImage.3 Tk_SizeOfImage.3.*
+ rm -f Tk_FreeImage.3 Tk_FreeImage.3.*
+ ln $S GetImage.3$Z Tk_GetImage.3$Z
+ ln $S GetImage.3$Z Tk_RedrawImage.3$Z
+ ln $S GetImage.3$Z Tk_SizeOfImage.3$Z
+ ln $S GetImage.3$Z Tk_FreeImage.3$Z
fi
if test -r GetJoinStl.3; then
- rm -f Tk_GetJoinStyle.3
- rm -f Tk_NameOfJoinStyle.3
- cp GetJoinStl.3 Tk_GetJoinStyle.3
- cp GetJoinStl.3 Tk_NameOfJoinStyle.3
+ rm -f GetJoinStl.3.*
+ $ZIP GetJoinStl.3
+ rm -f Tk_GetJoinStyle.3 Tk_GetJoinStyle.3.*
+ rm -f Tk_NameOfJoinStyle.3 Tk_NameOfJoinStyle.3.*
+ ln $S GetJoinStl.3$Z Tk_GetJoinStyle.3$Z
+ ln $S GetJoinStl.3$Z Tk_NameOfJoinStyle.3$Z
fi
if test -r GetJustify.3; then
- rm -f Tk_GetJustifyFromObj.3
- rm -f Tk_GetJustify.3
- rm -f Tk_NameOfJustify.3
- cp GetJustify.3 Tk_GetJustifyFromObj.3
- cp GetJustify.3 Tk_GetJustify.3
- cp GetJustify.3 Tk_NameOfJustify.3
+ rm -f GetJustify.3.*
+ $ZIP GetJustify.3
+ rm -f Tk_GetJustifyFromObj.3 Tk_GetJustifyFromObj.3.*
+ rm -f Tk_GetJustify.3 Tk_GetJustify.3.*
+ rm -f Tk_NameOfJustify.3 Tk_NameOfJustify.3.*
+ ln $S GetJustify.3$Z Tk_GetJustifyFromObj.3$Z
+ ln $S GetJustify.3$Z Tk_GetJustify.3$Z
+ ln $S GetJustify.3$Z Tk_NameOfJustify.3$Z
fi
if test -r GetOption.3; then
- rm -f Tk_GetOption.3
- cp GetOption.3 Tk_GetOption.3
+ rm -f GetOption.3.*
+ $ZIP GetOption.3
+ rm -f Tk_GetOption.3 Tk_GetOption.3.*
+ ln $S GetOption.3$Z Tk_GetOption.3$Z
fi
if test -r GetPixels.3; then
- rm -f Tk_GetPixelsFromObj.3
- rm -f Tk_GetPixels.3
- rm -f Tk_GetMMFromObj.3
- rm -f Tk_GetScreenMM.3
- cp GetPixels.3 Tk_GetPixelsFromObj.3
- cp GetPixels.3 Tk_GetPixels.3
- cp GetPixels.3 Tk_GetMMFromObj.3
- cp GetPixels.3 Tk_GetScreenMM.3
+ rm -f GetPixels.3.*
+ $ZIP GetPixels.3
+ rm -f Tk_GetPixelsFromObj.3 Tk_GetPixelsFromObj.3.*
+ rm -f Tk_GetPixels.3 Tk_GetPixels.3.*
+ rm -f Tk_GetMMFromObj.3 Tk_GetMMFromObj.3.*
+ rm -f Tk_GetScreenMM.3 Tk_GetScreenMM.3.*
+ ln $S GetPixels.3$Z Tk_GetPixelsFromObj.3$Z
+ ln $S GetPixels.3$Z Tk_GetPixels.3$Z
+ ln $S GetPixels.3$Z Tk_GetMMFromObj.3$Z
+ ln $S GetPixels.3$Z Tk_GetScreenMM.3$Z
fi
if test -r GetPixmap.3; then
- rm -f Tk_GetPixmap.3
- rm -f Tk_FreePixmap.3
- cp GetPixmap.3 Tk_GetPixmap.3
- cp GetPixmap.3 Tk_FreePixmap.3
+ rm -f GetPixmap.3.*
+ $ZIP GetPixmap.3
+ rm -f Tk_GetPixmap.3 Tk_GetPixmap.3.*
+ rm -f Tk_FreePixmap.3 Tk_FreePixmap.3.*
+ ln $S GetPixmap.3$Z Tk_GetPixmap.3$Z
+ ln $S GetPixmap.3$Z Tk_FreePixmap.3$Z
fi
if test -r GetRelief.3; then
- rm -f Tk_GetReliefFromObj.3
- rm -f Tk_GetRelief.3
- rm -f Tk_NameOfRelief.3
- cp GetRelief.3 Tk_GetReliefFromObj.3
- cp GetRelief.3 Tk_GetRelief.3
- cp GetRelief.3 Tk_NameOfRelief.3
+ rm -f GetRelief.3.*
+ $ZIP GetRelief.3
+ rm -f Tk_GetReliefFromObj.3 Tk_GetReliefFromObj.3.*
+ rm -f Tk_GetRelief.3 Tk_GetRelief.3.*
+ rm -f Tk_NameOfRelief.3 Tk_NameOfRelief.3.*
+ ln $S GetRelief.3$Z Tk_GetReliefFromObj.3$Z
+ ln $S GetRelief.3$Z Tk_GetRelief.3$Z
+ ln $S GetRelief.3$Z Tk_NameOfRelief.3$Z
fi
if test -r GetRootCrd.3; then
- rm -f Tk_GetRootCoords.3
- cp GetRootCrd.3 Tk_GetRootCoords.3
+ rm -f GetRootCrd.3.*
+ $ZIP GetRootCrd.3
+ rm -f Tk_GetRootCoords.3 Tk_GetRootCoords.3.*
+ ln $S GetRootCrd.3$Z Tk_GetRootCoords.3$Z
fi
if test -r GetScroll.3; then
- rm -f Tk_GetScrollInfo.3
- rm -f Tk_GetScrollInfoObj.3
- cp GetScroll.3 Tk_GetScrollInfo.3
- cp GetScroll.3 Tk_GetScrollInfoObj.3
+ rm -f GetScroll.3.*
+ $ZIP GetScroll.3
+ rm -f Tk_GetScrollInfo.3 Tk_GetScrollInfo.3.*
+ rm -f Tk_GetScrollInfoObj.3 Tk_GetScrollInfoObj.3.*
+ ln $S GetScroll.3$Z Tk_GetScrollInfo.3$Z
+ ln $S GetScroll.3$Z Tk_GetScrollInfoObj.3$Z
fi
if test -r GetSelect.3; then
- rm -f Tk_GetSelection.3
- cp GetSelect.3 Tk_GetSelection.3
+ rm -f GetSelect.3.*
+ $ZIP GetSelect.3
+ rm -f Tk_GetSelection.3 Tk_GetSelection.3.*
+ ln $S GetSelect.3$Z Tk_GetSelection.3$Z
fi
if test -r GetUid.3; then
- rm -f Tk_GetUid.3
- rm -f Tk_Uid.3
- cp GetUid.3 Tk_GetUid.3
- cp GetUid.3 Tk_Uid.3
+ rm -f GetUid.3.*
+ $ZIP GetUid.3
+ rm -f Tk_GetUid.3 Tk_GetUid.3.*
+ rm -f Tk_Uid.3 Tk_Uid.3.*
+ ln $S GetUid.3$Z Tk_GetUid.3$Z
+ ln $S GetUid.3$Z Tk_Uid.3$Z
fi
if test -r GetVRoot.3; then
- rm -f Tk_GetVRootGeometry.3
- cp GetVRoot.3 Tk_GetVRootGeometry.3
+ rm -f GetVRoot.3.*
+ $ZIP GetVRoot.3
+ rm -f Tk_GetVRootGeometry.3 Tk_GetVRootGeometry.3.*
+ ln $S GetVRoot.3$Z Tk_GetVRootGeometry.3$Z
fi
if test -r GetVisual.3; then
- rm -f Tk_GetVisual.3
- cp GetVisual.3 Tk_GetVisual.3
+ rm -f GetVisual.3.*
+ $ZIP GetVisual.3
+ rm -f Tk_GetVisual.3 Tk_GetVisual.3.*
+ ln $S GetVisual.3$Z Tk_GetVisual.3$Z
fi
if test -r Grab.3; then
- rm -f Tk_Grab.3
- rm -f Tk_Ungrab.3
- cp Grab.3 Tk_Grab.3
- cp Grab.3 Tk_Ungrab.3
+ rm -f Grab.3.*
+ $ZIP Grab.3
+ rm -f Tk_Grab.3 Tk_Grab.3.*
+ rm -f Tk_Ungrab.3 Tk_Ungrab.3.*
+ ln $S Grab.3$Z Tk_Grab.3$Z
+ ln $S Grab.3$Z Tk_Ungrab.3$Z
fi
if test -r HWNDToWindow.3; then
- rm -f Tk_HWNDToWindow.3
- cp HWNDToWindow.3 Tk_HWNDToWindow.3
+ rm -f HWNDToWindow.3.*
+ $ZIP HWNDToWindow.3
+ rm -f Tk_HWNDToWindow.3 Tk_HWNDToWindow.3.*
+ ln $S HWNDToWindow.3$Z Tk_HWNDToWindow.3$Z
fi
if test -r HandleEvent.3; then
- rm -f Tk_HandleEvent.3
- cp HandleEvent.3 Tk_HandleEvent.3
+ rm -f HandleEvent.3.*
+ $ZIP HandleEvent.3
+ rm -f Tk_HandleEvent.3 Tk_HandleEvent.3.*
+ ln $S HandleEvent.3$Z Tk_HandleEvent.3$Z
fi
if test -r IdToWindow.3; then
- rm -f Tk_IdToWindow.3
- cp IdToWindow.3 Tk_IdToWindow.3
+ rm -f IdToWindow.3.*
+ $ZIP IdToWindow.3
+ rm -f Tk_IdToWindow.3 Tk_IdToWindow.3.*
+ ln $S IdToWindow.3$Z Tk_IdToWindow.3$Z
fi
if test -r ImgChanged.3; then
- rm -f Tk_ImageChanged.3
- cp ImgChanged.3 Tk_ImageChanged.3
+ rm -f ImgChanged.3.*
+ $ZIP ImgChanged.3
+ rm -f Tk_ImageChanged.3 Tk_ImageChanged.3.*
+ ln $S ImgChanged.3$Z Tk_ImageChanged.3$Z
fi
if test -r InternAtom.3; then
- rm -f Tk_InternAtom.3
- rm -f Tk_GetAtomName.3
- cp InternAtom.3 Tk_InternAtom.3
- cp InternAtom.3 Tk_GetAtomName.3
+ rm -f InternAtom.3.*
+ $ZIP InternAtom.3
+ rm -f Tk_InternAtom.3 Tk_InternAtom.3.*
+ rm -f Tk_GetAtomName.3 Tk_GetAtomName.3.*
+ ln $S InternAtom.3$Z Tk_InternAtom.3$Z
+ ln $S InternAtom.3$Z Tk_GetAtomName.3$Z
fi
if test -r MainLoop.3; then
- rm -f Tk_MainLoop.3
- cp MainLoop.3 Tk_MainLoop.3
+ rm -f MainLoop.3.*
+ $ZIP MainLoop.3
+ rm -f Tk_MainLoop.3 Tk_MainLoop.3.*
+ ln $S MainLoop.3$Z Tk_MainLoop.3$Z
fi
if test -r MainWin.3; then
- rm -f Tk_MainWindow.3
- rm -f Tk_GetNumMainWindows.3
- cp MainWin.3 Tk_MainWindow.3
- cp MainWin.3 Tk_GetNumMainWindows.3
+ rm -f MainWin.3.*
+ $ZIP MainWin.3
+ rm -f Tk_MainWindow.3 Tk_MainWindow.3.*
+ rm -f Tk_GetNumMainWindows.3 Tk_GetNumMainWindows.3.*
+ ln $S MainWin.3$Z Tk_MainWindow.3$Z
+ ln $S MainWin.3$Z Tk_GetNumMainWindows.3$Z
fi
if test -r MaintGeom.3; then
- rm -f Tk_MaintainGeometry.3
- rm -f Tk_UnmaintainGeometry.3
- cp MaintGeom.3 Tk_MaintainGeometry.3
- cp MaintGeom.3 Tk_UnmaintainGeometry.3
+ rm -f MaintGeom.3.*
+ $ZIP MaintGeom.3
+ rm -f Tk_MaintainGeometry.3 Tk_MaintainGeometry.3.*
+ rm -f Tk_UnmaintainGeometry.3 Tk_UnmaintainGeometry.3.*
+ ln $S MaintGeom.3$Z Tk_MaintainGeometry.3$Z
+ ln $S MaintGeom.3$Z Tk_UnmaintainGeometry.3$Z
fi
if test -r ManageGeom.3; then
- rm -f Tk_ManageGeometry.3
- cp ManageGeom.3 Tk_ManageGeometry.3
+ rm -f ManageGeom.3.*
+ $ZIP ManageGeom.3
+ rm -f Tk_ManageGeometry.3 Tk_ManageGeometry.3.*
+ ln $S ManageGeom.3$Z Tk_ManageGeometry.3$Z
fi
if test -r MapWindow.3; then
- rm -f Tk_MapWindow.3
- rm -f Tk_UnmapWindow.3
- cp MapWindow.3 Tk_MapWindow.3
- cp MapWindow.3 Tk_UnmapWindow.3
+ rm -f MapWindow.3.*
+ $ZIP MapWindow.3
+ rm -f Tk_MapWindow.3 Tk_MapWindow.3.*
+ rm -f Tk_UnmapWindow.3 Tk_UnmapWindow.3.*
+ ln $S MapWindow.3$Z Tk_MapWindow.3$Z
+ ln $S MapWindow.3$Z Tk_UnmapWindow.3$Z
fi
if test -r MeasureChar.3; then
- rm -f Tk_MeasureChars.3
- rm -f Tk_TextWidth.3
- rm -f Tk_DrawChars.3
- rm -f Tk_UnderlineChars.3
- cp MeasureChar.3 Tk_MeasureChars.3
- cp MeasureChar.3 Tk_TextWidth.3
- cp MeasureChar.3 Tk_DrawChars.3
- cp MeasureChar.3 Tk_UnderlineChars.3
+ rm -f MeasureChar.3.*
+ $ZIP MeasureChar.3
+ rm -f Tk_MeasureChars.3 Tk_MeasureChars.3.*
+ rm -f Tk_TextWidth.3 Tk_TextWidth.3.*
+ rm -f Tk_DrawChars.3 Tk_DrawChars.3.*
+ rm -f Tk_UnderlineChars.3 Tk_UnderlineChars.3.*
+ ln $S MeasureChar.3$Z Tk_MeasureChars.3$Z
+ ln $S MeasureChar.3$Z Tk_TextWidth.3$Z
+ ln $S MeasureChar.3$Z Tk_DrawChars.3$Z
+ ln $S MeasureChar.3$Z Tk_UnderlineChars.3$Z
fi
if test -r MoveToplev.3; then
- rm -f Tk_MoveToplevelWindow.3
- cp MoveToplev.3 Tk_MoveToplevelWindow.3
+ rm -f MoveToplev.3.*
+ $ZIP MoveToplev.3
+ rm -f Tk_MoveToplevelWindow.3 Tk_MoveToplevelWindow.3.*
+ ln $S MoveToplev.3$Z Tk_MoveToplevelWindow.3$Z
fi
if test -r Name.3; then
- rm -f Tk_Name.3
- rm -f Tk_PathName.3
- rm -f Tk_NameToWindow.3
- cp Name.3 Tk_Name.3
- cp Name.3 Tk_PathName.3
- cp Name.3 Tk_NameToWindow.3
+ rm -f Name.3.*
+ $ZIP Name.3
+ rm -f Tk_Name.3 Tk_Name.3.*
+ rm -f Tk_PathName.3 Tk_PathName.3.*
+ rm -f Tk_NameToWindow.3 Tk_NameToWindow.3.*
+ ln $S Name.3$Z Tk_Name.3$Z
+ ln $S Name.3$Z Tk_PathName.3$Z
+ ln $S Name.3$Z Tk_NameToWindow.3$Z
fi
if test -r NameOfImg.3; then
- rm -f Tk_NameOfImage.3
- cp NameOfImg.3 Tk_NameOfImage.3
+ rm -f NameOfImg.3.*
+ $ZIP NameOfImg.3
+ rm -f Tk_NameOfImage.3 Tk_NameOfImage.3.*
+ ln $S NameOfImg.3$Z Tk_NameOfImage.3$Z
fi
if test -r OwnSelect.3; then
- rm -f Tk_OwnSelection.3
- cp OwnSelect.3 Tk_OwnSelection.3
+ rm -f OwnSelect.3.*
+ $ZIP OwnSelect.3
+ rm -f Tk_OwnSelection.3 Tk_OwnSelection.3.*
+ ln $S OwnSelect.3$Z Tk_OwnSelection.3$Z
fi
if test -r ParseArgv.3; then
- rm -f Tk_ParseArgv.3
- cp ParseArgv.3 Tk_ParseArgv.3
+ rm -f ParseArgv.3.*
+ $ZIP ParseArgv.3
+ rm -f Tk_ParseArgv.3 Tk_ParseArgv.3.*
+ ln $S ParseArgv.3$Z Tk_ParseArgv.3$Z
fi
if test -r QWinEvent.3; then
- rm -f Tk_QueueWindowEvent.3
- cp QWinEvent.3 Tk_QueueWindowEvent.3
+ rm -f QWinEvent.3.*
+ $ZIP QWinEvent.3
+ rm -f Tk_CollapseMotionEvents.3 Tk_CollapseMotionEvents.3.*
+ rm -f Tk_QueueWindowEvent.3 Tk_QueueWindowEvent.3.*
+ ln $S QWinEvent.3$Z Tk_CollapseMotionEvents.3$Z
+ ln $S QWinEvent.3$Z Tk_QueueWindowEvent.3$Z
fi
if test -r Restack.3; then
- rm -f Tk_RestackWindow.3
- cp Restack.3 Tk_RestackWindow.3
+ rm -f Restack.3.*
+ $ZIP Restack.3
+ rm -f Tk_RestackWindow.3 Tk_RestackWindow.3.*
+ ln $S Restack.3$Z Tk_RestackWindow.3$Z
fi
if test -r RestrictEv.3; then
- rm -f Tk_RestrictEvents.3
- cp RestrictEv.3 Tk_RestrictEvents.3
+ rm -f RestrictEv.3.*
+ $ZIP RestrictEv.3
+ rm -f Tk_RestrictEvents.3 Tk_RestrictEvents.3.*
+ ln $S RestrictEv.3$Z Tk_RestrictEvents.3$Z
fi
if test -r SetAppName.3; then
- rm -f Tk_SetAppName.3
- cp SetAppName.3 Tk_SetAppName.3
+ rm -f SetAppName.3.*
+ $ZIP SetAppName.3
+ rm -f Tk_SetAppName.3 Tk_SetAppName.3.*
+ ln $S SetAppName.3$Z Tk_SetAppName.3$Z
+fi
+if test -r SetCaret.3; then
+ rm -f SetCaret.3.*
+ $ZIP SetCaret.3
+ rm -f Tk_SetCaretPos.3 Tk_SetCaretPos.3.*
+ ln $S SetCaret.3$Z Tk_SetCaretPos.3$Z
fi
if test -r SetClass.3; then
- rm -f Tk_SetClass.3
- rm -f Tk_Class.3
- cp SetClass.3 Tk_SetClass.3
- cp SetClass.3 Tk_Class.3
+ rm -f SetClass.3.*
+ $ZIP SetClass.3
+ rm -f Tk_SetClass.3 Tk_SetClass.3.*
+ rm -f Tk_Class.3 Tk_Class.3.*
+ ln $S SetClass.3$Z Tk_SetClass.3$Z
+ ln $S SetClass.3$Z Tk_Class.3$Z
+fi
+if test -r SetClassProcs.3; then
+ rm -f SetClassProcs.3.*
+ $ZIP SetClassProcs.3
+ rm -f Tk_SetClassProcs.3 Tk_SetClassProcs.3.*
+ ln $S SetClassProcs.3$Z Tk_SetClassProcs.3$Z
fi
if test -r SetGrid.3; then
- rm -f Tk_SetGrid.3
- rm -f Tk_UnsetGrid.3
- cp SetGrid.3 Tk_SetGrid.3
- cp SetGrid.3 Tk_UnsetGrid.3
+ rm -f SetGrid.3.*
+ $ZIP SetGrid.3
+ rm -f Tk_SetGrid.3 Tk_SetGrid.3.*
+ rm -f Tk_UnsetGrid.3 Tk_UnsetGrid.3.*
+ ln $S SetGrid.3$Z Tk_SetGrid.3$Z
+ ln $S SetGrid.3$Z Tk_UnsetGrid.3$Z
fi
if test -r SetOptions.3; then
- rm -f Tk_CreateOptionTable.3
- rm -f Tk_DeleteOptionTable.3
- rm -f Tk_InitOptions.3
- rm -f Tk_SetOptions.3
- rm -f Tk_FreeSavedOptions.3
- rm -f Tk_RestoreSavedOptions.3
- rm -f Tk_GetOptionValue.3
- rm -f Tk_GetOptionInfo.3
- rm -f Tk_FreeConfigOptions.3
- rm -f Tk_Offset.3
- cp SetOptions.3 Tk_CreateOptionTable.3
- cp SetOptions.3 Tk_DeleteOptionTable.3
- cp SetOptions.3 Tk_InitOptions.3
- cp SetOptions.3 Tk_SetOptions.3
- cp SetOptions.3 Tk_FreeSavedOptions.3
- cp SetOptions.3 Tk_RestoreSavedOptions.3
- cp SetOptions.3 Tk_GetOptionValue.3
- cp SetOptions.3 Tk_GetOptionInfo.3
- cp SetOptions.3 Tk_FreeConfigOptions.3
- cp SetOptions.3 Tk_Offset.3
+ rm -f SetOptions.3.*
+ $ZIP SetOptions.3
+ rm -f Tk_CreateOptionTable.3 Tk_CreateOptionTable.3.*
+ rm -f Tk_DeleteOptionTable.3 Tk_DeleteOptionTable.3.*
+ rm -f Tk_InitOptions.3 Tk_InitOptions.3.*
+ rm -f Tk_SetOptions.3 Tk_SetOptions.3.*
+ rm -f Tk_FreeSavedOptions.3 Tk_FreeSavedOptions.3.*
+ rm -f Tk_RestoreSavedOptions.3 Tk_RestoreSavedOptions.3.*
+ rm -f Tk_GetOptionValue.3 Tk_GetOptionValue.3.*
+ rm -f Tk_GetOptionInfo.3 Tk_GetOptionInfo.3.*
+ rm -f Tk_FreeConfigOptions.3 Tk_FreeConfigOptions.3.*
+ rm -f Tk_Offset.3 Tk_Offset.3.*
+ ln $S SetOptions.3$Z Tk_CreateOptionTable.3$Z
+ ln $S SetOptions.3$Z Tk_DeleteOptionTable.3$Z
+ ln $S SetOptions.3$Z Tk_InitOptions.3$Z
+ ln $S SetOptions.3$Z Tk_SetOptions.3$Z
+ ln $S SetOptions.3$Z Tk_FreeSavedOptions.3$Z
+ ln $S SetOptions.3$Z Tk_RestoreSavedOptions.3$Z
+ ln $S SetOptions.3$Z Tk_GetOptionValue.3$Z
+ ln $S SetOptions.3$Z Tk_GetOptionInfo.3$Z
+ ln $S SetOptions.3$Z Tk_FreeConfigOptions.3$Z
+ ln $S SetOptions.3$Z Tk_Offset.3$Z
fi
if test -r SetVisual.3; then
- rm -f Tk_SetWindowVisual.3
- cp SetVisual.3 Tk_SetWindowVisual.3
+ rm -f SetVisual.3.*
+ $ZIP SetVisual.3
+ rm -f Tk_SetWindowVisual.3 Tk_SetWindowVisual.3.*
+ ln $S SetVisual.3$Z Tk_SetWindowVisual.3$Z
fi
if test -r StrictMotif.3; then
- rm -f Tk_StrictMotif.3
- cp StrictMotif.3 Tk_StrictMotif.3
+ rm -f StrictMotif.3.*
+ $ZIP StrictMotif.3
+ rm -f Tk_StrictMotif.3 Tk_StrictMotif.3.*
+ ln $S StrictMotif.3$Z Tk_StrictMotif.3$Z
fi
if test -r TextLayout.3; then
- rm -f Tk_ComputeTextLayout.3
- rm -f Tk_FreeTextLayout.3
- rm -f Tk_DrawTextLayout.3
- rm -f Tk_UnderlineTextLayout.3
- rm -f Tk_PointToChar.3
- rm -f Tk_CharBbox.3
- rm -f Tk_DistanceToTextLayout.3
- rm -f Tk_IntersectTextLayout.3
- rm -f Tk_TextLayoutToPostscript.3
- cp TextLayout.3 Tk_ComputeTextLayout.3
- cp TextLayout.3 Tk_FreeTextLayout.3
- cp TextLayout.3 Tk_DrawTextLayout.3
- cp TextLayout.3 Tk_UnderlineTextLayout.3
- cp TextLayout.3 Tk_PointToChar.3
- cp TextLayout.3 Tk_CharBbox.3
- cp TextLayout.3 Tk_DistanceToTextLayout.3
- cp TextLayout.3 Tk_IntersectTextLayout.3
- cp TextLayout.3 Tk_TextLayoutToPostscript.3
+ rm -f TextLayout.3.*
+ $ZIP TextLayout.3
+ rm -f Tk_ComputeTextLayout.3 Tk_ComputeTextLayout.3.*
+ rm -f Tk_FreeTextLayout.3 Tk_FreeTextLayout.3.*
+ rm -f Tk_DrawTextLayout.3 Tk_DrawTextLayout.3.*
+ rm -f Tk_UnderlineTextLayout.3 Tk_UnderlineTextLayout.3.*
+ rm -f Tk_PointToChar.3 Tk_PointToChar.3.*
+ rm -f Tk_CharBbox.3 Tk_CharBbox.3.*
+ rm -f Tk_DistanceToTextLayout.3 Tk_DistanceToTextLayout.3.*
+ rm -f Tk_IntersectTextLayout.3 Tk_IntersectTextLayout.3.*
+ rm -f Tk_TextLayoutToPostscript.3 Tk_TextLayoutToPostscript.3.*
+ ln $S TextLayout.3$Z Tk_ComputeTextLayout.3$Z
+ ln $S TextLayout.3$Z Tk_FreeTextLayout.3$Z
+ ln $S TextLayout.3$Z Tk_DrawTextLayout.3$Z
+ ln $S TextLayout.3$Z Tk_UnderlineTextLayout.3$Z
+ ln $S TextLayout.3$Z Tk_PointToChar.3$Z
+ ln $S TextLayout.3$Z Tk_CharBbox.3$Z
+ ln $S TextLayout.3$Z Tk_DistanceToTextLayout.3$Z
+ ln $S TextLayout.3$Z Tk_IntersectTextLayout.3$Z
+ ln $S TextLayout.3$Z Tk_TextLayoutToPostscript.3$Z
fi
if test -r TkInitStubs.3; then
- rm -f Tk_InitStubs.3
- cp TkInitStubs.3 Tk_InitStubs.3
+ rm -f TkInitStubs.3.*
+ $ZIP TkInitStubs.3
+ rm -f Tk_InitStubs.3 Tk_InitStubs.3.*
+ ln $S TkInitStubs.3$Z Tk_InitStubs.3$Z
+fi
+if test -r Tk_Init.3; then
+ rm -f Tk_Init.3.*
+ $ZIP Tk_Init.3
+ rm -f Tk_SafeInit.3 Tk_SafeInit.3.*
+ ln $S Tk_Init.3$Z Tk_SafeInit.3$Z
+fi
+if test -r Tk_Main.3; then
+ rm -f Tk_Main.3.*
+ $ZIP Tk_Main.3
fi
if test -r WindowId.3; then
- rm -f Tk_WindowId.3
- rm -f Tk_Parent.3
- rm -f Tk_Display.3
- rm -f Tk_DisplayName.3
- rm -f Tk_ScreenNumber.3
- rm -f Tk_Screen.3
- rm -f Tk_X.3
- rm -f Tk_Y.3
- rm -f Tk_Width.3
- rm -f Tk_Height.3
- rm -f Tk_Changes.3
- rm -f Tk_Attributes.3
- rm -f Tk_IsContainer.3
- rm -f Tk_IsEmbedded.3
- rm -f Tk_IsMapped.3
- rm -f Tk_IsTopLevel.3
- rm -f Tk_ReqWidth.3
- rm -f Tk_ReqHeight.3
- rm -f Tk_InternalBorderWidth.3
- rm -f Tk_Visual.3
- rm -f Tk_Depth.3
- rm -f Tk_Colormap.3
- cp WindowId.3 Tk_WindowId.3
- cp WindowId.3 Tk_Parent.3
- cp WindowId.3 Tk_Display.3
- cp WindowId.3 Tk_DisplayName.3
- cp WindowId.3 Tk_ScreenNumber.3
- cp WindowId.3 Tk_Screen.3
- cp WindowId.3 Tk_X.3
- cp WindowId.3 Tk_Y.3
- cp WindowId.3 Tk_Width.3
- cp WindowId.3 Tk_Height.3
- cp WindowId.3 Tk_Changes.3
- cp WindowId.3 Tk_Attributes.3
- cp WindowId.3 Tk_IsContainer.3
- cp WindowId.3 Tk_IsEmbedded.3
- cp WindowId.3 Tk_IsMapped.3
- cp WindowId.3 Tk_IsTopLevel.3
- cp WindowId.3 Tk_ReqWidth.3
- cp WindowId.3 Tk_ReqHeight.3
- cp WindowId.3 Tk_InternalBorderWidth.3
- cp WindowId.3 Tk_Visual.3
- cp WindowId.3 Tk_Depth.3
- cp WindowId.3 Tk_Colormap.3
+ rm -f WindowId.3.*
+ $ZIP WindowId.3
+ rm -f Tk_WindowId.3 Tk_WindowId.3.*
+ rm -f Tk_Parent.3 Tk_Parent.3.*
+ rm -f Tk_Display.3 Tk_Display.3.*
+ rm -f Tk_DisplayName.3 Tk_DisplayName.3.*
+ rm -f Tk_ScreenNumber.3 Tk_ScreenNumber.3.*
+ rm -f Tk_Screen.3 Tk_Screen.3.*
+ rm -f Tk_X.3 Tk_X.3.*
+ rm -f Tk_Y.3 Tk_Y.3.*
+ rm -f Tk_Width.3 Tk_Width.3.*
+ rm -f Tk_Height.3 Tk_Height.3.*
+ rm -f Tk_Changes.3 Tk_Changes.3.*
+ rm -f Tk_Attributes.3 Tk_Attributes.3.*
+ rm -f Tk_IsContainer.3 Tk_IsContainer.3.*
+ rm -f Tk_IsEmbedded.3 Tk_IsEmbedded.3.*
+ rm -f Tk_IsMapped.3 Tk_IsMapped.3.*
+ rm -f Tk_IsTopLevel.3 Tk_IsTopLevel.3.*
+ rm -f Tk_ReqWidth.3 Tk_ReqWidth.3.*
+ rm -f Tk_ReqHeight.3 Tk_ReqHeight.3.*
+ rm -f Tk_MinReqWidth.3 Tk_MinReqWidth.3.*
+ rm -f Tk_MinReqHeight.3 Tk_MinReqHeight.3.*
+ rm -f Tk_InternalBorderLeft.3 Tk_InternalBorderLeft.3.*
+ rm -f Tk_InternalBorderRight.3 Tk_InternalBorderRight.3.*
+ rm -f Tk_InternalBorderTop.3 Tk_InternalBorderTop.3.*
+ rm -f Tk_InternalBorderBottom.3 Tk_InternalBorderBottom.3.*
+ rm -f Tk_Visual.3 Tk_Visual.3.*
+ rm -f Tk_Depth.3 Tk_Depth.3.*
+ rm -f Tk_Colormap.3 Tk_Colormap.3.*
+ ln $S WindowId.3$Z Tk_WindowId.3$Z
+ ln $S WindowId.3$Z Tk_Parent.3$Z
+ ln $S WindowId.3$Z Tk_Display.3$Z
+ ln $S WindowId.3$Z Tk_DisplayName.3$Z
+ ln $S WindowId.3$Z Tk_ScreenNumber.3$Z
+ ln $S WindowId.3$Z Tk_Screen.3$Z
+ ln $S WindowId.3$Z Tk_X.3$Z
+ ln $S WindowId.3$Z Tk_Y.3$Z
+ ln $S WindowId.3$Z Tk_Width.3$Z
+ ln $S WindowId.3$Z Tk_Height.3$Z
+ ln $S WindowId.3$Z Tk_Changes.3$Z
+ ln $S WindowId.3$Z Tk_Attributes.3$Z
+ ln $S WindowId.3$Z Tk_IsContainer.3$Z
+ ln $S WindowId.3$Z Tk_IsEmbedded.3$Z
+ ln $S WindowId.3$Z Tk_IsMapped.3$Z
+ ln $S WindowId.3$Z Tk_IsTopLevel.3$Z
+ ln $S WindowId.3$Z Tk_ReqWidth.3$Z
+ ln $S WindowId.3$Z Tk_ReqHeight.3$Z
+ ln $S WindowId.3$Z Tk_MinReqWidth.3$Z
+ ln $S WindowId.3$Z Tk_MinReqHeight.3$Z
+ ln $S WindowId.3$Z Tk_InternalBorderLeft.3$Z
+ ln $S WindowId.3$Z Tk_InternalBorderRight.3$Z
+ ln $S WindowId.3$Z Tk_InternalBorderTop.3$Z
+ ln $S WindowId.3$Z Tk_InternalBorderBottom.3$Z
+ ln $S WindowId.3$Z Tk_Visual.3$Z
+ ln $S WindowId.3$Z Tk_Depth.3$Z
+ ln $S WindowId.3$Z Tk_Colormap.3$Z
+fi
+if test -r bell.n; then
+ rm -f bell.n.*
+ $ZIP bell.n
+fi
+if test -r bind.n; then
+ rm -f bind.n.*
+ $ZIP bind.n
+fi
+if test -r bindtags.n; then
+ rm -f bindtags.n.*
+ $ZIP bindtags.n
+fi
+if test -r bitmap.n; then
+ rm -f bitmap.n.*
+ $ZIP bitmap.n
+fi
+if test -r button.n; then
+ rm -f button.n.*
+ $ZIP button.n
+fi
+if test -r canvas.n; then
+ rm -f canvas.n.*
+ $ZIP canvas.n
+fi
+if test -r checkbutton.n; then
+ rm -f checkbutton.n.*
+ $ZIP checkbutton.n
fi
if test -r chooseColor.n; then
- rm -f tk_chooseColor.n
- cp chooseColor.n tk_chooseColor.n
+ rm -f chooseColor.n.*
+ $ZIP chooseColor.n
+ rm -f tk_chooseColor.n tk_chooseColor.n.*
+ ln $S chooseColor.n$Z tk_chooseColor.n$Z
fi
if test -r chooseDirectory.n; then
- rm -f tk_chooseDirectory.n
- cp chooseDirectory.n tk_chooseDirectory.n
+ rm -f chooseDirectory.n.*
+ $ZIP chooseDirectory.n
+ rm -f tk_chooseDirectory.n tk_chooseDirectory.n.*
+ ln $S chooseDirectory.n$Z tk_chooseDirectory.n$Z
+fi
+if test -r clipboard.n; then
+ rm -f clipboard.n.*
+ $ZIP clipboard.n
+fi
+if test -r colors.n; then
+ rm -f colors.n.*
+ $ZIP colors.n
+fi
+if test -r console.n; then
+ rm -f console.n.*
+ $ZIP console.n
+fi
+if test -r cursors.n; then
+ rm -f cursors.n.*
+ $ZIP cursors.n
+fi
+if test -r destroy.n; then
+ rm -f destroy.n.*
+ $ZIP destroy.n
fi
if test -r dialog.n; then
- rm -f tk_dialog.n
- cp dialog.n tk_dialog.n
+ rm -f dialog.n.*
+ $ZIP dialog.n
+ rm -f tk_dialog.n tk_dialog.n.*
+ ln $S dialog.n$Z tk_dialog.n$Z
+fi
+if test -r entry.n; then
+ rm -f entry.n.*
+ $ZIP entry.n
+fi
+if test -r event.n; then
+ rm -f event.n.*
+ $ZIP event.n
+fi
+if test -r focus.n; then
+ rm -f focus.n.*
+ $ZIP focus.n
fi
if test -r focusNext.n; then
- rm -f tk_focusNext.n
- rm -f tk_focusPrev.n
- rm -f tk_focusFollowsMouse.n
- cp focusNext.n tk_focusNext.n
- cp focusNext.n tk_focusPrev.n
- cp focusNext.n tk_focusFollowsMouse.n
+ rm -f focusNext.n.*
+ $ZIP focusNext.n
+ rm -f tk_focusNext.n tk_focusNext.n.*
+ rm -f tk_focusPrev.n tk_focusPrev.n.*
+ rm -f tk_focusFollowsMouse.n tk_focusFollowsMouse.n.*
+ ln $S focusNext.n$Z tk_focusNext.n$Z
+ ln $S focusNext.n$Z tk_focusPrev.n$Z
+ ln $S focusNext.n$Z tk_focusFollowsMouse.n$Z
+fi
+if test -r font.n; then
+ rm -f font.n.*
+ $ZIP font.n
+fi
+if test -r frame.n; then
+ rm -f frame.n.*
+ $ZIP frame.n
fi
if test -r getOpenFile.n; then
- rm -f tk_getOpenFile.n
- rm -f tk_getSaveFile.n
- cp getOpenFile.n tk_getOpenFile.n
- cp getOpenFile.n tk_getSaveFile.n
+ rm -f getOpenFile.n.*
+ $ZIP getOpenFile.n
+ rm -f tk_getOpenFile.n tk_getOpenFile.n.*
+ rm -f tk_getSaveFile.n tk_getSaveFile.n.*
+ ln $S getOpenFile.n$Z tk_getOpenFile.n$Z
+ ln $S getOpenFile.n$Z tk_getSaveFile.n$Z
+fi
+if test -r grab.n; then
+ rm -f grab.n.*
+ $ZIP grab.n
+fi
+if test -r grid.n; then
+ rm -f grid.n.*
+ $ZIP grid.n
+fi
+if test -r image.n; then
+ rm -f image.n.*
+ $ZIP image.n
+fi
+if test -r keysyms.n; then
+ rm -f keysyms.n.*
+ $ZIP keysyms.n
+fi
+if test -r label.n; then
+ rm -f label.n.*
+ $ZIP label.n
+fi
+if test -r labelframe.n; then
+ rm -f labelframe.n.*
+ $ZIP labelframe.n
+fi
+if test -r listbox.n; then
+ rm -f listbox.n.*
+ $ZIP listbox.n
+fi
+if test -r loadTk.n; then
+ rm -f loadTk.n.*
+ $ZIP loadTk.n
+fi
+if test -r lower.n; then
+ rm -f lower.n.*
+ $ZIP lower.n
+fi
+if test -r menu.n; then
+ rm -f menu.n.*
+ $ZIP menu.n
+ rm -f tk_menuSetFocus.n tk_menuSetFocus.n.*
+ ln $S menu.n$Z tk_menuSetFocus.n$Z
fi
if test -r menubar.n; then
- rm -f tk_menuBar.n
- rm -f tk_bindForTraversal.n
- cp menubar.n tk_menuBar.n
- cp menubar.n tk_bindForTraversal.n
+ rm -f menubar.n.*
+ $ZIP menubar.n
+ rm -f tk_menuBar.n tk_menuBar.n.*
+ rm -f tk_bindForTraversal.n tk_bindForTraversal.n.*
+ ln $S menubar.n$Z tk_menuBar.n$Z
+ ln $S menubar.n$Z tk_bindForTraversal.n$Z
+fi
+if test -r menubutton.n; then
+ rm -f menubutton.n.*
+ $ZIP menubutton.n
+fi
+if test -r message.n; then
+ rm -f message.n.*
+ $ZIP message.n
fi
if test -r messageBox.n; then
- rm -f tk_messageBox.n
- cp messageBox.n tk_messageBox.n
+ rm -f messageBox.n.*
+ $ZIP messageBox.n
+ rm -f tk_messageBox.n tk_messageBox.n.*
+ ln $S messageBox.n$Z tk_messageBox.n$Z
+fi
+if test -r option.n; then
+ rm -f option.n.*
+ $ZIP option.n
fi
if test -r optionMenu.n; then
- rm -f tk_optionMenu.n
- cp optionMenu.n tk_optionMenu.n
+ rm -f optionMenu.n.*
+ $ZIP optionMenu.n
+ rm -f tk_optionMenu.n tk_optionMenu.n.*
+ ln $S optionMenu.n$Z tk_optionMenu.n$Z
+fi
+if test -r options.n; then
+ rm -f options.n.*
+ $ZIP options.n
+fi
+if test -r pack-old.n; then
+ rm -f pack-old.n.*
+ $ZIP pack-old.n
+fi
+if test -r pack.n; then
+ rm -f pack.n.*
+ $ZIP pack.n
fi
if test -r palette.n; then
- rm -f tk_setPalette.n
- rm -f tk_bisque.n
- cp palette.n tk_setPalette.n
- cp palette.n tk_bisque.n
+ rm -f palette.n.*
+ $ZIP palette.n
+ rm -f tk_setPalette.n tk_setPalette.n.*
+ rm -f tk_bisque.n tk_bisque.n.*
+ ln $S palette.n$Z tk_setPalette.n$Z
+ ln $S palette.n$Z tk_bisque.n$Z
+fi
+if test -r panedwindow.n; then
+ rm -f panedwindow.n.*
+ $ZIP panedwindow.n
+fi
+if test -r photo.n; then
+ rm -f photo.n.*
+ $ZIP photo.n
+fi
+if test -r place.n; then
+ rm -f place.n.*
+ $ZIP place.n
fi
if test -r popup.n; then
- rm -f tk_popup.n
- cp popup.n tk_popup.n
+ rm -f popup.n.*
+ $ZIP popup.n
+ rm -f tk_popup.n tk_popup.n.*
+ ln $S popup.n$Z tk_popup.n$Z
+fi
+if test -r radiobutton.n; then
+ rm -f radiobutton.n.*
+ $ZIP radiobutton.n
+fi
+if test -r raise.n; then
+ rm -f raise.n.*
+ $ZIP raise.n
+fi
+if test -r scale.n; then
+ rm -f scale.n.*
+ $ZIP scale.n
+fi
+if test -r scrollbar.n; then
+ rm -f scrollbar.n.*
+ $ZIP scrollbar.n
+fi
+if test -r selection.n; then
+ rm -f selection.n.*
+ $ZIP selection.n
+fi
+if test -r send.n; then
+ rm -f send.n.*
+ $ZIP send.n
+fi
+if test -r spinbox.n; then
+ rm -f spinbox.n.*
+ $ZIP spinbox.n
+fi
+if test -r text.n; then
+ rm -f text.n.*
+ $ZIP text.n
+ rm -f tk_textCopy.n tk_textCopy.n.*
+ rm -f tk_textCut.n tk_textCut.n.*
+ rm -f tk_textPaste.n tk_textPaste.n.*
+ ln $S text.n$Z tk_textCopy.n$Z
+ ln $S text.n$Z tk_textCut.n$Z
+ ln $S text.n$Z tk_textPaste.n$Z
+fi
+if test -r tk.n; then
+ rm -f tk.n.*
+ $ZIP tk.n
+fi
+if test -r tkerror.n; then
+ rm -f tkerror.n.*
+ $ZIP tkerror.n
+fi
+if test -r tkvars.n; then
+ rm -f tkvars.n.*
+ $ZIP tkvars.n
+fi
+if test -r tkwait.n; then
+ rm -f tkwait.n.*
+ $ZIP tkwait.n
+fi
+if test -r toplevel.n; then
+ rm -f toplevel.n.*
+ $ZIP toplevel.n
+fi
+if test -r winfo.n; then
+ rm -f winfo.n.*
+ $ZIP winfo.n
+fi
+if test -r wish.1; then
+ rm -f wish.1.*
+ $ZIP wish.1
+fi
+if test -r wm.n; then
+ rm -f wm.n.*
+ $ZIP wm.n
fi
exit 0
diff --git a/tk/unix/tcl.m4 b/tk/unix/tcl.m4
index 6ebd6a4b805..31f43a95fb0 100644
--- a/tk/unix/tcl.m4
+++ b/tk/unix/tcl.m4
@@ -31,7 +31,7 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [
AC_MSG_CHECKING([for Tcl configuration])
AC_CACHE_VAL(ac_cv_c_tclconfig,[
- # First check to see if --with-tclconfig was specified.
+ # First check to see if --with-tcl was specified.
if test x"${with_tclconfig}" != x ; then
if test -f "${with_tclconfig}/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
@@ -53,17 +53,16 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
fi
- if test -f "$i/win/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/win; pwd)`
- break
- fi
done
fi
# check in a few common install locations
if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` ; do
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ ; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i; pwd)`
break
@@ -79,18 +78,14 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [
if test -f "$i/unix/tclConfig.sh" ; then
ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
break
- fi
- if test -f "$i/win/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd $i/win; pwd)`
- break
- fi
+ fi
done
fi
])
if test x"${ac_cv_c_tclconfig}" = x ; then
TCL_BIN_DIR="# no Tcl configs found"
- AC_MSG_ERROR(Can't find Tcl configuration definitions)
+ AC_MSG_WARN(Can't find Tcl configuration definitions)
exit 0
else
no_tcl=
@@ -154,16 +149,15 @@ AC_DEFUN(SC_PATH_TKCONFIG, [
ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
break
fi
- if test -f "$i/win/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/win; pwd)`
- break
- fi
done
fi
# check in a few common install locations
if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in `ls -d ${prefix}/lib 2>/dev/null` \
- `ls -d /usr/local/lib 2>/dev/null` ; do
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ ; do
if test -f "$i/tkConfig.sh" ; then
ac_cv_c_tkconfig=`(cd $i; pwd)`
break
@@ -179,16 +173,12 @@ AC_DEFUN(SC_PATH_TKCONFIG, [
ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
break
fi
- if test -f "$i/win/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i/win; pwd)`
- break
- fi
done
fi
])
if test x"${ac_cv_c_tkconfig}" = x ; then
TK_BIN_DIR="# no Tk configs found"
- AC_MSG_ERROR(Can't find Tk configuration definitions)
+ AC_MSG_WARN(Can't find Tk configuration definitions)
exit 0
else
no_tk=
@@ -229,16 +219,43 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [
fi
#
- # The eval is required to do the TCL_DBGX substitution in the
- # TCL_LIB_FILE variable
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
#
- eval TCL_LIB_FILE=${TCL_LIB_FILE}
- eval TCL_LIB_FLAG=${TCL_LIB_FLAG}
+ if test -f $TCL_BIN_DIR/Makefile ; then
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
+ fi
+ #
+ # eval is required to do the TCL_DBGX substitution
+ #
+
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_SRC_DIR)
+
AC_SUBST(TCL_LIB_FILE)
+ AC_SUBST(TCL_LIB_FLAG)
+ AC_SUBST(TCL_LIB_SPEC)
+
+ AC_SUBST(TCL_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
])
#------------------------------------------------------------------------
@@ -258,15 +275,16 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [
#------------------------------------------------------------------------
AC_DEFUN(SC_LOAD_TKCONFIG, [
- AC_MSG_CHECKING([for existence of $TCLCONFIG])
+ AC_MSG_CHECKING([for existence of $TK_BIN_DIR/tkConfig.sh])
if test -f "$TK_BIN_DIR/tkConfig.sh" ; then
- AC_MSG_CHECKING([loading $TK_BIN_DIR/tkConfig.sh])
+ AC_MSG_RESULT([loading])
. $TK_BIN_DIR/tkConfig.sh
else
AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh])
fi
+ AC_SUBST(TK_VERSION)
AC_SUBST(TK_BIN_DIR)
AC_SUBST(TK_SRC_DIR)
AC_SUBST(TK_LIB_FILE)
@@ -297,13 +315,13 @@ AC_DEFUN(SC_ENABLE_SHARED, [
AC_MSG_CHECKING([how to build libraries])
AC_ARG_ENABLE(shared,
[ --enable-shared build and link with shared libraries [--enable-shared]],
- [tcl_ok=$enableval], [tcl_ok=no])
+ [tcl_ok=$enableval], [tcl_ok=yes])
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
tcl_ok=$enableval
else
- tcl_ok=no
+ tcl_ok=yes
fi
if test "$tcl_ok" = "yes" ; then
@@ -317,6 +335,49 @@ AC_DEFUN(SC_ENABLE_SHARED, [
])
#------------------------------------------------------------------------
+# SC_ENABLE_FRAMEWORK --
+#
+# Allows the building of shared libraries into frameworks
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-framework=yes|no
+#
+# Sets the following vars:
+# FRAMEWORK_BUILD Value of 1 or 0
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_FRAMEWORK, [
+ AC_MSG_CHECKING([how to package libraries])
+ AC_ARG_ENABLE(framework,
+ [ --enable-framework package shared libraries in frameworks [--disable-framework]],
+ [tcl_ok=$enableval], [tcl_ok=no])
+
+ if test "${enable_framework+set}" = set; then
+ enableval="$enable_framework"
+ tcl_ok=$enableval
+ else
+ tcl_ok=no
+ fi
+
+ if test "$tcl_ok" = "yes" ; then
+ AC_MSG_RESULT([framework])
+ FRAMEWORK_BUILD=1
+ if test "${SHARED_BUILD}" = "0" ; then
+ AC_MSG_WARN("Frameworks can only be built if --enable-shared is yes")
+ FRAMEWORK_BUILD=0
+ fi
+ else
+ AC_MSG_RESULT([standard shared library])
+ FRAMEWORK_BUILD=0
+ fi
+])
+
+#------------------------------------------------------------------------
# SC_ENABLE_THREADS --
#
# Specify if thread support should be enabled
@@ -335,6 +396,7 @@ AC_DEFUN(SC_ENABLE_SHARED, [
# Defines the following vars:
# TCL_THREADS
# _REENTRANT
+# _THREAD_SAFE
#
#------------------------------------------------------------------------
@@ -347,6 +409,9 @@ AC_DEFUN(SC_ENABLE_THREADS, [
AC_MSG_RESULT(yes)
TCL_THREADS=1
AC_DEFINE(TCL_THREADS)
+ # USE_THREAD_ALLOC tells us to try the special thread-based
+ # allocator that significantly reduces lock contention
+ AC_DEFINE(USE_THREAD_ALLOC)
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
@@ -370,8 +435,14 @@ AC_DEFUN(SC_ENABLE_THREADS, [
else
AC_CHECK_LIB(c,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
if test "$tcl_ok" = "no"; then
- TCL_THREADS=0
- AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...")
+ AC_CHECK_LIB(c_r,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
+ if test "$tcl_ok" = "yes"; then
+ # The space is needed
+ THREADS_LIBS=" -pthread"
+ else
+ TCL_THREADS=0
+ AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...")
+ fi
fi
fi
fi
@@ -380,10 +451,12 @@ AC_DEFUN(SC_ENABLE_THREADS, [
# 'pthread_attr_setstacksize' ?
AC_CHECK_FUNCS(pthread_attr_setstacksize)
+ AC_CHECK_FUNCS(readdir_r)
else
TCL_THREADS=0
- AC_MSG_RESULT(no (default))
+ AC_MSG_RESULT([no (default)])
fi
+ AC_SUBST(TCL_THREADS)
])
#------------------------------------------------------------------------
@@ -417,6 +490,7 @@ AC_DEFUN(SC_ENABLE_THREADS, [
AC_DEFUN(SC_ENABLE_SYMBOLS, [
AC_MSG_CHECKING([for build with symbols])
AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])
+# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
if test "$tcl_ok" = "yes"; then
CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
@@ -428,9 +502,134 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
DBGX=""
AC_MSG_RESULT([no])
fi
+ AC_SUBST(CFLAGS_DEFAULT)
+ AC_SUBST(LDFLAGS_DEFAULT)
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_LANGINFO --
+#
+# Allows use of modern nl_langinfo check for better l10n.
+# This is only relevant for Unix.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-langinfo=yes|no (default is yes)
+#
+# Defines the following vars:
+# HAVE_LANGINFO Triggers use of nl_langinfo if defined.
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_LANGINFO, [
+ AC_ARG_ENABLE(langinfo,
+ [ --enable-langinfo use nl_langinfo if possible to determine
+ encoding at startup, otherwise use old heuristic],
+ [langinfo_ok=$enableval], [langinfo_ok=yes])
+
+ HAVE_LANGINFO=0
+ if test "$langinfo_ok" = "yes"; then
+ if test "$langinfo_ok" = "yes"; then
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
+ fi
+ fi
+ AC_MSG_CHECKING([whether to use nl_langinfo])
+ if test "$langinfo_ok" = "yes"; then
+ AC_TRY_COMPILE([#include <langinfo.h>],
+ [nl_langinfo(CODESET);],[langinfo_ok=yes],[langinfo_ok=no])
+ if test "$langinfo_ok" = "no"; then
+ langinfo_ok="no (could not compile with nl_langinfo)";
+ fi
+ if test "$langinfo_ok" = "yes"; then
+ AC_DEFINE(HAVE_LANGINFO)
+ fi
+ fi
+ AC_MSG_RESULT([$langinfo_ok])
])
#--------------------------------------------------------------------
+# SC_CONFIG_MANPAGES
+#
+# Decide whether to use symlinks for linking the manpages and
+# whether to compress the manpages after installation.
+#
+# Arguments:
+# none
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-man-symlinks
+# --enable-man-compression=PROG
+#
+# Defines the following variable:
+#
+# MKLINKS_FLAGS - The apropriate flags for mkLinks
+# according to the user's selection.
+#
+#--------------------------------------------------------------------
+AC_DEFUN(SC_CONFIG_MANPAGES, [
+
+ AC_MSG_CHECKING([whether to use symlinks for manpages])
+ AC_ARG_ENABLE(man-symlinks,
+ [ --enable-man-symlinks use symlinks for the manpages],
+ test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --symlinks",
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+
+ AC_MSG_CHECKING([compression for manpages])
+ AC_ARG_ENABLE(man-compression,
+ [ --enable-man-compression=PROG
+ compress the manpages with PROG],
+ test "$enableval" = "yes" && echo && AC_MSG_ERROR([missing argument to --enable-man-compression])
+ test "$enableval" != "no" && MKLINKS_FLAGS="$MKLINKS_FLAGS --compress $enableval",
+ enableval="no")
+ AC_MSG_RESULT([$enableval])
+
+ AC_SUBST(MKLINKS_FLAGS)
+])
+
+#------------------------------------------------------------------------
+# SC_ENABLE_MEMDEBUG --
+#
+# Specify if the memory debugging code should be used
+#
+# Arguments:
+# none
+#
+# Requires the following vars to be set in the Makefile:
+# None.
+#
+# Results:
+#
+# Adds the following arguments to configure:
+# --enable-memdebug
+#
+# Defines the following @vars@:
+# MEM_DEBUG_FLAGS Sets to -DTCL_MEM_DEBUG if true
+# Sets to "" if false
+#
+#------------------------------------------------------------------------
+
+AC_DEFUN(SC_ENABLE_MEMDEBUG, [
+ AC_MSG_CHECKING([for build with memory debugging])
+ AC_ARG_ENABLE(memdebug, [ --enable-memdebug build with memory debugging [--disable-memdebug]], [tcl_ok=$enableval], [tcl_ok=no])
+ if test "$tcl_ok" = "yes"; then
+ MEM_DEBUG_FLAGS=-DTCL_MEM_DEBUG
+ AC_MSG_RESULT([yes])
+ else
+ MEM_DEBUG_FLAGS=""
+ AC_MSG_RESULT([no])
+ fi
+ AC_SUBST(MEM_DEBUG_FLAGS)
+])
+
+
+#--------------------------------------------------------------------
# SC_CONFIG_CFLAGS
#
# Try to determine the proper flags to pass to the compiler
@@ -441,7 +640,7 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
#
# Results:
#
-# Defines the following vars:
+# Defines and substitutes the following vars:
#
# DL_OBJS - Name of the object file that implements dynamic
# loading for Tcl on this system.
@@ -453,10 +652,20 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
# LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
# that tell the run-time dynamic linker where to look
# for shared libraries such as libtcl.so. Depends on
+# the variable LIB_RUNTIME_DIR in the Makefile. Could
+# be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
+# CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
+# that tell the run-time dynamic linker where to look
+# for shared libraries such as libtcl.so. Depends on
# the variable LIB_RUNTIME_DIR in the Makefile.
-# MAKE_LIB - Command to execute to build the Tcl library;
-# differs depending on whether or not Tcl is being
-# compiled as a shared library.
+# MAKE_LIB - Command to execute to build the a library;
+# differs when building shared or static.
+# MAKE_STUB_LIB -
+# Command to execute to build a stub library.
+# INSTALL_LIB - Command to execute to install a library;
+# differs when building shared or static.
+# INSTALL_STUB_LIB -
+# Command to execute to install a stub library.
# STLIB_LD - Base command to use for combining object files
# into a static library.
# SHLIB_CFLAGS - Flags to pass to cc when compiling the components
@@ -464,6 +673,9 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
# code, among other things).
# SHLIB_LD - Base command to use for combining object files
# into a shared library.
+# SHLIB_LD_FLAGS -Flags to pass when building a shared library. This
+# differes from the SHLIB_CFLAGS as it is not used
+# when building object files or executables.
# SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
# creating shared libraries. This symbol typically
# goes at the end of the "ld" commands that build
@@ -478,15 +690,20 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
# SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
# extensions. An empty string means we don't know how
# to use shared libraries on this platform.
-# TCL_LIB_FILE - Name of the file that contains the Tcl library, such
-# as libtcl7.8.so or libtcl7.8.a.
-# TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl"
-# in the shared library name, using the $VERSION variable
+# TCL_SHLIB_LD_EXTRAS - Additional element which are added to SHLIB_LD_LIBS
+# TK_SHLIB_LD_EXTRAS for the build of Tcl and Tk, but not recorded in the
+# tclConfig.sh, since they are only used for the build
+# of Tcl and Tk.
+# Examples: MacOS X records the library version and
+# compatibility version in the shared library. But
+# of course the Tcl version of this is only used for Tcl.
+# LIB_SUFFIX - Specifies everything that comes after the "libfoo"
+# in a static or shared library name, using the $VERSION variable
# to put the version in the right place. This is used
# by platforms that need non-standard library names.
# Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
# to have a version after the .so, and ${VERSION}.a
-# on AIX, since the Tcl shared library needs to have
+# on AIX, since a shared library needs to have
# a .a extension whereas shared objects for loadable
# extensions have a .so extension. Defaults to
# ${VERSION}${SHLIB_SUFFIX}.
@@ -504,13 +721,8 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
# Flags used when running the compiler in debug mode
# CFLAGS_OPTIMIZE -
# Flags used when running the compiler in optimize mode
-#
# EXTRA_CFLAGS
#
-# Subst's the following vars:
-# DL_LIBS
-# CFLAGS_DEBUG
-# CFLAGS_OPTIMIZE
#--------------------------------------------------------------------
AC_DEFUN(SC_CONFIG_CFLAGS, [
@@ -567,15 +779,6 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
fi
fi
- AC_MSG_CHECKING([if gcc is being used])
- if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then
- using_gcc="yes"
- else
- using_gcc="no"
- fi
-
- AC_MSG_RESULT([$using_gcc ($CC)])
-
# Step 2: check for existence of -ldl library. This is needed because
# Linux can use either -ldl or -ldld for dynamic loading.
@@ -584,7 +787,6 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
# Step 3: set configuration options based on system name and version.
do64bit_ok=no
- fullSrcDir=`cd $srcdir; pwd`
EXTRA_CFLAGS=""
TCL_EXPORT_FILE_SUFFIX=""
UNSHARED_LIB_SUFFIX=""
@@ -593,7 +795,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
TCL_LIB_VERSIONS_OK=ok
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
- if test "$using_gcc" = "yes" ; then
+ if test "$GCC" = "yes" ; then
CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
else
CFLAGS_WARNING=""
@@ -605,45 +807,107 @@ dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixe
dnl AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_PROG(AR, ar, ar)
STLIB_LD='${AR} cr'
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
+ PLAT_OBJS=""
case $system in
- AIX-4.[[2-9]])
- if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then
+ AIX-5.*)
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
if test "${CC}" != "cc_r" ; then
CC=${CC}_r
fi
AC_MSG_RESULT(Using $CC for compiling with threads)
fi
+ LIBS="$LIBS -lc"
+ # AIX-5 uses ELF style dynamic libraries
SHLIB_CFLAGS=""
- SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+
+ # Note: need the LIBS below, otherwise Tk won't find Tcl's
+ # symbols when dynamically loaded into tclsh.
+
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
- DL_LIBS="-ldl"
+ # AIX-5 has dl* in libc.so
+ DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- TCL_NEEDS_EXP_FILE=1
- TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
+
+ if test "$GCC" = "yes" ; then
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ else
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ fi
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_LIBRARY_PATH_VAR="LIBPATH"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ AC_MSG_WARN("64bit mode not supported with GCC on $system")
+ else
+ do64bit_ok=yes
+ EXTRA_CFLAGS="-q64"
+ LDFLAGS="-q64"
+ fi
+ fi
;;
AIX-*)
- if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then
+ if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
if test "${CC}" != "cc_r" ; then
CC=${CC}_r
fi
AC_MSG_RESULT(Using $CC for compiling with threads)
fi
+ LIBS="$LIBS -lc"
SHLIB_CFLAGS=""
- SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
+ SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
- LIBOBJS="$LIBOBJS tclLoadAix.o"
- DL_LIBS="-lld"
+ DL_LIBS="-ldl"
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ LD_LIBRARY_PATH_VAR="LIBPATH"
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp'
+
+ # AIX v<=4.1 has some different flags than 4.2+
+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then
+ LIBOBJS="$LIBOBJS tclLoadAix.o"
+ DL_LIBS="-lld"
+ fi
+
+ # On AIX <=v4 systems, libbsd.a has to be linked in to support
+ # non-blocking file IO. This library has to be linked in after
+ # the MATH_LIBS or it breaks the pow() function. The way to
+ # insure proper sequencing, is to add it to the tail of MATH_LIBS.
+ # This library also supplies gettimeofday.
+ #
+ # AIX does not have a timezone field in struct tm. When the AIX
+ # bsd library is used, the timezone global and the gettimeofday
+ # methods are to be avoided for timezone deduction instead, we
+ # deduce the timezone by comparing the localtime result on a
+ # known GMT value.
+
+ AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
+ if test $libbsd = yes; then
+ MATH_LIBS="$MATH_LIBS -lbsd"
+ AC_DEFINE(USE_DELTA_FOR_TZ)
+ fi
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ AC_MSG_WARN("64bit mode not supported with GCC on $system")
+ else
+ do64bit_ok=yes
+ EXTRA_CFLAGS="-q64"
+ LDFLAGS="-q64"
+ fi
+ fi
;;
BSD/OS-2.1*|BSD/OS-3*)
SHLIB_CFLAGS=""
@@ -653,6 +917,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
BSD/OS-4.*)
@@ -663,6 +928,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-export-dynamic"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
dgux*)
@@ -673,9 +939,54 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
- HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*|HP-UX-*.11.*)
+ HP-UX-*.11.*)
+ # Use updated header definitions where possible
+ AC_DEFINE(_XOPEN_SOURCE_EXTENDED)
+
+ SHLIB_SUFFIX=".sl"
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
+ if test "$tcl_ok" = yes; then
+ SHLIB_CFLAGS="+z"
+ SHLIB_LD="ld -b"
+ SHLIB_LD_LIBS='${LIBS}'
+ DL_OBJS="tclLoadShl.o"
+ DL_LIBS="-ldld"
+ LDFLAGS="-Wl,-E"
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
+ fi
+
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
+ #EXTRA_CFLAGS="+DAportable"
+
+ # Check to enable 64-bit flags for compiler/linker
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ hpux_arch='`gcc -dumpmachine`'
+ case $hpux_arch in
+ hppa64*)
+ # 64-bit gcc in use. Fix flags for GNU ld.
+ do64bit_ok=yes
+ SHLIB_LD="gcc -shared"
+ SHLIB_LD_LIBS=""
+ LD_SEARCH_FLAGS=''
+ ;;
+ *)
+ AC_MSG_WARN("64bit mode not supported with GCC on $system")
+ ;;
+ esac
+ else
+ do64bit_ok=yes
+ EXTRA_CFLAGS="+DA2.0W"
+ LDFLAGS="+DA2.0W $LDFLAGS"
+ fi
+ fi
+ ;;
+ HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
SHLIB_SUFFIX=".sl"
AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
if test "$tcl_ok" = yes; then
@@ -685,7 +996,9 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadShl.o"
DL_LIBS="-ldld"
LDFLAGS="-Wl,-E"
- LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
fi
;;
IRIX-4.*)
@@ -696,18 +1009,32 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
;;
- IRIX-5.*|IRIX-6.*|IRIX64-6.5*)
+ IRIX-5.*)
+ SHLIB_CFLAGS=""
+ SHLIB_LD="ld -shared -rdata_shared"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ DL_LIBS=""
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ EXTRA_CFLAGS=""
+ LDFLAGS=""
+ ;;
+ IRIX-6.*|IRIX64-6.5*)
SHLIB_CFLAGS=""
SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- if test "$using_gcc" = "yes" ; then
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
EXTRA_CFLAGS="-mabi=n32"
LDFLAGS="-mabi=n32"
else
@@ -725,13 +1052,28 @@ dnl AC_CHECK_TOOL(AR, ar, :)
;;
IRIX64-6.*)
SHLIB_CFLAGS=""
- SHLIB_LD="ld -32 -shared -rdata_shared"
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+
+ # Check to enable 64-bit flags for compiler/linker
+
+ if test "$do64bit" = "yes" ; then
+ if test "$GCC" = "yes" ; then
+ AC_MSG_WARN([64bit mode not supported by gcc])
+ else
+ do64bit_ok=yes
+ SHLIB_LD="ld -64 -shared -rdata_shared"
+ EXTRA_CFLAGS="-64"
+ LDFLAGS="-64"
+ fi
+ fi
+
;;
Linux*)
SHLIB_CFLAGS="-fPIC"
@@ -749,13 +1091,52 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-rdynamic"
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
else
AC_CHECK_HEADER(dld.h, [
SHLIB_LD="ld -shared"
DL_OBJS="tclLoadDld.o"
DL_LIBS="-ldld"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""])
+ fi
+ if test "`uname -m`" = "alpha" ; then
+ EXTRA_CFLAGS="-mieee"
+ fi
+
+ # The combo of gcc + glibc has a bug related
+ # to inlining of functions like strtod(). The
+ # -fno-builtin flag should address this problem
+ # but it does not work. The -fno-inline flag
+ # is kind of overkill but it works.
+ # Disable inlining only when one of the
+ # files in compat/*.c is being linked in.
+ if test x"${LIBOBJS}" != x ; then
+ EXTRA_CFLAGS="${EXTRA_CFLAGS} -fno-inline"
+ fi
+
+ ;;
+ GNU*)
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".so"
+
+ if test "$have_dl" = yes; then
+ SHLIB_LD="${CC} -shared"
+ DL_OBJS=""
+ DL_LIBS="-ldl"
+ LDFLAGS="-rdynamic"
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ else
+ AC_CHECK_HEADER(dld.h, [
+ SHLIB_LD="ld -shared"
+ DL_OBJS=""
+ DL_LIBS="-ldld"
+ LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""])
fi
if test "`uname -m`" = "alpha" ; then
@@ -770,6 +1151,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
MP-RAS-*)
@@ -780,6 +1162,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="-Wl,-Bexport"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
NetBSD-*|FreeBSD-[[1-2]].*|OpenBSD-*)
@@ -793,7 +1176,8 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
AC_MSG_CHECKING(for ELF)
AC_EGREP_CPP(yes, [
#ifdef __ELF__
@@ -813,7 +1197,8 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
])
@@ -826,12 +1211,47 @@ dnl AC_CHECK_TOOL(AR, ar, :)
# FreeBSD 3.* and greater have ELF.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x"
- SHLIB_LD_LIBS=""
+ SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS="-export-dynamic"
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "${TCL_THREADS}" = "1" ; then
+ # The -pthread needs to go in the CFLAGS, not LIBS
+ LIBS=`echo $LIBS | sed s/-pthread//`
+ EXTRA_CFLAGS="-pthread"
+ LDFLAGS="$LDFLAGS -pthread"
+ fi
+ case $system in
+ FreeBSD-3.*)
+ # FreeBSD-3 doesn't handle version numbers with dots.
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a'
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so'
+ TCL_LIB_VERSIONS_OK=nodots
+ ;;
+ esac
+ ;;
+ Rhapsody-*|Darwin-*)
+ SHLIB_CFLAGS="-fno-common"
+ SHLIB_LD="cc -dynamiclib \${LDFLAGS}"
+ TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TCL_LIB_FILE} -prebind -seg1addr 0xa000000"
+ TK_SHLIB_LD_EXTRAS="-compatibility_version ${TK_VERSION} -current_version \${VERSION} -install_name \${DYLIB_INSTALL_DIR}/\${TK_LIB_FILE} -prebind -seg1addr 0xb000000"
+ SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_SUFFIX=".dylib"
+ DL_OBJS="tclLoadDyld.o"
+ PLAT_OBJS="tclMacOSXBundle.o"
+ DL_LIBS=""
+ LDFLAGS="-prebind"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
+ CFLAGS_OPTIMIZE="-Os"
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
+ # for compatibility with autoconf vers 2.13 :
+ HACK=""
+ EXTRA_CFLAGS="-DMA${HACK}C_OSX_TCL -DHAVE_CFBUNDLE -DTCL_DEFAULT_ENCODING=\\\"utf-8\\\""
+ LIBS="$LIBS -framework CoreFoundation"
;;
NEXTSTEP-*)
SHLIB_CFLAGS=""
@@ -841,6 +1261,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadNext.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OS/390-*)
@@ -857,45 +1278,71 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadOSF.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-1.*)
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD="ld -shared"
+ if test "$SHARED_BUILD" = "1" ; then
+ SHLIB_LD="ld -shared"
+ else
+ SHLIB_LD="ld -non_shared"
+ fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
OSF1-V*)
# Digital OSF/1
SHLIB_CFLAGS=""
- SHLIB_LD='ld -shared -expect_unresolved "*"'
+ if test "$SHARED_BUILD" = "1" ; then
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
+ else
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
+ fi
SHLIB_LD_LIBS=""
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- if test "$using_gcc" = "no" ; then
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
+ if test "$GCC" != "yes" ; then
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
fi
# see pthread_intro(3) for pthread support on osf1, k.furukawa
if test "${TCL_THREADS}" = "1" ; then
+ EXTRA_CFLAGS="${EXTRA_CFLAGS} -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
- if test "$using_gcc" = "no" ; then
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
+ if test "$GCC" = "yes" ; then
+ LIBS="$LIBS -lpthread -lmach -lexc"
+ else
EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread"
LDFLAGS="-pthread"
- else
- LIBS=`echo $LIBS | sed s/-lpthreads//`
- LIBS="$LIBS -lpthread -lmach -lexc"
fi
fi
;;
+ QNX-6*)
+ # QNX RTP
+ # This may work for all QNX, but it was only reported for v6.
+ SHLIB_CFLAGS="-fPIC"
+ SHLIB_LD="ld -Bshareable -x"
+ SHLIB_LD_LIBS=""
+ SHLIB_SUFFIX=".so"
+ DL_OBJS="tclLoadDl.o"
+ # dlopen is in -lc on QNX
+ DL_LIBS=""
+ LDFLAGS=""
+ CC_SEARCH_FLAGS=""
+ LD_SEARCH_FLAGS=""
+ ;;
RISCos-*)
SHLIB_CFLAGS="-G 0"
SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0"
@@ -904,13 +1351,14 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
SCO_SV-3.2*)
# 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.
- if test "$using_gcc" = "yes" ; then
+ if test "$GCC" = "yes" ; then
SHLIB_CFLAGS="-fPIC -melf"
LDFLAGS="-melf -Wl,-Bexport"
else
@@ -922,7 +1370,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LDFLAGS="-belf -Wl,-Bexport"
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SINIX*5.4*)
@@ -933,6 +1381,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
SunOS-4*)
@@ -943,7 +1392,8 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
# SunOS can't handle version numbers with dots in them in library
# specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
@@ -955,8 +1405,14 @@ dnl AC_CHECK_TOOL(AR, ar, :)
TCL_LIB_VERSIONS_OK=nodots
;;
SunOS-5.[[0-6]]*)
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
+
SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
# Note: need the LIBS below, otherwise Tk won't find Tcl's
# symbols when dynamically loaded into tclsh.
@@ -966,18 +1422,34 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS=""
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="$CC -shared"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ else
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ fi
;;
SunOS-5*)
+
+ # Note: If _REENTRANT isn't defined, then Solaris
+ # won't define thread-safe library routines.
+
+ AC_DEFINE(_REENTRANT)
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS)
+
SHLIB_CFLAGS="-KPIC"
- SHLIB_LD="/usr/ccs/bin/ld -G -z text"
LDFLAGS=""
- do64bit_ok=no
+ # Check to enable 64-bit flags for compiler/linker
if test "$do64bit" = "yes" ; then
arch=`isainfo`
if test "$arch" = "sparcv9 sparc" ; then
- if test "$using_gcc" = "no" ; then
+ if test "$GCC" = "yes" ; then
+ AC_MSG_WARN("64bit mode not supported with GCC on $system")
+ else
do64bit_ok=yes
if test "$do64bitVIS" = "yes" ; then
EXTRA_CFLAGS="-xarch=v9a"
@@ -986,8 +1458,6 @@ dnl AC_CHECK_TOOL(AR, ar, :)
EXTRA_CFLAGS="-xarch=v9"
LDFLAGS="-xarch=v9"
fi
- else
- AC_MSG_WARN("64bit mode not supported with GCC on $system")
fi
else
AC_MSG_WARN("64bit mode only supported sparcv9 system")
@@ -1001,9 +1471,13 @@ dnl AC_CHECK_TOOL(AR, ar, :)
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
- if test "$using_gcc" = "yes" ; then
- LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ if test "$GCC" = "yes" ; then
+ SHLIB_LD="$CC -shared"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
else
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
fi
;;
@@ -1015,8 +1489,9 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadAout.o"
DL_LIBS=""
LDFLAGS="-Wl,-D,08000000"
- LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
- if test "$using_gcc" = "no" ; then
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
+ if test "$GCC" != "yes" ; then
EXTRA_CFLAGS="-DHAVE_TZSET -std1"
fi
;;
@@ -1040,6 +1515,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
else
LDFLAGS=""
fi
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
esac
@@ -1144,6 +1620,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
DL_OBJS="tclLoadNone.o"
DL_LIBS=""
LDFLAGS=""
+ CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
BUILD_DLTEST=""
fi
@@ -1153,7 +1630,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
# standard manufacturer compiler.
if test "$DL_OBJS" != "tclLoadNone.o" ; then
- if test "$using_gcc" = "yes" ; then
+ if test "$GCC" = "yes" ; then
case $system in
AIX-*)
;;
@@ -1163,6 +1640,8 @@ dnl AC_CHECK_TOOL(AR, ar, :)
;;
NetBSD-*|FreeBSD-*|OpenBSD-*)
;;
+ Rhapsody-*|Darwin-*)
+ ;;
RISCos-*)
;;
SCO_SV-3.2*)
@@ -1183,15 +1662,79 @@ dnl AC_CHECK_TOOL(AR, ar, :)
UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a'
fi
-# CYGNUS LOCAL
- TCL_LIB_SUFFIX=.a
- AC_SUBST(TCL_LIB_SUFFIX)
-# END CYGNUS LOCAL
+ AC_REQUIRE([AC_PROG_RANLIB])
+
+ if test "${SHARED_BUILD}" = "1" && test "${SHLIB_SUFFIX}" != "" ; then
+ LIB_SUFFIX=${SHARED_LIB_SUFFIX}
+ MAKE_LIB='${SHLIB_LD} -o [$]@ ${SHLIB_LD_FLAGS} ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ else
+ LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}
+
+ if test "$RANLIB" = "" ; then
+ MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)'
+ else
+ MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@'
+ INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))'
+ fi
+
+dnl Not at all clear what this was doing in Tcl's configure.in
+dnl or why it was needed was needed. In any event, this sort of
+dnl things needs to be done in the big loop above.
+dnl REMOVE THIS BLOCK LATER! (mdejong)
+dnl case $system in
+dnl BSD/OS*)
+dnl ;;
+dnl AIX-[[1-4]].*)
+dnl ;;
+dnl *)
+dnl SHLIB_LD_LIBS=""
+dnl ;;
+dnl esac
+ fi
+
+
+ # Stub lib does not depend on shared/static configuration
+ if test "$RANLIB" = "" ; then
+ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)'
+ else
+ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@'
+ INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))'
+ fi
+
AC_SUBST(DL_LIBS)
+
+ AC_SUBST(DL_OBJS)
+ AC_SUBST(PLAT_OBJS)
+ AC_SUBST(CFLAGS)
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
+ AC_SUBST(EXTRA_CFLAGS)
+
+ AC_SUBST(LDFLAGS)
+ AC_SUBST(LDFLAGS_DEBUG)
+ AC_SUBST(LDFLAGS_OPTIMIZE)
+ AC_SUBST(CC_SEARCH_FLAGS)
+ AC_SUBST(LD_SEARCH_FLAGS)
+
+ AC_SUBST(STLIB_LD)
+ AC_SUBST(SHLIB_LD)
+ AC_SUBST(TCL_SHLIB_LD_EXTRAS)
+ AC_SUBST(TK_SHLIB_LD_EXTRAS)
+ AC_SUBST(SHLIB_LD_FLAGS)
+ AC_SUBST(SHLIB_LD_LIBS)
+ AC_SUBST(SHLIB_CFLAGS)
+ AC_SUBST(SHLIB_SUFFIX)
+
+ AC_SUBST(MAKE_LIB)
+ AC_SUBST(MAKE_STUB_LIB)
+ AC_SUBST(INSTALL_LIB)
+ AC_SUBST(INSTALL_STUB_LIB)
+ AC_SUBST(RANLIB)
])
#--------------------------------------------------------------------
@@ -1199,7 +1742,9 @@ dnl AC_CHECK_TOOL(AR, ar, :)
#
# Determine which interface to use to talk to the serial port.
# Note that #include lines must begin in leftmost column for
-# some compilers to recognize them as preprocessor directives.
+# some compilers to recognize them as preprocessor directives,
+# and some build environments have stdin not pointing at a
+# pseudo-terminal (usually /dev/null instead.)
#
# Arguments:
# none
@@ -1207,6 +1752,7 @@ dnl AC_CHECK_TOOL(AR, ar, :)
# Results:
#
# Defines only one of the following vars:
+# HAVE_SYS_MODEM_H
# USE_TERMIOS
# USE_TERMIO
# USE_SGTTY
@@ -1214,13 +1760,13 @@ dnl AC_CHECK_TOOL(AR, ar, :)
#--------------------------------------------------------------------
AC_DEFUN(SC_SERIAL_PORT, [
+ AC_CHECK_HEADERS(sys/modem.h)
AC_MSG_CHECKING([termios vs. termio vs. sgtty])
-
+ AC_CACHE_VAL(tcl_cv_api_serial, [
AC_TRY_RUN([
#include <termios.h>
-main()
-{
+int main() {
struct termios t;
if (tcgetattr(0, &t) == 0) {
cfsetospeed(&t, 0);
@@ -1228,32 +1774,25 @@ main()
return 0;
}
return 1;
-}], tk_ok=termios, tk_ok=no, tk_ok=no)
-
- if test $tk_ok = termios; then
- AC_DEFINE(USE_TERMIOS)
- else
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ if test $tcl_cv_api_serial = no ; then
AC_TRY_RUN([
#include <termio.h>
-main()
-{
+int main() {
struct termio t;
if (ioctl(0, TCGETA, &t) == 0) {
t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
return 0;
}
return 1;
- }], tk_ok=termio, tk_ok=no, tk_ok=no)
-
- if test $tk_ok = termio; then
- AC_DEFINE(USE_TERMIO)
- else
+}], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
+ fi
+ if test $tcl_cv_api_serial = no ; then
AC_TRY_RUN([
#include <sgtty.h>
-main()
-{
+int main() {
struct sgttyb t;
if (ioctl(0, TIOCGETP, &t) == 0) {
t.sg_ospeed = 0;
@@ -1261,13 +1800,61 @@ main()
return 0;
}
return 1;
-}], tk_ok=sgtty, tk_ok=none, tk_ok=none)
- if test $tk_ok = sgtty; then
- AC_DEFINE(USE_SGTTY)
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
fi
+ if test $tcl_cv_api_serial = no ; then
+ AC_TRY_RUN([
+#include <termios.h>
+#include <errno.h>
+
+int main() {
+ struct termios t;
+ if (tcgetattr(0, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ cfsetospeed(&t, 0);
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
fi
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <termio.h>
+#include <errno.h>
+
+int main() {
+ struct termio t;
+ if (ioctl(0, TCGETA, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
+ return 0;
+ }
+ return 1;
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
fi
- AC_MSG_RESULT($tk_ok)
+ if test $tcl_cv_api_serial = no; then
+ AC_TRY_RUN([
+#include <sgtty.h>
+#include <errno.h>
+
+int main() {
+ struct sgttyb t;
+ if (ioctl(0, TIOCGETP, &t) == 0
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
+ t.sg_ospeed = 0;
+ t.sg_flags |= ODDP | EVENP | RAW;
+ return 0;
+ }
+ return 1;
+}], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
+ fi])
+ case $tcl_cv_api_serial in
+ termios) AC_DEFINE(USE_TERMIOS);;
+ termio) AC_DEFINE(USE_TERMIO);;
+ sgtty) AC_DEFINE(USE_SGTTY);;
+ esac
+ AC_MSG_RESULT($tcl_cv_api_serial)
])
#--------------------------------------------------------------------
@@ -1302,7 +1889,6 @@ main()
#--------------------------------------------------------------------
AC_DEFUN(SC_MISSING_POSIX_HEADERS, [
-
AC_MSG_CHECKING(dirent.h)
AC_TRY_LINK([#include <sys/types.h>
#include <dirent.h>], [
@@ -1330,10 +1916,10 @@ closedir(d);
fi
AC_MSG_RESULT($tcl_ok)
- AC_CHECK_HEADER(errno.h, , AC_DEFINE(NO_ERRNO_H))
- AC_CHECK_HEADER(float.h, , AC_DEFINE(NO_FLOAT_H))
- AC_CHECK_HEADER(values.h, , AC_DEFINE(NO_VALUES_H))
- AC_CHECK_HEADER(limits.h, , AC_DEFINE(NO_LIMITS_H))
+ AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)])
+ AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)])
+ AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)])
+ AC_CHECK_HEADER(limits.h, , [AC_DEFINE(NO_LIMITS_H)])
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
@@ -1352,8 +1938,8 @@ closedir(d);
AC_DEFINE(NO_STRING_H)
fi
- AC_CHECK_HEADER(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H))
- AC_CHECK_HEADER(dlfcn.h, , AC_DEFINE(NO_DLFCN_H))
+ AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)])
+ AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)])
# OS/390 lacks sys/param.h (and doesn't need it, by chance).
@@ -1396,28 +1982,27 @@ AC_DEFUN(SC_PATH_X, [
fi
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
AC_MSG_CHECKING(for X11 header files)
- XINCLUDES="# no special path needed"
- AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="nope")
- if test "$XINCLUDES" = nope; then
+ found_xincludes="no"
+ AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no")
+ if test "$found_xincludes" = "no"; then
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
for i in $dirs ; do
if test -r $i/X11/Intrinsic.h; then
AC_MSG_RESULT($i)
XINCLUDES=" -I$i"
+ found_xincludes="yes"
break
fi
done
fi
else
if test "$x_includes" != ""; then
- XINCLUDES=-I$x_includes
- else
- XINCLUDES="# no special path needed"
+ XINCLUDES="-I$x_includes"
+ found_xincludes="yes"
fi
fi
- if test "$XINCLUDES" = nope; then
+ if test found_xincludes = "no"; then
AC_MSG_RESULT(couldn't find any!)
- XINCLUDES="# no include files found"
fi
if test "$no_x" = yes; then
@@ -1515,68 +2100,6 @@ AC_DEFUN(SC_BLOCKING_STYLE, [
])
#--------------------------------------------------------------------
-# SC_HAVE_VFORK
-#
-# Check to see whether the system provides a vfork kernel call.
-# If not, then use fork instead. Also, check for a problem with
-# vforks and signals that can cause core dumps if a vforked child
-# resets a signal handler. If the problem exists, then use fork
-# instead of vfork.
-#
-# Arguments:
-# none
-#
-# Results:
-#
-# Defines some of the following vars:
-# vfork (=fork)
-#
-#--------------------------------------------------------------------
-
-AC_DEFUN(SC_HAVE_VFORK, [
- AC_TYPE_SIGNAL()
- AC_CHECK_FUNC(vfork, tcl_ok=1, tcl_ok=0)
- if test "$tcl_ok" = 1; then
- AC_MSG_CHECKING([vfork/signal bug]);
- AC_TRY_RUN([
-#include <stdio.h>
-#include <signal.h>
-#include <sys/wait.h>
-int gotSignal = 0;
-sigProc(sig)
- int sig;
-{
- gotSignal = 1;
-}
-main()
-{
- int pid, sts;
- (void) signal(SIGCHLD, sigProc);
- pid = vfork();
- if (pid < 0) {
- exit(1);
- } else if (pid == 0) {
- (void) signal(SIGCHLD, SIG_DFL);
- _exit(0);
- } else {
- (void) wait(&sts);
- }
- exit((gotSignal) ? 0 : 1);
-}], tcl_ok=1, tcl_ok=0, tcl_ok=0)
-
- if test "$tcl_ok" = 1; then
- AC_MSG_RESULT(ok)
- else
- AC_MSG_RESULT([buggy, using fork instead])
- fi
- fi
- rm -f core
- if test "$tcl_ok" = 0; then
- AC_DEFINE(vfork, fork)
- fi
-])
-
-#--------------------------------------------------------------------
# SC_TIME_HANLDER
#
# Checks how the system deals with time.h, what time structures
@@ -1600,73 +2123,54 @@ AC_DEFUN(SC_TIME_HANDLER, [
AC_HEADER_TIME
AC_STRUCT_TIMEZONE
+ AC_CHECK_FUNCS(gmtime_r localtime_r)
+
AC_MSG_CHECKING([tm_tzadj in struct tm])
- AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
- [AC_DEFINE(HAVE_TM_TZADJ)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
+ AC_CACHE_VAL(tcl_cv_member_tm_tzadj,
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
+ tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no))
+ AC_MSG_RESULT($tcl_cv_member_tm_tzadj)
+ if test $tcl_cv_member_tm_tzadj = yes ; then
+ AC_DEFINE(HAVE_TM_TZADJ)
+ fi
AC_MSG_CHECKING([tm_gmtoff in struct tm])
- AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
- [AC_DEFINE(HAVE_TM_GMTOFF)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
+ AC_CACHE_VAL(tcl_cv_member_tm_gmtoff,
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
+ tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no))
+ AC_MSG_RESULT($tcl_cv_member_tm_gmtoff)
+ if test $tcl_cv_member_tm_gmtoff = yes ; then
+ AC_DEFINE(HAVE_TM_GMTOFF)
+ fi
#
# Its important to include time.h in this check, as some systems
# (like convex) have timezone functions, etc.
#
- have_timezone=no
AC_MSG_CHECKING([long timezone variable])
- AC_TRY_COMPILE([#include <time.h>],
+ AC_CACHE_VAL(tcl_cv_var_timezone,
+ AC_TRY_COMPILE([#include <time.h>],
[extern long timezone;
timezone += 1;
exit (0);],
- [have_timezone=yes
+ tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no))
+ AC_MSG_RESULT($tcl_cv_timezone_long)
+ if test $tcl_cv_timezone_long = yes ; then
+ AC_DEFINE(HAVE_TIMEZONE_VAR)
+ else
+ #
+ # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
+ #
+ AC_MSG_CHECKING([time_t timezone variable])
+ AC_CACHE_VAL(tcl_cv_timezone_time,
+ AC_TRY_COMPILE([#include <time.h>],
+ [extern time_t timezone;
+ timezone += 1;
+ exit (0);],
+ tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no))
+ AC_MSG_RESULT($tcl_cv_timezone_time)
+ if test $tcl_cv_timezone_time = yes ; then
AC_DEFINE(HAVE_TIMEZONE_VAR)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
-
- #
- # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
- #
- if test "$have_timezone" = no; then
- AC_MSG_CHECKING([time_t timezone variable])
- AC_TRY_COMPILE([#include <time.h>],
- [extern time_t timezone;
- timezone += 1;
- exit (0);],
- [AC_DEFINE(HAVE_TIMEZONE_VAR)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- fi
-
- #
- # On some systems (eg Solaris 2.5.1), timezone is not declared in
- # time.h unless you jump through hoops. Instead of that, we just
- # declare it ourselves when necessary.
- #
- if test "$have_timezone" = yes; then
- AC_MSG_CHECKING(for timezone declaration)
- changequote(<<,>>)
- tzrx='^[ ]*extern.*timezone'
- changequote([,])
- AC_EGREP_HEADER($tzrx, time.h, [
- AC_DEFINE(HAVE_TIMEZONE_DECL)
- AC_MSG_RESULT(found)], AC_MSG_RESULT(missing))
- fi
-
- #
- # AIX does not have a timezone field in struct tm. When the AIX bsd
- # library is used, the timezone global and the gettimeofday methods are
- # to be avoided for timezone deduction instead, we deduce the timezone
- # by comparing the localtime result on a known GMT value.
- #
-
- if test "`uname -s`" = "AIX" ; then
- AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes)
- if test $libbsd = yes; then
- AC_DEFINE(USE_DELTA_FOR_TZ)
fi
fi
])
@@ -1695,24 +2199,28 @@ AC_DEFUN(SC_BUGGY_STRTOD, [
AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
if test "$tcl_strtod" = 1; then
AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs])
- AC_TRY_RUN([
- extern double strtod();
- int main()
- {
- char *string = "NaN", *spaceString = " ";
- char *term;
- double value;
- value = strtod(string, &term);
- if ((term != string) && (term[-1] == 0)) {
- exit(1);
- }
- value = strtod(spaceString, &term);
- if (term == (spaceString+1)) {
- exit(1);
- }
- exit(0);
- }], tcl_ok=1, tcl_ok=0, tcl_ok=0)
- if test "$tcl_ok" = 1; then
+ AC_CACHE_VAL(tcl_cv_strtod_buggy,[
+ AC_TRY_RUN([
+ extern double strtod();
+ int main() {
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
+ char *term;
+ double value;
+ value = strtod(infString, &term);
+ if ((term != infString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(nanString, &term);
+ if ((term != nanString) && (term[-1] == 0)) {
+ exit(1);
+ }
+ value = strtod(spaceString, &term);
+ if (term == (spaceString+1)) {
+ exit(1);
+ }
+ exit(0);
+ }], tcl_cv_strtod_buggy=1, tcl_cv_strtod_buggy=0, tcl_cv_strtod_buggy=0)])
+ if test "$tcl_cv_strtod_buggy" = 1; then
AC_MSG_RESULT(ok)
else
AC_MSG_RESULT(buggy)
@@ -1761,29 +2269,12 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
#--------------------------------------------------------------------
- # On AIX systems, libbsd.a has to be linked in to support
- # non-blocking file IO. This library has to be linked in after
- # the MATH_LIBS or it breaks the pow() function. The way to
- # insure proper sequencing, is to add it to the tail of MATH_LIBS.
- # This library also supplies gettimeofday.
- #--------------------------------------------------------------------
-
- libbsd=no
- if test "`uname -s`" = "AIX" ; then
- AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes)
- if test $libbsd = yes; then
- MATH_LIBS="$MATH_LIBS -lbsd"
- fi
- fi
-
-
- #--------------------------------------------------------------------
# Interactive UNIX requires -linet instead of -lsocket, plus it
# needs net/errno.h to define the socket-related error codes.
#--------------------------------------------------------------------
AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
- AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H))
+ AC_CHECK_HEADER(net/errno.h, [AC_DEFINE(HAVE_NET_ERRNO_H)])
#--------------------------------------------------------------------
# Check for the existence of the -lsocket and -lnsl libraries.
@@ -1803,38 +2294,19 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [
# if -lsocket doesn't work by itself.
#--------------------------------------------------------------------
- # CYGNUS LOCAL: Store any socket library(ies) in the cache, and don't
- # mess up the cache values of the functions we check for.
- AC_CACHE_CHECK([for socket libraries], tcl_cv_lib_sockets,
- [tcl_cv_lib_sockets=
- tcl_checkBoth=0
- unset ac_cv_func_connect
- AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
- if test "$tcl_checkSocket" = 1; then
- unset ac_cv_func_connect
- AC_CHECK_LIB(socket, main, tcl_cv_lib_sockets="-lsocket",
- tcl_checkBoth=1)
- fi
- if test "$tcl_checkBoth" = 1; then
- tcl_oldLibs=$LIBS
- LIBS="$LIBS -lsocket -lnsl"
- unset ac_cv_func_accept
- AC_CHECK_FUNC(accept,
- [tcl_checkNsl=0
- tcl_cv_lib_sockets="-lsocket -lnsl"])
- unset ac_cv_func_accept
- LIBS=$tcl_oldLibs
- fi
- unset ac_cv_func_gethostbyname
- tcl_oldLibs=$LIBS
- LIBS="$LIBS $tcl_cv_lib_sockets"
- AC_CHECK_FUNC(gethostbyname, ,
- [AC_CHECK_LIB(nsl, main,
- [tcl_cv_lib_sockets="$tcl_cv_lib_sockets -lnsl"])])
- unset ac_cv_func_gethostbyname
- LIBS=$tcl_oldLIBS
- ])
- test -z "$tcl_cv_lib_sockets" || LIBS="$LIBS $tcl_cv_lib_sockets"
+ tcl_checkBoth=0
+ AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
+ if test "$tcl_checkSocket" = 1; then
+ AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
+ LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
+ fi
+ if test "$tcl_checkBoth" = 1; then
+ tk_oldLibs=$LIBS
+ LIBS="$LIBS -lsocket -lnsl"
+ AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
+ fi
+ AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
+ [LIBS="$LIBS -lnsl"])])
# Don't perform the eval of the libraries here because DL_LIBS
# won't be set until we call SC_CONFIG_CFLAGS
@@ -1844,39 +2316,109 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [
AC_SUBST(MATH_LIBS)
])
-dnl CYGNUS LOCAL: This gets the right posix flag for gcc
-
-AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
-[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
-AC_MSG_CHECKING([to see if this is LynxOS])
-AC_CACHE_VAL(ac_cv_os_lynx,
-[AC_EGREP_CPP(yes,
-[/*
- * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
- */
-#if defined(__Lynx__) || defined(Lynx)
-yes
-#endif
-], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)])
-#
-if test "$ac_cv_os_lynx" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(LYNX)
- AC_MSG_CHECKING([whether -mposix or -X is available])
- AC_CACHE_VAL(ac_cv_c_posix_flag,
- [AC_TRY_COMPILE(,[
- /*
- * This flag varies depending on how old the compiler is.
- * -X is for the old "cc" and "gcc" (based on 1.42).
- * -mposix is for the new gcc (at least 2.5.8).
- */
- #if defined(__GNUC__) && __GNUC__ >= 2
- choke me
- #endif
- ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")])
- CC="$CC $ac_cv_c_posix_flag"
- AC_MSG_RESULT($ac_cv_c_posix_flag)
- else
- AC_MSG_RESULT(no)
-fi
-])
+#--------------------------------------------------------------------
+# SC_TCL_EARLY_FLAGS
+#
+# Check for what flags are needed to be passed so the correct OS
+# features are available.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# _ISOC99_SOURCE
+# _LARGEFILE64_SOURCE
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN(SC_TCL_EARLY_FLAG,[
+ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
+ AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
+ AC_TRY_COMPILE([[#define ]$1[ 1
+]$2], $3,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
+ if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
+ AC_DEFINE($1)
+ tcl_flags="$tcl_flags $1"
+ fi])
+
+AC_DEFUN(SC_TCL_EARLY_FLAGS,[
+ AC_MSG_CHECKING([for required early compiler flags])
+ tcl_flags=""
+ SC_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
+ [char *p = (char *)strtoll; char *q = (char *)strtoull;])
+ SC_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
+ [struct stat64 buf; int i = stat64("/", &buf);])
+ if test "x${tcl_flags}" = "x" ; then
+ AC_MSG_RESULT(none)
+ else
+ AC_MSG_RESULT(${tcl_flags})
+ fi])
+
+#--------------------------------------------------------------------
+# SC_TCL_64BIT_FLAGS
+#
+# Check for what is defined in the way of 64-bit features.
+#
+# Arguments:
+# None
+#
+# Results:
+#
+# Might define the following vars:
+# TCL_WIDE_INT_IS_LONG
+# TCL_WIDE_INT_TYPE
+# HAVE_STRUCT_DIRENT64
+# HAVE_STRUCT_STAT64
+# HAVE_TYPE_OFF64_T
+#
+#--------------------------------------------------------------------
+
+AC_DEFUN(SC_TCL_64BIT_FLAGS, [
+ AC_MSG_CHECKING([for 64-bit integer type])
+ AC_CACHE_VAL(tcl_cv_type_64bit,[
+ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
+ tcl_cv_type_64bit=__int64,tcl_cv_type_64bit=none
+ AC_TRY_RUN([#include <unistd.h>
+ int main() {exit(!(sizeof(long long) > sizeof(long)));}
+ ], tcl_cv_type_64bit="long long"))])
+ if test "${tcl_cv_type_64bit}" = none ; then
+ AC_MSG_RESULT(using long)
+ else
+ AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit})
+ AC_MSG_RESULT(${tcl_cv_type_64bit})
+
+ # Now check for auxiliary declarations
+ AC_MSG_CHECKING([for struct dirent64])
+ AC_CACHE_VAL(tcl_cv_struct_dirent64,[
+ AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/dirent.h>],[struct dirent64 p;],
+ tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_DIRENT64)
+ fi
+ AC_MSG_RESULT(${tcl_cv_struct_dirent64})
+
+ AC_MSG_CHECKING([for struct stat64])
+ AC_CACHE_VAL(tcl_cv_struct_stat64,[
+ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
+],
+ tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
+ AC_DEFINE(HAVE_STRUCT_STAT64)
+ fi
+ AC_MSG_RESULT(${tcl_cv_struct_stat64})
+
+ AC_MSG_CHECKING([for off64_t])
+ AC_CACHE_VAL(tcl_cv_type_off64_t,[
+ AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
+],
+ tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
+ if test "x${tcl_cv_type_off64_t}" = "xyes" ; then
+ AC_DEFINE(HAVE_TYPE_OFF64_T)
+ fi
+ AC_MSG_RESULT(${tcl_cv_type_off64_t})
+ fi])
diff --git a/tk/unix/tk.spec b/tk/unix/tk.spec
new file mode 100644
index 00000000000..c85701933ea
--- /dev/null
+++ b/tk/unix/tk.spec
@@ -0,0 +1,52 @@
+# $Id$
+# This file is the basis for a binary Tk Linux RPM.
+
+%define version 8.4.0
+%define directory /usr/local
+
+Summary: Tk graphical toolkit for the Tcl scripting language.
+Name: tk
+Version: %{version}
+Release: 1
+Copyright: BSD
+Group: Development/Languages
+Source: http://prdownloads.sourceforge.net/tcl/tk%{version}-src.tar.gz
+URL: http://www.tcl.tk/
+Packager: Carina
+Buildroot: /var/tmp/%{name}%{version}
+Requires: XFree86-libs >= 3.3.3, XFree86-devel >= 3.3.3, tcl = 8.4.0
+
+%description
+The Tcl (Tool Command Language) provides a powerful platform for
+creating integration applications that tie together diverse
+applications, protocols, devices, and frameworks. When paired with
+the Tk toolkit, Tcl provides the fastest and most powerful way to
+create GUI applications that run on PCs, Unix, and the Macintosh. Tcl
+can also be used for a variety of web-related tasks and for creating
+powerful command languages for applications.
+
+%prep
+
+%build
+./configure --prefix %{directory} --exec-prefix %{directory}
+make CFLAGS=$RPM_OPT_FLAGS
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make INSTALL_ROOT=$RPM_BUILD_ROOT install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+# to create the tcl files list, comment out tk in the install section above,
+# then run "rpm -bi" then do a find from the build root directory,
+# and remove the files in specific directories which suffice by themselves,
+# then to create the files list for tk, uncomment tk, comment out tcl,
+# then rm -rf $RPM_BUILD_ROOT then rpm --short-circuit -bi then redo a find,
+# and remove the files in specific directories which suffice by themselves.
+%files -n tk
+%defattr(-,root,root)
+%{directory}/lib
+%{directory}/bin
+%{directory}/include
+%{directory}/man
diff --git a/tk/unix/tkAppInit.c b/tk/unix/tkAppInit.c
index ca7febb4453..296586a18b0 100644
--- a/tk/unix/tkAppInit.c
+++ b/tk/unix/tkAppInit.c
@@ -16,16 +16,7 @@
#include "tk.h"
#include "locale.h"
-/*
- * The following variable is a special hack that is needed in order for
- * Sun shared libraries to be used for Tcl.
- */
-
-extern int matherr();
-int *tclDummyMathPtr = (int *) matherr;
-
#ifdef TK_TEST
-extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
#endif /* TK_TEST */
@@ -109,11 +100,6 @@ Tcl_AppInit(interp)
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
#ifdef TK_TEST
- if (Tcltest_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
- (Tcl_PackageInitProc *) NULL);
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
@@ -148,4 +134,3 @@ Tcl_AppInit(interp)
Tcl_SetVar(interp, "tcl_rcFileName", "~/.wishrc", TCL_GLOBAL_ONLY);
return TCL_OK;
}
-
diff --git a/tk/unix/tkConfig.sh.in b/tk/unix/tkConfig.sh.in
index faa90d29203..764c9a27f04 100644
--- a/tk/unix/tkConfig.sh.in
+++ b/tk/unix/tkConfig.sh.in
@@ -31,9 +31,6 @@ TK_DBGX=@TK_DBGX@
# The name of the Tk library (may be either a .a file or a shared library):
TK_LIB_FILE='@TK_LIB_FILE@'
-# The full path to the Tk library for dependency tracking
-TK_LIB_FULL_PATH='@TK_LIB_FULL_PATH@'
-
# Additional libraries to use when linking Tk.
TK_LIBS='@XLIBSW@ @DL_LIBS@ @LIBS@ @MATH_LIBS@'
@@ -45,12 +42,6 @@ TK_PREFIX='@prefix@'
# executables) are installed.
TK_EXEC_PREFIX='@exec_prefix@'
-# CYGNUS LOCAL
-# -I switch(es) to pick up the tk.h header file from its build
-# directory.
-TK_BUILD_INCLUDES='@TK_BUILD_INCLUDES@'
-# END CYGNUS LOCAL
-
# -I switch(es) to use to make all of the X11 include files accessible:
TK_XINCLUDES='@XINCLUDES@'
@@ -78,8 +69,8 @@ TK_SRC_DIR='@TK_SRC_DIR@'
# Needed if you want to make a 'fat' shared library library
# containing tk objects or link a different wish.
-TK_CC_SEARCH_FLAGS='@TK_CC_SEARCH_FLAGS@'
-TK_LD_SEARCH_FLAGS='@TK_LD_SEARCH_FLAGS@'
+TK_CC_SEARCH_FLAGS='@CC_SEARCH_FLAGS@'
+TK_LD_SEARCH_FLAGS='@LD_SEARCH_FLAGS@'
# The name of the Tk stub library (.a):
TK_STUB_LIB_FILE='@TK_STUB_LIB_FILE@'
@@ -100,4 +91,3 @@ TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@'
# Path to the Tk stub library in the install directory.
TK_STUB_LIB_PATH='@TK_STUB_LIB_PATH@'
-
diff --git a/tk/unix/tkUnix.c b/tk/unix/tkUnix.c
index 3b099540eed..ebb8bfe7353 100644
--- a/tk/unix/tkUnix.c
+++ b/tk/unix/tkUnix.c
@@ -68,10 +68,10 @@ TkGetServerInfo(interp, tkwin)
*----------------------------------------------------------------------
*/
-char *
+CONST char *
TkGetDefaultScreenName(interp, screenName)
Tcl_Interp *interp; /* Interp used to find environment variables. */
- char *screenName; /* Screen name from command line, or NULL. */
+ CONST char *screenName; /* Screen name from command line, or NULL. */
{
if ((screenName == NULL) || (screenName[0] == '\0')) {
screenName = Tcl_GetVar2(interp, "env", "DISPLAY", TCL_GLOBAL_ONLY);
@@ -106,4 +106,3 @@ Tk_UpdatePointer(tkwin, x, y, state)
* This function intentionally left blank
*/
}
-
diff --git a/tk/unix/tkUnix3d.c b/tk/unix/tkUnix3d.c
index 9cab15094ed..b6a6b4682cd 100644
--- a/tk/unix/tkUnix3d.c
+++ b/tk/unix/tkUnix3d.c
@@ -14,7 +14,7 @@
#include <tk3d.h>
-#if !defined(__WIN32__) && !defined(MAC_TCL)
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
#include "tkUnixInt.h"
#endif
@@ -294,6 +294,15 @@ Tk_3DHorizontalBevel(tkwin, drawable, border, x, y, width, height,
for ( ; y < bottom; y++) {
/*
+ * X Dimensions are 16-bit, so avoid wraparound or display errors
+ * by limiting these here.
+ */
+ if (x1 < -32767)
+ x1 = -32767;
+ if (x2 > 32767)
+ x2 = 32767;
+
+ /*
* In some weird cases (such as large border widths for skinny
* rectangles) x1 can be >= x2. Don't draw the lines
* in these cases.
@@ -490,5 +499,3 @@ TkpGetShadows(borderPtr, tkwin)
borderPtr->lightGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
}
}
-
-
diff --git a/tk/unix/tkUnixButton.c b/tk/unix/tkUnixButton.c
index 5f15d51fae5..8db0636d3a1 100644
--- a/tk/unix/tkUnixButton.c
+++ b/tk/unix/tkUnixButton.c
@@ -26,10 +26,9 @@ typedef struct UnixButton {
* The class procedure table for the button widgets.
*/
-TkClassProcs tkpButtonProcs = {
- NULL, /* createProc. */
- TkButtonWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+Tk_ClassProcs tkpButtonProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkButtonWorldChanged, /* worldChangedProc */
};
/*
@@ -86,10 +85,13 @@ TkpDisplayButton(clientData)
* compiler warning. */
int y, relief;
Tk_Window tkwin = butPtr->tkwin;
- int width, height;
+ int width, height, fullWidth, fullHeight;
+ int imageXOffset, imageYOffset, textXOffset, textYOffset;
+ int haveImage = 0, haveText = 0;
int offset; /* 1 means this is a button widget, so we
* offset the text to make the button appear
- * to move up and down as the relief changes. */
+ * to move up and down as the relief changes.
+ */
butPtr->flags &= ~REDRAW_PENDING;
if ((butPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
@@ -113,13 +115,40 @@ TkpDisplayButton(clientData)
/*
* Override the relief specified for the button if this is a
- * checkbutton or radiobutton and there's no indicator.
+ * checkbutton or radiobutton and there's no indicator. The new
+ * relief is as follows:
+ * If the button is select --> "sunken"
+ * If relief==overrelief --> relief
+ * Otherwise --> overrelief
+ *
+ * The effect we are trying to achieve is as follows:
+ *
+ * value mouse-over? --> relief
+ * ------- ------------ --------
+ * off no flat
+ * off yes raised
+ * on no sunken
+ * on yes sunken
+ *
+ * This is accomplished by configuring the checkbutton or radiobutton
+ * like this:
+ *
+ * -indicatoron 0 -overrelief raised -offrelief flat
+ *
+ * Bindings (see library/button.tcl) will copy the -overrelief into
+ * -relief on mouseover. Hence, we can tell if we are in mouse-over by
+ * comparing relief against overRelief. This is an aweful kludge, but
+ * it gives use the desired behavior while keeping the code backwards
+ * compatible.
*/
relief = butPtr->relief;
if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) {
- relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN
- : TK_RELIEF_RAISED;
+ if (butPtr->flags & SELECTED) {
+ relief = TK_RELIEF_SUNKEN;
+ } else if (butPtr->overRelief != relief) {
+ relief = butPtr->offRelief;
+ }
}
offset = (butPtr->type == TYPE_BUTTON) && !Tk_StrictMotif(butPtr->tkwin);
@@ -142,12 +171,72 @@ TkpDisplayButton(clientData)
if (butPtr->image != NULL) {
Tk_SizeOfImage(butPtr->image, &width, &height);
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
+ haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
+
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ imageXOffset = 0;
+ imageYOffset = 0;
+ textXOffset = 0;
+ textYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
+
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ if (butPtr->compound == COMPOUND_TOP) {
+ textYOffset = height + butPtr->padY;
+ } else {
+ imageYOffset = butPtr->textHeight + butPtr->padY;
+ }
+ fullHeight = height + butPtr->textHeight + butPtr->padY;
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ if (butPtr->compound == COMPOUND_LEFT) {
+ textXOffset = width + butPtr->padX;
+ } else {
+ imageXOffset = butPtr->textWidth + butPtr->padX;
+ }
+ fullWidth = butPtr->textWidth + butPtr->padX + width;
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ butPtr->indicatorSpace + fullWidth, fullHeight, &x, &y);
- imageOrBitmap:
- TkComputeAnchor(butPtr->anchor, tkwin, 0, 0,
- butPtr->indicatorSpace + width, height, &x, &y);
x += butPtr->indicatorSpace;
-
+
x += offset;
y += offset;
if (relief == TK_RELIEF_RAISED) {
@@ -157,47 +246,87 @@ TkpDisplayButton(clientData)
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);
+ Tk_RedrawImage(butPtr->selectImage, 0, 0,
+ width, height, pixmap, x + imageXOffset,
+ y + imageYOffset);
} else {
- Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap,
- x, y);
+ Tk_RedrawImage(butPtr->image, 0, 0, width,
+ height, pixmap, x + imageXOffset, y + imageYOffset);
}
} 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, x + imageXOffset,
+ y + imageYOffset);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc,
+ 0, 0, (unsigned int) width,
+ (unsigned int) height, x + imageXOffset,
+ y + imageYOffset, 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->padX, butPtr->padY,
- 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) {
+ Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
+ x + textXOffset, y + textYOffset, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x + textXOffset, y + textYOffset,
+ butPtr->underline);
+ y += fullHeight/2;
+ } else {
+ if (haveImage) {
+ TkComputeAnchor(butPtr->anchor, tkwin, 0, 0,
+ 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 {
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ 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;
+ }
+ Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
+ x, y, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x, y, butPtr->underline);
+ y += butPtr->textHeight/2;
}
- Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
- x, y, 0, -1);
- Tk_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
@@ -220,10 +349,15 @@ TkpDisplayButton(clientData)
dim -= 2*butPtr->borderWidth;
if (butPtr->flags & SELECTED) {
GC gc;
-
- gc = Tk_3DBorderGC(tkwin, (butPtr->selectBorder != NULL)
- ? butPtr->selectBorder : butPtr->normalBorder,
- TK_3D_FLAT_GC);
+ if (butPtr->state != STATE_DISABLED &&
+ butPtr->selectBorder != NULL) {
+ gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder,
+ TK_3D_FLAT_GC);
+ } else {
+ gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder,
+ TK_3D_FLAT_GC);
+ }
+
XFillRectangle(butPtr->display, pixmap, gc, x, y,
(unsigned int) dim, (unsigned int) dim);
} else {
@@ -247,9 +381,13 @@ TkpDisplayButton(clientData)
if (butPtr->flags & SELECTED) {
GC gc;
- gc = Tk_3DBorderGC(tkwin, (butPtr->selectBorder != NULL)
- ? butPtr->selectBorder : butPtr->normalBorder,
- TK_3D_FLAT_GC);
+ if (butPtr->state != STATE_DISABLED &&
+ butPtr->selectBorder != NULL) {
+ gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder, TK_3D_FLAT_GC);
+ } else {
+ gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder, TK_3D_FLAT_GC);
+ }
+
XFillPolygon(butPtr->display, pixmap, gc, points, 4, Convex,
CoordModeOrigin);
} else {
@@ -394,7 +532,8 @@ void
TkpComputeButtonGeometry(butPtr)
register TkButton *butPtr; /* Button whose geometry may have changed. */
{
- int width, height, avgWidth;
+ int width, height, avgWidth, txtWidth, txtHeight;
+ int haveImage = 0, haveText = 0;
Tk_FontMetrics fm;
butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth;
@@ -407,15 +546,73 @@ TkpComputeButtonGeometry(butPtr)
butPtr->inset += 5;
}
butPtr->indicatorSpace = 0;
+
+ width = 0;
+ height = 0;
+ txtWidth = 0;
+ txtHeight = 0;
+ avgWidth = 0;
+
if (butPtr->image != NULL) {
Tk_SizeOfImage(butPtr->image, &width, &height);
- imageOrBitmap:
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
+
+ if (haveImage == 0 || butPtr->compound != COMPOUND_NONE) {
+ Tk_FreeTextLayout(butPtr->textLayout);
+
+ butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
+ Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
+ butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
+
+ txtWidth = butPtr->textWidth;
+ txtHeight = butPtr->textHeight;
+ avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ haveText = (txtWidth != 0 && txtHeight != 0);
+ }
+
+ /*
+ * If the button is compound (ie, it shows both an image and text),
+ * the new geometry is a combination of the image and text geometry.
+ * We only honor the compound bit if the button has both text and an
+ * image, because otherwise it is not really a compound button.
+ */
+
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ height += txtHeight + butPtr->padY;
+ width = (width > txtWidth ? width : txtWidth);
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ width += txtWidth + butPtr->padX;
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ width = (width > txtWidth ? width : txtWidth);
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
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) {
@@ -424,33 +621,45 @@ TkpComputeButtonGeometry(butPtr)
butPtr->indicatorDiameter = (75*height)/100;
}
}
- } else if (butPtr->bitmap != None) {
- Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- goto imageOrBitmap;
- } else {
- Tk_FreeTextLayout(butPtr->textLayout);
-
- butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
- Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
- butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
- width = butPtr->textWidth;
- height = butPtr->textHeight;
- avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
- Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ width += 2*butPtr->padX;
+ height += 2*butPtr->padY;
- 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 = (80*butPtr->indicatorDiameter)/100;
+ } else {
+ if (haveImage) {
+ 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 {
+ width = txtWidth;
+ height = txtHeight;
+
+ 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 =
+ (80*butPtr->indicatorDiameter)/100;
+ }
+ butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth;
}
- butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth;
}
}
@@ -473,4 +682,3 @@ TkpComputeButtonGeometry(butPtr)
+ 2*butPtr->inset), (int) (height + 2*butPtr->inset));
Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset);
}
-
diff --git a/tk/unix/tkUnixColor.c b/tk/unix/tkUnixColor.c
index ef3d77a4669..d927351833b 100644
--- a/tk/unix/tkUnixColor.c
+++ b/tk/unix/tkUnixColor.c
@@ -422,4 +422,3 @@ TkpCmapStressed(tkwin, colormap)
}
return 0;
}
-
diff --git a/tk/unix/tkUnixConfig.c b/tk/unix/tkUnixConfig.c
index 9db523a9d40..d450d7d811e 100644
--- a/tk/unix/tkUnixConfig.c
+++ b/tk/unix/tkUnixConfig.c
@@ -38,9 +38,8 @@
Tcl_Obj *
TkpGetSystemDefault(tkwin, dbName, className)
Tk_Window tkwin; /* A window to use. */
- char *dbName; /* The option database name. */
- char *className; /* The name of the option class. */
+ CONST char *dbName; /* The option database name. */
+ CONST char *className; /* The name of the option class. */
{
return NULL;
}
-
diff --git a/tk/unix/tkUnixCursor.c b/tk/unix/tkUnixCursor.c
index 54915b9c92c..41069ac7368 100644
--- a/tk/unix/tkUnixCursor.c
+++ b/tk/unix/tkUnixCursor.c
@@ -154,7 +154,7 @@ TkGetCursorByName(interp, tkwin, string)
TkUnixCursor *cursorPtr = NULL;
Cursor cursor = None;
int argc;
- char **argv = NULL;
+ CONST char **argv = NULL;
Pixmap source = None;
Pixmap mask = None;
Display *display = Tk_Display(tkwin);
@@ -352,8 +352,8 @@ TkCursor *
TkCreateCursorFromData(tkwin, source, mask, width, height, xHot, yHot,
fgColor, bgColor)
Tk_Window tkwin; /* Window in which cursor will be used. */
- char *source; /* Bitmap data for cursor shape. */
- char *mask; /* Bitmap data for cursor mask. */
+ CONST char *source; /* Bitmap data for cursor shape. */
+ CONST char *mask; /* Bitmap data for cursor mask. */
int width, height; /* Dimensions of cursor. */
int xHot, yHot; /* Location of hot-spot in cursor. */
XColor fgColor; /* Foreground color for cursor. */
@@ -408,4 +408,3 @@ TkpFreeCursor(cursorPtr)
XFreeCursor(unixCursorPtr->display, (Cursor) unixCursorPtr->info.cursor);
Tk_FreeXId(unixCursorPtr->display, (XID) unixCursorPtr->info.cursor);
}
-
diff --git a/tk/unix/tkUnixDefault.h b/tk/unix/tkUnixDefault.h
index 0bc3f966b1b..7699c07ab94 100644
--- a/tk/unix/tkUnixDefault.h
+++ b/tk/unix/tkUnixDefault.h
@@ -51,6 +51,7 @@
#define DEF_BUTTON_BITMAP ""
#define DEF_BUTTON_BORDER_WIDTH "2"
#define DEF_BUTTON_CURSOR ""
+#define DEF_BUTTON_COMPOUND "none"
#define DEF_BUTTON_COMMAND ""
#define DEF_BUTTON_DEFAULT "disabled"
#define DEF_BUTTON_DISABLED_FG_COLOR DISABLED
@@ -69,12 +70,15 @@
#define DEF_BUTTON_JUSTIFY "center"
#define DEF_BUTTON_OFF_VALUE "0"
#define DEF_BUTTON_ON_VALUE "1"
+#define DEF_BUTTON_OVER_RELIEF ""
#define DEF_BUTTON_PADX "3m"
#define DEF_LABCHKRAD_PADX "1"
#define DEF_BUTTON_PADY "1m"
#define DEF_LABCHKRAD_PADY "1"
#define DEF_BUTTON_RELIEF "raised"
#define DEF_LABCHKRAD_RELIEF "flat"
+#define DEF_BUTTON_REPEAT_DELAY "0"
+#define DEF_BUTTON_REPEAT_INTERVAL "0"
#define DEF_BUTTON_SELECT_COLOR INDICATOR
#define DEF_BUTTON_SELECT_MONO BLACK
#define DEF_BUTTON_SELECT_IMAGE (char *) NULL
@@ -133,6 +137,9 @@
#define DEF_ENTRY_BG_MONO WHITE
#define DEF_ENTRY_BORDER_WIDTH "2"
#define DEF_ENTRY_CURSOR "xterm"
+#define DEF_ENTRY_DISABLED_BG_COLOR NORMAL_BG
+#define DEF_ENTRY_DISABLED_BG_MONO WHITE
+#define DEF_ENTRY_DISABLED_FG DISABLED
#define DEF_ENTRY_EXPORT_SELECTION "1"
#define DEF_ENTRY_FONT "Helvetica -12"
#define DEF_ENTRY_FG BLACK
@@ -146,6 +153,8 @@
#define DEF_ENTRY_INSERT_ON_TIME "600"
#define DEF_ENTRY_INSERT_WIDTH "2"
#define DEF_ENTRY_JUSTIFY "left"
+#define DEF_ENTRY_READONLY_BG_COLOR NORMAL_BG
+#define DEF_ENTRY_READONLY_BG_MONO WHITE
#define DEF_ENTRY_RELIEF "sunken"
#define DEF_ENTRY_SCROLL_COMMAND ""
#define DEF_ENTRY_SELECT_COLOR SELECT_BG
@@ -175,20 +184,36 @@
#define DEF_FRAME_HIGHLIGHT_BG NORMAL_BG
#define DEF_FRAME_HIGHLIGHT BLACK
#define DEF_FRAME_HIGHLIGHT_WIDTH "0"
+#define DEF_FRAME_LABEL ""
+#define DEF_FRAME_PADX "0"
+#define DEF_FRAME_PADY "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 labelframes:
+ */
+
+#define DEF_LABELFRAME_BORDER_WIDTH "2"
+#define DEF_LABELFRAME_CLASS "Labelframe"
+#define DEF_LABELFRAME_RELIEF "groove"
+#define DEF_LABELFRAME_FG BLACK
+#define DEF_LABELFRAME_FONT "Helvetica -12 bold"
+#define DEF_LABELFRAME_TEXT ""
+#define DEF_LABELFRAME_LABELANCHOR "nw"
+
+/*
* Defaults for listboxes:
*/
+#define DEF_LISTBOX_ACTIVE_STYLE "underline"
#define DEF_LISTBOX_BG_COLOR NORMAL_BG
#define DEF_LISTBOX_BG_MONO WHITE
#define DEF_LISTBOX_BORDER_WIDTH "2"
#define DEF_LISTBOX_CURSOR ""
+#define DEF_LISTBOX_DISABLED_FG DISABLED
#define DEF_LISTBOX_EXPORT_SELECTION "1"
#define DEF_LISTBOX_FONT "Helvetica -12 bold"
#define DEF_LISTBOX_FG BLACK
@@ -206,6 +231,7 @@
#define DEF_LISTBOX_SELECT_FG_MONO WHITE
#define DEF_LISTBOX_SELECT_MODE "browse"
#define DEF_LISTBOX_SET_GRID "0"
+#define DEF_LISTBOX_STATE "normal"
#define DEF_LISTBOX_TAKE_FOCUS (char *) NULL
#define DEF_LISTBOX_WIDTH "20"
@@ -220,6 +246,7 @@
#define DEF_MENU_ENTRY_BITMAP None
#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
#define DEF_MENU_ENTRY_COMMAND (char *) NULL
+#define DEF_MENU_ENTRY_COMPOUND "none"
#define DEF_MENU_ENTRY_FG (char *) NULL
#define DEF_MENU_ENTRY_FONT (char *) NULL
#define DEF_MENU_ENTRY_HIDE_MARGIN "0"
@@ -328,6 +355,40 @@
#define DEF_MESSAGE_WIDTH "0"
/*
+ * Defaults for panedwindows
+ */
+
+#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG
+#define DEF_PANEDWINDOW_BG_MONO WHITE
+#define DEF_PANEDWINDOW_BORDERWIDTH "2"
+#define DEF_PANEDWINDOW_CURSOR ""
+#define DEF_PANEDWINDOW_HANDLEPAD "8"
+#define DEF_PANEDWINDOW_HANDLESIZE "8"
+#define DEF_PANEDWINDOW_HEIGHT ""
+#define DEF_PANEDWINDOW_OPAQUERESIZE "0"
+#define DEF_PANEDWINDOW_ORIENT "horizontal"
+#define DEF_PANEDWINDOW_RELIEF "flat"
+#define DEF_PANEDWINDOW_SASHCURSOR ""
+#define DEF_PANEDWINDOW_SASHPAD "2"
+#define DEF_PANEDWINDOW_SASHRELIEF "raised"
+#define DEF_PANEDWINDOW_SASHWIDTH "2"
+#define DEF_PANEDWINDOW_SHOWHANDLE "1"
+#define DEF_PANEDWINDOW_WIDTH ""
+
+/*
+ * Defaults for panedwindow panes
+ */
+
+#define DEF_PANEDWINDOW_PANE_AFTER ""
+#define DEF_PANEDWINDOW_PANE_BEFORE ""
+#define DEF_PANEDWINDOW_PANE_HEIGHT ""
+#define DEF_PANEDWINDOW_PANE_MINSIZE "0"
+#define DEF_PANEDWINDOW_PANE_PADX "0"
+#define DEF_PANEDWINDOW_PANE_PADY "0"
+#define DEF_PANEDWINDOW_PANE_STICKY "nsew"
+#define DEF_PANEDWINDOW_PANE_WIDTH ""
+
+/*
* Defaults for scales:
*/
@@ -397,6 +458,7 @@
* Defaults for texts:
*/
+#define DEF_TEXT_AUTO_SEPARATORS "1"
#define DEF_TEXT_BG_COLOR NORMAL_BG
#define DEF_TEXT_BG_MONO WHITE
#define DEF_TEXT_BORDER_WIDTH "2"
@@ -414,6 +476,7 @@
#define DEF_TEXT_INSERT_OFF_TIME "300"
#define DEF_TEXT_INSERT_ON_TIME "600"
#define DEF_TEXT_INSERT_WIDTH "2"
+#define DEF_TEXT_MAX_UNDO "0"
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "sunken"
@@ -431,11 +494,11 @@
#define DEF_TEXT_STATE "normal"
#define DEF_TEXT_TABS ""
#define DEF_TEXT_TAKE_FOCUS (char *) NULL
+#define DEF_TEXT_UNDO "0"
#define DEF_TEXT_WIDTH "80"
#define DEF_TEXT_WRAP "char"
#define DEF_TEXT_XSCROLL_COMMAND ""
#define DEF_TEXT_YSCROLL_COMMAND ""
-#define DEF_TEXT_TAB_SIZE "8"
/*
* Defaults for canvas text:
@@ -451,6 +514,6 @@
#define DEF_TOPLEVEL_CLASS "Toplevel"
#define DEF_TOPLEVEL_MENU ""
#define DEF_TOPLEVEL_SCREEN ""
+#define DEF_TOPLEVEL_USE ""
#endif /* _TKUNIXDEFAULT */
-
diff --git a/tk/unix/tkUnixDialog.c b/tk/unix/tkUnixDialog.c
index b9554327af0..6fb99eae655 100644
--- a/tk/unix/tkUnixDialog.c
+++ b/tk/unix/tkUnixDialog.c
@@ -103,7 +103,7 @@ Tk_ChooseColorCmd(clientData, interp, argc, argv)
int argc; /* Number of arguments. */
char **argv; /* Argument strings. */
{
- return EvalArgv(interp, "tkColorDialog", argc, argv);
+ return EvalArgv(interp, "tk::ColorDialog", argc, argv);
}
/*
@@ -137,9 +137,9 @@ Tk_GetOpenFileCmd(clientData, interp, argc, argv)
Tk_Window tkwin = (Tk_Window)clientData;
if (Tk_StrictMotif(tkwin)) {
- return EvalArgv(interp, "tkMotifFDialog", argc, argv);
+ return EvalArgv(interp, "tk::MotifFDialog", argc, argv);
} else {
- return EvalArgv(interp, "tkFDialog", argc, argv);
+ return EvalArgv(interp, "tk::FDialog", argc, argv);
}
}
@@ -170,9 +170,9 @@ Tk_GetSaveFileCmd(clientData, interp, argc, argv)
Tk_Window tkwin = (Tk_Window)clientData;
if (Tk_StrictMotif(tkwin)) {
- return EvalArgv(interp, "tkMotifFDialog", argc, argv);
+ return EvalArgv(interp, "tk::MotifFDialog", argc, argv);
} else {
- return EvalArgv(interp, "tkFDialog", argc, argv);
+ return EvalArgv(interp, "tk::FDialog", argc, argv);
}
}
@@ -202,7 +202,6 @@ Tk_MessageBoxCmd(clientData, interp, argc, argv)
int argc; /* Number of arguments. */
char **argv; /* Argument strings. */
{
- return EvalArgv(interp, "tkMessageBox", argc, argv);
+ return EvalArgv(interp, "tk::MessageBox", argc, argv);
}
-
diff --git a/tk/unix/tkUnixDraw.c b/tk/unix/tkUnixDraw.c
index 2a135aa4036..2f603f9af32 100644
--- a/tk/unix/tkUnixDraw.c
+++ b/tk/unix/tkUnixDraw.c
@@ -94,7 +94,11 @@ TkScrollWindow(tkwin, gc, x, y, width, height, dx, dy, damageRgn)
}
Tk_RestrictEvents(oldProc, oldArg, &dummy);
- return XEmptyRegion((Region) damageRgn) ? 0 : 1;
+ if (XEmptyRegion((Region) damageRgn)) {
+ return 0;
+ } else {
+ return 1;
+ }
}
/*
@@ -205,4 +209,3 @@ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, drawable)
{
TkDrawInsetFocusHighlight(tkwin, fgGC, highlightWidth, drawable, 0);
}
-
diff --git a/tk/unix/tkUnixEmbed.c b/tk/unix/tkUnixEmbed.c
index e52a06226de..c28b84525b9 100644
--- a/tk/unix/tkUnixEmbed.c
+++ b/tk/unix/tkUnixEmbed.c
@@ -101,10 +101,11 @@ TkpUseWindow(interp, tkwin, string)
* if string is bogus. */
Tk_Window tkwin; /* Tk window that does not yet have an
* associated X window. */
- char *string; /* String identifying an X window to use
+ CONST char *string; /* String identifying an X window to use
* for tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *usePtr;
int id, anyError;
Window parent;
Tk_ErrorHandler handler;
@@ -121,6 +122,15 @@ TkpUseWindow(interp, tkwin, string)
}
parent = (Window) id;
+ usePtr = (TkWindow *) Tk_IdToWindow(winPtr->display, parent);
+ if (usePtr != NULL) {
+ if (!(usePtr->flags & TK_CONTAINER)) {
+ Tcl_AppendResult(interp, "window \"", usePtr->pathName,
+ "\" doesn't have -container option set", (char *) NULL);
+ return TCL_ERROR;
+ }
+ }
+
/*
* Tk sets the window colormap to the screen default colormap in
* tkWindow.c:AllocWindow. This doesn't work well for embedded
@@ -770,7 +780,7 @@ TkpRedirectKeyEvent(winPtr, eventPtr)
return;
}
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_TOP_HIERARCHY) {
break;
}
winPtr = winPtr->parentPtr;
@@ -872,7 +882,7 @@ TkpTestembedCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
int all;
Container *containerPtr;
@@ -1022,4 +1032,3 @@ TkUnixContainerId(winPtr)
panic("TkUnixContainerId couldn't find window");
return None;
}
-
diff --git a/tk/unix/tkUnixEvent.c b/tk/unix/tkUnixEvent.c
index f90963be892..a4debe3f7f6 100644
--- a/tk/unix/tkUnixEvent.c
+++ b/tk/unix/tkUnixEvent.c
@@ -39,6 +39,9 @@ static void DisplayFileProc _ANSI_ARGS_((ClientData clientData,
static void DisplaySetupProc _ANSI_ARGS_((ClientData clientData,
int flags));
static void TransferXEventsToTcl _ANSI_ARGS_((Display *display));
+#ifdef TK_USE_INPUT_METHODS
+static void OpenIM _ANSI_ARGS_((TkDisplay *dispPtr));
+#endif
/*
@@ -118,7 +121,7 @@ DisplayExitHandler(clientData)
TkDisplay *
TkpOpenDisplay(display_name)
- char *display_name;
+ CONST char *display_name;
{
TkDisplay *dispPtr;
Display *display = XOpenDisplay(display_name);
@@ -127,7 +130,11 @@ TkpOpenDisplay(display_name)
return NULL;
}
dispPtr = (TkDisplay *) ckalloc(sizeof(TkDisplay));
+ memset(dispPtr, 0, sizeof(TkDisplay));
dispPtr->display = display;
+#ifdef TK_USE_INPUT_METHODS
+ OpenIM(dispPtr);
+#endif
Tcl_CreateFileHandler(ConnectionNumber(display), TCL_READABLE,
DisplayFileProc, (ClientData) dispPtr);
return dispPtr;
@@ -144,25 +151,44 @@ TkpOpenDisplay(display_name)
* None.
*
* Side effects:
- * Deallocates the displayPtr.
+ * Deallocates the displayPtr and unix-specific resources.
*
*----------------------------------------------------------------------
*/
void
-TkpCloseDisplay(displayPtr)
- TkDisplay *displayPtr;
+TkpCloseDisplay(dispPtr)
+ TkDisplay *dispPtr;
{
- TkDisplay *dispPtr = (TkDisplay *) displayPtr;
+ TkSendCleanup(dispPtr);
+
+ TkFreeXId(dispPtr);
+
+ TkWmCleanup(dispPtr);
+
+#ifdef TK_USE_INPUT_METHODS
+#if TK_XIM_SPOT
+ if (dispPtr->inputXfs) {
+ XFreeFontSet(dispPtr->display, dispPtr->inputXfs);
+ }
+#endif
+ if (dispPtr->inputMethod) {
+ /*
+ * This caused core dumps on some systems (Solaris 2.3 1/6/95).
+ * The most likely cause of this is a bug in X that accesses
+ * memory that was already deallocated inside XCloseIM().
+ * One can work around this issue by making sure a XDestroyIC()
+ * gets invoked for each XCreateIC().
+ */
+ XCloseIM(dispPtr->inputMethod);
+ }
+#endif
if (dispPtr->display != 0) {
- Tcl_DeleteFileHandler(ConnectionNumber(dispPtr->display));
-
- (void) XSync(dispPtr->display, False);
- (void) XCloseDisplay(dispPtr->display);
+ Tcl_DeleteFileHandler(ConnectionNumber(dispPtr->display));
+ (void) XSync(dispPtr->display, False);
+ (void) XCloseDisplay(dispPtr->display);
}
-
- ckfree((char *) dispPtr);
}
/*
@@ -230,7 +256,6 @@ DisplaySetupProc(clientData, flags)
*----------------------------------------------------------------------
*/
-
static void
TransferXEventsToTcl(display)
Display *display;
@@ -285,8 +310,6 @@ DisplayCheckProc(clientData, flags)
TransferXEventsToTcl(dispPtr->display);
}
}
-
-
/*
*----------------------------------------------------------------------
@@ -516,6 +539,81 @@ TkpSync(display)
* Transfer events from the X event queue to the Tk event queue.
*/
TransferXEventsToTcl(display);
-
}
+#ifdef TK_USE_INPUT_METHODS
+
+/*
+ *--------------------------------------------------------------
+ *
+ * OpenIM --
+ *
+ * Tries to open an X input method, associated with the
+ * given display. Right now we can only deal with a bare-bones
+ * input style: no preedit, and no status.
+ *
+ * Results:
+ * Stores the input method in dispPtr->inputMethod; if there isn't
+ * a suitable input method, then NULL is stored in dispPtr->inputMethod.
+ *
+ * Side effects:
+ * An input method gets opened.
+ *
+ *--------------------------------------------------------------
+ */
+
+static void
+OpenIM(dispPtr)
+ TkDisplay *dispPtr; /* Tk's structure for the display. */
+{
+ unsigned short i;
+ XIMStyles *stylePtr;
+ char *modifier_list;
+
+ if ((modifier_list = XSetLocaleModifiers("")) == NULL) {
+ goto error;
+ }
+
+ dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL);
+ if (dispPtr->inputMethod == NULL) {
+ return;
+ }
+
+ if ((XGetIMValues(dispPtr->inputMethod, XNQueryInputStyle, &stylePtr,
+ NULL) != NULL) || (stylePtr == NULL)) {
+ goto error;
+ }
+#if TK_XIM_SPOT
+ /*
+ * If we want to do over-the-spot XIM, we have to check that this
+ * mode is supported. If not we will fall-through to the check below.
+ */
+ for (i = 0; i < stylePtr->count_styles; i++) {
+ if (stylePtr->supported_styles[i]
+ == (XIMPreeditPosition | XIMStatusNothing)) {
+ dispPtr->flags |= TK_DISPLAY_XIM_SPOT;
+ XFree(stylePtr);
+ return;
+ }
+ }
+#endif
+ for (i = 0; i < stylePtr->count_styles; i++) {
+ if (stylePtr->supported_styles[i]
+ == (XIMPreeditNothing | XIMStatusNothing)) {
+ XFree(stylePtr);
+ return;
+ }
+ }
+ XFree(stylePtr);
+ error:
+
+ if (dispPtr->inputMethod) {
+ /*
+ * This call should not suffer from any core dumping problems
+ * since we have not allocated any input contexts.
+ */
+ XCloseIM(dispPtr->inputMethod);
+ dispPtr->inputMethod = NULL;
+ }
+}
+#endif /* TK_USE_INPUT_METHODS */
diff --git a/tk/unix/tkUnixFocus.c b/tk/unix/tkUnixFocus.c
index 51e4b56c243..d7f450b7d38 100644
--- a/tk/unix/tkUnixFocus.c
+++ b/tk/unix/tkUnixFocus.c
@@ -146,4 +146,3 @@ TkpChangeFocus(winPtr, force)
XFlush(dispPtr->display);
return serial;
}
-
diff --git a/tk/unix/tkUnixFont.c b/tk/unix/tkUnixFont.c
index f9e4229f5c9..ce240df7ebb 100644
--- a/tk/unix/tkUnixFont.c
+++ b/tk/unix/tkUnixFont.c
@@ -14,6 +14,8 @@
#include "tkUnixInt.h"
#include "tkFont.h"
+#include <netinet/in.h> /* for htons() prototype */
+#include <arpa/inet.h> /* inet_ntoa() */
/*
* The preferred font encodings.
@@ -180,6 +182,7 @@ static EncodingAlias encodingAliases[] = {
{"cns11643-1", "cns11643*.1-0"},
{"cns11643-2", "cns11643*-2"},
{"cns11643-2", "cns11643*.2-0"},
+ {"jis0201", "jisx0201*"},
{"jis0201", "jisx0202*"},
{"jis0208", "jisc6226*"},
{"jis0208", "jisx0208*"},
@@ -187,6 +190,7 @@ static EncodingAlias encodingAliases[] = {
{"tis620", "tis620*"},
{"ksc5601", "ksc5601*"},
{"dingbats", "*dingbats"},
+ {"ucs-2be", "iso10646-1"},
{NULL, NULL}
};
@@ -194,10 +198,11 @@ static EncodingAlias encodingAliases[] = {
* Procedures used only in this file.
*/
+static void FontPkgCleanup _ANSI_ARGS_((ClientData clientData));
static FontFamily * AllocFontFamily _ANSI_ARGS_((Display *display,
XFontStruct *fontStructPtr, int base));
static SubFont * CanUseFallback _ANSI_ARGS_((UnixFont *fontPtr,
- char *fallbackName, int ch));
+ CONST char *fallbackName, int ch));
static SubFont * CanUseFallbackWithAliases _ANSI_ARGS_((
UnixFont *fontPtr, char *fallbackName,
int ch, Tcl_DString *nameTriedPtr));
@@ -243,11 +248,59 @@ static void ReleaseSubFont _ANSI_ARGS_((Display *display,
SubFont *subFontPtr));
static int SeenName _ANSI_ARGS_((CONST char *name,
Tcl_DString *dsPtr));
+static int Ucs2beToUtfProc _ANSI_ARGS_((ClientData clientData,
+ CONST char *src, int srcLen, int flags,
+ Tcl_EncodingState *statePtr, char *dst, int dstLen,
+ int *srcReadPtr, int *dstWrotePtr,
+ int *dstCharsPtr));
+static int UtfToUcs2beProc _ANSI_ARGS_((ClientData clientData,
+ CONST char *src, int srcLen, int flags,
+ Tcl_EncodingState *statePtr, char *dst, int dstLen,
+ int *srcReadPtr, int *dstWrotePtr,
+ int *dstCharsPtr));
/*
*-------------------------------------------------------------------------
*
+ * FontPkgCleanup --
+ *
+ * This procedure is called when an application is created. It
+ * initializes all the structures that are used by the
+ * platform-dependent code on a per application basis.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Releases thread-specific resources used by font pkg.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+FontPkgCleanup(ClientData clientData)
+{
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ if (tsdPtr->controlFamily.encoding != NULL) {
+ FontFamily *familyPtr = &tsdPtr->controlFamily;
+ int i;
+
+ Tcl_FreeEncoding(familyPtr->encoding);
+ for (i = 0; i < FONTMAP_PAGES; i++) {
+ if (familyPtr->fontMap[i] != NULL) {
+ ckfree(familyPtr->fontMap[i]);
+ }
+ }
+ tsdPtr->controlFamily.encoding = NULL;
+ }
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
* TkpFontPkgInit --
*
* This procedure is called when an application is created. It
@@ -274,12 +327,12 @@ TkpFontPkgInit(mainPtr)
int i;
if (tsdPtr->controlFamily.encoding == NULL) {
- type.encodingName = "X11ControlChars";
- type.toUtfProc = ControlUtfProc;
- type.fromUtfProc = ControlUtfProc;
- type.freeProc = NULL;
- type.clientData = NULL;
- type.nullSize = 0;
+ type.encodingName = "X11ControlChars";
+ type.toUtfProc = ControlUtfProc;
+ type.fromUtfProc = ControlUtfProc;
+ type.freeProc = NULL;
+ type.clientData = NULL;
+ type.nullSize = 0;
tsdPtr->controlFamily.refCount = 2;
tsdPtr->controlFamily.encoding = Tcl_CreateEncoding(&type);
@@ -291,6 +344,20 @@ TkpFontPkgInit(mainPtr)
FontMapInsert(&dummy, i);
FontMapInsert(&dummy, i + 0x80);
}
+
+ /*
+ * UCS-2BE is unicode in big-endian format.
+ * It is used in iso10646 fonts.
+ */
+
+ type.encodingName = "ucs-2be";
+ type.toUtfProc = Ucs2beToUtfProc;
+ type.fromUtfProc = UtfToUcs2beProc;
+ type.freeProc = NULL;
+ type.clientData = NULL;
+ type.nullSize = 2;
+ Tcl_CreateEncoding(&type);
+ Tcl_CreateThreadExitHandler(FontPkgCleanup, NULL);
}
}
@@ -387,6 +454,176 @@ ControlUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen,
}
/*
+ *-------------------------------------------------------------------------
+ *
+ * Ucs2beToUtfProc --
+ *
+ * Convert from UCS-2BE (big-endian 16-bit Unicode) to UTF-8.
+ *
+ * Results:
+ * Returns TCL_OK if conversion was successful.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+Ucs2beToUtfProc(clientData, src, srcLen, flags, statePtr, dst, dstLen,
+ srcReadPtr, dstWrotePtr, dstCharsPtr)
+ ClientData clientData; /* Not used. */
+ CONST char *src; /* Source string in Unicode. */
+ int srcLen; /* Source string length in bytes. */
+ int flags; /* Conversion control flags. */
+ Tcl_EncodingState *statePtr;/* Place for conversion routine to store
+ * state information used during a piecewise
+ * conversion. Contents of statePtr are
+ * initialized and/or reset by conversion
+ * routine under control of flags argument. */
+ char *dst; /* Output buffer in which converted string
+ * is stored. */
+ int dstLen; /* The maximum length of output buffer in
+ * bytes. */
+ int *srcReadPtr; /* Filled with the number of bytes from the
+ * source string that were converted. This
+ * may be less than the original source length
+ * if there was a problem converting some
+ * source characters. */
+ int *dstWrotePtr; /* Filled with the number of bytes that were
+ * stored in the output buffer as a result of
+ * the conversion. */
+ int *dstCharsPtr; /* Filled with the number of characters that
+ * correspond to the bytes stored in the
+ * output buffer. */
+{
+ CONST Tcl_UniChar *wSrc, *wSrcStart, *wSrcEnd;
+ char *dstEnd, *dstStart;
+ int result, numChars;
+
+ result = TCL_OK;
+ if ((srcLen % sizeof(Tcl_UniChar)) != 0) {
+ result = TCL_CONVERT_MULTIBYTE;
+ srcLen /= sizeof(Tcl_UniChar);
+ srcLen *= sizeof(Tcl_UniChar);
+ }
+
+ wSrc = (Tcl_UniChar *) src;
+
+ wSrcStart = (Tcl_UniChar *) src;
+ wSrcEnd = (Tcl_UniChar *) (src + srcLen);
+
+ dstStart = dst;
+ dstEnd = dst + dstLen - TCL_UTF_MAX;
+
+ for (numChars = 0; wSrc < wSrcEnd; numChars++) {
+ if (dst > dstEnd) {
+ result = TCL_CONVERT_NOSPACE;
+ break;
+ }
+ /*
+ * On a little-endian machine (Intel) the UCS-2BE is in the
+ * wrong byte-order in comparison to "unicode", which is
+ * in native host order.
+ */
+ dst += Tcl_UniCharToUtf(htons(*wSrc), dst);
+ wSrc++;
+ }
+
+ *srcReadPtr = (char *) wSrc - (char *) wSrcStart;
+ *dstWrotePtr = dst - dstStart;
+ *dstCharsPtr = numChars;
+ return result;
+}
+
+/*
+ *-------------------------------------------------------------------------
+ *
+ * UtfToUcs2beProc --
+ *
+ * Convert from UTF-8 to UCS-2BE.
+ *
+ * Results:
+ * Returns TCL_OK if conversion was successful.
+ *
+ * Side effects:
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static int
+UtfToUcs2beProc(clientData, src, srcLen, flags, statePtr, dst, dstLen,
+ srcReadPtr, dstWrotePtr, dstCharsPtr)
+ ClientData clientData; /* TableEncodingData that specifies encoding. */
+ CONST char *src; /* Source string in UTF-8. */
+ int srcLen; /* Source string length in bytes. */
+ int flags; /* Conversion control flags. */
+ Tcl_EncodingState *statePtr;/* Place for conversion routine to store
+ * state information used during a piecewise
+ * conversion. Contents of statePtr are
+ * initialized and/or reset by conversion
+ * routine under control of flags argument. */
+ char *dst; /* Output buffer in which converted string
+ * is stored. */
+ int dstLen; /* The maximum length of output buffer in
+ * bytes. */
+ int *srcReadPtr; /* Filled with the number of bytes from the
+ * source string that were converted. This
+ * may be less than the original source length
+ * if there was a problem converting some
+ * source characters. */
+ int *dstWrotePtr; /* Filled with the number of bytes that were
+ * stored in the output buffer as a result of
+ * the conversion. */
+ int *dstCharsPtr; /* Filled with the number of characters that
+ * correspond to the bytes stored in the
+ * output buffer. */
+{
+ CONST char *srcStart, *srcEnd, *srcClose;
+ Tcl_UniChar *wDst, *wDstStart, *wDstEnd;
+ int result, numChars;
+
+ srcStart = src;
+ srcEnd = src + srcLen;
+ srcClose = srcEnd;
+ if ((flags & TCL_ENCODING_END) == 0) {
+ srcClose -= TCL_UTF_MAX;
+ }
+
+ wDst = (Tcl_UniChar *) dst;
+ wDstStart = (Tcl_UniChar *) dst;
+ wDstEnd = (Tcl_UniChar *) (dst + dstLen - sizeof(Tcl_UniChar));
+
+ result = TCL_OK;
+ for (numChars = 0; src < srcEnd; numChars++) {
+ if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
+ /*
+ * If there is more string to follow, this will ensure that the
+ * last UTF-8 character in the source buffer hasn't been cut off.
+ */
+
+ result = TCL_CONVERT_MULTIBYTE;
+ break;
+ }
+ if (wDst > wDstEnd) {
+ result = TCL_CONVERT_NOSPACE;
+ break;
+ }
+ src += Tcl_UtfToUniChar(src, wDst);
+ /*
+ * Byte swap for little-endian machines.
+ */
+ *wDst = htons(*wDst);
+ wDst++;
+ }
+ *srcReadPtr = src - srcStart;
+ *dstWrotePtr = (char *) wDst - (char *) wDstStart;
+ *dstCharsPtr = numChars;
+ return result;
+}
+
+/*
*---------------------------------------------------------------------------
*
* TkpGetNativeFont --
@@ -918,74 +1155,76 @@ Tk_DrawChars(display, drawable, gc, tkfont, source, numBytes, x, y)
SubFont *thisSubFontPtr, *lastSubFontPtr;
Tcl_DString runString;
CONST char *p, *end, *next;
- int xStart, needWidth;
+ int xStart, needWidth, window_width;
Tcl_UniChar ch;
FontFamily *familyPtr;
+ int rx, ry;
+ unsigned int width, height, border_width, depth;
+ int do_width;
+ Drawable root;
fontPtr = (UnixFont *) tkfont;
lastSubFontPtr = &fontPtr->subFontArray[0];
xStart = x;
+ /*
+ * Get the window width so we can abort drawing outside of the window
+ */
+ if (XGetGeometry(display, drawable, &root, &rx, &ry, &width, &height,
+ &border_width, &depth) == False) {
+ window_width = INT_MAX;
+ } else {
+ window_width = width;
+ }
+
end = source + numBytes;
- for (p = source; p < end; ) {
- next = p + Tcl_UtfToUniChar(p, &ch);
- thisSubFontPtr = FindSubFontForChar(fontPtr, ch);
- if (thisSubFontPtr != lastSubFontPtr) {
+ needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike;
+ for (p = source; p <= end; ) {
+ if (p < end) {
+ next = p + Tcl_UtfToUniChar(p, &ch);
+ thisSubFontPtr = FindSubFontForChar(fontPtr, ch);
+ } else {
+ next = p + 1;
+ thisSubFontPtr = lastSubFontPtr;
+ }
+ if ((thisSubFontPtr != lastSubFontPtr)
+ || (p == end) || (p-source > 200)) {
if (p > source) {
+ do_width = (needWidth || (p != end)) ? 1 : 0;
familyPtr = lastSubFontPtr->familyPtr;
+
Tcl_UtfToExternalDString(familyPtr->encoding, source,
p - source, &runString);
if (familyPtr->isTwoByteFont) {
XDrawString16(display, drawable, gc, x, y,
(XChar2b *) Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) / 2);
-
- x += XTextWidth16(lastSubFontPtr->fontStructPtr,
- (XChar2b *) Tcl_DStringValue(&runString),
- Tcl_DStringLength(&runString) / 2);
+ if (do_width) {
+ x += XTextWidth16(lastSubFontPtr->fontStructPtr,
+ (XChar2b *) Tcl_DStringValue(&runString),
+ Tcl_DStringLength(&runString) / 2);
+ }
} else {
XDrawString(display, drawable, gc, x, y,
Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString));
- x += XTextWidth(lastSubFontPtr->fontStructPtr,
- Tcl_DStringValue(&runString),
- Tcl_DStringLength(&runString));
+ if (do_width) {
+ x += XTextWidth(lastSubFontPtr->fontStructPtr,
+ Tcl_DStringValue(&runString),
+ Tcl_DStringLength(&runString));
+ }
}
Tcl_DStringFree(&runString);
}
lastSubFontPtr = thisSubFontPtr;
source = p;
XSetFont(display, gc, lastSubFontPtr->fontStructPtr->fid);
- }
- p = next;
- }
-
- needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike;
- if (p > source) {
- familyPtr = lastSubFontPtr->familyPtr;
- Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source,
- &runString);
- if (familyPtr->isTwoByteFont) {
- XDrawString16(display, drawable, gc, x, y,
- (XChar2b *) Tcl_DStringValue(&runString),
- Tcl_DStringLength(&runString) >> 1);
- if (needWidth) {
- x += XTextWidth16(lastSubFontPtr->fontStructPtr,
- (XChar2b *) Tcl_DStringValue(&runString),
- Tcl_DStringLength(&runString) >> 1);
- }
- } else {
- XDrawString(display, drawable, gc, x, y,
- Tcl_DStringValue(&runString),
- Tcl_DStringLength(&runString));
- if (needWidth) {
- x += XTextWidth(lastSubFontPtr->fontStructPtr,
- Tcl_DStringValue(&runString),
- Tcl_DStringLength(&runString));
+ if (x > window_width) {
+ break;
}
}
- Tcl_DStringFree(&runString);
+ p = next;
}
if (lastSubFontPtr != &fontPtr->subFontArray[0]) {
@@ -1003,6 +1242,9 @@ Tk_DrawChars(display, drawable, gc, tkfont, source, numBytes, x, y)
(unsigned) (x - xStart), (unsigned) fontPtr->barHeight);
}
}
+
+
+
/*
*-------------------------------------------------------------------------
@@ -1460,7 +1702,17 @@ AllocFontFamily(display, fontStructPtr, base)
*/
familyPtr->refCount = 2;
- familyPtr->isTwoByteFont = (fontStructPtr->min_byte1 > 0);
+
+ /*
+ * One byte/character fonts have both min_byte1 and max_byte1 0,
+ * and max_char_or_byte2 <= 255.
+ * Anything else specifies a two byte/character font.
+ */
+
+ familyPtr->isTwoByteFont = !(
+ (fontStructPtr->min_byte1 == 0) &&
+ (fontStructPtr->max_byte1 == 0) &&
+ (fontStructPtr->max_char_or_byte2 < 256));
return familyPtr;
}
@@ -1550,7 +1802,8 @@ FindSubFontForChar(fontPtr, ch)
int ch; /* The Unicode character to be displayed. */
{
int i, j, k, numNames;
- char *faceName, *fallback;
+ Tk_Uid faceName;
+ char *fallback;
char **aliases, **nameList, **anyFallbacks;
char ***fontFallbacks;
SubFont *subFontPtr;
@@ -1969,7 +2222,7 @@ static SubFont *
CanUseFallback(fontPtr, faceName, ch)
UnixFont *fontPtr; /* The font object that will own the new
* screen font. */
- char *faceName; /* Desired face name for new screen font. */
+ CONST char *faceName; /* Desired face name for new screen font. */
int ch; /* The Unicode character that the new
* screen font must be able to display. */
{
@@ -2575,4 +2828,3 @@ GetEncodingAlias(name)
}
-
diff --git a/tk/unix/tkUnixInit.c b/tk/unix/tkUnixInit.c
index 7f3a4b0fe5a..be439986f98 100644
--- a/tk/unix/tkUnixInit.c
+++ b/tk/unix/tkUnixInit.c
@@ -71,7 +71,7 @@ TkpGetAppName(interp, namePtr)
Tcl_Interp *interp;
Tcl_DString *namePtr; /* A previously initialized Tcl_DString. */
{
- char *p, *name;
+ CONST char *p, *name;
name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY);
if ((name == NULL) || (*name == 0)) {
@@ -104,8 +104,8 @@ TkpGetAppName(interp, namePtr)
void
TkpDisplayWarning(msg, title)
- char *msg; /* Message to be displayed. */
- char *title; /* Title of warning. */
+ CONST char *msg; /* Message to be displayed. */
+ CONST char *title; /* Title of warning. */
{
Tcl_Channel errChannel = Tcl_GetStdChannel(TCL_STDERR);
if (errChannel) {
@@ -115,4 +115,3 @@ TkpDisplayWarning(msg, title)
Tcl_WriteChars(errChannel, "\n", 1);
}
}
-
diff --git a/tk/unix/tkUnixInt.h b/tk/unix/tkUnixInt.h
index 73becfb17f3..3b843984bf7 100644
--- a/tk/unix/tkUnixInt.h
+++ b/tk/unix/tkUnixInt.h
@@ -27,4 +27,3 @@
#include "tkIntPlatDecls.h"
#endif /* _TKUNIXINT */
-
diff --git a/tk/unix/tkUnixKey.c b/tk/unix/tkUnixKey.c
index 9c3f7f1d6f0..42f3da2e98b 100644
--- a/tk/unix/tkUnixKey.c
+++ b/tk/unix/tkUnixKey.c
@@ -18,7 +18,44 @@
* Prototypes for local procedures defined in this file:
*/
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_SetCaretPos --
+ *
+ * This enables correct placement of the XIM caret. This is called
+ * by widgets to indicate their cursor placement, and the caret
+ * location is used by TkpGetString to place the XIM caret.
+ * This is currently only used for over-the-spot XIM.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_SetCaretPos(tkwin, x, y, height)
+ Tk_Window tkwin;
+ int x;
+ int y;
+ int height;
+{
+ TkCaret *caretPtr = &(((TkWindow *) tkwin)->dispPtr->caret);
+
+ /*
+ * Use height for best placement of the XIM over-the-spot box.
+ */
+ caretPtr->winPtr = ((TkWindow *) tkwin);
+ caretPtr->x = x;
+ caretPtr->y = y;
+ caretPtr->height = height;
+}
/*
*----------------------------------------------------------------------
@@ -49,6 +86,9 @@ TkpGetString(winPtr, eventPtr, dsPtr)
int len;
Tcl_DString buf;
Status status;
+#ifdef TK_USE_INPUT_METHODS
+ TkDisplay *dispPtr = winPtr->dispPtr;
+#endif
/*
* Overallocate the dstring to the maximum stack amount.
@@ -56,11 +96,16 @@ TkpGetString(winPtr, eventPtr, dsPtr)
Tcl_DStringInit(&buf);
Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1);
-
+
#ifdef TK_USE_INPUT_METHODS
- if (winPtr->dispPtr->useInputMethods
+ if ((dispPtr->flags & TK_DISPLAY_USE_IM)
&& (winPtr->inputContext != NULL)
&& (eventPtr->type == KeyPress)) {
+#if TK_XIM_SPOT
+ XVaNestedList preedit_attr;
+ XPoint spot;
+#endif
+
len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey,
Tcl_DStringValue(&buf), Tcl_DStringLength(&buf),
(KeySym *) NULL, &status);
@@ -76,6 +121,21 @@ TkpGetString(winPtr, eventPtr, dsPtr)
if ((status != XLookupChars) && (status != XLookupBoth)) {
len = 0;
}
+
+#if TK_XIM_SPOT
+ /*
+ * Adjust the XIM caret position. We might want to check that
+ * this is the right caret.winPtr as well.
+ */
+ if (dispPtr->flags & TK_DISPLAY_XIM_SPOT) {
+ spot.x = dispPtr->caret.x;
+ spot.y = dispPtr->caret.y + dispPtr->caret.height;
+ preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
+ XSetICValues(winPtr->inputContext,
+ XNPreeditAttributes, preedit_attr, NULL);
+ XFree(preedit_attr);
+ }
+#endif
} else {
len = XLookupString(&eventPtr->xkey, Tcl_DStringValue(&buf),
Tcl_DStringLength(&buf), (KeySym *) NULL,
@@ -128,7 +188,7 @@ TkpSetKeycodeAndState(tkwin, keySym, eventPtr)
if (state & 2) {
TkDisplay *dispPtr;
- dispPtr = ((TkWindow *) tkwin)->dispPtr;
+ dispPtr = ((TkWindow *) tkwin)->dispPtr;
eventPtr->xkey.state |= dispPtr->modeModMask;
}
break;
@@ -351,5 +411,3 @@ TkpInitKeymapInfo(dispPtr)
}
XFreeModifiermap(modMapPtr);
}
-
-
diff --git a/tk/unix/tkUnixMenu.c b/tk/unix/tkUnixMenu.c
index 1ee5df86494..dcfb533aeb6 100644
--- a/tk/unix/tkUnixMenu.c
+++ b/tk/unix/tkUnixMenu.c
@@ -703,11 +703,14 @@ DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height)
int width; /* width of entry. */
int height; /* height of entry. */
{
- int baseline;
int indicatorSpace = mePtr->indicatorSpace;
int activeBorderWidth;
int leftEdge;
int imageHeight, imageWidth;
+ int textHeight = 0, textWidth = 0; /* stop GCC warning */
+ int haveImage = 0, haveText = 0;
+ int imageXOffset = 0, imageYOffset = 0;
+ int textXOffset = 0, textYOffset = 0;
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr,
&activeBorderWidth);
@@ -717,35 +720,108 @@ DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height)
}
/*
- * Draw label or bitmap or image for entry.
+ * Work out what we will need to draw first.
*/
- baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
if (mePtr->image != NULL) {
Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight);
+ haveImage = 1;
+ } else if (mePtr->bitmapPtr != NULL) {
+ Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
+ Tk_SizeOfBitmap(menuPtr->display, bitmap, &imageWidth, &imageHeight);
+ haveImage = 1;
+ }
+ if (!haveImage || (mePtr->compound != COMPOUND_NONE)) {
+ if (mePtr->labelLength > 0) {
+ char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
+ textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
+ textHeight = fmPtr->linespace;
+ haveText = 1;
+ }
+ }
+
+ /*
+ * Now work out what the relative positions are.
+ */
+
+ if (haveImage && haveText) {
+ int fullWidth = (imageWidth > textWidth ? imageWidth : textWidth);
+ switch ((enum compound) mePtr->compound) {
+ case COMPOUND_TOP: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = imageHeight/2 + 2;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = -textHeight/2;
+ break;
+ }
+ case COMPOUND_BOTTOM: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = -imageHeight/2;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = textHeight/2 + 2;
+ break;
+ }
+ case COMPOUND_LEFT: {
+ textXOffset = imageWidth + 2;
+ textYOffset = 0;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_RIGHT: {
+ textXOffset = 0;
+ textYOffset = 0;
+ imageXOffset = textWidth + 2;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = 0;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+ } else {
+ textXOffset = 0;
+ textYOffset = 0;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ }
+
+ /*
+ * Draw label and/or bitmap or image for entry.
+ */
+
+ if (mePtr->image != NULL) {
if ((mePtr->selectImage != NULL)
&& (mePtr->entryFlags & ENTRY_SELECTED)) {
Tk_RedrawImage(mePtr->selectImage, 0, 0,
- imageWidth, imageHeight, d, leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2));
+ imageWidth, imageHeight, d, leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset));
} else {
Tk_RedrawImage(mePtr->image, 0, 0, imageWidth,
- imageHeight, d, leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2));
+ imageHeight, d, leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset));
}
} else if (mePtr->bitmapPtr != None) {
- int width, height;
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
- Tk_SizeOfBitmap(menuPtr->display,bitmap, &width, &height);
- XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0, (unsigned) width,
- (unsigned) height, leftEdge,
- (int) (y + (mePtr->height - height)/2), 1);
- } else {
+ XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0,
+ (unsigned) imageWidth, (unsigned) imageHeight,
+ leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset), 1);
+ }
+ if ((mePtr->compound != COMPOUND_NONE) || !haveImage) {
+ int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
if (mePtr->labelLength > 0) {
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
Tk_DrawChars(menuPtr->display, d, gc, tkfont, label,
- mePtr->labelLength, leftEdge, baseline);
- DrawMenuUnderline(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y,
+ mePtr->labelLength, leftEdge + textXOffset,
+ baseline + textYOffset);
+ DrawMenuUnderline(menuPtr, mePtr, d, gc, tkfont, fmPtr,
+ x + textXOffset, y + textYOffset,
width, height);
}
}
@@ -757,8 +833,8 @@ DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height)
} else if ((mePtr->image != NULL)
&& (menuPtr->disabledImageGC != None)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
- leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2),
+ leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
(unsigned) imageWidth, (unsigned) imageHeight);
}
}
@@ -801,8 +877,8 @@ DrawMenuUnderline(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y, width, height)
int activeBorderWidth;
int leftEdge;
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
- char *start = Tcl_UtfAtIndex(label, mePtr->underline);
- char *end = Tcl_UtfNext(start);
+ CONST char *start = Tcl_UtfAtIndex(label, mePtr->underline);
+ CONST char *end = Tcl_UtfNext(start);
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
@@ -1397,21 +1473,68 @@ GetMenuLabelGeometry(mePtr, tkfont, fmPtr, widthPtr, heightPtr)
* portion */
{
TkMenu *menuPtr = mePtr->menuPtr;
+ int haveImage = 0;
if (mePtr->image != NULL) {
Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr);
+ haveImage = 1;
} else if (mePtr->bitmapPtr != NULL) {
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr);
+ haveImage = 1;
} else {
- *heightPtr = fmPtr->linespace;
+ *heightPtr = 0;
+ *widthPtr = 0;
+ }
+ if (haveImage && (mePtr->compound == COMPOUND_NONE)) {
+ /* We don't care about the text in this case */
+ } else {
+ /* Either it is compound or we don't have an image */
if (mePtr->labelPtr != NULL) {
+ int textWidth;
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
+ textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
- *widthPtr = Tk_TextWidth(tkfont, label, mePtr->labelLength);
+ if ((mePtr->compound != COMPOUND_NONE) && haveImage) {
+ switch ((enum compound) mePtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ /* Add text and padding */
+ *heightPtr += fmPtr->linespace + 2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ if (fmPtr->linespace > *heightPtr) {
+ *heightPtr = fmPtr->linespace;
+ }
+ /* Add text and padding */
+ *widthPtr += textWidth + 2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ if (fmPtr->linespace > *heightPtr) {
+ *heightPtr = fmPtr->linespace;
+ }
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
} else {
- *widthPtr = 0;
+ /* We don't have an image or we're not compound */
+ *heightPtr = fmPtr->linespace;
+ *widthPtr = textWidth;
+ }
+ } else {
+ /* An empty entry still has this height */
+ *heightPtr = fmPtr->linespace;
}
}
*heightPtr += 1;
@@ -1682,4 +1805,3 @@ TkpMenuThreadInit()
*/
}
-
diff --git a/tk/unix/tkUnixMenubu.c b/tk/unix/tkUnixMenubu.c
index c188af991ae..a38040db2e2 100644
--- a/tk/unix/tkUnixMenubu.c
+++ b/tk/unix/tkUnixMenubu.c
@@ -19,10 +19,9 @@
* procedures that can be invoked from generic window code.
*/
-TkClassProcs tkpMenubuttonClass = {
- NULL, /* createProc. */
- TkMenuButtonWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+Tk_ClassProcs tkpMenubuttonClass = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkMenuButtonWorldChanged, /* worldChangedProc */
};
/*
@@ -75,9 +74,11 @@ TkpDisplayMenuButton(clientData)
Pixmap pixmap;
int x = 0; /* Initialization needed only to stop
* compiler warning. */
- int y;
+ int y = 0;
register Tk_Window tkwin = mbPtr->tkwin;
- int width, height;
+ int width, height, fullWidth, fullHeight;
+ int imageXOffset, imageYOffset, textXOffset, textYOffset;
+ int haveImage = 0, haveText = 0;
mbPtr->flags &= ~REDRAW_PENDING;
if ((mbPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) {
@@ -96,6 +97,15 @@ TkpDisplayMenuButton(clientData)
border = mbPtr->normalBorder;
}
+ if (mbPtr->image != None) {
+ Tk_SizeOfImage(mbPtr->image, &width, &height);
+ haveImage = 1;
+ } else if (mbPtr->bitmap != None) {
+ Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
+ haveText = (mbPtr->textWidth != 0 && mbPtr->textHeight != 0);
+
/*
* In order to avoid screen flashes, this procedure redraws
* the menu button in a pixmap, then copies the pixmap to the
@@ -108,34 +118,105 @@ TkpDisplayMenuButton(clientData)
Tk_Fill3DRectangle(tkwin, pixmap, border, 0, 0, Tk_Width(tkwin),
Tk_Height(tkwin), 0, TK_RELIEF_FLAT);
- /*
- * Display image or bitmap or text for button.
- */
+ imageXOffset = 0;
+ imageYOffset = 0;
+ textXOffset = 0;
+ textYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
- if (mbPtr->image != None) {
- Tk_SizeOfImage(mbPtr->image, &width, &height);
+ if (mbPtr->compound != COMPOUND_NONE && haveImage && haveText) {
- imageOrBitmap:
- TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,
- width + mbPtr->indicatorWidth, height, &x, &y);
- 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;
+ switch ((enum compound) mbPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ if (mbPtr->compound == COMPOUND_TOP) {
+ textYOffset = height + mbPtr->padY;
+ } else {
+ imageYOffset = mbPtr->textHeight + mbPtr->padY;
+ }
+ fullHeight = height + mbPtr->textHeight + mbPtr->padY;
+ fullWidth = (width > mbPtr->textWidth ? width :
+ mbPtr->textWidth);
+ textXOffset = (fullWidth - mbPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ if (mbPtr->compound == COMPOUND_LEFT) {
+ textXOffset = width + mbPtr->padX;
+ } else {
+ imageXOffset = mbPtr->textWidth + mbPtr->padX;
+ }
+ fullWidth = mbPtr->textWidth + mbPtr->padX + width;
+ fullHeight = (height > mbPtr->textHeight ? height :
+ mbPtr->textHeight);
+ textYOffset = (fullHeight - mbPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ fullWidth = (width > mbPtr->textWidth ? width :
+ mbPtr->textWidth);
+ fullHeight = (height > mbPtr->textHeight ? height :
+ mbPtr->textHeight);
+ textXOffset = (fullWidth - mbPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ textYOffset = (fullHeight - mbPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+
+ TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,
+ mbPtr->indicatorWidth + fullWidth, fullHeight,
+ &x, &y);
+
+ if (mbPtr->image != NULL) {
+ Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap,
+ x + imageXOffset, y + imageYOffset);
+ }
+ if (mbPtr->bitmap != None) {
+ XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap,
+ gc, 0, 0, (unsigned) width, (unsigned) height,
+ x + imageXOffset, y + imageYOffset, 1);
+ }
+ if (haveText) {
+ Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout,
+ x + textXOffset, y + textYOffset ,
+ 0, -1);
+ Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc,
+ mbPtr->textLayout, x + textXOffset, y + textYOffset ,
+ mbPtr->underline);
+ }
} else {
- TkComputeAnchor(mbPtr->anchor, tkwin, mbPtr->padX, mbPtr->padY,
- mbPtr->textWidth + mbPtr->indicatorWidth,
- mbPtr->textHeight, &x, &y);
- Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, x, y,
- 0, -1);
- Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout,
- x, y, mbPtr->underline);
+ if (mbPtr->image != NULL) {
+ TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,
+ width + mbPtr->indicatorWidth, height, &x, &y);
+ Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap,
+ x + imageXOffset, y + imageYOffset);
+ } else if (mbPtr->bitmap != None) {
+ TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0,
+ width + mbPtr->indicatorWidth, height, &x, &y);
+ XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap,
+ gc, 0, 0, (unsigned) width, (unsigned) height,
+ x + imageXOffset, y + imageYOffset, 1);
+ } else {
+ TkComputeAnchor(mbPtr->anchor, tkwin, mbPtr->padX, mbPtr->padY,
+ mbPtr->textWidth + mbPtr->indicatorWidth,
+ mbPtr->textHeight, &x, &y);
+ Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout,
+ x + textXOffset, y + textYOffset ,
+ 0, -1);
+ Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc,
+ mbPtr->textLayout, x + textXOffset, y + textYOffset ,
+ mbPtr->underline);
+ }
}
/*
@@ -252,58 +333,116 @@ TkpComputeMenuButtonGeometry(mbPtr)
TkMenuButton *mbPtr; /* Widget record for menu button. */
{
int width, height, mm, pixels;
+ int avgWidth, txtWidth, txtHeight;
+ int haveImage = 0, haveText = 0;
+ Tk_FontMetrics fm;
mbPtr->inset = mbPtr->highlightWidth + mbPtr->borderWidth;
+
+ width = 0;
+ height = 0;
+ txtWidth = 0;
+ txtHeight = 0;
+ avgWidth = 0;
+
if (mbPtr->image != None) {
Tk_SizeOfImage(mbPtr->image, &width, &height);
- if (mbPtr->width > 0) {
- width = mbPtr->width;
- }
- if (mbPtr->height > 0) {
- height = mbPtr->height;
- }
+ haveImage = 1;
} 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 {
+ haveImage = 1;
+ }
+
+ if (haveImage == 0 || mbPtr->compound != COMPOUND_NONE) {
Tk_FreeTextLayout(mbPtr->textLayout);
+
mbPtr->textLayout = Tk_ComputeTextLayout(mbPtr->tkfont, mbPtr->text,
-1, mbPtr->wrapLength, mbPtr->justify, 0, &mbPtr->textWidth,
&mbPtr->textHeight);
- width = mbPtr->textWidth;
- height = mbPtr->textHeight;
- if (mbPtr->width > 0) {
- width = mbPtr->width * Tk_TextWidth(mbPtr->tkfont, "0", 1);
- }
- if (mbPtr->height > 0) {
- Tk_FontMetrics fm;
+ txtWidth = mbPtr->textWidth;
+ txtHeight = mbPtr->textHeight;
+ avgWidth = Tk_TextWidth(mbPtr->tkfont, "0", 1);
+ Tk_GetFontMetrics(mbPtr->tkfont, &fm);
+ haveText = (txtWidth != 0 && txtHeight != 0);
+ }
- Tk_GetFontMetrics(mbPtr->tkfont, &fm);
- height = mbPtr->height * fm.linespace;
+ /*
+ * If the menubutton is compound (ie, it shows both an image and text),
+ * the new geometry is a combination of the image and text geometry.
+ * We only honor the compound bit if the menubutton has both text and
+ * an image, because otherwise it is not really a compound menubutton.
+ */
+
+ if (mbPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ switch ((enum compound) mbPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ height += txtHeight + mbPtr->padY;
+ width = (width > txtWidth ? width : txtWidth);
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ width += txtWidth + mbPtr->padX;
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ width = (width > txtWidth ? width : txtWidth);
+ height = (height > txtHeight ? height : txtHeight);
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+ if (mbPtr->width > 0) {
+ width = mbPtr->width;
+ }
+ if (mbPtr->height > 0) {
+ height = mbPtr->height;
+ }
+ width += 2*mbPtr->padX;
+ height += 2*mbPtr->padY;
+ } else {
+ if (haveImage) {
+ if (mbPtr->width > 0) {
+ width = mbPtr->width;
+ }
+ if (mbPtr->height > 0) {
+ height = mbPtr->height;
+ }
+ } else {
+ width = txtWidth;
+ height = txtHeight;
+ if (mbPtr->width > 0) {
+ width = mbPtr->width * avgWidth;
+ }
+ if (mbPtr->height > 0) {
+ height = mbPtr->height * fm.linespace;
+ }
}
- width += 2*mbPtr->padX;
- height += 2*mbPtr->padY;
+ }
+
+ if (! haveImage) {
+ width += 2*mbPtr->padX;
+ height += 2*mbPtr->padY;
}
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;
+ 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;
+ 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);
}
-
diff --git a/tk/unix/tkUnixPort.h b/tk/unix/tkUnixPort.h
index 46951b67133..1ea655dfe06 100644
--- a/tk/unix/tkUnixPort.h
+++ b/tk/unix/tkUnixPort.h
@@ -49,13 +49,7 @@
#else
# include <stdlib.h>
#endif
-/* CYGNUS LOCAL: Don't include the system string.h if we've already
- included tcl/compat/string.h. Otherwise you can't include both
- tclInt.h and tkInt.h (not that you should anyhow, but some SN code
- does). */
-#ifndef _STRING
-# include <string.h>
-#endif
+#include <string.h>
#include <sys/types.h>
#include <sys/file.h>
#ifdef HAVE_SYS_SELECT_H
@@ -151,6 +145,8 @@ extern int errno;
(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)
@@ -206,18 +202,12 @@ extern int errno;
/*
* This macro stores a representation of the window handle in a string.
+ * This should perhaps use the real size of an XID.
*/
#define TkpPrintWindowId(buf,w) \
- sprintf((buf), "0x%x", (unsigned int) (w))
-
-/*
- * TkpScanWindowId is just an alias for Tcl_GetInt on Unix.
- */
+ sprintf((buf), "%#08lx", (unsigned long) (w))
-#define TkpScanWindowId(i,s,wp) \
- Tcl_GetInt((i),(s),(wp))
-
/*
* This macro indicates that entry and text widgets should display
* the selection highlight regardless of which window has the focus.
@@ -235,4 +225,3 @@ extern int errno;
#endif
#endif /* _UNIXPORT */
-
diff --git a/tk/unix/tkUnixScale.c b/tk/unix/tkUnixScale.c
index a05bbbef37d..455607e0ea5 100644
--- a/tk/unix/tkUnixScale.c
+++ b/tk/unix/tkUnixScale.c
@@ -271,7 +271,7 @@ DisplayVerticalValue(scalePtr, drawable, value, rightEdge)
Tk_GetFontMetrics(scalePtr->tkfont, &fm);
y = TkScaleValueToPixel(scalePtr, value) + fm.ascent/2;
sprintf(valueString, scalePtr->format, value);
- length = strlen(valueString);
+ length = (int) strlen(valueString);
width = Tk_TextWidth(scalePtr->tkfont, valueString, length);
/*
@@ -488,7 +488,7 @@ DisplayHorizontalValue(scalePtr, drawable, value, top)
Tk_GetFontMetrics(scalePtr->tkfont, &fm);
y = top + fm.ascent;
sprintf(valueString, scalePtr->format, value);
- length = strlen(valueString);
+ length = (int) strlen(valueString);
width = Tk_TextWidth(scalePtr->tkfont, valueString, length);
/*
@@ -559,7 +559,7 @@ TkpDisplayScale(clientData)
scalePtr->flags &= ~INVOKE_COMMAND;
if (scalePtr->flags & SCALE_DELETED) {
Tcl_Release((ClientData) scalePtr);
- goto done;
+ return;
}
Tcl_Release((ClientData) scalePtr);
diff --git a/tk/unix/tkUnixScrlbr.c b/tk/unix/tkUnixScrlbr.c
index 7704250eb01..c2e7239c146 100644
--- a/tk/unix/tkUnixScrlbr.c
+++ b/tk/unix/tkUnixScrlbr.c
@@ -32,13 +32,13 @@ typedef struct UnixScrollbar {
} UnixScrollbar;
/*
- * The class procedure table for the scrollbar widget.
+ * The class procedure table for the scrollbar widget. All fields except
+ * size are left initialized to NULL, which should happen automatically
+ * since the variable is declared at this scope.
*/
-TkClassProcs tkpScrollbarProcs = {
- NULL, /* createProc. */
- NULL, /* geometryProc. */
- NULL /* modalProc. */
+Tk_ClassProcs tkpScrollbarProcs = {
+ sizeof(Tk_ClassProcs) /* size */
};
@@ -474,4 +474,3 @@ TkpScrollbarPosition(scrollPtr, x, y)
}
return BOTTOM_GAP;
}
-
diff --git a/tk/unix/tkUnixSelect.c b/tk/unix/tkUnixSelect.c
index d240b1e0f40..8971f056a3e 100644
--- a/tk/unix/tkUnixSelect.c
+++ b/tk/unix/tkUnixSelect.c
@@ -597,7 +597,7 @@ TkSelEventProc(tkwin, eventPtr)
Tcl_Encoding encoding;
if (format != 8) {
char buf[64 + TCL_INTEGER_SPACE];
-
+
sprintf(buf,
"bad format for string selection: wanted \"8\", got \"%d\"",
format);
@@ -633,6 +633,35 @@ TkSelEventProc(tkwin, eventPtr)
interp, Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
Tcl_Release((ClientData) interp);
+ } else if (type == dispPtr->utf8Atom) {
+ /*
+ * The X selection data is in UTF-8 format already.
+ * We can't guarantee that propInfo is NULL-terminated,
+ * so we might have to copy the string.
+ */
+ char *propData = propInfo;
+
+ if (format != 8) {
+ char buf[64 + TCL_INTEGER_SPACE];
+
+ sprintf(buf,
+ "bad format for string selection: wanted \"8\", got \"%d\"",
+ format);
+ Tcl_SetResult(retrPtr->interp, buf, TCL_VOLATILE);
+ retrPtr->result = TCL_ERROR;
+ return;
+ }
+
+ if (propInfo[numItems] != '\0') {
+ propData = ckalloc((size_t) numItems + 1);
+ strcpy(propData, propInfo);
+ propData[numItems] = '\0';
+ }
+ retrPtr->result = (*retrPtr->proc)(retrPtr->clientData,
+ retrPtr->interp, propData);
+ if (propData != propInfo) {
+ ckfree((char *) propData);
+ }
} else if (type == dispPtr->incrAtom) {
/*
@@ -657,7 +686,7 @@ TkSelEventProc(tkwin, eventPtr)
if (format != 32) {
char buf[64 + TCL_INTEGER_SPACE];
-
+
sprintf(buf,
"bad format for selection: wanted \"32\", got \"%d\"",
format);
@@ -940,6 +969,15 @@ ConvertSelection(winPtr, eventPtr)
XChangeProperty(reply.display, reply.requestor,
property, type, format, PropModeReplace,
(unsigned char *) propPtr, numItems);
+ } else if (type == winPtr->dispPtr->utf8Atom) {
+ /*
+ * This matches selection requests of type UTF8_STRING,
+ * which allows us to pass our utf-8 information untouched.
+ */
+
+ XChangeProperty(reply.display, reply.requestor,
+ property, type, 8, PropModeReplace,
+ (unsigned char *) buffer, numItems);
} else if ((type == XA_STRING)
|| (type == winPtr->dispPtr->compoundTextAtom)) {
Tcl_DString ds;
@@ -1159,6 +1197,7 @@ SelRcvIncrProc(clientData, eventPtr)
*/
retrPtr->result = TCL_OK;
+ Tcl_Release((ClientData) interp);
goto done;
} else {
src = propInfo;
@@ -1458,7 +1497,7 @@ SelCvtFromX(propPtr, numValues, type, tkwin)
{
char *result;
int resultSpace, curSize, fieldSize;
- char *atomName;
+ CONST char *atomName;
/*
* Convert each long in the property to a string value, which is
@@ -1504,4 +1543,3 @@ SelCvtFromX(propPtr, numValues, type, tkwin)
}
return result;
}
-
diff --git a/tk/unix/tkUnixSend.c b/tk/unix/tkUnixSend.c
index b661923e694..531f09172cb 100644
--- a/tk/unix/tkUnixSend.c
+++ b/tk/unix/tkUnixSend.c
@@ -85,7 +85,7 @@ typedef struct PendingCommand {
int serial; /* Serial number expected in
* result. */
TkDisplay *dispPtr; /* Display being used for communication. */
- char *target; /* Name of interpreter command is
+ CONST char *target; /* Name of interpreter command is
* being sent to. */
Window commWindow; /* Target's communication window. */
Tcl_Interp *interp; /* Interpreter from which the send
@@ -224,12 +224,12 @@ static void AppendPropCarefully _ANSI_ARGS_((Display *display,
int length, PendingCommand *pendingPtr));
static void DeleteProc _ANSI_ARGS_((ClientData clientData));
static void RegAddName _ANSI_ARGS_((NameRegistry *regPtr,
- char *name, Window commWindow));
+ CONST char *name, Window commWindow));
static void RegClose _ANSI_ARGS_((NameRegistry *regPtr));
static void RegDeleteName _ANSI_ARGS_((NameRegistry *regPtr,
- char *name));
+ CONST char *name));
static Window RegFindName _ANSI_ARGS_((NameRegistry *regPtr,
- char *name));
+ CONST char *name));
static NameRegistry * RegOpen _ANSI_ARGS_((Tcl_Interp *interp,
TkDisplay *dispPtr, int lock));
static void SendEventProc _ANSI_ARGS_((ClientData clientData,
@@ -241,7 +241,7 @@ static Tk_RestrictAction SendRestrictProc _ANSI_ARGS_((ClientData clientData,
static int ServerSecure _ANSI_ARGS_((TkDisplay *dispPtr));
static void UpdateCommWindow _ANSI_ARGS_((TkDisplay *dispPtr));
static int ValidateName _ANSI_ARGS_((TkDisplay *dispPtr,
- char *name, Window commWindow, int oldOK));
+ CONST char *name, Window commWindow, int oldOK));
/*
*----------------------------------------------------------------------
@@ -365,7 +365,7 @@ static Window
RegFindName(regPtr, name)
NameRegistry *regPtr; /* Pointer to a registry opened with a
* previous call to RegOpen. */
- char *name; /* Name of an application. */
+ CONST char *name; /* Name of an application. */
{
char *p, *entry;
unsigned int id;
@@ -416,7 +416,7 @@ static void
RegDeleteName(regPtr, name)
NameRegistry *regPtr; /* Pointer to a registry opened with a
* previous call to RegOpen. */
- char *name; /* Name of an application. */
+ CONST char *name; /* Name of an application. */
{
char *p, *entry, *entryName;
int count;
@@ -476,7 +476,7 @@ static void
RegAddName(regPtr, name, commWindow)
NameRegistry *regPtr; /* Pointer to a registry opened with a
* previous call to RegOpen. */
- char *name; /* Name of an application. The caller
+ CONST char *name; /* Name of an application. The caller
* must ensure that this name isn't
* already registered. */
Window commWindow; /* X identifier for comm. window of
@@ -590,7 +590,7 @@ static int
ValidateName(dispPtr, name, commWindow, oldOK)
TkDisplay *dispPtr; /* Display for which to perform the
* validation. */
- char *name; /* The name of an application. */
+ CONST char *name; /* The name of an application. */
Window commWindow; /* X identifier for the application's
* comm. window. */
int oldOK; /* Non-zero means that we should consider
@@ -603,7 +603,7 @@ ValidateName(dispPtr, name, commWindow, oldOK)
Atom actualType;
char *property;
Tk_ErrorHandler handler;
- char **argv;
+ CONST char **argv;
property = NULL;
@@ -735,12 +735,12 @@ ServerSecure(dispPtr)
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_SetAppName(tkwin, name)
Tk_Window tkwin; /* Token for any window in the application
* to be named: it is just used to identify
* the application and the display. */
- char *name; /* The name that will be used to
+ CONST char *name; /* The name that will be used to
* refer to the interpreter in later
* "send" commands. Must be globally
* unique. */
@@ -751,7 +751,7 @@ Tk_SetAppName(tkwin, name)
TkDisplay *dispPtr = winPtr->dispPtr;
NameRegistry *regPtr;
Tcl_Interp *interp;
- char *actualName;
+ CONST char *actualName;
Tcl_DString dString;
int offset, i;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
@@ -821,10 +821,10 @@ Tk_SetAppName(tkwin, name)
Tcl_DStringAppend(&dString, name, -1);
Tcl_DStringAppend(&dString, " #", 2);
offset = Tcl_DStringLength(&dString);
- Tcl_DStringSetLength(&dString, offset+10);
+ Tcl_DStringSetLength(&dString, offset+TCL_INTEGER_SPACE);
actualName = Tcl_DStringValue(&dString);
}
- sprintf(actualName + offset, "%d", i);
+ sprintf(Tcl_DStringValue(&dString) + offset, "%d", i);
}
w = RegFindName(regPtr, actualName);
if (w == None) {
@@ -896,13 +896,13 @@ Tk_SendCmd(clientData, interp, argc, argv)
* dispPtr field is used). */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
TkWindow *winPtr;
Window commWindow;
PendingCommand pending;
register RegisteredInterp *riPtr;
- char *destName;
+ CONST char *destName;
int result, c, async, i, firstArg;
size_t length;
Tk_RestrictProc *prevRestrictProc;
@@ -1104,7 +1104,7 @@ Tk_SendCmd(clientData, interp, argc, argv)
prevRestrictProc = Tk_RestrictEvents(SendRestrictProc,
(ClientData) NULL, &prevArg);
- TclpGetTime(&timeout);
+ Tcl_GetTime(&timeout);
timeout.sec += 2;
while (!pending.gotResponse) {
if (!TkUnixDoOneXEvent(&timeout)) {
@@ -1128,7 +1128,7 @@ Tk_SendCmd(clientData, interp, argc, argv)
strcpy(pending.result, msg);
pending.gotResponse = 1;
} else {
- TclpGetTime(&timeout);
+ Tcl_GetTime(&timeout);
timeout.sec += 2;
}
}
@@ -1256,6 +1256,37 @@ TkGetInterpNames(interp, tkwin)
/*
*--------------------------------------------------------------
*
+ * TkSendCleanup --
+ *
+ * This procedure is called to free resources used by the
+ * communication channels for sending commands and
+ * receiving results.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Frees various data structures and windows.
+ *
+ *--------------------------------------------------------------
+ */
+
+void
+TkSendCleanup(dispPtr)
+ TkDisplay *dispPtr;
+{
+ if (dispPtr->commTkwin != NULL) {
+ Tk_DeleteEventHandler(dispPtr->commTkwin, PropertyChangeMask,
+ SendEventProc, (ClientData) dispPtr);
+ Tk_DestroyWindow(dispPtr->commTkwin);
+ Tcl_Release((ClientData) dispPtr->commTkwin);
+ dispPtr->commTkwin = NULL;
+ }
+}
+
+/*
+ *--------------------------------------------------------------
+ *
* SendInit --
*
* This procedure is called to initialize the
@@ -1290,6 +1321,7 @@ SendInit(interp, dispPtr)
if (dispPtr->commTkwin == NULL) {
panic("Tk_CreateWindow failed in SendInit!");
}
+ Tcl_Preserve((ClientData) dispPtr->commTkwin);
atts.override_redirect = True;
Tk_ChangeWindowAttributes(dispPtr->commTkwin,
CWOverrideRedirect, &atts);
@@ -1508,7 +1540,7 @@ SendEventProc(clientData, eventPtr)
Tcl_DStringAppend(&reply, Tcl_GetStringResult(remoteInterp),
-1);
if (result == TCL_ERROR) {
- char *varValue;
+ CONST char *varValue;
varValue = Tcl_GetVar2(remoteInterp, "errorInfo",
(char *) NULL, TCL_GLOBAL_ONLY);
@@ -1865,4 +1897,3 @@ UpdateCommWindow(dispPtr)
Tcl_DStringLength(&names));
Tcl_DStringFree(&names);
}
-
diff --git a/tk/unix/tkUnixWm.c b/tk/unix/tkUnixWm.c
index 98e4861f044..0d21b1d44a0 100644
--- a/tk/unix/tkUnixWm.c
+++ b/tk/unix/tkUnixWm.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkUnixWm.c --
*
* This module takes care of the interactions between a Tk-based
@@ -35,7 +35,7 @@ typedef struct ProtocolHandler {
* end of list. */
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
char command[4]; /* Tcl command to invoke when a client
- * message for this protocol arrives.
+ * message for this protocol arrives.
* The actual size of the structure varies
* to accommodate the needs of the actual
* command. THIS MUST BE THE LAST FIELD OF
@@ -62,19 +62,14 @@ typedef struct TkWmInfo {
char *title; /* Title to display in window caption. If
* NULL, use name of widget. Malloced. */
char *iconName; /* Name to display in icon. Malloced. */
- Window master; /* Master window for TRANSIENT_FOR property,
- * or None. */
XWMHints hints; /* Various pieces of information for
* window manager. */
char *leaderName; /* Path name of leader of window group
* (corresponds to hints.window_group).
* Malloc-ed. Note: this field doesn't
* get updated if leader is destroyed. */
- char *masterWindowName; /* Path name of window specified as master
- * in "wm transient" command, or NULL.
- * Malloc-ed. Note: this field doesn't
- * get updated if masterWindowName is
- * destroyed. */
+ TkWindow *masterPtr; /* Master window for TRANSIENT_FOR property,
+ * or NULL. */
Tk_Window icon; /* Window to use as icon for this window,
* or NULL. */
Tk_Window iconFor; /* Window for which this window is icon, or
@@ -196,12 +191,13 @@ typedef struct TkWmInfo {
ProtocolHandler *protPtr; /* First in list of protocol handlers for
* this window (NULL means none). */
int cmdArgc; /* Number of elements in cmdArgv below. */
- char **cmdArgv; /* Array of strings to store in the
+ CONST char **cmdArgv; /* Array of strings to store in the
* WM_COMMAND property. NULL means nothing
* available. */
char *clientMachine; /* String to store in WM_CLIENT_MACHINE
* property, or NULL. */
int flags; /* Miscellaneous flags, defined below. */
+ int numTransients; /* number of transients on this window */
struct TkWmInfo *nextPtr; /* Next in list of all top-level windows. */
} WmInfo;
@@ -248,6 +244,9 @@ typedef struct TkWmInfo {
* allow the user to change the height of the
* window (controlled by "wm resizable"
* command).
+ * WM_TRANSIENT_WITHDRAWN - non-zero means that this is a transient window
+ * that has explicitly been withdrawn. It should
+ * not mirror state changes in the master.
*/
#define WM_NEVER_MAPPED 1
@@ -263,10 +262,11 @@ typedef struct TkWmInfo {
#define WM_ADDED_TOPLEVEL_COLORMAP 0x800
#define WM_WIDTH_NOT_RESIZABLE 0x1000
#define WM_HEIGHT_NOT_RESIZABLE 0x2000
+#define WM_TRANSIENT_WITHDRAWN 0x4000
/*
* This module keeps a list of all top-level windows, primarily to
- * simplify the job of Tk_CoordsToWindow. The list is called
+ * simplify the job of Tk_CoordsToWindow. The list is called
* firstWmPtr and is stored in the TkDisplay structure.
*/
@@ -300,7 +300,7 @@ static Tk_GeomMgr menubarMgrType = {
typedef struct WaitRestrictInfo {
Display *display; /* Window belongs to this display. */
- Window window; /* We're waiting for events on this window. */
+ WmInfo *wmInfoPtr;
int type; /* We only care about this type of event. */
XEvent *eventPtr; /* Where to store the event when it's found. */
int foundEvent; /* Non-zero means that an event of the
@@ -323,6 +323,9 @@ static int ParseGeometry _ANSI_ARGS_((Tcl_Interp *interp,
char *string, TkWindow *winPtr));
static void ReparentEvent _ANSI_ARGS_((WmInfo *wmPtr,
XReparentEvent *eventPtr));
+static void TkWmStackorderToplevelWrapperMap _ANSI_ARGS_((
+ TkWindow *winPtr,
+ Tcl_HashTable *reparentTable));
static void TopLevelReqProc _ANSI_ARGS_((ClientData dummy,
Tk_Window tkwin));
static void UpdateCommand _ANSI_ARGS_((TkWindow *winPtr));
@@ -335,7 +338,7 @@ static void UpdateWmProtocols _ANSI_ARGS_((WmInfo *wmPtr));
static void WaitForConfigureNotify _ANSI_ARGS_((TkWindow *winPtr,
unsigned long serial));
static int WaitForEvent _ANSI_ARGS_((Display *display,
- Window window, int type, XEvent *eventPtr));
+ WmInfo *wmInfoPtr, int type, XEvent *eventPtr));
static void WaitForMapNotify _ANSI_ARGS_((TkWindow *winPtr,
int mapped));
static Tk_RestrictAction
@@ -343,6 +346,157 @@ static Tk_RestrictAction
XEvent *eventPtr));
static void WrapperEventProc _ANSI_ARGS_((ClientData clientData,
XEvent *eventPtr));
+static void WmWaitMapProc _ANSI_ARGS_((
+ ClientData clientData, XEvent *eventPtr));
+
+static int WmAspectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmAttributesCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmClientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmColormapwindowsCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmCommandCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmDeiconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFocusmodelCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFrameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGeometryCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGridCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGroupCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconbitmapCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconmaskCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconnameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconpositionCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconwindowCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMaxsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMinsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmOverrideredirectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmPositionfromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmProtocolCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmResizableCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmSizefromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStackorderCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStateCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTitleCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTransientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmWithdrawCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static void WmUpdateGeom _ANSI_ARGS_((WmInfo *wmPtr,
+ TkWindow *winPtr));
+
+/*
+ *--------------------------------------------------------------
+ *
+ * TkWmCleanup --
+ *
+ * This procedure is invoked to cleanup remaining wm resources
+ * associated with a display.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * All WmInfo structure resources are freed and invalidated.
+ *
+ *--------------------------------------------------------------
+ */
+
+void TkWmCleanup(dispPtr)
+ TkDisplay *dispPtr;
+{
+ WmInfo *wmPtr, *nextPtr;
+ for (wmPtr = dispPtr->firstWmPtr; wmPtr != NULL; wmPtr = nextPtr) {
+ /*
+ * We can't assume we have access to winPtr's anymore, so some
+ * cleanup requiring winPtr data is avoided.
+ */
+ nextPtr = wmPtr->nextPtr;
+ if (wmPtr->title != NULL) {
+ ckfree(wmPtr->title);
+ }
+ if (wmPtr->iconName != NULL) {
+ ckfree(wmPtr->iconName);
+ }
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
+ }
+ if (wmPtr->menubar != NULL) {
+ Tk_DestroyWindow(wmPtr->menubar);
+ }
+ if (wmPtr->wrapperPtr != NULL) {
+ Tk_DestroyWindow((Tk_Window) wmPtr->wrapperPtr);
+ }
+ while (wmPtr->protPtr != NULL) {
+ ProtocolHandler *protPtr;
+
+ protPtr = wmPtr->protPtr;
+ wmPtr->protPtr = protPtr->nextPtr;
+ Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ }
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ }
+ ckfree((char *) wmPtr);
+ }
+}
/*
*--------------------------------------------------------------
@@ -370,11 +524,11 @@ TkWmNewWindow(winPtr)
TkDisplay *dispPtr = winPtr->dispPtr;
wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
+ memset(wmPtr, 0, sizeof(WmInfo));
wmPtr->winPtr = winPtr;
wmPtr->reparent = None;
- wmPtr->title = NULL;
- wmPtr->iconName = NULL;
- wmPtr->master = None;
+ wmPtr->masterPtr = NULL;
+ wmPtr->numTransients = 0;
wmPtr->hints.flags = InputHint | StateHint;
wmPtr->hints.input = True;
wmPtr->hints.initial_state = NormalState;
@@ -383,15 +537,6 @@ TkWmNewWindow(winPtr)
wmPtr->hints.icon_x = wmPtr->hints.icon_y = 0;
wmPtr->hints.icon_mask = None;
wmPtr->hints.window_group = None;
- wmPtr->leaderName = NULL;
- wmPtr->masterWindowName = NULL;
- wmPtr->icon = NULL;
- wmPtr->iconFor = NULL;
- wmPtr->withdrawn = 0;
- wmPtr->wrapperPtr = NULL;
- wmPtr->menubar = NULL;
- wmPtr->menuHeight = 0;
- wmPtr->sizeHintsFlags = 0;
wmPtr->minWidth = wmPtr->minHeight = 1;
/*
@@ -399,9 +544,6 @@ TkWmNewWindow(winPtr)
* a guess about how space is needed for window manager decorations.
*/
- wmPtr->maxWidth = 0;
- wmPtr->maxHeight = 0;
- wmPtr->gridWin = NULL;
wmPtr->widthInc = wmPtr->heightInc = 1;
wmPtr->minAspect.x = wmPtr->minAspect.y = 1;
wmPtr->maxAspect.x = wmPtr->maxAspect.y = 1;
@@ -415,13 +557,9 @@ TkWmNewWindow(winPtr)
+ 2*winPtr->changes.border_width;
wmPtr->parentHeight = winPtr->changes.height
+ 2*winPtr->changes.border_width;
- wmPtr->xInParent = wmPtr->yInParent = 0;
wmPtr->configWidth = -1;
wmPtr->configHeight = -1;
wmPtr->vRoot = None;
- wmPtr->protPtr = NULL;
- wmPtr->cmdArgv = NULL;
- wmPtr->clientMachine = NULL;
wmPtr->flags = WM_NEVER_MAPPED;
wmPtr->nextPtr = (WmInfo *) dispPtr->firstWmPtr;
dispPtr->firstWmPtr = wmPtr;
@@ -467,7 +605,7 @@ TkWmMapWindow(winPtr)
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
XTextProperty textProp;
- char *string;
+ Tk_Uid string;
if (wmPtr->flags & WM_NEVER_MAPPED) {
Tcl_DString ds;
@@ -507,12 +645,21 @@ TkWmMapWindow(winPtr)
Tcl_DStringValue(&ds));
Tcl_DStringFree(&ds);
}
-
- if (wmPtr->master != None) {
- XSetTransientForHint(winPtr->display, wmPtr->wrapperPtr->window,
- wmPtr->master);
+
+ if (wmPtr->masterPtr != NULL) {
+ /*
+ * Don't map a transient if the master is not mapped.
+ */
+
+ if (!Tk_IsMapped(wmPtr->masterPtr)) {
+ wmPtr->withdrawn = 1;
+ wmPtr->hints.initial_state = WithdrawnState;
+ } else {
+ XSetTransientForHint(winPtr->display, wmPtr->wrapperPtr->window,
+ wmPtr->masterPtr->wmInfoPtr->wrapperPtr->window);
+ }
}
-
+
wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
UpdateHints(winPtr);
UpdateWmProtocols(wmPtr);
@@ -596,7 +743,7 @@ TkWmUnmapWindow(winPtr)
* mapped when in fact it is mapped. I suspect that this has something
* to do with the window manager filtering Map events (and possily not
* filtering Unmap events?).
- */
+ */
XUnmapWindow(winPtr->display, winPtr->wmInfoPtr->wrapperPtr->window);
WaitForMapNotify(winPtr, 0);
}
@@ -634,7 +781,7 @@ TkWmDeadWindow(winPtr)
} else {
register WmInfo *prevPtr;
- for (prevPtr = (WmInfo *) winPtr->dispPtr->firstWmPtr; ;
+ for (prevPtr = (WmInfo *) winPtr->dispPtr->firstWmPtr; ;
prevPtr = prevPtr->nextPtr) {
if (prevPtr == NULL) {
panic("couldn't unlink window in TkWmDeadWindow");
@@ -660,9 +807,6 @@ TkWmDeadWindow(winPtr)
if (wmPtr->leaderName != NULL) {
ckfree(wmPtr->leaderName);
}
- if (wmPtr->masterWindowName != NULL) {
- ckfree(wmPtr->masterWindowName);
- }
if (wmPtr->icon != NULL) {
wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
wmPtr2->iconFor = NULL;
@@ -706,6 +850,44 @@ TkWmDeadWindow(winPtr)
if (wmPtr->flags & WM_UPDATE_PENDING) {
Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
}
+ /*
+ * Reset all transient windows whose master is the dead window.
+ */
+
+ for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL;
+ wmPtr2 = wmPtr2->nextPtr) {
+ if (wmPtr2->masterPtr == winPtr) {
+ wmPtr->numTransients--;
+ Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr,
+ StructureNotifyMask,
+ WmWaitMapProc, (ClientData) wmPtr2->winPtr);
+ wmPtr2->masterPtr = NULL;
+ if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
+ XSetTransientForHint(wmPtr2->winPtr->display,
+ wmPtr2->wrapperPtr->window, None);
+ /* FIXME: Need a call like Win32's UpdateWrapper() so
+ we can recreate the wrapper and get rid of the
+ transient window decorations. */
+ }
+ }
+ }
+ if (wmPtr->numTransients != 0)
+ panic("numTransients should be 0");
+
+ if (wmPtr->masterPtr != NULL) {
+ wmPtr2 = wmPtr->masterPtr->wmInfoPtr;
+ /*
+ * If we had a master, tell them that we aren't tied
+ * to them anymore
+ */
+ if (wmPtr2 != NULL) {
+ wmPtr2->numTransients--;
+ }
+ Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
+ StructureNotifyMask,
+ WmWaitMapProc, (ClientData) winPtr);
+ wmPtr->masterPtr = NULL;
+ }
ckfree((char *) wmPtr);
winPtr->wmInfoPtr = NULL;
}
@@ -758,7 +940,7 @@ TkWmSetClass(winPtr)
/*
*----------------------------------------------------------------------
*
- * Tk_WmCmd --
+ * Tk_WmObjCmd --
*
* This procedure is invoked to process the "wm" Tcl command.
* See the user documentation for details on what it does.
@@ -774,1199 +956,2231 @@ TkWmSetClass(winPtr)
/* ARGSUSED */
int
-Tk_WmCmd(clientData, interp, argc, argv)
+Tk_WmObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
+ static CONST char *optionStrings[] = {
+ "aspect", "attributes", "client", "colormapwindows",
+ "command", "deiconify", "focusmodel", "frame",
+ "geometry", "grid", "group", "iconbitmap",
+ "iconify", "iconmask", "iconname", "iconposition",
+ "iconwindow", "maxsize", "minsize", "overrideredirect",
+ "positionfrom", "protocol", "resizable", "sizefrom",
+ "stackorder", "state", "title", "transient",
+ "withdraw", (char *) NULL };
+ enum options {
+ WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS,
+ WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FRAME,
+ WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBITMAP,
+ WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME, WMOPT_ICONPOSITION,
+ WMOPT_ICONWINDOW, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT,
+ WMOPT_POSITIONFROM, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM,
+ WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT,
+ WMOPT_WITHDRAW };
+ int index;
+ int length;
+ char *argv1;
TkWindow *winPtr;
- register WmInfo *wmPtr;
- int c;
- size_t length;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (argc < 2) {
+ if (objc < 2) {
wrongNumArgs:
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " option window ?arg ...?\"", (char *) NULL);
+ Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 't') && (strncmp(argv[1], "tracing", length) == 0)
+
+ argv1 = Tcl_GetStringFromObj(objv[1], &length);
+ if ((argv1[0] == 't') && (strncmp(argv1, "tracing", (size_t) length) == 0)
&& (length >= 3)) {
- if ((argc != 2) && (argc != 3)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " tracing ?boolean?\"", (char *) NULL);
+ int wmTracing;
+ if ((objc != 2) && (objc != 3)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
return TCL_ERROR;
}
- if (argc == 2) {
- Tcl_SetResult(interp, ((dispPtr->wmTracing) ? "on" : "off"),
- TCL_STATIC);
+ if (objc == 2) {
+ Tcl_SetResult(interp,
+ ((dispPtr->flags & TK_DISPLAY_WM_TRACING) ? "on" : "off"),
+ TCL_STATIC);
return TCL_OK;
}
- return Tcl_GetBoolean(interp, argv[2], &dispPtr->wmTracing);
+ if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (wmTracing) {
+ dispPtr->flags |= TK_DISPLAY_WM_TRACING;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_WM_TRACING;
+ }
+ return TCL_OK;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
}
- if (argc < 3) {
+ if (objc < 3) {
goto wrongNumArgs;
}
- winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[2], tkwin);
- if (winPtr == NULL) {
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], (Tk_Window *) &winPtr)
+ != TCL_OK) {
return TCL_ERROR;
}
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!Tk_IsTopLevel(winPtr)) {
Tcl_AppendResult(interp, "window \"", winPtr->pathName,
"\" isn't a top-level window", (char *) NULL);
return TCL_ERROR;
}
- wmPtr = winPtr->wmInfoPtr;
- if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)) {
- int numer1, denom1, numer2, denom2;
- if ((argc != 3) && (argc != 7)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " aspect window ?minNumer minDenom ",
- "maxNumer maxDenom?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & PAspect) {
- char buf[TCL_INTEGER_SPACE * 4];
-
- sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
- wmPtr->minAspect.y, wmPtr->maxAspect.x,
- wmPtr->maxAspect.y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~PAspect;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &numer1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &denom1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[5], &numer2) != TCL_OK)
- || (Tcl_GetInt(interp, argv[6], &denom2) != TCL_OK)) {
- return TCL_ERROR;
- }
- if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
- (denom2 <= 0)) {
- Tcl_SetResult(interp, "aspect number can't be <= 0",
- TCL_STATIC);
- return TCL_ERROR;
- }
- wmPtr->minAspect.x = numer1;
- wmPtr->minAspect.y = denom1;
- wmPtr->maxAspect.x = numer2;
- wmPtr->maxAspect.y = denom2;
- wmPtr->sizeHintsFlags |= PAspect;
+ switch ((enum options) index) {
+ case WMOPT_ASPECT:
+ return WmAspectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ATTRIBUTES:
+ return WmAttributesCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_CLIENT:
+ return WmClientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COLORMAPWINDOWS:
+ return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COMMAND:
+ return WmCommandCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_DEICONIFY:
+ return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FOCUSMODEL:
+ return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FRAME:
+ return WmFrameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GEOMETRY:
+ return WmGeometryCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GRID:
+ return WmGridCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GROUP:
+ return WmGroupCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONBITMAP:
+ return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONIFY:
+ return WmIconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONMASK:
+ return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONNAME:
+ return WmIconnameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONPOSITION:
+ return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONWINDOW:
+ return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MAXSIZE:
+ return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MINSIZE:
+ return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_OVERRIDEREDIRECT:
+ return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_POSITIONFROM:
+ return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_PROTOCOL:
+ return WmProtocolCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_RESIZABLE:
+ return WmResizableCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_SIZEFROM:
+ return WmSizefromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STACKORDER:
+ return WmStackorderCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STATE:
+ return WmStateCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TITLE:
+ return WmTitleCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TRANSIENT:
+ return WmTransientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_WITHDRAW:
+ return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv);
+ }
+
+ /* This should not happen */
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAspectCmd --
+ *
+ * This procedure is invoked to process the "wm aspect" 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
+WmAspectCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int numer1, denom1, numer2, denom2;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?minNumer minDenom maxNumer maxDenom?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PAspect) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
+ wmPtr->minAspect.y, wmPtr->maxAspect.x,
+ wmPtr->maxAspect.y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'c') && (strncmp(argv[1], "client", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " client window ?name?\"",
- (char *) NULL);
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~PAspect;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &numer1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->clientMachine != NULL) {
- Tcl_SetResult(interp, wmPtr->clientMachine, TCL_STATIC);
- }
- return TCL_OK;
+ if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
+ (denom2 <= 0)) {
+ Tcl_SetResult(interp, "aspect number can't be <= 0",
+ TCL_STATIC);
+ return TCL_ERROR;
}
- if (argv[3][0] == 0) {
- if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
- wmPtr->clientMachine = NULL;
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
- Tk_InternAtom((Tk_Window) winPtr,
- "WM_CLIENT_MACHINE"));
- }
- }
- return TCL_OK;
+ wmPtr->minAspect.x = numer1;
+ wmPtr->minAspect.y = denom1;
+ wmPtr->maxAspect.x = numer2;
+ wmPtr->maxAspect.y = denom2;
+ wmPtr->sizeHintsFlags |= PAspect;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAttributesCmd --
+ *
+ * This procedure is invoked to process the "wm attributes" 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
+WmAttributesCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmClientCmd --
+ *
+ * This procedure is invoked to process the "wm client" 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
+WmClientCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->clientMachine != NULL) {
+ Tcl_SetResult(interp, wmPtr->clientMachine, TCL_STATIC);
}
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (argv3[0] == 0) {
if (wmPtr->clientMachine != NULL) {
ckfree((char *) wmPtr->clientMachine);
- }
- wmPtr->clientMachine = (char *)
- ckalloc((unsigned) (strlen(argv[3]) + 1));
- strcpy(wmPtr->clientMachine, argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XTextProperty textProp;
- Tcl_DString ds;
-
- Tcl_UtfToExternalDString(NULL, wmPtr->clientMachine, -1, &ds);
- if (XStringListToTextProperty(&(Tcl_DStringValue(&ds)), 1,
- &textProp) != 0) {
- XSetWMClientMachine(winPtr->display, wmPtr->wrapperPtr->window,
- &textProp);
- XFree((char *) textProp.value);
+ wmPtr->clientMachine = NULL;
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
+ Tk_InternAtom((Tk_Window) winPtr,
+ "WM_CLIENT_MACHINE"));
}
- Tcl_DStringFree(&ds);
}
- } else if ((c == 'c') && (strncmp(argv[1], "colormapwindows", length) == 0)
- && (length >= 3)) {
- Window *cmapList;
- TkWindow *winPtr2;
- int count, i, windowArgc, gotToplevel;
- char buffer[20], **windowArgv;
+ return TCL_OK;
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ }
+ wmPtr->clientMachine = (char *)
+ ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->clientMachine, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XTextProperty textProp;
+ Tcl_DString ds;
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " colormapwindows window ?windowList?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- Tk_MakeWindowExist((Tk_Window) winPtr);
- if (wmPtr->wrapperPtr == NULL) {
- CreateWrapper(wmPtr);
+ Tcl_UtfToExternalDString(NULL, wmPtr->clientMachine, -1, &ds);
+ if (XStringListToTextProperty(&(Tcl_DStringValue(&ds)), 1,
+ &textProp) != 0) {
+ XSetWMClientMachine(winPtr->display, wmPtr->wrapperPtr->window,
+ &textProp);
+ XFree((char *) textProp.value);
}
- if (argc == 3) {
- if (XGetWMColormapWindows(winPtr->display,
- wmPtr->wrapperPtr->window, &cmapList, &count) == 0) {
- return TCL_OK;
- }
- for (i = 0; i < count; i++) {
- if ((i == (count-1))
- && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
- break;
- }
- winPtr2 = (TkWindow *) Tk_IdToWindow(winPtr->display,
- cmapList[i]);
- if (winPtr2 == NULL) {
- sprintf(buffer, "0x%lx", cmapList[i]);
- Tcl_AppendElement(interp, buffer);
- } else {
- Tcl_AppendElement(interp, winPtr2->pathName);
- }
- }
- XFree((char *) cmapList);
+ Tcl_DStringFree(&ds);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmColormapwindowsCmd --
+ *
+ * This procedure is invoked to process the "wm colormapwindows"
+ * 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
+WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Window *cmapList;
+ TkWindow *winPtr2;
+ int count, i, windowObjc, gotToplevel;
+ Tcl_Obj **windowObjv;
+ char buffer[20];
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?windowList?");
+ return TCL_ERROR;
+ }
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ if (wmPtr->wrapperPtr == NULL) {
+ CreateWrapper(wmPtr);
+ }
+ if (objc == 3) {
+ if (XGetWMColormapWindows(winPtr->display,
+ wmPtr->wrapperPtr->window, &cmapList, &count) == 0) {
return TCL_OK;
}
- if (Tcl_SplitList(interp, argv[3], &windowArgc, &windowArgv)
- != TCL_OK) {
- return TCL_ERROR;
- }
- cmapList = (Window *) ckalloc((unsigned)
- ((windowArgc+1)*sizeof(Window)));
- gotToplevel = 0;
- for (i = 0; i < windowArgc; i++) {
- winPtr2 = (TkWindow *) Tk_NameToWindow(interp, windowArgv[i],
- tkwin);
- if (winPtr2 == NULL) {
- ckfree((char *) cmapList);
- ckfree((char *) windowArgv);
- return TCL_ERROR;
- }
- if (winPtr2 == winPtr) {
- gotToplevel = 1;
+ for (i = 0; i < count; i++) {
+ if ((i == (count-1))
+ && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
+ break;
}
- if (winPtr2->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr2);
+ winPtr2 = (TkWindow *) Tk_IdToWindow(winPtr->display,
+ cmapList[i]);
+ if (winPtr2 == NULL) {
+ sprintf(buffer, "0x%lx", cmapList[i]);
+ Tcl_AppendElement(interp, buffer);
+ } else {
+ Tcl_AppendElement(interp, winPtr2->pathName);
}
- cmapList[i] = winPtr2->window;
}
- if (!gotToplevel) {
- wmPtr->flags |= WM_ADDED_TOPLEVEL_COLORMAP;
- cmapList[windowArgc] = wmPtr->wrapperPtr->window;
- windowArgc++;
- } else {
- wmPtr->flags &= ~WM_ADDED_TOPLEVEL_COLORMAP;
- }
- wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
- XSetWMColormapWindows(winPtr->display, wmPtr->wrapperPtr->window,
- cmapList, windowArgc);
- ckfree((char *) cmapList);
- ckfree((char *) windowArgv);
+ XFree((char *) cmapList);
return TCL_OK;
- } else if ((c == 'c') && (strncmp(argv[1], "command", length) == 0)
- && (length >= 3)) {
- int cmdArgc;
- char **cmdArgv;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " command window ?value?\"",
- (char *) NULL);
+ }
+ if (Tcl_ListObjGetElements(interp, objv[3], &windowObjc, &windowObjv)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ cmapList = (Window *) ckalloc((unsigned)
+ ((windowObjc+1)*sizeof(Window)));
+ gotToplevel = 0;
+ for (i = 0; i < windowObjc; i++) {
+ if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
+ (Tk_Window *) &winPtr2) != TCL_OK)
+ {
+ ckfree((char *) cmapList);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->cmdArgv != NULL) {
- Tcl_SetResult(interp,
- Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
- TCL_DYNAMIC);
- }
- return TCL_OK;
+ if (winPtr2 == winPtr) {
+ gotToplevel = 1;
}
- if (argv[3][0] == 0) {
- if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
- wmPtr->cmdArgv = NULL;
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
- Tk_InternAtom((Tk_Window) winPtr, "WM_COMMAND"));
- }
- }
- return TCL_OK;
+ if (winPtr2->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr2);
}
- if (Tcl_SplitList(interp, argv[3], &cmdArgc, &cmdArgv) != TCL_OK) {
- return TCL_ERROR;
+ cmapList[i] = winPtr2->window;
+ }
+ if (!gotToplevel) {
+ wmPtr->flags |= WM_ADDED_TOPLEVEL_COLORMAP;
+ cmapList[windowObjc] = wmPtr->wrapperPtr->window;
+ windowObjc++;
+ } else {
+ wmPtr->flags &= ~WM_ADDED_TOPLEVEL_COLORMAP;
+ }
+ wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
+ XSetWMColormapWindows(winPtr->display, wmPtr->wrapperPtr->window,
+ cmapList, windowObjc);
+ ckfree((char *) cmapList);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmCommandCmd --
+ *
+ * This procedure is invoked to process the "wm command" 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
+WmCommandCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int cmdArgc;
+ CONST char **cmdArgv;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->cmdArgv != NULL) {
+ Tcl_SetResult(interp,
+ Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
+ TCL_DYNAMIC);
}
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (argv3[0] == 0) {
if (wmPtr->cmdArgv != NULL) {
ckfree((char *) wmPtr->cmdArgv);
+ wmPtr->cmdArgv = NULL;
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XDeleteProperty(winPtr->display, wmPtr->wrapperPtr->window,
+ Tk_InternAtom((Tk_Window) winPtr, "WM_COMMAND"));
+ }
}
- wmPtr->cmdArgc = cmdArgc;
- wmPtr->cmdArgv = cmdArgv;
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- UpdateCommand(winPtr);
+ return TCL_OK;
+ }
+ if (Tcl_SplitList(interp, argv3, &cmdArgc, &cmdArgv) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ }
+ wmPtr->cmdArgc = cmdArgc;
+ wmPtr->cmdArgv = cmdArgv;
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ UpdateCommand(winPtr);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmDeiconifyCmd --
+ *
+ * This procedure is invoked to process the "wm deiconify" 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
+WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't deiconify ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) {
+ wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN;
+ }
+ TkpWmSetState(winPtr, NormalState);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFocusmodelCmd --
+ *
+ * This procedure is invoked to process the "wm focusmodel" 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
+WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "active", "passive", (char *) NULL };
+ enum options {
+ OPT_ACTIVE, OPT_PASSIVE };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?active|passive?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp, (wmPtr->hints.input ? "passive" : "active"),
+ TCL_STATIC);
+ return TCL_OK;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == OPT_ACTIVE) {
+ wmPtr->hints.input = False;
+ } else { /* OPT_PASSIVE */
+ wmPtr->hints.input = True;
+ }
+ UpdateHints(winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFrameCmd --
+ *
+ * This procedure is invoked to process the "wm frame" 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
+WmFrameCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Window window;
+ char buf[TCL_INTEGER_SPACE];
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ window = wmPtr->reparent;
+ if (window == None) {
+ window = Tk_WindowId((Tk_Window) winPtr);
+ }
+ sprintf(buf, "0x%x", (unsigned int) window);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGeometryCmd --
+ *
+ * This procedure is invoked to process the "wm geometry" 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
+WmGeometryCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char xSign, ySign;
+ int width, height;
+ char *argv3;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[16 + TCL_INTEGER_SPACE * 4];
+
+ xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
+ ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
+ if (wmPtr->gridWin != NULL) {
+ width = wmPtr->reqGridWidth + (winPtr->changes.width
+ - winPtr->reqWidth)/wmPtr->widthInc;
+ height = wmPtr->reqGridHeight + (winPtr->changes.height
+ - winPtr->reqHeight)/wmPtr->heightInc;
+ } else {
+ width = winPtr->changes.width;
+ height = winPtr->changes.height;
}
- } else if ((c == 'd') && (strncmp(argv[1], "deiconify", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " deiconify window\"", (char *) NULL);
- return TCL_ERROR;
+ sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
+ ySign, wmPtr->y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ wmPtr->width = -1;
+ wmPtr->height = -1;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+ }
+ return ParseGeometry(interp, argv3, winPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGridCmd --
+ *
+ * This procedure is invoked to process the "wm grid" 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
+WmGridCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int reqWidth, reqHeight, widthInc, heightInc;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?baseWidth baseHeight widthInc heightInc?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PBaseSize) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->reqGridWidth,
+ wmPtr->reqGridHeight, wmPtr->widthInc,
+ wmPtr->heightInc);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't deiconify ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
- (char *) NULL);
- return TCL_ERROR;
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ /*
+ * Turn off gridding and reset the width and height
+ * to make sense as ungridded numbers.
+ */
+
+ wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
+ if (wmPtr->width != -1) {
+ wmPtr->width = winPtr->reqWidth + (wmPtr->width
+ - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ wmPtr->height = winPtr->reqHeight + (wmPtr->height
+ - wmPtr->reqGridHeight)*wmPtr->heightInc;
}
- wmPtr->hints.initial_state = NormalState;
- wmPtr->withdrawn = 0;
- if (wmPtr->flags & WM_NEVER_MAPPED) {
- return TCL_OK;
+ wmPtr->widthInc = 1;
+ wmPtr->heightInc = 1;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &reqWidth) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &heightInc) != TCL_OK)) {
+ return TCL_ERROR;
}
- UpdateHints(winPtr);
- Tk_MapWindow((Tk_Window) winPtr);
- } else if ((c == 'f') && (strncmp(argv[1], "focusmodel", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " focusmodel window ?active|passive?\"",
- (char *) NULL);
+ if (reqWidth < 0) {
+ Tcl_SetResult(interp, "baseWidth can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- if (argc == 3) {
- Tcl_SetResult(interp, (wmPtr->hints.input ? "passive" : "active"),
- TCL_STATIC);
- return TCL_OK;
+ if (reqHeight < 0) {
+ Tcl_SetResult(interp, "baseHeight can't be < 0", TCL_STATIC);
+ return TCL_ERROR;
}
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'a') && (strncmp(argv[3], "active", length) == 0)) {
- wmPtr->hints.input = False;
- } else if ((c == 'p') && (strncmp(argv[3], "passive", length) == 0)) {
- wmPtr->hints.input = True;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be active or passive", (char *) NULL);
+ if (widthInc < 0) {
+ Tcl_SetResult(interp, "widthInc can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- UpdateHints(winPtr);
- } else if ((c == 'f') && (strncmp(argv[1], "frame", length) == 0)
- && (length >= 2)) {
- Window window;
- char buf[TCL_INTEGER_SPACE];
-
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " frame window\"", (char *) NULL);
+ if (heightInc < 0) {
+ Tcl_SetResult(interp, "heightInc can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- window = wmPtr->reparent;
- if (window == None) {
- window = Tk_WindowId((Tk_Window) winPtr);
+ Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
+ heightInc);
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGroupCmd --
+ *
+ * This procedure is invoked to process the "wm group" 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
+WmGroupCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ WmInfo *wmPtr2;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & WindowGroupHint) {
+ Tcl_SetResult(interp, wmPtr->leaderName, TCL_STATIC);
}
- sprintf(buf, "0x%x", (unsigned int) window);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if ((c == 'g') && (strncmp(argv[1], "geometry", length) == 0)
- && (length >= 2)) {
- char xSign, ySign;
- int width, height;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " geometry window ?newGeometry?\"",
- (char *) NULL);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (*argv3 == '\0') {
+ wmPtr->hints.flags &= ~WindowGroupHint;
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
+ }
+ wmPtr->leaderName = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
- if (argc == 3) {
- char buf[16 + TCL_INTEGER_SPACE * 4];
-
- xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
- ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
- if (wmPtr->gridWin != NULL) {
- width = wmPtr->reqGridWidth + (winPtr->changes.width
- - winPtr->reqWidth)/wmPtr->widthInc;
- height = wmPtr->reqGridHeight + (winPtr->changes.height
- - winPtr->reqHeight)/wmPtr->heightInc;
- } else {
- width = winPtr->changes.width;
- height = winPtr->changes.height;
- }
- sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
- ySign, wmPtr->y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
+ while (!Tk_TopWinHierarchy(tkwin2)) {
+ /*
+ * Ensure that the group leader is actually a Tk toplevel.
+ */
+
+ tkwin2 = Tk_Parent(tkwin2);
}
- if (*argv[3] == '\0') {
- wmPtr->width = -1;
- wmPtr->height = -1;
- goto updateGeom;
+ Tk_MakeWindowExist(tkwin2);
+ wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
+ if (wmPtr2->wrapperPtr == NULL) {
+ CreateWrapper(wmPtr2);
}
- return ParseGeometry(interp, argv[3], winPtr);
- } else if ((c == 'g') && (strncmp(argv[1], "grid", length) == 0)
- && (length >= 3)) {
- int reqWidth, reqHeight, widthInc, heightInc;
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
+ }
+ wmPtr->hints.window_group = Tk_WindowId(wmPtr2->wrapperPtr);
+ wmPtr->hints.flags |= WindowGroupHint;
+ wmPtr->leaderName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->leaderName, argv3);
+ }
+ UpdateHints(winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconbitmapCmd --
+ *
+ * This procedure is invoked to process the "wm iconbitmap" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 7)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " grid window ?baseWidth baseHeight ",
- "widthInc heightInc?\"", (char *) NULL);
+static int
+WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Pixmap pixmap;
+ char *argv3;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconPixmapHint) {
+ Tcl_SetResult(interp, (char *)
+ Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
+ TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ if (wmPtr->hints.icon_pixmap != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
+ wmPtr->hints.icon_pixmap = None;
+ }
+ wmPtr->hints.flags &= ~IconPixmapHint;
+ } else {
+ pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr, argv3);
+ if (pixmap == None) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & PBaseSize) {
- char buf[TCL_INTEGER_SPACE * 4];
+ wmPtr->hints.icon_pixmap = pixmap;
+ wmPtr->hints.flags |= IconPixmapHint;
+ }
+ UpdateHints(winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconifyCmd --
+ *
+ * This procedure is invoked to process the "wm iconify" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- sprintf(buf, "%d %d %d %d", wmPtr->reqGridWidth,
- wmPtr->reqGridHeight, wmPtr->widthInc,
- wmPtr->heightInc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- /*
- * Turn off gridding and reset the width and height
- * to make sense as ungridded numbers.
- */
+static int
+WmIconifyCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": override-redirect flag is set", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->masterPtr != NULL) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (TkpWmSetState(winPtr, IconicState) == 0) {
+ Tcl_SetResult(interp,
+ "couldn't send iconify message to window manager",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconmaskCmd --
+ *
+ * This procedure is invoked to process the "wm iconmask" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
- if (wmPtr->width != -1) {
- wmPtr->width = winPtr->reqWidth + (wmPtr->width
- - wmPtr->reqGridWidth)*wmPtr->widthInc;
- wmPtr->height = winPtr->reqHeight + (wmPtr->height
- - wmPtr->reqGridHeight)*wmPtr->heightInc;
- }
- wmPtr->widthInc = 1;
- wmPtr->heightInc = 1;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &reqWidth) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &reqHeight) != TCL_OK)
- || (Tcl_GetInt(interp, argv[5], &widthInc) != TCL_OK)
- || (Tcl_GetInt(interp, argv[6], &heightInc) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (reqWidth < 0) {
- Tcl_SetResult(interp, "baseWidth can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (reqHeight < 0) {
- Tcl_SetResult(interp, "baseHeight can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (widthInc < 0) {
- Tcl_SetResult(interp, "widthInc can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (heightInc < 0) {
- Tcl_SetResult(interp, "heightInc can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
- heightInc);
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'g') && (strncmp(argv[1], "group", length) == 0)
- && (length >= 3)) {
- Tk_Window tkwin2;
- WmInfo *wmPtr2;
+static int
+WmIconmaskCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Pixmap pixmap;
+ char *argv3;
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " group window ?pathName?\"",
- (char *) NULL);
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconMaskHint) {
+ Tcl_SetResult(interp, (char *)
+ Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
+ TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ if (wmPtr->hints.icon_mask != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
+ }
+ wmPtr->hints.flags &= ~IconMaskHint;
+ } else {
+ pixmap = Tk_GetBitmap(interp, tkwin, argv3);
+ if (pixmap == None) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->hints.flags & WindowGroupHint) {
- Tcl_SetResult(interp, wmPtr->leaderName, TCL_STATIC);
- }
- return TCL_OK;
+ wmPtr->hints.icon_mask = pixmap;
+ wmPtr->hints.flags |= IconMaskHint;
+ }
+ UpdateHints(winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconnameCmd --
+ *
+ * This procedure is invoked to process the "wm iconname" 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
+WmIconnameCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp,
+ ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ if (wmPtr->iconName != NULL) {
+ ckfree((char *) wmPtr->iconName);
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~WindowGroupHint;
- if (wmPtr->leaderName != NULL) {
- ckfree(wmPtr->leaderName);
- }
- wmPtr->leaderName = NULL;
- } else {
- tkwin2 = Tk_NameToWindow(interp, argv[3], tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- while (!Tk_IsTopLevel(tkwin2)) {
- /*
- * Ensure that the group leader is actually a Tk toplevel.
- */
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->iconName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->iconName, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ Tcl_DString ds;
- tkwin2 = Tk_Parent(tkwin2);
- }
- Tk_MakeWindowExist(tkwin2);
- wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
- if (wmPtr2->wrapperPtr == NULL) {
- CreateWrapper(wmPtr2);
- }
- if (wmPtr->leaderName != NULL) {
- ckfree(wmPtr->leaderName);
- }
- wmPtr->hints.window_group = Tk_WindowId(wmPtr2->wrapperPtr);
- wmPtr->hints.flags |= WindowGroupHint;
- wmPtr->leaderName = ckalloc((unsigned) (strlen(argv[3])+1));
- strcpy(wmPtr->leaderName, argv[3]);
+ Tcl_UtfToExternalDString(NULL, wmPtr->iconName, -1, &ds);
+ XSetIconName(winPtr->display, wmPtr->wrapperPtr->window,
+ Tcl_DStringValue(&ds));
+ Tcl_DStringFree(&ds);
}
- UpdateHints(winPtr);
- } else if ((c == 'i') && (strncmp(argv[1], "iconbitmap", length) == 0)
- && (length >= 5)) {
- Pixmap pixmap;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconpositionCmd --
+ *
+ * This procedure is invoked to process the "wm iconposition"
+ * Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconbitmap window ?bitmap?\"",
- (char *) NULL);
- return TCL_ERROR;
+static int
+WmIconpositionCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int x, y;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?x y?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconPositionHint) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->hints.icon_x,
+ wmPtr->hints.icon_y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- if (argc == 3) {
- if (wmPtr->hints.flags & IconPixmapHint) {
- Tcl_SetResult(interp,
- Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
- TCL_STATIC);
- }
- return TCL_OK;
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconPositionHint;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)){
+ return TCL_ERROR;
}
- if (*argv[3] == '\0') {
- if (wmPtr->hints.icon_pixmap != None) {
- Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
- wmPtr->hints.icon_pixmap = None;
- }
- wmPtr->hints.flags &= ~IconPixmapHint;
- } else {
- pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr,
- Tk_GetUid(argv[3]));
- if (pixmap == None) {
- return TCL_ERROR;
- }
- wmPtr->hints.icon_pixmap = pixmap;
- wmPtr->hints.flags |= IconPixmapHint;
+ wmPtr->hints.icon_x = x;
+ wmPtr->hints.icon_y = y;
+ wmPtr->hints.flags |= IconPositionHint;
+ }
+ UpdateHints(winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconwindowCmd --
+ *
+ * This procedure is invoked to process the "wm iconwindow" 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
+WmIconwindowCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ WmInfo *wmPtr2;
+ XSetWindowAttributes atts;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->icon != NULL) {
+ Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
}
- UpdateHints(winPtr);
- } else if ((c == 'i') && (strncmp(argv[1], "iconify", length) == 0)
- && (length >= 5)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconify window\"", (char *) NULL);
- return TCL_ERROR;
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconWindowHint;
+ if (wmPtr->icon != NULL) {
+ /*
+ * Remove the icon window relationship. In principle we
+ * should also re-enable button events for the window, but
+ * this doesn't work in general because the window manager
+ * is probably selecting on them (we'll get an error if
+ * we try to re-enable the events). So, just leave the
+ * icon window event-challenged; the user will have to
+ * recreate it if they want button events.
+ */
+
+ wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr2->iconFor = NULL;
+ wmPtr2->withdrawn = 1;
+ wmPtr2->hints.initial_state = WithdrawnState;
}
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
- Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
- "\": override-redirect flag is set", (char *) NULL);
+ wmPtr->icon = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
- if (wmPtr->master != None) {
- Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
- "\": it is a transient", (char *) NULL);
+ if (!Tk_IsTopLevel(tkwin2)) {
+ Tcl_AppendResult(interp, "can't use ", Tcl_GetString(objv[3]),
+ " as icon window: not at top level", (char *) NULL);
return TCL_ERROR;
}
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't iconify ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
- (char *) NULL);
+ wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
+ if (wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[3]),
+ " is already an icon for ",
+ Tk_PathName(wmPtr2->iconFor), (char *) NULL);
return TCL_ERROR;
}
- wmPtr->hints.initial_state = IconicState;
- if (wmPtr->flags & WM_NEVER_MAPPED) {
- return TCL_OK;
+ if (wmPtr->icon != NULL) {
+ WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr3->iconFor = NULL;
+ wmPtr3->withdrawn = 1;
+ wmPtr3->hints.initial_state = WithdrawnState;
}
- if (wmPtr->withdrawn) {
- UpdateHints(winPtr);
- Tk_MapWindow((Tk_Window) winPtr);
- wmPtr->withdrawn = 0;
- } else {
- if (XIconifyWindow(winPtr->display, wmPtr->wrapperPtr->window,
- winPtr->screenNum) == 0) {
+
+ /*
+ * Disable button events in the icon window: some window
+ * managers (like olvwm) want to get the events themselves,
+ * but X only allows one application at a time to receive
+ * button events for a window.
+ */
+
+ atts.event_mask = Tk_Attributes(tkwin2)->event_mask
+ & ~ButtonPressMask;
+ Tk_ChangeWindowAttributes(tkwin2, CWEventMask, &atts);
+ Tk_MakeWindowExist(tkwin2);
+ if (wmPtr2->wrapperPtr == NULL) {
+ CreateWrapper(wmPtr2);
+ }
+ wmPtr->hints.icon_window = Tk_WindowId(wmPtr2->wrapperPtr);
+ wmPtr->hints.flags |= IconWindowHint;
+ wmPtr->icon = tkwin2;
+ wmPtr2->iconFor = (Tk_Window) winPtr;
+ if (!wmPtr2->withdrawn && !(wmPtr2->flags & WM_NEVER_MAPPED)) {
+ wmPtr2->withdrawn = 0;
+ if (XWithdrawWindow(Tk_Display(tkwin2),
+ Tk_WindowId(wmPtr2->wrapperPtr),
+ Tk_ScreenNumber(tkwin2)) == 0) {
Tcl_SetResult(interp,
- "couldn't send iconify message to window manager",
+ "couldn't send withdraw message to window manager",
TCL_STATIC);
return TCL_ERROR;
}
- WaitForMapNotify(winPtr, 0);
+ WaitForMapNotify((TkWindow *) tkwin2, 0);
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconmask", length) == 0)
- && (length >= 5)) {
- Pixmap pixmap;
+ }
+ UpdateHints(winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMaxsizeCmd --
+ *
+ * This procedure is invoked to process the "wm maxsize" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconmask window ?bitmap?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- if (wmPtr->hints.flags & IconMaskHint) {
- Tcl_SetResult(interp,
- Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
- TCL_STATIC);
- }
- return TCL_OK;
+static int
+WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ GetMaxSize(wmPtr, &width, &height);
+ sprintf(buf, "%d %d", width, height);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->maxWidth = width;
+ wmPtr->maxHeight = height;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMinsizeCmd --
+ *
+ * This procedure is invoked to process the "wm minsize" 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
+WmMinsizeCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->minWidth, wmPtr->minHeight);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->minWidth = width;
+ wmPtr->minHeight = height;
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmOverrideredirectCmd --
+ *
+ * This procedure is invoked to process the "wm overrideredirect"
+ * 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
+WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ int boolean, curValue;
+ XSetWindowAttributes atts;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
+ return TCL_ERROR;
+ }
+ curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
+ if (objc == 3) {
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), curValue);
+ return TCL_OK;
+ }
+ if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (curValue != boolean) {
+ /*
+ * Only do this if we are really changing value, because it
+ * causes some funky stuff to occur
+ */
+ atts.override_redirect = (boolean) ? True : False;
+ Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
+ &atts);
+ if (winPtr->wmInfoPtr->wrapperPtr != NULL) {
+ Tk_ChangeWindowAttributes(
+ (Tk_Window) winPtr->wmInfoPtr->wrapperPtr,
+ CWOverrideRedirect, &atts);
}
- if (*argv[3] == '\0') {
- if (wmPtr->hints.icon_mask != None) {
- Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
- }
- wmPtr->hints.flags &= ~IconMaskHint;
- } else {
- pixmap = Tk_GetBitmap(interp, tkwin, Tk_GetUid(argv[3]));
- if (pixmap == None) {
- return TCL_ERROR;
- }
- wmPtr->hints.icon_mask = pixmap;
- wmPtr->hints.flags |= IconMaskHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmPositionfromCmd --
+ *
+ * This procedure is invoked to process the "wm positionfrom"
+ * 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
+WmPositionfromCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user/program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USPosition) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PPosition) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
}
- UpdateHints(winPtr);
- } else if ((c == 'i') && (strncmp(argv[1], "iconname", length) == 0)
- && (length >= 5)) {
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconname window ?newName?\"", (char *) NULL);
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- if (argc == 3) {
- Tcl_SetResult(interp,
- ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""),
- TCL_STATIC);
- return TCL_OK;
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PPosition;
+ wmPtr->sizeHintsFlags |= USPosition;
} else {
- if (wmPtr->iconName != NULL) {
- ckfree((char *) wmPtr->iconName);
- }
- wmPtr->iconName = ckalloc((unsigned) (strlen(argv[3]) + 1));
- strcpy(wmPtr->iconName, argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- Tcl_DString ds;
-
- Tcl_UtfToExternalDString(NULL, wmPtr->iconName, -1, &ds);
- XSetIconName(winPtr->display, wmPtr->wrapperPtr->window,
- Tcl_DStringValue(&ds));
- Tcl_DStringFree(&ds);
- }
+ wmPtr->sizeHintsFlags &= ~USPosition;
+ wmPtr->sizeHintsFlags |= PPosition;
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconposition", length) == 0)
- && (length >= 5)) {
- int x, y;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmProtocolCmd --
+ *
+ * This procedure is invoked to process the "wm protocol" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconposition window ?x y?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- if (wmPtr->hints.flags & IconPositionHint) {
- char buf[TCL_INTEGER_SPACE * 2];
+static int
+WmProtocolCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ register ProtocolHandler *protPtr, *prevPtr;
+ Atom protocol;
+ char *cmd;
+ int cmdLength;
- sprintf(buf, "%d %d", wmPtr->hints.icon_x,
- wmPtr->hints.icon_y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
+ if ((objc < 3) || (objc > 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ /*
+ * Return a list of all defined protocols for the window.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ Tcl_AppendElement(interp,
+ Tk_GetAtomName((Tk_Window) winPtr, protPtr->protocol));
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~IconPositionHint;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &x) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &y) != TCL_OK)){
- return TCL_ERROR;
+ return TCL_OK;
+ }
+ protocol = Tk_InternAtom((Tk_Window) winPtr, Tcl_GetString(objv[3]));
+ if (objc == 4) {
+ /*
+ * Return the command to handle a given protocol.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ Tcl_SetResult(interp, protPtr->command, TCL_STATIC);
+ return TCL_OK;
}
- wmPtr->hints.icon_x = x;
- wmPtr->hints.icon_y = y;
- wmPtr->hints.flags |= IconPositionHint;
- }
- UpdateHints(winPtr);
- } else if ((c == 'i') && (strncmp(argv[1], "iconwindow", length) == 0)
- && (length >= 5)) {
- Tk_Window tkwin2;
- WmInfo *wmPtr2;
- XSetWindowAttributes atts;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconwindow window ?pathName?\"",
- (char *) NULL);
- return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->icon != NULL) {
- Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
+ return TCL_OK;
+ }
+
+ /*
+ * Delete any current protocol handler, then create a new
+ * one with the specified command, unless the command is
+ * empty.
+ */
+
+ for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
+ prevPtr = protPtr, protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ if (prevPtr == NULL) {
+ wmPtr->protPtr = protPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = protPtr->nextPtr;
}
- return TCL_OK;
+ Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ break;
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~IconWindowHint;
- if (wmPtr->icon != NULL) {
- /*
- * Remove the icon window relationship. In principle we
- * should also re-enable button events for the window, but
- * this doesn't work in general because the window manager
- * is probably selecting on them (we'll get an error if
- * we try to re-enable the events). So, just leave the
- * icon window event-challenged; the user will have to
- * recreate it if they want button events.
- */
+ }
+ cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
+ if (cmdLength > 0) {
+ protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr->protocol = protocol;
+ protPtr->nextPtr = wmPtr->protPtr;
+ wmPtr->protPtr = protPtr;
+ protPtr->interp = interp;
+ strcpy(protPtr->command, cmd);
+ }
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ UpdateWmProtocols(wmPtr);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmResizableCmd --
+ *
+ * This procedure is invoked to process the "wm resizable" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
- wmPtr2->iconFor = NULL;
- wmPtr2->withdrawn = 1;
- wmPtr2->hints.initial_state = WithdrawnState;
- }
- wmPtr->icon = NULL;
- } else {
- tkwin2 = Tk_NameToWindow(interp, argv[3], tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- if (!Tk_IsTopLevel(tkwin2)) {
- Tcl_AppendResult(interp, "can't use ", argv[3],
- " as icon window: not at top level", (char *) NULL);
- return TCL_ERROR;
- }
- wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
- if (wmPtr2->iconFor != NULL) {
- Tcl_AppendResult(interp, argv[3], " is already an icon for ",
- Tk_PathName(wmPtr2->iconFor), (char *) NULL);
- return TCL_ERROR;
- }
- if (wmPtr->icon != NULL) {
- WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
- wmPtr3->iconFor = NULL;
- wmPtr3->withdrawn = 1;
- wmPtr3->hints.initial_state = WithdrawnState;
- }
+static int
+WmResizableCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
- /*
- * Disable button events in the icon window: some window
- * managers (like olvwm) want to get the events themselves,
- * but X only allows one application at a time to receive
- * button events for a window.
- */
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
- atts.event_mask = Tk_Attributes(tkwin2)->event_mask
- & ~ButtonPressMask;
- Tk_ChangeWindowAttributes(tkwin2, CWEventMask, &atts);
- Tk_MakeWindowExist(tkwin2);
- if (wmPtr2->wrapperPtr == NULL) {
- CreateWrapper(wmPtr2);
- }
- wmPtr->hints.icon_window = Tk_WindowId(wmPtr2->wrapperPtr);
- wmPtr->hints.flags |= IconWindowHint;
- wmPtr->icon = tkwin2;
- wmPtr2->iconFor = (Tk_Window) winPtr;
- if (!wmPtr2->withdrawn && !(wmPtr2->flags & WM_NEVER_MAPPED)) {
- wmPtr2->withdrawn = 0;
- if (XWithdrawWindow(Tk_Display(tkwin2),
- Tk_WindowId(wmPtr2->wrapperPtr),
- Tk_ScreenNumber(tkwin2)) == 0) {
- Tcl_SetResult(interp,
- "couldn't send withdraw message to window manager",
- TCL_STATIC);
- return TCL_ERROR;
- }
- WaitForMapNotify((TkWindow *) tkwin2, 0);
- }
- }
- UpdateHints(winPtr);
- } else if ((c == 'm') && (strncmp(argv[1], "maxsize", length) == 0)
- && (length >= 2)) {
- int width, height;
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " maxsize window ?width height?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- GetMaxSize(wmPtr, &width, &height);
- sprintf(buf, "%d %d", width, height);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
+ sprintf(buf, "%d %d",
+ (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetBooleanFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetBooleanFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if (width) {
+ wmPtr->flags &= ~WM_WIDTH_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
+ }
+ if (height) {
+ wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmSizefromCmd --
+ *
+ * This procedure is invoked to process the "wm sizefrom" 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
+WmSizefromCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user|program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USSize) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PSize) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
}
- if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &height) != TCL_OK)) {
+ return TCL_OK;
+ }
+
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USSize|PSize);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- wmPtr->maxWidth = width;
- wmPtr->maxHeight = height;
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'm') && (strncmp(argv[1], "minsize", length) == 0)
- && (length >= 2)) {
- int width, height;
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " minsize window ?width height?\"", (char *) NULL);
- return TCL_ERROR;
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PSize;
+ wmPtr->sizeHintsFlags |= USSize;
+ } else { /* OPT_PROGRAM */
+ wmPtr->sizeHintsFlags &= ~USSize;
+ wmPtr->sizeHintsFlags |= PSize;
}
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
+ }
+ wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStackorderCmd --
+ *
+ * This procedure is invoked to process the "wm stackorder" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- sprintf(buf, "%d %d", wmPtr->minWidth, wmPtr->minHeight);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+static int
+WmStackorderCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ TkWindow **windows, **window_ptr;
+ static CONST char *optionStrings[] = {
+ "isabove", "isbelow", (char *) NULL };
+ enum options {
+ OPT_ISABOVE, OPT_ISBELOW };
+ int index;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?isabove|isbelow window?");
+ return TCL_ERROR;
+ }
+
+ if (objc == 3) {
+ windows = TkWmStackorderToplevel(winPtr);
+ if (windows == NULL) {
+ panic("TkWmStackorderToplevel failed");
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ Tcl_AppendElement(interp, (*window_ptr)->pathName);
+ }
+ ckfree((char *) windows);
return TCL_OK;
}
- if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &height) != TCL_OK)) {
- return TCL_ERROR;
- }
- wmPtr->minWidth = width;
- wmPtr->minHeight = height;
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'o')
- && (strncmp(argv[1], "overrideredirect", length) == 0)) {
- int boolean, curValue;
- XSetWindowAttributes atts;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " overrideredirect window ?boolean?\"",
- (char *) NULL);
+ } else {
+ TkWindow *winPtr2;
+ int index1=-1, index2=-1, result;
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[4], (Tk_Window *) &winPtr2)
+ != TCL_OK) {
return TCL_ERROR;
}
- curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
- if (argc == 3) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), curValue);
- return TCL_OK;
- }
- if (Tcl_GetBoolean(interp, argv[3], &boolean) != TCL_OK) {
+
+ if (!Tk_IsTopLevel(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't a top-level window", (char *) NULL);
return TCL_ERROR;
}
- if (curValue != boolean) {
- /*
- * Only do this if we are really changing value, because it
- * causes some funky stuff to occur
- */
- atts.override_redirect = (boolean) ? True : False;
- Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
- &atts);
- if (winPtr->wmInfoPtr->wrapperPtr != NULL) {
- Tk_ChangeWindowAttributes(
- (Tk_Window) winPtr->wmInfoPtr->wrapperPtr,
- CWOverrideRedirect, &atts);
- }
- }
- } else if ((c == 'p') && (strncmp(argv[1], "positionfrom", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " positionfrom window ?user/program?\"",
- (char *) NULL);
+
+ if (!Tk_IsMapped(winPtr)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't mapped", (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & USPosition) {
- Tcl_SetResult(interp, "user", TCL_STATIC);
- } else if (wmPtr->sizeHintsFlags & PPosition) {
- Tcl_SetResult(interp, "program", TCL_STATIC);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
- } else {
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'u') && (strncmp(argv[3], "user", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~PPosition;
- wmPtr->sizeHintsFlags |= USPosition;
- } else if ((c == 'p') && (strncmp(argv[3], "program", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~USPosition;
- wmPtr->sizeHintsFlags |= PPosition;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be program or user", (char *) NULL);
- return TCL_ERROR;
- }
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 'p') && (strncmp(argv[1], "protocol", length) == 0)
- && (length >= 2)) {
- register ProtocolHandler *protPtr, *prevPtr;
- Atom protocol;
- int cmdLength;
-
- if ((argc < 3) || (argc > 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " protocol window ?name? ?command?\"",
- (char *) NULL);
+
+ if (!Tk_IsMapped(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't mapped", (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- /*
- * Return a list of all defined protocols for the window.
- */
- for (protPtr = wmPtr->protPtr; protPtr != NULL;
- protPtr = protPtr->nextPtr) {
- Tcl_AppendElement(interp,
- Tk_GetAtomName((Tk_Window) winPtr, protPtr->protocol));
- }
- return TCL_OK;
- }
- protocol = Tk_InternAtom((Tk_Window) winPtr, argv[3]);
- if (argc == 4) {
- /*
- * Return the command to handle a given protocol.
- */
- for (protPtr = wmPtr->protPtr; protPtr != NULL;
- protPtr = protPtr->nextPtr) {
- if (protPtr->protocol == protocol) {
- Tcl_SetResult(interp, protPtr->command, TCL_STATIC);
- return TCL_OK;
- }
- }
- return TCL_OK;
- }
/*
- * Delete any current protocol handler, then create a new
- * one with the specified command, unless the command is
- * empty.
+ * Lookup stacking order of all toplevels that are children
+ * of "." and find the position of winPtr and winPtr2
+ * in the stacking order.
*/
- for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
- prevPtr = protPtr, protPtr = protPtr->nextPtr) {
- if (protPtr->protocol == protocol) {
- if (prevPtr == NULL) {
- wmPtr->protPtr = protPtr->nextPtr;
- } else {
- prevPtr->nextPtr = protPtr->nextPtr;
- }
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
- break;
+ windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
+
+ if (windows == NULL) {
+ Tcl_AppendResult(interp, "TkWmStackorderToplevel failed",
+ (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ if (*window_ptr == winPtr)
+ index1 = (window_ptr - windows);
+ if (*window_ptr == winPtr2)
+ index2 = (window_ptr - windows);
}
+ if (index1 == -1)
+ panic("winPtr window not found");
+ if (index2 == -1)
+ panic("winPtr2 window not found");
+
+ ckfree((char *) windows);
}
- cmdLength = strlen(argv[4]);
- if (cmdLength > 0) {
- protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
- protPtr->protocol = protocol;
- protPtr->nextPtr = wmPtr->protPtr;
- wmPtr->protPtr = protPtr;
- protPtr->interp = interp;
- strcpy(protPtr->command, argv[4]);
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
}
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- UpdateWmProtocols(wmPtr);
+ if (index == OPT_ISABOVE) {
+ result = index1 > index2;
+ } else { /* OPT_ISBELOW */
+ result = index1 < index2;
}
- } else if ((c == 'r') && (strncmp(argv[1], "resizable", length) == 0)) {
- int width, height;
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
+ return TCL_OK;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStateCmd --
+ *
+ * This procedure is invoked to process the "wm state" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " resizable window ?width height?\"",
+static int
+WmStateCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "normal", "iconic", "withdrawn", (char *) NULL };
+ enum options {
+ OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN };
+ int index;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?state?");
+ return TCL_ERROR;
+ }
+ if (objc == 4) {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
(char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
- sprintf(buf, "%d %d",
- (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
- (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
- }
- if ((Tcl_GetBoolean(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetBoolean(interp, argv[4], &height) != TCL_OK)) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- if (width) {
- wmPtr->flags &= ~WM_WIDTH_NOT_RESIZABLE;
- } else {
- wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
- }
- if (height) {
- wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
- } else {
- wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 's') && (strncmp(argv[1], "sizefrom", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " sizefrom window ?user|program?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & USSize) {
- Tcl_SetResult(interp, "user", TCL_STATIC);
- } else if (wmPtr->sizeHintsFlags & PSize) {
- Tcl_SetResult(interp, "program", TCL_STATIC);
+
+ if (index == OPT_NORMAL) {
+ if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) {
+ wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN;
}
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~(USSize|PSize);
- } else {
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'u') && (strncmp(argv[3], "user", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~PSize;
- wmPtr->sizeHintsFlags |= USSize;
- } else if ((c == 'p')
- && (strncmp(argv[3], "program", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~USSize;
- wmPtr->sizeHintsFlags |= PSize;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be program or user", (char *) NULL);
+ (void) TkpWmSetState(winPtr, NormalState);
+ } else if (index == OPT_ICONIC) {
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": override-redirect flag is set",
+ (char *) NULL);
return TCL_ERROR;
}
- }
- wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
- goto updateGeom;
- } else if ((c == 's') && (strncmp(argv[1], "state", length) == 0)
- && (length >= 2)) {
- if ((argc < 3) || (argc > 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " state window ?state?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 4) {
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't change state of ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
- (char *) NULL);
+ if (wmPtr->masterPtr != NULL) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
return TCL_ERROR;
}
-
- c = argv[3][0];
- length = strlen(argv[3]);
-
- if ((c == 'n') && (strncmp(argv[3], "normal", length) == 0)) {
- wmPtr->hints.initial_state = NormalState;
- wmPtr->withdrawn = 0;
- if (wmPtr->flags & WM_NEVER_MAPPED) {
- return TCL_OK;
- }
- UpdateHints(winPtr);
- Tk_MapWindow((Tk_Window) winPtr);
- } else if ((c == 'i')
- && (strncmp(argv[3], "iconic", length) == 0)) {
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
- Tcl_AppendResult(interp, "can't iconify \"",
- winPtr->pathName,
- "\": override-redirect flag is set",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (wmPtr->master != None) {
- Tcl_AppendResult(interp, "can't iconify \"",
- winPtr->pathName,
- "\": it is a transient", (char *) NULL);
- return TCL_ERROR;
- }
- wmPtr->hints.initial_state = IconicState;
- if (wmPtr->flags & WM_NEVER_MAPPED) {
- return TCL_OK;
- }
- if (wmPtr->withdrawn) {
- UpdateHints(winPtr);
- Tk_MapWindow((Tk_Window) winPtr);
- wmPtr->withdrawn = 0;
- } else {
- if (XIconifyWindow(winPtr->display,
- wmPtr->wrapperPtr->window,
- winPtr->screenNum) == 0) {
- Tcl_SetResult(interp, "couldn't send iconify message to window manager", TCL_STATIC);
- return TCL_ERROR;
- }
- WaitForMapNotify(winPtr, 0);
- }
- } else if ((c == 'w')
- && (strncmp(argv[3], "withdrawn", length) == 0)) {
- wmPtr->hints.initial_state = WithdrawnState;
- wmPtr->withdrawn = 1;
- if (wmPtr->flags & WM_NEVER_MAPPED) {
- return TCL_OK;
- }
- if (XWithdrawWindow(winPtr->display, wmPtr->wrapperPtr->window,
- winPtr->screenNum) == 0) {
- Tcl_SetResult(interp,
- "couldn't send withdraw message to window manager",
- TCL_STATIC);
- return TCL_ERROR;
- }
- WaitForMapNotify(winPtr, 0);
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be normal, iconic or withdrawn",
- (char *) NULL);
+ if (TkpWmSetState(winPtr, IconicState) == 0) {
+ Tcl_SetResult(interp,
+ "couldn't send iconify message to window manager",
+ TCL_STATIC);
return TCL_ERROR;
}
- } else {
- if (wmPtr->iconFor != NULL) {
- Tcl_SetResult(interp, "icon", TCL_STATIC);
- } else if (wmPtr->withdrawn) {
- Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
- } else if (Tk_IsMapped((Tk_Window) winPtr)
- || ((wmPtr->flags & WM_NEVER_MAPPED)
- && (wmPtr->hints.initial_state == NormalState))) {
- Tcl_SetResult(interp, "normal", TCL_STATIC);
- } else {
- Tcl_SetResult(interp, "iconic", TCL_STATIC);
+ } else { /* OPT_WITHDRAWN */
+ if (wmPtr->masterPtr != NULL) {
+ wmPtr->flags |= WM_TRANSIENT_WITHDRAWN;
+ }
+ if (TkpWmSetState(winPtr, WithdrawnState) == 0) {
+ Tcl_SetResult(interp,
+ "couldn't send withdraw message to window manager",
+ TCL_STATIC);
+ return TCL_ERROR;
}
}
- } else if ((c == 't') && (strncmp(argv[1], "title", length) == 0)
- && (length >= 2)) {
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " title window ?newTitle?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- Tcl_SetResult(interp,
- ((wmPtr->title != NULL) ? wmPtr->title : winPtr->nameUid),
- TCL_STATIC);
- return TCL_OK;
+ } else {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_SetResult(interp, "icon", TCL_STATIC);
+ } else if (wmPtr->withdrawn) {
+ Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
+ } else if (Tk_IsMapped((Tk_Window) winPtr)
+ || ((wmPtr->flags & WM_NEVER_MAPPED)
+ && (wmPtr->hints.initial_state == NormalState))) {
+ Tcl_SetResult(interp, "normal", TCL_STATIC);
} else {
- if (wmPtr->title != NULL) {
- ckfree((char *) wmPtr->title);
- }
- wmPtr->title = ckalloc((unsigned) (strlen(argv[3]) + 1));
- strcpy(wmPtr->title, argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XTextProperty textProp;
- Tcl_DString ds;
-
- Tcl_UtfToExternalDString(NULL, wmPtr->title, -1, &ds);
- if (XStringListToTextProperty(&(Tcl_DStringValue(&ds)), 1,
- &textProp) != 0) {
- XSetWMName(winPtr->display, wmPtr->wrapperPtr->window,
- &textProp);
- XFree((char *) textProp.value);
- }
- Tcl_DStringFree(&ds);
- }
+ Tcl_SetResult(interp, "iconic", TCL_STATIC);
}
- } else if ((c == 't') && (strncmp(argv[1], "transient", length) == 0)
- && (length >= 3)) {
- Tk_Window master;
- WmInfo *wmPtr2;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTitleCmd --
+ *
+ * This procedure is invoked to process the "wm title" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " transient window ?master?\"", (char *) NULL);
- return TCL_ERROR;
+static int
+WmTitleCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp, (char *)
+ ((wmPtr->title != NULL) ? wmPtr->title : winPtr->nameUid),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ if (wmPtr->title != NULL) {
+ ckfree((char *) wmPtr->title);
}
- if (argc == 3) {
- if (wmPtr->master != None) {
- Tcl_SetResult(interp, wmPtr->masterWindowName, TCL_STATIC);
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->title = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->title, argv3);
+
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XTextProperty textProp;
+ Tcl_DString ds;
+
+ Tcl_UtfToExternalDString(NULL, wmPtr->title, -1, &ds);
+ if (XStringListToTextProperty(&(Tcl_DStringValue(&ds)), 1,
+ &textProp) != 0) {
+ XSetWMName(winPtr->display, wmPtr->wrapperPtr->window,
+ &textProp);
+ XFree((char *) textProp.value);
}
- return TCL_OK;
+ Tcl_DStringFree(&ds);
}
- if (argv[3][0] == '\0') {
- wmPtr->master = None;
- if (wmPtr->masterWindowName != NULL) {
- ckfree(wmPtr->masterWindowName);
- }
- wmPtr->masterWindowName = NULL;
- } else {
- master = Tk_NameToWindow(interp, argv[3], tkwin);
- if (master == NULL) {
- return TCL_ERROR;
- }
- while (!Tk_IsTopLevel(master)) {
- /*
- * Ensure that the master window is actually a Tk toplevel.
- */
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTransientCmd --
+ *
+ * This procedure is invoked to process the "wm transient" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- master = Tk_Parent(master);
- }
- Tk_MakeWindowExist(master);
- wmPtr2 = ((TkWindow *) master)->wmInfoPtr;
- if (wmPtr2->wrapperPtr == NULL) {
- CreateWrapper(wmPtr2);
- }
- wmPtr->master = Tk_WindowId(wmPtr2->wrapperPtr);
- if (wmPtr->masterWindowName != NULL) {
- ckfree((char *) wmPtr->masterWindowName);
- }
- wmPtr->masterWindowName = ckalloc((unsigned) (strlen(argv[3])+1));
- strcpy(wmPtr->masterWindowName, argv[3]);
+static int
+WmTransientCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ TkWindow *masterPtr = wmPtr->masterPtr;
+ WmInfo *wmPtr2;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?master?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (masterPtr != NULL) {
+ Tcl_SetResult(interp, Tk_PathName(masterPtr), TCL_STATIC);
}
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XSetTransientForHint(winPtr->display, wmPtr->wrapperPtr->window,
- wmPtr->master);
+ return TCL_OK;
+ }
+ if (Tcl_GetString(objv[3])[0] == '\0') {
+ if (masterPtr != NULL) {
+ /*
+ * If we had a master, tell them that we aren't tied
+ * to them anymore
+ */
+
+ masterPtr->wmInfoPtr->numTransients--;
+ Tk_DeleteEventHandler((Tk_Window) masterPtr,
+ StructureNotifyMask,
+ WmWaitMapProc, (ClientData) winPtr);
+
+ /* FIXME: Need a call like Win32's UpdateWrapper() so
+ we can recreate the wrapper and get rid of the
+ transient window decorations. */
}
- } else if ((c == 'w') && (strncmp(argv[1], "withdraw", length) == 0)
- && (length >= 2)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " withdraw window\"", (char *) NULL);
+
+ wmPtr->masterPtr = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3],
+ (Tk_Window *) &masterPtr) != TCL_OK) {
return TCL_ERROR;
}
+ while (!Tk_TopWinHierarchy(masterPtr)) {
+ /*
+ * Ensure that the master window is actually a Tk toplevel.
+ */
+
+ masterPtr = masterPtr->parentPtr;
+ }
+ Tk_MakeWindowExist((Tk_Window) masterPtr);
+
if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't withdraw ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[2]),
+ "\" a transient: it is an icon for ",
+ Tk_PathName(wmPtr->iconFor),
(char *) NULL);
return TCL_ERROR;
}
- wmPtr->hints.initial_state = WithdrawnState;
- wmPtr->withdrawn = 1;
- if (wmPtr->flags & WM_NEVER_MAPPED) {
- return TCL_OK;
+
+ wmPtr2 = masterPtr->wmInfoPtr;
+ if (wmPtr2->wrapperPtr == NULL) {
+ CreateWrapper(wmPtr2);
}
- if (XWithdrawWindow(winPtr->display, wmPtr->wrapperPtr->window,
- winPtr->screenNum) == 0) {
- Tcl_SetResult(interp,
- "couldn't send withdraw message to window manager",
- TCL_STATIC);
+
+ if (wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[3]),
+ "\" a master: it is an icon for ",
+ Tk_PathName(wmPtr2->iconFor),
+ (char *) NULL);
return TCL_ERROR;
}
- WaitForMapNotify(winPtr, 0);
- } else {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
- "\": must be aspect, client, command, deiconify, ",
- "focusmodel, frame, geometry, grid, group, iconbitmap, ",
- "iconify, iconmask, iconname, iconposition, ",
- "iconwindow, maxsize, minsize, overrideredirect, ",
- "positionfrom, protocol, resizable, sizefrom, state, title, ",
- "transient, or withdraw",
+
+ if (masterPtr == winPtr) {
+ Tcl_AppendResult(interp, "can't make \"", Tk_PathName(winPtr),
+ "\" its own master",
+ (char *) NULL);
+ return TCL_ERROR;
+ } else if (masterPtr != wmPtr->masterPtr) {
+ /*
+ * Remove old master map/unmap binding before setting
+ * the new master. The event handler will ensure that
+ * transient states reflect the state of the master.
+ */
+
+ if (wmPtr->masterPtr != NULL) {
+ wmPtr->masterPtr->wmInfoPtr->numTransients--;
+ Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
+ StructureNotifyMask,
+ WmWaitMapProc, (ClientData) winPtr);
+ }
+
+ masterPtr->wmInfoPtr->numTransients++;
+ Tk_CreateEventHandler((Tk_Window) masterPtr,
+ StructureNotifyMask,
+ WmWaitMapProc, (ClientData) winPtr);
+
+ wmPtr->masterPtr = masterPtr;
+ }
+ }
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ if (wmPtr->masterPtr != NULL && !Tk_IsMapped(wmPtr->masterPtr)) {
+ if (TkpWmSetState(winPtr, WithdrawnState) == 0) {
+ Tcl_SetResult(interp,
+ "couldn't send withdraw message to window manager",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
+ } else {
+ Window xwin = (wmPtr->masterPtr == NULL) ? None :
+ wmPtr->masterPtr->wmInfoPtr->wrapperPtr->window;
+ XSetTransientForHint(winPtr->display, wmPtr->wrapperPtr->window,
+ xwin);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmWithdrawCmd --
+ *
+ * This procedure is invoked to process the "wm withdraw" 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
+WmWithdrawCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't withdraw ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
(char *) NULL);
return TCL_ERROR;
}
+ if (wmPtr->masterPtr != NULL) {
+ wmPtr->flags |= WM_TRANSIENT_WITHDRAWN;
+ }
+ if (TkpWmSetState(winPtr, WithdrawnState) == 0) {
+ Tcl_SetResult(interp,
+ "couldn't send withdraw message to window manager",
+ TCL_STATIC);
+ return TCL_ERROR;
+ }
return TCL_OK;
+}
- updateGeom:
+/*
+ * Invoked by those wm subcommands that affect geometry.
+ * Schedules a geometry update.
+ */
+static void
+WmUpdateGeom(wmPtr, winPtr)
+ WmInfo *wmPtr;
+ TkWindow *winPtr;
+{
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
- return TCL_OK;
+}
+
+/*
+ * Invoked when a MapNotify or UnmapNotify event is delivered for a
+ * toplevel that is the master of a transient toplevel.
+ */
+static void
+WmWaitMapProc(clientData, eventPtr)
+ ClientData clientData; /* Pointer to window. */
+ XEvent *eventPtr; /* Information about event. */
+{
+ TkWindow *winPtr = (TkWindow *) clientData;
+ TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr;
+
+ if (masterPtr == NULL)
+ return;
+
+ if (eventPtr->type == MapNotify) {
+ if (!(winPtr->wmInfoPtr->flags & WM_TRANSIENT_WITHDRAWN))
+ (void) TkpWmSetState(winPtr, NormalState);
+ } else if (eventPtr->type == UnmapNotify) {
+ (void) TkpWmSetState(winPtr, WithdrawnState);
+ }
}
/*
@@ -2011,7 +3225,7 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
if (winPtr == NULL) {
/*
@@ -2022,6 +3236,9 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
}
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
if ((wmPtr->gridWin != NULL) && (wmPtr->gridWin != tkwin)) {
return;
@@ -2032,7 +3249,7 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
&& (wmPtr->widthInc == widthInc)
&& (wmPtr->heightInc == heightInc)
&& ((wmPtr->sizeHintsFlags & (PBaseSize|PResizeInc))
- == (PBaseSize|PResizeInc) )) {
+ == (PBaseSize|PResizeInc))) {
return;
}
@@ -2053,7 +3270,7 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
wmPtr->height = -1;
}
- /*
+ /*
* Set the new gridding information, and start the process of passing
* all of this information to the window manager.
*/
@@ -2103,7 +3320,7 @@ Tk_UnsetGrid(tkwin)
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
if (winPtr == NULL) {
/*
@@ -2114,6 +3331,10 @@ Tk_UnsetGrid(tkwin)
}
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
+
if (tkwin != wmPtr->gridWin) {
return;
}
@@ -2165,7 +3386,7 @@ ConfigureEvent(wmPtr, configEventPtr)
TkDisplay *dispPtr = wmPtr->winPtr->dispPtr;
Tk_ErrorHandler handler;
- /*
+ /*
* Update size information from the event. There are a couple of
* tricky points here:
*
@@ -2181,7 +3402,7 @@ ConfigureEvent(wmPtr, configEventPtr)
if (((wrapperPtr->changes.width != configEventPtr->width)
|| (wrapperPtr->changes.height != configEventPtr->height))
&& !(wmPtr->flags & WM_SYNC_PENDING)){
- if (dispPtr->wmTracing) {
+ if (dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("TopLevelEventProc: user changed %s size to %dx%d\n",
winPtr->pathName, configEventPtr->width,
configEventPtr->height);
@@ -2245,12 +3466,13 @@ ConfigureEvent(wmPtr, configEventPtr)
wmPtr->configHeight = configEventPtr->height;
}
- if (dispPtr->wmTracing) {
- printf("ConfigureEvent: %s x = %d y = %d, width = %d, height = %d",
+ if (dispPtr->flags & TK_DISPLAY_WM_TRACING) {
+ printf("ConfigureEvent: %s x = %d y = %d, width = %d, height = %d\n",
winPtr->pathName, configEventPtr->x, configEventPtr->y,
configEventPtr->width, configEventPtr->height);
- printf(" send_event = %d, serial = %ld\n", configEventPtr->send_event,
- configEventPtr->serial);
+ printf(" send_event = %d, serial = %ld (win %p, wrapper %p)\n",
+ configEventPtr->send_event, configEventPtr->serial,
+ winPtr, wrapperPtr);
}
wrapperPtr->changes.width = configEventPtr->width;
wrapperPtr->changes.height = configEventPtr->height;
@@ -2274,6 +3496,12 @@ ConfigureEvent(wmPtr, configEventPtr)
* there is a parent shrink-wrapped around the window.
*/
+ if (dispPtr->flags & TK_DISPLAY_WM_TRACING) {
+ printf(" %s parent == %p, above %p\n",
+ winPtr->pathName, (void *) wmPtr->reparent,
+ (void *) configEventPtr->above);
+ }
+
if ((wmPtr->reparent == None) || !ComputeReparentGeometry(wmPtr)) {
wmPtr->parentWidth = configEventPtr->width
+ 2*configEventPtr->border_width;
@@ -2377,7 +3605,7 @@ ReparentEvent(wmPtr, reparentEventPtr)
&& (actualType == XA_WINDOW))) {
if ((actualFormat == 32) && (numItems == 1)) {
vRoot = wmPtr->vRoot = *virtualRootPtr;
- } else if (dispPtr->wmTracing) {
+ } else if (dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("%s format %d numItems %ld\n",
"ReparentEvent got bogus VROOT property:", actualFormat,
numItems);
@@ -2386,9 +3614,9 @@ ReparentEvent(wmPtr, reparentEventPtr)
}
Tk_DeleteErrorHandler(handler);
- if (dispPtr->wmTracing) {
- printf("ReparentEvent: %s reparented to 0x%x, vRoot = 0x%x\n",
- wmPtr->winPtr->pathName,
+ if (dispPtr->flags & TK_DISPLAY_WM_TRACING) {
+ printf("ReparentEvent: %s (%p) reparented to 0x%x, vRoot = 0x%x\n",
+ wmPtr->winPtr->pathName, wmPtr->winPtr,
(unsigned int) reparentEventPtr->parent, (unsigned int) vRoot);
}
@@ -2411,6 +3639,8 @@ ReparentEvent(wmPtr, reparentEventPtr)
wmPtr->xInParent = wmPtr->yInParent = 0;
wrapperPtr->changes.x = reparentEventPtr->x;
wrapperPtr->changes.y = reparentEventPtr->y;
+ wmPtr->winPtr->changes.x = reparentEventPtr->x;
+ wmPtr->winPtr->changes.y = reparentEventPtr->y + wmPtr->menuHeight;
return;
}
@@ -2428,8 +3658,8 @@ ReparentEvent(wmPtr, reparentEventPtr)
(Tk_ErrorProc *) NULL, (ClientData) NULL);
wmPtr->reparent = reparentEventPtr->parent;
while (1) {
- if (XQueryTree(wrapperPtr->display, wmPtr->reparent, &dummy2, &ancestor,
- &children, &dummy) == 0) {
+ if (XQueryTree(wrapperPtr->display, wmPtr->reparent, &dummy2,
+ &ancestor, &children, &dummy) == 0) {
Tk_DeleteErrorHandler(handler);
goto noReparent;
}
@@ -2536,8 +3766,8 @@ ComputeReparentGeometry(wmPtr)
*/
if (!(wmPtr->flags & WM_MOVE_PENDING)
- && ((wmPtr->wrapperPtr->changes.x != (x + wmPtr->xInParent))
- || (wmPtr->wrapperPtr->changes.y != (y + wmPtr->yInParent)))) {
+ && ((wrapperPtr->changes.x != (x + wmPtr->xInParent))
+ || (wrapperPtr->changes.y != (y + wmPtr->yInParent)))) {
wmPtr->x = x;
if (wmPtr->flags & WM_NEGATIVE_X) {
wmPtr->x = wmPtr->vRootWidth - (wmPtr->x + wmPtr->parentWidth);
@@ -2548,12 +3778,13 @@ ComputeReparentGeometry(wmPtr)
}
}
- wmPtr->wrapperPtr->changes.x = x + wmPtr->xInParent;
- wmPtr->wrapperPtr->changes.y = y + wmPtr->yInParent;
- if (dispPtr->wmTracing) {
- printf("wrapperPtr coords %d,%d, wmPtr coords %d,%d, offsets %d %d\n",
- wrapperPtr->changes.x, wrapperPtr->changes.y,
- wmPtr->x, wmPtr->y, wmPtr->xInParent, wmPtr->yInParent);
+ wrapperPtr->changes.x = x + wmPtr->xInParent;
+ wrapperPtr->changes.y = y + wmPtr->yInParent;
+ if (dispPtr->flags & TK_DISPLAY_WM_TRACING) {
+ printf("wrapperPtr %p coords %d,%d\n",
+ wrapperPtr, wrapperPtr->changes.x, wrapperPtr->changes.y);
+ printf(" wmPtr %p coords %d,%d, offsets %d %d\n",
+ wmPtr, wmPtr->x, wmPtr->y, wmPtr->xInParent, wmPtr->yInParent);
}
return 1;
}
@@ -2597,13 +3828,13 @@ WrapperEventProc(clientData, eventPtr)
* Tk_DestroyWindow will try to destroy the window, but of course
* it's already gone.
*/
-
+
handler = Tk_CreateErrorHandler(wmPtr->winPtr->display, -1, -1, -1,
(Tk_ErrorProc *) NULL, (ClientData) NULL);
Tk_DestroyWindow((Tk_Window) wmPtr->winPtr);
Tk_DeleteErrorHandler(handler);
}
- if (dispPtr->wmTracing) {
+ if (dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("TopLevelEventProc: %s deleted\n", wmPtr->winPtr->pathName);
}
} else if (eventPtr->type == ConfigureNotify) {
@@ -2851,7 +4082,8 @@ UpdateGeometryInfo(clientData)
serial = NextRequest(winPtr->display);
height += wmPtr->menuHeight;
if (wmPtr->flags & WM_MOVE_PENDING) {
- if ((x == winPtr->changes.x) && (y == winPtr->changes.y)
+ if ((x + wmPtr->xInParent == winPtr->changes.x) &&
+ (y + wmPtr->yInParent + wmPtr->menuHeight == winPtr->changes.y)
&& (width == wmPtr->wrapperPtr->changes.width)
&& (height == wmPtr->wrapperPtr->changes.height)) {
/*
@@ -2866,7 +4098,7 @@ UpdateGeometryInfo(clientData)
}
wmPtr->configWidth = width;
wmPtr->configHeight = height;
- if (winPtr->dispPtr->wmTracing) {
+ if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("UpdateGeometryInfo moving to %d %d, resizing to %d x %d,\n",
x, y, width, height);
}
@@ -2887,8 +4119,9 @@ UpdateGeometryInfo(clientData)
}
wmPtr->configWidth = width;
wmPtr->configHeight = height;
- if (winPtr->dispPtr->wmTracing) {
- printf("UpdateGeometryInfo resizing to %d x %d\n", width, height);
+ if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
+ printf("UpdateGeometryInfo resizing %p to %d x %d\n",
+ (void *)wmPtr->wrapperPtr->window, width, height);
}
XResizeWindow(winPtr->display, wmPtr->wrapperPtr->window,
(unsigned) width, (unsigned) height);
@@ -2899,7 +4132,7 @@ UpdateGeometryInfo(clientData)
* It is possible that the window's overall size has not changed
* but the menu size has.
*/
-
+
Tk_MoveResizeWindow(wmPtr->menubar, 0, 0,
wmPtr->wrapperPtr->changes.width, wmPtr->menuHeight);
XResizeWindow(winPtr->display, wmPtr->wrapperPtr->window,
@@ -3084,11 +4317,10 @@ WaitForConfigureNotify(winPtr, serial)
while (!gotConfig) {
wmPtr->flags |= WM_SYNC_PENDING;
- code = WaitForEvent(winPtr->display, wmPtr->wrapperPtr->window,
- ConfigureNotify, &event);
+ code = WaitForEvent(winPtr->display, wmPtr, ConfigureNotify, &event);
wmPtr->flags &= ~WM_SYNC_PENDING;
if (code != TCL_OK) {
- if (winPtr->dispPtr->wmTracing) {
+ if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("WaitForConfigureNotify giving up on %s\n",
winPtr->pathName);
}
@@ -3100,7 +4332,7 @@ WaitForConfigureNotify(winPtr, serial)
}
}
wmPtr->flags &= ~WM_MOVE_PENDING;
- if (winPtr->dispPtr->wmTracing) {
+ if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("WaitForConfigureNotify finished with %s, serial %ld\n",
winPtr->pathName, serial);
}
@@ -3131,9 +4363,9 @@ WaitForConfigureNotify(winPtr, serial)
*/
static int
-WaitForEvent(display, window, type, eventPtr)
+WaitForEvent(display, wmInfoPtr, type, eventPtr)
Display *display; /* Display event is coming from. */
- Window window; /* Window for which event is desired. */
+ WmInfo *wmInfoPtr; /* Window for which event is desired. */
int type; /* Type of event that is wanted. */
XEvent *eventPtr; /* Place to store event. */
{
@@ -3149,7 +4381,7 @@ WaitForEvent(display, window, type, eventPtr)
*/
info.display = display;
- info.window = window;
+ info.wmInfoPtr = wmInfoPtr;
info.type = type;
info.eventPtr = eventPtr;
info.foundEvent = 0;
@@ -3203,7 +4435,8 @@ WaitRestrictProc(clientData, eventPtr)
if (eventPtr->type == ReparentNotify) {
return TK_PROCESS_EVENT;
}
- if ((eventPtr->xany.window != infoPtr->window)
+ if (((eventPtr->xany.window != infoPtr->wmInfoPtr->wrapperPtr->window)
+ && (eventPtr->xany.window != infoPtr->wmInfoPtr->reparent))
|| (eventPtr->xany.display != infoPtr->display)) {
return TK_DEFER_EVENT;
}
@@ -3265,7 +4498,7 @@ WaitForMapNotify(winPtr, mapped)
break;
}
wmPtr->flags |= WM_SYNC_PENDING;
- code = WaitForEvent(winPtr->display, wmPtr->wrapperPtr->window,
+ code = WaitForEvent(winPtr->display, wmPtr,
mapped ? MapNotify : UnmapNotify, &event);
wmPtr->flags &= ~WM_SYNC_PENDING;
if (code != TCL_OK) {
@@ -3276,15 +4509,16 @@ WaitForMapNotify(winPtr, mapped)
* just quit.
*/
- if (winPtr->dispPtr->wmTracing) {
+ if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("WaitForMapNotify giving up on %s\n", winPtr->pathName);
}
break;
}
}
wmPtr->flags &= ~WM_MOVE_PENDING;
- if (winPtr->dispPtr->wmTracing) {
- printf("WaitForMapNotify finished with %s\n", winPtr->pathName);
+ if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
+ printf("WaitForMapNotify finished with %s (winPtr %p, wmPtr %p)\n",
+ winPtr->pathName, winPtr, wmPtr);
}
}
@@ -3525,7 +4759,7 @@ Tk_GetRootCoords(tkwin, xPtr, yPtr)
if (root == None) {
root = RootWindowOfScreen(Tk_Screen((Tk_Window)winPtr));
}
- XTranslateCoordinates(winPtr->display, winPtr->window,
+ XTranslateCoordinates(winPtr->display, winPtr->window,
root, 0, 0, &rootX, &rootY, &dummyChild);
x += rootX;
y += rootY;
@@ -3638,7 +4872,7 @@ Tk_CoordsToWindow(rootX, rootY, tkwin)
Tk_DeleteErrorHandler(handler);
return NULL;
}
- for (wmPtr = (WmInfo *) dispPtr->firstWmPtr; wmPtr != NULL;
+ for (wmPtr = (WmInfo *) dispPtr->firstWmPtr; wmPtr != NULL;
wmPtr = wmPtr->nextPtr) {
if (wmPtr->reparent == child) {
goto gotToplevel;
@@ -3708,7 +4942,7 @@ Tk_CoordsToWindow(rootX, rootY, tkwin)
nextPtr = NULL;
for (childPtr = winPtr->childList; childPtr != NULL;
childPtr = childPtr->nextPtr) {
- if (!Tk_IsMapped(childPtr) || (childPtr->flags & TK_TOP_LEVEL)) {
+ if (!Tk_IsMapped(childPtr) || (childPtr->flags & TK_TOP_HIERARCHY)) {
continue;
}
if (childPtr->flags & TK_REPARENTED) {
@@ -3804,7 +5038,7 @@ UpdateVRootGeometry(wmPtr)
(unsigned int *) &wmPtr->vRootWidth,
(unsigned int *) &wmPtr->vRootHeight, (unsigned int *) &bd,
&dummy);
- if (winPtr->dispPtr->wmTracing) {
+ if (winPtr->dispPtr->flags & TK_DISPLAY_WM_TRACING) {
printf("UpdateVRootGeometry: x = %d, y = %d, width = %d, ",
wmPtr->vRootX, wmPtr->vRootY, wmPtr->vRootWidth);
printf("height = %d, status = %d\n", wmPtr->vRootHeight, status);
@@ -3858,10 +5092,18 @@ Tk_GetVRootGeometry(tkwin, xPtr, yPtr, widthPtr, heightPtr)
* information for that window.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL) && (winPtr->parentPtr != NULL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY) && (winPtr->parentPtr != NULL)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ /* Punt. */
+ *xPtr = 0;
+ *yPtr = 0;
+ *widthPtr = 0;
+ *heightPtr = 0;
+ }
+
/*
* Make sure that the geometry information is up-to-date, then copy
@@ -4019,7 +5261,7 @@ TkWmProtocolEventProc(winPtr, eventPtr)
register ProtocolHandler *protPtr;
Atom protocol;
int result;
- char *protocolName;
+ CONST char *protocolName;
Tcl_Interp *interp;
wmPtr = winPtr->wmInfoPtr;
@@ -4070,6 +5312,139 @@ TkWmProtocolEventProc(winPtr, eventPtr)
/*
*----------------------------------------------------------------------
*
+ * TkWmStackorderToplevelWrapperMap --
+ *
+ * This procedure will create a table that maps the reparent wrapper
+ * X id for a toplevel to the TkWindow structure that is wraps.
+ * Tk keeps track of a mapping from the window X id to the TkWindow
+ * structure but that does us no good here since we only get the X
+ * id of the wrapper window. Only those toplevel windows that are
+ * mapped have a position in the stacking order.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Adds entries to the passed hashtable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+TkWmStackorderToplevelWrapperMap(winPtr, table)
+ TkWindow *winPtr; /* TkWindow to recurse on */
+ Tcl_HashTable *table; /* Maps X id to TkWindow */
+{
+ TkWindow *childPtr;
+ Tcl_HashEntry *hPtr;
+ Window wrapper;
+ int newEntry;
+
+ if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) &&
+ !Tk_IsEmbedded(winPtr)) {
+ wrapper = (winPtr->wmInfoPtr->reparent != None)
+ ? winPtr->wmInfoPtr->reparent
+ : winPtr->wmInfoPtr->wrapperPtr->window;
+
+ hPtr = Tcl_CreateHashEntry(table,
+ (char *) wrapper, &newEntry);
+ Tcl_SetHashValue(hPtr, winPtr);
+ }
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ TkWmStackorderToplevelWrapperMap(childPtr, table);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmStackorderToplevel --
+ *
+ * This procedure returns the stack order of toplevel windows.
+ *
+ * Results:
+ * An array of pointers to tk window objects in stacking order
+ * or else NULL if there was an error.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow **
+TkWmStackorderToplevel(parentPtr)
+ TkWindow *parentPtr; /* Parent toplevel window. */
+{
+ Window dummy1, dummy2, vRoot;
+ Window *children;
+ unsigned int numChildren, i;
+ TkWindow *childWinPtr, **windows, **window_ptr;
+ Tcl_HashTable table;
+ Tcl_HashEntry *hPtr;
+ Tcl_HashSearch search;
+
+ /*
+ * Map X Window ids to a TkWindow of the wrapped toplevel.
+ */
+
+ Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
+ TkWmStackorderToplevelWrapperMap(parentPtr, &table);
+
+ window_ptr = windows = (TkWindow **) ckalloc((table.numEntries+1)
+ * sizeof(TkWindow *));
+
+ /*
+ * Special cases: If zero or one toplevels were mapped
+ * there is no need to call XQueryTree.
+ */
+
+ switch (table.numEntries) {
+ case 0:
+ windows[0] = NULL;
+ goto done;
+ case 1:
+ hPtr = Tcl_FirstHashEntry(&table, &search);
+ windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr);
+ windows[1] = NULL;
+ goto done;
+ }
+
+ vRoot = parentPtr->wmInfoPtr->vRoot;
+ if (vRoot == None) {
+ vRoot = RootWindowOfScreen(Tk_Screen((Tk_Window) parentPtr));
+ }
+
+ if (XQueryTree(parentPtr->display, vRoot, &dummy1, &dummy2,
+ &children, &numChildren) == 0) {
+ ckfree((char *) windows);
+ windows = NULL;
+ } else {
+ for (i = 0; i < numChildren; i++) {
+ hPtr = Tcl_FindHashEntry(&table, (char *) children[i]);
+ if (hPtr != NULL) {
+ childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
+ *window_ptr++ = childWinPtr;
+ }
+ }
+ if ((window_ptr - windows) != table.numEntries)
+ panic("num matched toplevel windows does not equal num children");
+ *window_ptr = NULL;
+ if (numChildren) {
+ XFree((char *) children);
+ }
+ }
+
+ done:
+ Tcl_DeleteHashTable(&table);
+ return windows;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkWmRestackToplevel --
*
* This procedure restacks a top-level window.
@@ -4079,8 +5454,6 @@ TkWmProtocolEventProc(winPtr, eventPtr)
*
* Side effects:
* WinPtr gets restacked as specified by aboveBelow and otherPtr.
- * This procedure doesn't return until the restack has taken
- * effect and the ConfigureNotify event for it has been received.
*
*----------------------------------------------------------------------
*/
@@ -4095,192 +5468,45 @@ TkWmRestackToplevel(winPtr, aboveBelow, otherPtr)
* above or below *all* siblings. */
{
XWindowChanges changes;
- XWindowAttributes atts;
unsigned int mask;
- Window window, dummy1, dummy2, vRoot;
- Window *children;
- unsigned int numChildren;
- int i;
- int desiredIndex = 0; /* Initialized to stop gcc warnings. */
- int ourIndex = 0; /* Initialized to stop gcc warnings. */
- unsigned long serial;
- XEvent event;
- int diff;
- Tk_ErrorHandler handler;
TkWindow *wrapperPtr;
+ memset(&changes, 0, sizeof(XWindowChanges));
changes.stack_mode = aboveBelow;
- changes.sibling = None;
mask = CWStackMode;
- if (winPtr->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
- }
- if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
- /*
- * Can't set stacking order properly until the window is on the
- * screen (mapping it may give it a reparent window), so make sure
- * it's on the screen.
- */
-
- TkWmMapWindow(winPtr);
- }
- wrapperPtr = winPtr->wmInfoPtr->wrapperPtr;
- window = (winPtr->wmInfoPtr->reparent != None)
- ? winPtr->wmInfoPtr->reparent : wrapperPtr->window;
- if (otherPtr != NULL) {
- if (otherPtr->window == None) {
- Tk_MakeWindowExist((Tk_Window) otherPtr);
- }
- if (otherPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
- TkWmMapWindow(otherPtr);
- }
- changes.sibling = (otherPtr->wmInfoPtr->reparent != None)
- ? otherPtr->wmInfoPtr->reparent
- : otherPtr->wmInfoPtr->wrapperPtr->window;
- mask = CWStackMode|CWSibling;
- }
/*
- * Before actually reconfiguring the window, see if it's already
- * in the right place. If so then don't reconfigure it. The
- * reason for this extra work is that some window managers will
- * ignore the reconfigure request if the window is already in
- * the right place, causing a long delay in WaitForConfigureNotify
- * while it times out. Special note: if the window is almost in
- * the right place, and the only windows between it and the right
- * place aren't mapped, then we don't reconfigure it either, for
- * the same reason.
+ * Make sure that winPtr and its wrapper window have been created.
*/
-
- vRoot = winPtr->wmInfoPtr->vRoot;
- if (vRoot == None) {
- vRoot = RootWindowOfScreen(Tk_Screen((Tk_Window) winPtr));
+ if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
+ TkWmMapWindow(winPtr);
}
- if (XQueryTree(winPtr->display, vRoot, &dummy1, &dummy2,
- &children, &numChildren) != 0) {
- /*
- * Find where our window is in the stacking order, and
- * compute the desired location in the stacking order.
- */
-
- for (i = 0; i < numChildren; i++) {
- if (children[i] == window) {
- ourIndex = i;
- }
- if (children[i] == changes.sibling) {
- desiredIndex = i;
- }
- }
- if (mask & CWSibling) {
- if (aboveBelow == Above) {
- if (desiredIndex < ourIndex) {
- desiredIndex += 1;
- }
- } else {
- if (desiredIndex > ourIndex) {
- desiredIndex -= 1;
- }
- }
- } else {
- if (aboveBelow == Above) {
- desiredIndex = numChildren-1;
- } else {
- desiredIndex = 0;
- }
- }
+ wrapperPtr = winPtr->wmInfoPtr->wrapperPtr;
+ if (otherPtr != NULL) {
/*
- * See if there are any mapped windows between where we are
- * and where we want to be.
+ * The window is to be restacked with respect to another toplevel.
+ * Make sure it has been created as well.
*/
-
- handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
- (Tk_ErrorProc *) NULL, (ClientData) NULL);
- while (desiredIndex != ourIndex) {
- if ((XGetWindowAttributes(winPtr->display, children[desiredIndex],
- &atts) != 0) && (atts.map_state != IsUnmapped)) {
- break;
- }
- if (desiredIndex < ourIndex) {
- desiredIndex++;
- } else {
- desiredIndex--;
- }
- }
- Tk_DeleteErrorHandler(handler);
- XFree((char *) children);
- if (ourIndex == desiredIndex) {
- return;
+ if (otherPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
+ TkWmMapWindow(otherPtr);
}
+ changes.sibling = otherPtr->wmInfoPtr->wrapperPtr->window;
+ mask |= CWSibling;
}
/*
- * Reconfigure the window. This tricky because of two things:
- * (a) Some window managers, like olvwm, insist that we raise
- * or lower the toplevel window itself, as opposed to its
- * decorative frame. Attempts to raise or lower the frame
- * are ignored.
- * (b) If the raise or lower is relative to a sibling, X will
- * generate an error unless we work with the frames (the
- * toplevels themselves aren't siblings).
- * Fortunately, the procedure XReconfigureWMWindow is supposed
- * to handle all of this stuff, so be careful to use it instead
- * of XConfigureWindow.
+ * Reconfigure the window. Note that we use XReconfigureWMWindow
+ * instead of XConfigureWindow, in order to handle the case
+ * where the window is to be restacked with respect to another toplevel.
+ * See [ICCCM] 4.1.5 "Configuring the Window" and XReconfigureWMWindow(3)
+ * for details.
*/
- serial = NextRequest(winPtr->display);
- if (window != wrapperPtr->window) {
- /*
- * We're going to have to wait for events on a window that
- * Tk doesn't own, so we have to tell X specially that we
- * want to get events on that window. To make matters worse,
- * it's possible that the window doesn't exist anymore (e.g.
- * the toplevel could have been withdrawn) so ignore events
- * occurring during the request.
- */
-
- handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
- (Tk_ErrorProc *) NULL, (ClientData) NULL);
- XSelectInput(winPtr->display, window, StructureNotifyMask);
- Tk_DeleteErrorHandler(handler);
- }
XReconfigureWMWindow(winPtr->display, wrapperPtr->window,
Tk_ScreenNumber((Tk_Window) winPtr), mask, &changes);
-
- /*
- * Wait for the reconfiguration to complete. If we don't wait, then
- * the window may not restack for a while and the application might
- * observe it before it has restacked. Waiting for the reconfiguration
- * is tricky if winPtr has been reparented, since the window getting
- * the event isn't one that Tk owns.
- */
-
- if (window == wrapperPtr->window) {
- WaitForConfigureNotify(winPtr, serial);
- } else {
- while (1) {
- if (WaitForEvent(winPtr->display, window, ConfigureNotify,
- &event) != TCL_OK) {
- break;
- }
- diff = event.xconfigure.serial - serial;
- if (diff >= 0) {
- break;
- }
- }
-
- /*
- * Ignore errors that occur when we are de-selecting events on
- * window, since it's possible that the window doesn't exist
- * anymore (see comment above previous call to XSelectInput).
- */
-
- handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
- (Tk_ErrorProc *) NULL, (ClientData) NULL);
- XSelectInput(winPtr->display, window, (long) 0);
- Tk_DeleteErrorHandler(handler);
- }
}
+
/*
*----------------------------------------------------------------------
@@ -4327,10 +5553,14 @@ TkWmAddToColormapWindows(winPtr)
return;
}
- if (topPtr->flags & TK_TOP_LEVEL) {
+ if (topPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
if (topPtr->wmInfoPtr->flags & WM_COLORMAPS_EXPLICIT) {
return;
}
@@ -4427,7 +5657,7 @@ TkWmRemoveFromColormapWindows(winPtr)
return;
}
- if (topPtr->flags & TK_TOP_LEVEL) {
+ if (topPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
@@ -4439,6 +5669,10 @@ TkWmRemoveFromColormapWindows(winPtr)
return;
}
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
if (topPtr->wmInfoPtr->wrapperPtr == NULL) {
CreateWrapper(topPtr->wmInfoPtr);
}
@@ -4614,7 +5848,7 @@ TkpMakeMenuWindow(tkwin, transient)
XSetWindowAttributes atts;
TkWindow *wrapperPtr;
- if (!Tk_IsTopLevel(tkwin)) {
+ if (!Tk_HasWrapper(tkwin)) {
return;
}
wmPtr = ((TkWindow *) tkwin)->wmInfoPtr;
@@ -4724,9 +5958,6 @@ CreateWrapper(wmPtr)
wrapperPtr->mainPtr->refCount++;
wrapperPtr->dirtyAtts = 0;
wrapperPtr->dirtyChanges = 0;
-#ifdef TK_USE_INPUT_METHODS
- wrapperPtr->inputContext = NULL;
-#endif /* TK_USE_INPUT_METHODS */
wrapperPtr->wmInfoPtr = wmPtr;
/*
@@ -5038,3 +6269,68 @@ UpdateCommand(winPtr)
ckfree((char *) cmdArgv);
ckfree((char *) offsets);
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpWmSetState --
+ *
+ * Sets the window manager state for the wrapper window of a
+ * given toplevel window.
+ *
+ * Results:
+ * 0 on error, 1 otherwise
+ *
+ * Side effects:
+ * May minimize, restore, or withdraw a window.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpWmSetState(winPtr, state)
+ TkWindow *winPtr; /* Toplevel window to operate on. */
+ int state; /* One of IconicState, NormalState,
+ * or WithdrawnState. */
+{
+ WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (state == WithdrawnState) {
+ wmPtr->hints.initial_state = WithdrawnState;
+ wmPtr->withdrawn = 1;
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ return 1;
+ }
+ if (XWithdrawWindow(winPtr->display, wmPtr->wrapperPtr->window,
+ winPtr->screenNum) == 0) {
+ return 0;
+ }
+ WaitForMapNotify(winPtr, 0);
+ } else if (state == NormalState) {
+ wmPtr->hints.initial_state = NormalState;
+ wmPtr->withdrawn = 0;
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ return 1;
+ }
+ UpdateHints(winPtr);
+ Tk_MapWindow((Tk_Window) winPtr);
+ } else if (state == IconicState) {
+ wmPtr->hints.initial_state = IconicState;
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ return 1;
+ }
+ if (wmPtr->withdrawn) {
+ UpdateHints(winPtr);
+ Tk_MapWindow((Tk_Window) winPtr);
+ wmPtr->withdrawn = 0;
+ } else {
+ if (XIconifyWindow(winPtr->display, wmPtr->wrapperPtr->window,
+ winPtr->screenNum) == 0) {
+ return 0;
+ }
+ WaitForMapNotify(winPtr, 0);
+ }
+ }
+
+ return 1;
+}
diff --git a/tk/unix/tkUnixXId.c b/tk/unix/tkUnixXId.c
index 134e47dfaff..64fb9250c2d 100644
--- a/tk/unix/tkUnixXId.c
+++ b/tk/unix/tkUnixXId.c
@@ -84,7 +84,50 @@ TkInitXId(dispPtr)
dispPtr->display->resource_alloc;
dispPtr->display->resource_alloc = AllocXId;
dispPtr->windowStackPtr = NULL;
- dispPtr->idCleanupScheduled = 0;
+ dispPtr->idCleanupScheduled = (Tcl_TimerToken) 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkFreeXId --
+ *
+ * This procedure is called to free resources for the id allocator
+ * for a given display.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Frees the id and window stack pools.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TkFreeXId(dispPtr)
+ TkDisplay *dispPtr; /* Tk's information about the
+ * display. */
+{
+ TkIdStack *stackPtr, *freePtr;
+
+ if (dispPtr->idCleanupScheduled) {
+ Tcl_DeleteTimerHandler(dispPtr->idCleanupScheduled);
+ }
+
+ for (stackPtr = dispPtr->idStackPtr; stackPtr != NULL; ) {
+ freePtr = stackPtr;
+ stackPtr = stackPtr->nextPtr;
+ ckfree((char *) freePtr);
+ }
+ dispPtr->idStackPtr = NULL;
+
+ for (stackPtr = dispPtr->windowStackPtr; stackPtr != NULL; ) {
+ freePtr = stackPtr;
+ stackPtr = stackPtr->nextPtr;
+ ckfree((char *) freePtr);
+ }
+ dispPtr->windowStackPtr = NULL;
}
/*
@@ -293,8 +336,8 @@ TkFreeWindowId(dispPtr, w)
*/
if (!dispPtr->idCleanupScheduled) {
- dispPtr->idCleanupScheduled = 1;
- Tcl_CreateTimerHandler(100, WindowIdCleanup, (ClientData) dispPtr);
+ dispPtr->idCleanupScheduled =
+ Tcl_CreateTimerHandler(100, WindowIdCleanup, (ClientData) dispPtr);
}
}
@@ -328,7 +371,7 @@ WindowIdCleanup(clientData)
ClientData oldData;
static Tcl_Time timeout = {0, 0};
- dispPtr->idCleanupScheduled = 0;
+ dispPtr->idCleanupScheduled = (Tcl_TimerToken) 0;
/*
* See if it's safe to recycle the window ids. It's safe if:
@@ -375,8 +418,8 @@ WindowIdCleanup(clientData)
*/
tryAgain:
- dispPtr->idCleanupScheduled = 1;
- Tcl_CreateTimerHandler(500, WindowIdCleanup, (ClientData) dispPtr);
+ dispPtr->idCleanupScheduled =
+ Tcl_CreateTimerHandler(500, WindowIdCleanup, (ClientData) dispPtr);
}
/*
@@ -534,4 +577,37 @@ TkpWindowWasRecentlyDeleted(win, dispPtr)
}
return 0;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpScanWindowId --
+ *
+ * Given a string, produce the corresponding Window Id.
+ *
+ * Results:
+ * The return value is normally TCL_OK; in this case *idPtr
+ * will be set to the Window value equivalent to string. If
+ * string is improperly formed then TCL_ERROR is returned and
+ * an error message will be left in the interp's result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpScanWindowId(interp, string, idPtr)
+ Tcl_Interp *interp;
+ CONST char *string;
+ Window *idPtr;
+{
+ int value;
+ if (Tcl_GetInt(interp, string, &value) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ *idPtr = (Window) value;
+ return TCL_OK;
+}
diff --git a/tk/win/Makefile.in b/tk/win/Makefile.in
index 7af644ea916..602265e466d 100644
--- a/tk/win/Makefile.in
+++ b/tk/win/Makefile.in
@@ -39,7 +39,7 @@ INSTALL_ROOT =
# Directory from which applications will reference the library of Tk
# scripts (note: you can set the TK_LIBRARY environment variable at
# run-time to override this value):
-TK_LIBRARY = @datadir@/tk$(VERSION)
+TK_LIBRARY = $(prefix)/lib/tk$(VERSION)
# Path to use at runtime to refer to LIB_INSTALL_DIR:
LIB_RUNTIME_DIR = $(libdir)
@@ -73,6 +73,12 @@ MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann
# Libraries built with optimization switches have this additional extension
TK_DBGX = @TK_DBGX@
+# Directory in which to install the pkgIndex.tcl file for loadable Tk
+PKG_INSTALL_DIR = $(LIB_INSTALL_DIR)/tk$(VERSION)$(TK_DBGX)
+
+# Package index file for loadable Tk
+PKG_INDEX = $(PKG_INSTALL_DIR)/pkgIndex.tcl
+
# The directory containing the Tcl source and header files.
TCL_SRC_DIR = @TCL_SRC_DIR@
@@ -84,13 +90,14 @@ TCL_BIN_DIR = @TCL_BIN_DIR@
# for this version of Tk ("srcdir" will be replaced or has already
# been replaced by the configure script):
TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
+TCL_TOOL_DIR = @TCL_SRC_DIR@/tools
-# This program converts from POSIX to Windows native paths.
+# Converts a POSIX path to a Windows native path.
CYGPATH = @CYGPATH@
# The name of the Tcl library.
-TCL_LIB_SPEC = @TCL_BUILD_LIB_SPEC@
-TCL_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@
+TCL_LIB_FILE = "$(shell $(CYGPATH) '@TCL_BIN_DIR@/@TCL_LIB_FILE@')"
+TCL_STUB_LIB_FILE = "$(shell $(CYGPATH) '@TCL_BIN_DIR@/@TCL_STUB_LIB_FILE@')"
SRC_DIR = @srcdir@
ROOT_DIR = $(SRC_DIR)/..
@@ -108,7 +115,6 @@ BITMAP_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)/bitmaps')
XLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)/xlib')
TCL_GENERIC_NATIVE = $(shell $(CYGPATH) '$(TCL_GENERIC_DIR)')
TCL_SRC_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_SRC_DIR)')
-TCL_BIN_DIR_NATIVE = $(shell $(CYGPATH) '$(TCL_BIN_DIR)')
RC_DIR_NATIVE = $(shell $(CYGPATH) '$(RC_DIR)')
DLLSUFFIX = @DLLSUFFIX@
@@ -122,9 +128,6 @@ TK_DLL_FILE = @TK_DLL_FILE@
SHARED_LIBRARIES = $(TK_DLL_FILE) $(TK_STUB_LIB_FILE)
STATIC_LIBRARIES = $(TK_LIB_FILE)
-WISH_RES = @WISH_RES@
-TK_RES = @TK_RES@
-
WISH = wish$(VER)${EXESUFFIX}
TKTEST = tktest${EXEEXT}
CAT32 = cat32$(EXEEXT)
@@ -164,6 +167,7 @@ RANLIB = @RANLIB@
CC = @CC@
RC = @RC@
RES = @RES@
+TK_RES = @TK_RES@
AC_FLAGS = @EXTRA_CFLAGS@ @DEFS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ @LDFLAGS_DEFAULT@
@@ -171,24 +175,28 @@ LDFLAGS_CONSOLE = @LDFLAGS_CONSOLE@
LDFLAGS_WINDOW = @LDFLAGS_WINDOW@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
-LIBS_GUI = @LIBS_GUI@
STLIB_LD = @STLIB_LD@
SHLIB_LD = @SHLIB_LD@
+SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ $(TCL_STUB_LIB_FILE) $(LIBS)
SHLIB_CFLAGS = @SHLIB_CFLAGS@
-SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ $(TCL_STUB_LIB_SPEC) $(LIBS_GUI)
SHLIB_SUFFIX = @SHLIB_SUFFIX@
VER = @TK_MAJOR_VERSION@@TK_MINOR_VERSION@
DOTVER = @TK_MAJOR_VERSION@.@TK_MINOR_VERSION@
-LIBS = @LIBS@ $(LIBS_GUI)
+LIBS = @LIBS@ @LIBS_GUI@
RMDIR = rm -rf
MKDIR = mkdir -p
SHELL = @SHELL@
RM = rm -f
COPY = cp
-# FIXME: Add a "make shell SCRIPT=foo.tcl" argument
-# so that a shell can easily be run from the build dir.
-TCLSH_PROG = $(TCL_BIN_DIR)/tclsh$(VER)
+TCLSH_PROG = @TCLSH_PROG@
+
+# TCL_EXE is the name of a tclsh executable that is available *BEFORE*
+# running make for the first time. Certain build targets (make genstubs)
+# need it to be available on the PATH. This executable should *NOT* be
+# required just to do a normal build although it can be required to run
+# make dist.
+TCL_EXE = tclsh
CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
-I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \
@@ -213,21 +221,7 @@ INSTALL_DATA = ${INSTALL}
WISH_OBJS = \
winMain.$(OBJEXT)
-TCLTEST_OBJS = \
- ${TCL_BIN_DIR}/tclThreadTest.$(OBJEXT)
-
-TCLTEST_OBJS_NATIVE = \
- "${TCL_BIN_DIR_NATIVE}/tclThreadTest.$(OBJEXT)"
-
TKTEST_OBJS = \
- $(TCLTEST_OBJS) \
- testMain.$(OBJEXT) \
- tkSquare.$(OBJEXT) \
- tkTest.$(OBJEXT) \
- tkWinTest.$(OBJEXT)
-
-TKTEST_OBJS_NATIVE = \
- $(TCLTEST_OBJS_NATIVE) \
testMain.$(OBJEXT) \
tkSquare.$(OBJEXT) \
tkTest.$(OBJEXT) \
@@ -315,6 +309,7 @@ TK_OBJS = \
tkMenubutton.$(OBJEXT) \
tkMenuDraw.$(OBJEXT) \
tkMessage.$(OBJEXT) \
+ tkPanedWindow.$(OBJEXT) \
tkObj.$(OBJEXT) \
tkOldConfig.$(OBJEXT) \
tkOption.$(OBJEXT) \
@@ -325,6 +320,7 @@ TK_OBJS = \
tkScale.$(OBJEXT) \
tkScrollbar.$(OBJEXT) \
tkSelect.$(OBJEXT) \
+ tkStyle.$(OBJEXT) \
tkText.$(OBJEXT) \
tkTextBTree.$(OBJEXT) \
tkTextDisp.$(OBJEXT) \
@@ -334,6 +330,7 @@ TK_OBJS = \
tkTextTag.$(OBJEXT) \
tkTextWind.$(OBJEXT) \
tkTrig.$(OBJEXT) \
+ tkUndo.$(OBJEXT) \
tkUtil.$(OBJEXT) \
tkVisual.$(OBJEXT) \
tkStubInit.$(OBJEXT) \
@@ -360,7 +357,7 @@ binaries: @LIBRARIES@ $(WISH)
libraries:
$(ROOT_DIR)/doc/man.macros:
- $(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(ROOT_DIR)/doc/man.macros
+ $(INSTALL_DATA) "$(TCL_SRC_DIR)/doc/man.macros" "$(ROOT_DIR)/doc/man.macros"
doc: $(ROOT_DIR)/doc/man.macros
@@ -368,7 +365,7 @@ winhelp: $(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl $(MAN2TCL)
TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
PATH="$(PATH):$(TCL_BIN_DIR)"; export PATH; \
- $(TCLSH_PROG) "$(TCL_SRC_DIR_NATIVE)"/tools/man2help.tcl tcl "$(VER)" $(CORE_DOCS)
+ $(TCLSH_PROG) "$(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl" tcl "$(VER)" $(CORE_DOCS)
$(COPY) "$(TCL_BIN_DIR)"/tcl.hpj ./
hcw /c /e tcl.hpj
$(COPY) ./tcl$(VER).cnt ./TCL$(VER).HLP "$(TCL_SRC_DIR_NATIVE)"/tools/
@@ -376,6 +373,10 @@ winhelp: $(TCL_SRC_DIR_NATIVE)/tools/man2help.tcl $(MAN2TCL)
$(MAN2TCL): $(TCL_SRC_DIR_NATIVE)/tools/man2tcl.c
$(CC) $(CFLAGS_OPTIMIZE) $(MAN2TCLFLAGS) -o $(MAN2TCL) "$(TCL_SRC_DIR_NATIVE)"/tools/man2tcl.c
+# Specifying TESTFLAGS on the command line is the standard way to pass
+# args to tcltest, ie:
+# % make test TESTFLAGS="-verbose bps -file fileName.test"
+
test: binaries $(TKTEST)
@TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
@@ -383,16 +384,32 @@ test: binaries $(TKTEST)
./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) \
| ./$(CAT32)
-runtest: tktest
+runtest: binaries $(TKTEST)
@TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
PATH="$(PATH):$(TCL_BIN_DIR)"; export PATH; \
- ./$(TKTEST)
+ ./$(TKTEST) $(TESTFLAGS) $(SCRIPT)
+
+# This target can be used to run wish from the build directory
+# via `make shell` or `make shell SCRIPT=foo.tcl`
+shell: binaries
+ @TCL_LIBRARY="$(TCL_SRC_DIR_NATIVE)/library"; export TCL_LIBRARY; \
+ TK_LIBRARY="$(ROOT_DIR_NATIVE)/library"; export TK_LIBRARY; \
+ PATH="$(PATH):$(TCL_BIN_DIR)"; export PATH; \
+ ./$(WISH) $(SCRIPT)
+
+# This target can be used to run wish inside either gdb or insight
+gdb: binaries
+ @echo "set env TCL_LIBRARY=$(TCL_SRC_DIR_NATIVE)/library" > gdb.run
+ @echo "set env TK_LIBRARY=$(ROOT_DIR_NATIVE)/library" >> gdb.run
+ PATH="$(PATH):$(TCL_BIN_DIR)"; export PATH; \
+ gdb ./$(WISH) --command=gdb.run
+ @$(RM) gdb.run
install: all install-binaries install-libraries install-doc install-demos
-install-binaries:
- @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
+install-binaries: binaries
+ @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) $(PKG_INSTALL_DIR); \
do \
if [ ! -d $$i ] ; then \
echo "Making directory $$i"; \
@@ -401,29 +418,34 @@ install-binaries:
else true; \
fi; \
done;
- @echo "Installing $(TK_LIB_FILE) to $(LIB_INSTALL_DIR)/"
- @$(INSTALL_DATA) $(TK_LIB_FILE) $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
- @echo "Installing $(WISH) as $(BIN_INSTALL_DIR)/wish$(VERSION)"
- @$(INSTALL_PROGRAM) $(WISH) $(BIN_INSTALL_DIR)/$(WISH)
- @echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/"
- @$(INSTALL_DATA) tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh
- @if test "$(DLLSUFFIX)" != "" ; then \
- echo "Installing $(TK_DLL_FILE) to $(LIB_INSTALL_DIR)/" ; \
- $(INSTALL_PROGRAM) $(TK_DLL_FILE) \
- $(BIN_INSTALL_DIR)/$(TK_DLL_FILE) ; \
- fi
- @if test "$(TK_STUB_LIB_FILE)" != "" ; then \
- if [ -f $(TK_STUB_LIB_FILE) ]; then \
- echo "Installing $(TK_STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \
- $(INSTALL_DATA) $(TK_STUB_LIB_FILE) \
- $(LIB_INSTALL_DIR)/$(TK_STUB_LIB_FILE); \
+ @for i in $(TK_DLL_FILE) $(WISH); \
+ do \
+ if [ -f $$i ]; then \
+ echo "Installing $$i to $(BIN_INSTALL_DIR)/"; \
+ $(COPY) $$i "$(BIN_INSTALL_DIR)"; \
+ fi; \
+ done
+ @echo "Creating package index $(PKG_INDEX)";
+ @$(RM) $(PKG_INDEX);
+ @(\
+ echo "if {[package vcompare [package provide Tcl]\
+ $(TCLVERSION)] != 0} { return }";\
+ echo "package ifneeded Tk $(VERSION)\
+ [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\
+ ) > $(PKG_INDEX);
+ @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \
+ do \
+ if [ -f $$i ]; then \
+ echo "Installing $$i to $(LIB_INSTALL_DIR)/"; \
+ $(COPY) $$i "$(LIB_INSTALL_DIR)"; \
fi; \
- fi
+ done
-install-libraries:
+install-libraries: libraries
@for i in $(INSTALL_ROOT)$(prefix)/lib \
$(INCLUDE_INSTALL_DIR) $(INCLUDE_INSTALL_DIR)/X11 \
- $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images; \
+ $(SCRIPT_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)/images \
+ $(SCRIPT_INSTALL_DIR)/msgs; \
do \
if [ ! -d $$i ] ; then \
echo "Making directory $$i"; \
@@ -432,9 +454,9 @@ install-libraries:
else true; \
fi; \
done;
- @echo "Installing header files";
- @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkDecls.h \
- $(GENERIC_DIR)/tkIntXlibDecls.h ; \
+ @echo "Installing header files to $(INCLUDE_INSTALL_DIR)/";
+ @for i in $(GENERIC_DIR)/tk.h $(GENERIC_DIR)/tkPlatDecls.h \
+ $(GENERIC_DIR)/tkIntXlibDecls.h $(GENERIC_DIR)/tkDecls.h ; \
do \
$(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \
done;
@@ -455,6 +477,13 @@ install-libraries:
$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/images; \
fi; \
done;
+ @echo "Installing translation directory";
+ @for i in $(ROOT_DIR)/library/msgs/*.msg; \
+ do \
+ if [ -f $$i ] ; then \
+ $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/msgs; \
+ fi; \
+ done;
install-demos:
@for i in $(INSTALL_ROOT)$(prefix)/lib $(SCRIPT_INSTALL_DIR) \
@@ -488,19 +517,19 @@ install-demos:
fi; \
done;
-install-doc:
+install-doc: doc
-$(WISH): $(TK_LIB_FILE) $(WISH_OBJS) $(WISH_RES)
- $(CC) $(CFLAGS) $(WISH_OBJS) $(TCL_LIB_SPEC) $(TK_LIB_FILE) $(LIBS) \
- $(WISH_RES) $(CC_EXENAME) $(LDFLAGS_WINDOW)
+$(WISH): $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(WISH_OBJS) wish.$(RES)
+ $(CC) $(CFLAGS) $(WISH_OBJS) $(TCL_LIB_FILE) $(TK_LIB_FILE) $(LIBS) \
+ wish.$(RES) $(CC_EXENAME) $(LDFLAGS_WINDOW)
tktest : $(TKTEST)
-$(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) $(WISH_RES) $(CAT32)
- $(CC) $(CFLAGS) $(TKTEST_OBJS_NATIVE) $(TCL_LIB_SPEC) \
+$(TKTEST): $(TK_LIB_FILE) $(TKTEST_OBJS) wish.$(RES) $(CAT32)
+ $(CC) $(CFLAGS) $(TKTEST_OBJS) $(TCL_LIB_FILE) \
$(TK_LIB_FILE) $(LIBS) \
- $(WISH_RES) $(CC_EXENAME) $(LDFLAGS_WINDOW)
+ wish.$(RES) $(CC_EXENAME) $(LDFLAGS_WINDOW)
cat32.${OBJEXT}: $(TCL_SRC_DIR)/win/cat.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
@@ -508,21 +537,6 @@ cat32.${OBJEXT}: $(TCL_SRC_DIR)/win/cat.c
$(CAT32): cat32.${OBJEXT}
$(CC) $(CFLAGS) cat32.$(OBJEXT) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
-# WISH_RES
-$(RC_DIR)/wish_static.rc : $(RC_DIR)/wish.rc $(RC_DIR)/tk_base.rc
- cat $(RC_DIR)/wish.rc $(RC_DIR)/tk_base.rc > $(RC_DIR)/wish_static.rc
-
-wish_static.$(RES) : $(RC_DIR)/wish_static.rc
- $(RC) @RC_OUT@ $@ @RC_TYPE@ @RC_INCLUDE@ "$(GENERIC_DIR_NATIVE)" @RC_INCLUDE@ "$(TCL_GENERIC_NATIVE)" @RC_INCLUDE@ "$(RC_DIR_NATIVE)" @DEPARG@
-
-
-# TK_RES
-$(RC_DIR)/tk_dll.rc : $(RC_DIR)/tk.rc $(RC_DIR)/tk_base.rc
- cat $(RC_DIR)/tk.rc $(RC_DIR)/tk_base.rc > $(RC_DIR)/tk_dll.rc
-
-tk_dll.$(RES) : $(RC_DIR)/tk_dll.rc
- $(RC) @RC_OUT@ $@ @RC_TYPE@ @RC_INCLUDE@ "$(GENERIC_DIR_NATIVE)" @RC_INCLUDE@ "$(TCL_GENERIC_NATIVE)" @RC_INCLUDE@ "$(RC_DIR_NATIVE)" @DEPARG@
-
# The following targets are configured by autoconf to generate either
# a shared library or static library
@@ -535,9 +549,7 @@ ${TK_DLL_FILE}: ${TK_OBJS} $(TK_RES)
@$(RM) ${TK_DLL_FILE}
@MAKE_DLL@ ${TK_OBJS} $(TK_RES) $(SHLIB_LD_LIBS)
-${GNU_TK_LIB_FILE}: ${TK_DLL_FILE}
-
-${MSVC_TK_LIB_FILE}: ${TK_OBJS}
+${TK_LIB_FILE}: ${TK_OBJS}
@$(RM) ${TK_LIB_FILE}
@MAKE_LIB@ ${TK_OBJS}
@POST_MAKE_LIB@
@@ -559,8 +571,6 @@ tkWinTest.$(OBJEXT): tkWinTest.c
tkSquare.$(OBJEXT): tkSquare.c
$(CC) -c $(CC_SWITCHES) @DEPARG@ $(CC_OBJNAME)
-tclThreadTest.$(OBJEXT): $(TCL_BIN_DIR)/tclThreadTest.$(OBJEXT)
-
# Add the object extension to the implicit rules. By default .obj is not
# automatically added.
@@ -574,7 +584,7 @@ tclThreadTest.$(OBJEXT): $(TCL_BIN_DIR)/tclThreadTest.$(OBJEXT)
$(CC) -c $(STUB_CC_SWITCHES) -DBUILD_tk @DEPARG@ $(CC_OBJNAME)
.rc.$(RES):
- $(RC) @RC_OUT@ $@ @RC_TYPE@ @RC_INCLUDE@ "$(GENERIC_DIR_NATIVE)" @RC_INCLUDE@ "$(TCL_GENERIC_NATIVE)" @RC_INCLUDE@ "$(RC_DIR_NATIVE)" @DEPARG@
+ $(RC) @RC_OUT@ $@ @RC_TYPE@ @RC_DEFINES@ @RC_INCLUDE@ "$(GENERIC_DIR_NATIVE)" @RC_INCLUDE@ "$(TCL_GENERIC_NATIVE)" @RC_INCLUDE@ "$(RC_DIR_NATIVE)" @DEPARG@
depend:
@@ -582,7 +592,7 @@ cleanhelp:
$(RM) *.hlp *.cnt *.hpj *.GID *.rtf man2tcl${EXEEXT}
clean: cleanhelp
- $(RM) *.lib *.a *.exp *.dll *.$(RES) *.${OBJEXT} *~ \#* TAGS a.out
+ $(RM) *.lib *.a *.exp *.dll *.res *.${OBJEXT} *~ \#* TAGS a.out
$(RM) $(WISH) $(TKTEST) $(CAT32)
$(RM) *.pch *.ilk *.pdb
@@ -591,3 +601,19 @@ distclean: clean
Makefile: $(SRC_DIR)/Makefile.in
./config.status
+
+#
+# Regenerate the stubs files.
+#
+
+$(GENERIC_DIR)/tkStubInit.c: $(GENERIC_DIR)/tk.decls \
+ $(GENERIC_DIR)/tkInt.decls
+ @echo "Warning: tkStubInit.c may be out of date."
+ @echo "Developers may want to run \"make genstubs\" to regenerate."
+ @echo "This warning can be safely ignored, do not report as a bug!"
+
+genstubs:
+ $(TCL_EXE) "$(TCL_TOOL_DIR}\genStubs.tcl" \
+ "$(GENERIC_DIR_NATIVE)" \
+ "$(GENERIC_DIR_NATIVE)\tk.decls" \
+ "$(GENERIC_DIR_NATIVE)\tkInt.decls"
diff --git a/tk/win/README b/tk/win/README
index fe3790e478b..15cea28f10f 100644
--- a/tk/win/README
+++ b/tk/win/README
@@ -1,8 +1,6 @@
-Tk 8.3 for Windows
+Tk 8.4 for Windows
-by Scott Stanton
-Scriptics Corporation
-scott.stanton@scriptics.com
+Originally by Scott Stanton while at Sun Microsystems Labs
RCS: @(#) $Id$
@@ -22,4 +20,4 @@ locate the necessary Tcl files. Otherwise you may need to
edit makefile.vc and adjust the path to Tcl accordingly.
Information about compiling for windows is maintained at:
- http://dev.scriptics.com/doc/howto/compile.html
+ http://www.tcl.tk/doc/howto/compile.html
diff --git a/tk/win/aclocal.m4 b/tk/win/aclocal.m4
index 005783c4aae..bc7540da6cc 100644
--- a/tk/win/aclocal.m4
+++ b/tk/win/aclocal.m4
@@ -1,2 +1 @@
builtin(include,tcl.m4)
-builtin(include,../cygtcl.m4)
diff --git a/tk/win/buildall.vc.bat b/tk/win/buildall.vc.bat
new file mode 100644
index 00000000000..4b6a820e9b9
--- /dev/null
+++ b/tk/win/buildall.vc.bat
@@ -0,0 +1,37 @@
+@echo off
+
+:: This is an example batchfile for building everything. Please
+:: edit this (or make your own) for your needs and wants using
+:: the instructions for calling makefile.vc found in makefile.vc
+::
+:: RCS: @(#) $Id$
+
+echo Sit back and have a cup of coffee while this grinds through ;)
+echo You asked for *everything*, remember?
+echo.
+
+if "%MSVCDir%" == "" call C:\dev\devstudio60\vc98\bin\vcvars32.bat
+set INSTALLDIR=C:\progra~1\tcl
+set TCLDIR=..\..\tcl_head
+
+nmake -nologo -f makefile.vc release winhelp OPTS=none
+if errorlevel 1 goto error
+nmake -nologo -f makefile.vc release OPTS=static,linkexten
+if errorlevel 1 goto error
+nmake -nologo -f makefile.vc core OPTS=static,msvcrt
+if errorlevel 1 goto error
+nmake -nologo -f makefile.vc core OPTS=static,threads
+if errorlevel 1 goto error
+nmake -nologo -f makefile.vc core OPTS=static,msvcrt,threads
+if errorlevel 1 goto error
+nmake -nologo -f makefile.vc release OPTS=threads
+if errorlevel 1 goto error
+goto end
+
+:error
+echo *** BOOM! ***
+
+:end
+echo done!
+pause
+
diff --git a/tk/win/configure b/tk/win/configure
index 601e2868c1c..6ecdf3bc9a2 100755
--- a/tk/win/configure
+++ b/tk/win/configure
@@ -16,9 +16,11 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-shared build and link with shared libraries [--enable-shared]"
ac_help="$ac_help
+ --enable-64bit enable 64bit support (where applicable)"
+ac_help="$ac_help
--enable-symbols build with debugging symbols [--disable-symbols]"
ac_help="$ac_help
- --with-tcl=DIR use Tcl 8.3 binaries from DIR"
+ --with-tcl=DIR use Tcl 8.4 binaries from DIR"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -36,7 +38,6 @@ program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
-sitefile=
srcdir=
target=NONE
verbose=
@@ -151,7 +152,6 @@ Configuration:
--help print this message
--no-create do not create output files
--quiet, --silent do not print \`checking...' messages
- --site-file=FILE use FILE as the site file
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
@@ -322,11 +322,6 @@ EOF
-site=* | --site=* | --sit=*)
site="$ac_optarg" ;;
- -site-file | --site-file | --site-fil | --site-fi | --site-f)
- ac_prev=sitefile ;;
- -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
- sitefile="$ac_optarg" ;;
-
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -492,16 +487,12 @@ fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$sitefile"; then
- if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
-else
- CONFIG_SITE="$sitefile"
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
@@ -541,27 +532,40 @@ fi
-TK_VERSION=8.3
+
+TK_VERSION=8.4
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=3
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=4
+TK_PATCH_LEVEL=".0"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
+#------------------------------------------------------------------------
+# Handle the --prefix=... option
+#------------------------------------------------------------------------
+
if test "${prefix}" = "NONE"; then
prefix=/usr/local
fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
+# libdir must be a fully qualified path and (not ${exec_prefix}/lib)
+eval libdir="$libdir"
#------------------------------------------------------------------------
# Standard compiler checks
#------------------------------------------------------------------------
+# If the user did not set CFLAGS, set it now to keep
+# the AC_PROG_CC macro from adding "-g -O2".
+if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+fi
+
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:565: checking for $ac_word" >&5
+echo "configure:569: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -591,7 +595,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:595: checking for $ac_word" >&5
+echo "configure:599: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -642,7 +646,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:646: checking for $ac_word" >&5
+echo "configure:650: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -674,7 +678,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:678: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:682: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -685,12 +689,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 689 "configure"
+#line 693 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -716,12 +720,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:720: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:724: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:725: checking whether we are using GNU C" >&5
+echo "configure:729: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -730,7 +734,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -749,7 +753,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:753: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:757: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -781,112 +785,21 @@ else
fi
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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
- fi
-done
-if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
-fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
-
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:811: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
-echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:832: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
-
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
-
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
-else
- ac_tool_prefix=
-fi
+# To properly support cross-compilation, one would
+# need to use these tool checks instead of
+# the ones below and reconfigure with
+# autoconf 2.50. You can also just set
+# the CC, AR, RANLIB, and RC environment
+# variables if you want to cross compile.
+#AC_CHECK_TOOL(AR, ar, :)
+#AC_CHECK_TOOL(RANLIB, ranlib, :)
+#AC_CHECK_TOOL(RC, windres, :)
-# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:858: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-AR="$ac_cv_prog_AR"
-if test -n "$AR"; then
- echo "$ac_t""$AR" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-if test -z "$ac_cv_prog_AR"; then
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "ar", so it can be a program name with args.
+if test "${GCC}" = "yes" ; then
+ # Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:890: checking for $ac_word" >&5
+echo "configure:803: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -903,7 +816,6 @@ else
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AR" && ac_cv_prog_AR=":"
fi
fi
AR="$ac_cv_prog_AR"
@@ -913,47 +825,10 @@ else
echo "$ac_t""no" 1>&6
fi
-else
- AR=":"
-fi
-fi
-
-# 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:925: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-if test -z "$ac_cv_prog_RANLIB"; then
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "ranlib", so it can be a program name with args.
+ # Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:957: checking for $ac_word" >&5
+echo "configure:832: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -970,7 +845,6 @@ else
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
@@ -980,47 +854,10 @@ else
echo "$ac_t""no" 1>&6
fi
-else
- RANLIB=":"
-fi
-fi
-
-# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
-set dummy ${ac_tool_prefix}windres; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:992: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test -n "$RC"; then
- ac_cv_prog_RC="$RC" # Let the user override the test.
-else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RC="${ac_tool_prefix}windres"
- break
- fi
- done
- IFS="$ac_save_ifs"
-fi
-fi
-RC="$ac_cv_prog_RC"
-if test -n "$RC"; then
- echo "$ac_t""$RC" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-if test -z "$ac_cv_prog_RC"; then
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "windres", so it can be a program name with args.
+ # Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1024: checking for $ac_word" >&5
+echo "configure:861: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1037,7 +874,6 @@ else
fi
done
IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RC" && ac_cv_prog_RC=":"
fi
fi
RC="$ac_cv_prog_RC"
@@ -1047,18 +883,14 @@ else
echo "$ac_t""no" 1>&6
fi
-else
- RC=":"
-fi
fi
-
#--------------------------------------------------------------------
# Checks to see if the make progeam sets the $MAKE variable.
#--------------------------------------------------------------------
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1062: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:894: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1090,12 +922,12 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1094: checking for Cygwin environment" >&5
+echo "configure:926: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1099 "configure"
+#line 931 "configure"
#include "confdefs.h"
int main() {
@@ -1106,7 +938,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:1110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -1128,13 +960,13 @@ test "$ac_cv_cygwin" = yes && CYGWIN=yes
#--------------------------------------------------------------------
echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1132: checking for object suffix" >&5
+echo "configure:964: checking for object suffix" >&5
if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1152,19 +984,19 @@ OBJEXT=$ac_cv_objext
ac_objext=$ac_cv_objext
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:1156: checking for mingw32 environment" >&5
+echo "configure:988: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1161 "configure"
+#line 993 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:1168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -1183,7 +1015,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1187: checking for executable suffix" >&5
+echo "configure:1019: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1193,10 +1025,10 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
- *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *.c | *.o | *.obj) ;;
*) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
esac
done
@@ -1220,7 +1052,7 @@ ac_exeext=$EXEEXT
echo $ac_n "checking for building with threads""... $ac_c" 1>&6
-echo "configure:1224: checking for building with threads" >&5
+echo "configure:1056: checking for building with threads" >&5
# Check whether --enable-threads or --disable-threads was given.
if test "${enable_threads+set}" = set; then
enableval="$enable_threads"
@@ -1241,6 +1073,7 @@ EOF
TCL_THREADS=0
echo "$ac_t""no (default)" 1>&6
fi
+
#--------------------------------------------------------------------
@@ -1250,7 +1083,7 @@ EOF
echo $ac_n "checking how to build libraries""... $ac_c" 1>&6
-echo "configure:1254: checking how to build libraries" >&5
+echo "configure:1087: checking how to build libraries" >&5
# Check whether --enable-shared or --disable-shared was given.
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
@@ -1287,12 +1120,28 @@ EOF
#--------------------------------------------------------------------
- TCL_LIB_VERSIONS_OK=nodots
+
+ # Step 0: Enable 64 bit support?
+
+ echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6
+echo "configure:1128: checking if 64bit support is requested" >&5
+ # Check whether --enable-64bit or --disable-64bit was given.
+if test "${enable_64bit+set}" = set; then
+ enableval="$enable_64bit"
+ do64bit=$enableval
+else
+ do64bit=no
+fi
+
+ echo "$ac_t""$do64bit" 1>&6
+
+ # Set some defaults (may get changed below)
+ EXTRA_CFLAGS=""
# Extract the first word of "cygpath", so it can be a program name with args.
set dummy cygpath; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1296: checking for $ac_word" >&5
+echo "configure:1145: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1320,62 +1169,42 @@ else
fi
- # Check for a bug in gcc's windres that causes the
- # compile to fail when a Windows native path is
- # passed into windres. The mingw toolchain requires
- # Windows native paths while Cygwin should work
- # with both. Avoid the bug by passing a POSIX
- # path when using the Cygwin toolchain.
-
- if test "$GCC" = "yes" && test "$CYGPATH" != "echo" ; then
- conftest=/tmp/conftest.rc
- echo "STRINGTABLE BEGIN" > $conftest
- echo "101 \"name\"" >> $conftest
- echo "END" >> $conftest
-
- echo $ac_n "checking for Windows native path bug in windres""... $ac_c" 1>&6
-echo "configure:1338: checking for Windows native path bug in windres" >&5
- cyg_conftest=`$CYGPATH $conftest`
- if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1340: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then
- echo "$ac_t""no" 1>&6
- else
- echo "$ac_t""yes" 1>&6
- CYGPATH=echo
- fi
- conftest=
- cyg_conftest=
- fi
-
if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then
DEPARG='"$<"'
else
DEPARG='"$(shell $(CYGPATH) $<)"'
fi
- VENDORPREFIX=""
-
# set various compiler flags depending on whether we are using gcc or cl
echo $ac_n "checking compiler flags""... $ac_c" 1>&6
-echo "configure:1361: checking compiler flags" >&5
+echo "configure:1182: checking compiler flags" >&5
if test "${GCC}" = "yes" ; then
-
- # CYGNUS LOCAL
- VENDORPREFIX="cyg"
-
+ if test "$do64bit" = "yes" ; then
+ echo "configure: warning: "64bit mode not supported with GCC on Windows"" 1>&2
+ fi
SHLIB_LD=""
SHLIB_LD_LIBS=""
LIBS=""
- LIBS_GUI="-lgdi32 -lcomdlg32"
- STLIB_LD="${AR} cr"
+ LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32"
+ STLIB_LD='${AR} cr'
RC_OUT=-o
RC_TYPE=
RC_INCLUDE=--include
+ RC_DEFINE=--define
RES=res.o
MAKE_LIB="\${STLIB_LD} \$@"
POST_MAKE_LIB="\${RANLIB} \$@"
MAKE_EXE="\${CC} -o \$@"
- LIBPREFIX="lib${VENDORPREFIX}"
+ LIBPREFIX="lib"
+
+ if test "$ac_cv_cygwin" = "yes"; then
+ extra_cflags="-mno-cygwin"
+ extra_ldflags="-mno-cygwin"
+ else
+ extra_cflags=""
+ extra_ldflags=""
+ fi
if test "${SHARED_BUILD}" = "0" ; then
# static
@@ -1385,7 +1214,6 @@ echo "configure:1361: checking compiler flags" >&5
LIBSUFFIX="s\${DBGX}.a"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
- DLLSUFFIX=""
else
# dynamic
echo "$ac_t""using shared flags" 1>&6
@@ -1393,23 +1221,27 @@ echo "configure:1361: checking compiler flags" >&5
# ad-hoc check to see if CC supports -shared.
if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then
{ echo "configure: error: ${CC} does not support the -shared option.
- You will need to upgrade to a newer version of the toolchain." 1>&2; exit 1; }
+ You will need to upgrade to a newer version of the toolchain." 1>&2; exit 1; }
fi
runtime=
# Link with gcc since ld does not link to default libs like
- # -luser32 and -lmsvcrt. We also need to add CFLAGS so important
- # flags like -mno-cygwin get passed in to CC.
+ # -luser32 and -lmsvcrt by default. Make sure CFLAGS is
+ # included so -mno-cygwin passed the correct libs to the linker.
SHLIB_LD='${CC} -shared ${CFLAGS}'
# Add SHLIB_LD_LIBS to the Make rule, not here.
MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \$@ ${extra_ldflags} \
-Wl,--out-implib,\$(patsubst %.dll,lib%.a,\$@)"
LIBSUFFIX="\${DBGX}.a"
- DLLSUFFIX="\${DBGX}.dll"
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
fi
+ # DLLSUFFIX is separate because it is the building block for
+ # users of tclConfig.sh that may build shared or static.
+ DLLSUFFIX="\${DBGX}.dll"
+
+ EXTRA_CFLAGS="${extra_cflags}"
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
@@ -1433,24 +1265,6 @@ echo "configure:1361: checking compiler flags" >&5
LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
else
- # CYGNUS LOCAL
- VENDORPREFIX="sn"
-
- SHLIB_LD="link -dll -nologo"
- SHLIB_LD_LIBS="user32.lib advapi32.lib"
- LIBS="user32.lib advapi32.lib"
- LIBS_GUI="gdi32.lib comdlg32.lib"
- STLIB_LD="lib -nologo"
- RC="rc"
- RC_OUT=-fo
- RC_TYPE=-r
- RC_INCLUDE=-i
- RES=res
- MAKE_LIB="\${STLIB_LD} -out:\$@"
- POST_MAKE_LIB=
- MAKE_EXE="\${CC} -Fe\$@"
- LIBPREFIX=${VENDORPREFIX}
-
if test "${SHARED_BUILD}" = "0" ; then
# static
echo "$ac_t""using static flags" 1>&6
@@ -1459,7 +1273,6 @@ echo "configure:1361: checking compiler flags" >&5
LIBSUFFIX="s\${DBGX}.lib"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
- DLLSUFFIX=""
else
# dynamic
echo "$ac_t""using shared flags" 1>&6
@@ -1467,32 +1280,84 @@ echo "configure:1361: checking compiler flags" >&5
# Add SHLIB_LD_LIBS to the Make rule, not here.
MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\$@"
LIBSUFFIX="\${DBGX}.lib"
- DLLSUFFIX="\${DBGX}.dll"
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
fi
+ # DLLSUFFIX is separate because it is the building block for
+ # users of tclConfig.sh that may build shared or static.
+ DLLSUFFIX="\${DBGX}.dll"
+
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ if test "$do64bit" = "yes" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft SDK"
+ fi
+ # In order to work in the tortured autoconf environment,
+ # we need to ensure that this path has no spaces
+ MSSDK=$(cygpath -w -s "$MSSDK" | sed -e 's!\\!/!g')
+ if test ! -d "${MSSDK}/bin/win64" ; then
+ echo "configure: warning: "could not find 64-bit SDK to enable 64bit mode"" 1>&2
+ do64bit="no"
+ fi
+ fi
+
+ if test "$do64bit" = "yes" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="${MSSDK}/Bin/Win64/cl.exe \
+ -I${MSSDK}/Include/prerelease \
+ -I${MSSDK}/Include/Win64/crt \
+ -I${MSSDK}/Include/Win64/crt/sys \
+ -I${MSSDK}/Include"
+ RC="${MSSDK}/bin/rc.exe"
+ CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -Gs ${runtime}"
+ lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
+ -LIBPATH:${MSSDK}/Lib/Prerelease/IA64"
+ STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}"
+ LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}"
+ else
+ RC="rc"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
+ STLIB_LD="lib -nologo"
+ LINKBIN="link -link50compat"
+ fi
+
+ SHLIB_LD="${LINKBIN} -dll -nologo -incremental:no"
+ SHLIB_LD_LIBS="user32.lib advapi32.lib"
+ LIBS="user32.lib advapi32.lib"
+ LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib"
+ RC_OUT=-fo
+ RC_TYPE=-r
+ RC_INCLUDE=-i
+ RC_DEFINE=-d
+ RES=res
+ MAKE_LIB="\${STLIB_LD} -out:\$@"
+ POST_MAKE_LIB=
+ MAKE_EXE="\${CC} -Fe\$@"
+ LIBPREFIX=""
EXTRA_CFLAGS="-YX"
- CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
-# CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
- CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
CFLAGS_WARNING="-W3"
- LDFLAGS_DEBUG="-debug:full -debugtype:cv"
+ LDFLAGS_DEBUG="-debug:full -debugtype:both"
LDFLAGS_OPTIMIZE="-release"
-
+
# Specify the CC output file names based on the target name
CC_OBJNAME="-Fo\$@"
CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\$@')\""
# Specify linker flags depending on the type of app being
# built -- Console vs. Window.
- LDFLAGS_CONSOLE="-link -subsystem:console"
- LDFLAGS_WINDOW="-link -subsystem:windows"
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
- # TCL_LIB_SUFFIX is defined here and in tclConfig.sh so that macros
- # can use a single variable name for both Tcl and extensions.
- TCL_LIB_SUFFIX=$LIBSUFFIX
+ # DL_LIBS is empty, but then we match the Unix version
+
+
+
+
#--------------------------------------------------------------------
@@ -1500,7 +1365,7 @@ echo "configure:1361: checking compiler flags" >&5
#--------------------------------------------------------------------
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1504: checking how to run the C preprocessor" >&5
+echo "configure:1369: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1515,13 +1380,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1519 "configure"
+#line 1384 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1532,13 +1397,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1536 "configure"
+#line 1401 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1542: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1407: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1549,13 +1414,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1553 "configure"
+#line 1418 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1581,17 +1446,17 @@ echo "$ac_t""$CPP" 1>&6
ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for errno.h""... $ac_c" 1>&6
-echo "configure:1585: checking for errno.h" >&5
+echo "configure:1450: checking for errno.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1590 "configure"
+#line 1455 "configure"
#include "confdefs.h"
#include <errno.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1623,7 +1488,7 @@ fi
echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
-echo "configure:1627: checking for build with symbols" >&5
+echo "configure:1492: checking for build with symbols" >&5
# Check whether --enable-symbols or --disable-symbols was given.
if test "${enable_symbols+set}" = set; then
enableval="$enable_symbols"
@@ -1654,15 +1519,13 @@ TK_DBGX=${DBGX}
echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6
-echo "configure:1658: checking the location of tclConfig.sh" >&5
+echo "configure:1523: checking the location of tclConfig.sh" >&5
-# CYGNUS LOCAL
- if test -d ../../tcl8.1/win; then
- TCL_BIN_DIR_DEFAULT=../../tcl8.1/win
+ if test -d ../../tcl8.4$TK_PATCH_LEVEL/win; then
+ TCL_BIN_DIR_DEFAULT=../../tcl8.4$TK_PATCH_LEVEL/win
else
- TCL_BIN_DIR_DEFAULT=../../tcl/win
+ TCL_BIN_DIR_DEFAULT=../../tcl8.4/win
fi
-# END CYGNUS LOCAL
# Check whether --with-tcl or --without-tcl was given.
if test "${with_tcl+set}" = set; then
@@ -1682,7 +1545,7 @@ fi
echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6
-echo "configure:1686: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
+echo "configure:1549: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
echo "$ac_t""loading" 1>&6
@@ -1691,635 +1554,142 @@ echo "configure:1686: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
echo "$ac_t""file not found" 1>&6
fi
- # The eval is required to do the TCL_DBGX substitution in the
- # TCL_LIB_FILE variable.
+ #
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f $TCL_BIN_DIR/Makefile ; then
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
+ fi
+
+ #
+ # eval is required to do the TCL_DBGX substitution
+ #
+
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
- eval TCL_LIB_FILE=${TCL_LIB_FILE}
- eval TCL_LIB_FLAG=${TCL_LIB_FLAG}
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+
+
-#------------------------------------------------------------------------
-# tkConfig.sh refers to this by a different name
-#------------------------------------------------------------------------
-
-TK_SHARED_BUILD=${SHARED_BUILD}
-
-#--------------------------------------------------------------------
-# Perform final evaluations of variables with possible substitutions.
-#--------------------------------------------------------------------
-
-NODOT_VERSION=${VER}
-
-TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
-TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
-TK_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
-
-
- val="`cd $srcdir/..; pwd`"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_SRC_DIR" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_SRC_DIR=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_SRC_DIR="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_SRC_DIR=$val
- ;;
- esac
-
-
-
- libname=tk
- suffix=${TK_SHARED_LIB_SUFFIX}
-
- case "${host}" in
- *windows32* | *mingw32* | *cygwin*)
- eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- *)
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- esac
-
- eval "long_libname=${long_libname}"
-
- # Trick to replace DBGX with TCL_DBGX
- DBGX='${TCL_DBGX}'
- eval "long_libname=${long_libname}"
-
- TK_DLL_FILE=$long_libname
-
-
- libname=tk
- suffix=${TK_UNSHARED_LIB_SUFFIX}
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- else
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- fi
- ;;
- *)
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- esac
-
- eval "long_libname=${long_libname}"
-
- # Trick to replace DBGX with TCL_DBGX
- DBGX='${TCL_DBGX}'
- eval "long_libname=${long_libname}"
-
- TK_LIB_FILE=$long_libname
-
-
- libname=tkstub
- suffix=${TK_UNSHARED_LIB_SUFFIX}
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- else
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- fi
- ;;
- *)
- eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\""
- ;;
- esac
-
- eval "long_libname=${long_libname}"
+
+
+
- # Trick to replace DBGX with TCL_DBGX
- DBGX='${TCL_DBGX}'
- eval "long_libname=${long_libname}"
- TK_STUB_LIB_FILE=$long_libname
+ echo $ac_n "checking for tclsh""... $ac_c" 1>&6
+echo "configure:1600: checking for tclsh" >&5
-if test "$GCC" = "yes"; then
- GNU_TK_LIB_FILE=${TK_LIB_FILE}
- MSVC_TK_LIB_FILE=
+ if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- GNU_TK_LIB_FILE=
- MSVC_TK_LIB_FILE=${TK_LIB_FILE}
+
+ search_path=`echo ${exec_prefix}/bin:${prefix}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${PATH} | sed -e 's/:/ /g'`
+ for dir in $search_path ; do
+ for j in `ls -r $dir/tclsh[8-9]*.exe 2> /dev/null` \
+ `ls -r $dir/tclsh* 2> /dev/null` ; do
+ if test x"$ac_cv_path_tclsh" = x ; then
+ if test -f "$j" ; then
+ ac_cv_path_tclsh=$j
+ break
+ fi
+ fi
+ done
+ done
+
fi
- libname=tkstub
- version=${TK_VERSION}
-
- if test "$TCL_LIB_SUFFIX" = "" ; then
- { echo "configure: error: The TCL_LIB_SUFFIX variable is not defined" 1>&2; exit 1; }
- fi
-
- # If the . character is not allowed in lib name, remove it from version
- if test "${TCL_LIB_VERSIONS_OK}" != "ok"; then
- version=`echo $version | tr -d .`
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "short_libname=\"${TCL_VENDOR_PREFIX}${libname}${version}${TCL_LIB_SUFFIX}\""
- else
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}${TCL_DBGX}"
- fi
- ;;
- *)
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}\${TCL_DBGX}"
- ;;
- esac
-
- TK_STUB_LIB_FLAG=$short_libname
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="`pwd`/${TK_STUB_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_BUILD_STUB_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_BUILD_STUB_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_BUILD_STUB_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_BUILD_STUB_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=`pwd`
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_BUILD_STUB_LIB_SPEC="-L${dirname} ${TK_STUB_LIB_FLAG}"
- fi
- ;;
- *)
- TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}"
- ;;
- esac
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="${exec_prefix}/lib/${TK_STUB_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_STUB_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_STUB_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_STUB_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_STUB_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=${exec_prefix}/lib
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_STUB_LIB_SPEC="-L${dirname} ${TK_STUB_LIB_FLAG}"
- fi
- ;;
- *)
- TK_STUB_LIB_SPEC="-L${exec_prefix}/lib ${TK_STUB_LIB_FLAG}"
- ;;
- esac
-
-
+ if test -f "$ac_cv_path_tclsh" ; then
+ TCLSH_PROG=$ac_cv_path_tclsh
+ echo "$ac_t""$TCLSH_PROG" 1>&6
+ else
+ { echo "configure: error: No tclsh found in PATH: $search_path" 1>&2; exit 1; }
+ fi
+
-
- val="`pwd`/${TK_STUB_LIB_FILE}"
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_BUILD_STUB_LIB_PATH" 1>&2; exit 1; }
- fi
+#------------------------------------------------------------------------
+# tkConfig.sh refers to this by a different name
+#------------------------------------------------------------------------
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_BUILD_STUB_LIB_PATH=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_BUILD_STUB_LIB_PATH="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_BUILD_STUB_LIB_PATH=$val
- ;;
- esac
+TK_SHARED_BUILD=${SHARED_BUILD}
+#--------------------------------------------------------------------
+# Perform final evaluations of variables with possible substitutions.
+#--------------------------------------------------------------------
+TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
+TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
+TK_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
-
- val="${exec_prefix}/lib/${TK_STUB_LIB_FILE}"
+eval "TK_SRC_DIR=`cd $srcdir/..; pwd`"
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_STUB_LIB_PATH" 1>&2; exit 1; }
- fi
+eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}"
+eval "TK_LIB_FILE=${LIBPREFIX}tk$VER${LIBSUFFIX}"
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_STUB_LIB_PATH=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_STUB_LIB_PATH="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_STUB_LIB_PATH=$val
- ;;
- esac
+eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}"
+# FIXME: All of this var junk needs to be done in tcl.m4 !!!!
+# I left out the other vars that also need to get defined here.
+# we also need to double check about including DBGX in lib names
+# and spaces in file or directory names for the eval
+eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${TCL_DBGX}\""
+eval "TK_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TK_STUB_LIB_FLAG}\""
+eval "TCL_DLL_FILE=\"tcl$VER${DLLSUFFIX}\""
+eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl$VER${LIBSUFFIX}\""
+eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
+eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${TCL_DBGX}\""
+eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\""
eval "DLLSUFFIX=${DLLSUFFIX}"
eval "LIBPREFIX=${LIBPREFIX}"
eval "LIBSUFFIX=${LIBSUFFIX}"
eval "EXESUFFIX=${EXESUFFIX}"
-
- libname=tk
- version=$TK_VERSION
-
- if test "$TCL_LIB_SUFFIX" = "" ; then
- { echo "configure: error: The TCL_LIB_SUFFIX variable is not defined" 1>&2; exit 1; }
- fi
-
- # If the . character is not allowed in lib name, remove it from version
- if test "${TCL_LIB_VERSIONS_OK}" != "ok"; then
- version=`echo $version | tr -d .`
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
- eval "short_libname=\"${TCL_VENDOR_PREFIX}${libname}${version}${TCL_LIB_SUFFIX}\""
- else
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}${TCL_DBGX}"
- fi
- ;;
- *)
- short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}\${TCL_DBGX}"
- ;;
- esac
-
- TK_LIB_FLAG=$short_libname
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="`pwd`/${TK_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_BUILD_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_BUILD_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_BUILD_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_BUILD_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=`pwd`
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_BUILD_LIB_SPEC="-L${dirname} ${TK_LIB_FLAG}"
- fi
- ;;
- *)
- TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}"
- ;;
- esac
-
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "$GCC" != yes; then
-
- val="${exec_prefix}/lib/${TK_LIB_FLAG}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_LIB_SPEC" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_LIB_SPEC=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_LIB_SPEC=$val
- ;;
- esac
-
- else
-
- val=${exec_prefix}/lib
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- dirname=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- dirname="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- dirname=$val
- ;;
- esac
-
- TK_LIB_SPEC="-L${dirname} ${TK_LIB_FLAG}"
- fi
- ;;
- *)
- TK_LIB_SPEC="-L${exec_prefix}/lib ${TK_LIB_FLAG}"
- ;;
- esac
-
-
-
- val="`pwd`/${TK_LIB_FILE}"
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable TK_LIB_FULL_PATH" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- TK_LIB_FULL_PATH=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- TK_LIB_FULL_PATH="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- TK_LIB_FULL_PATH=$val
- ;;
- esac
-
-
-
-if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then
- WISH_RES=wish_static.${RES}
- TK_RES=
-else
- WISH_RES=wish_static.${RES}
- TK_RES=tk_dll.${RES}
-fi
-TK_SHARED_BUILD=${SHARED_BUILD}
-
CFG_TK_SHARED_LIB_SUFFIX=${TK_SHARED_LIB_SUFFIX}
CFG_TK_UNSHARED_LIB_SUFFIX=${TK_UNSHARED_LIB_SUFFIX}
CFG_TK_EXPORT_FILE_SUFFIX=${TK_EXPORT_FILE_SUFFIX}
-# Add X include path, it must be in a format
-# like -I"C:/Dir" and not -I"C:\Dir" or VC++ will puke.
-
- val=$srcdir/../xlib
-
- if test "$val" = "" ; then
- { echo "configure: error: Empty value for variable XINCLUDES" 1>&2; exit 1; }
- fi
-
- case "${host}" in
- *windows32* | *mingw32*)
- if test "${CYGPATH}" = ""; then
- { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; }
- elif test "${CYGPATH}" = "echo"; then
- # No cygpath when cross compiling
- XINCLUDES=$val
- else
- # store literal argument text in a variable
- val=$val
- # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo)
- val="`${CYGPATH} $val`"
- # Convert path like C:\Tmp\foo to C:/Tmp/foo
- XINCLUDES="`echo $val | sed -e s#\\\\\\\\#/#g`"
- fi
- ;;
- *)
- # Default to a no-op under Unix or Cygwin gcc
- XINCLUDES=$val
- ;;
- esac
-
-XINCLUDES="-I\"${XINCLUDES}\""
-
-
-
-
-
+#--------------------------------------------------------------------
+# Adjust the defines for how the resources are built depending
+# on symbols and static vs. shared.
+#--------------------------------------------------------------------
+if test "$SHARED_BUILD" = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then
+ if test "${DBGX}" = "d"; then
+ RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
+ else
+ RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
+ fi
+ TK_RES=""
+else
+ if test "${DBGX}" = "d"; then
+ RC_DEFINES="${RC_DEFINE} DEBUG"
+ else
+ RC_DEFINES=""
+ fi
+ TK_RES='tk.$(RES)'
+fi
@@ -2389,6 +1759,7 @@ XINCLUDES="-I\"${XINCLUDES}\""
+# undefined at this point for win
@@ -2543,70 +1914,54 @@ s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@CC@%$CC%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
-s%@build@%$build%g
-s%@build_alias@%$build_alias%g
-s%@build_c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_STUB_LIB_PATH@%$TK_STUB_LIB_PATH%g
CEOF
EOF
diff --git a/tk/win/configure.in b/tk/win/configure.in
index 51be87e08dd..619cfc4c014 100755
--- a/tk/win/configure.in
+++ b/tk/win/configure.in
@@ -1,3 +1,4 @@
+#! /bin/bash -norc
# This file is an input file used by the GNU "autoconf" program to
# generate the file "configure", which is run during Tk installation
# to configure the system for the local environment.
@@ -5,29 +6,54 @@
# RCS: @(#) $Id$
AC_INIT(../generic/tk.h)
+AC_PREREQ(2.13)
-TK_VERSION=8.3
+TK_VERSION=8.4
TK_MAJOR_VERSION=8
-TK_MINOR_VERSION=3
-TK_PATCH_LEVEL=".2"
+TK_MINOR_VERSION=4
+TK_PATCH_LEVEL=".0"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
+#------------------------------------------------------------------------
+# Handle the --prefix=... option
+#------------------------------------------------------------------------
+
if test "${prefix}" = "NONE"; then
prefix=/usr/local
fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
+# libdir must be a fully qualified path and (not ${exec_prefix}/lib)
+eval libdir="$libdir"
#------------------------------------------------------------------------
# Standard compiler checks
#------------------------------------------------------------------------
+# If the user did not set CFLAGS, set it now to keep
+# the AC_PROG_CC macro from adding "-g -O2".
+if test "${CFLAGS+set}" != "set" ; then
+ CFLAGS=""
+fi
+
AC_PROG_CC
-AC_CHECK_TOOL(AR, ar, :)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(RC, windres, :)
+# To properly support cross-compilation, one would
+# need to use these tool checks instead of
+# the ones below and reconfigure with
+# autoconf 2.50. You can also just set
+# the CC, AR, RANLIB, and RC environment
+# variables if you want to cross compile.
+#AC_CHECK_TOOL(AR, ar, :)
+#AC_CHECK_TOOL(RANLIB, ranlib, :)
+#AC_CHECK_TOOL(RC, windres, :)
+
+if test "${GCC}" = "yes" ; then
+ AC_CHECK_PROG(AR, ar, ar)
+ AC_CHECK_PROG(RANLIB, ranlib, ranlib)
+ AC_CHECK_PROG(RC, windres, windres)
+fi
#--------------------------------------------------------------------
# Checks to see if the make progeam sets the $MAKE variable.
@@ -93,6 +119,8 @@ TK_DBGX=${DBGX}
SC_PATH_TCLCONFIG($TK_PATCH_LEVEL)
SC_LOAD_TCLCONFIG
+SC_PROG_TCLSH
+
#------------------------------------------------------------------------
# tkConfig.sh refers to this by a different name
#------------------------------------------------------------------------
@@ -103,60 +131,59 @@ TK_SHARED_BUILD=${SHARED_BUILD}
# Perform final evaluations of variables with possible substitutions.
#--------------------------------------------------------------------
-NODOT_VERSION=${VER}
-
TK_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
TK_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
TK_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
-TCL_TOOL_PATH(TK_SRC_DIR, "`cd $srcdir/..; pwd`")
+eval "TK_SRC_DIR=`cd $srcdir/..; pwd`"
-TCL_TOOL_SHARED_LIB_LONGNAME(TK_DLL_FILE, tk, ${TK_SHARED_LIB_SUFFIX})
-TCL_TOOL_STATIC_LIB_LONGNAME(TK_LIB_FILE, tk, ${TK_UNSHARED_LIB_SUFFIX})
-TCL_TOOL_STATIC_LIB_LONGNAME(TK_STUB_LIB_FILE, tkstub, ${TK_UNSHARED_LIB_SUFFIX})
+eval "TK_DLL_FILE=tk$VER${DLLSUFFIX}"
+eval "TK_LIB_FILE=${LIBPREFIX}tk$VER${LIBSUFFIX}"
-if test "$GCC" = "yes"; then
- GNU_TK_LIB_FILE=${TK_LIB_FILE}
- MSVC_TK_LIB_FILE=
-else
- GNU_TK_LIB_FILE=
- MSVC_TK_LIB_FILE=${TK_LIB_FILE}
-fi
+eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}"
+# FIXME: All of this var junk needs to be done in tcl.m4 !!!!
+# I left out the other vars that also need to get defined here.
+# we also need to double check about including DBGX in lib names
+# and spaces in file or directory names for the eval
+eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${TCL_DBGX}\""
+eval "TK_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TK_STUB_LIB_FLAG}\""
-TCL_TOOL_LIB_SHORTNAME(TK_STUB_LIB_FLAG, tkstub, ${TK_VERSION})
-TCL_TOOL_LIB_SPEC(TK_BUILD_STUB_LIB_SPEC, `pwd`, ${TK_STUB_LIB_FLAG})
-TCL_TOOL_LIB_SPEC(TK_STUB_LIB_SPEC, ${exec_prefix}/lib, ${TK_STUB_LIB_FLAG})
+eval "TCL_DLL_FILE=\"tcl$VER${DLLSUFFIX}\""
+eval "TCL_LIB_FILE=\"${LIBPREFIX}tcl$VER${LIBSUFFIX}\""
-TCL_TOOL_LIB_PATH(TK_BUILD_STUB_LIB_PATH, `pwd`, ${TK_STUB_LIB_FILE})
-TCL_TOOL_LIB_PATH(TK_STUB_LIB_PATH, ${exec_prefix}/lib, ${TK_STUB_LIB_FILE})
+eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
+eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${TCL_DBGX}\""
+eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\""
eval "DLLSUFFIX=${DLLSUFFIX}"
eval "LIBPREFIX=${LIBPREFIX}"
eval "LIBSUFFIX=${LIBSUFFIX}"
eval "EXESUFFIX=${EXESUFFIX}"
-TCL_TOOL_LIB_SHORTNAME(TK_LIB_FLAG, tk, $TK_VERSION)
-TCL_TOOL_LIB_SPEC(TK_BUILD_LIB_SPEC, `pwd`, ${TK_LIB_FLAG})
-TCL_TOOL_LIB_SPEC(TK_LIB_SPEC, ${exec_prefix}/lib, ${TK_LIB_FLAG})
-TCL_TOOL_LIB_PATH(TK_LIB_FULL_PATH, `pwd`, ${TK_LIB_FILE})
-
-if test "$SHARED_BUILD" = 0 -o $TCL_NEEDS_EXP_FILE = 0; then
- WISH_RES=wish_static.${RES}
- TK_RES=
-else
- WISH_RES=wish_static.${RES}
- TK_RES=tk_dll.${RES}
-fi
-TK_SHARED_BUILD=${SHARED_BUILD}
-
CFG_TK_SHARED_LIB_SUFFIX=${TK_SHARED_LIB_SUFFIX}
CFG_TK_UNSHARED_LIB_SUFFIX=${TK_UNSHARED_LIB_SUFFIX}
CFG_TK_EXPORT_FILE_SUFFIX=${TK_EXPORT_FILE_SUFFIX}
-# Add X include path, it must be in a format
-# like -I"C:/Dir" and not -I"C:\Dir" or VC++ will puke.
-TCL_TOOL_PATH(XINCLUDES, $srcdir/../xlib)
-XINCLUDES="-I\"${XINCLUDES}\""
+#--------------------------------------------------------------------
+# Adjust the defines for how the resources are built depending
+# on symbols and static vs. shared.
+#--------------------------------------------------------------------
+
+if test "$SHARED_BUILD" = 0 -o "$TCL_NEEDS_EXP_FILE" = 0; then
+ if test "${DBGX}" = "d"; then
+ RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
+ else
+ RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
+ fi
+ TK_RES=""
+else
+ if test "${DBGX}" = "d"; then
+ RC_DEFINES="${RC_DEFINE} DEBUG"
+ else
+ RC_DEFINES=""
+ fi
+ TK_RES='tk.$(RES)'
+fi
AC_SUBST(TK_VERSION)
AC_SUBST(TK_MAJOR_VERSION)
@@ -164,24 +191,12 @@ AC_SUBST(TK_MINOR_VERSION)
AC_SUBST(TK_PATCH_LEVEL)
AC_SUBST(TK_DBGX)
AC_SUBST(TK_LIB_FILE)
-AC_SUBST(GNU_TK_LIB_FILE)
-AC_SUBST(MSVC_TK_LIB_FILE)
AC_SUBST(TK_DLL_FILE)
-AC_SUBST(TK_LIB_FLAG)
AC_SUBST(TK_STUB_LIB_FILE)
AC_SUBST(TK_STUB_LIB_FLAG)
-AC_SUBST(TK_STUB_LIB_SPEC)
-AC_SUBST(TK_STUB_LIB_PATH)
AC_SUBST(TK_BUILD_STUB_LIB_SPEC)
-AC_SUBST(TK_BUILD_STUB_LIB_PATH)
AC_SUBST(TK_SRC_DIR)
AC_SUBST(TK_BIN_DIR)
-AC_SUBST(TK_BUILD_LIB_SPEC)
-AC_SUBST(TK_LIB_SPEC)
-AC_SUBST(TK_LIB_FULL_PATH)
-AC_SUBST(TK_SHARED_BUILD)
-AC_SUBST(WISH_RES)
-AC_SUBST(TK_RES)
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_MAJOR_VERSION)
@@ -191,7 +206,6 @@ AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_DLL_FILE)
AC_SUBST(TCL_STUB_LIB_FILE)
AC_SUBST(TCL_STUB_LIB_FLAG)
-AC_SUBST(TCL_BUILD_LIB_SPEC)
AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_BIN_DIR)
@@ -204,9 +218,6 @@ AC_SUBST(TK_SHARED_BUILD)
AC_SUBST(CYGPATH)
AC_SUBST(DEPARG)
AC_SUBST(CFLAGS_DEFAULT)
-AC_SUBST(CFLAGS_DEBUG)
-AC_SUBST(CFLAGS_OPTIMIZE)
-AC_SUBST(CFLAGS_WARNING)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(STLIB_LD)
AC_SUBST(SHLIB_LD)
@@ -226,6 +237,9 @@ AC_SUBST(RC)
AC_SUBST(RC_OUT)
AC_SUBST(RC_TYPE)
AC_SUBST(RC_INCLUDE)
+AC_SUBST(RC_DEFINE)
+AC_SUBST(RC_DEFINES)
+AC_SUBST(TK_RES)
AC_SUBST(RES)
AC_SUBST(LIBS)
AC_SUBST(LIBS_GUI)
@@ -238,7 +252,15 @@ AC_SUBST(MAKE_LIB)
AC_SUBST(POST_MAKE_LIB)
AC_SUBST(MAKE_DLL)
AC_SUBST(MAKE_EXE)
-AC_SUBST(TK_XINCLUDES)
-AC_SUBST(XINCLUDES)
+
+# undefined at this point for win
+AC_SUBST(TK_BUILD_LIB_SPEC)
+AC_SUBST(TK_CC_SEARCH_FLAGS)
+AC_SUBST(TK_LD_SEARCH_FLAGS)
+AC_SUBST(TK_LIB_FLAG)
+AC_SUBST(TK_LIB_SPEC)
+AC_SUBST(TK_STUB_LIB_SPEC)
+AC_SUBST(TK_BUILD_STUB_LIB_PATH)
+AC_SUBST(TK_STUB_LIB_PATH)
AC_OUTPUT(Makefile tkConfig.sh)
diff --git a/tk/win/lamp.bmp b/tk/win/lamp.bmp
new file mode 100644
index 00000000000..834c0f9a521
--- /dev/null
+++ b/tk/win/lamp.bmp
Binary files differ
diff --git a/tk/win/makefile.bc b/tk/win/makefile.bc
index 050d0127c2c..d26d00b448c 100644
--- a/tk/win/makefile.bc
+++ b/tk/win/makefile.bc
@@ -1,340 +1,535 @@
-# Borland C++ 4.5 makefile for Tk
-#
-# Copyright (c) 1995-1996 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.
-#
-# SCCS: @(#) makefile.bc 1.73 97/11/05 16:12:27
-
-
-#
-# Project directories
-#
-# ROOT = top of source tree
-# TMPDIR = location where .obj files should be stored during build
-# TCLDIR = location of top of Tcl source heirarchy
-#
-
-ROOT = ..
-TMPDIR = .
-TOOLS = c:\bc45
-TCLDIR = ..\..\tcl8.0
-
-# uncomment the following line to compile with symbols
-#DEBUG=1
-
-# uncomment the following line to compile with TCL_MEM_DEBUG
-#DEBUGDEFINES =TCL_MEM_DEBUG
-
-#
-# Borland C++ tools
-#
-
-BORLAND = $(TOOLS)
-IMPLIB = $(BORLAND)\bin\Implib
-BCC32 = $(BORLAND)\bin\Bcc32
-TLINK32 = $(BORLAND)\bin\tlink32
-RC = $(BORLAND)\bin\brcc32
-CP = copy
-RM = del
-
-INCLUDES = $(BORLAND)\include;$(ROOT)\generic;$(ROOT)\bitmaps;$(ROOT)\xlib;$(ROOT)\win;$(TCLDIR)\generic
-LIBDIRS = $(BORLAND)\lib;$(ROOT)\win
-TCLLIBDIR = $(TCLDIR)\win
-
-
-!ifndef DEBUG
-
-# these macros cause maximum optimization and no symbols
-DEBUGLDFLAGS =
-DEBUGCCFLAGS = -v- -vi- -O2
-
-!else
-
-# these macros enable debugging
-DEBUGLDFLAGS = -v
-DEBUGCCFLAGS = -k -Od -v
-
-!endif
-
-DEFINES = MT;_RTLDLL;STRICT;$(DEBUGDEFINES)
-PROJECTCCFLAGS= $(DEBUGCCFLAGS) -w-par -w-stu
-
-LNFLAGS_exe = -Tpe -aa -c $(DEBUGLDFLAGS) $(BORLAND)\lib\c0w32
-LNFLAGS_dll = -Tpd -aa -c $(DEBUGLDFLAGS) $(BORLAND)\lib\c0d32
-
-LNLIBS_exe = $(TKLIB) $(TCLLIBDIR)\$(TCLLIB) import32 cw32mti
-LNLIBS_dll = $(TCLLIBDIR)\$(TCLLIB) import32 cw32mti
-
-#
-# Global makefile settings
-#
-
-.AUTODEPEND
-.CACHEAUTODEPEND
-
-.suffixes: .c .dll .lib .obj .exe
-
-.path.c=$(ROOT)\win;$(ROOT)\generic;$(ROOT)\xlib;$(ROOT)\unix
-.path.obj=$(TMPDIR)
-
-WISHOBJS = \
- $(TMPDIR)\winMain.obj
-
-TKTESTOBJS = \
- $(TMPDIR)\tkTest.obj \
- $(TMPDIR)\tkSquare.obj \
- $(TMPDIR)\testMain.obj
-
-XLIBOBJS = \
- $(TMPDIR)\xcolors.obj \
- $(TMPDIR)\xdraw.obj \
- $(TMPDIR)\xgc.obj \
- $(TMPDIR)\ximage.obj \
- $(TMPDIR)\xutil.obj
-
-TKOBJS = \
- $(TMPDIR)\tkConsole.obj \
- $(TMPDIR)\tkUnixMenubu.obj \
- $(TMPDIR)\tkUnixScale.obj \
- $(XLIBOBJS) \
- $(TMPDIR)\tkWin3d.obj \
- $(TMPDIR)\tkWin32Dll.obj \
- $(TMPDIR)\tkWinButton.obj \
- $(TMPDIR)\tkWinClipboard.obj \
- $(TMPDIR)\tkWinColor.obj \
- $(TMPDIR)\tkWinCursor.obj \
- $(TMPDIR)\tkWinDialog.obj \
- $(TMPDIR)\tkWinDraw.obj \
- $(TMPDIR)\tkWinEmbed.obj \
- $(TMPDIR)\tkWinFont.obj \
- $(TMPDIR)\tkWinImage.obj \
- $(TMPDIR)\tkWinInit.obj \
- $(TMPDIR)\tkWinKey.obj \
- $(TMPDIR)\tkWinMenu.obj \
- $(TMPDIR)\tkWinPixmap.obj \
- $(TMPDIR)\tkWinPointer.obj \
- $(TMPDIR)\tkWinRegion.obj \
- $(TMPDIR)\tkWinScrlbr.obj \
- $(TMPDIR)\tkWinSend.obj \
- $(TMPDIR)\tkWinWindow.obj \
- $(TMPDIR)\tkWinWm.obj \
- $(TMPDIR)\tkWinX.obj \
- $(TMPDIR)\stubs.obj \
- $(TMPDIR)\tk3d.obj \
- $(TMPDIR)\tkArgv.obj \
- $(TMPDIR)\tkAtom.obj \
- $(TMPDIR)\tkBind.obj \
- $(TMPDIR)\tkBitmap.obj \
- $(TMPDIR)\tkButton.obj \
- $(TMPDIR)\tkCanvArc.obj \
- $(TMPDIR)\tkCanvBmap.obj \
- $(TMPDIR)\tkCanvImg.obj \
- $(TMPDIR)\tkCanvLine.obj \
- $(TMPDIR)\tkCanvPoly.obj \
- $(TMPDIR)\tkCanvPs.obj \
- $(TMPDIR)\tkCanvText.obj \
- $(TMPDIR)\tkCanvUtil.obj \
- $(TMPDIR)\tkCanvWind.obj \
- $(TMPDIR)\tkCanvas.obj \
- $(TMPDIR)\tkClipboard.obj \
- $(TMPDIR)\tkCmds.obj \
- $(TMPDIR)\tkColor.obj \
- $(TMPDIR)\tkConfig.obj \
- $(TMPDIR)\tkCursor.obj \
- $(TMPDIR)\tkEntry.obj \
- $(TMPDIR)\tkError.obj \
- $(TMPDIR)\tkEvent.obj \
- $(TMPDIR)\tkFileFilter.obj \
- $(TMPDIR)\tkFocus.obj \
- $(TMPDIR)\tkFont.obj \
- $(TMPDIR)\tkFrame.obj \
- $(TMPDIR)\tkGC.obj \
- $(TMPDIR)\tkGeometry.obj \
- $(TMPDIR)\tkGet.obj \
- $(TMPDIR)\tkGrab.obj \
- $(TMPDIR)\tkGrid.obj \
- $(TMPDIR)\tkImage.obj \
- $(TMPDIR)\tkImgBmap.obj \
- $(TMPDIR)\tkImgGIF.obj \
- $(TMPDIR)\tkImgPPM.obj \
- $(TMPDIR)\tkImgPhoto.obj \
- $(TMPDIR)\tkImgUtil.obj \
- $(TMPDIR)\tkListbox.obj \
- $(TMPDIR)\tkMacWinMenu.obj \
- $(TMPDIR)\tkMain.obj \
- $(TMPDIR)\tkMenu.obj \
- $(TMPDIR)\tkMenubutton.obj \
- $(TMPDIR)\tkMenuDraw.obj \
- $(TMPDIR)\tkMessage.obj \
- $(TMPDIR)\tkOption.obj \
- $(TMPDIR)\tkPack.obj \
- $(TMPDIR)\tkPlace.obj \
- $(TMPDIR)\tkPointer.obj \
- $(TMPDIR)\tkRectOval.obj \
- $(TMPDIR)\tkScale.obj \
- $(TMPDIR)\tkScrollbar.obj \
- $(TMPDIR)\tkSelect.obj \
- $(TMPDIR)\tkText.obj \
- $(TMPDIR)\tkTextBTree.obj \
- $(TMPDIR)\tkTextDisp.obj \
- $(TMPDIR)\tkTextImage.obj \
- $(TMPDIR)\tkTextIndex.obj \
- $(TMPDIR)\tkTextMark.obj \
- $(TMPDIR)\tkTextTag.obj \
- $(TMPDIR)\tkTextWind.obj \
- $(TMPDIR)\tkTrig.obj \
- $(TMPDIR)\tkUtil.obj \
- $(TMPDIR)\tkVisual.obj \
- $(TMPDIR)\tkWindow.obj
-
-TCLDLL = tcl80.dll
-TCLLIB = tcl80.lib
-TKDLL = tk80.dll
-TKLIB = tk80.lib
-WISH = wish80.exe
-TKTEST = tktest.exe
-
-#
-# Targets
-#
-
-all: cfgdll $(TKDLL) cfgexe $(WISH) cfgcln
-tktest: cfgdll $(TKDLL) cfgtest $(TKTEST) cfgcln
-
-test: tktest
- $(TKTEST) &&|
- cd ../tests
- console show
- update
- source all
-|
-
-# Implicit Targets
-
-.c.obj:
- @$(BCC32) {$< }
-
-.dll.lib:
- $(IMPLIB) -c $@ $<
-
-.rc.res:
- $(RC) -i$(INCLUDES) $<
-
-#
-# Special case object file targets
-#
-
-$(TMPDIR)\testMain.obj : $(ROOT)\win\winMain.c
- $(BCC32) -c -o$@ $(ROOT)\win\winMain.c
-
-#
-# Configuration file targets - these files are implicitly used by the compiler
-#
-
-cfgdll:
- @$(CP) &&|
- -n$(TMPDIR) -I$(INCLUDES) -c -WM
- -D$(DEFINES) -3 -d $(PROJECTCCFLAGS)
-| bcc32.cfg >NUL
-
-cfgexe:
- @$(CP) &&|
- -n$(TMPDIR) -I$(INCLUDES) -c -W
- -D$(DEFINES) -3 -d $(PROJECTCCFLAGS)
-| bcc32.cfg >NUL
-
-cfgtest:
- @$(CP) &&|
- -n$(TMPDIR) -I$(INCLUDES) -c -W
- -D$(DEFINES);TK_TEST -3 -d $(PROJECTCCFLAGS)
-| bcc32.cfg >NUL
-
-cfgcln:
- @$(RM) bcc32.cfg
-
-#
-# Executable targets
-#
-
-$(TKDLL): $(TKOBJS) tk.def rc\tk.res
- $(TLINK32) @&&|
-$(LNFLAGS_dll) $(TKOBJS)
-$@
--x
-$(LNLIBS_dll)
-tk.def
-rc\tk.res
-|
-
-$(WISH): $(WISHOBJS) $(TKLIB) rc\wish.res
- $(TLINK32) @&&|
-$(LNFLAGS_exe) $(WISHOBJS)
-$@
--x
-$(LNLIBS_exe)
-|, &&|
-EXETYPE WINDOWS
-CODE PRELOAD MOVEABLE DISCARDABLE
-DATA PRELOAD MOVEABLE MULTIPLE
-|, rc\wish.res
-
-$(TKTEST): $(TKTESTOBJS) $(TKLIB)
- $(TLINK32) $(LNFLAGS_exe) @&&|
-$(TKTESTOBJS)
-$@
--x
-$(LNLIBS_exe)
-|, &&|
-EXETYPE WINDOWS
-CODE PRELOAD MOVEABLE DISCARDABLE
-DATA PRELOAD MOVEABLE MULTIPLE
-|,
-
-#
-# Other dependencies
-#
-
-rc\wish.res: rc\wish.ico
-rc\tk.res: rc\tk.ico rc\*.cur
-
-# The following rule automatically generates a tk.def file containing
-# an export entry for every public symbol in the $(TKDLL) library.
-
-tk.def: $(TKOBJS)
- $(TCLLIBDIR)\dumpexts.exe -o $@ $(TKDLL) @&&|
- $(TKOBJS)
-|
-
-# rule to build library object files
-
-# debugging rules, the .dll and .exe files must be in the same
-# directory as the object files for debugging purposes
-
-$(TMPDIR)\$(TKDLL): $(TKDLL)
- $(CP) $(TKDLL) $(TMPDIR)
-
-$(TMPDIR)\$(TCLDLL): $(TCLLIBDIR)\$(TCLDLL)
- $(CP) $(TCLLIBDIR)\$(TCLDLL) $(TMPDIR)
-
-$(TMPDIR)\$(WISH): $(WISH)
- $(CP) $(WISH) $(TMPDIR)
-
-$(TMPDIR)\$(TKTEST): $(TKTEST)
- $(CP) $(TKTEST) $(TMPDIR)
-
-debug: $(TMPDIR)\$(TKDLL) $(TMPDIR)\$(TCLDLL) $(TMPDIR)\$(TKTEST)
-
-
-# remove all generated files
-
-clean:
- $(RM) $(WISH)
- $(RM) $(TKTEST)
- $(RM) $(TKLIB)
- $(RM) $(TKDLL)
- $(RM) rc\*.res
- $(RM) tk.def
- $(RM) $(TMPDIR)\*.obj
- $(RM) *.cfg
+#
+# Makefile for Borland C++ 5.5 (or C++ Builder 5), adapted from the makefile
+# for Visual C++ that came with tk 8.3.3
+#
+# Some "not so obvious" details in this makefile are preceded by a comment
+# "maintenance hint", which tries to explain what's going on. Better to
+# leave those in place.
+# Helmut Giese, July 2002
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# Copyright (c) 1995-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-2000 Ajuba Solutions.
+#
+# RCS: @(#) $Id$
+
+# Does not depend on the presence of any environment variables in
+# order to compile tcl; all needed information is derived from
+# location of the compiler directories.
+
+#
+# Project directories
+#
+# ROOT = top of source tree
+#
+# TMPDIR = location where .obj files should be stored during build
+#
+# TOOLS32 = location of Borland development tools.
+#
+# TCLDIR = location of top of Tcl source hierarchy
+#
+
+ROOT = ..
+TCLDIR = ..\..\tcl8.4
+INSTALLDIR = D:\tmp\tcl
+
+# If you have C++ Builder 5 or the free Borland C++ 5.5 compiler
+# adapt the following paths as appropriate for your system
+TOOLS32 = d:\cbld5
+TOOLS32_rc = d:\cbld5
+#TOOLS32 = c:\bc55
+#TOOLS32_rc = c:\bc55
+
+cc32 = "$(TOOLS32)\bin\bcc32.exe"
+link32 = "$(TOOLS32)\bin\ilink32.exe"
+lib32 = "$(TOOLS32)\bin\tlib.exe"
+rc32 = "$(TOOLS32_rc)\bin\brcc32.exe"
+include32 = -I"$(TOOLS32)\include;$(TOOLS32)\include\mfc"
+libpath32 = -L"$(TOOLS32)\lib"
+
+# Uncomment the following line to compile with thread support
+#THREADDEFINES = -DTCL_THREADS=1
+
+# Allow definition of NDEBUG via command line
+# Set NODEBUG to 0 to compile with symbols
+!if !defined(NODEBUG)
+NODEBUG = 1
+!endif
+
+# uncomment the following two lines to compile with TCL_MEM_DEBUG
+#DEBUGDEFINES =-DTCL_MEM_DEBUG
+
+######################################################################
+# Do not modify below this line
+######################################################################
+
+TCLNAMEPREFIX = tcl
+TKNAMEPREFIX = tk
+WISHNAMEPREFIX = wish
+VERSION = 84
+DOTVERSION = 8.4
+
+TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub
+TKSTUBPREFIX = $(TKNAMEPREFIX)stub
+
+
+BINROOT = .
+!IF "$(NODEBUG)" == "1"
+TMPDIRNAME = Release
+DBGX =
+!ELSE
+TMPDIRNAME = Debug
+DBGX =
+#DBGX = d
+!ENDIF
+TMPDIR = $(BINROOT)\$(TMPDIRNAME)
+OUTDIRNAME = $(TMPDIRNAME)
+OUTDIR = $(TMPDIR)
+
+TCLLIB = $(TCLNAMEPREFIX)$(VERSION)$(DBGX).lib
+TCLPLUGINLIB = $(TCLNAMEPREFIX)$(VERSION)p.lib
+TCLSTUBLIB = $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib
+TKDLLNAME = $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll
+TKDLL = $(OUTDIR)\$(TKDLLNAME)
+TKLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib
+TKSTUBLIBNAME = $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib
+TKSTUBLIB = $(OUTDIR)\$(TKSTUBLIBNAME)
+TKPLUGINDLLNAME = $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll
+TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME)
+TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib
+
+WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe
+WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe
+WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe
+TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe
+CAT32 = $(TMPDIR)\cat32.exe
+
+BIN_INSTALL_DIR = $(INSTALLDIR)\bin
+INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include
+LIB_INSTALL_DIR = $(INSTALLDIR)\lib
+SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION)
+
+WISHOBJS = \
+ $(TMPDIR)\winMain.obj
+
+TKTESTOBJS = \
+ $(TMPDIR)\tkTest.obj \
+ $(TMPDIR)\tkSquare.obj \
+ $(TMPDIR)\testMain.obj \
+ $(TMPDIR)\tkWinTest.obj \
+ $(TCLLIBDIR)\tclThreadTest.obj
+
+XLIBOBJS = \
+ $(TMPDIR)\xcolors.obj \
+ $(TMPDIR)\xdraw.obj \
+ $(TMPDIR)\xgc.obj \
+ $(TMPDIR)\ximage.obj \
+ $(TMPDIR)\xutil.obj
+
+TKOBJS = \
+ $(TMPDIR)\tkConsole.obj \
+ $(TMPDIR)\tkUnixMenubu.obj \
+ $(TMPDIR)\tkUnixScale.obj \
+ $(XLIBOBJS) \
+ $(TMPDIR)\tkWin3d.obj \
+ $(TMPDIR)\tkWin32Dll.obj \
+ $(TMPDIR)\tkWinButton.obj \
+ $(TMPDIR)\tkWinClipboard.obj \
+ $(TMPDIR)\tkWinColor.obj \
+ $(TMPDIR)\tkWinConfig.obj \
+ $(TMPDIR)\tkWinCursor.obj \
+ $(TMPDIR)\tkWinDialog.obj \
+ $(TMPDIR)\tkWinDraw.obj \
+ $(TMPDIR)\tkWinEmbed.obj \
+ $(TMPDIR)\tkWinFont.obj \
+ $(TMPDIR)\tkWinImage.obj \
+ $(TMPDIR)\tkWinInit.obj \
+ $(TMPDIR)\tkWinKey.obj \
+ $(TMPDIR)\tkWinMenu.obj \
+ $(TMPDIR)\tkWinPixmap.obj \
+ $(TMPDIR)\tkWinPointer.obj \
+ $(TMPDIR)\tkWinRegion.obj \
+ $(TMPDIR)\tkWinScrlbr.obj \
+ $(TMPDIR)\tkWinSend.obj \
+ $(TMPDIR)\tkWinWindow.obj \
+ $(TMPDIR)\tkWinWm.obj \
+ $(TMPDIR)\tkWinX.obj \
+ $(TMPDIR)\stubs.obj \
+ $(TMPDIR)\tk3d.obj \
+ $(TMPDIR)\tkArgv.obj \
+ $(TMPDIR)\tkAtom.obj \
+ $(TMPDIR)\tkBind.obj \
+ $(TMPDIR)\tkBitmap.obj \
+ $(TMPDIR)\tkButton.obj \
+ $(TMPDIR)\tkCanvArc.obj \
+ $(TMPDIR)\tkCanvBmap.obj \
+ $(TMPDIR)\tkCanvImg.obj \
+ $(TMPDIR)\tkCanvLine.obj \
+ $(TMPDIR)\tkCanvPoly.obj \
+ $(TMPDIR)\tkCanvPs.obj \
+ $(TMPDIR)\tkCanvText.obj \
+ $(TMPDIR)\tkCanvUtil.obj \
+ $(TMPDIR)\tkCanvWind.obj \
+ $(TMPDIR)\tkCanvas.obj \
+ $(TMPDIR)\tkClipboard.obj \
+ $(TMPDIR)\tkCmds.obj \
+ $(TMPDIR)\tkColor.obj \
+ $(TMPDIR)\tkConfig.obj \
+ $(TMPDIR)\tkCursor.obj \
+ $(TMPDIR)\tkEntry.obj \
+ $(TMPDIR)\tkError.obj \
+ $(TMPDIR)\tkEvent.obj \
+ $(TMPDIR)\tkFileFilter.obj \
+ $(TMPDIR)\tkFocus.obj \
+ $(TMPDIR)\tkFont.obj \
+ $(TMPDIR)\tkFrame.obj \
+ $(TMPDIR)\tkGC.obj \
+ $(TMPDIR)\tkGeometry.obj \
+ $(TMPDIR)\tkGet.obj \
+ $(TMPDIR)\tkGrab.obj \
+ $(TMPDIR)\tkGrid.obj \
+ $(TMPDIR)\tkImage.obj \
+ $(TMPDIR)\tkImgBmap.obj \
+ $(TMPDIR)\tkImgGIF.obj \
+ $(TMPDIR)\tkImgPPM.obj \
+ $(TMPDIR)\tkImgPhoto.obj \
+ $(TMPDIR)\tkImgUtil.obj \
+ $(TMPDIR)\tkListbox.obj \
+ $(TMPDIR)\tkMacWinMenu.obj \
+ $(TMPDIR)\tkMain.obj \
+ $(TMPDIR)\tkMenu.obj \
+ $(TMPDIR)\tkMenubutton.obj \
+ $(TMPDIR)\tkMenuDraw.obj \
+ $(TMPDIR)\tkMessage.obj \
+ $(TMP_DIR)\tkPanedWindow.obj \
+ $(TMPDIR)\tkObj.obj \
+ $(TMPDIR)\tkOldConfig.obj \
+ $(TMPDIR)\tkOption.obj \
+ $(TMPDIR)\tkPack.obj \
+ $(TMPDIR)\tkPlace.obj \
+ $(TMPDIR)\tkPointer.obj \
+ $(TMPDIR)\tkRectOval.obj \
+ $(TMPDIR)\tkScale.obj \
+ $(TMPDIR)\tkScrollbar.obj \
+ $(TMPDIR)\tkSelect.obj \
+ $(TMPDIR)\tkText.obj \
+ $(TMPDIR)\tkTextBTree.obj \
+ $(TMPDIR)\tkTextDisp.obj \
+ $(TMPDIR)\tkTextImage.obj \
+ $(TMPDIR)\tkTextIndex.obj \
+ $(TMPDIR)\tkTextMark.obj \
+ $(TMPDIR)\tkTextTag.obj \
+ $(TMPDIR)\tkTextWind.obj \
+ $(TMPDIR)\tkTrig.obj \
+ $(TMPDIR)\tkUtil.obj \
+ $(TMPDIR)\tkVisual.obj \
+ $(TMPDIR)\tkStubInit.obj \
+ $(TMPDIR)\tkStubLib.obj \
+ $(TMPDIR)\tkWindow.obj
+
+# Maintenance hint: Please have multiple members of TKSTUBOBJS be separated
+# by exactly one ' ' (see below the rule for making TKSTUBLIB)
+TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj $(TMPDIR)\tkStubImg.obj
+
+WINDIR = $(ROOT)\win
+GENERICDIR = $(ROOT)\generic
+XLIBDIR = $(ROOT)\xlib
+BITMAPDIR = $(ROOT)\bitmaps
+TCLLIBDIR = $(TCLDIR)\win\$(OUTDIRNAME)
+RCDIR = $(WINDIR)\rc
+
+TK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \
+ -I$(TCLDIR)\generic
+
+TK_DEFINES = -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES)
+
+######################################################################
+# Compile flags
+######################################################################
+
+!IF "$(NODEBUG)" == "1"
+# these macros cause maximum optimization and no symbols
+cdebug = -v- -vi- -O2 -D_DEBUG
+!ELSE
+# these macros enable debugging
+cdebug = -k -Od -r- -v -vi- -y
+!ENDIF
+
+SYSDEFINES = _MT;NO_STRICT;_NO_VCL
+
+# declarations common to all compiler options
+cbase = -3 -a4 -c -g0 -tWM -Ve -Vx -X-
+WARNINGS = -w-rch -w-pch -w-par -w-dup -w-pro -w-dpu
+
+ccons = -tWC
+
+CFLAGS = $(cdebug) $(cbase) $(WARNINGS) -D$(SYSDEFINES)
+
+CON_CFLAGS = $(CFLAGS) $(TK_DEFINES) $(include32) $(ccons)
+WISH_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES)
+TK_CFLAGS = $(CFLAGS) $(include32) $(TK_INCLUDES) $(TK_DEFINES) \
+ -DUSE_TCL_STUBS
+
+######################################################################
+# Link flags
+######################################################################
+
+!IF "$(NODEBUG)" == "1"
+ldebug =
+!ELSE
+ldebug = -v
+!ENDIF
+
+# declarations common to all linker options
+LNFLAGS = -D"" -Gn -I$(TMPDIR) -x $(ldebug) $(libpath32)
+# -Gi: create lib file (is -Gl in doc)
+# -aa: Windows app, -ap: Windows console app
+LNFLAGS_DLL = -ap -Gi -Tpd
+LNFLAGS_CONS = -ap -Tpe
+LNFLAGS_GUI = -aa -Tpe
+
+LNLIBS = import32 cw32mt
+
+
+######################################################################
+# Project specific targets
+######################################################################
+
+all: setup $(WISH) $(CAT32)
+install: install-binaries install-libraries
+plugin: setup $(TKPLUGINDLL) $(WISHP)
+tktest: setup $(TKTEST) $(CAT32)
+
+# Maintenance hint: We want to set environment variables before calling tktest.
+# If we do this in the form of normal commands, they will not persist up to
+# the call of tktest. Therfore we put all commands wanted into a batch file.
+# The normal way of using 'echo >x.bat' and 'echo >>x.bat' does not work here
+# because we cannot write '... > tktest.txt' this way. Hence this advanced
+# form of loop hopping:
+# - Have MAKE produce a temporary file with the content we want.
+# - Use it as input to the COPY command to produce a batch file.
+# - Run the batch file and be happy.
+#
+test: setup $(TKTEST) $(TKLIB) $(CAT32)
+ copy &&!
+ set TCL_LIBRARY=$(TCLDIR)/library
+ set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH)
+ $(TKTEST) $(ROOT)/tests/all.tcl > tktest.txt
+! _test.bat
+ _test.bat
+# del _test.bat
+
+runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
+ echo set TCL_LIBRARY=$(TCLDIR)/library > _test2.bat
+ echo set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH) >> _test2.bat
+ echo $(TKTEST) >> _test2.bat
+ _test2.bat
+# del _test2.bat
+
+console-wish : all $(WISHC)
+
+stubs:
+ $(TCLDIR)\win\$(TMPDIRNAME)\tclsh$(VERSION)$(DBGX) \
+ $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \
+ $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls
+
+setup:
+ @mkd $(TMPDIR)
+ @mkd $(OUTDIR)
+
+install-binaries:
+ @mkd "$(BIN_INSTALL_DIR)"
+ copy $(TKDLL) "$(BIN_INSTALL_DIR)"
+ copy $(WISH) "$(BIN_INSTALL_DIR)"
+ @mkd "$(LIB_INSTALL_DIR)"
+ copy $(TKLIB) "$(LIB_INSTALL_DIR)"
+
+install-libraries:
+ @mkd "$(INCLUDE_INSTALL_DIR)"
+ @mkd "$(INCLUDE_INSTALL_DIR)\X11"
+ copy "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)"
+ copy "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)"
+ copy "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)"
+ copy "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)"
+ xcopy "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11"
+ @mkd "$(SCRIPT_INSTALL_DIR)"
+ @mkd "$(SCRIPT_INSTALL_DIR)\images"
+ @mkd "$(SCRIPT_INSTALL_DIR)\demos"
+ @mkd "$(SCRIPT_INSTALL_DIR)\demos\images"
+ @mkd "$(SCRIPT_INSTALL_DIR)\msgs"
+ xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)"
+ xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images"
+ xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos"
+ xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images"
+ xcopy "$(ROOT)\library\msgs" "$(SCRIPT_INSTALL_DIR)\msgs"
+
+$(TKLIB): $(TKDLL) $(TKSTUBLIB)
+
+# Maintenance hint: The macro puts a '+-' before the first member of
+# TKSTUBOBJS, than replaces any ' ' with ' +-' - together putting '+-' in
+# front of any member of TKSTUBOBJS (provided, they are separated in their
+# defintion by just one space).
+#
+# The first time you *make* this target, you will get a warning
+# tkStubLib not found in library
+# This is (probably) because of the '-' option, telling TLIB to remove
+# 'tkStubLib' when it does not yet exist. Forcing a re-make when it already
+# exists avoids this warning.
+#
+$(TKSTUBLIB): $(TKSTUBOBJS)
+ $(lib32) $@ +-$(TKSTUBOBJS: = +-)
+
+# $(lib32) $@ @&&!
+#+-$(TKSTUBOBJS: = &^
+#+-)
+#!
+
+$(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res
+ $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_DLL) $(TOOLS32)\lib\c0d32 @&&!
+ $(TKOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLSTUBLIB),, $(TMPDIR)\tk.res
+!
+
+$(TKPLUGINLIB): $(TKPLUGINDLL)
+
+#$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res
+# $(link32) $(ldebug) $(dlllflags) \
+# -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \
+# $(guilibsdll) @<<
+# $(TKOBJS)
+#<<
+
+$(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res
+ $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&!
+ $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res
+!
+
+$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res
+ $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 @&&!
+ $(WISHOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res
+!
+
+$(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res
+ $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
+ $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \
+ $(TKPLUGINLIB) $(WISHOBJS)
+
+$(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res
+ $(link32) $(ldebug) -S:2400000 $(LNFLAGS) $(LNFLAGS_GUI) $(TOOLS32)\lib\c0x32 @&&!
+ $(TKTESTOBJS), $@, -x, $(LNLIBS) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB),, $(TMPDIR)\wish.res
+!
+# $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
+# $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS)
+
+#$(CAT32): $(TCLDIR)\win\cat.c
+# $(cc32) $(CON_CFLAGS) -o$(TMPDIR)\cat.obj $?
+# $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs)
+
+$(CAT32): $(TCLDIR)\win\cat.c
+ $(cc32) $(CONS_CFLAGS) -o$(TMPDIR)\cat.obj $?
+ $(link32) $(ldebug) $(LNFLAGS) $(LNFLAGS_CONS) $(TOOLS32)\lib\c0x32 \
+ $(TMPDIR)\cat.obj, $@, -x, $(LNLIBS),,
+
+#
+# Regenerate the stubs files.
+#
+
+genstubs:
+ tclsh$(VERSION) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \
+ $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls
+
+#
+# Special case object file targets
+#
+
+$(TMPDIR)\testMain.obj: $(WINDIR)\winMain.c
+ $(cc32) $(WISH_CFLAGS) -DTK_TEST -o$@ $?
+
+$(TMPDIR)\tkTest.obj: $(GENERICDIR)\tkTest.c
+ $(cc32) $(WISH_CFLAGS) -o$@ $?
+
+$(TMPDIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c
+ $(cc32) $(WISH_CFLAGS) -o$@ $?
+
+$(TMPDIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c
+ $(cc32) $(WISH_CFLAGS) -o$@ $?
+
+$(TMPDIR)\winMain.obj: $(WINDIR)\winMain.c
+ $(cc32) $(WISH_CFLAGS) -o$@ $?
+
+$(TMPDIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c
+ $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -o$@ $?
+
+#
+# Implicit rules
+#
+
+{$(XLIBDIR)}.c{$(TMPDIR)}.obj:
+ $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $<
+
+{$(GENERICDIR)}.c{$(TMPDIR)}.obj:
+ $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $<
+
+{$(WINDIR)}.c{$(TMPDIR)}.obj:
+ $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $<
+
+{$(ROOT)\unix}.c{$(TMPDIR)}.obj:
+ $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o$@ $<
+
+{$(RCDIR)}.rc{$(TMPDIR)}.res:
+ $(rc32) -I"$(GENERICDIR)" -I"$(TOOLS32)\include" -I"$(TCLDIR)\generic" \
+ -D$(USERDEFINES);$(SYSDEFINES) -fo$@ $<
+
+clean:
+ -@del $(OUTDIR)\*.exp
+ -@del $(OUTDIR)\*.lib
+ -@del $(OUTDIR)\*.dll
+ -@del $(OUTDIR)\*.exe
+ -@del $(OUTDIR)\*.pdb
+ -@del $(TMPDIR)\*.pch
+ -@del $(TMPDIR)\*.obj
+ -@del $(TMPDIR)\*.res
+ -@del $(TMPDIR)\*.exe
+ -@rmd $(OUTDIR)
+ -@rmd $(TMPDIR)
+
+# dependencies
+
+$(TMPDIR)\tk.res: \
+ $(RCDIR)\buttons.bmp \
+ $(RCDIR)\cursor*.cur \
+ $(RCDIR)\tk.ico
+
+$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h
+$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h
+
+$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h
+
+$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h
+$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h
+$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h
+$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h
+
+
+
diff --git a/tk/win/makefile.vc b/tk/win/makefile.vc
index b74f01cb95e..469969fd7e2 100644
--- a/tk/win/makefile.vc
+++ b/tk/win/makefile.vc
@@ -1,508 +1,839 @@
-# Visual C++ 2.x and 4.0 makefile
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# Copyright (c) 1995-1997 Sun Microsystems, Inc.
-# RCS: @(#) $Id$
-
-# Does not depend on the presence of any environment variables in
-# order to compile tcl; all needed information is derived from
-# location of the compiler directories.
-
-#
-# Project directories
-#
-# ROOT = top of source tree
-#
-# TMPDIR = location where .obj files should be stored during build
-#
-# TOOLS32 = location of VC++ 32-bit development tools. Note that the
-# VC++ 2.0 header files are broken, so you need to use the
-# ones that come with the developer network CD's, or later
-# versions of VC++.
-#
-# TCLDIR = location of top of Tcl source heirarchy
-#
-
-ROOT = ..
-TCLDIR = ..\..\tcl8.3
-INSTALLDIR = c:\progra~1\tcl
-
-# Set this to the appropriate value of /MACHINE: for your platform
-MACHINE = IX86
-
-!IF "$(MACHINE)" == "IA64"
-TOOLS32 = c:\ia64sdk17
-TOOLS32_rc = c:\ia64sdk17
-!ELSE
-TOOLS32 = c:\Progra~1\devstudio\vc
-TOOLS32_rc = c:\Progra~1\devstudio\sharedide
-!ENDIF
-
-# Uncomment the following line to compile with thread support
-#THREADDEFINES = -DTCL_THREADS=1
-
-# Set NODEBUG to 0 to compile with symbols
-NODEBUG = 1
-
-# uncomment the following two lines to compile with TCL_MEM_DEBUG
-#DEBUGDEFINES =-DTCL_MEM_DEBUG
-
-######################################################################
-# Do not modify below this line
-######################################################################
-
-TCLNAMEPREFIX = tcl
-TKNAMEPREFIX = tk
-WISHNAMEPREFIX = wish
-VERSION = 83
-DOTVERSION = 8.3
-
-TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub
-TKSTUBPREFIX = $(TKNAMEPREFIX)stub
-
-
-BINROOT = .
-!IF "$(NODEBUG)" == "1"
-TMPDIRNAME = Release
-DBGX =
-!ELSE
-TMPDIRNAME = Debug
-DBGX = d
-!ENDIF
-TMPDIR = $(BINROOT)\$(TMPDIRNAME)
-OUTDIRNAME = $(TMPDIRNAME)
-OUTDIR = $(TMPDIR)
-
-TCLLIB = $(TCLNAMEPREFIX)$(VERSION)$(DBGX).lib
-TCLPLUGINLIB = $(TCLNAMEPREFIX)$(VERSION)p.lib
-TCLSTUBLIB = $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib
-TKDLLNAME = $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll
-TKDLL = $(OUTDIR)\$(TKDLLNAME)
-TKLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib
-TKSTUBLIBNAME = $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib
-TKSTUBLIB = $(OUTDIR)\$(TKSTUBLIBNAME)
-TKPLUGINDLLNAME = $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll
-TKPLUGINDLL = $(OUTDIR)\$(TKPLUGINDLLNAME)
-TKPLUGINLIB = $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)p$(DBGX).lib
-
-WISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe
-WISHC = $(OUTDIR)\$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe
-WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe
-TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe
-CAT32 = $(TMPDIR)\cat32.exe
-
-BIN_INSTALL_DIR = $(INSTALLDIR)\bin
-INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include
-LIB_INSTALL_DIR = $(INSTALLDIR)\lib
-SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION)
-
-WISHOBJS = \
- $(TMPDIR)\winMain.obj
-
-TKTESTOBJS = \
- $(TMPDIR)\tkTest.obj \
- $(TMPDIR)\tkSquare.obj \
- $(TMPDIR)\testMain.obj \
- $(TMPDIR)\tkWinTest.obj \
- $(TCLLIBDIR)\tclThreadTest.obj
-
-XLIBOBJS = \
- $(TMPDIR)\xcolors.obj \
- $(TMPDIR)\xdraw.obj \
- $(TMPDIR)\xgc.obj \
- $(TMPDIR)\ximage.obj \
- $(TMPDIR)\xutil.obj
-
-TKOBJS = \
- $(TMPDIR)\tkConsole.obj \
- $(TMPDIR)\tkUnixMenubu.obj \
- $(TMPDIR)\tkUnixScale.obj \
- $(XLIBOBJS) \
- $(TMPDIR)\tkWin3d.obj \
- $(TMPDIR)\tkWin32Dll.obj \
- $(TMPDIR)\tkWinButton.obj \
- $(TMPDIR)\tkWinClipboard.obj \
- $(TMPDIR)\tkWinColor.obj \
- $(TMPDIR)\tkWinConfig.obj \
- $(TMPDIR)\tkWinCursor.obj \
- $(TMPDIR)\tkWinDialog.obj \
- $(TMPDIR)\tkWinDraw.obj \
- $(TMPDIR)\tkWinEmbed.obj \
- $(TMPDIR)\tkWinFont.obj \
- $(TMPDIR)\tkWinImage.obj \
- $(TMPDIR)\tkWinInit.obj \
- $(TMPDIR)\tkWinKey.obj \
- $(TMPDIR)\tkWinMenu.obj \
- $(TMPDIR)\tkWinPixmap.obj \
- $(TMPDIR)\tkWinPointer.obj \
- $(TMPDIR)\tkWinRegion.obj \
- $(TMPDIR)\tkWinScrlbr.obj \
- $(TMPDIR)\tkWinSend.obj \
- $(TMPDIR)\tkWinWindow.obj \
- $(TMPDIR)\tkWinWm.obj \
- $(TMPDIR)\tkWinX.obj \
- $(TMPDIR)\stubs.obj \
- $(TMPDIR)\tk3d.obj \
- $(TMPDIR)\tkArgv.obj \
- $(TMPDIR)\tkAtom.obj \
- $(TMPDIR)\tkBind.obj \
- $(TMPDIR)\tkBitmap.obj \
- $(TMPDIR)\tkButton.obj \
- $(TMPDIR)\tkCanvArc.obj \
- $(TMPDIR)\tkCanvBmap.obj \
- $(TMPDIR)\tkCanvImg.obj \
- $(TMPDIR)\tkCanvLine.obj \
- $(TMPDIR)\tkCanvPoly.obj \
- $(TMPDIR)\tkCanvPs.obj \
- $(TMPDIR)\tkCanvText.obj \
- $(TMPDIR)\tkCanvUtil.obj \
- $(TMPDIR)\tkCanvWind.obj \
- $(TMPDIR)\tkCanvas.obj \
- $(TMPDIR)\tkClipboard.obj \
- $(TMPDIR)\tkCmds.obj \
- $(TMPDIR)\tkColor.obj \
- $(TMPDIR)\tkConfig.obj \
- $(TMPDIR)\tkCursor.obj \
- $(TMPDIR)\tkEntry.obj \
- $(TMPDIR)\tkError.obj \
- $(TMPDIR)\tkEvent.obj \
- $(TMPDIR)\tkFileFilter.obj \
- $(TMPDIR)\tkFocus.obj \
- $(TMPDIR)\tkFont.obj \
- $(TMPDIR)\tkFrame.obj \
- $(TMPDIR)\tkGC.obj \
- $(TMPDIR)\tkGeometry.obj \
- $(TMPDIR)\tkGet.obj \
- $(TMPDIR)\tkGrab.obj \
- $(TMPDIR)\tkGrid.obj \
- $(TMPDIR)\tkImage.obj \
- $(TMPDIR)\tkImgBmap.obj \
- $(TMPDIR)\tkImgGIF.obj \
- $(TMPDIR)\tkImgPPM.obj \
- $(TMPDIR)\tkImgPhoto.obj \
- $(TMPDIR)\tkImgUtil.obj \
- $(TMPDIR)\tkListbox.obj \
- $(TMPDIR)\tkMacWinMenu.obj \
- $(TMPDIR)\tkMain.obj \
- $(TMPDIR)\tkMenu.obj \
- $(TMPDIR)\tkMenubutton.obj \
- $(TMPDIR)\tkMenuDraw.obj \
- $(TMPDIR)\tkMessage.obj \
- $(TMPDIR)\tkObj.obj \
- $(TMPDIR)\tkOldConfig.obj \
- $(TMPDIR)\tkOption.obj \
- $(TMPDIR)\tkPack.obj \
- $(TMPDIR)\tkPlace.obj \
- $(TMPDIR)\tkPointer.obj \
- $(TMPDIR)\tkRectOval.obj \
- $(TMPDIR)\tkScale.obj \
- $(TMPDIR)\tkScrollbar.obj \
- $(TMPDIR)\tkSelect.obj \
- $(TMPDIR)\tkText.obj \
- $(TMPDIR)\tkTextBTree.obj \
- $(TMPDIR)\tkTextDisp.obj \
- $(TMPDIR)\tkTextImage.obj \
- $(TMPDIR)\tkTextIndex.obj \
- $(TMPDIR)\tkTextMark.obj \
- $(TMPDIR)\tkTextTag.obj \
- $(TMPDIR)\tkTextWind.obj \
- $(TMPDIR)\tkTrig.obj \
- $(TMPDIR)\tkUtil.obj \
- $(TMPDIR)\tkVisual.obj \
- $(TMPDIR)\tkStubInit.obj \
- $(TMPDIR)\tkStubLib.obj \
- $(TMPDIR)\tkWindow.obj
-
-TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj \
- $(TMPDIR)\tkStubImg.obj
-
-
-cc32 = "$(TOOLS32)\bin\cl.exe"
-link32 = "$(TOOLS32)\bin\link.exe"
-lib32 = "$(TOOLS32)\bin\lib.exe"
-rc32 = "$(TOOLS32_rc)\bin\rc.exe"
-include32 = -I"$(TOOLS32)\include"
-
-WINDIR = $(ROOT)\win
-GENERICDIR = $(ROOT)\generic
-XLIBDIR = $(ROOT)\xlib
-BITMAPDIR = $(ROOT)\bitmaps
-TCLLIBDIR = $(TCLDIR)\win\$(OUTDIRNAME)
-RCDIR = $(WINDIR)\rc
-
-TK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \
- -I$(TCLDIR)\generic
-TK_DEFINES = -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES)
-
-######################################################################
-# Compile flags
-######################################################################
-
-!IF "$(NODEBUG)" == "1"
-!IF "$(MACHINE)" == "ALPHA"
-# MSVC on Alpha doesn't understand -Ot
-cdebug = -O2i -Gs -GD
-!ELSE
-# NOTE: Due to a bug in MSVC, we cannot use -O2 here or Tk starts to misbehave.
-cdebug = -Oti -Gs -GD
-!ENDIF
-!ELSE
-!IF "$(MACHINE)" == "IA64"
-cdebug = -Od -Zi
-!ELSE
-cdebug = -Z7 -Od -WX
-!ENDIF
-!ENDIF
-
-# declarations common to all compiler options
-cflags = -c -W3 -nologo -Fp$(TMPDIR)\ -YX
-cvarsdll = -MD$(DBGX)
-
-CON_CFLAGS = $(cdebug) $(cflags) $(include32) -DCONSOLE
-TK_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) \
- $(TK_INCLUDES) $(TK_DEFINES) -DUSE_TCL_STUBS
-WISH_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) \
- $(TK_INCLUDES) $(TK_DEFINES)
-
-######################################################################
-# Link flags
-######################################################################
-
-!IF "$(NODEBUG)" == "1"
-ldebug = /RELEASE
-!ELSE
-ldebug = -debug:full -debugtype:cv
-!ENDIF
-
-# declarations common to all linker options
-lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
-lflags = $(lcommon) /MACHINE:$(MACHINE)
-
-# declarations for use on Intel i386, i486, and Pentium systems
-!IF "$(MACHINE)" == "IX86"
-DLLENTRY = @12
-!ENDIF
-
-conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
-guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
-dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
-
-!IF "$(MACHINE)" == "PPC"
-libc = libc$(DBGX).lib
-libcdll = crtdll$(DBGX).lib
-!ELSE
-libc = libc$(DBGX).lib oldnames.lib
-libcdll = msvcrt$(DBGX).lib oldnames.lib
-!ENDIF
-
-baselibs = kernel32.lib $(optlibs) advapi32.lib
-winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
-guilibs = $(libc) $(winlibs)
-conlibs = $(libc) $(baselibs)
-guilibsdll = $(libcdll) $(winlibs)
-
-######################################################################
-# Project specific targets
-######################################################################
-
-all: setup $(WISH) $(CAT32)
-install: install-binaries install-libraries
-plugin: setup $(TKPLUGINDLL) $(WISHP)
-tktest: setup $(TKTEST) $(CAT32)
-test: setup $(TKTEST) $(TKLIB) $(CAT32)
- set TCL_LIBRARY=$(TCLDIR)/library
- set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH)
- $(TKTEST) $(ROOT)/tests/all.tcl | $(CAT32)
-
-runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
- set TCL_LIBRARY=$(TCLDIR)/library
- set PATH=$(TCLDIR)\win\$(TMPDIRNAME);$(PATH)
- $(TKTEST)
-
-console-wish : all $(WISHC)
-
-stubs:
- $(TCLDIR)\win\$(TMPDIRNAME)\tclsh$(VERSION)$(DBGX) \
- $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \
- $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls
-
-setup:
- @mkd $(TMPDIR)
- @mkd $(OUTDIR)
-
-install-binaries:
- @mkd "$(BIN_INSTALL_DIR)"
- copy $(TKDLL) "$(BIN_INSTALL_DIR)"
- copy $(WISH) "$(BIN_INSTALL_DIR)"
- @mkd "$(LIB_INSTALL_DIR)"
- copy $(TKLIB) "$(LIB_INSTALL_DIR)"
-
-install-libraries:
- @mkd "$(INCLUDE_INSTALL_DIR)"
- @mkd "$(INCLUDE_INSTALL_DIR)\X11"
- copy "$(ROOT)\generic\tk.h" "$(INCLUDE_INSTALL_DIR)"
- copy "$(ROOT)\generic\tkDecls.h" "$(INCLUDE_INSTALL_DIR)"
- copy "$(ROOT)\generic\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)"
- xcopy "$(ROOT)\xlib\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11"
- @mkd "$(SCRIPT_INSTALL_DIR)"
- @mkd "$(SCRIPT_INSTALL_DIR)\images"
- @mkd "$(SCRIPT_INSTALL_DIR)\demos"
- @mkd "$(SCRIPT_INSTALL_DIR)\demos\images"
- xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)"
- xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images"
- xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos"
- xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images"
-
-$(TKLIB): $(TKDLL) $(TKSTUBLIB)
-
-$(TKSTUBLIB): $(TKSTUBOBJS)
- $(lib32) /out:$@ $(TKSTUBOBJS)
-
-$(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res
- set LIB=$(TOOLS32)\lib
- $(link32) $(ldebug) $(dlllflags) \
- -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLSTUBLIB) \
- $(guilibsdll) @<<
- $(TKOBJS)
-<<
-
-$(TKPLUGINLIB): $(TKPLUGINDLL)
-
-$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)\tk.res
- set LIB=$(TOOLS32)\lib
- $(link32) $(ldebug) $(dlllflags) \
- -out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLPLUGINLIB) \
- $(guilibsdll) @<<
- $(TKOBJS)
-<<
-
-$(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res
- set LIB=$(TOOLS32)\lib
- $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
- $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(WISHOBJS)
-
-$(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)\wish.res
- set LIB=$(TOOLS32)\lib
- $(link32) $(ldebug) $(conlflags) $(TMPDIR)\wish.res -out:$@ \
- $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(WISHOBJS)
-
-$(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)\wish.res
- set LIB=$(TOOLS32)\lib
- $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
- $(guilibsdll) $(TCLLIBDIR)\$(TCLPLUGINLIB) \
- $(TKPLUGINLIB) $(WISHOBJS)
-
-$(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)\wish.res
- set LIB=$(TOOLS32)\lib
- $(link32) $(ldebug) $(guilflags) $(TMPDIR)\wish.res -out:$@ \
- $(guilibsdll) $(TCLLIBDIR)\$(TCLLIB) $(TKLIB) $(TKTESTOBJS)
-
-$(CAT32): $(TCLDIR)\win\cat.c
- $(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $?
- set LIB=$(TOOLS32)\lib
- $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs)
-
-#
-# Regenerate the stubs files.
-#
-
-genstubs:
- tclsh$(VERSION) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \
- $(GENERICDIR)\tk.decls $(GENERICDIR)\tkInt.decls
-
-#
-# Special case object file targets
-#
-
-$(TMPDIR)\testMain.obj: $(ROOT)\win\winMain.c
- $(cc32) $(WISH_CFLAGS) -DTK_TEST -Fo$@ $?
-
-$(TMPDIR)\tkTest.obj: $(ROOT)\generic\tkTest.c
- $(cc32) $(WISH_CFLAGS) -Fo$@ $?
-
-$(TMPDIR)\tkWinTest.obj: $(ROOT)\generic\tkWinTest.c
- $(cc32) $(WISH_CFLAGS) -Fo$@ $?
-
-$(TMPDIR)\tkSquare.obj: $(ROOT)\generic\tkSquare.c
- $(cc32) $(WISH_CFLAGS) -Fo$@ $?
-
-$(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c
- $(cc32) $(WISH_CFLAGS) -Fo$@ $?
-
-$(TMPDIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c
- $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -Fo$@ $?
-
-#
-# Implicit rules
-#
-
-{$(XLIBDIR)}.c{$(TMPDIR)}.obj:
- $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
-
-{$(GENERICDIR)}.c{$(TMPDIR)}.obj:
- $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
-
-{$(WINDIR)}.c{$(TMPDIR)}.obj:
- $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
-
-{$(ROOT)\unix}.c{$(TMPDIR)}.obj:
- $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
-
-{$(RCDIR)}.rc{$(TMPDIR)}.res:
- $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TOOLS32)\include" \
- -i "$(TCLDIR)\generic" $<
-
-clean:
- -@del $(OUTDIR)\*.exp
- -@del $(OUTDIR)\*.lib
- -@del $(OUTDIR)\*.dll
- -@del $(OUTDIR)\*.exe
- -@del $(OUTDIR)\*.pdb
- -@del $(TMPDIR)\*.pch
- -@del $(TMPDIR)\*.obj
- -@del $(TMPDIR)\*.res
- -@del $(TMPDIR)\*.exe
- -@rmd $(OUTDIR)
- -@rmd $(TMPDIR)
-
-# dependencies
-
-$(TMPDIR)\tk.res: \
- $(RCDIR)\buttons.bmp \
- $(RCDIR)\cursor*.cur \
- $(RCDIR)\tk.ico
-
-$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h
-$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h
-
-$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h
-
-$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h
-$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h
-$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h
-$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h
-
-
-
+#------------------------------------------------------------------------------
+# makefile.vc --
+#
+# Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+)
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# Copyright (c) 1995-1996 Sun Microsystems, Inc.
+# Copyright (c) 1998-2000 Ajuba Solutions.
+# Copyright (c) 2001 ActiveState Corporation.
+# Copyright (c) 2001-2002 David Gravereaux.
+#
+#------------------------------------------------------------------------------
+# RCS: @(#) $Id$
+#------------------------------------------------------------------------------
+
+!if "$(MSVCDIR)" == ""
+MSG = ^
+You'll need to run vcvars32.bat from Developer Studio, first, to setup^
+the environment. Jump to this line to read the new instructions.
+!error $(MSG)
+!endif
+
+#------------------------------------------------------------------------------
+# HOW TO USE this makefile:
+#
+# 1) It is now necessary to have MSVCDir set in the environment. This is used
+# as a check to see if vcvars32.bat had been run prior to running nmake or
+# during the install of Microsoft Developer Studio, MSVCDir had been set
+# globally and the PATH adjusted. Either way is valid.
+#
+# You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin
+# directory to setup the proper environment, if needed, for your current
+# setup. This is a needed bootstrap requirement and allows the swapping of
+# different environments to be easier.
+#
+# 2) To use the Platform SDK (not expressly needed), run setenv.bat after
+# vcvars32.bat according to the instructions for it. This can also turn on
+# the 64-bit compiler, if your SDK has it.
+#
+# 3) Targets are:
+# release -- builds the core, the shell. (default)
+# core -- Only builds the core.
+# all -- builds everything.
+# test -- builds and runs the test suite.
+# tktest -- just builds the binaries for the test suite.
+# install -- installs the built binaries and libraries to $(INSTALLDIR)
+# as the root of the install tree.
+# console-wish -- builds a console version of wish.
+# clean -- removes the contents of $(TMP_DIR)
+# hose -- removes the contents of $(TMP_DIR) and $(OUT_DIR)
+# genstubs -- rebuilds the Stubs table and support files (dev only).
+# depend -- Generates an accurate set of source dependancies for this
+# makefile. Helpful to avoid problems when the sources are
+# refreshed and you rebuild, but can "overbuild" when common
+# headers like tkInt.h just get small changes.
+# winhelp -- builds the windows .hlp file for Tcl from the troff man
+# files.
+#
+# 4) Macros usable on the commandline:
+# TCLDIR=<path>
+# Sets the location for where to find the Tcl headers and
+# libraries. The install point is assumed when not specified.
+# Tk does need the source directory, though. Tk comes very close
+# to not needing the sources, but does, in fact, require them.
+#
+# INSTALLDIR=<path>
+# Sets where to install Tcl from the built binaries.
+# C:\Progra~1\Tcl is assumed when not specified.
+#
+# OPTS=static,msvcrt,linkexten,threads,symbols,profile,none
+# Sets special options for the core. The default is for none.
+# Any combination of the above may be used (comma separated).
+# 'none' will over-ride everything to nothing.
+#
+# static = Builds a static library of the core instead of a
+# dll. The shell will be static (and large), as well.
+# msvcrt = Effects the static option only to switch it from
+# using libcmt(d) as the C runtime [by default] to
+# msvcrt(d). This is useful for static embedding
+# support.
+# linkexten = Affects the static option only to switch wishXX.exe
+# to have the dde and reg extension linked inside it.
+# threads = Turns on full multithreading support.
+# symbols = Adds symbols for step debugging.
+# profile = Adds profiling hooks. Map file is assumed.
+#
+# STATS=memdbg,compdbg,none
+# Sets optional memory and bytecode compiler debugging code added
+# to the core. The default is for none. Any combination of the
+# above may be used (comma separated). 'none' will over-ride
+# everything to nothing.
+#
+# memdbg = Enables the debugging memory allocator.
+# compdbg = Enables byte compilation logging.
+#
+# MACHINE=(IX86|IA64|ALPHA)
+# Set the machine type used for the compiler, linker, and
+# resource compiler. This hook is needed to tell the tools
+# when alternate platforms are requested. IX86 is the default
+# when not specified.
+#
+# TMP_DIR=<path>
+# OUT_DIR=<path>
+# Hooks to allow the intermediate and output directories to be
+# changed. $(OUT_DIR) is assumed to be
+# $(BINROOT)\(Release|Debug) based on if symbols are requested.
+# $(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
+#
+# TESTPAT=<file>
+# Reads the tests requested to be run from this file.
+#
+# 5) Examples:
+#
+# Basic syntax of calling nmake looks like this:
+# nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]]
+#
+# Standard (no frills)
+# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
+# Setting environment for using Microsoft Visual C++ tools.
+# c:\tk_src\win\>nmake -f makefile.vc release
+# c:\tk_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl
+#
+# Building for Win64
+# c:\tk_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
+# Setting environment for using Microsoft Visual C++ tools.
+# c:\tk_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL
+# Targeting Windows pre64 RETAIL
+# c:\tk_src\win\>nmake -f makefile.vc MACHINE=IA64
+#
+#------------------------------------------------------------------------------
+#==============================================================================
+###############################################################################
+
+
+# //==================================================================\\
+# >>[ -> Do not modify below this line. <- ]<<
+# >>[ Please, use the commandline macros to modify how Tcl is built. ]<<
+# >>[ If you need more features, send us a patch for more macros. ]<<
+# \\==================================================================//
+
+
+###############################################################################
+#==============================================================================
+#------------------------------------------------------------------------------
+
+!if !exist("makefile.vc")
+MSG = ^
+You must run this makefile only from the directory it is in.^
+Please `cd` to its location first.
+!error $(MSG)
+!endif
+
+PROJECT = tk
+!include "rules.vc"
+
+_INSTALLDIR = $(INSTALLDIR:/=\)
+
+!if !defined(TCLDIR)
+!if exist($(_INSTALLDIR)\include\tcl.h)
+TCLINSTALL = 1
+_TCLDIR = $(_INSTALLDIR)
+!else
+MSG=^
+Don't know where tcl.h is. Set the _TCLDIR macro.
+!error $(MSG)
+!endif
+!else
+_TCLDIR = $(TCLDIR:/=\)
+!if exist($(_TCLDIR)\include\tcl.h)
+TCLINSTALL = 1
+!elseif exist($(_TCLDIR)\generic\tcl.h)
+TCLINSTALL = 0
+!else
+MSG =^
+Don't know where tcl.h is. the TCLDIR macro doesn't appear correct.
+!error $(MSG)
+!endif
+!endif
+
+!if $(TCLINSTALL)
+!message *** Warning: Tk requires the source distribution of Tcl to build from,
+!message *** at this time, sorry. Please set the TCLDIR macro to point to the
+!message *** Tcl sources.
+!endif
+
+STUBPREFIX = $(PROJECT)stub
+DOTVERSION = 8.4
+VERSION = $(DOTVERSION:.=)
+WISHNAMEPREFIX = wish
+
+BINROOT = .
+ROOT = ..
+
+TCLIMPLIBNAME = tcl$(VERSION)$(SUFX).lib
+TCLLIBNAME = tcl$(VERSION)$(SUFX).$(EXT)
+TCLSTUBLIBNAME = tclstub$(VERSION).lib
+
+TCLREGLIBNAME = tclreg10$(SUFX:t=).lib
+TCLDDELIBNAME = tcldde12$(SUFX:t=).lib
+
+TKIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
+TKLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
+TKLIB = $(OUT_DIR)\$(TKLIBNAME)
+
+TKSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
+TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME)
+
+!if $(TCLINSTALL)
+TCLSH = $(_INSTALLDIR)\bin\tclsh$(VERSION)$(SUFX).exe
+TCLSTUBLIB = $(_INSTALLDIR)\lib\$(TCLSTUBLIBNAME)
+TCLIMPLIB = $(_INSTALLDIR)\lib\$(TCLIMPLIBNAME)
+TCL_LIBRARY = $(_INSTALLDIR)\lib
+TCLREGLIB = $(_INSTALLDIR)\lib\$(TCLREGLIBNAME)
+TCLDDELIB = $(_INSTALLDIR)\lib\$(TCLDDELIBNAME)
+TCLTMP_DIR = \must\have\tcl\sources\to\build\this\target
+COFFBASE = \must\have\tcl\sources\to\build\this\target
+TOOLSDIR = \must\have\tcl\sources\to\build\this\target
+!else
+TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(VERSION)$(SUFX).exe
+TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLSTUBLIBNAME)
+TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLIMPLIBNAME)
+TCL_LIBRARY = $(_TCLDIR)\library
+TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLREGLIBNAME)
+TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLDDELIBNAME)
+TCLTMP_DIR = $(_TCLDIR)\win\$(TMP_DIR:tk=tcl)
+COFFBASE = $(_TCLDIR)\win\coffbase.txt
+TOOLSDIR = $(_TCLDIR)\tools
+!endif
+
+WISH = $(OUT_DIR)\$(WISHNAMEPREFIX)$(VERSION)$(SUFX).exe
+WISHC = $(OUT_DIR)\$(WISHNAMEPREFIX)c$(VERSION)$(SUFX).exe
+
+TKTEST = $(OUT_DIR)\$(PROJECT)test.exe
+CAT32 = $(OUT_DIR)\cat32.exe
+RMDIR = .\rmd.bat
+RM = del
+
+LIB_INSTALL_DIR = $(_INSTALLDIR)\lib
+BIN_INSTALL_DIR = $(_INSTALLDIR)\bin
+DOC_INSTALL_DIR = $(_INSTALLDIR)\doc
+SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(DOTVERSION)
+INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include
+
+WISHOBJS = \
+ $(TMP_DIR)\winMain.obj \
+!if $(TCL_LINKWITHEXTENSIONS)
+ $(TCLDDELIB) \
+ $(TCLREGLIB) \
+!endif
+ $(TMP_DIR)\wish.res
+
+TKTESTOBJS = \
+ $(TMP_DIR)\tkTest.obj \
+ $(TMP_DIR)\tkSquare.obj \
+ $(TMP_DIR)\testMain.obj \
+ $(TMP_DIR)\tkWinTest.obj \
+ $(TCLTMP_DIR)\tclThreadTest.obj
+
+XLIBOBJS = \
+ $(TMP_DIR)\xcolors.obj \
+ $(TMP_DIR)\xdraw.obj \
+ $(TMP_DIR)\xgc.obj \
+ $(TMP_DIR)\ximage.obj \
+ $(TMP_DIR)\xutil.obj
+
+TKOBJS = \
+ $(TMP_DIR)\tkConsole.obj \
+ $(TMP_DIR)\tkUnixMenubu.obj \
+ $(TMP_DIR)\tkUnixScale.obj \
+ $(XLIBOBJS) \
+ $(TMP_DIR)\tkWin3d.obj \
+ $(TMP_DIR)\tkWin32Dll.obj \
+ $(TMP_DIR)\tkWinButton.obj \
+ $(TMP_DIR)\tkWinClipboard.obj \
+ $(TMP_DIR)\tkWinColor.obj \
+ $(TMP_DIR)\tkWinConfig.obj \
+ $(TMP_DIR)\tkWinCursor.obj \
+ $(TMP_DIR)\tkWinDialog.obj \
+ $(TMP_DIR)\tkWinDraw.obj \
+ $(TMP_DIR)\tkWinEmbed.obj \
+ $(TMP_DIR)\tkWinFont.obj \
+ $(TMP_DIR)\tkWinImage.obj \
+ $(TMP_DIR)\tkWinInit.obj \
+ $(TMP_DIR)\tkWinKey.obj \
+ $(TMP_DIR)\tkWinMenu.obj \
+ $(TMP_DIR)\tkWinPixmap.obj \
+ $(TMP_DIR)\tkWinPointer.obj \
+ $(TMP_DIR)\tkWinRegion.obj \
+ $(TMP_DIR)\tkWinScrlbr.obj \
+ $(TMP_DIR)\tkWinSend.obj \
+ $(TMP_DIR)\tkWinWindow.obj \
+ $(TMP_DIR)\tkWinWm.obj \
+ $(TMP_DIR)\tkWinX.obj \
+ $(TMP_DIR)\stubs.obj \
+ $(TMP_DIR)\tk3d.obj \
+ $(TMP_DIR)\tkArgv.obj \
+ $(TMP_DIR)\tkAtom.obj \
+ $(TMP_DIR)\tkBind.obj \
+ $(TMP_DIR)\tkBitmap.obj \
+ $(TMP_DIR)\tkButton.obj \
+ $(TMP_DIR)\tkCanvArc.obj \
+ $(TMP_DIR)\tkCanvBmap.obj \
+ $(TMP_DIR)\tkCanvImg.obj \
+ $(TMP_DIR)\tkCanvLine.obj \
+ $(TMP_DIR)\tkCanvPoly.obj \
+ $(TMP_DIR)\tkCanvPs.obj \
+ $(TMP_DIR)\tkCanvText.obj \
+ $(TMP_DIR)\tkCanvUtil.obj \
+ $(TMP_DIR)\tkCanvWind.obj \
+ $(TMP_DIR)\tkCanvas.obj \
+ $(TMP_DIR)\tkClipboard.obj \
+ $(TMP_DIR)\tkCmds.obj \
+ $(TMP_DIR)\tkColor.obj \
+ $(TMP_DIR)\tkConfig.obj \
+ $(TMP_DIR)\tkCursor.obj \
+ $(TMP_DIR)\tkEntry.obj \
+ $(TMP_DIR)\tkError.obj \
+ $(TMP_DIR)\tkEvent.obj \
+ $(TMP_DIR)\tkFileFilter.obj \
+ $(TMP_DIR)\tkFocus.obj \
+ $(TMP_DIR)\tkFont.obj \
+ $(TMP_DIR)\tkFrame.obj \
+ $(TMP_DIR)\tkGC.obj \
+ $(TMP_DIR)\tkGeometry.obj \
+ $(TMP_DIR)\tkGet.obj \
+ $(TMP_DIR)\tkGrab.obj \
+ $(TMP_DIR)\tkGrid.obj \
+ $(TMP_DIR)\tkImage.obj \
+ $(TMP_DIR)\tkImgBmap.obj \
+ $(TMP_DIR)\tkImgGIF.obj \
+ $(TMP_DIR)\tkImgPPM.obj \
+ $(TMP_DIR)\tkImgPhoto.obj \
+ $(TMP_DIR)\tkImgUtil.obj \
+ $(TMP_DIR)\tkListbox.obj \
+ $(TMP_DIR)\tkMacWinMenu.obj \
+ $(TMP_DIR)\tkMain.obj \
+ $(TMP_DIR)\tkMenu.obj \
+ $(TMP_DIR)\tkMenubutton.obj \
+ $(TMP_DIR)\tkMenuDraw.obj \
+ $(TMP_DIR)\tkMessage.obj \
+ $(TMP_DIR)\tkPanedWindow.obj \
+ $(TMP_DIR)\tkObj.obj \
+ $(TMP_DIR)\tkOldConfig.obj \
+ $(TMP_DIR)\tkOption.obj \
+ $(TMP_DIR)\tkPack.obj \
+ $(TMP_DIR)\tkPlace.obj \
+ $(TMP_DIR)\tkPointer.obj \
+ $(TMP_DIR)\tkRectOval.obj \
+ $(TMP_DIR)\tkScale.obj \
+ $(TMP_DIR)\tkScrollbar.obj \
+ $(TMP_DIR)\tkSelect.obj \
+ $(TMP_DIR)\tkStyle.obj \
+ $(TMP_DIR)\tkText.obj \
+ $(TMP_DIR)\tkTextBTree.obj \
+ $(TMP_DIR)\tkTextDisp.obj \
+ $(TMP_DIR)\tkTextImage.obj \
+ $(TMP_DIR)\tkTextIndex.obj \
+ $(TMP_DIR)\tkTextMark.obj \
+ $(TMP_DIR)\tkTextTag.obj \
+ $(TMP_DIR)\tkTextWind.obj \
+ $(TMP_DIR)\tkTrig.obj \
+ $(TMP_DIR)\tkUndo.obj \
+ $(TMP_DIR)\tkUtil.obj \
+ $(TMP_DIR)\tkVisual.obj \
+ $(TMP_DIR)\tkStubInit.obj \
+ $(TMP_DIR)\tkStubLib.obj \
+ $(TMP_DIR)\tkWindow.obj \
+!if !$(STATIC_BUILD)
+ $(TMP_DIR)\tk.res
+!endif
+
+TKSTUBOBJS = \
+ $(TMP_DIR)\tkStubLib.obj \
+ $(TMP_DIR)\tkStubImg.obj
+
+
+WINDIR = $(ROOT)\win
+GENERICDIR = $(ROOT)\generic
+XLIBDIR = $(ROOT)\xlib
+BITMAPDIR = $(ROOT)\bitmaps
+DOCDIR = $(ROOT)\doc
+RCDIR = $(WINDIR)\rc
+
+!if $(TCLINSTALL)
+TCL_INCLUDES = -I "$(_TCLDIR)\include"
+!else
+TCL_INCLUDES = -I "$(_TCLDIR)\win" -I "$(_TCLDIR)\generic"
+!endif
+TK_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" -I"$(BITMAPDIR)" -I"$(XLIBDIR)" \
+ $(TCL_INCLUDES)
+
+TK_DEFINES = $(OPTDEFINES)
+
+
+#---------------------------------------------------------------------
+# Compile flags
+#---------------------------------------------------------------------
+
+!if $(DEBUG)
+!if "$(MACHINE)" == "IA64"
+cdebug = -Od -Zi
+!else
+cdebug = -Z7 -Od -WX
+!endif
+!else
+# This cranks the optimization level up. We can't use -02 because sometimes
+# it causes problems.
+cdebug = -Oti
+!endif
+
+# declarations common to all compiler options
+cflags = -nologo -c -W3 -YX -Fp$(TMP_DIR)^\
+
+!if $(PENT_0F_ERRATA)
+cflags = $(cflags) -QI0f
+!endif
+
+!if $(ITAN_B_ERRATA)
+cflags = $(cflags) -QIA64_Bx
+!endif
+
+!if $(MSVCRT)
+crt = -MD$(DBGX)
+!else
+crt = -MT$(DBGX)
+!endif
+
+BASE_CLFAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES)
+TK_CFLAGS = $(BASE_CLFAGS) $(TK_DEFINES) -DUSE_TCL_STUBS
+CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
+WISH_CFLAGS = $(BASE_CLFAGS) $(TK_DEFINES)
+
+
+#---------------------------------------------------------------------
+# Link flags
+#---------------------------------------------------------------------
+
+!if $(DEBUG)
+ldebug = -debug:full -debugtype:cv
+!else
+ldebug = -release -opt:ref -opt:icf,3
+!endif
+
+# declarations common to all linker options
+lflags = -nologo -machine:$(MACHINE) $(ldebug)
+
+!if $(PROFILE)
+lflags = $(lflags) -profile
+!endif
+
+!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
+# align sections for PE size savings.
+lflags = $(lflags) -opt:nowin98
+!else if !$(ALIGN98_HACK) && $(STATIC_BUILD)
+# align sections for speed in loading by choosing the virtual page size.
+lflags = $(lflags) -align:4096
+!endif
+
+!if $(LOIMPACT)
+lflags = $(lflags) -ws:aggressive
+!endif
+
+dlllflags = $(lflags) -dll
+conlflags = $(lflags) -subsystem:console
+guilflags = $(lflags) -subsystem:windows
+
+baselibs = kernel32.lib advapi32.lib user32.lib
+guilibs = $(baselibs) shell32.lib gdi32.lib comdlg32.lib winspool.lib imm32.lib comctl32.lib
+
+
+#---------------------------------------------------------------------
+# TkTest flags
+#---------------------------------------------------------------------
+
+!if "$(TESTPAT)" != ""
+TESTFLAGS = -file $(TESTPAT)
+!endif
+
+
+#---------------------------------------------------------------------
+# Project specific targets
+#---------------------------------------------------------------------
+
+release: setup $(TKSTUBLIB) $(WISH)
+all: release $(CAT32)
+core: setup $(TKSTUBLIB) $(TKLIB)
+console-wish : $(WISHC)
+install: install-binaries install-libraries install-docs
+tktest: setup $(TKTEST) $(CAT32)
+
+
+test: setup $(TKTEST) $(TKLIB) $(CAT32)
+ set TCL_LIBRARY=$(TCL_LIBRARY)
+!if $(TCLINSTALL)
+ set PATH=$(_TCLDIR)\bin;$(PATH)
+!else
+ set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
+!endif
+!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
+ $(TKTEST) $(ROOT)/tests/all.tcl $(TESTFLAGS) | $(CAT32)
+!else
+ $(TKTEST) $(ROOT)/tests/all.tcl $(TESTFLAGS) | $(CAT32)
+!endif
+
+runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
+ set TCL_LIBRARY=$(TCL_LIBRARY)
+!if $(TCLINSTALL)
+ set PATH=$(_TCLDIR)\bin;$(PATH)
+!else
+ set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
+!endif
+ $(TKTEST)
+
+rundemo: setup $(TKTEST) $(TKLIB) $(CAT32)
+ set TCL_LIBRARY=$(TCL_LIBRARY)
+!if $(TCLINSTALL)
+ set PATH=$(_TCLDIR)\bin;$(PATH)
+!else
+ set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
+!endif
+ $(TKTEST) $(ROOT)\library\demos\widget
+
+setup:
+ @if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
+ @if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
+
+!if !$(STATIC_BUILD)
+$(TKIMPLIB): $(TKLIB)
+!endif
+
+$(TKLIB): $(TKOBJS)
+!if $(STATIC_BUILD)
+ $(lib32) -nologo -out:$@ @<<
+$**
+<<
+!else
+ $(link32) $(dlllflags) -base:@$(COFFBASE),tk -out:$@ $(guilibs) \
+ $(TCLSTUBLIB) @<<
+$**
+<<
+ -@del $*.exp
+!endif
+
+
+$(TKSTUBLIB): $(TKSTUBOBJS)
+ $(lib32) -nologo -out:$@ $**
+
+
+$(WISH): $(WISHOBJS) $(TKIMPLIB)
+ $(link32) $(guilflags) -out:$@ $(guilibs) $(TCLIMPLIB) $**
+
+$(WISHC): $(WISHOBJS) $(TKIMPLIB)
+ $(link32) $(conlflags) -out:$@ $(guilibs) $(TCLIMPLIB) $**
+
+$(TKTEST): $(TKTESTOBJS) $(TKIMPLIB)
+ $(link32) $(guilflags) -out:$@ $(guilibs) $(TCLIMPLIB) $**
+
+
+$(CAT32): $(_TCLDIR)\win\cat.c
+ $(cc32) $(CON_CFLAGS) -Fo$(TMP_DIR)\ $?
+ $(link32) $(conlflags) -out:$@ -stack:16384 $(TMP_DIR)\cat.obj $(baselibs)
+
+install-binaries:
+ @xcopy /i /y "$(WISH)" "$(BIN_INSTALL_DIR)\"
+!if "$(TKLIB)" != "$(TKIMPLIB)"
+ @xcopy /i /y "$(TKLIB)" "$(BIN_INSTALL_DIR)\"
+!endif
+ @xcopy /i /y "$(TKIMPLIB)" "$(LIB_INSTALL_DIR)\"
+ @xcopy /i /y "$(TKSTUBLIB)" "$(LIB_INSTALL_DIR)\"
+
+install-libraries:
+ @xcopy /i /y "$(GENERICDIR)\tk.h" "$(INCLUDE_INSTALL_DIR)\"
+ @xcopy /i /y "$(GENERICDIR)\tkDecls.h" "$(INCLUDE_INSTALL_DIR)\"
+ @xcopy /i /y "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
+ @xcopy /i /y "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\"
+ @xcopy /i /y "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\"
+ @xcopy /i /y "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\*" "$(SCRIPT_INSTALL_DIR)\"
+ @xcopy /i /y "$(ROOT)\library\demos\*" "$(SCRIPT_INSTALL_DIR)\demos\"
+ @xcopy /i /y "$(ROOT)\library\demos\images\*" "$(SCRIPT_INSTALL_DIR)\demos\images\"
+ @xcopy /i /y "$(ROOT)\library\images\*" "$(SCRIPT_INSTALL_DIR)\images\"
+ @xcopy /i /y "$(ROOT)\library\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\"
+
+
+#---------------------------------------------------------------------
+# Regenerate the stubs files.
+#---------------------------------------------------------------------
+
+genstubs:
+ $(TCLSH) $(_TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \
+ $(GENERICDIR)\$(PROJECT).decls $(GENERICDIR)\$(PROJECT)Int.decls
+
+
+#---------------------------------------------------------------------
+# Generate the makefile depedancies.
+#---------------------------------------------------------------------
+
+depend:
+!if !exist($(TCLSH))
+ @echo Build tclsh first!
+!else
+ $(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
+ -passthru:"-DBUILD_tcl $(TK_INCLUDES:"="")" $(GENERICDIR) \
+ $(COMPATDIR) $(WINDIR) @<<
+$(TKOBJS)
+<<
+!endif
+
+
+#---------------------------------------------------------------------
+# Regenerate the windows help files.
+#---------------------------------------------------------------------
+
+HLPBASE = $(PROJECT)$(VERSION)
+HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp
+HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt
+DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs
+HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf
+MAN2HELP = $(DOCTMP_DIR)\man2help.tcl
+MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl
+INDEX = $(DOCTMP_DIR)\index.tcl
+BMP = $(DOCTMP_DIR)\lamp.bmp
+BMP_NOPATH = lamp.bmp
+MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe
+
+winhelp: docsetup $(HELPFILE)
+
+docsetup:
+ @if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR)
+
+$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TOOLSDIR)\$$(@F)
+ copy $(TOOLSDIR)\$(@F) $(@D)
+
+$(BMP):
+ copy $(WINDIR)\$(@F) $(@D)
+
+$(HELPFILE): $(HELPRTF) $(BMP)
+ cd $(DOCTMP_DIR)
+ start /wait hcrtf.exe -x <<$(PROJECT).hpj
+[OPTIONS]
+COMPRESS=12 Hall Zeck
+LCID=0x409 0x0 0x0 ; English (United States)
+TITLE=Tk Reference Manual
+BMROOT=.
+CNT=$(@B).cnt
+HLP=$(@B).hlp
+
+[FILES]
+$(PROJECT).rtf
+
+[WINDOWS]
+main="Tcl/Tk Reference Manual",,27648,(r15263976),(r4227327)
+
+[CONFIG]
+BrowseButtons()
+CreateButton(1, "Web", ExecFile("http://www.tcl.tk"))
+CreateButton(2, "SF", ExecFile("http://sf.net/projects/tcl"))
+CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
+CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/"))
+<<
+ cd $(MAKEDIR)
+ copy "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
+ copy "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
+
+$(MAN2TCL): $(TOOLSDIR)\$$(@B).c
+ $(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TOOLSDIR)\$(@B).c -link -out:$@
+
+$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX)
+ $(TCLSH) $(MAN2HELP:\=/) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/)
+
+install-docs:
+!if exist($(HELPFILE))
+ @xcopy /i /y "$(HELPFILE)" "$(DOC_INSTALL_DIR)\"
+ @xcopy /i /y "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
+ $(TCLSH) <<
+puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..."
+set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(VERSION).cnt" r]
+while {![eof $$f]} {
+ if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} {
+ if {$$ver == $(VERSION)} {
+ puts "Already installed."
+ exit
+ } else {
+ # do something here logical to remove (or replace) it.
+ puts "$$ver != $(VERSION), unfinished code path, die, die!"
+ exit 1
+ }
+ }
+}
+close $$f
+set f [open $(DOC_INSTALL_DIR:\=/)/tcl$(VERSION).cnt a]
+puts $$f {:Include $(HLPBASE).cnt}
+close $$f
+<<
+ start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(VERSION).hlp
+!endif
+
+#---------------------------------------------------------------------
+# Special case object file targets
+#---------------------------------------------------------------------
+
+$(TMP_DIR)\testMain.obj: $(WINDIR)\winMain.c
+!if $(TCL_LINKWITHEXTENSIONS)
+ $(cc32) $(WISH_CFLAGS) -DTK_TEST -DTCL_LINKWITHEXTENSIONS -Fo$@ $?
+!else
+ $(cc32) $(WISH_CFLAGS) -DTK_TEST -Fo$@ $?
+!endif
+
+$(TMP_DIR)\tkTest.obj: $(GENERICDIR)\tkTest.c
+ $(cc32) $(WISH_CFLAGS) -Fo$@ $?
+
+$(TMP_DIR)\tkWinTest.obj: $(WINDIR)\tkWinTest.c
+ $(cc32) $(WISH_CFLAGS) -Fo$@ $?
+
+$(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c
+ $(cc32) $(WISH_CFLAGS) -Fo$@ $?
+
+$(TMP_DIR)\winMain.obj: $(WINDIR)\winMain.c
+!if $(TCL_LINKWITHEXTENSIONS)
+ $(cc32) $(WISH_CFLAGS) -DTCL_LINKWITHEXTENSIONS -Fo$@ $?
+!else
+ $(cc32) $(WISH_CFLAGS) -Fo$@ $?
+!endif
+
+# The following objects are part of the stub library and should not
+# be built as DLL objects but none of the symbols should be exported
+# and no reference made to a C runtime.
+
+$(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c
+ $(cc32) $(cdebug) $(cflags) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $?
+
+$(TMP_DIR)\tkStubImg.obj : $(GENERICDIR)\tkStubImg.c
+ $(cc32) $(cdebug) $(cflags) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $?
+
+
+#---------------------------------------------------------------------
+# Dedependency rules
+#---------------------------------------------------------------------
+
+$(TMP_DIR)\tk.res: \
+ $(RCDIR)\buttons.bmp \
+ $(RCDIR)\cursor*.cur \
+ $(RCDIR)\tk.ico
+
+$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h
+$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkPanedWindow.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h
+$(GENERICDIR)/tkUndo.c: $(GENERICDIR)/tkUndo.h
+
+$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h
+$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h
+
+$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h
+$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h
+$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h
+$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h
+
+!if exist("$(OUT_DIR)\depend.mk")
+!include "$(OUT_DIR)\depend.mk"
+!message *** Dependency rules in effect.
+!else
+!message *** Dependency rules are not being used.
+!endif
+
+### add a spacer in the output
+!message
+
+#---------------------------------------------------------------------
+# Implicit rules
+#---------------------------------------------------------------------
+
+{$(XLIBDIR)}.c{$(TMP_DIR)}.obj::
+ $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<<
+$<
+<<
+
+{$(GENERICDIR)}.c{$(TMP_DIR)}.obj::
+ $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<<
+$<
+<<
+
+{$(WINDIR)}.c{$(TMP_DIR)}.obj::
+ $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<<
+$<
+<<
+
+{$(ROOT)\unix}.c{$(TMP_DIR)}.obj::
+ $(cc32) -DBUILD_tk $(TK_CFLAGS) -Fo$(TMP_DIR)\ @<<
+$<
+<<
+
+{$(RCDIR)}.rc{$(TMP_DIR)}.res:
+ $(rc32) -fo $@ -r -i "$(GENERICDIR)" $(TCL_INCLUDES) \
+!if $(DEBUG)
+ -d DEBUG \
+!endif
+!if $(TCL_THREADS)
+ -d TCL_THREADS \
+!endif
+!if $(STATIC_BUILD)
+ -d STATIC_BUILD \
+!endif
+ $<
+
+#---------------------------------------------------------------------
+# Clean up
+#---------------------------------------------------------------------
+
+clean:
+ -@$(RMDIR) $(TMP_DIR)
+
+hose: clean
+ -@$(RMDIR) $(OUT_DIR)
+
+
+.SUFFIXES:
+.SUFFIXES:.c .rc
+
diff --git a/tk/win/mkd.bat b/tk/win/mkd.bat
index 13203f1c7a1..ac35788ce2b 100644
--- a/tk/win/mkd.bat
+++ b/tk/win/mkd.bat
@@ -1,22 +1,14 @@
-@echo off
-rem RCS: @(#) $Id$
-
-if exist %1\tag.txt goto end
-
-if "%OS%" == "Windows_NT" goto winnt
-
-md %1
-if errorlevel 1 goto end
-
-goto success
-
-:winnt
-md %1
-if errorlevel 1 goto end
-
-:success
-echo TAG >%1\tag.txt
-echo created directory %1
-
-:end
-
+@echo off
+rem RCS: @(#) $Id$
+
+if exist %1\nul goto end
+
+md %1
+if errorlevel 1 goto end
+
+echo Created directory %1
+
+:end
+
+
+
diff --git a/tk/win/nmakehlp.c b/tk/win/nmakehlp.c
new file mode 100644
index 00000000000..5021ae11cbe
--- /dev/null
+++ b/tk/win/nmakehlp.c
@@ -0,0 +1,297 @@
+/* ----------------------------------------------------------------------------
+ * nmakehlp.c --
+ *
+ * This is used to fix limitations within nmake and the environment.
+ *
+ * Copyright (c) 2002 by David Gravereaux.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * ----------------------------------------------------------------------------
+ * RCS: @(#) $Id$
+ * ----------------------------------------------------------------------------
+ */
+#include <windows.h>
+#pragma comment (lib, "user32.lib")
+#pragma comment (lib, "kernel32.lib")
+
+/* protos */
+int CheckForCompilerFeature (const char *option);
+int CheckForLinkerFeature (const char *option);
+int IsIn (const char *string, const char *substring);
+DWORD WINAPI ReadFromPipe (LPVOID args);
+
+/* globals */
+typedef struct {
+ HANDLE pipe;
+ char buffer[1000];
+} pipeinfo;
+
+pipeinfo Out = {INVALID_HANDLE_VALUE, '\0'};
+pipeinfo Err = {INVALID_HANDLE_VALUE, '\0'};
+
+
+
+/* exitcodes: 0 == no, 1 == yes, 2 == error */
+int
+main (int argc, char *argv[])
+{
+ char msg[300];
+ DWORD dwWritten;
+ int chars;
+
+ if (argc > 1 && *argv[1] == '-') {
+ switch (*(argv[1]+1)) {
+ case 'c':
+ if (argc != 3) {
+ chars = wsprintf(msg, "usage: %s -c <compiler option>\n"
+ "Tests for whether cl.exe supports an option\n"
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+ }
+ return CheckForCompilerFeature(argv[2]);
+ case 'l':
+ if (argc != 3) {
+ chars = wsprintf(msg, "usage: %s -l <linker option>\n"
+ "Tests for whether link.exe supports an option\n"
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+ }
+ return CheckForLinkerFeature(argv[2]);
+ case 'f':
+ if (argc == 2) {
+ chars = wsprintf(msg, "usage: %s -f <string> <substring>\n"
+ "Find a substring within another\n"
+ "exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+ } else if (argc == 3) {
+ /* if the string is blank, there is no match */
+ return 0;
+ } else {
+ return IsIn(argv[2], argv[3]);
+ }
+ }
+ }
+ chars = wsprintf(msg, "usage: %s -c|-l|-f ...\n"
+ "This is a little helper app to equalize shell differences between WinNT and\n"
+ "Win9x and get nmake.exe to accomplish its job.\n",
+ argv[0]);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
+ return 2;
+}
+
+int
+CheckForCompilerFeature (const char *option)
+{
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ SECURITY_ATTRIBUTES sa;
+ DWORD threadID;
+ char msg[300];
+ BOOL ok;
+ HANDLE hProcess, h, pipeThreads[2];
+ char cmdline[100];
+
+ hProcess = GetCurrentProcess();
+
+ ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ si.dwFlags = STARTF_USESTDHANDLES;
+ si.hStdInput = INVALID_HANDLE_VALUE;
+
+ ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = FALSE;
+
+ /* create a non-inheritible pipe. */
+ CreatePipe(&Out.pipe, &h, &sa, 0);
+
+ /* dupe the write side, make it inheritible, and close the original. */
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* Same as above, but for the error side. */
+ CreatePipe(&Err.pipe, &h, &sa, 0);
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdError,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* base command line */
+ strcpy(cmdline, "cl.exe -nologo -c -TC -Fdtemp ");
+ /* append our option for testing */
+ strcat(cmdline, option);
+ /* filename to compile, which exists, but is nothing and empty. */
+ strcat(cmdline, " nul");
+
+ ok = CreateProcess(
+ NULL, /* Module name. */
+ cmdline, /* Command line. */
+ NULL, /* Process handle not inheritable. */
+ NULL, /* Thread handle not inheritable. */
+ TRUE, /* yes, inherit handles. */
+ DETACHED_PROCESS, /* No console for you. */
+ NULL, /* Use parent's environment block. */
+ NULL, /* Use parent's starting directory. */
+ &si, /* Pointer to STARTUPINFO structure. */
+ &pi); /* Pointer to PROCESS_INFORMATION structure. */
+
+ if (!ok) {
+ DWORD err = GetLastError();
+ int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars],
+ (300-chars), 0);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL);
+ return 2;
+ }
+
+ /* close our references to the write handles that have now been inherited. */
+ CloseHandle(si.hStdOutput);
+ CloseHandle(si.hStdError);
+
+ WaitForInputIdle(pi.hProcess, 5000);
+ CloseHandle(pi.hThread);
+
+ /* start the pipe reader threads. */
+ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
+ pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
+
+ /* block waiting for the process to end. */
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ CloseHandle(pi.hProcess);
+
+ /* clean up temporary files before returning */
+ DeleteFile("temp.idb");
+ DeleteFile("temp.pdb");
+
+ /* wait for our pipe to get done reading, should it be a little slow. */
+ WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
+ CloseHandle(pipeThreads[0]);
+ CloseHandle(pipeThreads[1]);
+
+ /* look for the commandline warning code in both streams. */
+ return !(strstr(Out.buffer, "D4002") != NULL || strstr(Err.buffer, "D4002") != NULL);
+}
+
+int
+CheckForLinkerFeature (const char *option)
+{
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ SECURITY_ATTRIBUTES sa;
+ DWORD threadID;
+ char msg[300];
+ BOOL ok;
+ HANDLE hProcess, h, pipeThreads[2];
+ char cmdline[100];
+
+ hProcess = GetCurrentProcess();
+
+ ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ si.dwFlags = STARTF_USESTDHANDLES;
+ si.hStdInput = INVALID_HANDLE_VALUE;
+
+ ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ /* create a non-inheritible pipe. */
+ CreatePipe(&Out.pipe, &h, &sa, 0);
+
+ /* dupe the write side, make it inheritible, and close the original. */
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* Same as above, but for the error side. */
+ CreatePipe(&Err.pipe, &h, &sa, 0);
+ DuplicateHandle(hProcess, h, hProcess, &si.hStdError,
+ 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
+
+ /* base command line */
+ strcpy(cmdline, "link.exe -nologo ");
+ /* append our option for testing */
+ strcat(cmdline, option);
+ /* filename to compile, which exists, but is nothing and empty. */
+// strcat(cmdline, " nul");
+
+ ok = CreateProcess(
+ NULL, /* Module name. */
+ cmdline, /* Command line. */
+ NULL, /* Process handle not inheritable. */
+ NULL, /* Thread handle not inheritable. */
+ TRUE, /* yes, inherit handles. */
+ DETACHED_PROCESS, /* No console for you. */
+ NULL, /* Use parent's environment block. */
+ NULL, /* Use parent's starting directory. */
+ &si, /* Pointer to STARTUPINFO structure. */
+ &pi); /* Pointer to PROCESS_INFORMATION structure. */
+
+ if (!ok) {
+ DWORD err = GetLastError();
+ int chars = wsprintf(msg, "Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS |
+ FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPVOID) &msg[chars],
+ (300-chars), 0);
+ WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, strlen(msg), &err, NULL);
+ return 2;
+ }
+
+ /* close our references to the write handles that have now been inherited. */
+ CloseHandle(si.hStdOutput);
+ CloseHandle(si.hStdError);
+
+ WaitForInputIdle(pi.hProcess, 5000);
+ CloseHandle(pi.hThread);
+
+ /* start the pipe reader threads. */
+ pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
+ pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
+
+ /* block waiting for the process to end. */
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ CloseHandle(pi.hProcess);
+
+ /* wait for our pipe to get done reading, should it be a little slow. */
+ WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
+ CloseHandle(pipeThreads[0]);
+ CloseHandle(pipeThreads[1]);
+
+ /* look for the commandline warning code in the stderr stream. */
+ return !(strstr(Out.buffer, "LNK1117") != NULL || strstr(Err.buffer, "LNK1117") != NULL);
+}
+
+DWORD WINAPI
+ReadFromPipe (LPVOID args)
+{
+ pipeinfo *pi = (pipeinfo *) args;
+ char *lastBuf = pi->buffer;
+ DWORD dwRead;
+ BOOL ok;
+
+again:
+ ok = ReadFile(pi->pipe, lastBuf, 25, &dwRead, 0L);
+ if (!ok || dwRead == 0) {
+ CloseHandle(pi->pipe);
+ return 0;
+ }
+ lastBuf += dwRead;
+ goto again;
+
+ return 0; /* makes the compiler happy */
+}
+
+int
+IsIn (const char *string, const char *substring)
+{
+ return (strstr(string, substring) != NULL);
+}
diff --git a/tk/win/rc/tk.rc b/tk/win/rc/tk.rc
index 00d90046acb..099c75c9400 100644
--- a/tk/win/rc/tk.rc
+++ b/tk/win/rc/tk.rc
@@ -1,39 +1,76 @@
-// RCS: @(#) $Id$
-//
-// Version
-//
-
-#include <windows.h>
-#define RESOURCE_INCLUDED
-#include <tk.h>
-
-#define STRINGIFY1(x) #x
-#define STRINGIFY(x) STRINGIFY1(x)
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
- PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
- FILEFLAGSMASK 0x3fL
- FILEFLAGS 0x0L
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "FileDescription", "Tk DLL\0"
- VALUE "OriginalFilename", "tk" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) ".dll\0"
- VALUE "CompanyName", "Scriptics Corporation\0"
- VALUE "FileVersion", TK_PATCH_LEVEL
- VALUE "LegalCopyright", "Copyright \251 2000 by Scriptics Corporation\0"
- VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
- VALUE "ProductVersion", TK_PATCH_LEVEL
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
+// RCS: @(#) $Id$
+//
+// Version Resource Script
+//
+
+#include <windows.h>
+#include <tk.h>
+
+//
+// build-up the name suffix that defines the type of build this is.
+//
+#ifdef TCL_THREADS
+#define SUFFIX_THREADS "t"
+#else
+#define SUFFIX_THREADS ""
+#endif
+
+#ifdef DEBUG
+#define SUFFIX_DEBUG "d"
+#else
+#define SUFFIX_DEBUG ""
+#endif
+
+#define SUFFIX SUFFIX_THREADS SUFFIX_DEBUG
+
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
+ PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
+ FILEFLAGSMASK 0x3fL
+#ifdef DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "Tk DLL\0"
+ VALUE "OriginalFilename", "tk" STRINGIFY(JOIN(TK_MAJOR_VERSION,TK_MINOR_VERSION)) SUFFIX ".dll\0"
+ VALUE "CompanyName", "ActiveState Corporation\0"
+ VALUE "FileVersion", TK_PATCH_LEVEL
+ VALUE "LegalCopyright", "Copyright \251 2001 by ActiveState Corporation, et al\0"
+ VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
+ VALUE "ProductVersion", TK_PATCH_LEVEL
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+//
+// Include the base resources.
+//
+
+#include "tk_base.rc"
+
+//
+// This enables themed scrollbars in XP by trying to use comctl32 v6.
+//
+
+#ifndef RT_MANIFEST
+#define RT_MANIFEST 24
+#endif
+#ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID
+#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
+#endif
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wish.exe.manifest"
+
diff --git a/tk/win/rc/tk_base.rc b/tk/win/rc/tk_base.rc
index 52d64d21ae9..277f631363b 100644
--- a/tk/win/rc/tk_base.rc
+++ b/tk/win/rc/tk_base.rc
@@ -1,130 +1,131 @@
-// RCS: @(#) $Id$
-//
-// Base resources needed by Tk whether it's a DLL or a static library.
-//
-
-//
-// Tk Icon
-//
-
-tk ICON DISCARDABLE "tk.ico"
-
-#include <dlgs.h>
-
-FILEOPENORD DIALOG DISCARDABLE 36, 24, 218, 138
-STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Choose Directory"
-FONT 8, "Helv"
-BEGIN
- LTEXT "Directory &name:",-1,8,6,118,9
- EDITTEXT edt10,8,26,144,12, WS_TABSTOP | ES_AUTOHSCROLL
- LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED |
- LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT |
- LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
- LTEXT "Dri&ves:",stc4,8,106,92,9
- COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
- CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
- WS_VSCROLL | WS_TABSTOP
- DEFPUSHBUTTON "OK",1,160,6,50,14,WS_GROUP
- PUSHBUTTON "Cancel",2,160,24,50,14,WS_GROUP
- PUSHBUTTON "&Help",psh15,160,42,50,14,WS_GROUP
- CHECKBOX "&Read only",chx1,160,66,50,12,WS_GROUP
- PUSHBUTTON "Net&work...",psh14,160,115,50,14,WS_GROUP
-
- LTEXT "a",stc3,9,143,114,15
- EDITTEXT edt1,7,158,135,20,NOT WS_TABSTOP
- LISTBOX lst1,8,205,134,42,LBS_NOINTEGRALHEIGHT
- COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
- CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
- WS_VSCROLL
-
-END
-
-
-//
-// Bitmaps
-//
-
-buttons BITMAP DISCARDABLE "buttons.bmp"
-
-//
-// Cursors
-//
-
-X_cursor CURSOR DISCARDABLE "cursor00.cur"
-arrow CURSOR DISCARDABLE "cursor02.cur"
-based_arrow_down CURSOR DISCARDABLE "cursor04.cur"
-based_arrow_up CURSOR DISCARDABLE "cursor06.cur"
-boat CURSOR DISCARDABLE "cursor08.cur"
-bogosity CURSOR DISCARDABLE "cursor0a.cur"
-bottom_left_corner CURSOR DISCARDABLE "cursor0c.cur"
-bottom_right_corner CURSOR DISCARDABLE "cursor0e.cur"
-bottom_side CURSOR DISCARDABLE "cursor10.cur"
-bottom_tee CURSOR DISCARDABLE "cursor12.cur"
-box_spiral CURSOR DISCARDABLE "cursor14.cur"
-center_ptr CURSOR DISCARDABLE "cursor16.cur"
-circle CURSOR DISCARDABLE "cursor18.cur"
-clock CURSOR DISCARDABLE "cursor1a.cur"
-coffee_mug CURSOR DISCARDABLE "cursor1c.cur"
-cross CURSOR DISCARDABLE "cursor1e.cur"
-cross_reverse CURSOR DISCARDABLE "cursor20.cur"
-crosshair CURSOR DISCARDABLE "cursor22.cur"
-diamond_cross CURSOR DISCARDABLE "cursor24.cur"
-dot CURSOR DISCARDABLE "cursor26.cur"
-dotbox CURSOR DISCARDABLE "cursor28.cur"
-double_arrow CURSOR DISCARDABLE "cursor2a.cur"
-draft_large CURSOR DISCARDABLE "cursor2c.cur"
-draft_small CURSOR DISCARDABLE "cursor2e.cur"
-draped_box CURSOR DISCARDABLE "cursor30.cur"
-exchange CURSOR DISCARDABLE "cursor32.cur"
-fleur CURSOR DISCARDABLE "cursor34.cur"
-gobbler CURSOR DISCARDABLE "cursor36.cur"
-gumby CURSOR DISCARDABLE "cursor38.cur"
-hand1 CURSOR DISCARDABLE "cursor3a.cur"
-hand2 CURSOR DISCARDABLE "cursor3c.cur"
-heart CURSOR DISCARDABLE "cursor3e.cur"
-icon CURSOR DISCARDABLE "cursor40.cur"
-iron_cross CURSOR DISCARDABLE "cursor42.cur"
-left_ptr CURSOR DISCARDABLE "cursor44.cur"
-left_side CURSOR DISCARDABLE "cursor46.cur"
-left_tee CURSOR DISCARDABLE "cursor48.cur"
-leftbutton CURSOR DISCARDABLE "cursor4a.cur"
-ll_angle CURSOR DISCARDABLE "cursor4c.cur"
-lr_angle CURSOR DISCARDABLE "cursor4e.cur"
-man CURSOR DISCARDABLE "cursor50.cur"
-middlebutton CURSOR DISCARDABLE "cursor52.cur"
-mouse CURSOR DISCARDABLE "cursor54.cur"
-pencil CURSOR DISCARDABLE "cursor56.cur"
-pirate CURSOR DISCARDABLE "cursor58.cur"
-plus CURSOR DISCARDABLE "cursor5a.cur"
-question_arrow CURSOR DISCARDABLE "cursor5c.cur"
-right_ptr CURSOR DISCARDABLE "cursor5e.cur"
-right_side CURSOR DISCARDABLE "cursor60.cur"
-right_tee CURSOR DISCARDABLE "cursor62.cur"
-rightbutton CURSOR DISCARDABLE "cursor64.cur"
-rtl_logo CURSOR DISCARDABLE "cursor66.cur"
-sailboat CURSOR DISCARDABLE "cursor68.cur"
-sb_down_arrow CURSOR DISCARDABLE "cursor6a.cur"
-sb_h_double_arrow CURSOR DISCARDABLE "cursor6c.cur"
-sb_left_arrow CURSOR DISCARDABLE "cursor6e.cur"
-sb_right_arrow CURSOR DISCARDABLE "cursor70.cur"
-sb_up_arrow CURSOR DISCARDABLE "cursor72.cur"
-sb_v_double_arrow CURSOR DISCARDABLE "cursor74.cur"
-shuttle CURSOR DISCARDABLE "cursor76.cur"
-sizing CURSOR DISCARDABLE "cursor78.cur"
-spider CURSOR DISCARDABLE "cursor7a.cur"
-spraycan CURSOR DISCARDABLE "cursor7c.cur"
-star CURSOR DISCARDABLE "cursor7e.cur"
-target CURSOR DISCARDABLE "cursor80.cur"
-tcross CURSOR DISCARDABLE "cursor82.cur"
-top_left_arrow CURSOR DISCARDABLE "cursor84.cur"
-top_left_corner CURSOR DISCARDABLE "cursor86.cur"
-top_right_corner CURSOR DISCARDABLE "cursor88.cur"
-top_side CURSOR DISCARDABLE "cursor8a.cur"
-top_tee CURSOR DISCARDABLE "cursor8c.cur"
-trek CURSOR DISCARDABLE "cursor8e.cur"
-ul_angle CURSOR DISCARDABLE "cursor90.cur"
-umbrella CURSOR DISCARDABLE "cursor92.cur"
-ur_angle CURSOR DISCARDABLE "cursor94.cur"
-watch CURSOR DISCARDABLE "cursor96.cur"
-xterm CURSOR DISCARDABLE "cursor98.cur"
+// RCS: @(#) $Id$
+//
+// Base resources needed by Tk whether it's a DLL or a static library.
+//
+
+//
+// Tk Icon
+//
+
+tk ICON DISCARDABLE "tk.ico"
+
+#include <dlgs.h>
+
+FILEOPENORD DIALOG DISCARDABLE 36, 24, 218, 138
+STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Choose Directory"
+FONT 8, "Helv"
+BEGIN
+ LTEXT "Directory &name:",-1,8,6,118,9
+ EDITTEXT edt10,8,26,144,12, WS_TABSTOP | ES_AUTOHSCROLL
+ LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED |
+ LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT |
+ LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
+ LTEXT "Dri&ves:",stc4,8,106,92,9
+ COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
+ CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
+ WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "OK",1,160,6,50,14,WS_GROUP
+ PUSHBUTTON "Cancel",2,160,24,50,14,WS_GROUP
+ PUSHBUTTON "&Help",psh15,160,42,50,14,WS_GROUP
+ CHECKBOX "&Read only",chx1,160,66,50,12,WS_GROUP
+ PUSHBUTTON "Net&work...",psh14,160,115,50,14,WS_GROUP
+
+ LTEXT "a",stc3,9,143,114,15
+ EDITTEXT edt1,7,158,135,20,NOT WS_TABSTOP
+ LISTBOX lst1,8,205,134,42,LBS_NOINTEGRALHEIGHT
+ COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
+ CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
+ WS_VSCROLL
+
+END
+
+
+//
+// Bitmaps
+//
+
+buttons BITMAP DISCARDABLE "buttons.bmp"
+
+//
+// Cursors
+//
+
+X_cursor CURSOR DISCARDABLE "cursor00.cur"
+arrow CURSOR DISCARDABLE "cursor02.cur"
+based_arrow_down CURSOR DISCARDABLE "cursor04.cur"
+based_arrow_up CURSOR DISCARDABLE "cursor06.cur"
+boat CURSOR DISCARDABLE "cursor08.cur"
+bogosity CURSOR DISCARDABLE "cursor0a.cur"
+bottom_left_corner CURSOR DISCARDABLE "cursor0c.cur"
+bottom_right_corner CURSOR DISCARDABLE "cursor0e.cur"
+bottom_side CURSOR DISCARDABLE "cursor10.cur"
+bottom_tee CURSOR DISCARDABLE "cursor12.cur"
+box_spiral CURSOR DISCARDABLE "cursor14.cur"
+center_ptr CURSOR DISCARDABLE "cursor16.cur"
+circle CURSOR DISCARDABLE "cursor18.cur"
+clock CURSOR DISCARDABLE "cursor1a.cur"
+coffee_mug CURSOR DISCARDABLE "cursor1c.cur"
+cross CURSOR DISCARDABLE "cursor1e.cur"
+cross_reverse CURSOR DISCARDABLE "cursor20.cur"
+crosshair CURSOR DISCARDABLE "cursor22.cur"
+diamond_cross CURSOR DISCARDABLE "cursor24.cur"
+dot CURSOR DISCARDABLE "cursor26.cur"
+dotbox CURSOR DISCARDABLE "cursor28.cur"
+double_arrow CURSOR DISCARDABLE "cursor2a.cur"
+draft_large CURSOR DISCARDABLE "cursor2c.cur"
+draft_small CURSOR DISCARDABLE "cursor2e.cur"
+draped_box CURSOR DISCARDABLE "cursor30.cur"
+exchange CURSOR DISCARDABLE "cursor32.cur"
+fleur CURSOR DISCARDABLE "cursor34.cur"
+gobbler CURSOR DISCARDABLE "cursor36.cur"
+gumby CURSOR DISCARDABLE "cursor38.cur"
+hand1 CURSOR DISCARDABLE "cursor3a.cur"
+hand2 CURSOR DISCARDABLE "cursor3c.cur"
+heart CURSOR DISCARDABLE "cursor3e.cur"
+icon CURSOR DISCARDABLE "cursor40.cur"
+iron_cross CURSOR DISCARDABLE "cursor42.cur"
+left_ptr CURSOR DISCARDABLE "cursor44.cur"
+left_side CURSOR DISCARDABLE "cursor46.cur"
+left_tee CURSOR DISCARDABLE "cursor48.cur"
+leftbutton CURSOR DISCARDABLE "cursor4a.cur"
+ll_angle CURSOR DISCARDABLE "cursor4c.cur"
+lr_angle CURSOR DISCARDABLE "cursor4e.cur"
+man CURSOR DISCARDABLE "cursor50.cur"
+middlebutton CURSOR DISCARDABLE "cursor52.cur"
+mouse CURSOR DISCARDABLE "cursor54.cur"
+pencil CURSOR DISCARDABLE "cursor56.cur"
+pirate CURSOR DISCARDABLE "cursor58.cur"
+plus CURSOR DISCARDABLE "cursor5a.cur"
+question_arrow CURSOR DISCARDABLE "cursor5c.cur"
+right_ptr CURSOR DISCARDABLE "cursor5e.cur"
+right_side CURSOR DISCARDABLE "cursor60.cur"
+right_tee CURSOR DISCARDABLE "cursor62.cur"
+rightbutton CURSOR DISCARDABLE "cursor64.cur"
+rtl_logo CURSOR DISCARDABLE "cursor66.cur"
+sailboat CURSOR DISCARDABLE "cursor68.cur"
+sb_down_arrow CURSOR DISCARDABLE "cursor6a.cur"
+sb_h_double_arrow CURSOR DISCARDABLE "cursor6c.cur"
+sb_left_arrow CURSOR DISCARDABLE "cursor6e.cur"
+sb_right_arrow CURSOR DISCARDABLE "cursor70.cur"
+sb_up_arrow CURSOR DISCARDABLE "cursor72.cur"
+sb_v_double_arrow CURSOR DISCARDABLE "cursor74.cur"
+shuttle CURSOR DISCARDABLE "cursor76.cur"
+sizing CURSOR DISCARDABLE "cursor78.cur"
+spider CURSOR DISCARDABLE "cursor7a.cur"
+spraycan CURSOR DISCARDABLE "cursor7c.cur"
+star CURSOR DISCARDABLE "cursor7e.cur"
+target CURSOR DISCARDABLE "cursor80.cur"
+tcross CURSOR DISCARDABLE "cursor82.cur"
+top_left_arrow CURSOR DISCARDABLE "cursor84.cur"
+top_left_corner CURSOR DISCARDABLE "cursor86.cur"
+top_right_corner CURSOR DISCARDABLE "cursor88.cur"
+top_side CURSOR DISCARDABLE "cursor8a.cur"
+top_tee CURSOR DISCARDABLE "cursor8c.cur"
+trek CURSOR DISCARDABLE "cursor8e.cur"
+ul_angle CURSOR DISCARDABLE "cursor90.cur"
+umbrella CURSOR DISCARDABLE "cursor92.cur"
+ur_angle CURSOR DISCARDABLE "cursor94.cur"
+watch CURSOR DISCARDABLE "cursor96.cur"
+xterm CURSOR DISCARDABLE "cursor98.cur"
+
diff --git a/tk/win/rc/wish.exe.manifest b/tk/win/rc/wish.exe.manifest
new file mode 100644
index 00000000000..3fcc7c3b8f3
--- /dev/null
+++ b/tk/win/rc/wish.exe.manifest
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+ version="8.4.0.4"
+ processorArchitecture="X86"
+ name="Tcl.Tk.wish"
+ type="win32"
+/>
+<description>Tcl/Tk windowing shell (wish)</description>
+<dependency>
+<dependentAssembly>
+<assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="X86"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+/>
+</dependentAssembly>
+</dependency>
+</assembly>
+
diff --git a/tk/win/rc/wish.rc b/tk/win/rc/wish.rc
index 5505c7b2c6a..1f5659db99c 100644
--- a/tk/win/rc/wish.rc
+++ b/tk/win/rc/wish.rc
@@ -1,47 +1,89 @@
-// RCS: @(#) $Id$
-//
-// Version
-//
-#include <windows.h>
-
-#define RESOURCE_INCLUDED
-#include <tk.h>
-
-#define STRINGIFY1(x) #x
-#define STRINGIFY(x) STRINGIFY1(x)
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
- PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
- FILEFLAGSMASK 0x3fL
- FILEFLAGS 0x0L
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "FileDescription", "Wish Application\0"
- VALUE "OriginalFilename", "wish" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) ".exe\0"
- VALUE "CompanyName", "Scriptics Corporation\0"
- VALUE "FileVersion", TK_PATCH_LEVEL
- VALUE "LegalCopyright", "Copyright \251 2000 by Scriptics Corporation\0"
- VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
- VALUE "ProductVersion", TK_PATCH_LEVEL
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-//
-// Icon
-//
-
-wish ICON DISCARDABLE "wish.ico"
-
-
+// RCS: @(#) $Id$
+//
+// Version Resource Script
+//
+
+#include <windows.h>
+#include <tk.h>
+
+//
+// build-up the name suffix that defines the type of build this is.
+//
+#ifdef TCL_THREADS
+#define SUFFIX_THREADS "t"
+#else
+#define SUFFIX_THREADS ""
+#endif
+
+#ifdef STATIC_BUILD
+#define SUFFIX_STATIC "s"
+#else
+#define SUFFIX_STATIC ""
+#endif
+
+#ifdef DEBUG
+#define SUFFIX_DEBUG "d"
+#else
+#define SUFFIX_DEBUG ""
+#endif
+
+#define SUFFIX SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG
+
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
+ PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
+ FILEFLAGSMASK 0x3fL
+#ifdef DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "Wish Application\0"
+ VALUE "OriginalFilename", "wish" STRINGIFY(JOIN(TK_MAJOR_VERSION,TK_MINOR_VERSION)) SUFFIX ".exe\0"
+ VALUE "CompanyName", "ActiveState Corporation\0"
+ VALUE "FileVersion", TK_PATCH_LEVEL
+ VALUE "LegalCopyright", "Copyright \251 2000 by ActiveState Corporation, et al\0"
+ VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
+ VALUE "ProductVersion", TK_PATCH_LEVEL
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+//
+// Icon
+//
+// The icon whose name or resource ID is lexigraphically first, is used
+// as the application's icon.
+//
+
+app ICON DISCARDABLE "wish.ico"
+
+#ifdef STATIC_BUILD
+#include "tk_base.rc"
+#endif
+
+//
+// This enables themed scrollbars in XP by trying to use comctl32 v6.
+//
+
+#ifndef RT_MANIFEST
+#define RT_MANIFEST 24
+#endif
+#ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID
+#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
+#endif
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wish.exe.manifest"
+
diff --git a/tk/win/rmd.bat b/tk/win/rmd.bat
index 63bf7619ac5..ee82bb12720 100644
--- a/tk/win/rmd.bat
+++ b/tk/win/rmd.bat
@@ -1,26 +1,22 @@
-@echo off
-rem RCS: @(#) $Id$
-
-if not exist %1\tag.txt goto end
-
-echo Removing directory %1
-
-if "%OS%" == "Windows_NT" goto winnt
-
-cd %1
-if errorlevel 1 goto end
-del *.*
-cd ..
-rmdir %1
-if errorlevel 1 goto end
-goto success
-
-:winnt
-rmdir %1 /s /q
-if errorlevel 1 goto end
-
-:success
-echo deleted directory %1
-
-:end
-
+@echo off
+rem RCS: @(#) $Id$
+
+if not exist %1\nul goto end
+
+echo Removing directory %1
+
+if "%OS%" == "Windows_NT" goto winnt
+
+deltree /y %1
+if errorlevel 1 goto end
+goto success
+
+:winnt
+rmdir /s /q %1
+if errorlevel 1 goto end
+
+:success
+echo Deleted directory %1
+
+:end
+
diff --git a/tk/win/rules.vc b/tk/win/rules.vc
new file mode 100644
index 00000000000..e77fb25edbe
--- /dev/null
+++ b/tk/win/rules.vc
@@ -0,0 +1,263 @@
+#------------------------------------------------------------------------------
+# rules.vc --
+#
+# Microsoft Visual C++ makefile include for decoding the commandline
+# macros. This file does not need editing to build Tcl.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+#
+# Copyright (c) 2001-2002 David Gravereaux.
+#
+#------------------------------------------------------------------------------
+# RCS: @(#) $Id$
+#------------------------------------------------------------------------------
+
+!ifndef _RULES_VC
+_RULES_VC = 1
+
+cc32 = $(CC) # built-in default.
+link32 = link
+lib32 = lib
+rc32 = $(RC) # built-in default.
+
+!ifndef INSTALLDIR
+INSTALLDIR = C:\Progra~1\Tcl
+!endif
+
+!ifndef MACHINE
+MACHINE = IX86
+!endif
+
+!message ===============================================================================
+
+#----------------------------------------------------------
+# build the helper app we need to overcome nmake's limiting
+# environment.
+#----------------------------------------------------------
+
+!if !exist(nmakehlp.exe)
+!if [$(cc32) -nologo -ML nmakehlp.c -link -subsystem:console > nul]
+!endif
+!endif
+
+#----------------------------------------------------------
+# Test for compiler features
+#----------------------------------------------------------
+
+### test for optimizations
+!if [nmakehlp -c -Otip]
+!message *** Compiler has 'Optimizations'
+OPTIMIZING = 1
+!else
+!message *** Compiler doesn't have 'Optimizations'
+OPTIMIZING = 0
+!endif
+
+!if "$(MACHINE)" == "IX86"
+### test for pentium errata
+!if [nmakehlp -c -QI0f]
+!message *** Compiler has 'Pentium 0x0f fix'
+PENT_0F_ERRATA = 1
+!else
+!message *** Compiler doesn't have 'Pentium 0x0f fix'
+PENT_0F_ERRATA = 0
+!endif
+### test for -align:4096, when align:512 will do.
+!if [nmakehlp -l -opt:nowin98]
+!message *** Linker has 'Win98 alignment problem'
+ALIGN98_HACK = 1
+!else
+!message *** Linker doesn't have 'Win98 alignment problem'
+ALIGN98_HACK = 0
+!endif
+!else
+PENT_0F_ERRATA = 0
+ALIGN98_HACK = 0
+!endif
+
+!if "$(MACHINE)" == "IA64"
+### test for Itanium errata
+!if [nmakehlp -c -QIA64_Bx]
+!message *** Compiler has 'B-stepping errata workarounds'
+ITAN_B_ERRATA = 1
+!else
+!message *** Compiler doesn't have 'B-stepping errata workarounds'
+ITAN_B_ERRATA = 0
+!endif
+!else
+ITAN_B_ERRATA = 0
+!endif
+
+#----------------------------------------------------------
+# Decode the options requested.
+#----------------------------------------------------------
+
+!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
+STATIC_BUILD = 0
+TCL_THREADS = 0
+DEBUG = 0
+PROFILE = 0
+MSVCRT = 0
+LOIMPACT = 0
+TCL_LINKWITHEXTENSIONS = 0
+!else
+!if [nmakehlp -f $(OPTS) "static"]
+!message *** Doing static
+STATIC_BUILD = 1
+!else
+STATIC_BUILD = 0
+!endif
+!if [nmakehlp -f $(OPTS) "msvcrt"]
+!message *** Doing msvcrt
+MSVCRT = 1
+!else
+MSVCRT = 0
+!endif
+!if [nmakehlp -f $(OPTS) "linkexten"]
+!message *** Doing linkexten
+TCL_LINKWITHEXTENSIONS = 1
+!else
+TCL_LINKWITHEXTENSIONS = 0
+!endif
+!if [nmakehlp -f $(OPTS) "threads"]
+!message *** Doing threads
+TCL_THREADS = 1
+!else
+TCL_THREADS = 0
+!endif
+!if [nmakehlp -f $(OPTS) "symbols"]
+!message *** Doing symbols
+DEBUG = 1
+!else
+DEBUG = 0
+!endif
+!if [nmakehlp -f $(OPTS) "profile"]
+!message *** Doing profile
+PROFILE = 1
+!else
+PROFILE = 0
+!endif
+!if [nmakehlp -f $(OPTS) "loimpact"]
+!message *** Doing loimpact
+LOIMPACT = 1
+!else
+LOIMPACT = 0
+!endif
+!endif
+
+
+!if !$(STATIC_BUILD)
+# Make sure we don't build overly fat DLLs.
+MSVCRT = 1
+# We shouldn't statically put the extensions inside the shell when dynamic.
+TCL_LINKWITHEXTENSIONS = 0
+!endif
+
+
+#----------------------------------------------------------
+# Figure-out how to name our intermediate and output directories.
+# We wouldn't want different builds to use the same .obj files
+# by accident.
+#----------------------------------------------------------
+
+SUFX = tsdx
+
+!if $(DEBUG)
+BUILDDIRTOP = Debug
+DBGX = d
+!else
+BUILDDIRTOP = Release
+DBGX =
+SUFX = $(SUFX:d=)
+!endif
+
+TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX
+
+!if !$(STATIC_BUILD)
+TMP_DIRFULL = $(TMP_DIRFULL:Static=)
+SUFX = $(SUFX:s=)
+EXT = dll
+!if $(MSVCRT)
+TMP_DIRFULL = $(TMP_DIRFULL:X=)
+SUFX = $(SUFX:x=)
+!endif
+!else
+TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)
+EXT = lib
+!if !$(MSVCRT)
+TMP_DIRFULL = $(TMP_DIRFULL:X=)
+SUFX = $(SUFX:x=)
+!endif
+!endif
+
+!if !$(TCL_THREADS)
+TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)
+SUFX = $(SUFX:t=)
+!endif
+
+!ifndef TMP_DIR
+TMP_DIR = $(TMP_DIRFULL)
+!ifndef OUT_DIR
+OUT_DIR = .\$(BUILDDIRTOP)
+!endif
+!else
+!ifndef OUT_DIR
+OUT_DIR = $(TMP_DIR)
+!endif
+!endif
+
+
+#----------------------------------------------------------
+# Decode the statistics requested.
+#----------------------------------------------------------
+
+!if "$(STATS)" == "" || [nmakehlp -f "$(STATS)" "none"]
+TCL_MEM_DEBUG = 0
+TCL_COMPILE_DEBUG = 0
+!else
+!if [nmakehlp -f $(STATS) "memdbg"]
+!message *** Doing memdbg
+TCL_MEM_DEBUG = 1
+!else
+TCL_MEM_DEBUG = 0
+!endif
+!if [nmakehlp -f $(STATS) "compdbg"]
+!message *** Doing compdbg
+TCL_COMPILE_DEBUG = 1
+!else
+TCL_COMPILE_DEBUG = 0
+!endif
+!endif
+
+
+#----------------------------------------------------------
+# Set our defines armed with our options.
+#----------------------------------------------------------
+
+OPTDEFINES =
+!if $(TCL_MEM_DEBUG)
+OPTDEFINES = -DTCL_MEM_DEBUG
+!endif
+!if $(TCL_COMPILE_DEBUG)
+OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
+!endif
+!if $(TCL_THREADS)
+OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1
+!endif
+!if $(STATIC_BUILD)
+OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
+!endif
+
+
+#----------------------------------------------------------
+# Display stats being used.
+#----------------------------------------------------------
+
+!message *** Intermediate directory will be '$(TMP_DIR)'
+!message *** Output directory will be '$(OUT_DIR)'
+!message *** Suffix for binaries will be '$(SUFX)'
+!message *** Optional defines are '$(OPTDEFINES)'
+
+!endif
+
diff --git a/tk/win/stubs.c b/tk/win/stubs.c
index e827b0fe853..5fbc8d1c3b5 100644
--- a/tk/win/stubs.c
+++ b/tk/win/stubs.c
@@ -4,7 +4,7 @@
* Undocumented Xlib internal function
*/
-_XInitImageFuncPtrs(XImage *image)
+int _XInitImageFuncPtrs(XImage *image)
{
return 0;
}
@@ -253,7 +253,7 @@ void
XSetCommand(display, w, argv, argc)
Display* display;
Window w;
- char** argv;
+ CONST char** argv;
int argc;
{
}
diff --git a/tk/win/tcl.m4 b/tk/win/tcl.m4
index 1522bbb5b09..3a3b43f0e78 100644
--- a/tk/win/tcl.m4
+++ b/tk/win/tcl.m4
@@ -20,15 +20,13 @@
AC_DEFUN(SC_PATH_TCLCONFIG, [
AC_MSG_CHECKING([the location of tclConfig.sh])
-# CYGNUS LOCAL
- if test -d ../../tcl8.1/win; then
- TCL_BIN_DIR_DEFAULT=../../tcl8.1/win
+ if test -d ../../tcl8.4$1/win; then
+ TCL_BIN_DIR_DEFAULT=../../tcl8.4$1/win
else
- TCL_BIN_DIR_DEFAULT=../../tcl/win
+ TCL_BIN_DIR_DEFAULT=../../tcl8.4/win
fi
-# END CYGNUS LOCAL
- AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.3 binaries from DIR],
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR],
TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`)
if test ! -d $TCL_BIN_DIR; then
AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
@@ -60,13 +58,13 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [
AC_DEFUN(SC_PATH_TKCONFIG, [
AC_MSG_CHECKING([the location of tkConfig.sh])
- if test -d ../../tk8.3$1/win; then
- TK_BIN_DIR_DEFAULT=../../tk8.3$1/win
+ if test -d ../../tk8.4$1/win; then
+ TK_BIN_DIR_DEFAULT=../../tk8.4$1/win
else
- TK_BIN_DIR_DEFAULT=../../tk8.3/win
+ TK_BIN_DIR_DEFAULT=../../tk8.4/win
fi
- AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.3 binaries from DIR],
+ AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.4 binaries from DIR],
TK_BIN_DIR=$withval, TK_BIN_DIR=`cd $TK_BIN_DIR_DEFAULT; pwd`)
if test ! -d $TK_BIN_DIR; then
AC_MSG_ERROR(Tk directory $TK_BIN_DIR does not exist)
@@ -108,15 +106,44 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [
AC_MSG_RESULT([file not found])
fi
- # The eval is required to do the TCL_DBGX substitution in the
- # TCL_LIB_FILE variable.
+ #
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable TCL_LIB_SPEC will be set to the value
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f $TCL_BIN_DIR/Makefile ; then
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
+ fi
- eval TCL_LIB_FILE=${TCL_LIB_FILE}
- eval TCL_LIB_FLAG=${TCL_LIB_FLAG}
+ #
+ # eval is required to do the TCL_DBGX substitution
+ #
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
+
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
+
+ AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_BIN_DIR)
AC_SUBST(TCL_SRC_DIR)
+
AC_SUBST(TCL_LIB_FILE)
+ AC_SUBST(TCL_LIB_FLAG)
+ AC_SUBST(TCL_LIB_SPEC)
+
+ AC_SUBST(TCL_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
])
#------------------------------------------------------------------------
@@ -137,10 +164,10 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [
#------------------------------------------------------------------------
AC_DEFUN(SC_LOAD_TKCONFIG, [
- AC_MSG_CHECKING([for existence of $TCLCONFIG])
+ AC_MSG_CHECKING([for existence of $TK_BIN_DIR/tkConfig.sh])
if test -f "$TK_BIN_DIR/tkConfig.sh" ; then
- AC_MSG_CHECKING([loading $TK_BIN_DIR/tkConfig.sh])
+ AC_MSG_RESULT([loading])
. $TK_BIN_DIR/tkConfig.sh
else
AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh])
@@ -226,6 +253,7 @@ AC_DEFUN(SC_ENABLE_THREADS, [
TCL_THREADS=0
AC_MSG_RESULT([no (default)])
fi
+ AC_SUBST(TCL_THREADS)
])
#------------------------------------------------------------------------
@@ -239,8 +267,6 @@ AC_DEFUN(SC_ENABLE_THREADS, [
# Requires the following vars to be set in the Makefile:
# CFLAGS_DEBUG
# CFLAGS_OPTIMIZE
-# LDFLAGS_DEBUG
-# LDFLAGS_OPTIMIZE
#
# Results:
#
@@ -248,10 +274,10 @@ AC_DEFUN(SC_ENABLE_THREADS, [
# --enable-symbols
#
# Defines the following vars:
-# CFLAGS_DEFAULT Set to $(CFLAGS_DEBUG) if true
-# Set to $(CFLAGS_OPTIMIZE) if false
-# LDFLAGS_DEFAULT Set to $(LDFLAGS_DEBUG) if true
-# Set to $(LDFLAGS_OPTIMIZE) if false
+# CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
+# Sets to $(CFLAGS_OPTIMIZE) if false
+# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
+# Sets to $(LDFLAGS_OPTIMIZE) if false
# DBGX Debug library extension
#
#------------------------------------------------------------------------
@@ -289,7 +315,7 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
#
# Results:
#
-# Can set the following vars:
+# Can the following vars:
# EXTRA_CFLAGS
# CFLAGS_DEBUG
# CFLAGS_OPTIMIZE
@@ -315,7 +341,6 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
#
# LIBSUFFIX
# LIBPREFIX
-# VENDORPREFIX
# LIBRARIES
# EXESUFFIX
# DLLSUFFIX
@@ -323,34 +348,17 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [
#--------------------------------------------------------------------
AC_DEFUN(SC_CONFIG_CFLAGS, [
- TCL_LIB_VERSIONS_OK=nodots
- AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
+ # Step 0: Enable 64 bit support?
- # Check for a bug in gcc's windres that causes the
- # compile to fail when a Windows native path is
- # passed into windres. The mingw toolchain requires
- # Windows native paths while Cygwin should work
- # with both. Avoid the bug by passing a POSIX
- # path when using the Cygwin toolchain.
-
- if test "$GCC" = "yes" && test "$CYGPATH" != "echo" ; then
- conftest=/tmp/conftest.rc
- echo "STRINGTABLE BEGIN" > $conftest
- echo "101 \"name\"" >> $conftest
- echo "END" >> $conftest
-
- AC_MSG_CHECKING([for Windows native path bug in windres])
- cyg_conftest=`$CYGPATH $conftest`
- if AC_TRY_COMMAND($RC -o conftest.res.o $cyg_conftest) ; then
- AC_MSG_RESULT([no])
- else
- AC_MSG_RESULT([yes])
- CYGPATH=echo
- fi
- conftest=
- cyg_conftest=
- fi
+ AC_MSG_CHECKING([if 64bit support is requested])
+ AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no])
+ AC_MSG_RESULT($do64bit)
+
+ # Set some defaults (may get changed below)
+ EXTRA_CFLAGS=""
+
+ AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then
DEPARG='"$<"'
@@ -358,29 +366,35 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
DEPARG='"$(shell $(CYGPATH) $<)"'
fi
- VENDORPREFIX=""
-
# set various compiler flags depending on whether we are using gcc or cl
AC_MSG_CHECKING([compiler flags])
if test "${GCC}" = "yes" ; then
-
- # CYGNUS LOCAL
- VENDORPREFIX="cyg"
-
+ if test "$do64bit" = "yes" ; then
+ AC_MSG_WARN("64bit mode not supported with GCC on Windows")
+ fi
SHLIB_LD=""
SHLIB_LD_LIBS=""
LIBS=""
- LIBS_GUI="-lgdi32 -lcomdlg32"
- STLIB_LD="${AR} cr"
+ LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32"
+ STLIB_LD='${AR} cr'
RC_OUT=-o
RC_TYPE=
RC_INCLUDE=--include
+ RC_DEFINE=--define
RES=res.o
MAKE_LIB="\${STLIB_LD} \[$]@"
POST_MAKE_LIB="\${RANLIB} \[$]@"
MAKE_EXE="\${CC} -o \[$]@"
- LIBPREFIX="lib${VENDORPREFIX}"
+ LIBPREFIX="lib"
+
+ if test "$ac_cv_cygwin" = "yes"; then
+ extra_cflags="-mno-cygwin"
+ extra_ldflags="-mno-cygwin"
+ else
+ extra_cflags=""
+ extra_ldflags=""
+ fi
if test "${SHARED_BUILD}" = "0" ; then
# static
@@ -390,7 +404,6 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
LIBSUFFIX="s\${DBGX}.a"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
- DLLSUFFIX=""
else
# dynamic
AC_MSG_RESULT([using shared flags])
@@ -398,23 +411,27 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
# ad-hoc check to see if CC supports -shared.
if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then
AC_MSG_ERROR([${CC} does not support the -shared option.
- You will need to upgrade to a newer version of the toolchain.])
+ You will need to upgrade to a newer version of the toolchain.])
fi
runtime=
# Link with gcc since ld does not link to default libs like
- # -luser32 and -lmsvcrt. We also need to add CFLAGS so important
- # flags like -mno-cygwin get passed in to CC.
+ # -luser32 and -lmsvcrt by default. Make sure CFLAGS is
+ # included so -mno-cygwin passed the correct libs to the linker.
SHLIB_LD='${CC} -shared ${CFLAGS}'
# Add SHLIB_LD_LIBS to the Make rule, not here.
MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \[$]@ ${extra_ldflags} \
-Wl,--out-implib,\$(patsubst %.dll,lib%.a,\[$]@)"
LIBSUFFIX="\${DBGX}.a"
- DLLSUFFIX="\${DBGX}.dll"
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
fi
+ # DLLSUFFIX is separate because it is the building block for
+ # users of tclConfig.sh that may build shared or static.
+ DLLSUFFIX="\${DBGX}.dll"
+
+ EXTRA_CFLAGS="${extra_cflags}"
CFLAGS_DEBUG=-g
CFLAGS_OPTIMIZE=-O
@@ -438,24 +455,6 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
else
- # CYGNUS LOCAL
- VENDORPREFIX="sn"
-
- SHLIB_LD="link -dll -nologo"
- SHLIB_LD_LIBS="user32.lib advapi32.lib"
- LIBS="user32.lib advapi32.lib"
- LIBS_GUI="gdi32.lib comdlg32.lib"
- STLIB_LD="lib -nologo"
- RC="rc"
- RC_OUT=-fo
- RC_TYPE=-r
- RC_INCLUDE=-i
- RES=res
- MAKE_LIB="\${STLIB_LD} -out:\[$]@"
- POST_MAKE_LIB=
- MAKE_EXE="\${CC} -Fe\[$]@"
- LIBPREFIX=${VENDORPREFIX}
-
if test "${SHARED_BUILD}" = "0" ; then
# static
AC_MSG_RESULT([using static flags])
@@ -464,7 +463,6 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
LIBSUFFIX="s\${DBGX}.lib"
LIBRARIES="\${STATIC_LIBRARIES}"
EXESUFFIX="s\${DBGX}.exe"
- DLLSUFFIX=""
else
# dynamic
AC_MSG_RESULT([using shared flags])
@@ -472,32 +470,84 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
# Add SHLIB_LD_LIBS to the Make rule, not here.
MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\[$]@"
LIBSUFFIX="\${DBGX}.lib"
- DLLSUFFIX="\${DBGX}.dll"
EXESUFFIX="\${DBGX}.exe"
LIBRARIES="\${SHARED_LIBRARIES}"
fi
+ # DLLSUFFIX is separate because it is the building block for
+ # users of tclConfig.sh that may build shared or static.
+ DLLSUFFIX="\${DBGX}.dll"
+
+ # This is a 2-stage check to make sure we have the 64-bit SDK
+ # We have to know where the SDK is installed.
+ if test "$do64bit" = "yes" ; then
+ if test "x${MSSDK}x" = "xx" ; then
+ MSSDK="C:/Progra~1/Microsoft SDK"
+ fi
+ # In order to work in the tortured autoconf environment,
+ # we need to ensure that this path has no spaces
+ MSSDK=$(cygpath -w -s "$MSSDK" | sed -e 's!\\!/!g')
+ if test ! -d "${MSSDK}/bin/win64" ; then
+ AC_MSG_WARN("could not find 64-bit SDK to enable 64bit mode")
+ do64bit="no"
+ fi
+ fi
+
+ if test "$do64bit" = "yes" ; then
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
+ CC="${MSSDK}/Bin/Win64/cl.exe \
+ -I${MSSDK}/Include/prerelease \
+ -I${MSSDK}/Include/Win64/crt \
+ -I${MSSDK}/Include/Win64/crt/sys \
+ -I${MSSDK}/Include"
+ RC="${MSSDK}/bin/rc.exe"
+ CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -O2 -Gs ${runtime}"
+ lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
+ -LIBPATH:${MSSDK}/Lib/Prerelease/IA64"
+ STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}"
+ LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}"
+ else
+ RC="rc"
+ CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
+ CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
+ STLIB_LD="lib -nologo"
+ LINKBIN="link -link50compat"
+ fi
+
+ SHLIB_LD="${LINKBIN} -dll -nologo -incremental:no"
+ SHLIB_LD_LIBS="user32.lib advapi32.lib"
+ LIBS="user32.lib advapi32.lib"
+ LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib"
+ RC_OUT=-fo
+ RC_TYPE=-r
+ RC_INCLUDE=-i
+ RC_DEFINE=-d
+ RES=res
+ MAKE_LIB="\${STLIB_LD} -out:\[$]@"
+ POST_MAKE_LIB=
+ MAKE_EXE="\${CC} -Fe\[$]@"
+ LIBPREFIX=""
EXTRA_CFLAGS="-YX"
- CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
-# CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
- CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
CFLAGS_WARNING="-W3"
- LDFLAGS_DEBUG="-debug:full -debugtype:cv"
+ LDFLAGS_DEBUG="-debug:full -debugtype:both"
LDFLAGS_OPTIMIZE="-release"
-
+
# Specify the CC output file names based on the target name
CC_OBJNAME="-Fo\[$]@"
CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\""
# Specify linker flags depending on the type of app being
# built -- Console vs. Window.
- LDFLAGS_CONSOLE="-link -subsystem:console"
- LDFLAGS_WINDOW="-link -subsystem:windows"
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
fi
- # TCL_LIB_SUFFIX is defined here and in tclConfig.sh so that macros
- # can use a single variable name for both Tcl and extensions.
- TCL_LIB_SUFFIX=$LIBSUFFIX
+ # DL_LIBS is empty, but then we match the Unix version
+ AC_SUBST(DL_LIBS)
+ AC_SUBST(CFLAGS_DEBUG)
+ AC_SUBST(CFLAGS_OPTIMIZE)
+ AC_SUBST(CFLAGS_WARNING)
])
#------------------------------------------------------------------------
@@ -518,13 +568,13 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
#------------------------------------------------------------------------
AC_DEFUN(SC_WITH_TCL, [
- if test -d ../../tcl8.3$1/win; then
- TCL_BIN_DEFAULT=../../tcl8.3$1/win
+ if test -d ../../tcl8.4$1/win; then
+ TCL_BIN_DEFAULT=../../tcl8.4$1/win
else
- TCL_BIN_DEFAULT=../../tcl8.3/win
+ TCL_BIN_DEFAULT=../../tcl8.4/win
fi
- AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.3 binaries from DIR],
+ AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR],
TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`)
if test ! -d $TCL_BIN_DIR; then
AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
@@ -537,98 +587,50 @@ AC_DEFUN(SC_WITH_TCL, [
AC_SUBST(TCL_BIN_DIR)
])
-#--------------------------------------------------------------------
-# SC_TIME_HANLDER
-#
-# Checks how the system deals with time.h, what time structures
-# are used on the system, and what fields the structures have.
-#
-# Arguments:
+# FIXME : SC_PROG_TCLSH should really look for the installed tclsh and
+# not the build version. If we want to use the build version in the
+# tk script, it is better to hardcode that!
+
+#------------------------------------------------------------------------
+# SC_PROG_TCLSH
+# Locate a tclsh shell in the following directories:
+# ${exec_prefix}/bin
+# ${prefix}/bin
+# ${TCL_BIN_DIR}
+# ${TCL_BIN_DIR}/../bin
+# ${PATH}
+#
+# Arguments
# none
-#
-# Results:
#
-# Defines some of the following vars:
-# USE_DELTA_FOR_TZ
-# HAVE_TM_GMTOFF
-# HAVE_TM_TZADJ
-# HAVE_TIMEZONE_VAR
-#
-#--------------------------------------------------------------------
-
-AC_DEFUN(SC_TIME_HANDLER, [
- AC_CHECK_HEADERS(sys/time.h)
- AC_HEADER_TIME
- AC_STRUCT_TIMEZONE
-
- AC_MSG_CHECKING([tm_tzadj in struct tm])
- AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
- [AC_DEFINE(HAVE_TM_TZADJ)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
-
- AC_MSG_CHECKING([tm_gmtoff in struct tm])
- AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
- [AC_DEFINE(HAVE_TM_GMTOFF)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
-
- #
- # Its important to include time.h in this check, as some systems
- # (like convex) have timezone functions, etc.
- #
- have_timezone=no
- AC_MSG_CHECKING([long timezone variable])
- AC_TRY_COMPILE([#include <time.h>],
- [extern long timezone;
- timezone += 1;
- exit (0);],
- [have_timezone=yes
- AC_DEFINE(HAVE_TIMEZONE_VAR)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
-
- #
- # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
- #
- if test "$have_timezone" = no; then
- AC_MSG_CHECKING([time_t timezone variable])
- AC_TRY_COMPILE([#include <time.h>],
- [extern time_t timezone;
- timezone += 1;
- exit (0);],
- [AC_DEFINE(HAVE_TIMEZONE_VAR)
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no))
- fi
-
- #
- # On some systems (eg Solaris 2.5.1), timezone is not declared in
- # time.h unless you jump through hoops. Instead of that, we just
- # declare it ourselves when necessary.
- #
- if test "$have_timezone" = yes; then
- AC_MSG_CHECKING(for timezone declaration)
- changequote(<<,>>)
- tzrx='^[ ]*extern.*timezone'
- changequote([,])
- AC_EGREP_HEADER($tzrx, time.h, [
- AC_DEFINE(HAVE_TIMEZONE_DECL)
- AC_MSG_RESULT(found)], AC_MSG_RESULT(missing))
- fi
-
- #
- # AIX does not have a timezone field in struct tm. When the AIX bsd
- # library is used, the timezone global and the gettimeofday methods are
- # to be avoided for timezone deduction instead, we deduce the timezone
- # by comparing the localtime result on a known GMT value.
- #
+# Results
+# Subst's the following values:
+# TCLSH_PROG
+#------------------------------------------------------------------------
- if test "`uname -s`" = "AIX" ; then
- AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes)
- if test $libbsd = yes; then
- AC_DEFINE(USE_DELTA_FOR_TZ)
- fi
+AC_DEFUN(SC_PROG_TCLSH, [
+ AC_MSG_CHECKING([for tclsh])
+
+ AC_CACHE_VAL(ac_cv_path_tclsh, [
+ search_path=`echo ${exec_prefix}/bin:${prefix}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${PATH} | sed -e 's/:/ /g'`
+ for dir in $search_path ; do
+ for j in `ls -r $dir/tclsh[[8-9]]*.exe 2> /dev/null` \
+ `ls -r $dir/tclsh* 2> /dev/null` ; do
+ if test x"$ac_cv_path_tclsh" = x ; then
+ if test -f "$j" ; then
+ ac_cv_path_tclsh=$j
+ break
+ fi
+ fi
+ done
+ done
+ ])
+
+ if test -f "$ac_cv_path_tclsh" ; then
+ TCLSH_PROG=$ac_cv_path_tclsh
+ AC_MSG_RESULT($TCLSH_PROG)
+ else
+ AC_MSG_ERROR(No tclsh found in PATH: $search_path)
fi
+ AC_SUBST(TCLSH_PROG)
])
-
diff --git a/tk/win/tkConfig.sh.in b/tk/win/tkConfig.sh.in
index 3e2dbf33846..34555334d36 100644
--- a/tk/win/tkConfig.sh.in
+++ b/tk/win/tkConfig.sh.in
@@ -33,7 +33,6 @@ TK_LIB_FILE='@TK_LIB_FILE@'
# Additional libraries to use when linking Tk.
TK_LIBS='@LIBS@ @LIBS_GUI@'
-LIBS_GUI='@LIBS_GUI@'
# Top-level directory in which Tcl's platform-independent files are
# installed.
@@ -43,9 +42,6 @@ TK_PREFIX='@prefix@'
# executables) are installed.
TK_EXEC_PREFIX='@exec_prefix@'
-# -I switch(es) to use to make all of the X11 include files accessible:
-TK_XINCLUDES='@XINCLUDES@'
-
# -l flag to pass to the linker to pick up the Tcl library
TK_LIB_FLAG='@TK_LIB_FLAG@'
@@ -89,4 +85,3 @@ TK_BUILD_STUB_LIB_PATH='@TK_BUILD_STUB_LIB_PATH@'
# Path to the Tk stub library in the install directory.
TK_STUB_LIB_PATH='@TK_STUB_LIB_PATH@'
-
diff --git a/tk/win/tkWin.h b/tk/win/tkWin.h
index f92ec8d322c..0e2cef4442c 100644
--- a/tk/win/tkWin.h
+++ b/tk/win/tkWin.h
@@ -53,4 +53,3 @@
# define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _TKWIN */
-
diff --git a/tk/win/tkWin32Dll.c b/tk/win/tkWin32Dll.c
index 48fdd0ac671..61b05c01806 100644
--- a/tk/win/tkWin32Dll.c
+++ b/tk/win/tkWin32Dll.c
@@ -19,14 +19,6 @@
BOOL APIENTRY DllMain _ANSI_ARGS_((HINSTANCE hInst,
DWORD reason, LPVOID reserved));
-/* CYGNUS LOCAL */
-#ifdef __CYGWIN32__
-/* cygwin32 requires an impure pointer variable, which must be
- explicitly initialized when the DLL starts up. */
-struct _reent *_impure_ptr;
-extern struct _reent __declspec(dllimport) reent_data;
-#endif
-/* END CYGNUS LOCAL */
/*
*----------------------------------------------------------------------
@@ -77,12 +69,6 @@ DllMain(hInstance, reason, reserved)
DWORD reason;
LPVOID reserved;
{
-#ifdef __CYGWIN32__
- /* cygwin32 requires the impure data pointer to be initialized
- when the DLL starts up. */
- _impure_ptr = &reent_data;
-#endif
- /* END CYGNUS LOCAL */
/*
* If we are attaching to the DLL from a new process, tell Tk about
@@ -97,4 +83,3 @@ DllMain(hInstance, reason, reserved)
}
return(TRUE);
}
-
diff --git a/tk/win/tkWinButton.c b/tk/win/tkWinButton.c
index 6b4da6ecc1c..058ae39852f 100644
--- a/tk/win/tkWinButton.c
+++ b/tk/win/tkWinButton.c
@@ -25,10 +25,6 @@
#define CHECK_STYLE (BS_OWNERDRAW | BS_CHECKBOX | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)
#define RADIO_STYLE (BS_OWNERDRAW | BS_RADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)
-static DWORD buttonStyles[] = {
- LABEL_STYLE, PUSH_STYLE, CHECK_STYLE, RADIO_STYLE
-};
-
/*
* Declaration of Windows specific button structure.
*/
@@ -38,7 +34,6 @@ typedef struct WinButton {
WNDPROC oldProc; /* Old window procedure. */
HWND hwnd; /* Current window handle. */
Pixmap pixmap; /* Bitmap for rendering the button. */
- int pixFlags; /* Button flags for pixmap field. */
DWORD style; /* Window style flags. */
} WinButton;
@@ -84,28 +79,20 @@ static Tcl_ThreadDataKey dataKey;
/*
* Declarations for functions defined in this file.
*/
-
-static int ButtonBindProc _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, XEvent *eventPtr,
- Tk_Window tkwin, KeySym keySym));
static LRESULT CALLBACK ButtonProc _ANSI_ARGS_((HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam));
-static DWORD ComputeStyle _ANSI_ARGS_((WinButton* butPtr));
static Window CreateProc _ANSI_ARGS_((Tk_Window tkwin,
Window parent, ClientData instanceData));
static void InitBoxes _ANSI_ARGS_((void));
-/* CYGNUS LOCAL. */
-static void TkpRealDisplayButton _ANSI_ARGS_((ClientData, int));
-
/*
* The class procedure table for the button widgets.
*/
-TkClassProcs tkpButtonProcs = {
- CreateProc, /* createProc. */
- TkButtonWorldChanged, /* geometryProc. */
- NULL /* modalProc. */
+Tk_ClassProcs tkpButtonProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ TkButtonWorldChanged, /* worldChangedProc */
+ CreateProc, /* createProc */
};
@@ -240,9 +227,6 @@ TkpCreateButton(tkwin)
butPtr = (WinButton *)ckalloc(sizeof(WinButton));
butPtr->hwnd = NULL;
- /* CYGNUS LOCAL: Use the pixmap field. */
- butPtr->pixmap = 0;
- butPtr->pixFlags = 0;
return (TkButton *) butPtr;
}
@@ -287,8 +271,13 @@ CreateProc(tkwin, parentWin, instanceData)
parent, NULL, Tk_GetHINSTANCE(), NULL);
SetWindowPos(butPtr->hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+#ifdef _WIN64
+ butPtr->oldProc = (WNDPROC)SetWindowLongPtr(butPtr->hwnd, GWLP_WNDPROC,
+ (LONG_PTR) ButtonProc);
+#else
butPtr->oldProc = (WNDPROC)SetWindowLong(butPtr->hwnd, GWL_WNDPROC,
(DWORD) ButtonProc);
+#endif
window = Tk_AttachHWND(tkwin, butPtr->hwnd);
return window;
@@ -317,12 +306,11 @@ TkpDestroyButton(butPtr)
WinButton *winButPtr = (WinButton *)butPtr;
HWND hwnd = winButPtr->hwnd;
if (hwnd) {
+#ifdef _WIN64
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winButPtr->oldProc);
+#else
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) winButPtr->oldProc);
- }
- /* CYGNUS LOCAL: Free the pixmap. */
- if (winButPtr->pixmap != 0) {
- Tk_FreePixmap(butPtr->display, winButPtr->pixmap);
- winButPtr->pixmap = 0;
+#endif
}
}
@@ -348,19 +336,6 @@ void
TkpDisplayButton(clientData)
ClientData clientData; /* Information about widget. */
{
- /* CYGNUS LOCAL: Use a subroutine. */
- TkpRealDisplayButton(clientData, 1);
-}
-
-/* CYGNUS LOCAL: This is the old TkpDisplayButton, with a force
- argument added. The idea is to speed up redrawing a button due to
- a WM_PAINT event by saving a pixmap of the image. */
-
-static void
-TkpRealDisplayButton(clientData, force)
- ClientData clientData;
- int force;
-{
TkWinDCState state;
HDC dc;
register TkButton *butPtr = (TkButton *) clientData;
@@ -371,12 +346,15 @@ TkpRealDisplayButton(clientData, force)
* compiler warning. */
int y, relief;
register Tk_Window tkwin = butPtr->tkwin;
- int width, height;
+ int width, height, haveImage = 0, haveText = 0, drawRing = 0;
+ RECT rect;
int defaultWidth; /* Width of default ring. */
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. */
+ int textXOffset = 0, textYOffset = 0; /* text offsets for use with
+ * compound buttons and focus ring */
DWORD *boxesPalette;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
@@ -388,21 +366,6 @@ TkpRealDisplayButton(clientData, force)
return;
}
- /* CYGNUS LOCAL: Use the saved pixmap if we can. */
- if (! force && ((WinButton *)butPtr)->pixmap != 0
- && ((WinButton *)butPtr)->pixFlags == butPtr->flags) {
- XCopyArea(butPtr->display, ((WinButton *)butPtr)->pixmap,
- Tk_WindowId(tkwin), butPtr->copyGC, 0, 0,
- (unsigned) Tk_Width(tkwin), (unsigned) Tk_Height(tkwin),
- 0, 0);
- return;
- }
-
- if (((WinButton *)butPtr)->pixmap != 0) {
- Tk_FreePixmap(butPtr->display, ((WinButton*)butPtr)->pixmap);
- ((WinButton*)butPtr)->pixmap = 0;
- }
-
border = butPtr->normalBorder;
if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) {
gc = butPtr->disabledGC;
@@ -420,13 +383,40 @@ TkpRealDisplayButton(clientData, force)
/*
* Override the relief specified for the button if this is a
- * checkbutton or radiobutton and there's no indicator.
+ * checkbutton or radiobutton and there's no indicator. The new
+ * relief is as follows:
+ * If the button is select --> "sunken"
+ * If relief==overrelief --> relief
+ * Otherwise --> overrelief
+ *
+ * The effect we are trying to achieve is as follows:
+ *
+ * value mouse-over? --> relief
+ * ------- ------------ --------
+ * off no flat
+ * off yes raised
+ * on no sunken
+ * on yes sunken
+ *
+ * This is accomplished by configuring the checkbutton or radiobutton
+ * like this:
+ *
+ * -indicatoron 0 -overrelief raised -offrelief flat
+ *
+ * Bindings (see library/button.tcl) will copy the -overrelief into
+ * -relief on mouseover. Hence, we can tell if we are in mouse-over by
+ * comparing relief against overRelief. This is an aweful kludge, but
+ * it gives use the desired behavior while keeping the code backwards
+ * compatible.
*/
relief = butPtr->relief;
if ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn) {
- relief = (butPtr->flags & SELECTED) ? TK_RELIEF_SUNKEN
- : TK_RELIEF_RAISED;
+ if (butPtr->flags & SELECTED) {
+ relief = TK_RELIEF_SUNKEN;
+ } else if (butPtr->overRelief != relief) {
+ relief = butPtr->offRelief;
+ }
}
/*
@@ -464,78 +454,177 @@ TkpRealDisplayButton(clientData, force)
if (butPtr->image != None) {
Tk_SizeOfImage(butPtr->image, &width, &height);
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
+ haveImage = 1;
+ }
- imageOrBitmap:
- TkComputeAnchor(butPtr->anchor, tkwin, 0, 0,
- butPtr->indicatorSpace + width, height, &x, &y);
+ haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
+
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ int imageXOffset, imageYOffset, fullWidth,
+ fullHeight;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ fullWidth = 0;
+ fullHeight = 0;
+
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ if (butPtr->compound == COMPOUND_TOP) {
+ textYOffset = height + butPtr->padY;
+ } else {
+ imageYOffset = butPtr->textHeight + butPtr->padY;
+ }
+ fullHeight = height + butPtr->textHeight + butPtr->padY;
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ if (butPtr->compound == COMPOUND_LEFT) {
+ textXOffset = width + butPtr->padX;
+ } else {
+ imageXOffset = butPtr->textWidth + butPtr->padX;
+ }
+ fullWidth = butPtr->textWidth + butPtr->padX + width;
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ fullWidth = (width > butPtr->textWidth ? width :
+ butPtr->textWidth);
+ fullHeight = (height > butPtr->textHeight ? height :
+ butPtr->textHeight);
+ textXOffset = (fullWidth - butPtr->textWidth)/2;
+ imageXOffset = (fullWidth - width)/2;
+ textYOffset = (fullHeight - butPtr->textHeight)/2;
+ imageYOffset = (fullHeight - height)/2;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ butPtr->indicatorSpace + fullWidth, fullHeight, &x, &y);
x += butPtr->indicatorSpace;
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);
+ Tk_RedrawImage(butPtr->selectImage, 0, 0,
+ width, height, pixmap, x + imageXOffset,
+ y + imageYOffset);
} else {
- Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap,
- x, y);
+ Tk_RedrawImage(butPtr->image, 0, 0, width,
+ height, pixmap, x + imageXOffset, y + imageYOffset);
}
} 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, x + imageXOffset,
+ y + imageYOffset);
+ XCopyPlane(butPtr->display, butPtr->bitmap, pixmap, gc,
+ 0, 0, (unsigned int) width,
+ (unsigned int) height, x + imageXOffset,
+ y + imageYOffset, 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 {
- RECT rect;
- TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
- butPtr->indicatorSpace + butPtr->textWidth, butPtr->textHeight,
- &x, &y);
-
- x += butPtr->indicatorSpace;
-
- if (relief == TK_RELIEF_SUNKEN) {
- x += offset;
- y += offset;
- }
+
Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
- x, y, 0, -1);
+ x + textXOffset, y + textYOffset, 0, -1);
Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
- butPtr->textLayout, x, y, butPtr->underline);
-
- /*
- * Draw the focus ring. If this is a push button then we need to put
- * it around the inner edge of the border, otherwise we put it around
- * the text.
- */
-
- if (butPtr->flags & GOT_FOCUS && butPtr->type != TYPE_LABEL) {
- dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state);
- if (butPtr->type == TYPE_BUTTON || !butPtr->indicatorOn) {
- rect.top = butPtr->borderWidth + 1 + defaultWidth;
- rect.left = rect.top;
- rect.right = Tk_Width(tkwin) - rect.left;
- rect.bottom = Tk_Height(tkwin) - rect.top;
+ butPtr->textLayout, x + textXOffset, y + textYOffset,
+ butPtr->underline);
+ height = fullHeight;
+ drawRing = 1;
+ } else {
+ if (haveImage) {
+ TkComputeAnchor(butPtr->anchor, tkwin, 0, 0,
+ butPtr->indicatorSpace + width, height, &x, &y);
+ x += butPtr->indicatorSpace;
+
+ 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 {
- rect.top = y-2;
- rect.left = x-2;
- rect.right = x+butPtr->textWidth + 1;
- rect.bottom = y+butPtr->textHeight + 1;
+ 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);
+ }
+
+ } else {
+ TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY,
+ butPtr->indicatorSpace + butPtr->textWidth,
+ butPtr->textHeight, &x, &y);
+
+ x += butPtr->indicatorSpace;
+
+ if (relief == TK_RELIEF_SUNKEN) {
+ x += offset;
+ y += offset;
}
- SetTextColor(dc, gc->foreground);
- SetBkColor(dc, gc->background);
- DrawFocusRect(dc, &rect);
- TkWinReleaseDrawableDC(pixmap, dc, &state);
+ Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
+ x, y, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
+ butPtr->textLayout, x, y, butPtr->underline);
+
+ height = butPtr->textHeight;
+ drawRing = 1;
+ }
+ }
+
+ /*
+ * Draw the focus ring. If this is a push button then we need to
+ * put it around the inner edge of the border, otherwise we put it
+ * around the text. The text offsets are only non-zero when this
+ * is a compound button.
+ */
+
+ if (drawRing && butPtr->flags & GOT_FOCUS && butPtr->type != TYPE_LABEL) {
+ dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state);
+ if (butPtr->type == TYPE_BUTTON || !butPtr->indicatorOn) {
+ rect.top = butPtr->borderWidth + 1 + defaultWidth;
+ rect.left = rect.top;
+ rect.right = Tk_Width(tkwin) - rect.left;
+ rect.bottom = Tk_Height(tkwin) - rect.top;
+ } else {
+ rect.top = y-1 + textYOffset;
+ rect.left = x-1 + textXOffset;
+ rect.right = x+butPtr->textWidth + 1 + textXOffset;
+ rect.bottom = y+butPtr->textHeight + 2 + textYOffset;
}
- y += butPtr->textHeight/2;
+ SetTextColor(dc, gc->foreground);
+ SetBkColor(dc, gc->background);
+ DrawFocusRect(dc, &rect);
+ TkWinReleaseDrawableDC(pixmap, dc, &state);
}
+ y += height/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
@@ -645,6 +734,10 @@ TkpRealDisplayButton(clientData, force)
TkWinReleaseDrawableDC(pixmap, dc, &state);
}
+ if (butPtr->flags & GOT_FOCUS) {
+ Tk_SetCaretPos(tkwin, x, y, 0 /* not used */);
+ }
+
/*
* Copy the information from the off-screen pixmap onto the screen,
* then delete the pixmap.
@@ -653,13 +746,7 @@ TkpRealDisplayButton(clientData, force)
XCopyArea(butPtr->display, pixmap, Tk_WindowId(tkwin),
butPtr->copyGC, 0, 0, (unsigned) Tk_Width(tkwin),
(unsigned) Tk_Height(tkwin), 0, 0);
-
- /* CYGNUS LOCAL: Don't free the pixmap; save it for the next
- redisplay.
- Tk_FreePixmap(butPtr->display, pixmap);
- */
- ((WinButton*)butPtr)->pixmap = pixmap;
- ((WinButton*)butPtr)->pixFlags = butPtr->flags;
+ Tk_FreePixmap(butPtr->display, pixmap);
}
/*
@@ -684,10 +771,18 @@ void
TkpComputeButtonGeometry(butPtr)
register TkButton *butPtr; /* Button whose geometry may have changed. */
{
- int width, height, avgWidth;
+ int txtWidth, txtHeight; /* Width and height of text */
+ int imgWidth, imgHeight; /* Width and height of image */
+ int width = 0, height = 0; /* Width and height of button */
+ int haveImage, haveText;
+ int avgWidth;
+ int minWidth;
+ /* Vertical and horizontal dialog units size in pixels. */
+ double vDLU, hDLU;
Tk_FontMetrics fm;
+
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (butPtr->highlightWidth < 0) {
butPtr->highlightWidth = 0;
@@ -699,82 +794,322 @@ TkpComputeButtonGeometry(butPtr)
InitBoxes();
}
+ /* Figure out image metrics */
if (butPtr->image != NULL) {
- Tk_SizeOfImage(butPtr->image, &width, &height);
- imageOrBitmap:
- if (butPtr->width > 0) {
+ Tk_SizeOfImage(butPtr->image, &imgWidth, &imgHeight);
+ haveImage = 1;
+ } else if (butPtr->bitmap != None) {
+ Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap,
+ &imgWidth, &imgHeight);
+ haveImage = 1;
+ } else {
+ imgWidth = 0;
+ imgHeight = 0;
+ haveImage = 0;
+ }
+
+ /*
+ * Figure out font metrics (even if we don't have text because we need
+ * DLUs (based on font, not text) for some spacing calculations below).
+ */
+ Tk_FreeTextLayout(butPtr->textLayout);
+ butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
+ Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
+ butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
+
+ txtWidth = butPtr->textWidth;
+ txtHeight = butPtr->textHeight;
+ haveText = (*(Tcl_GetString(butPtr->textPtr)) != '\0');
+ avgWidth = (Tk_TextWidth(butPtr->tkfont,
+ "abcdefghijklmnopqurstuvwzyABCDEFGHIJKLMNOPQURSTUVWZY",
+ 52) + 26) / 52;
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
+
+ /* Compute dialog units for layout calculations. */
+ hDLU = avgWidth / 4.0;
+ vDLU = fm.linespace / 8.0;
+
+ /*
+ * First, let's try to compute button size "by the book" (See "Microsoft
+ * Windows User Experience" (ISBN 0-7356-0566-1), Chapter 14 - Visual
+ * Design, Section 4 - Layout (page 448)).
+ *
+ * Note, that Tk "buttons" are Microsoft "Command buttons", Tk
+ * "checkbuttons" are Microsoft "check boxes", Tk "radiobuttons" are
+ * Microsoft "option buttons", and Tk "labels" are Microsoft "text
+ * labels".
+ */
+
+ /*
+ * Set width and height by button type; See User Experience table, p449.
+ * These are text-based measurements, even if the text is "".
+ * If there is an image, height will get set again later.
+ */
+ switch (butPtr->type) {
+ case TYPE_BUTTON: {
+ /*
+ * First compute the minimum width of the button in
+ * characters. MWUE says that the button should be
+ * 50 DLUs. We allow 6 DLUs padding left and right.
+ * (There is no rule but this is consistent with the
+ * fact that button text is 8 DLUs high and buttons
+ * are 14 DLUs high.)
+ *
+ * The width is specified in characters. A character
+ * is, by definition, 4 DLUs wide. 11 char * 4 DLU
+ * is 44 DLU + 6 DLU padding = 50 DLU. Therefore,
+ * width = -11 -> MWUE compliant buttons.
+ */
+ if (butPtr->width < 0) {
+ /* Min width in characters */
+ minWidth = -(butPtr->width);
+ /* Allow for characters */
+ width = avgWidth * minWidth;
+ /* Add for padding */
+ width += (int)(0.5 + (6 * hDLU));
+ }
+
+ /*
+ * If shrink-wrapping was requested (width = 0) or
+ * if the text is wider than the default button width,
+ * adjust the button width up to suit.
+ */
+ if (butPtr->width == 0
+ || (txtWidth + (int)(0.5 + (6 * hDLU)) > width)) {
+ width = txtWidth + (int)(0.5 + (6 * hDLU));
+ }
+
+ /*
+ * The User Experience says 14 DLUs. Since text is, by
+ * definition, 8 DLU/line, this allows for multi-line text
+ * while working perfectly for single-line text.
+ */
+ height = txtHeight + (int)(0.5 + (6 * vDLU));
+
+ /*
+ * The above includes 6 DLUs of padding which should include
+ * defaults of 1 pixel of highlightwidth, 2 pixels of
+ * borderwidth, 1 pixel of padding and 1 pixel of extra inset
+ * on each side. Those will be added later so reduce width
+ * and height now to compensate.
+ */
+ width -= 10;
+ height -= 10;
+
+ if (!haveImage) {
+ /*
+ * Extra inset for the focus ring.
+ */
+ butPtr->inset += 1;
+ }
+ break;
+ }
+
+ case TYPE_LABEL: {
+ /*
+ * The User Experience says, "as wide as needed".
+ */
+ width = txtWidth;
+
+ /*
+ * The User Experience says, "8 (DLUs) per line of text."
+ * Since text is, by definition, 8 DLU/line, this allows
+ * for multi-line text while working perfectly for single-line
+ * text.
+ */
+ if (txtHeight) {
+ height = txtHeight;
+ } else {
+ /*
+ * If there's no text, we want the height to be one linespace.
+ */
+ height = fm.linespace;
+ }
+ break;
+ }
+
+ case TYPE_RADIO_BUTTON:
+ case TYPE_CHECK_BUTTON: {
+ /* See note for TYPE_LABEL */
+ width = txtWidth;
+ /*
+ * The User Experience says 10 DLUs. (Is that one DLU above
+ * and below for the focus ring?) See note above about
+ * multi-line text and 8 DLU/line.
+ */
+ height = txtHeight + (int)(0.5 + (2.0 * vDLU));
+
+ /*
+ * The above includes 2 DLUs of padding which should include
+ * defaults of 1 pixel of highlightwidth, 0 pixels of
+ * borderwidth, and 1 pixel of padding on each side. Those
+ * will be added later so reduce height now to compensate.
+ */
+ height -= 4;
+
+ /*
+ * Extra inset for the focus ring.
+ */
+ butPtr->inset += 1;
+ break;
+ }
+ }/* switch */
+
+ /*
+ * At this point, the width and height are correct for a Tk text
+ * button, excluding padding and inset, but we have to allow for
+ * compound buttons. The image may be above, below, left, or right
+ * of the text.
+ */
+
+ /*
+ * If the button is compound (i.e., it shows both an image and text),
+ * the new geometry is a combination of the image and text geometry.
+ * We only honor the compound bit if the button has both text and an
+ * image, because otherwise it is not really a compound button.
+ */
+ if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
+ switch ((enum compound) butPtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ /* Image is above or below text */
+ if (imgWidth > width) {
+ width = imgWidth;
+ }
+ height += imgHeight + butPtr->padY;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ /* Image is left or right of text */
+ /*
+ * Only increase width of button if image doesn't fit in
+ * slack space of default button width
+ */
+ if ((imgWidth + txtWidth + butPtr->padX) > width) {
+ width = imgWidth + txtWidth + butPtr->padX;
+ }
+
+ if (imgHeight > height) {
+ height = imgHeight;
+ }
+ break;
+ }
+ case COMPOUND_CENTER: {
+ /* Image and text are superimposed */
+ if (imgWidth > width) {
+ width = imgWidth;
+ }
+ if (imgHeight > height) {
+ height = imgHeight;
+ }
+ break;
+ }
+ } /* switch */
+
+ /* Fix up for minimum width */
+ if (butPtr->width < 0) {
+ /* minWidth in pixels (because there's an image */
+ minWidth = -(butPtr->width);
+ if (width < minWidth) {
+ width = minWidth;
+ }
+ } else if (butPtr->width > 0) {
width = butPtr->width;
}
+
if (butPtr->height > 0) {
height = butPtr->height;
}
- if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) {
- butPtr->indicatorSpace = tsdPtr->boxWidth * 2;
- butPtr->indicatorDiameter = tsdPtr->boxHeight;
+
+ width += 2*butPtr->padX;
+ height += 2*butPtr->padY;
+ } else if (haveImage) {
+ if (butPtr->width > 0) {
+ width = butPtr->width;
+ } else {
+ width = imgWidth;
+ }
+ if (butPtr->height > 0) {
+ height = butPtr->height;
+ } else {
+ height = imgHeight;
}
- } else if (butPtr->bitmap != None) {
- Tk_SizeOfBitmap(butPtr->display, butPtr->bitmap, &width, &height);
- goto imageOrBitmap;
} else {
- Tk_FreeTextLayout(butPtr->textLayout);
- butPtr->textLayout = Tk_ComputeTextLayout(butPtr->tkfont,
- Tcl_GetString(butPtr->textPtr), -1, butPtr->wrapLength,
- butPtr->justify, 0, &butPtr->textWidth, &butPtr->textHeight);
+ /* No image. May or may not be text. May or may not be compound. */
- width = butPtr->textWidth;
- height = butPtr->textHeight;
- avgWidth = Tk_TextWidth(butPtr->tkfont, "0", 1);
- Tk_GetFontMetrics(butPtr->tkfont, &fm);
-
- if (butPtr->width > 0) {
+ /*
+ * butPtr->width is in characters. We need to allow for that
+ * many characters on the face, not in the over-all button width
+ */
+ if (butPtr->width > 0) {
width = butPtr->width * avgWidth;
}
- if (butPtr->type == TYPE_BUTTON) {
- height = butPtr->height * fm.ascent;
- } else {
+ /*
+ * butPtr->height is in lines of text. We need to allow for
+ * that many lines on the face, not in the over-all button
+ * height.
+ */
+ if (butPtr->height > 0) {
height = butPtr->height * fm.linespace;
+
+ /*
+ * Make the same adjustments as above to get same height for
+ * e.g. a one line text with -height 0 or 1. [Bug #565485]
+ */
+
+ switch (butPtr->type) {
+ case TYPE_BUTTON: {
+ height += (int)(0.5 + (6 * vDLU)) - 10;
+ break;
+ }
+ case TYPE_RADIO_BUTTON:
+ case TYPE_CHECK_BUTTON: {
+ height += (int)(0.5 + (2.0 * vDLU)) - 4;
+ break;
+ }
+ }
}
+
+ width += 2 * butPtr->padX;
+ height += 2 * butPtr->padY;
+ }
- if ((butPtr->type >= TYPE_CHECK_BUTTON) && butPtr->indicatorOn) {
+ /* Fix up width and height for indicator sizing and spacing */
+ if (butPtr->type == TYPE_RADIO_BUTTON
+ || butPtr->type == TYPE_CHECK_BUTTON) {
+ if (butPtr->indicatorOn) {
butPtr->indicatorDiameter = tsdPtr->boxHeight;
- butPtr->indicatorSpace = butPtr->indicatorDiameter + avgWidth;
- }
- /*
- * Increase the inset to allow for the focus ring.
- */
+ /*
+ * Make sure we can see the whole indicator, even if the text
+ * or image is very small.
+ */
+ if (height < butPtr->indicatorDiameter) {
+ height = butPtr->indicatorDiameter;
+ }
- if (butPtr->type != TYPE_LABEL) {
- butPtr->inset += 3;
+ /*
+ * There is no rule for space between the indicator and
+ * the text (the two are atomic on 'Windows) but the User
+ * Experience page 451 says leave 3 hDLUs between "text
+ * labels and their associated controls".
+ */
+ butPtr->indicatorSpace = butPtr->indicatorDiameter +
+ (int)(0.5 + (3.0 * hDLU));
+ width += butPtr->indicatorSpace;
}
}
/*
- * When issuing the geometry request, add extra space for the indicator,
- * if any, and for the border and padding, plus an extra pixel so the
- * display can be offset by 1 pixel in either direction for the raised
- * or lowered effect.
+ * Inset is always added to the size.
*/
+ width += 2 * butPtr->inset;
+ height += 2 * butPtr->inset;
- if ((butPtr->image == NULL) && (butPtr->bitmap == None)) {
- width += 2*butPtr->padX;
- height += 2*butPtr->padY;
- }
- if ((butPtr->type == TYPE_BUTTON)
- || ((butPtr->type >= TYPE_CHECK_BUTTON) && !butPtr->indicatorOn)) {
- width += 1;
- height += 1;
- }
- Tk_GeometryRequest(butPtr->tkwin, (int) (width + butPtr->indicatorSpace
- + 2*butPtr->inset), (int) (height + 2*butPtr->inset));
+ Tk_GeometryRequest(butPtr->tkwin, width, height);
Tk_SetInternalBorder(butPtr->tkwin, butPtr->inset);
-
- /* CYGNUS LOCAL: Discard any saved pixmap. */
- if (((WinButton*)butPtr)->pixmap != 0) {
- Tk_FreePixmap(butPtr->display, ((WinButton*)butPtr)->pixmap);
- ((WinButton*)butPtr)->pixmap = 0;
- }
}
/*
@@ -878,4 +1213,3 @@ ButtonProc(hwnd, message, wParam, lParam)
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
-
diff --git a/tk/win/tkWinClipboard.c b/tk/win/tkWinClipboard.c
index df94a49aec0..7a5ff0b01eb 100644
--- a/tk/win/tkWinClipboard.c
+++ b/tk/win/tkWinClipboard.c
@@ -452,5 +452,3 @@ TkSelPropProc(eventPtr)
register XEvent *eventPtr; /* X PropertyChange event. */
{
}
-
-
diff --git a/tk/win/tkWinColor.c b/tk/win/tkWinColor.c
index e05f0c692e0..0381b1b54bb 100644
--- a/tk/win/tkWinColor.c
+++ b/tk/win/tkWinColor.c
@@ -80,8 +80,6 @@ static Tcl_ThreadDataKey dataKey;
static int FindSystemColor _ANSI_ARGS_((const char *name,
XColor *colorPtr, int *indexPtr));
-static int GetColorByName _ANSI_ARGS_((char *name, XColor *color));
-static int GetColorByValue _ANSI_ARGS_((char *value, XColor *color));
/*
*----------------------------------------------------------------------
diff --git a/tk/win/tkWinConfig.c b/tk/win/tkWinConfig.c
index c8c4f76cf55..e9d6943225e 100644
--- a/tk/win/tkWinConfig.c
+++ b/tk/win/tkWinConfig.c
@@ -39,8 +39,8 @@
Tcl_Obj *
TkpGetSystemDefault(
Tk_Window tkwin, /* A window to use. */
- char *dbName, /* The option database name. */
- char *className) /* The name of the option class. */
+ CONST char *dbName, /* The option database name. */
+ CONST char *className) /* The name of the option class. */
{
Tcl_Obj *valueObjPtr;
Tk_Uid classUid;
@@ -58,4 +58,3 @@ TkpGetSystemDefault(
return valueObjPtr;
}
-
diff --git a/tk/win/tkWinCursor.c b/tk/win/tkWinCursor.c
index 6ed11a7a90d..5c5ad1b8c98 100644
--- a/tk/win/tkWinCursor.c
+++ b/tk/win/tkWinCursor.c
@@ -87,63 +87,76 @@ TkGetCursorByName(interp, tkwin, string)
{
struct CursorName *namePtr;
TkWinCursor *cursorPtr;
+ int argc;
+ CONST char **argv = NULL;
/*
- * Check for the cursor in the system cursor set.
+ * All cursor names are valid lists of one element (for
+ * Unix-compatability), even unadorned system cursor names.
*/
- for (namePtr = cursorNames; namePtr->name != NULL; namePtr++) {
- if (strcmp(namePtr->name, string) == 0) {
- break;
- }
+ if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {
+ return NULL;
+ }
+ if (argc != 1) {
+ goto badCursorSpec;
}
cursorPtr = (TkWinCursor *) ckalloc(sizeof(TkWinCursor));
cursorPtr->info.cursor = (Tk_Cursor) cursorPtr;
cursorPtr->winCursor = NULL;
- if (namePtr->name != NULL) {
- cursorPtr->winCursor = LoadCursor(NULL, namePtr->id);
- cursorPtr->system = 1;
- }
- if (cursorPtr->winCursor == NULL) {
- cursorPtr->winCursor = LoadCursor(Tk_GetHINSTANCE(), string);
- cursorPtr->system = 0;
- }
- if (string[0] == '@') {
- int argc;
- char **argv = NULL;
- if (Tcl_SplitList(interp, string, &argc, &argv) != TCL_OK) {
- return NULL;
- }
+ cursorPtr->system = 0;
+
+ if (argv[0][0] == '@') {
/*
* Check for system cursor of type @<filename>, where only
- * the name is allowed. This accepts either:
+ * the name is allowed. This accepts any of:
* -cursor @/winnt/cursors/globe.ani
* -cursor @C:/Winnt/cursors/E_arrow.cur
* -cursor {@C:/Program\ Files/Cursors/bart.ani}
+ * -cursor {{@C:/Program Files/Cursors/bart.ani}}
+ * -cursor [list @[file join "C:/Program Files" Cursors bart.ani]]
*/
- if ((argc != 1) || (argv[0][0] != '@')) {
- ckfree((char *) argv);
- goto badCursorSpec;
- }
+
if (Tcl_IsSafe(interp)) {
Tcl_AppendResult(interp, "can't get cursor from a file in",
" a safe interpreter", (char *) NULL);
ckfree((char *) argv);
- ckfree((char *)cursorPtr);
+ ckfree((char *) cursorPtr);
return NULL;
}
cursorPtr->winCursor = LoadCursorFromFile(&(argv[0][1]));
- cursorPtr->system = 0;
- ckfree((char *) argv);
+ } else {
+ /*
+ * Check for the cursor in the system cursor set.
+ */
+ for (namePtr = cursorNames; namePtr->name != NULL; namePtr++) {
+ if (strcmp(namePtr->name, argv[0]) == 0) {
+ cursorPtr->winCursor = LoadCursor(NULL, namePtr->id);
+ break;
+ }
+ }
+
+ if (cursorPtr->winCursor == NULL) {
+ /*
+ * Hmm, it is not in the system cursor set. Check to see
+ * if it is one of our application resources.
+ */
+ cursorPtr->winCursor = LoadCursor(Tk_GetHINSTANCE(), argv[0]);
+ } else {
+ cursorPtr->system = 1;
+ }
}
+
if (cursorPtr->winCursor == NULL) {
- badCursorSpec:
- ckfree((char *)cursorPtr);
+ ckfree((char *) cursorPtr);
+ badCursorSpec:
+ ckfree((char *) argv);
Tcl_AppendResult(interp, "bad cursor spec \"", string, "\"",
(char *) NULL);
return NULL;
} else {
+ ckfree((char *) argv);
return (TkCursor *) cursorPtr;
}
}
@@ -168,8 +181,8 @@ TkCursor *
TkCreateCursorFromData(tkwin, source, mask, width, height, xHot, yHot,
fgColor, bgColor)
Tk_Window tkwin; /* Window in which cursor will be used. */
- char *source; /* Bitmap data for cursor shape. */
- char *mask; /* Bitmap data for cursor mask. */
+ CONST char *source; /* Bitmap data for cursor shape. */
+ CONST char *mask; /* Bitmap data for cursor mask. */
int width, height; /* Dimensions of cursor. */
int xHot, yHot; /* Location of hot-spot in cursor. */
XColor fgColor; /* Foreground color for cursor. */
@@ -236,4 +249,3 @@ TkpSetCursor(cursor)
SetCursor(hcursor);
}
}
-
diff --git a/tk/win/tkWinDefault.h b/tk/win/tkWinDefault.h
index 3860cce0a33..d1c5401ff3c 100644
--- a/tk/win/tkWinDefault.h
+++ b/tk/win/tkWinDefault.h
@@ -32,14 +32,14 @@
#define NORMAL_BG "SystemButtonFace"
#define NORMAL_FG "SystemButtonText"
#define ACTIVE_BG NORMAL_BG
-#define TEXT_FG "SystemWindowText"
+#define TEXT_FG "SystemWindowText"
#define SELECT_BG "SystemHighlight"
#define SELECT_FG "SystemHighlightText"
#define TROUGH "SystemScrollbar"
#define INDICATOR "SystemWindow"
#define DISABLED "SystemDisabledText"
-#define MENU_BG "SystemMenu"
-#define MENU_FG "SystemMenuText"
+#define MENU_BG "SystemMenu"
+#define MENU_FG "SystemMenuText"
#define HIGHLIGHT "SystemWindowFrame"
/*
@@ -58,6 +58,7 @@
#define DEF_BUTTON_BORDER_WIDTH "2"
#define DEF_BUTTON_CURSOR ""
#define DEF_BUTTON_COMMAND ""
+#define DEF_BUTTON_COMPOUND "none"
#define DEF_BUTTON_DEFAULT "disabled"
#define DEF_BUTTON_DISABLED_FG_COLOR DISABLED
#define DEF_BUTTON_DISABLED_FG_MONO ""
@@ -75,13 +76,16 @@
#define DEF_BUTTON_JUSTIFY "center"
#define DEF_BUTTON_OFF_VALUE "0"
#define DEF_BUTTON_ON_VALUE "1"
-#define DEF_BUTTON_PADX "1"
+#define DEF_BUTTON_OVER_RELIEF ""
+#define DEF_BUTTON_PADX "1"
#define DEF_LABCHKRAD_PADX "1"
-#define DEF_BUTTON_PADY "4.5"
+#define DEF_BUTTON_PADY "1"
#define DEF_LABCHKRAD_PADY "1"
#define DEF_BUTTON_RELIEF "raised"
#define DEF_LABCHKRAD_RELIEF "flat"
-#define DEF_BUTTON_SELECT_COLOR INDICATOR
+#define DEF_BUTTON_REPEAT_DELAY "0"
+#define DEF_BUTTON_REPEAT_INTERVAL "0"
+#define DEF_BUTTON_SELECT_COLOR INDICATOR
#define DEF_BUTTON_SELECT_MONO BLACK
#define DEF_BUTTON_SELECT_IMAGE (char *) NULL
#define DEF_BUTTON_STATE "normal"
@@ -139,6 +143,9 @@
#define DEF_ENTRY_BG_MONO WHITE
#define DEF_ENTRY_BORDER_WIDTH "2"
#define DEF_ENTRY_CURSOR "xterm"
+#define DEF_ENTRY_DISABLED_BG_COLOR "SystemButtonFace"
+#define DEF_ENTRY_DISABLED_BG_MONO WHITE
+#define DEF_ENTRY_DISABLED_FG DISABLED
#define DEF_ENTRY_EXPORT_SELECTION "1"
#define DEF_ENTRY_FONT CTL_FONT
#define DEF_ENTRY_FG TEXT_FG
@@ -152,6 +159,8 @@
#define DEF_ENTRY_INSERT_ON_TIME "600"
#define DEF_ENTRY_INSERT_WIDTH "2"
#define DEF_ENTRY_JUSTIFY "left"
+#define DEF_ENTRY_READONLY_BG_COLOR "SystemButtonFace"
+#define DEF_ENTRY_READONLY_BG_MONO WHITE
#define DEF_ENTRY_RELIEF "sunken"
#define DEF_ENTRY_SCROLL_COMMAND ""
#define DEF_ENTRY_SELECT_COLOR SELECT_BG
@@ -181,20 +190,35 @@
#define DEF_FRAME_HIGHLIGHT_BG NORMAL_BG
#define DEF_FRAME_HIGHLIGHT HIGHLIGHT
#define DEF_FRAME_HIGHLIGHT_WIDTH "0"
+#define DEF_FRAME_PADX "0"
+#define DEF_FRAME_PADY "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 labelframes:
+ */
+
+#define DEF_LABELFRAME_BORDER_WIDTH "2"
+#define DEF_LABELFRAME_CLASS "Labelframe"
+#define DEF_LABELFRAME_RELIEF "groove"
+#define DEF_LABELFRAME_FG NORMAL_FG
+#define DEF_LABELFRAME_FONT CTL_FONT
+#define DEF_LABELFRAME_TEXT ""
+#define DEF_LABELFRAME_LABELANCHOR "nw"
+
+/*
* Defaults for listboxes:
*/
-#define DEF_LISTBOX_BG_COLOR NORMAL_BG
+#define DEF_LISTBOX_ACTIVE_STYLE "underline"
+#define DEF_LISTBOX_BG_COLOR "SystemWindow"
#define DEF_LISTBOX_BG_MONO WHITE
#define DEF_LISTBOX_BORDER_WIDTH "2"
#define DEF_LISTBOX_CURSOR ""
+#define DEF_LISTBOX_DISABLED_FG DISABLED
#define DEF_LISTBOX_EXPORT_SELECTION "1"
#define DEF_LISTBOX_FONT CTL_FONT
#define DEF_LISTBOX_FG NORMAL_FG
@@ -207,11 +231,12 @@
#define DEF_LISTBOX_LIST_VARIABLE ""
#define DEF_LISTBOX_SELECT_COLOR SELECT_BG
#define DEF_LISTBOX_SELECT_MONO BLACK
-#define DEF_LISTBOX_SELECT_BD "1"
+#define DEF_LISTBOX_SELECT_BD "0"
#define DEF_LISTBOX_SELECT_FG_COLOR SELECT_FG
#define DEF_LISTBOX_SELECT_FG_MONO WHITE
#define DEF_LISTBOX_SELECT_MODE "browse"
#define DEF_LISTBOX_SET_GRID "0"
+#define DEF_LISTBOX_STATE "normal"
#define DEF_LISTBOX_TAKE_FOCUS (char *) NULL
#define DEF_LISTBOX_WIDTH "20"
@@ -226,6 +251,7 @@
#define DEF_MENU_ENTRY_BITMAP None
#define DEF_MENU_ENTRY_COLUMN_BREAK "0"
#define DEF_MENU_ENTRY_COMMAND (char *) NULL
+#define DEF_MENU_ENTRY_COMPOUND "none"
#define DEF_MENU_ENTRY_FG (char *) NULL
#define DEF_MENU_ENTRY_FONT (char *) NULL
#define DEF_MENU_ENTRY_HIDE_MARGIN "0"
@@ -334,6 +360,40 @@
#define DEF_MESSAGE_WIDTH "0"
/*
+ * Defaults for panedwindows
+ */
+
+#define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG
+#define DEF_PANEDWINDOW_BG_MONO WHITE
+#define DEF_PANEDWINDOW_BORDERWIDTH "2"
+#define DEF_PANEDWINDOW_CURSOR ""
+#define DEF_PANEDWINDOW_HANDLEPAD "8"
+#define DEF_PANEDWINDOW_HANDLESIZE "8"
+#define DEF_PANEDWINDOW_HEIGHT ""
+#define DEF_PANEDWINDOW_OPAQUERESIZE "0"
+#define DEF_PANEDWINDOW_ORIENT "horizontal"
+#define DEF_PANEDWINDOW_RELIEF "flat"
+#define DEF_PANEDWINDOW_SASHCURSOR ""
+#define DEF_PANEDWINDOW_SASHPAD "2"
+#define DEF_PANEDWINDOW_SASHRELIEF "raised"
+#define DEF_PANEDWINDOW_SASHWIDTH "2"
+#define DEF_PANEDWINDOW_SHOWHANDLE "0"
+#define DEF_PANEDWINDOW_WIDTH ""
+
+/*
+ * Defaults for panedwindow panes
+ */
+
+#define DEF_PANEDWINDOW_PANE_AFTER ""
+#define DEF_PANEDWINDOW_PANE_BEFORE ""
+#define DEF_PANEDWINDOW_PANE_HEIGHT ""
+#define DEF_PANEDWINDOW_PANE_MINSIZE "0"
+#define DEF_PANEDWINDOW_PANE_PADX "0"
+#define DEF_PANEDWINDOW_PANE_PADY "0"
+#define DEF_PANEDWINDOW_PANE_STICKY "nsew"
+#define DEF_PANEDWINDOW_PANE_WIDTH ""
+
+/*
* Defaults for scales:
*/
@@ -403,6 +463,7 @@
* Defaults for texts:
*/
+#define DEF_TEXT_AUTO_SEPARATORS "1"
#define DEF_TEXT_BG_COLOR "SystemWindow"
#define DEF_TEXT_BG_MONO WHITE
#define DEF_TEXT_BORDER_WIDTH "2"
@@ -420,6 +481,7 @@
#define DEF_TEXT_INSERT_OFF_TIME "300"
#define DEF_TEXT_INSERT_ON_TIME "600"
#define DEF_TEXT_INSERT_WIDTH "2"
+#define DEF_TEXT_MAX_UNDO "0"
#define DEF_TEXT_PADX "1"
#define DEF_TEXT_PADY "1"
#define DEF_TEXT_RELIEF "sunken"
@@ -437,11 +499,11 @@
#define DEF_TEXT_STATE "normal"
#define DEF_TEXT_TABS ""
#define DEF_TEXT_TAKE_FOCUS (char *) NULL
+#define DEF_TEXT_UNDO "0"
#define DEF_TEXT_WIDTH "80"
#define DEF_TEXT_WRAP "char"
#define DEF_TEXT_XSCROLL_COMMAND ""
#define DEF_TEXT_YSCROLL_COMMAND ""
-#define DEF_TEXT_TAB_SIZE "8"
/*
* Defaults for canvas text:
@@ -457,6 +519,6 @@
#define DEF_TOPLEVEL_CLASS "Toplevel"
#define DEF_TOPLEVEL_MENU ""
#define DEF_TOPLEVEL_SCREEN ""
+#define DEF_TOPLEVEL_USE ""
#endif /* _TKWINDEFAULT */
-
diff --git a/tk/win/tkWinDialog.c b/tk/win/tkWinDialog.c
index 3d0b2e1fddd..38b7370f56d 100644
--- a/tk/win/tkWinDialog.c
+++ b/tk/win/tkWinDialog.c
@@ -1,4 +1,3 @@
-
/*
* tkWinDialog.c --
*
@@ -20,6 +19,41 @@
#include <dlgs.h> /* includes common dialog template defines */
#include <cderr.h> /* includes the common dialog error codes */
+/*
+ * This controls the use of the new style tk_chooseDirectory dialog.
+ */
+#define USE_NEW_CHOOSEDIR 1
+#ifdef USE_NEW_CHOOSEDIR
+#include <shlobj.h> /* includes SHBrowseForFolder */
+
+/* These needed for compilation with VC++ 5.2 */
+#ifndef BIF_EDITBOX
+#define BIF_EDITBOX 0x10
+#endif
+#ifndef BIF_VALIDATE
+#define BIF_VALIDATE 0x0020
+#endif
+#ifndef BFFM_VALIDATEFAILED
+#ifdef UNICODE
+#define BFFM_VALIDATEFAILED 4
+#else
+#define BFFM_VALIDATEFAILED 3
+#endif
+#endif
+
+/*
+ * The following structure is used by the new Tk_ChooseDirectoryObjCmd
+ * to pass data between it and its callback. Unqiue to Winodws platform.
+ */
+typedef struct ChooseDirData {
+ TCHAR utfInitDir[MAX_PATH]; /* Initial folder to use */
+ TCHAR utfRetDir[MAX_PATH]; /* Returned folder to use */
+ Tcl_Interp *interp;
+ int mustExist; /* true if file must exist to return from
+ * callback */
+} CHOOSEDIRDATA;
+#endif
+
typedef struct ThreadSpecificData {
int debugFlag; /* Flags whether we should output debugging
* information while displaying a builtin
@@ -81,6 +115,16 @@ static const struct {int type; int btnIds[3];} allowedTypes[] = {
#define NUM_TYPES (sizeof(allowedTypes) / sizeof(allowedTypes[0]))
/*
+ * The value of TK_MULTI_MAX_PATH dictactes how many files can
+ * be retrieved with tk_get*File -multiple 1. It must be allocated
+ * on the stack, so make it large enough but not too large. -- hobbs
+ * The data is stored as <dir>\0<file1>\0<file2>\0...<fileN>\0\0.
+ * MAX_PATH == 260 on Win2K/NT.
+ */
+
+#define TK_MULTI_MAX_PATH (MAX_PATH*20)
+
+/*
* The following structure is used to pass information between the directory
* chooser procedure, Tk_ChooseDirectoryObjCmd(), and its dialog hook proc.
*/
@@ -100,14 +144,20 @@ typedef struct ChooseDir {
* the default dialog proc stores a '\0' in
* it, since, of course, no _file_ was
* selected. */
+ OPENFILENAME *ofnPtr; /* pointer to the OFN structure */
} ChooseDir;
/*
* Definitions of procedures used only in this file.
*/
+#ifdef USE_NEW_CHOOSEDIR
+static UINT APIENTRY ChooseDirectoryValidateProc(HWND hdlg, UINT uMsg,
+ LPARAM wParam, LPARAM lParam);
+#else
static UINT APIENTRY ChooseDirectoryHookProc(HWND hdlg, UINT uMsg,
WPARAM wParam, LPARAM lParam);
+#endif
static UINT CALLBACK ColorDlgHookProc(HWND hDlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
static int GetFileNameA(ClientData clientData,
@@ -123,7 +173,6 @@ static UINT APIENTRY OFNHookProc(HWND hdlg, UINT uMsg, WPARAM wParam,
static UINT APIENTRY OFNHookProcW(HWND hdlg, UINT uMsg, WPARAM wParam,
LPARAM lParam);
static void SetTkDialog(ClientData clientData);
-static int TrySetDirectory(HWND hwnd, const TCHAR *dir);
/*
*-------------------------------------------------------------------------
@@ -183,18 +232,19 @@ Tk_ChooseColorObjCmd(clientData, interp, objc, objv)
{
Tk_Window tkwin, parent;
HWND hWnd;
- int i, oldMode, winCode;
+ int i, oldMode, winCode, result;
CHOOSECOLOR chooseColor;
- static inited = 0;
+ static int inited = 0;
static COLORREF dwCustColors[16];
static long oldColor; /* the color selected last time */
- static char *optionStrings[] = {
- "-initialcolor", "-parent", "-title", NULL
+ static CONST char *optionStrings[] = {
+ "-initialcolor", "-parent", "-title", NULL
};
enum options {
- COLOR_INITIAL, COLOR_PARENT, COLOR_TITLE
+ COLOR_INITIAL, COLOR_PARENT, COLOR_TITLE
};
+ result = TCL_OK;
if (inited == 0) {
/*
* dwCustColors stores the custom color which the user can
@@ -219,7 +269,7 @@ Tk_ChooseColorObjCmd(clientData, interp, objc, objv)
chooseColor.lpCustColors = dwCustColors;
chooseColor.Flags = CC_RGBINIT | CC_FULLOPEN | CC_ENABLEHOOK;
chooseColor.lCustData = (LPARAM) NULL;
- chooseColor.lpfnHook = ColorDlgHookProc;
+ chooseColor.lpfnHook = (LPOFNHOOKPROC) ColorDlgHookProc;
chooseColor.lpTemplateName = (LPTSTR) interp;
for (i = 1; i < objc; i += 2) {
@@ -299,16 +349,18 @@ Tk_ChooseColorObjCmd(clientData, interp, objc, objv)
/*
* User has selected a color
*/
- char result[100];
+ char color[100];
- sprintf(result, "#%02x%02x%02x",
- GetRValue(chooseColor.rgbResult),
+ sprintf(color, "#%02x%02x%02x",
+ GetRValue(chooseColor.rgbResult),
GetGValue(chooseColor.rgbResult),
GetBValue(chooseColor.rgbResult));
- Tcl_AppendResult(interp, result, NULL);
+ Tcl_AppendResult(interp, color, NULL);
oldColor = chooseColor.rgbResult;
+ result = TCL_OK;
}
- return TCL_OK;
+
+ return result;
}
/*
@@ -352,8 +404,8 @@ ColorDlgHookProc(hDlg, uMsg, wParam, lParam)
ccPtr = (CHOOSECOLOR *) lParam;
title = (const char *) ccPtr->lCustData;
if ((title != NULL) && (title[0] != '\0')) {
- Tcl_UtfToExternalDString(NULL, title, -1, &ds);
- SetWindowText(hDlg, (TCHAR *) Tcl_DStringValue(&ds));
+ (*tkWinProcs->setWindowText)(hDlg,
+ Tcl_WinUtfToTChar(title, -1, &ds));
Tcl_DStringFree(&ds);
}
if (tsdPtr->debugFlag) {
@@ -454,24 +506,30 @@ GetFileNameW(clientData, interp, objc, objv, open)
int open; /* 1 to call GetOpenFileName(), 0 to
* call GetSaveFileName(). */
{
- Tcl_Encoding unicodeEncoding = Tcl_GetEncoding(NULL, "unicode");
OPENFILENAMEW ofn;
- WCHAR file[MAX_PATH];
- int result, winCode, oldMode, i;
+ WCHAR file[TK_MULTI_MAX_PATH];
+ int result, winCode, oldMode, i, multi = 0;
char *extension, *filter, *title;
Tk_Window tkwin;
HWND hWnd;
Tcl_DString utfFilterString, utfDirString;
Tcl_DString extString, filterString, dirString, titleString;
+ Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static char *optionStrings[] = {
+ static CONST char *saveOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-parent", "-title", NULL
+ "-parent", "-title", NULL
};
+ static CONST char *openOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
+ "-multiple", "-parent", "-title", NULL
+ };
+ CONST char **optionStrings;
+
enum options {
FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE,
- FILE_PARENT, FILE_TITLE
+ FILE_MULTIPLE, FILE_PARENT, FILE_TITLE
};
result = TCL_ERROR;
@@ -488,6 +546,12 @@ GetFileNameW(clientData, interp, objc, objv, open)
tkwin = (Tk_Window) clientData;
title = NULL;
+ if (open) {
+ optionStrings = openOptionStrings;
+ } else {
+ optionStrings = saveOptionStrings;
+ }
+
for (i = 1; i < objc; i += 2) {
int index;
char *string;
@@ -496,10 +560,24 @@ GetFileNameW(clientData, interp, objc, objv, open)
optionPtr = objv[i];
valuePtr = objv[i + 1];
- if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings, "option",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings,
+ "option", 0, &index) != TCL_OK) {
goto end;
}
+ /*
+ * We want to maximize code sharing between the open and save file
+ * dialog implementations; in particular, the switch statement below.
+ * We use different sets of option strings from the GetIndexFromObj
+ * call above, but a single enumeration for both. The save file
+ * dialog doesn't support -multiple, but it falls in the middle of
+ * the enumeration. Ultimately, this means that when the index found
+ * by GetIndexFromObj is >= FILE_MULTIPLE, when doing a save file
+ * dialog, we have to increment the index, so that it matches the
+ * open file dialog enumeration.
+ */
+ if (!open && index >= FILE_MULTIPLE) {
+ index++;
+ }
if (i + 1 == objc) {
string = Tcl_GetStringFromObj(optionPtr, NULL);
Tcl_AppendResult(interp, "value for \"", string, "\" missing",
@@ -526,7 +604,7 @@ GetFileNameW(clientData, interp, objc, objv, open)
}
case FILE_INITDIR: {
Tcl_DStringFree(&utfDirString);
- if (Tcl_TranslateFileName(interp, string,
+ if (Tcl_TranslateFileName(interp, string,
&utfDirString) == NULL) {
goto end;
}
@@ -538,11 +616,18 @@ GetFileNameW(clientData, interp, objc, objv, open)
if (Tcl_TranslateFileName(interp, string, &ds) == NULL) {
goto end;
}
- Tcl_UtfToExternal(NULL, unicodeEncoding, Tcl_DStringValue(&ds),
- Tcl_DStringLength(&ds), 0, NULL, (char *) file,
+ Tcl_UtfToExternal(NULL, unicodeEncoding, Tcl_DStringValue(&ds),
+ Tcl_DStringLength(&ds), 0, NULL, (char *) file,
sizeof(file), NULL, NULL, NULL);
break;
}
+ case FILE_MULTIPLE: {
+ if (Tcl_GetBooleanFromObj(interp, valuePtr,
+ &multi) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ }
case FILE_PARENT: {
tkwin = Tk_NameToWindow(interp, string, tkwin);
if (tkwin == NULL) {
@@ -566,28 +651,22 @@ GetFileNameW(clientData, interp, objc, objv, open)
Tk_MakeWindowExist(tkwin);
hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
- ofn.lStructSize = sizeof(ofn);
+ ZeroMemory(&ofn, sizeof(OPENFILENAMEW));
+ ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.hwndOwner = hWnd;
+#ifdef _WIN64
+ ofn.hInstance = (HINSTANCE) GetWindowLongPtr(ofn.hwndOwner,
+ GWLP_HINSTANCE);
+#else
ofn.hInstance = (HINSTANCE) GetWindowLong(ofn.hwndOwner,
GWL_HINSTANCE);
- ofn.lpstrFilter = NULL;
- ofn.lpstrCustomFilter = NULL;
- ofn.nMaxCustFilter = 0;
- ofn.nFilterIndex = 0;
+#endif
ofn.lpstrFile = (WCHAR *) file;
- ofn.nMaxFile = MAX_PATH;
- ofn.lpstrFileTitle = NULL;
- ofn.nMaxFileTitle = 0;
- ofn.lpstrInitialDir = NULL;
- ofn.lpstrTitle = NULL;
+ ofn.nMaxFile = TK_MULTI_MAX_PATH;
ofn.Flags = OFN_HIDEREADONLY | OFN_PATHMUSTEXIST
| OFN_NOCHANGEDIR | OFN_EXPLORER;
- ofn.nFileOffset = 0;
- ofn.nFileExtension = 0;
- ofn.lpstrDefExt = NULL;
- ofn.lpfnHook = OFNHookProcW;
+ ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProcW;
ofn.lCustData = (LPARAM) interp;
- ofn.lpTemplateName = NULL;
if (open != 0) {
ofn.Flags |= OFN_FILEMUSTEXIST;
@@ -599,20 +678,44 @@ GetFileNameW(clientData, interp, objc, objv, open)
ofn.Flags |= OFN_ENABLEHOOK;
}
+ if (multi != 0) {
+ ofn.Flags |= OFN_ALLOWMULTISELECT;
+ }
+
if (extension != NULL) {
Tcl_UtfToExternalDString(unicodeEncoding, extension, -1, &extString);
ofn.lpstrDefExt = (WCHAR *) Tcl_DStringValue(&extString);
}
- Tcl_UtfToExternalDString(unicodeEncoding, Tcl_DStringValue(&utfFilterString),
+ Tcl_UtfToExternalDString(unicodeEncoding,
+ Tcl_DStringValue(&utfFilterString),
Tcl_DStringLength(&utfFilterString), &filterString);
ofn.lpstrFilter = (WCHAR *) Tcl_DStringValue(&filterString);
if (Tcl_DStringValue(&utfDirString)[0] != '\0') {
- Tcl_UtfToExternalDString(unicodeEncoding, Tcl_DStringValue(&utfDirString),
+ Tcl_UtfToExternalDString(unicodeEncoding,
+ Tcl_DStringValue(&utfDirString),
Tcl_DStringLength(&utfDirString), &dirString);
- ofn.lpstrInitialDir = (WCHAR *) Tcl_DStringValue(&dirString);
+ } else {
+ /*
+ * NT 5.0 changed the meaning of lpstrInitialDir, so we have
+ * to ensure that we set the [pwd] if the user didn't specify
+ * anything else.
+ */
+ Tcl_DString cwd;
+
+ Tcl_DStringFree(&utfDirString);
+ if ((Tcl_GetCwd(interp, &utfDirString) == (char *) NULL) ||
+ (Tcl_TranslateFileName(interp,
+ Tcl_DStringValue(&utfDirString), &cwd) == NULL)) {
+ Tcl_ResetResult(interp);
+ } else {
+ Tcl_UtfToExternalDString(unicodeEncoding, Tcl_DStringValue(&cwd),
+ Tcl_DStringLength(&cwd), &dirString);
+ }
+ Tcl_DStringFree(&cwd);
}
+ ofn.lpstrInitialDir = (WCHAR *) Tcl_DStringValue(&dirString);
if (title != NULL) {
Tcl_UtfToExternalDString(unicodeEncoding, title, -1, &titleString);
@@ -650,23 +753,130 @@ GetFileNameW(clientData, interp, objc, objv, open)
*/
if (winCode != 0) {
- char *p;
- Tcl_DString ds;
-
- Tcl_ExternalToUtfDString(unicodeEncoding, (char *) ofn.lpstrFile, -1, &ds);
- for (p = Tcl_DStringValue(&ds); *p != '\0'; p++) {
- /*
- * Change the pathname to the Tcl "normalized" pathname, where
- * back slashes are used instead of forward slashes
+ if (ofn.Flags & OFN_ALLOWMULTISELECT) {
+ /*
+ * The result in custData->szFile contains many items,
+ * separated with null characters. It is terminated with
+ * two nulls in a row. The first element is the directory
+ * path.
*/
- if (*p == '\\') {
- *p = '/';
+ char *dir;
+ char *p;
+ char *file;
+ WCHAR *files;
+ Tcl_DString ds;
+ Tcl_DString fullname, filename;
+ Tcl_Obj *returnList;
+ int count = 0;
+
+ returnList = Tcl_NewObj();
+ Tcl_IncrRefCount(returnList);
+
+ files = ofn.lpstrFile;
+ Tcl_ExternalToUtfDString(unicodeEncoding, (char *) files, -1, &ds);
+
+ /* Get directory */
+ dir = Tcl_DStringValue(&ds);
+ for (p = dir; p && *p; p++) {
+ /*
+ * Change the pathname to the Tcl "normalized" pathname, where
+ * back slashes are used instead of forward slashes
+ */
+ if (*p == '\\') {
+ *p = '/';
+ }
}
+
+ while (*files != '\0') {
+ while (*files != '\0') {
+ files++;
+ }
+ files++;
+ if (*files != '\0') {
+ count++;
+ Tcl_ExternalToUtfDString(unicodeEncoding,
+ (char *)files, -1, &filename);
+ file = Tcl_DStringValue(&filename);
+ for (p = file; *p != '\0'; p++) {
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+ Tcl_DStringInit(&fullname);
+ Tcl_DStringAppend(&fullname, dir, -1);
+ Tcl_DStringAppend(&fullname, "/", -1);
+ Tcl_DStringAppend(&fullname, file, -1);
+ Tcl_ListObjAppendElement(interp, returnList,
+ Tcl_NewStringObj(Tcl_DStringValue(&fullname), -1));
+ Tcl_DStringFree(&fullname);
+ Tcl_DStringFree(&filename);
+ }
+ }
+ if (count == 0) {
+ /*
+ * Only one file was returned.
+ */
+ Tcl_ListObjAppendElement(interp, returnList,
+ Tcl_NewStringObj(dir, -1));
+ }
+ Tcl_SetObjResult(interp, returnList);
+ Tcl_DecrRefCount(returnList);
+ Tcl_DStringFree(&ds);
+ } else {
+ char *p;
+ Tcl_DString ds;
+
+ Tcl_ExternalToUtfDString(unicodeEncoding,
+ (char *) ofn.lpstrFile, -1, &ds);
+ for (p = Tcl_DStringValue(&ds); *p != '\0'; p++) {
+ /*
+ * Change the pathname to the Tcl "normalized" pathname, where
+ * back slashes are used instead of forward slashes
+ */
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+ Tcl_AppendResult(interp, Tcl_DStringValue(&ds), NULL);
+ Tcl_DStringFree(&ds);
}
- Tcl_AppendResult(interp, Tcl_DStringValue(&ds), NULL);
- Tcl_DStringFree(&ds);
- }
+ result = TCL_OK;
+ } else {
+ /*
+ * Use the CommDlgExtendedError() function to retrieve the error code.
+ * This function can return one of about two dozen codes; most of
+ * these indicate some sort of gross system failure (insufficient
+ * memory, bad window handles, etc.). Most of the error codes will be
+ * ignored; as we find we want more specific error messages for
+ * particular errors, we can extend the code as needed.
+ *
+ * We could also check for FNERR_BUFFERTOOSMALL, but we can't
+ * really do anything about it when it happens.
+ */
+ if (CommDlgExtendedError() == FNERR_INVALIDFILENAME) {
+ char *p;
+ Tcl_DString ds;
+
+ Tcl_ExternalToUtfDString(unicodeEncoding,
+ (char *) ofn.lpstrFile, -1, &ds);
+ for (p = Tcl_DStringValue(&ds); *p != '\0'; p++) {
+ /*
+ * Change the pathname to the Tcl "normalized" pathname,
+ * where back slashes are used instead of forward slashes
+ */
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+ Tcl_SetResult(interp, "invalid filename \"", TCL_STATIC);
+ Tcl_AppendResult(interp, Tcl_DStringValue(&ds), "\"", NULL);
+ Tcl_DStringFree(&ds);
+ } else {
+ result = TCL_OK;
+ }
+ }
+
if (ofn.lpstrTitle != NULL) {
Tcl_DStringFree(&titleString);
}
@@ -677,7 +887,6 @@ GetFileNameW(clientData, interp, objc, objv, open)
if (ofn.lpstrDefExt != NULL) {
Tcl_DStringFree(&extString);
}
- result = TCL_OK;
end:
Tcl_DStringFree(&utfDirString);
@@ -716,7 +925,11 @@ OFNHookProcW(
OPENFILENAMEW *ofnPtr;
if (uMsg == WM_INITDIALOG) {
+#ifdef _WIN64
+ SetWindowLongPtr(hdlg, GWLP_USERDATA, lParam);
+#else
SetWindowLong(hdlg, GWL_USERDATA, lParam);
+#endif
} else if (uMsg == WM_WINDOWPOSCHANGED) {
/*
* This message is delivered at the right time to enable Tk
@@ -725,12 +938,20 @@ OFNHookProcW(
* WM_WINDOWPOSCHANGED message.
*/
+#ifdef _WIN64
+ ofnPtr = (OPENFILENAMEW *) GetWindowLongPtr(hdlg, GWLP_USERDATA);
+#else
ofnPtr = (OPENFILENAMEW *) GetWindowLong(hdlg, GWL_USERDATA);
+#endif
if (ofnPtr != NULL) {
hdlg = GetParent(hdlg);
tsdPtr->debugInterp = (Tcl_Interp *) ofnPtr->lCustData;
Tcl_DoWhenIdle(SetTkDialog, (ClientData) hdlg);
+#ifdef _WIN64
+ SetWindowLongPtr(hdlg, GWLP_USERDATA, (LPARAM) NULL);
+#else
SetWindowLong(hdlg, GWL_USERDATA, (LPARAM) NULL);
+#endif
}
}
return 0;
@@ -762,8 +983,8 @@ GetFileNameA(clientData, interp, objc, objv, open)
* call GetSaveFileName(). */
{
OPENFILENAME ofn;
- TCHAR file[MAX_PATH], savePath[MAX_PATH];
- int result, winCode, oldMode, i;
+ TCHAR file[TK_MULTI_MAX_PATH], savePath[MAX_PATH];
+ int result, winCode, oldMode, i, multi = 0;
char *extension, *filter, *title;
Tk_Window tkwin;
HWND hWnd;
@@ -771,13 +992,19 @@ GetFileNameA(clientData, interp, objc, objv, open)
Tcl_DString extString, filterString, dirString, titleString;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static char *optionStrings[] = {
+ static CONST char *saveOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
- "-parent", "-title", NULL
+ "-parent", "-title", NULL
};
+ static CONST char *openOptionStrings[] = {
+ "-defaultextension", "-filetypes", "-initialdir", "-initialfile",
+ "-multiple", "-parent", "-title", NULL
+ };
+ CONST char **optionStrings;
+
enum options {
FILE_DEFAULT, FILE_TYPES, FILE_INITDIR, FILE_INITFILE,
- FILE_PARENT, FILE_TITLE
+ FILE_MULTIPLE, FILE_PARENT, FILE_TITLE
};
result = TCL_ERROR;
@@ -794,6 +1021,12 @@ GetFileNameA(clientData, interp, objc, objv, open)
tkwin = (Tk_Window) clientData;
title = NULL;
+ if (open) {
+ optionStrings = openOptionStrings;
+ } else {
+ optionStrings = saveOptionStrings;
+ }
+
for (i = 1; i < objc; i += 2) {
int index;
char *string;
@@ -802,10 +1035,24 @@ GetFileNameA(clientData, interp, objc, objv, open)
optionPtr = objv[i];
valuePtr = objv[i + 1];
- if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings, "option",
- 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings,
+ "option", 0, &index) != TCL_OK) {
goto end;
}
+ /*
+ * We want to maximize code sharing between the open and save file
+ * dialog implementations; in particular, the switch statement below.
+ * We use different sets of option strings from the GetIndexFromObj
+ * call above, but a single enumeration for both. The save file
+ * dialog doesn't support -multiple, but it falls in the middle of
+ * the enumeration. Ultimately, this means that when the index found
+ * by GetIndexFromObj is >= FILE_MULTIPLE, when doing a save file
+ * dialog, we have to increment the index, so that it matches the
+ * open file dialog enumeration.
+ */
+ if (!open && index >= FILE_MULTIPLE) {
+ index++;
+ }
if (i + 1 == objc) {
string = Tcl_GetStringFromObj(optionPtr, NULL);
Tcl_AppendResult(interp, "value for \"", string, "\" missing",
@@ -832,7 +1079,7 @@ GetFileNameA(clientData, interp, objc, objv, open)
}
case FILE_INITDIR: {
Tcl_DStringFree(&utfDirString);
- if (Tcl_TranslateFileName(interp, string,
+ if (Tcl_TranslateFileName(interp, string,
&utfDirString) == NULL) {
goto end;
}
@@ -849,6 +1096,13 @@ GetFileNameA(clientData, interp, objc, objv, open)
sizeof(file), NULL, NULL, NULL);
break;
}
+ case FILE_MULTIPLE: {
+ if (Tcl_GetBooleanFromObj(interp, valuePtr,
+ &multi) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ break;
+ }
case FILE_PARENT: {
tkwin = Tk_NameToWindow(interp, string, tkwin);
if (tkwin == NULL) {
@@ -874,14 +1128,19 @@ GetFileNameA(clientData, interp, objc, objv, open)
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hWnd;
+#ifdef _WIN64
+ ofn.hInstance = (HINSTANCE) GetWindowLongPtr(ofn.hwndOwner,
+ GWLP_HINSTANCE);
+#else
ofn.hInstance = (HINSTANCE) GetWindowLong(ofn.hwndOwner,
GWL_HINSTANCE);
+#endif
ofn.lpstrFilter = NULL;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 0;
ofn.lpstrFile = (LPTSTR) file;
- ofn.nMaxFile = MAX_PATH;
+ ofn.nMaxFile = TK_MULTI_MAX_PATH;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
@@ -891,7 +1150,7 @@ GetFileNameA(clientData, interp, objc, objv, open)
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
- ofn.lpfnHook = OFNHookProc;
+ ofn.lpfnHook = (LPOFNHOOKPROC) OFNHookProc;
ofn.lCustData = (LPARAM) interp;
ofn.lpTemplateName = NULL;
@@ -905,6 +1164,10 @@ GetFileNameA(clientData, interp, objc, objv, open)
ofn.Flags |= OFN_ENABLEHOOK;
}
+ if (multi != 0) {
+ ofn.Flags |= OFN_ALLOWMULTISELECT;
+ }
+
if (extension != NULL) {
Tcl_UtfToExternalDString(NULL, extension, -1, &extString);
ofn.lpstrDefExt = (LPTSTR) Tcl_DStringValue(&extString);
@@ -916,15 +1179,34 @@ GetFileNameA(clientData, interp, objc, objv, open)
if (Tcl_DStringValue(&utfDirString)[0] != '\0') {
Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&utfDirString),
Tcl_DStringLength(&utfDirString), &dirString);
- ofn.lpstrInitialDir = (LPTSTR) Tcl_DStringValue(&dirString);
+ } else {
+ /*
+ * NT 5.0 changed the meaning of lpstrInitialDir, so we have
+ * to ensure that we set the [pwd] if the user didn't specify
+ * anything else.
+ */
+ Tcl_DString cwd;
+
+ Tcl_DStringFree(&utfDirString);
+ if ((Tcl_GetCwd(interp, &utfDirString) == (char *) NULL) ||
+ (Tcl_TranslateFileName(interp,
+ Tcl_DStringValue(&utfDirString), &cwd) == NULL)) {
+ Tcl_ResetResult(interp);
+ } else {
+ Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&cwd),
+ Tcl_DStringLength(&cwd), &dirString);
+ }
+ Tcl_DStringFree(&cwd);
}
+ ofn.lpstrInitialDir = (LPTSTR) Tcl_DStringValue(&dirString);
+
if (title != NULL) {
Tcl_UtfToExternalDString(NULL, title, -1, &titleString);
ofn.lpstrTitle = (LPTSTR) Tcl_DStringValue(&titleString);
}
/*
- * Popup the dialog.
+ * Popup the dialog.
*/
GetCurrentDirectory(MAX_PATH, savePath);
@@ -956,21 +1238,125 @@ GetFileNameA(clientData, interp, objc, objv, open)
*/
if (winCode != 0) {
- char *p;
- Tcl_DString ds;
-
- Tcl_ExternalToUtfDString(NULL, (char *) ofn.lpstrFile, -1, &ds);
- for (p = Tcl_DStringValue(&ds); *p != '\0'; p++) {
- /*
- * Change the pathname to the Tcl "normalized" pathname, where
- * back slashes are used instead of forward slashes
+ if (ofn.Flags & OFN_ALLOWMULTISELECT) {
+ /*
+ * The result in custData->szFile contains many items,
+ * separated with null characters. It is terminated with
+ * two nulls in a row. The first element is the directory
+ * path.
*/
- if (*p == '\\') {
- *p = '/';
+ char *dir;
+ char *p;
+ char *file;
+ char *files;
+ Tcl_DString ds;
+ Tcl_DString fullname, filename;
+ Tcl_Obj *returnList;
+ int count = 0;
+
+ returnList = Tcl_NewObj();
+ Tcl_IncrRefCount(returnList);
+
+ files = ofn.lpstrFile;
+ Tcl_ExternalToUtfDString(NULL, (char *) files, -1, &ds);
+
+ /* Get directory */
+ dir = Tcl_DStringValue(&ds);
+ for (p = dir; p && *p; p++) {
+ /*
+ * Change the pathname to the Tcl "normalized" pathname, where
+ * back slashes are used instead of forward slashes
+ */
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+
+ while (*files != '\0') {
+ while (*files != '\0') {
+ files++;
+ }
+ files++;
+ if (*files != '\0') {
+ count++;
+ Tcl_ExternalToUtfDString(NULL,
+ (char *)files, -1, &filename);
+ file = Tcl_DStringValue(&filename);
+ for (p = file; *p != '\0'; p++) {
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+ Tcl_DStringInit(&fullname);
+ Tcl_DStringAppend(&fullname, dir, -1);
+ Tcl_DStringAppend(&fullname, "/", -1);
+ Tcl_DStringAppend(&fullname, file, -1);
+ Tcl_ListObjAppendElement(interp, returnList,
+ Tcl_NewStringObj(Tcl_DStringValue(&fullname), -1));
+ Tcl_DStringFree(&fullname);
+ Tcl_DStringFree(&filename);
+ }
+ }
+ if (count == 0) {
+ /*
+ * Only one file was returned.
+ */
+ Tcl_ListObjAppendElement(interp, returnList,
+ Tcl_NewStringObj(dir, -1));
+ }
+ Tcl_SetObjResult(interp, returnList);
+ Tcl_DecrRefCount(returnList);
+ Tcl_DStringFree(&ds);
+ } else {
+ char *p;
+ Tcl_DString ds;
+
+ Tcl_ExternalToUtfDString(NULL, (char *) ofn.lpstrFile, -1, &ds);
+ for (p = Tcl_DStringValue(&ds); *p != '\0'; p++) {
+ /*
+ * Change the pathname to the Tcl "normalized" pathname, where
+ * back slashes are used instead of forward slashes
+ */
+ if (*p == '\\') {
+ *p = '/';
+ }
}
+ Tcl_AppendResult(interp, Tcl_DStringValue(&ds), NULL);
+ Tcl_DStringFree(&ds);
+ }
+ result = TCL_OK;
+ } else {
+ /*
+ * Use the CommDlgExtendedError() function to retrieve the error code.
+ * This function can return one of about two dozen codes; most of
+ * these indicate some sort of gross system failure (insufficient
+ * memory, bad window handles, etc.). Most of the error codes will be
+ * ignored;; as we find we want specific error messages for particular
+ * errors, we can extend the code as needed.
+ *
+ * We could also check for FNERR_BUFFERTOOSMALL, but we can't
+ * really do anything about it when it happens.
+ */
+ if (CommDlgExtendedError() == FNERR_INVALIDFILENAME) {
+ char *p;
+ Tcl_DString ds;
+
+ Tcl_ExternalToUtfDString(NULL, (char *) ofn.lpstrFile, -1, &ds);
+ for (p = Tcl_DStringValue(&ds); *p != '\0'; p++) {
+ /*
+ * Change the pathname to the Tcl "normalized" pathname,
+ * where back slashes are used instead of forward slashes
+ */
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+ Tcl_SetResult(interp, "invalid filename \"", TCL_STATIC);
+ Tcl_AppendResult(interp, Tcl_DStringValue(&ds), "\"", NULL);
+ Tcl_DStringFree(&ds);
+ } else {
+ result = TCL_OK;
}
- Tcl_AppendResult(interp, Tcl_DStringValue(&ds), NULL);
- Tcl_DStringFree(&ds);
}
if (ofn.lpstrTitle != NULL) {
@@ -983,7 +1369,6 @@ GetFileNameA(clientData, interp, objc, objv, open)
if (ofn.lpstrDefExt != NULL) {
Tcl_DStringFree(&extString);
}
- result = TCL_OK;
end:
Tcl_DStringFree(&utfDirString);
@@ -1022,7 +1407,11 @@ OFNHookProc(
OPENFILENAME *ofnPtr;
if (uMsg == WM_INITDIALOG) {
+#ifdef _WIN64
+ SetWindowLongPtr(hdlg, GWLP_USERDATA, lParam);
+#else
SetWindowLong(hdlg, GWL_USERDATA, lParam);
+#endif
} else if (uMsg == WM_WINDOWPOSCHANGED) {
/*
* This message is delivered at the right time to both
@@ -1032,14 +1421,22 @@ OFNHookProc(
* WM_WINDOWPOSCHANGED message.
*/
+#ifdef _WIN64
+ ofnPtr = (OPENFILENAME *) GetWindowLongPtr(hdlg, GWLP_USERDATA);
+#else
ofnPtr = (OPENFILENAME *) GetWindowLong(hdlg, GWL_USERDATA);
+#endif
if (ofnPtr != NULL) {
if (ofnPtr->Flags & OFN_EXPLORER) {
hdlg = GetParent(hdlg);
}
tsdPtr->debugInterp = (Tcl_Interp *) ofnPtr->lCustData;
Tcl_DoWhenIdle(SetTkDialog, (ClientData) hdlg);
+#ifdef _WIN64
+ SetWindowLongPtr(hdlg, GWLP_USERDATA, (LPARAM) NULL);
+#else
SetWindowLong(hdlg, GWL_USERDATA, (LPARAM) NULL);
+#endif
}
}
return 0;
@@ -1110,7 +1507,7 @@ MakeFilter(interp, string, dsPtr)
* Since we may only add asterisks (*) to the filter, we need at most
* twice the size of the string to format the filter
*/
- filterStr = ckalloc(strlen(string) * 3);
+ filterStr = ckalloc((unsigned int) strlen(string) * 3);
for (filterPtr = flist.filters, p = filterStr; filterPtr;
filterPtr = filterPtr->next) {
@@ -1168,13 +1565,409 @@ MakeFilter(interp, string, dsPtr)
*p = '\0';
}
- Tcl_DStringAppend(dsPtr, filterStr, p - filterStr);
+ Tcl_DStringAppend(dsPtr, filterStr, (int) (p - filterStr));
ckfree((char *) filterStr);
TkFreeFileFilters(&flist);
return TCL_OK;
}
+#ifdef USE_NEW_CHOOSEDIR
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_ChooseDirectoryObjCmd --
+ *
+ * This procedure implements the "tk_chooseDirectory" dialog box
+ * for the Windows platform. See the user documentation for details
+ * on what it does. Uses the newer SHBrowseForFolder explorer type
+ * interface.
+ *
+ * Results:
+ * See user documentation.
+ *
+ * Side effects:
+ * A modal dialog window is created. Tcl_SetServiceMode() is
+ * called to allow background events to be processed
+ *
+ *----------------------------------------------------------------------
+
+The procedure tk_chooseDirectory pops up a dialog box for the user to
+select a directory. The following option-value pairs are possible as
+command line arguments:
+
+-initialdir dirname
+
+Specifies that the directories in directory should be displayed when the
+dialog pops up. If this parameter is not specified, then the directories
+in the current working directory are displayed. If the parameter specifies
+a relative path, the return value will convert the relative path to an
+absolute path. This option may not always work on the Macintosh. This is
+not a bug. Rather, the General Controls control panel on the Mac allows
+the end user to override the application default directory.
+
+-parent window
+
+Makes window the logical parent of the dialog. The dialog is displayed on
+top of its parent window.
+
+-title titleString
+
+Specifies a string to display as the title of the dialog box. If this
+option is not specified, then a default title will be displayed.
+
+-mustexist boolean
+
+Specifies whether the user may specify non-existant directories. If this
+parameter is true, then the user may only select directories that already
+exist. The default value is false.
+
+New Behaviour:
+
+- If mustexist = 0 and a user entered folder does not exist, a prompt will
+ pop-up asking if the user wants another chance to change it. The old
+ dialog just returned the bogus entry. On mustexist = 1, the entries MUST
+ exist before exiting the box with OK.
+
+ Bugs:
+
+- If valid abs directory name is entered into the entry box and Enter
+ pressed, the box will close returning the name. This is inconsistent when
+ entering relative names or names with forward slashes, which are
+ invalidated then corrected in the callback. After correction, the box is
+ held open to allow further modification by the user.
+
+- Not sure how to implement localization of message prompts.
+
+- -title is really -message.
+ToDo:
+- Fix bugs.
+- test to see what platforms this really works on. May require v4.71
+ of shell32.dll everywhere (what is standard?).
+ *
+ */
+int
+Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
+ ClientData clientData; /* Main window associated with interpreter. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ char path[MAX_PATH];
+ int oldMode, result, i;
+ LPCITEMIDLIST pidl; /* Returned by browser */
+ BROWSEINFO bInfo; /* Used by browser */
+ CHOOSEDIRDATA cdCBData; /* Structure to pass back and forth */
+ LPMALLOC pMalloc; /* Used by shell */
+
+ Tk_Window tkwin;
+ HWND hWnd;
+ char *utfTitle; /* Title for window */
+ TCHAR saveDir[MAX_PATH];
+ Tcl_DString titleString; /* UTF Title */
+ Tcl_DString initDirString; /* Initial directory */
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ static CONST char *optionStrings[] = {
+ "-initialdir", "-mustexist", "-parent", "-title", (char *) NULL
+ };
+ enum options {
+ DIR_INITIAL, DIR_EXIST, DIR_PARENT, FILE_TITLE
+ };
+
+ /*
+ * Initialize
+ */
+ result = TCL_ERROR;
+ path[0] = '\0';
+ utfTitle = NULL;
+
+ ZeroMemory(&cdCBData, sizeof(CHOOSEDIRDATA));
+ cdCBData.interp = interp;
+
+ tkwin = (Tk_Window) clientData;
+ /*
+ * Process the command line options
+ */
+ for (i = 1; i < objc; i += 2) {
+ int index;
+ char *string;
+ Tcl_Obj *optionPtr, *valuePtr;
+
+ optionPtr = objv[i];
+ valuePtr = objv[i + 1];
+
+ if (Tcl_GetIndexFromObj(interp, optionPtr, optionStrings, "option",
+ 0, &index) != TCL_OK) {
+ goto cleanup;
+ }
+ if (i + 1 == objc) {
+ string = Tcl_GetStringFromObj(optionPtr, NULL);
+ Tcl_AppendResult(interp, "value for \"", string, "\" missing",
+ (char *) NULL);
+ goto cleanup;
+ }
+
+ string = Tcl_GetString(valuePtr);
+ switch ((enum options) index) {
+ case DIR_INITIAL: {
+ if (Tcl_TranslateFileName(interp, string,
+ &initDirString) == NULL) {
+ goto cleanup;
+ }
+ string = Tcl_DStringValue(&initDirString);
+ /*
+ * Convert possible relative path to full path to keep
+ * dialog happy
+ */
+ GetFullPathName(string, MAX_PATH, saveDir, NULL);
+ lstrcpyn(cdCBData.utfInitDir, saveDir, MAX_PATH);
+ Tcl_DStringFree(&initDirString);
+ break;
+ }
+ case DIR_EXIST: {
+ if (Tcl_GetBooleanFromObj(interp, valuePtr,
+ &cdCBData.mustExist) != TCL_OK) {
+ goto cleanup;
+ }
+ break;
+ }
+ case DIR_PARENT: {
+ tkwin = Tk_NameToWindow(interp, string, tkwin);
+ if (tkwin == NULL) {
+ goto cleanup;
+ }
+ break;
+ }
+ case FILE_TITLE: {
+ utfTitle = string;
+ break;
+ }
+ }
+ }
+
+ /*
+ * Get ready to call the browser
+ */
+
+ Tk_MakeWindowExist(tkwin);
+ hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
+
+ /*
+ * Setup the parameters used by SHBrowseForFolder
+ */
+
+ bInfo.hwndOwner = hWnd;
+ bInfo.pszDisplayName = path;
+ bInfo.pidlRoot = NULL;
+ if (lstrlen(cdCBData.utfInitDir) == 0) {
+ GetCurrentDirectory(MAX_PATH, cdCBData.utfInitDir);
+ }
+ bInfo.lParam = (LPARAM) &cdCBData;
+
+ if (utfTitle != NULL) {
+ Tcl_UtfToExternalDString(NULL, utfTitle, -1, &titleString);
+ bInfo.lpszTitle = (LPTSTR) Tcl_DStringValue(&titleString);
+ } else {
+ bInfo.lpszTitle = "Please choose a directory, then select OK.";
+ }
+
+ /*
+ * Set flags to add edit box (needs 4.71 Shell DLLs), status text line,
+ * validate edit box and
+ */
+ bInfo.ulFlags = BIF_EDITBOX | BIF_STATUSTEXT | BIF_RETURNFSANCESTORS
+ | BIF_VALIDATE;
+
+ /*
+ * Callback to handle events
+ */
+ bInfo.lpfn = (BFFCALLBACK) ChooseDirectoryValidateProc;
+
+ /*
+ * Display dialog in background and process result.
+ * We look to give the user a chance to change their mind
+ * on an invalid folder if mustexist is 0;
+ */
+
+ oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
+ GetCurrentDirectory(MAX_PATH, saveDir);
+ if (SHGetMalloc(&pMalloc) == NOERROR) {
+ pidl = SHBrowseForFolder(&bInfo);
+ /* Null for cancel button or invalid dir, otherwise valid*/
+ if (pidl != NULL) {
+ if (!SHGetPathFromIDList(pidl, path)) {
+ Tcl_SetResult(interp, "Error: Not a file system folder\n",
+ TCL_VOLATILE);
+ };
+ pMalloc->lpVtbl->Free(pMalloc, (void *) pidl);
+ } else if (lstrlen(cdCBData.utfRetDir) > 0) {
+ lstrcpy(path, cdCBData.utfRetDir);
+ }
+ pMalloc->lpVtbl->Release(pMalloc);
+ }
+ SetCurrentDirectory(saveDir);
+ Tcl_SetServiceMode(oldMode);
+
+ /*
+ * Ensure that hWnd is enabled, because it can happen that we
+ * have updated the wrapper of the parent, which causes us to
+ * leave this child disabled (Windows loses sync).
+ */
+ EnableWindow(hWnd, 1);
+
+ /*
+ * Change the pathname to the Tcl "normalized" pathname, where
+ * back slashes are used instead of forward slashes
+ */
+ Tcl_ResetResult(interp);
+ if (*path) {
+ char *p;
+ Tcl_DString ds;
+
+ Tcl_ExternalToUtfDString(NULL, (char *) path, -1, &ds);
+ for (p = Tcl_DStringValue(&ds); *p != '\0'; p++) {
+ if (*p == '\\') {
+ *p = '/';
+ }
+ }
+ Tcl_AppendResult(interp, Tcl_DStringValue(&ds), NULL);
+ Tcl_DStringFree(&ds);
+ }
+
+ result = TCL_OK;
+
+ if (utfTitle != NULL) {
+ Tcl_DStringFree(&titleString);
+ }
+
+ cleanup:
+ return result;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ChooseDirectoryValidateProc --
+ *
+ * Hook procedure called by the explorer ChooseDirectory dialog when events
+ * occur. It is used to validate the text entry the user may have entered.
+ *
+ * Results:
+ * Returns 0 to allow default processing of message, or 1 to
+ * tell default dialog procedure not to close.
+ *
+ *----------------------------------------------------------------------
+ */
+static UINT APIENTRY
+ChooseDirectoryValidateProc (
+ HWND hwnd,
+ UINT message,
+ LPARAM lParam,
+ LPARAM lpData)
+{
+ TCHAR selDir[MAX_PATH];
+ CHOOSEDIRDATA *chooseDirSharedData;
+ Tcl_DString initDirString;
+ char string[MAX_PATH];
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+
+ chooseDirSharedData = (CHOOSEDIRDATA *)lpData;
+
+#ifdef _WIN64
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lpData);
+#else
+ SetWindowLong(hwnd, GWL_USERDATA, lpData);
+#endif
+
+ if (tsdPtr->debugFlag) {
+ tsdPtr->debugInterp = (Tcl_Interp *) chooseDirSharedData->interp;
+ Tcl_DoWhenIdle(SetTkDialog, (ClientData) hwnd);
+ }
+ chooseDirSharedData->utfRetDir[0] = '\0';
+ switch (message) {
+ case BFFM_VALIDATEFAILED:
+ /*
+ * First save and check to see if it is a valid path name, if
+ * so then make that path the one shown in the
+ * window. Otherwise, it failed the check and should be treated
+ * as such. Use Set/GetCurrentDirectory which allows relative
+ * path names and names with forward slashes. Use
+ * Tcl_TranslateFileName to make sure names like ~ are
+ * converted correctly.
+ */
+ Tcl_TranslateFileName(chooseDirSharedData->interp,
+ (char *)lParam, &initDirString);
+ lstrcpyn (string, Tcl_DStringValue(&initDirString), MAX_PATH);
+ Tcl_DStringFree(&initDirString);
+
+ if (SetCurrentDirectory((char *)string) == 0) {
+ LPTSTR lpFilePart[MAX_PATH];
+ /*
+ * Get the full path name to the user entry,
+ * at this point it doesn't exist so see if
+ * it is supposed to. Otherwise just return it.
+ */
+ GetFullPathName(string, MAX_PATH,
+ chooseDirSharedData->utfRetDir, /*unused*/ lpFilePart);
+ if (chooseDirSharedData->mustExist) {
+ /*
+ * User HAS to select a valid directory.
+ */
+ wsprintf(selDir, _T("Directory '%.200s' does not exist,\nplease select or enter an existing directory."), chooseDirSharedData->utfRetDir);
+ MessageBox(NULL, selDir, NULL, MB_ICONEXCLAMATION|MB_OK);
+ return 1;
+ }
+ } else {
+ /*
+ * Changed to new folder OK, return immediatly with the
+ * current directory in utfRetDir.
+ */
+ GetCurrentDirectory(MAX_PATH, chooseDirSharedData->utfRetDir);
+ return 0;
+ }
+ return 0;
+
+ case BFFM_SELCHANGED:
+ /*
+ * Set the status window to the currently selected path.
+ * And enable the OK button if a file system folder, otherwise
+ * disable the OK button for things like server names.
+ * perhaps a new switch -enablenonfolders can be used to allow
+ * non folders to be selected.
+ *
+ * Not called when user changes edit box directly.
+ */
+
+ if (SHGetPathFromIDList((LPITEMIDLIST) lParam, selDir)) {
+ SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM) selDir);
+ // enable the OK button
+ SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
+ //EnableWindow(GetDlgItem(hwnd, IDOK), TRUE);
+ SetCurrentDirectory(selDir);
+ } else {
+ // disable the OK button
+ SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0);
+ //EnableWindow(GetDlgItem(hwnd, IDOK), FALSE);
+ }
+ UpdateWindow(hwnd);
+ return 1;
+
+ case BFFM_INITIALIZED:
+ /*
+ * Directory browser intializing - tell it where to start from,
+ * user specified parameter.
+ */
+ SetCurrentDirectory((char *) lpData);
+ SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)lpData);
+ SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1);
+ break;
+
+ }
+ return 0;
+}
+#else
/*
*----------------------------------------------------------------------
*
@@ -1212,7 +2005,7 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
Tcl_DString titleString, dirString;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- static char *optionStrings[] = {
+ static CONST char *optionStrings[] = {
"-initialdir", "-mustexist", "-parent", "-title",
NULL
};
@@ -1285,11 +2078,17 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
hWnd = Tk_GetHWND(Tk_WindowId(tkwin));
cd.interp = interp;
+ cd.ofnPtr = &ofn;
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hWnd;
+#ifdef _WIN64
+ ofn.hInstance = (HINSTANCE) GetWindowLongPtr(ofn.hwndOwner,
+ GWLP_HINSTANCE);
+#else
ofn.hInstance = (HINSTANCE) GetWindowLong(ofn.hwndOwner,
GWL_HINSTANCE);
+#endif
ofn.lpstrFilter = NULL;
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
@@ -1306,14 +2105,33 @@ Tk_ChooseDirectoryObjCmd(clientData, interp, objc, objv)
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
ofn.lCustData = (LPARAM) &cd;
- ofn.lpfnHook = ChooseDirectoryHookProc;
+ ofn.lpfnHook = (LPOFNHOOKPROC) ChooseDirectoryHookProc;
ofn.lpTemplateName = MAKEINTRESOURCE(FILEOPENORD);
if (Tcl_DStringValue(&utfDirString)[0] != '\0') {
Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&utfDirString),
Tcl_DStringLength(&utfDirString), &dirString);
- ofn.lpstrInitialDir = (LPTSTR) Tcl_DStringValue(&dirString);
+ } else {
+ /*
+ * NT 5.0 changed the meaning of lpstrInitialDir, so we have
+ * to ensure that we set the [pwd] if the user didn't specify
+ * anything else.
+ */
+ Tcl_DString cwd;
+
+ Tcl_DStringFree(&utfDirString);
+ if ((Tcl_GetCwd(interp, &utfDirString) == (char *) NULL) ||
+ (Tcl_TranslateFileName(interp,
+ Tcl_DStringValue(&utfDirString), &cwd) == NULL)) {
+ Tcl_ResetResult(interp);
+ } else {
+ Tcl_UtfToExternalDString(NULL, Tcl_DStringValue(&cwd),
+ Tcl_DStringLength(&cwd), &dirString);
+ }
+ Tcl_DStringFree(&cwd);
}
+ ofn.lpstrInitialDir = (LPTSTR) Tcl_DStringValue(&dirString);
+
if (mustExist) {
ofn.Flags |= OFN_PATHMUSTEXIST;
}
@@ -1409,22 +2227,19 @@ ChooseDirectoryHookProc(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
OPENFILENAME *ofnPtr;
-
- /*
- * GWL_USERDATA keeps track of ofnPtr.
- */
-
- ofnPtr = (OPENFILENAME *) GetWindowLong(hwnd, GWL_USERDATA);
+ ChooseDir *cdPtr;
if (message == WM_INITDIALOG) {
- ChooseDir *cdPtr;
-
- SetWindowLong(hwnd, GWL_USERDATA, lParam);
ofnPtr = (OPENFILENAME *) lParam;
cdPtr = (ChooseDir *) ofnPtr->lCustData;
cdPtr->lastCtrl = 0;
cdPtr->lastIdx = 1000;
cdPtr->path[0] = '\0';
+#ifdef _WIN64
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) cdPtr);
+#else
+ SetWindowLong(hwnd, GWL_USERDATA, (LONG) cdPtr);
+#endif
if (ofnPtr->lpstrInitialDir == NULL) {
GetCurrentDirectory(MAX_PATH, cdPtr->path);
@@ -1439,9 +2254,20 @@ ChooseDirectoryHookProc(
}
return 0;
}
- if (ofnPtr == NULL) {
+
+ /*
+ * GWL_USERDATA keeps track of cdPtr.
+ */
+
+#ifdef _WIN64
+ cdPtr = (ChooseDir *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+#else
+ cdPtr = (ChooseDir *) GetWindowLong(hwnd, GWL_USERDATA);
+#endif
+ if (cdPtr == NULL) {
return 0;
}
+ ofnPtr = cdPtr->ofnPtr;
if (message == tsdPtr->WM_LBSELCHANGED) {
/*
@@ -1450,12 +2276,10 @@ ChooseDirectoryHookProc(
* If directory was already open, return selected directory.
*/
- ChooseDir *cdPtr;
int idCtrl, thisItem;
idCtrl = (int) wParam;
thisItem = LOWORD(lParam);
- cdPtr = (ChooseDir *) ofnPtr->lCustData;
GetCurrentDirectory(MAX_PATH, cdPtr->path);
if (idCtrl == lst2) {
@@ -1468,12 +2292,10 @@ ChooseDirectoryHookProc(
SetDlgItemText(hwnd, edt10, cdPtr->path);
SendDlgItemMessage(hwnd, edt10, EM_SETSEL, 0, -1);
} else if (message == WM_COMMAND) {
- ChooseDir *cdPtr;
int idCtrl, notifyCode;
idCtrl = LOWORD(wParam);
notifyCode = HIWORD(wParam);
- cdPtr = (ChooseDir *) ofnPtr->lCustData;
if ((idCtrl != IDOK) || (notifyCode != BN_CLICKED)) {
/*
@@ -1522,7 +2344,7 @@ ChooseDirectoryHookProc(
* Directory must exist. Complain, then rehighlight text.
*/
- wsprintf(tmp, _T("Cannot change directory to \"%.200s\"."),
+ wsprintf(tmp, _T("Cannot change directory to \"%.200s\"."),
cdPtr->path);
MessageBox(hwnd, tmp, NULL, MB_OK);
SendDlgItemMessage(hwnd, edt10, EM_SETSEL, 0, -1);
@@ -1590,6 +2412,7 @@ ChooseDirectoryHookProc(
}
return 0;
}
+#endif
/*
*----------------------------------------------------------------------
@@ -1623,7 +2446,8 @@ Tk_MessageBoxObjCmd(clientData, interp, objc, objv)
int defaultBtn, icon, type;
int i, oldMode, flags, winCode;
Tcl_DString messageString, titleString;
- static char *optionStrings[] = {
+ Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
+ static CONST char *optionStrings[] = {
"-default", "-icon", "-message", "-parent",
"-title", "-type", NULL
};
@@ -1734,12 +2558,16 @@ Tk_MessageBoxObjCmd(clientData, interp, objc, objv)
flags |= icon | type | MB_SYSTEMMODAL;
- Tcl_UtfToExternalDString(NULL, message, -1, &messageString);
- Tcl_UtfToExternalDString(NULL, title, -1, &titleString);
+ Tcl_UtfToExternalDString(unicodeEncoding, message, -1, &messageString);
+ Tcl_UtfToExternalDString(unicodeEncoding, title, -1, &titleString);
oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
- winCode = MessageBox(hWnd, Tcl_DStringValue(&messageString),
- Tcl_DStringValue(&titleString), flags);
+ /*
+ * MessageBoxW exists for all platforms. Use it to allow unicode
+ * error message to be displayed correctly where possible by the OS.
+ */
+ winCode = MessageBoxW(hWnd, (WCHAR *) Tcl_DStringValue(&messageString),
+ (WCHAR *) Tcl_DStringValue(&titleString), flags);
(void) Tcl_SetServiceMode(oldMode);
/*
@@ -1762,10 +2590,7 @@ SetTkDialog(ClientData clientData)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
char buf[32];
- HWND hwnd;
-
- hwnd = (HWND) clientData;
- sprintf(buf, "0x%08x", hwnd);
+ sprintf(buf, "0x%p", (HWND) clientData);
Tcl_SetVar(tsdPtr->debugInterp, "tk_dialog", buf, TCL_GLOBAL_ONLY);
}
diff --git a/tk/win/tkWinDraw.c b/tk/win/tkWinDraw.c
index eafe1effd78..a4dc49db73c 100644
--- a/tk/win/tkWinDraw.c
+++ b/tk/win/tkWinDraw.c
@@ -589,6 +589,12 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x,
image->data, infoPtr, DIB_RGB_COLORS);
ckfree((char *) infoPtr);
}
+ if(!bitmap) {
+ panic("Fail to allocate bitmap\n");
+ DeleteDC(dcMem);
+ TkWinReleaseDrawableDC(d, dc, &state);
+ return;
+ }
bitmap = SelectObject(dcMem, bitmap);
BitBlt(dc, dest_x, dest_y, width, height, dcMem, src_x, src_y, SRCCOPY);
DeleteObject(SelectObject(dcMem, bitmap));
@@ -745,15 +751,13 @@ RenderObject(dc, gc, points, npoints, mode, pen, func)
}
/*
- * Grow the bounding box enough to account for wide lines.
+ * Grow the bounding box enough to account for line width.
*/
- if (gc->line_width > 1) {
- rect.left -= gc->line_width;
- rect.top -= gc->line_width;
- rect.right += gc->line_width;
- rect.bottom += gc->line_width;
- }
+ rect.left -= gc->line_width;
+ rect.top -= gc->line_width;
+ rect.right += gc->line_width;
+ rect.bottom += gc->line_width;
width = rect.right - rect.left;
height = rect.bottom - rect.top;
@@ -1333,5 +1337,3 @@ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, drawable)
{
TkDrawInsetFocusHighlight(tkwin, fgGC, highlightWidth, drawable, 0);
}
-
-
diff --git a/tk/win/tkWinEmbed.c b/tk/win/tkWinEmbed.c
index 55893afa65a..249dae1cf36 100644
--- a/tk/win/tkWinEmbed.c
+++ b/tk/win/tkWinEmbed.c
@@ -110,7 +110,7 @@ TkpTestembedCmd(clientData, interp, argc, argv)
ClientData clientData;
Tcl_Interp *interp;
int argc;
- char **argv;
+ CONST char **argv;
{
return TCL_OK;
}
@@ -144,10 +144,11 @@ TkpUseWindow(interp, tkwin, string)
* if string is bogus. */
Tk_Window tkwin; /* Tk window that does not yet have an
* associated X window. */
- char *string; /* String identifying an X window to use
+ CONST char *string; /* String identifying an X window to use
* for tkwin; must be an integer value. */
{
TkWindow *winPtr = (TkWindow *) tkwin;
+ TkWindow *usePtr;
int id;
HWND hwnd;
Container *containerPtr;
@@ -177,6 +178,15 @@ TkpUseWindow(interp, tkwin, string)
return TCL_ERROR;
}
+ usePtr = (TkWindow *) Tk_HWNDToWindow(hwnd);
+ if (usePtr != NULL) {
+ if (!(usePtr->flags & TK_CONTAINER)) {
+ Tcl_AppendResult(interp, "window \"", usePtr->pathName,
+ "\" doesn't have -container option set", (char *) NULL);
+ return TCL_ERROR;
+ }
+ }
+
/*
* Store the parent window in the platform private data slot so
* TkWmMapWindow can use it when creating the wrapper window.
@@ -397,7 +407,7 @@ TkWinEmbeddedEventProc(hwnd, message, wParam, lParam)
break;
case TK_GEOMETRYREQ:
- EmbedGeometryRequest(containerPtr, wParam, lParam);
+ EmbedGeometryRequest(containerPtr, (int) wParam, lParam);
break;
}
return 1;
@@ -628,10 +638,12 @@ EmbedWindowDeleted(winPtr)
* Find the Container structure for this window work. Delete the
* information about the embedded application and free the container's
* record.
+ * The main container may be null. [Bug #476176]
*/
prevPtr = NULL;
containerPtr = tsdPtr->firstContainerPtr;
+ if (containerPtr == NULL) return;
while (1) {
if (containerPtr->embeddedPtr == winPtr) {
containerPtr->embeddedHWnd = NULL;
@@ -658,4 +670,3 @@ EmbedWindowDeleted(winPtr)
ckfree((char *) containerPtr);
}
}
-
diff --git a/tk/win/tkWinFont.c b/tk/win/tkWinFont.c
index 7f6d336ff03..dd314eb6468 100644
--- a/tk/win/tkWinFont.c
+++ b/tk/win/tkWinFont.c
@@ -180,7 +180,6 @@ static Tcl_ThreadDataKey dataKey;
* Information cached about the system at startup time.
*/
-static Tcl_Encoding unicodeEncoding;
static Tcl_Encoding systemEncoding;
/*
@@ -248,7 +247,6 @@ void
TkpFontPkgInit(
TkMainInfo *mainPtr) /* The application being created. */
{
- unicodeEncoding = Tcl_GetEncoding(NULL, "unicode");
if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
/*
* If running NT, then we will be calling some Unicode functions
@@ -256,7 +254,7 @@ TkpFontPkgInit(
* make sure we convert to/from the Unicode char set.
*/
- systemEncoding = unicodeEncoding;
+ systemEncoding = TkWinGetUnicodeEncoding();
}
}
@@ -354,7 +352,7 @@ TkpGetFontFromAttributes(
Window window;
WinFont *fontPtr;
char ***fontFallbacks;
- char *faceName, *fallback, *actualName;
+ Tk_Uid faceName, fallback, actualName;
tkwin = (Tk_Window) ((TkWindow *) tkwin)->mainPtr->winPtr;
window = Tk_WindowId(tkwin);
@@ -648,7 +646,7 @@ Tk_MeasureChars(
if (thisSubFontPtr != lastSubFontPtr) {
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
- p - source, &runString);
+ (int) (p - source), &runString);
(*familyPtr->getTextExtentPoint32Proc)(hdc,
Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
@@ -663,8 +661,8 @@ Tk_MeasureChars(
p = next;
}
familyPtr = lastSubFontPtr->familyPtr;
- Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source,
- &runString);
+ Tcl_UtfToExternalDString(familyPtr->encoding, source,
+ (int) (p - source), &runString);
(*familyPtr->getTextExtentPoint32Proc)(hdc,
Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
@@ -710,8 +708,9 @@ Tk_MeasureChars(
lastSubFontPtr = thisSubFontPtr;
}
familyPtr = lastSubFontPtr->familyPtr;
- Tcl_UtfToExternal(NULL, familyPtr->encoding, p, next - p,
- 0, NULL, buf, sizeof(buf), NULL, &dstWrote, NULL);
+ Tcl_UtfToExternal(NULL, familyPtr->encoding, p,
+ (int) (next - p), 0, NULL, buf, sizeof(buf), NULL,
+ &dstWrote, NULL);
(*familyPtr->getTextExtentPoint32Proc)(hdc, buf,
dstWrote >> familyPtr->isWideFont, &size);
newX += size.cx;
@@ -767,7 +766,7 @@ Tk_MeasureChars(
}
curX = termX;
- curByte = term - source;
+ curByte = (int) (term - source);
}
SelectObject(hdc, oldFont);
@@ -825,6 +824,11 @@ Tk_DrawChars(
dc = TkWinGetDrawableDC(display, drawable, &state);
SetROP2(dc, tkpWinRopModes[gc->function]);
+
+ if ((gc->clip_mask != None) &&
+ ((TkpClipMask*)gc->clip_mask)->type == TKP_CLIP_REGION) {
+ SelectClipRgn(dc, (HRGN)((TkpClipMask*)gc->clip_mask)->value.region);
+ }
if ((gc->fill_style == FillStippled
|| gc->fill_style == FillOpaqueStippled)
@@ -950,7 +954,7 @@ MultiFontTextOut(
if (p > source) {
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
- p - source, &runString);
+ (int) (p - source), &runString);
(*familyPtr->textOutProc)(hdc, x, y,
Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont);
@@ -969,8 +973,8 @@ MultiFontTextOut(
}
if (p > source) {
familyPtr = lastSubFontPtr->familyPtr;
- Tcl_UtfToExternalDString(familyPtr->encoding, source, p - source,
- &runString);
+ Tcl_UtfToExternalDString(familyPtr->encoding, source,
+ (int) (p - source), &runString);
(*familyPtr->textOutProc)(hdc, x, y, Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont);
Tcl_DStringFree(&runString);
@@ -1076,7 +1080,7 @@ InitFont(
InitSubFont(hdc, hFont, 1, &fontPtr->subFontArray[0]);
encoding = fontPtr->subFontArray[0].familyPtr->encoding;
- if (encoding == unicodeEncoding) {
+ if (encoding == TkWinGetUnicodeEncoding()) {
GetCharWidthW(hdc, 0, BASE_CHARS - 1, fontPtr->widths);
} else {
GetCharWidthA(hdc, 0, BASE_CHARS - 1, fontPtr->widths);
@@ -1347,7 +1351,7 @@ FreeFontFamily(
if (familyPtr->endCount != NULL) {
ckfree((char *) familyPtr->endCount);
}
- if (familyPtr->encoding != unicodeEncoding) {
+ if (familyPtr->encoding != TkWinGetUnicodeEncoding()) {
Tcl_FreeEncoding(familyPtr->encoding);
}
@@ -1665,7 +1669,7 @@ FontMapLoadPage(
familyPtr = subFontPtr->familyPtr;
encoding = familyPtr->encoding;
- if (familyPtr->encoding == unicodeEncoding) {
+ if (familyPtr->encoding == TkWinGetUnicodeEncoding()) {
/*
* Font is Unicode. Few fonts are going to have all characters, so
* examine the TrueType character existence metrics to determine
@@ -1931,6 +1935,7 @@ GetScreenFont(
HFONT hFont;
LOGFONTW lf;
+ memset(&lf, 0, sizeof(lf));
lf.lfHeight = -pixelSize;
lf.lfWidth = 0;
lf.lfEscapement = 0;
@@ -2314,6 +2319,17 @@ LoadFontRanges(
}
}
}
+ } else if (GetTextCharset(hdc) == ANSI_CHARSET) {
+ /*
+ * Bitmap font. We should also support ranges for the other
+ * *_CHARSET values.
+ */
+ segCount = 1;
+ cbData = segCount * sizeof(USHORT);
+ startCount = (USHORT *) ckalloc(cbData);
+ endCount = (USHORT *) ckalloc(cbData);
+ startCount[0] = 0x0000;
+ endCount[0] = 0x00ff;
}
SelectObject(hdc, hFont);
@@ -2365,4 +2381,3 @@ SwapLong(PULONG p)
temp += (LONG) ((BYTE) *p);
*p = temp;
}
-
diff --git a/tk/win/tkWinImage.c b/tk/win/tkWinImage.c
index 7cbdfde9036..00a5439bf35 100644
--- a/tk/win/tkWinImage.c
+++ b/tk/win/tkWinImage.c
@@ -221,7 +221,7 @@ XCreateImage(display, visual, depth, format, offset, data, width, height,
imagePtr->data = data;
imagePtr->byte_order = LSBFirst;
imagePtr->bitmap_unit = 8;
- imagePtr->bitmap_bit_order = MSBFirst;
+ imagePtr->bitmap_bit_order = LSBFirst;
imagePtr->bitmap_pad = bitmap_pad;
imagePtr->bits_per_pixel = depth;
imagePtr->depth = depth;
@@ -327,4 +327,3 @@ XGetImage(display, d, x, y, width, height, plane_mask, format)
return imagePtr;
}
-
diff --git a/tk/win/tkWinInit.c b/tk/win/tkWinInit.c
index 29f2246c977..471590b15f8 100644
--- a/tk/win/tkWinInit.c
+++ b/tk/win/tkWinInit.c
@@ -31,7 +31,7 @@
*
* Results:
* A standard Tcl completion code (TCL_OK or TCL_ERROR). Also
- * leaves information in interp->result.
+ * leaves information in the interp's result.
*
* Side effects:
* Sets "tk_library" Tcl variable, runs "tk.tcl" script.
@@ -75,17 +75,18 @@ TkpGetAppName(interp, namePtr)
Tcl_Interp *interp;
Tcl_DString *namePtr; /* A previously initialized Tcl_DString. */
{
- int argc;
- char **argv = NULL, *name, *p;
+ int argc, namelength;
+ CONST char **argv = NULL, *name, *p;
name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY);
+ namelength = -1;
if (name != NULL) {
Tcl_SplitPath(name, &argc, &argv);
if (argc > 0) {
name = argv[argc-1];
p = strrchr(name, '.');
if (p != NULL) {
- *p = '\0';
+ namelength = p - name;
}
} else {
name = NULL;
@@ -93,8 +94,9 @@ TkpGetAppName(interp, namePtr)
}
if ((name == NULL) || (*name == 0)) {
name = "tk";
+ namelength = -1;
}
- Tcl_DStringAppend(namePtr, name, -1);
+ Tcl_DStringAppend(namePtr, name, namelength);
if (argv != NULL) {
ckfree((char *)argv);
}
@@ -119,22 +121,18 @@ TkpGetAppName(interp, namePtr)
void
TkpDisplayWarning(msg, title)
- char *msg; /* Message to be displayed. */
- char *title; /* Title of warning. */
+ CONST char *msg; /* Message to be displayed. */
+ CONST char *title; /* Title of warning. */
{
- int l;
+ Tcl_DString msgString, titleString;
+ Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
- if ( GetStdHandle(STD_ERROR_HANDLE) != INVALID_HANDLE_VALUE &&
- GetFileType(GetStdHandle(STD_ERROR_HANDLE)) != FILE_TYPE_UNKNOWN ) {
- WriteFile(GetStdHandle(STD_ERROR_HANDLE), title, strlen(title), &l, NULL);
- WriteFile(GetStdHandle(STD_ERROR_HANDLE), ": " , 2 , &l, NULL);
- WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg , strlen(msg) , &l, NULL);
- WriteFile(GetStdHandle(STD_ERROR_HANDLE), "\n" , 1 , &l, NULL);
- FlushFileBuffers(GetStdHandle(STD_ERROR_HANDLE));
- } else {
- MessageBox(NULL, msg, title, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
- | MB_SETFOREGROUND | MB_TOPMOST);
- }
+ Tcl_UtfToExternalDString(unicodeEncoding, msg, -1, &msgString);
+ Tcl_UtfToExternalDString(unicodeEncoding, title, -1, &titleString);
+ MessageBoxW(NULL, (WCHAR *) Tcl_DStringValue(&msgString),
+ (WCHAR *) Tcl_DStringValue(&titleString),
+ MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
+ | MB_SETFOREGROUND | MB_TOPMOST);
+ Tcl_DStringFree(&msgString);
+ Tcl_DStringFree(&titleString);
}
-
-
diff --git a/tk/win/tkWinInt.h b/tk/win/tkWinInt.h
index 37f5dda2079..bf58e18d424 100644
--- a/tk/win/tkWinInt.h
+++ b/tk/win/tkWinInt.h
@@ -164,9 +164,42 @@ EXTERN LRESULT CALLBACK TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message,
*/
EXTERN void TkWinUpdatingClipboard(int mode);
+/*
+ * The following structure keeps track of whether we are using the
+ * multi-byte or the wide-character interfaces to the operating system.
+ * System calls should be made through the following function table.
+ *
+ * While some system calls need to use this A/W jump-table, it is not
+ * necessary for all calls to do it, which is why you won't see this
+ * used throughout the Tk code, but only in key areas. -- hobbs
+ */
+
+typedef struct TkWinProcs {
+ int useWide;
+ LRESULT (WINAPI *callWindowProc)(WNDPROC lpPrevWndFunc, HWND hWnd,
+ UINT Msg, WPARAM wParam, LPARAM lParam);
+ LRESULT (WINAPI *defWindowProc)(HWND hWnd, UINT Msg, WPARAM wParam,
+ LPARAM lParam);
+ ATOM (WINAPI *registerClass)(CONST WNDCLASS *lpWndClass);
+ BOOL (WINAPI *setWindowText)(HWND hWnd, LPCTSTR lpString);
+ HWND (WINAPI *createWindowEx)(DWORD dwExStyle, LPCTSTR lpClassName,
+ LPCTSTR lpWindowName, DWORD dwStyle, int x, int y,
+ int nWidth, int nHeight, HWND hWndParent, HMENU hMenu,
+ HINSTANCE hInstance, LPVOID lpParam);
+} TkWinProcs;
+
+EXTERN TkWinProcs *tkWinProcs;
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
-#endif /* _TKWININT */
+/*
+ * The following allows us to cache these encoding for multiple functions.
+ */
+
+extern Tcl_Encoding TkWinGetKeyInputEncoding _ANSI_ARGS_((void));
+extern Tcl_Encoding TkWinGetUnicodeEncoding _ANSI_ARGS_((void));
+
+#endif /* _TKWININT */
diff --git a/tk/win/tkWinKey.c b/tk/win/tkWinKey.c
index c60d1bfa1cb..33d84ab1935 100644
--- a/tk/win/tkWinKey.c
+++ b/tk/win/tkWinKey.c
@@ -90,7 +90,29 @@ TkpGetString(winPtr, eventPtr, dsPtr)
XKeyEvent* keyEv = &eventPtr->xkey;
Tcl_DStringInit(dsPtr);
- if (eventPtr->xkey.send_event != -1) {
+ if (eventPtr->xkey.send_event == -1) {
+ if (eventPtr->xkey.nbytes > 0) {
+ Tcl_ExternalToUtfDString(TkWinGetKeyInputEncoding(),
+ eventPtr->xkey.trans_chars, eventPtr->xkey.nbytes, dsPtr);
+ }
+ } else if (eventPtr->xkey.send_event == -2) {
+ /*
+ * Special case for win2000 multi-lingal IME input.
+ * xkey.trans_chars[] already contains a UNICODE char.
+ */
+
+ int unichar;
+ char buf[TCL_UTF_MAX];
+ int len;
+
+ unichar = (eventPtr->xkey.trans_chars[1] & 0xff);
+ unichar <<= 8;
+ unichar |= (eventPtr->xkey.trans_chars[0] & 0xff);
+
+ len = Tcl_UniCharToUtf((Tcl_UniChar) unichar, buf);
+
+ Tcl_DStringAppend(dsPtr, buf, len);
+ } else {
/*
* This is an event generated from generic code. It has no
* nchars or trans_chars members.
@@ -105,9 +127,6 @@ TkpGetString(winPtr, eventPtr, dsPtr)
int len = Tcl_UniCharToUtf((Tcl_UniChar) (keysym & 255), buf);
Tcl_DStringAppend(dsPtr, buf, len);
}
- } else if (eventPtr->xkey.nbytes > 0) {
- Tcl_ExternalToUtfDString(NULL, eventPtr->xkey.trans_chars,
- eventPtr->xkey.nbytes, dsPtr);
}
return Tcl_DStringValue(dsPtr);
}
@@ -565,14 +584,6 @@ TkpSetKeycodeAndState(tkwin, keySym, eventPtr)
eventPtr->xkey.keycode = (KeyCode) (result & 0xff);
}
}
- {
- /* Debug log */
- FILE *fp = fopen("c:\\temp\\tklog.txt", "a");
- if (fp != NULL) {
- fprintf(fp, "TkpSetKeycode. Keycode %d State %d Keysym %d\n", eventPtr->xkey.keycode, eventPtr->xkey.state, keySym);
- fclose(fp);
- }
- }
}
/*
@@ -729,5 +740,3 @@ XKeysymToString(keysym)
{
return NULL;
}
-
-
diff --git a/tk/win/tkWinMenu.c b/tk/win/tkWinMenu.c
index 52a4aca8ea0..cd58053eac4 100644
--- a/tk/win/tkWinMenu.c
+++ b/tk/win/tkWinMenu.c
@@ -461,7 +461,7 @@ GetEntryText(mePtr)
: Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
char *accel = (mePtr->accelPtr == NULL) ? ""
: Tcl_GetStringFromObj(mePtr->accelPtr, NULL);
- char *p, *next;
+ CONST char *p, *next;
Tcl_DString itemString;
/*
@@ -481,7 +481,7 @@ GetEntryText(mePtr)
Tcl_DStringAppend(&itemString, "&", 1);
}
next = Tcl_UtfNext(p);
- Tcl_DStringAppend(&itemString, p, next - p);
+ Tcl_DStringAppend(&itemString, p, (int) (next - p));
}
if (mePtr->accelLength > 0) {
Tcl_DStringAppend(&itemString, "\t", 1);
@@ -490,7 +490,7 @@ GetEntryText(mePtr)
Tcl_DStringAppend(&itemString, "&", 1);
}
next = Tcl_UtfNext(p);
- Tcl_DStringAppend(&itemString, p, next - p);
+ Tcl_DStringAppend(&itemString, p, (int) (next - p));
}
}
@@ -913,6 +913,7 @@ TkWinHandleMenuEvent(phwnd, pMessage, pwParam, plParam, plResult)
(ClientData) menuPtr);
ReconfigureWindowsMenu((ClientData) menuPtr);
}
+ RecursivelyClearActiveMenu(menuPtr);
if (!tsdPtr->inPostMenu) {
Tcl_Interp *interp;
int code;
@@ -1078,6 +1079,18 @@ TkWinHandleMenuEvent(phwnd, pMessage, pwParam, plParam, plResult)
} else {
TkActivateMenuEntry(menuPtr, -1);
}
+ } else {
+ /* On windows, menu entries should highlight even if they
+ ** are disabled. (I know this seems dumb, but it is the way
+ ** native windows menus works so we ought to mimic it.)
+ ** The ENTRY_PLATFORM_FLAG1 flag will indicate that the
+ ** entry should be highlighted even though it is disabled.
+ */
+ if (itemPtr->itemState & ODS_SELECTED) {
+ mePtr->entryFlags |= ENTRY_PLATFORM_FLAG1;
+ } else {
+ mePtr->entryFlags &= ~ENTRY_PLATFORM_FLAG1;
+ }
}
tkfont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
@@ -1101,8 +1114,8 @@ TkWinHandleMenuEvent(phwnd, pMessage, pwParam, plParam, plResult)
TkMenuInit();
if ((flags == 0xFFFF) && (*plParam == 0)) {
- Tcl_SetServiceMode(tsdPtr->oldServiceMode);
if (tsdPtr->modalMenuPtr != NULL) {
+ Tcl_SetServiceMode(tsdPtr->oldServiceMode);
RecursivelyClearActiveMenu(tsdPtr->modalMenuPtr);
}
} else {
@@ -1140,6 +1153,7 @@ TkWinHandleMenuEvent(phwnd, pMessage, pwParam, plParam, plResult)
Tcl_ServiceAll();
}
}
+ break;
}
}
return returnResult;
@@ -1172,6 +1186,10 @@ RecursivelyClearActiveMenu(
MenuSelectEvent(menuPtr);
for (i = 0; i < menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
+ if (mePtr->state == ENTRY_ACTIVE) {
+ mePtr->state = ENTRY_NORMAL;
+ }
+ mePtr->entryFlags &= ~ENTRY_PLATFORM_FLAG1;
if (mePtr->type == CASCADE_ENTRY) {
if ((mePtr->childMenuRefPtr != NULL)
&& (mePtr->childMenuRefPtr->menuPtr != NULL)) {
@@ -1222,16 +1240,15 @@ TkpSetWindowMenuBar(tkwin, menuPtr)
Tcl_SetHashValue(hashEntryPtr, (char *) menuPtr);
menuPtr->platformData = (TkMenuPlatformData) winMenuHdl;
TkWinSetMenu(tkwin, winMenuHdl);
- if (menuPtr->menuFlags & MENU_RECONFIGURE_PENDING) {
- Tcl_DoWhenIdle(ReconfigureWindowsMenu, (ClientData) menuPtr);
+ if (!(menuPtr->menuFlags & MENU_RECONFIGURE_PENDING)) {
menuPtr->menuFlags |= MENU_RECONFIGURE_PENDING;
+ Tcl_DoWhenIdle(ReconfigureWindowsMenu, (ClientData) menuPtr);
}
} else {
TkWinSetMenu(tkwin, NULL);
}
}
-
/*
*----------------------------------------------------------------------
*
@@ -1449,7 +1466,7 @@ DrawWindowsSystemBitmap(display, drawable, gc, rectPtr, bitmapID, alignFlags)
DPtoLP(hdc, &ptSize, 1);
ptOrg.y = ptOrg.x = 0;
- DPtoLP(hdc, &ptOrg, 1);
+ DPtoLP(scratchDC, &ptOrg, 1);
if (alignFlags & ALIGN_BITMAP_TOP) {
topOffset = 0;
@@ -1710,13 +1727,13 @@ DrawMenuUnderline(
{
if (mePtr->underline >= 0) {
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
- char *start = Tcl_UtfAtIndex(label, mePtr->underline);
- char *end = Tcl_UtfNext(start);
+ CONST char *start = Tcl_UtfAtIndex(label, mePtr->underline);
+ CONST char *end = Tcl_UtfNext(start);
Tk_UnderlineChars(menuPtr->display, d,
gc, tkfont, label, x + mePtr->indicatorSpace,
y + (height + fmPtr->ascent - fmPtr->descent) / 2,
- start - label, end - label);
+ (int) (start - label), (int) (end - label));
}
}
@@ -1889,7 +1906,6 @@ TkpInitializeMenuBindings(interp, bindingTable)
*
*----------------------------------------------------------------------
*/
-
static void
DrawMenuEntryLabel(
TkMenu *menuPtr, /* The menu we are drawing */
@@ -1903,46 +1919,122 @@ DrawMenuEntryLabel(
int width, /* width of entry */
int height) /* height of entry */
{
- int baseline;
int indicatorSpace = mePtr->indicatorSpace;
int activeBorderWidth;
int leftEdge;
int imageHeight, imageWidth;
+ int textHeight, textWidth;
+ int haveImage = 0, haveText = 0;
+ int imageXOffset = 0, imageYOffset = 0;
+ int textXOffset = 0, textYOffset = 0;
Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
leftEdge = x + indicatorSpace + activeBorderWidth;
/*
- * Draw label or bitmap or image for entry.
+ * Work out what we will need to draw first.
*/
- baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
if (mePtr->image != NULL) {
Tk_SizeOfImage(mePtr->image, &imageWidth, &imageHeight);
+ haveImage = 1;
+ } else if (mePtr->bitmapPtr != NULL) {
+ Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
+ Tk_SizeOfBitmap(menuPtr->display, bitmap, &imageWidth, &imageHeight);
+ haveImage = 1;
+ }
+ if (!haveImage || (mePtr->compound != COMPOUND_NONE)) {
+ if (mePtr->labelLength > 0) {
+ char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
+ textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
+ textHeight = fmPtr->linespace;
+ haveText = 1;
+ }
+ }
+
+ /*
+ * Now work out what the relative positions are.
+ */
+
+ if (haveImage && haveText) {
+ int fullWidth = (imageWidth > textWidth ? imageWidth : textWidth);
+ switch ((enum compound) mePtr->compound) {
+ case COMPOUND_TOP: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = imageHeight/2 + 2;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = -textHeight/2;
+ break;
+ }
+ case COMPOUND_BOTTOM: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = -imageHeight/2;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = textHeight/2 + 2;
+ break;
+ }
+ case COMPOUND_LEFT: {
+ textXOffset = imageWidth + 2;
+ textYOffset = 0;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_RIGHT: {
+ textXOffset = 0;
+ textYOffset = 0;
+ imageXOffset = textWidth + 2;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ textXOffset = (fullWidth - textWidth)/2;
+ textYOffset = 0;
+ imageXOffset = (fullWidth - imageWidth)/2;
+ imageYOffset = 0;
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
+ } else {
+ textXOffset = 0;
+ textYOffset = 0;
+ imageXOffset = 0;
+ imageYOffset = 0;
+ }
+
+ /*
+ * Draw label and/or bitmap or image for entry.
+ */
+
+ if (mePtr->image != NULL) {
if ((mePtr->selectImage != NULL)
&& (mePtr->entryFlags & ENTRY_SELECTED)) {
Tk_RedrawImage(mePtr->selectImage, 0, 0,
- imageWidth, imageHeight, d, leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2));
+ imageWidth, imageHeight, d, leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset));
} else {
Tk_RedrawImage(mePtr->image, 0, 0, imageWidth,
- imageHeight, d, leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2));
+ imageHeight, d, leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset));
}
} else if (mePtr->bitmapPtr != NULL) {
- int width, height;
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
- Tk_SizeOfBitmap(menuPtr->display, bitmap, &width, &height);
- XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0, (unsigned) width,
- (unsigned) height, leftEdge,
- (int) (y + (mePtr->height - height)/2), 1);
- } else {
+ XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0,
+ (unsigned) imageWidth, (unsigned) imageHeight,
+ leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset), 1);
+ }
+ if ((mePtr->compound != COMPOUND_NONE) || !haveImage) {
if (mePtr->labelLength > 0) {
+ int baseline = y + (height + fmPtr->ascent - fmPtr->descent) / 2;
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
Tk_DrawChars(menuPtr->display, d, gc, tkfont, label,
- mePtr->labelLength, leftEdge, baseline);
- DrawMenuUnderline(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, y,
+ mePtr->labelLength, leftEdge + textXOffset,
+ baseline + textYOffset);
+ DrawMenuUnderline(menuPtr, mePtr, d, gc, tkfont, fmPtr,
+ x + textXOffset, y + textYOffset,
width, height);
}
}
@@ -1954,8 +2046,8 @@ DrawMenuEntryLabel(
} else if ((mePtr->image != NULL)
&& (menuPtr->disabledImageGC != None)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
- leftEdge,
- (int) (y + (mePtr->height - imageHeight)/2),
+ leftEdge + imageXOffset,
+ (int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
(unsigned) imageWidth, (unsigned) imageHeight);
}
}
@@ -2237,21 +2329,68 @@ GetMenuLabelGeometry(mePtr, tkfont, fmPtr, widthPtr, heightPtr)
* portion */
{
TkMenu *menuPtr = mePtr->menuPtr;
+ int haveImage = 0, haveText = 0;
if (mePtr->image != NULL) {
Tk_SizeOfImage(mePtr->image, widthPtr, heightPtr);
+ haveImage = 1;
} else if (mePtr->bitmapPtr != NULL) {
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
Tk_SizeOfBitmap(menuPtr->display, bitmap, widthPtr, heightPtr);
+ haveImage = 1;
} else {
- *heightPtr = fmPtr->linespace;
+ *heightPtr = 0;
+ *widthPtr = 0;
+ }
+ if (haveImage && (mePtr->compound == COMPOUND_NONE)) {
+ /* We don't care about the text in this case */
+ } else {
+ /* Either it is compound or we don't have an image */
if (mePtr->labelPtr != NULL) {
+ int textWidth;
char *label = Tcl_GetStringFromObj(mePtr->labelPtr, NULL);
-
- *widthPtr = Tk_TextWidth(tkfont, label, mePtr->labelLength);
+ textWidth = Tk_TextWidth(tkfont, label, mePtr->labelLength);
+
+ if ((mePtr->compound != COMPOUND_NONE) && haveImage) {
+ switch ((enum compound) mePtr->compound) {
+ case COMPOUND_TOP:
+ case COMPOUND_BOTTOM: {
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ /* Add text and padding */
+ *heightPtr += fmPtr->linespace + 2;
+ break;
+ }
+ case COMPOUND_LEFT:
+ case COMPOUND_RIGHT: {
+ if (fmPtr->linespace > *heightPtr) {
+ *heightPtr = fmPtr->linespace;
+ }
+ /* Add text and padding */
+ *widthPtr += textWidth + 2;
+ break;
+ }
+ case COMPOUND_CENTER: {
+ if (fmPtr->linespace > *heightPtr) {
+ *heightPtr = fmPtr->linespace;
+ }
+ if (textWidth > *widthPtr) {
+ *widthPtr = textWidth;
+ }
+ break;
+ }
+ case COMPOUND_NONE: {break;}
+ }
} else {
- *widthPtr = 0;
+ /* We don't have an image or we're not compound */
+ *heightPtr = fmPtr->linespace;
+ *widthPtr = textWidth;
+ }
+ } else {
+ /* An empty entry still has this height */
+ *heightPtr = fmPtr->linespace;
}
}
*heightPtr += 1;
@@ -2286,7 +2425,8 @@ DrawMenuEntryBackground(
int width, /* width of rectangle to draw */
int height) /* height of rectangle to draw */
{
- if (mePtr->state == ENTRY_ACTIVE) {
+ if (mePtr->state == ENTRY_ACTIVE
+ || (mePtr->entryFlags & ENTRY_PLATFORM_FLAG1)!=0 ) {
bgBorder = activeBorder;
}
Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder,
@@ -2603,8 +2743,8 @@ MenuExitHandler(
Tcl_Obj *
TkWinGetMenuSystemDefault(
Tk_Window tkwin, /* A window to use. */
- char *dbName, /* The option database name. */
- char *className) /* The name of the option class. */
+ CONST char *dbName, /* The option database name. */
+ CONST char *className) /* The name of the option class. */
{
Tcl_Obj *valuePtr = NULL;
@@ -2715,7 +2855,7 @@ SetDefaults(
* documented.
*/
- if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_WINDOWS) {
+ if (TkWinGetPlatformId() >= VER_PLATFORM_WIN32_WINDOWS) {
indicatorDimensions[0] = GetSystemMetrics(SM_CYMENUCHECK);
indicatorDimensions[1] = ((GetSystemMetrics(SM_CXFIXEDFRAME) +
GetSystemMetrics(SM_CXBORDER)
diff --git a/tk/win/tkWinPixmap.c b/tk/win/tkWinPixmap.c
index 62b90180aee..f62f59c4751 100644
--- a/tk/win/tkWinPixmap.c
+++ b/tk/win/tkWinPixmap.c
@@ -196,4 +196,3 @@ XGetGeometry(display, d, root_return, x_return, y_return, width_return,
}
return 1;
}
-
diff --git a/tk/win/tkWinPort.h b/tk/win/tkWinPort.h
index c04862bf3b3..3f652e35b24 100644
--- a/tk/win/tkWinPort.h
+++ b/tk/win/tkWinPort.h
@@ -42,10 +42,7 @@
#endif
#include <time.h>
-
-#ifdef _MSC_VER
#include <tchar.h>
-#endif
#ifdef _MSC_VER
# define hypot _hypot
@@ -71,11 +68,11 @@
* input data available for a stdio FILE.
*/
-#if defined (_MSC_VER) || defined (__MINGW32__)
+#ifdef _MSC_VER
# define TK_READ_DATA_PENDING(f) ((f)->_cnt > 0)
-#else /* _MSC_VER || __MINGW32__ */
+#else /* _MSC_VER */
# define TK_READ_DATA_PENDING(f) ((f)->level > 0)
-#endif /* _MSC_VER || __MINGW32__ */
+#endif /* _MSC_VER */
/*
* The following stubs implement various calls that don't do anything
@@ -117,13 +114,6 @@
#define TkpGetNativeAppBitmap(display, name, w, h) None
/*
- * timezone et al are already defined in Windows32api headers used by
- * GNU mingw32 port.
- */
-
-#ifndef __MINGW32__
-
-/*
* Define timezone for gettimeofday.
*/
@@ -132,11 +122,8 @@ struct timezone {
int tz_dsttime;
};
-#endif
-
#ifndef _TCLINT
#include <tclInt.h>
#endif
#endif /* _WINPORT */
-
diff --git a/tk/win/tkWinRegion.c b/tk/win/tkWinRegion.c
index 3f4024da24e..ea48a5f592a 100644
--- a/tk/win/tkWinRegion.c
+++ b/tk/win/tkWinRegion.c
@@ -177,4 +177,28 @@ TkRectInRegion(r, x, y, width, height)
rect.right = x+width;
return RectInRegion((HRGN)r, &rect) ? RectanglePart : RectangleOut;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkSubtractRegion --
+ *
+ * Compute the set-difference of two regions.
+ *
+ * Results:
+ * Returns the result in the dr_return region.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+TkSubtractRegion(sra, srb, dr_return)
+ TkRegion sra;
+ TkRegion srb;
+ TkRegion dr_return;
+{
+ CombineRgn((HRGN) dr_return, (HRGN) sra, (HRGN) srb, RGN_DIFF);
+}
diff --git a/tk/win/tkWinScrlbr.c b/tk/win/tkWinScrlbr.c
index fa622ca365d..9b547d97d9b 100644
--- a/tk/win/tkWinScrlbr.c
+++ b/tk/win/tkWinScrlbr.c
@@ -87,9 +87,10 @@ static void UpdateScrollbarMetrics _ANSI_ARGS_((void));
* The class procedure table for the scrollbar widget.
*/
-TkClassProcs tkpScrollbarProcs = {
+Tk_ClassProcs tkpScrollbarProcs = {
+ sizeof(Tk_ClassProcs), /* size */
+ NULL, /* worldChangedProc */
CreateProc, /* createProc */
- NULL, /* geometryProc */
ModalLoopProc, /* modalProc */
};
@@ -241,7 +242,7 @@ CreateProc(tkwin, parentWin, instanceData)
for (winPtr = ((TkWindow*)tkwin)->nextPtr; winPtr != NULL;
winPtr = winPtr->nextPtr) {
- if ((winPtr->window != None) && !(winPtr->flags & TK_TOP_LEVEL)) {
+ if ((winPtr->window != None) && !(winPtr->flags & TK_TOP_HIERARCHY)) {
TkWinSetWindowPos(scrollPtr->hwnd, Tk_GetHWND(winPtr->window),
Below);
break;
@@ -249,8 +250,13 @@ CreateProc(tkwin, parentWin, instanceData)
}
scrollPtr->lastVertical = scrollPtr->info.vertical;
+#ifdef _WIN64
+ scrollPtr->oldProc = (WNDPROC)SetWindowLongPtr(scrollPtr->hwnd,
+ GWLP_WNDPROC, (LONG_PTR) ScrollbarProc);
+#else
scrollPtr->oldProc = (WNDPROC)SetWindowLong(scrollPtr->hwnd, GWL_WNDPROC,
(DWORD) ScrollbarProc);
+#endif
window = Tk_AttachHWND(tkwin, scrollPtr->hwnd);
UpdateScrollbar(scrollPtr);
@@ -295,7 +301,11 @@ TkpDisplayScrollbar(clientData)
if (scrollPtr->lastVertical != scrollPtr->info.vertical) {
HWND hwnd = Tk_GetHWND(Tk_WindowId(tkwin));
+#ifdef _WIN64
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) scrollPtr->oldProc);
+#else
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) scrollPtr->oldProc);
+#endif
DestroyWindow(hwnd);
CreateProc(tkwin, Tk_WindowId(Tk_Parent(tkwin)),
@@ -328,7 +338,11 @@ TkpDestroyScrollbar(scrollPtr)
WinScrollbar *winScrollPtr = (WinScrollbar *)scrollPtr;
HWND hwnd = winScrollPtr->hwnd;
if (hwnd) {
+#ifdef _WIN64
+ SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winScrollPtr->oldProc);
+#else
SetWindowLong(hwnd, GWL_WNDPROC, (DWORD) winScrollPtr->oldProc);
+#endif
if (winScrollPtr->winFlags & IN_MODAL_LOOP) {
((TkWindow *)scrollPtr->tkwin)->flags |= TK_DONT_DESTROY_WINDOW;
SetParent(hwnd, NULL);
@@ -745,5 +759,3 @@ TkpScrollbarPosition(scrollPtr, x, y)
}
return BOTTOM_GAP;
}
-
-
diff --git a/tk/win/tkWinSend.c b/tk/win/tkWinSend.c
index a9219a07f91..3bf42b46b96 100644
--- a/tk/win/tkWinSend.c
+++ b/tk/win/tkWinSend.c
@@ -42,12 +42,12 @@
*--------------------------------------------------------------
*/
-char *
+CONST char *
Tk_SetAppName(tkwin, name)
Tk_Window tkwin; /* Token for any window in the application
* to be named: it is just used to identify
* the application and the display. */
- char *name; /* The name that will be used to
+ CONST char *name; /* The name that will be used to
* refer to the interpreter in later
* "send" commands. Must be globally
* unique. */
diff --git a/tk/win/tkWinTest.c b/tk/win/tkWinTest.c
index dd66ce05f46..03d8984e129 100644
--- a/tk/win/tkWinTest.c
+++ b/tk/win/tkWinTest.c
@@ -6,6 +6,7 @@
*
* Copyright (c) 1997 Sun Microsystems, Inc.
* Copyright (c) 2000 by Scriptics Corporation.
+ * Copyright (c) 2001 by ActiveState Corporation.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -26,7 +27,7 @@ static int TestclipboardObjCmd(ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]);
static int TestwineventCmd(ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv);
+ Tcl_Interp *interp, int argc, CONST char **argv);
/*
@@ -65,6 +66,90 @@ TkplatformtestInit(
/*
*----------------------------------------------------------------------
*
+ * AppendSystemError --
+ *
+ * This routine formats a Windows system error message and places
+ * it into the interpreter result. Originally from tclWinReg.c.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+AppendSystemError(
+ Tcl_Interp *interp, /* Current interpreter. */
+ DWORD error) /* Result code from error. */
+{
+ int length;
+ WCHAR *wMsgPtr;
+ char *msg;
+ char id[TCL_INTEGER_SPACE], msgBuf[24 + TCL_INTEGER_SPACE];
+ Tcl_DString ds;
+ Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
+
+ length = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (WCHAR *) &wMsgPtr,
+ 0, NULL);
+ if (length == 0) {
+ char *msgPtr;
+
+ length = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *) &msgPtr,
+ 0, NULL);
+ if (length > 0) {
+ wMsgPtr = (WCHAR *) LocalAlloc(LPTR, (length + 1) * sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, msgPtr, length + 1, wMsgPtr,
+ length + 1);
+ LocalFree(msgPtr);
+ }
+ }
+ if (length == 0) {
+ if (error == ERROR_CALL_NOT_IMPLEMENTED) {
+ msg = "function not supported under Win32s";
+ } else {
+ sprintf(msgBuf, "unknown error: %ld", error);
+ msg = msgBuf;
+ }
+ } else {
+ Tcl_Encoding encoding;
+
+ encoding = Tcl_GetEncoding(NULL, "unicode");
+ msg = Tcl_ExternalToUtfDString(encoding, (char *) wMsgPtr, -1, &ds);
+ Tcl_FreeEncoding(encoding);
+ LocalFree(wMsgPtr);
+
+ length = Tcl_DStringLength(&ds);
+
+ /*
+ * Trim the trailing CR/LF from the system message.
+ */
+ if (msg[length-1] == '\n') {
+ msg[--length] = 0;
+ }
+ if (msg[length-1] == '\r') {
+ msg[--length] = 0;
+ }
+ }
+
+ sprintf(id, "%ld", error);
+ Tcl_SetErrorCode(interp, "WINDOWS", id, msg, (char *) NULL);
+ Tcl_AppendToObj(resultPtr, msg, length);
+
+ if (length != 0) {
+ Tcl_DStringFree(&ds);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TestclipboardObjCmd --
*
* This procedure implements the testclipboard command. It provides
@@ -89,6 +174,7 @@ TestclipboardObjCmd(clientData, interp, objc, objv)
TkWindow *winPtr = (TkWindow *) clientData;
HGLOBAL handle;
char *data;
+ int code = TCL_OK;
if (objc != 1) {
Tcl_WrongNumArgs(interp, 1, objv, (char *) NULL);
@@ -108,11 +194,13 @@ TestclipboardObjCmd(clientData, interp, objc, objv)
GlobalUnlock(handle);
} else {
Tcl_AppendResult(interp, "null clipboard handle", (char *) NULL);
- return TCL_ERROR;
+ code = TCL_ERROR;
}
CloseClipboard();
+ return code;
} else {
- Tcl_AppendResult(interp, "couldn't open clipboard", (char *) NULL);
+ Tcl_AppendResult(interp, "couldn't open clipboard: ", (char *) NULL);
+ AppendSystemError(interp, GetLastError());
return TCL_ERROR;
}
return TCL_OK;
@@ -140,9 +228,9 @@ TestwineventCmd(clientData, interp, argc, argv)
ClientData clientData; /* Main window for application. */
Tcl_Interp *interp; /* Current interpreter. */
int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ CONST char **argv; /* Argument strings. */
{
- HWND hwnd;
+ HWND hwnd = 0;
int id;
char *rest;
UINT message;
@@ -158,12 +246,12 @@ TestwineventCmd(clientData, interp, argc, argv)
};
if ((argc == 3) && (strcmp(argv[1], "debug") == 0)) {
- int i;
+ int b;
- if (Tcl_GetBoolean(interp, argv[2], &i) != TCL_OK) {
+ if (Tcl_GetBoolean(interp, argv[2], &b) != TCL_OK) {
return TCL_ERROR;
}
- TkWinDialogDebug(i);
+ TkWinDialogDebug(b);
return TCL_OK;
}
@@ -171,14 +259,24 @@ TestwineventCmd(clientData, interp, argc, argv)
return TCL_ERROR;
}
+#if 0
+ TkpScanWindowId(interp, argv[1], &id);
+ if (
+#ifdef _WIN64
+ (sscanf(string, "0x%p", &number) != 1) &&
+#endif
+ Tcl_GetInt(interp, string, (int *)&number) != TCL_OK) {
+ return TCL_ERROR;
+ }
+#endif
hwnd = (HWND) strtol(argv[1], &rest, 0);
- if (rest == argv[2]) {
+ if (rest == argv[1]) {
hwnd = FindWindow(NULL, argv[1]);
if (hwnd == NULL) {
Tcl_SetResult(interp, "no such window", TCL_STATIC);
return TCL_ERROR;
}
- }
+ }
UpdateWindow(hwnd);
id = strtol(argv[2], &rest, 0);
@@ -246,5 +344,3 @@ TestwineventCmd(clientData, interp, argc, argv)
-
-
diff --git a/tk/win/tkWinWindow.c b/tk/win/tkWinWindow.c
index 6980f39bca1..580531f9aa0 100644
--- a/tk/win/tkWinWindow.c
+++ b/tk/win/tkWinWindow.c
@@ -27,8 +27,6 @@ static Tcl_ThreadDataKey dataKey;
static void NotifyVisibility _ANSI_ARGS_((XEvent *eventPtr,
TkWindow *winPtr));
-static void StackWindow _ANSI_ARGS_((Window w, Window sibling,
- int stack_mode));
/*
*----------------------------------------------------------------------
@@ -146,8 +144,7 @@ HWND
Tk_GetHWND(window)
Window window;
{
- TkWinDrawable *twdPtr = (TkWinDrawable *) window;
- return twdPtr->window.handle;
+ return ((TkWinDrawable *) window)->window.handle;
}
/*
@@ -175,7 +172,11 @@ TkpPrintWindowId(buf, window)
Window window; /* Window to be printed into buffer. */
{
HWND hwnd = (window) ? Tk_GetHWND(window) : 0;
- sprintf(buf, "0x%x", (unsigned int) hwnd);
+ /*
+ * Use pointer representation, because Win64 is P64 (*not* LP64).
+ * Windows doesn't print the 0x for %p, so we do it.
+ */
+ sprintf(buf, "0x%p", hwnd);
}
/*
@@ -203,16 +204,25 @@ TkpPrintWindowId(buf, window)
int
TkpScanWindowId(interp, string, idPtr)
Tcl_Interp *interp; /* Interpreter to use for error reporting. */
- char *string; /* String containing a (possibly signed)
+ CONST char *string; /* String containing a (possibly signed)
* integer in a form acceptable to strtol. */
- int *idPtr; /* Place to store converted result. */
+ Window *idPtr; /* Place to store converted result. */
{
- int number;
Tk_Window tkwin;
+ Window number;
- if (Tcl_GetInt(interp, string, &number) != TCL_OK) {
+ /*
+ * We want sscanf for the 64-bit check, but if that doesn't work,
+ * then Tcl_GetInt manages the error correctly.
+ */
+ if (
+#ifdef _WIN64
+ (sscanf(string, "0x%p", &number) != 1) &&
+#endif
+ Tcl_GetInt(interp, string, (int *)&number) != TCL_OK) {
return TCL_ERROR;
}
+
tkwin = Tk_HWNDToWindow((HWND)number);
if (tkwin) {
*idPtr = Tk_WindowId(tkwin);
@@ -352,7 +362,7 @@ XMapWindow(display, w)
display->request++;
- ShowWindow(TkWinGetHWND(w), SW_SHOWNORMAL);
+ ShowWindow(Tk_GetHWND(w), SW_SHOWNORMAL);
winPtr->flags |= TK_MAPPED;
/*
@@ -361,13 +371,13 @@ XMapWindow(display, w)
* its mapped children have just become visible.
*/
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!(winPtr->flags & TK_TOP_HIERARCHY)) {
for (parentPtr = winPtr->parentPtr; ;
parentPtr = parentPtr->parentPtr) {
if ((parentPtr == NULL) || !(parentPtr->flags & TK_MAPPED)) {
return;
}
- if (parentPtr->flags & TK_TOP_LEVEL) {
+ if (parentPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
@@ -465,10 +475,10 @@ XUnmapWindow(display, w)
* it will be cleared before XUnmapWindow is called.
*/
- ShowWindow(TkWinGetHWND(w), SW_HIDE);
+ ShowWindow(Tk_GetHWND(w), SW_HIDE);
winPtr->flags &= ~TK_MAPPED;
- if (winPtr->flags & TK_TOP_LEVEL) {
+ if (winPtr->flags & TK_WIN_MANAGED) {
event.type = UnmapNotify;
event.xunmap.serial = display->request;
event.xunmap.send_event = False;
@@ -506,7 +516,7 @@ XMoveResizeWindow(display, w, x, y, width, height)
unsigned int height;
{
display->request++;
- MoveWindow(TkWinGetHWND(w), x, y, width, height, TRUE);
+ MoveWindow(Tk_GetHWND(w), x, y, width, height, TRUE);
}
/*
@@ -536,7 +546,7 @@ XMoveWindow(display, w, x, y)
display->request++;
- MoveWindow(TkWinGetHWND(w), x, y, winPtr->changes.width,
+ MoveWindow(Tk_GetHWND(w), x, y, winPtr->changes.width,
winPtr->changes.height, TRUE);
}
@@ -567,7 +577,7 @@ XResizeWindow(display, w, width, height)
display->request++;
- MoveWindow(TkWinGetHWND(w), winPtr->changes.x, winPtr->changes.y, width,
+ MoveWindow(Tk_GetHWND(w), winPtr->changes.x, winPtr->changes.y, width,
height, TRUE);
}
@@ -592,7 +602,7 @@ XRaiseWindow(display, w)
Display* display;
Window w;
{
- HWND window = TkWinGetHWND(w);
+ HWND window = Tk_GetHWND(w);
display->request++;
SetWindowPos(window, HWND_TOPMOST, 0, 0, 0, 0,
@@ -626,7 +636,7 @@ XConfigureWindow(display, w, value_mask, values)
XWindowChanges* values;
{
TkWindow *winPtr = TkWinGetWinPtr(w);
- HWND hwnd = TkWinGetHWND(w);
+ HWND hwnd = Tk_GetHWND(w);
display->request++;
@@ -679,7 +689,7 @@ XClearWindow(display, w)
HBRUSH brush;
HPALETTE oldPalette, palette;
TkWindow *winPtr;
- HWND hwnd = TkWinGetHWND(w);
+ HWND hwnd = Tk_GetHWND(w);
HDC dc = GetDC(hwnd);
palette = TkWinGetPalette(display->screens[0].cmap);
@@ -801,4 +811,3 @@ TkpWindowWasRecentlyDeleted(win, dispPtr)
{
return 0;
}
-
diff --git a/tk/win/tkWinWm.c b/tk/win/tkWinWm.c
index 8f7ba87d999..db1e540693c 100644
--- a/tk/win/tkWinWm.c
+++ b/tk/win/tkWinWm.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkWinWm.c --
*
* This module takes care of the interactions between a Tk-based
@@ -16,6 +16,7 @@
*/
#include "tkWinInt.h"
+#include <shellapi.h>
/*
* Event structure for synthetic activation events. These events are
@@ -43,7 +44,7 @@ typedef struct ProtocolHandler {
* end of list. */
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
char command[4]; /* Tcl command to invoke when a client
- * message for this protocol arrives.
+ * message for this protocol arrives.
* The actual size of the structure varies
* to accommodate the needs of the actual
* command. THIS MUST BE THE LAST FIELD OF
@@ -54,6 +55,88 @@ typedef struct ProtocolHandler {
((unsigned) (sizeof(ProtocolHandler) - 3 + cmdLength))
/*
+ * Helper type passed via lParam to TkWmStackorderToplevelEnumProc
+ */
+typedef struct TkWmStackorderToplevelPair {
+ Tcl_HashTable *table;
+ TkWindow **window_ptr;
+} TkWmStackorderToplevelPair;
+
+/*
+ * This structure represents the contents of a icon, in terms of its
+ * image. The HICON is an internal Windows format. Most of these
+ * icon-specific-structures originated with the Winico extension.
+ * We stripped out unused parts of that code, and integrated the
+ * code more naturally with Tcl.
+ */
+typedef struct {
+ UINT Width, Height, Colors; /* Width, Height and bpp */
+ LPBYTE lpBits; /* ptr to DIB bits */
+ DWORD dwNumBytes; /* how many bytes? */
+ LPBITMAPINFO lpbi; /* ptr to header */
+ LPBYTE lpXOR; /* ptr to XOR image bits */
+ LPBYTE lpAND; /* ptr to AND image bits */
+ HICON hIcon; /* DAS ICON */
+} ICONIMAGE, *LPICONIMAGE;
+/*
+ * This structure is how we represent a block of the above
+ * items. We will reallocate these structures according to
+ * how many images they need to contain.
+ */
+typedef struct {
+ int nNumImages; /* How many images? */
+ ICONIMAGE IconImages[1]; /* Image entries */
+} BlockOfIconImages, *BlockOfIconImagesPtr;
+/*
+ * These two structures are used to read in icons from an
+ * 'icon directory' (i.e. the contents of a .icr file, say).
+ * We only use these structures temporarily, since we copy
+ * the information we want into a BlockOfIconImages.
+ */
+typedef struct {
+ BYTE bWidth; /* Width of the image */
+ BYTE bHeight; /* Height of the image (times 2) */
+ BYTE bColorCount; /* Number of colors in image (0 if >=8bpp) */
+ BYTE bReserved; /* Reserved */
+ WORD wPlanes; /* Color Planes */
+ WORD wBitCount; /* Bits per pixel */
+ DWORD dwBytesInRes; /* how many bytes in this resource? */
+ DWORD dwImageOffset; /* where in the file is this image */
+} ICONDIRENTRY, *LPICONDIRENTRY;
+typedef struct {
+ WORD idReserved; /* Reserved */
+ WORD idType; /* resource type (1 for icons) */
+ WORD idCount; /* how many images? */
+ ICONDIRENTRY idEntries[1]; /* the entries for each image */
+} ICONDIR, *LPICONDIR;
+
+/*
+ * A pointer to one of these strucutures is associated with each
+ * toplevel. This allows us to free up all memory associated with icon
+ * resources when a window is deleted or if the window's icon is
+ * changed. They are simply reference counted according to:
+ *
+ * (i) how many WmInfo structures point to this object
+ * (ii) whether the ThreadSpecificData defined in this file contains
+ * a pointer to this object.
+ *
+ * The former count is for windows whose icons are individually
+ * set, and the latter is for the global default icon choice.
+ *
+ * Icons loaded from .icr/.icr use the iconBlock field, icons
+ * loaded from .exe/.dll use the hIcon field.
+ */
+typedef struct WinIconInstance {
+ int refCount; /* Number of instances that share this
+ * data structure. */
+ BlockOfIconImagesPtr iconBlock;
+ /* Pointer to icon resource data for
+ * image. */
+} WinIconInstance;
+
+typedef struct WinIconInstance *WinIconPtr;
+
+/*
* A data structure of the following type holds window-manager-related
* information for each top-level window in an application.
*/
@@ -65,17 +148,17 @@ typedef struct TkWmInfo {
* created by the window manager to wrap
* a toplevel window. This window is
* a direct child of the root window. */
- Tk_Uid titleUid; /* Title to display in window caption. If
- * NULL, use name of widget. */
- Tk_Uid iconName; /* Name to display in icon. */
- TkWindow *masterPtr; /* Master window for TRANSIENT_FOR property,
- * or NULL. */
+ char *title; /* Title to display in window caption. If
+ * NULL, use name of widget. Malloced. */
+ char *iconName; /* Name to display in icon. Malloced. */
XWMHints hints; /* Various pieces of information for
* window manager. */
char *leaderName; /* Path name of leader of window group
* (corresponds to hints.window_group).
- * Malloc-ed. Note: this field doesn't
+ * Malloc-ed. Note: this field doesn't
* get updated if leader is destroyed. */
+ TkWindow *masterPtr; /* Master window for TRANSIENT_FOR property,
+ * or NULL. */
Tk_Window icon; /* Window to use as icon for this window,
* or NULL. */
Tk_Window iconFor; /* Window for which this window is icon, or
@@ -143,6 +226,8 @@ typedef struct TkWmInfo {
* to eliminate redundant resize operations. */
HMENU hMenu; /* the hMenu associated with this menu */
DWORD style, exStyle; /* Style flags for the wrapper window. */
+ LONG styleConfig; /* Extra user requested style bits */
+ LONG exStyleConfig; /* Extra user requested extended style bits */
/*
* List of children of the toplevel which have private colormaps.
@@ -158,13 +243,15 @@ typedef struct TkWmInfo {
ProtocolHandler *protPtr; /* First in list of protocol handlers for
* this window (NULL means none). */
int cmdArgc; /* Number of elements in cmdArgv below. */
- char **cmdArgv; /* Array of strings to store in the
+ CONST char **cmdArgv; /* Array of strings to store in the
* WM_COMMAND property. NULL means nothing
* available. */
char *clientMachine; /* String to store in WM_CLIENT_MACHINE
* property, or NULL. */
int flags; /* Miscellaneous flags, defined below. */
int numTransients; /* number of transients on this window */
+ WinIconPtr iconPtr; /* pointer to titlebar icon structure for
+ * this window, or NULL. */
struct TkWmInfo *nextPtr; /* Next in list of all top-level windows. */
} WmInfo;
@@ -191,12 +278,23 @@ typedef struct TkWmInfo {
* a new position for the window, but it hasn't
* been reflected through the window manager
* yet.
- * WM_COLORAMPS_EXPLICIT - non-zero means the colormap windows were
+ * WM_COLORMAPS_EXPLICIT - non-zero means the colormap windows were
* set explicitly via "wm colormapwindows".
* WM_ADDED_TOPLEVEL_COLORMAP - non-zero means that when "wm colormapwindows"
* was called the top-level itself wasn't
* specified, so we added it implicitly at
* the end of the list.
+ * WM_WIDTH_NOT_RESIZABLE - non-zero means that we're not supposed to
+ * allow the user to change the width of the
+ * window (controlled by "wm resizable"
+ * command).
+ * WM_HEIGHT_NOT_RESIZABLE - non-zero means that we're not supposed to
+ * allow the user to change the height of the
+ * window (controlled by "wm resizable"
+ * command).
+ * WM_TRANSIENT_WITHDRAWN - non-zero means that this is a transient window
+ * that has explicitly been withdrawn. It should
+ * not mirror state changes in the master.
*/
#define WM_NEVER_MAPPED (1<<0)
@@ -211,6 +309,7 @@ typedef struct TkWmInfo {
#define WM_ADDED_TOPLEVEL_COLORMAP (1<<9)
#define WM_WIDTH_NOT_RESIZABLE (1<<10)
#define WM_HEIGHT_NOT_RESIZABLE (1<<11)
+#define WM_TRANSIENT_WITHDRAWN (1<<12)
/*
* Window styles for various types of toplevel windows.
@@ -224,8 +323,7 @@ typedef struct TkWmInfo {
#define WM_TRANSIENT_STYLE \
(WS_POPUP|WS_CAPTION|WS_SYSMENU|WS_CLIPSIBLINGS|CS_DBLCLKS)
-#define EX_TRANSIENT_STYLE \
- (WS_EX_TOOLWINDOW|WS_EX_DLGMODALFRAME)
+#define EX_TRANSIENT_STYLE (WS_EX_DLGMODALFRAME)
/*
* The following structure is the official type record for geometry
@@ -241,7 +339,7 @@ static Tk_GeomMgr wmMgrType = {
};
typedef struct ThreadSpecificData {
- HPALETTE systemPalette; /* System palette; refers to the
+ HPALETTE systemPalette; /* System palette; refers to the
* currently installed foreground logical
* palette. */
TkWindow *createWindow; /* Window that is being constructed. This
@@ -253,10 +351,12 @@ typedef struct ThreadSpecificData {
* WM_GETMINMAXINFO message before the
* WM_CREATE window. */
int initialized; /* Flag indicating whether thread-
- * specific elements of module have
+ * specific elements of module have
* been initialized. */
int firstWindow; /* Flag, cleared when the first window
* is mapped in a non-iconic state. */
+ WinIconPtr iconPtr; /* IconPtr being used as default for all
+ * toplevels, or NULL. */
} ThreadSpecificData;
static Tcl_ThreadDataKey dataKey;
@@ -265,11 +365,18 @@ static Tcl_ThreadDataKey dataKey;
* because they must be shared across threads.
*/
-static WNDCLASS toplevelClass; /* Class for toplevel windows. */
static int initialized; /* Flag indicating whether module has
* been initialized. */
-TCL_DECLARE_MUTEX(winWmMutex)
+/*
+ * A pointer to a shell proc which allows us to extract icons from
+ * any file. We just initialize this when we start up (if we can)
+ * and then it never changes
+ */
+DWORD* (WINAPI *shgetfileinfoProc) (LPCTSTR pszPath, DWORD dwFileAttributes,
+ SHFILEINFO* psfi, UINT cbFileInfo, UINT uFlags) = NULL;
+
+TCL_DECLARE_MUTEX(winWmMutex)
/*
* Forward declarations for procedures defined in this file:
@@ -277,8 +384,6 @@ TCL_DECLARE_MUTEX(winWmMutex)
static int ActivateWindow _ANSI_ARGS_((Tcl_Event *evPtr,
int flags));
-static void ConfigureEvent _ANSI_ARGS_((TkWindow *winPtr,
- XConfigureEvent *eventPtr));
static void ConfigureTopLevel _ANSI_ARGS_((WINDOWPOS *pos));
static void GenerateConfigureNotify _ANSI_ARGS_((
TkWindow *winPtr));
@@ -297,6 +402,9 @@ static int ParseGeometry _ANSI_ARGS_((Tcl_Interp *interp,
static void RefreshColormap _ANSI_ARGS_((Colormap colormap,
TkDisplay *dispPtr));
static void SetLimits _ANSI_ARGS_((HWND hwnd, MINMAXINFO *info));
+static void TkWmStackorderToplevelWrapperMap _ANSI_ARGS_((
+ TkWindow *winPtr,
+ Tcl_HashTable *table));
static LRESULT CALLBACK TopLevelProc _ANSI_ARGS_((HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam));
static void TopLevelEventProc _ANSI_ARGS_((ClientData clientData,
@@ -308,13 +416,376 @@ static void UpdateGeometryInfo _ANSI_ARGS_((
static void UpdateWrapper _ANSI_ARGS_((TkWindow *winPtr));
static LRESULT CALLBACK WmProc _ANSI_ARGS_((HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam));
-static void WmWaitVisibilityProc _ANSI_ARGS_((
+static void WmWaitVisibilityOrMapProc _ANSI_ARGS_((
ClientData clientData, XEvent *eventPtr));
+static BlockOfIconImagesPtr ReadIconOrCursorFromFile _ANSI_ARGS_((
+ Tcl_Interp *interp, Tcl_Obj* fileName, BOOL isIcon));
+static WinIconPtr ReadIconFromFile _ANSI_ARGS_((
+ Tcl_Interp *interp, Tcl_Obj *fileName));
+static WinIconPtr GetIconFromPixmap _ANSI_ARGS_((Display *dsPtr,
+ Pixmap pixmap));
+static int ReadICOHeader _ANSI_ARGS_((Tcl_Channel channel));
+static BOOL AdjustIconImagePointers _ANSI_ARGS_((LPICONIMAGE lpImage));
+static HICON MakeIconOrCursorFromResource
+ _ANSI_ARGS_((LPICONIMAGE lpIcon, BOOL isIcon));
+static HICON GetIcon _ANSI_ARGS_((WinIconPtr titlebaricon,
+ int icon_size));
+static int WinSetIcon _ANSI_ARGS_((Tcl_Interp *interp,
+ WinIconPtr titlebaricon, Tk_Window tkw));
+static void FreeIconBlock _ANSI_ARGS_((BlockOfIconImagesPtr lpIR));
+static void DecrIconRefCount _ANSI_ARGS_((WinIconPtr titlebaricon));
+
+static int WmAspectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmAttributesCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmClientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmColormapwindowsCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmCommandCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmDeiconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFocusmodelCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmFrameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGeometryCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGridCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmGroupCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconbitmapCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconifyCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconmaskCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconnameCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconpositionCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmIconwindowCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMaxsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmMinsizeCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmOverrideredirectCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmPositionfromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmProtocolCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmResizableCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmSizefromCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStackorderCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmStateCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTitleCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmTransientCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static int WmWithdrawCmd _ANSI_ARGS_((Tk_Window tkwin,
+ TkWindow *winPtr, Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
+static void WmUpdateGeom _ANSI_ARGS_((WmInfo *wmPtr,
+ TkWindow *winPtr));
+
+/* Used in BytesPerLine */
+#define WIDTHBYTES(bits) ((((bits) + 31)>>5)<<2)
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DIBNumColors --
+ *
+ * Calculates the number of entries in the color table, given by
+ * LPSTR lpbi - pointer to the CF_DIB memory block. Used by
+ * titlebar icon code.
+ *
+ * Results:
+ *
+ * WORD - Number of entries in the color table.
+ *
+ * Side effects: None.
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static WORD
+DIBNumColors( LPSTR lpbi )
+{
+ WORD wBitCount;
+ DWORD dwClrUsed;
+
+ dwClrUsed = ((LPBITMAPINFOHEADER) lpbi)->biClrUsed;
+
+ if (dwClrUsed)
+ return (WORD) dwClrUsed;
+
+ wBitCount = ((LPBITMAPINFOHEADER) lpbi)->biBitCount;
+
+ switch (wBitCount)
+ {
+ case 1: return 2;
+ case 4: return 16;
+ case 8: return 256;
+ default:return 0;
+ }
+}
/*
*----------------------------------------------------------------------
*
- * InitWm --
+ * PaletteSize --
+ *
+ * Calculates the number of bytes in the color table, as given by
+ * LPSTR lpbi - pointer to the CF_DIB memory block. Used by
+ * titlebar icon code.
+ *
+ * Results:
+ * number of bytes in the color table
+ *
+ * Side effects: None.
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static WORD
+PaletteSize( LPSTR lpbi )
+{
+ return ((WORD)( DIBNumColors( lpbi ) * sizeof( RGBQUAD )) );
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FindDIBits --
+ *
+ * Locate the image bits in a CF_DIB format DIB, as given by
+ * LPSTR lpbi - pointer to the CF_DIB memory block. Used by
+ * titlebar icon code.
+ *
+ * Results:
+ * pointer to the image bits
+ *
+ * Side effects: None
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static LPSTR
+FindDIBBits( LPSTR lpbi )
+{
+ return ( lpbi + *(LPDWORD)lpbi + PaletteSize( lpbi ) );
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * BytesPerLine --
+ *
+ * Calculates the number of bytes in one scan line, as given by
+ * LPBITMAPINFOHEADER lpBMIH - pointer to the BITMAPINFOHEADER
+ * that begins the CF_DIB block. Used by titlebar icon code.
+ *
+ * Results:
+ * number of bytes in one scan line (DWORD aligned)
+ *
+ * Side effects: None
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static DWORD
+BytesPerLine( LPBITMAPINFOHEADER lpBMIH )
+{
+ return WIDTHBYTES(lpBMIH->biWidth * lpBMIH->biPlanes * lpBMIH->biBitCount);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * AdjustIconImagePointers --
+ *
+ * Adjusts internal pointers in icon resource struct, as given
+ * by LPICONIMAGE lpImage - the resource to handle. Used by
+ * titlebar icon code.
+ *
+ * Results:
+ * BOOL - TRUE for success, FALSE for failure
+ *
+ * Side effects:
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static BOOL
+AdjustIconImagePointers( LPICONIMAGE lpImage )
+{
+ /* Sanity check */
+ if (lpImage==NULL)
+ return FALSE;
+ /* BITMAPINFO is at beginning of bits */
+ lpImage->lpbi = (LPBITMAPINFO)lpImage->lpBits;
+ /* Width - simple enough */
+ lpImage->Width = lpImage->lpbi->bmiHeader.biWidth;
+ /*
+ * Icons are stored in funky format where height is doubled
+ * so account for that
+ */
+ lpImage->Height = (lpImage->lpbi->bmiHeader.biHeight)/2;
+ /* How many colors? */
+ lpImage->Colors = lpImage->lpbi->bmiHeader.biPlanes *
+ lpImage->lpbi->bmiHeader.biBitCount;
+ /* XOR bits follow the header and color table */
+ lpImage->lpXOR = (LPBYTE)FindDIBBits(((LPSTR)lpImage->lpbi));
+ /* AND bits follow the XOR bits */
+ lpImage->lpAND = lpImage->lpXOR + (lpImage->Height*
+ BytesPerLine((LPBITMAPINFOHEADER)(lpImage->lpbi)));
+ return TRUE;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MakeIconOrCursorFromResource --
+ *
+ * Construct an actual HICON structure from the information
+ * in a resource.
+ *
+ * Results:
+ *
+ *
+ * Side effects:
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static HICON
+MakeIconOrCursorFromResource(LPICONIMAGE lpIcon, BOOL isIcon) {
+ HICON hIcon ;
+ static FARPROC pfnCreateIconFromResourceEx=NULL;
+ static int initinfo=0;
+ /* Sanity Check */
+ if (lpIcon == NULL)
+ return NULL;
+ if (lpIcon->lpBits == NULL)
+ return NULL;
+ if (!initinfo) {
+ HMODULE hMod = GetModuleHandleA("USER32.DLL");
+ initinfo=1;
+ if (hMod){
+ pfnCreateIconFromResourceEx =
+ GetProcAddress(hMod, "CreateIconFromResourceEx");
+ }
+ }
+ /* Let the OS do the real work :) */
+ if (pfnCreateIconFromResourceEx!=NULL) {
+ hIcon = (HICON) (pfnCreateIconFromResourceEx)
+ (lpIcon->lpBits, lpIcon->dwNumBytes, isIcon, 0x00030000,
+ (*(LPBITMAPINFOHEADER)(lpIcon->lpBits)).biWidth,
+ (*(LPBITMAPINFOHEADER)(lpIcon->lpBits)).biHeight/2, 0);
+ } else {
+ hIcon = NULL;
+ }
+ /* It failed, odds are good we're on NT so try the non-Ex way */
+ if (hIcon == NULL) {
+ /* We would break on NT if we try with a 16bpp image */
+ if (lpIcon->lpbi->bmiHeader.biBitCount != 16) {
+ hIcon = CreateIconFromResource(lpIcon->lpBits, lpIcon->dwNumBytes,
+ isIcon, 0x00030000);
+ }
+ }
+ return hIcon;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadICOHeader --
+ *
+ * Reads the header from an ICO file, as specfied by channel.
+ *
+ * Results:
+ * UINT - Number of images in file, -1 for failure.
+ * If this succeeds, there is a decent chance this is a
+ * valid icon file.
+ *
+ * Side effects:
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static int
+ReadICOHeader( Tcl_Channel channel )
+{
+ WORD Input;
+ DWORD dwBytesRead;
+
+ /* Read the 'reserved' WORD */
+ dwBytesRead = Tcl_Read( channel, (char*)&Input, sizeof( WORD ));
+ /* Did we get a WORD? */
+ if (dwBytesRead != sizeof( WORD ))
+ return -1;
+ /* Was it 'reserved' ? (ie 0) */
+ if (Input != 0)
+ return -1;
+ /* Read the type WORD */
+ dwBytesRead = Tcl_Read( channel, (char*)&Input, sizeof( WORD ));
+ /* Did we get a WORD? */
+ if (dwBytesRead != sizeof( WORD ))
+ return -1;
+ /* Was it type 1? */
+ if (Input != 1)
+ return -1;
+ /* Get the count of images */
+ dwBytesRead = Tcl_Read( channel, (char*)&Input, sizeof( WORD ));
+ /* Did we get a WORD? */
+ if (dwBytesRead != sizeof( WORD ))
+ return -1;
+ /* Return the count */
+ return (int)Input;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitWindowClass --
*
* This routine creates the Wm toplevel decorative frame class.
*
@@ -326,54 +797,726 @@ static void WmWaitVisibilityProc _ANSI_ARGS_((
*
*----------------------------------------------------------------------
*/
-
-static void
-InitWm(void)
-{
+static int
+InitWindowClass(WinIconPtr titlebaricon) {
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- WNDCLASS * classPtr;
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (! tsdPtr->initialized) {
tsdPtr->initialized = 1;
tsdPtr->firstWindow = 1;
+ tsdPtr->iconPtr = NULL;
}
if (! initialized) {
Tcl_MutexLock(&winWmMutex);
if (! initialized) {
+ Tcl_DString classString;
+ WNDCLASS class;
initialized = 1;
- classPtr = &toplevelClass;
- /*
- * When threads are enabled, we cannot use CLASSDC because
- * threads will then write into the same device context.
- *
- * This is a hack; we should add a subsystem that manages
- * device context on a per-thread basis. See also tkWinX.c,
- * which also initializes a WNDCLASS structure.
- */
+ if (shgetfileinfoProc == NULL) {
+ HINSTANCE hInstance = LoadLibraryA("shell32");
+ if (hInstance != NULL) {
+ shgetfileinfoProc =
+ (DWORD* (WINAPI *) (LPCTSTR pszPath, DWORD dwFileAttributes,
+ SHFILEINFO* psfi, UINT cbFileInfo, UINT uFlags)) GetProcAddress(hInstance,
+ "SHGetFileInfo");
+ FreeLibrary(hInstance);
+ }
+ }
+ /*
+ * The only difference between WNDCLASSW and WNDCLASSA are
+ * in pointers, so we can use the generic structure WNDCLASS.
+ */
+ ZeroMemory(&class, sizeof(WNDCLASS));
+
+ /*
+ * When threads are enabled, we cannot use CLASSDC because
+ * threads will then write into the same device context.
+ *
+ * This is a hack; we should add a subsystem that manages
+ * device context on a per-thread basis. See also tkWinX.c,
+ * which also initializes a WNDCLASS structure.
+ */
#ifdef TCL_THREADS
- classPtr->style = CS_HREDRAW | CS_VREDRAW;
+ class.style = CS_HREDRAW | CS_VREDRAW;
#else
- classPtr->style = CS_HREDRAW | CS_VREDRAW | CS_CLASSDC;
+ class.style = CS_HREDRAW | CS_VREDRAW | CS_CLASSDC;
#endif
- classPtr->cbClsExtra = 0;
- classPtr->cbWndExtra = 0;
- classPtr->hInstance = Tk_GetHINSTANCE();
- classPtr->hbrBackground = NULL;
- classPtr->lpszMenuName = NULL;
- classPtr->lpszClassName = TK_WIN_TOPLEVEL_CLASS_NAME;
- classPtr->lpfnWndProc = WmProc;
- classPtr->hIcon = LoadIcon(Tk_GetHINSTANCE(), "tk");
- classPtr->hCursor = LoadCursor(NULL, IDC_ARROW);
-
- if (!RegisterClass(classPtr)) {
+ class.hInstance = Tk_GetHINSTANCE();
+ Tcl_WinUtfToTChar(TK_WIN_TOPLEVEL_CLASS_NAME, -1, &classString);
+ class.lpszClassName = (LPCTSTR) Tcl_DStringValue(&classString);
+ class.lpfnWndProc = WmProc;
+ if (titlebaricon == NULL) {
+ class.hIcon = LoadIcon(Tk_GetHINSTANCE(), "tk");
+ } else {
+ class.hIcon = GetIcon(titlebaricon, ICON_BIG);
+ if (class.hIcon == NULL) {
+ return TCL_ERROR;
+ }
+ /*
+ * Store pointer to default icon so we know when
+ * we need to free that information
+ */
+ tsdPtr->iconPtr = titlebaricon;
+ }
+ class.hCursor = LoadCursor(NULL, IDC_ARROW);
+
+ if (!(*tkWinProcs->registerClass)(&class)) {
panic("Unable to register TkTopLevel class");
}
+ Tcl_DStringFree(&classString);
}
Tcl_MutexUnlock(&winWmMutex);
}
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * InitWm --
+ *
+ * This initialises the window manager
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Registers a new window class.
+ *
+ *----------------------------------------------------------------------
+ */
+static void
+InitWm(void)
+{
+ /* Ignore return result */
+ (void) InitWindowClass(NULL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WinSetIcon --
+ *
+ * Sets either the default toplevel titlebar icon, or the icon
+ * for a specific toplevel (if tkw is given, then only that
+ * window is used).
+ *
+ * The ref-count of the titlebaricon is NOT changed. If this
+ * function returns successfully, the caller should assume
+ * the icon was used (and therefore the ref-count should
+ * be adjusted to reflect that fact). If the function returned
+ * an error, the caller should assume the icon was not used
+ * (and may wish to free the memory associated with it).
+ *
+ * Results:
+ * A standard Tcl return code.
+ *
+ * Side effects:
+ * One or all windows may have their icon changed.
+ * The Tcl result may be modified.
+ * The window-manager will be initialised if it wasn't already.
+ * The given window will be forced into existence.
+ *
+ *----------------------------------------------------------------------
+ */
+static int
+WinSetIcon(interp, titlebaricon, tkw)
+ Tcl_Interp *interp;
+ WinIconPtr titlebaricon;
+ Tk_Window tkw;
+{
+ WmInfo *wmPtr;
+ HWND hwnd;
+ int application = 0;
+
+ if (tkw == NULL) {
+ tkw = Tk_MainWindow(interp);
+ application = 1;
+ }
+
+ if (!(Tk_IsTopLevel(tkw))) {
+ Tcl_AppendResult(interp, "window \"", Tk_PathName(tkw),
+ "\" isn't a top-level window", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (Tk_WindowId(tkw) == None) {
+ Tk_MakeWindowExist(tkw);
+ }
+ /* We must get the window's wrapper, not the window itself */
+ wmPtr = ((TkWindow*)tkw)->wmInfoPtr;
+ hwnd = wmPtr->wrapper;
+
+ if (application) {
+ if (hwnd == NULL) {
+ /*
+ * I don't actually think this is ever the correct thing, unless
+ * perhaps the window doesn't have a wrapper. But I believe all
+ * windows have wrappers.
+ */
+ hwnd = Tk_GetHWND(Tk_WindowId(tkw));
+ }
+ /*
+ * If we aren't initialised, then just initialise with the user's
+ * icon. Otherwise our icon choice will be ignored moments later
+ * when Tk finishes initialising.
+ */
+ if (!initialized) {
+ if (InitWindowClass(titlebaricon) != TCL_OK) {
+ Tcl_AppendResult(interp,"Unable to set icon", (char*)NULL);
+ return TCL_ERROR;
+ }
+ } else {
+ ThreadSpecificData *tsdPtr;
+ if (
+#ifdef _WIN64
+ !SetClassLongPtr(hwnd, GCLP_HICONSM,
+ (LPARAM)GetIcon(titlebaricon, ICON_SMALL))
+#else
+ !SetClassLong(hwnd, GCL_HICONSM,
+ (LPARAM)GetIcon(titlebaricon, ICON_SMALL))
+#endif
+ ) {
+ /*
+ * For some reason this triggers, even though it seems
+ * to be successful This is probably related to the
+ * WNDCLASS vs WNDCLASSEX difference. Anyway it seems
+ * we have to ignore errors returned here.
+ */
+
+ /*
+ * Tcl_AppendResult(interp,"Unable to set new small icon", (char*)NULL);
+ * return TCL_ERROR;
+ */
+ }
+ if (
+#ifdef _WIN64
+ !SetClassLongPtr(hwnd, GCLP_HICON,
+ (LPARAM)GetIcon(titlebaricon, ICON_BIG))
+#else
+ !SetClassLong(hwnd, GCL_HICON,
+ (LPARAM)GetIcon(titlebaricon, ICON_BIG))
+#endif
+ ) {
+ Tcl_AppendResult(interp,"Unable to set new icon", (char*)NULL);
+ return TCL_ERROR;
+ }
+ tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ if (tsdPtr->iconPtr != NULL) {
+ DecrIconRefCount(tsdPtr->iconPtr);
+ }
+ tsdPtr->iconPtr = titlebaricon;
+ }
+ } else {
+ if (!initialized) {
+ /*
+ * Need to initialise the wm otherwise we will fail on
+ * code which tries to set a toplevel's icon before that
+ * happens. Ignore return result.
+ */
+ (void)InitWindowClass(NULL);
+ }
+ /*
+ * The following code is exercised if you do
+ *
+ * toplevel .t ; wm titlebaricon .t foo.icr
+ *
+ * i.e. the wm hasn't had time to properly create
+ * the '.t' window before you set the icon.
+ */
+ if (hwnd == NULL) {
+ /*
+ * This little snippet is copied from the 'Map' function,
+ * and should probably be placed in one proper location
+ */
+ UpdateWrapper(wmPtr->winPtr);
+ wmPtr = ((TkWindow*)tkw)->wmInfoPtr;
+ hwnd = wmPtr->wrapper;
+ if (hwnd == NULL) {
+ Tcl_AppendResult(interp,
+ "Can't set icon; window has no wrapper.", (char*)NULL);
+ return TCL_ERROR;
+ }
+ }
+ SendMessage(hwnd, WM_SETICON, ICON_SMALL,
+ (LPARAM) GetIcon(titlebaricon, ICON_SMALL));
+ SendMessage(hwnd, WM_SETICON, ICON_BIG,
+ (LPARAM) GetIcon(titlebaricon, ICON_BIG));
+
+ /* Update the iconPtr we keep for each WmInfo structure. */
+ if (wmPtr->iconPtr != NULL) {
+ /* Free any old icon ptr which is associated with this window. */
+ DecrIconRefCount(wmPtr->iconPtr);
+ }
+ /*
+ * We do not need to increment the ref count for the
+ * titlebaricon, because it was already incremented when we
+ * retrieved it.
+ */
+ wmPtr->iconPtr = titlebaricon;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadIconFromFile --
+ *
+ * Read the contents of a file (usually .ico, .icr) and extract an
+ * icon resource, if possible, otherwise check if the shell has an
+ * icon assigned to the given file and use that. If both of those
+ * fail, then NULL is returned, and an error message will already be
+ * in the interpreter.
+ *
+ * Results:
+ * A WinIconPtr structure containing the icons in the file, with
+ * its ref count already incremented. The calling procedure should
+ * either place this structure inside a WmInfo structure, or it should
+ * pass it on to DecrIconRefCount() to ensure no memory leaks occur.
+ *
+ * If the given fileName did not contain a valid icon structure,
+ * return NULL.
+ *
+ * Side effects:
+ * Memory is allocated for the returned structure and the icons
+ * it contains. If the structure is not wanted, it should be
+ * passed to DecrIconRefCount, and in any case a valid ref count
+ * should be ensured to avoid memory leaks.
+ *
+ * Currently icon resources are not shared, so the ref count of
+ * one of these structures will always be 0 or 1. However all we
+ * need do is implement some sort of lookup function between
+ * filenames and WinIconPtr structures and no other code will need
+ * to be changed. The pseudo-code for this is implemented below
+ * in the 'if (0)' branch. It did not seem necessary to implement
+ * this optimisation here, since moving to icon<->image
+ * conversions will probably make it obsolete.
+ *
+ *----------------------------------------------------------------------
+ */
+static WinIconPtr
+ReadIconFromFile(interp, fileName)
+ Tcl_Interp *interp;
+ Tcl_Obj *fileName;
+{
+ WinIconPtr titlebaricon = NULL;
+
+ if (0 /* If we already have an icon for this filename */) {
+ titlebaricon = NULL; /* Get the real value from a lookup */
+ titlebaricon->refCount++;
+ return titlebaricon;
+ } else {
+ /* First check if it is a .ico file */
+ BlockOfIconImagesPtr lpIR;
+ lpIR = ReadIconOrCursorFromFile(interp, fileName, TRUE);
+
+ /* Then see if we can ask the shell for the icon for this file */
+ if (lpIR == NULL && shgetfileinfoProc != NULL) {
+ SHFILEINFO sfi;
+ Tcl_DString ds, ds2;
+ DWORD *res;
+ CONST char *file;
+
+ file = Tcl_TranslateFileName(interp, Tcl_GetString(fileName), &ds);
+ if (file == NULL) { return NULL; }
+ Tcl_UtfToExternalDString(NULL, file, -1, &ds2);
+ Tcl_DStringFree(&ds);
+
+ res = (*shgetfileinfoProc)(Tcl_DStringValue(&ds2), 0, &sfi,
+ sizeof(SHFILEINFO), SHGFI_SMALLICON|SHGFI_ICON);
+
+ Tcl_DStringFree(&ds2);
+
+ if (res != 0) {
+ Tcl_ResetResult(interp);
+
+ lpIR = (BlockOfIconImagesPtr) ckalloc(sizeof(BlockOfIconImages));
+ if (lpIR == NULL) {
+ DestroyIcon(sfi.hIcon);
+ return NULL;
+ }
+
+ lpIR->nNumImages = 1;
+ lpIR->IconImages[0].Width = 16;
+ lpIR->IconImages[0].Height = 16;
+ lpIR->IconImages[0].Colors = 4;
+ lpIR->IconImages[0].hIcon = sfi.hIcon;
+ /* These fields are ignored */
+ lpIR->IconImages[0].lpBits = 0;
+ lpIR->IconImages[0].dwNumBytes = 0;
+ lpIR->IconImages[0].lpXOR = 0;
+ lpIR->IconImages[0].lpAND = 0;
+ }
+ }
+ if (lpIR != NULL) {
+ titlebaricon = (WinIconPtr) ckalloc(sizeof(WinIconInstance));
+ titlebaricon->iconBlock = lpIR;
+ titlebaricon->refCount = 1;
+ }
+ return titlebaricon;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetIconFromPixmap --
+ *
+ * Turn a Tk Pixmap (i.e. a bitmap) into an icon resource, if
+ * possible, otherwise NULL is returned.
+ *
+ * Results:
+ * A WinIconPtr structure containing a conversion of the given
+ * bitmap into an icon, with its ref count already incremented. The
+ * calling procedure should either place this structure inside a
+ * WmInfo structure, or it should pass it on to DecrIconRefCount()
+ * to ensure no memory leaks occur.
+ *
+ * If the given pixmap did not contain a valid icon structure,
+ * return NULL.
+ *
+ * Side effects:
+ * Memory is allocated for the returned structure and the icons
+ * it contains. If the structure is not wanted, it should be
+ * passed to DecrIconRefCount, and in any case a valid ref count
+ * should be ensured to avoid memory leaks.
+ *
+ * Currently icon resources are not shared, so the ref count of
+ * one of these structures will always be 0 or 1. However all we
+ * need do is implement some sort of lookup function between
+ * pixmaps and WinIconPtr structures and no other code will need
+ * to be changed.
+ *
+ *----------------------------------------------------------------------
+ */
+static WinIconPtr
+GetIconFromPixmap(dsPtr, pixmap)
+ Display *dsPtr;
+ Pixmap pixmap;
+{
+ WinIconPtr titlebaricon = NULL;
+ TkWinDrawable* twdPtr = (TkWinDrawable*) pixmap;
+
+ if (twdPtr == NULL) {
+ return NULL;
+ }
+
+ if (0 /* If we already have an icon for this pixmap */) {
+ titlebaricon = NULL; /* Get the real value from a lookup */
+ titlebaricon->refCount++;
+ return titlebaricon;
+ } else {
+ BlockOfIconImagesPtr lpIR;
+ ICONINFO icon;
+ HICON hIcon;
+ int width, height;
+
+ Tk_SizeOfBitmap(dsPtr, pixmap, &width, &height);
+
+ icon.fIcon = TRUE;
+ icon.xHotspot = 0;
+ icon.yHotspot = 0;
+ icon.hbmMask = twdPtr->bitmap.handle;
+ icon.hbmColor = twdPtr->bitmap.handle;
+
+ hIcon = CreateIconIndirect(&icon);
+ if (hIcon == NULL) {
+ return NULL;
+ }
+
+ lpIR = (BlockOfIconImagesPtr) ckalloc(sizeof(BlockOfIconImages));
+ if (lpIR == NULL) {
+ DestroyIcon(hIcon);
+ return NULL;
+ }
+
+ lpIR->nNumImages = 1;
+ lpIR->IconImages[0].Width = width;
+ lpIR->IconImages[0].Height = height;
+ lpIR->IconImages[0].Colors = 1 << twdPtr->bitmap.depth;
+ lpIR->IconImages[0].hIcon = hIcon;
+ /* These fields are ignored */
+ lpIR->IconImages[0].lpBits = 0;
+ lpIR->IconImages[0].dwNumBytes = 0;
+ lpIR->IconImages[0].lpXOR = 0;
+ lpIR->IconImages[0].lpAND = 0;
+
+ titlebaricon = (WinIconPtr) ckalloc(sizeof(WinIconInstance));
+ titlebaricon->iconBlock = lpIR;
+ titlebaricon->refCount = 1;
+ return titlebaricon;
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * DecrIconRefCount --
+ *
+ * Reduces the reference count.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * If the ref count falls to zero, free the memory associated
+ * with the icon resource structures. In this case the pointer
+ * passed into this function is no longer valid.
+ *
+ *----------------------------------------------------------------------
+ */
+static void
+DecrIconRefCount(WinIconPtr titlebaricon) {
+ titlebaricon->refCount--;
+
+ if (titlebaricon->refCount <= 0) {
+ if (titlebaricon->iconBlock != NULL) {
+ FreeIconBlock(titlebaricon->iconBlock);
+ }
+ titlebaricon->iconBlock = NULL;
+
+ ckfree((char*)titlebaricon);
+ }
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FreeIconBlock --
+ *
+ * Frees all memory associated with a previously loaded
+ * titlebaricon. The icon block pointer is no longer
+ * valid once this function returns.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static void
+FreeIconBlock(BlockOfIconImagesPtr lpIR) {
+ int i;
+
+ /* Free all the bits */
+ for (i=0; i< lpIR->nNumImages; i++) {
+ if (lpIR->IconImages[i].lpBits != NULL) {
+ ckfree((char*)lpIR->IconImages[i].lpBits);
+ }
+ if (lpIR->IconImages[i].hIcon != NULL) {
+ DestroyIcon(lpIR->IconImages[i].hIcon);
+ }
+ }
+ ckfree ((char*)lpIR);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * GetIcon --
+ *
+ * Extracts an icon of a given size from an icon resource
+ *
+ * Results:
+ * Returns the icon, if found, else NULL.
+ *
+ * Side effects:
+ *
+ *
+ *----------------------------------------------------------------------
+ */
+static HICON
+GetIcon(WinIconPtr titlebaricon, int icon_size) {
+ BlockOfIconImagesPtr lpIR;
+
+ if (titlebaricon == NULL) {
+ return NULL;
+ }
+
+ lpIR = titlebaricon->iconBlock;
+ if (lpIR == NULL) {
+ return NULL;
+ } else {
+ unsigned int size = (icon_size == 0 ? 16 : 32);
+ int i;
+
+ for (i = 0; i < lpIR->nNumImages; i++) {
+ /* Take the first or a 32x32 16 color icon*/
+ if ((lpIR->IconImages[i].Height == size)
+ && (lpIR->IconImages[i].Width == size)
+ && (lpIR->IconImages[i].Colors >= 4)) {
+ return lpIR->IconImages[i].hIcon;
+ }
+ }
+
+ /*
+ * If we get here, then just return the first one,
+ * it will have to do!
+ */
+ if (lpIR->nNumImages >= 1) {
+ return lpIR->IconImages[0].hIcon;
+ }
+ }
+ return NULL;
+}
+
+static HCURSOR
+TclWinReadCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName) {
+ BlockOfIconImagesPtr lpIR;
+ HICON res = NULL;
+
+ lpIR = ReadIconOrCursorFromFile(interp, fileName, FALSE);
+ if (lpIR == NULL) {
+ return NULL;
+ }
+ if (lpIR->nNumImages >= 1) {
+ res = CopyImage(lpIR->IconImages[0].hIcon, IMAGE_CURSOR,0,0,0);
+ }
+ FreeIconBlock(lpIR);
+ return res;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ReadIconOrCursorFromFile --
+ *
+ * Reads an Icon Resource from an ICO file, as given by
+ * char* fileName - Name of the ICO file. This name should
+ * be in Utf format.
+ *
+ * Results:
+ * Returns an icon resource, if found, else NULL.
+ *
+ * Side effects:
+ * May leave error messages in the Tcl interpreter.
+ *
+ *----------------------------------------------------------------------
+ */
+static BlockOfIconImagesPtr
+ReadIconOrCursorFromFile(Tcl_Interp* interp, Tcl_Obj* fileName, BOOL isIcon) {
+ BlockOfIconImagesPtr lpIR, lpNew;
+ Tcl_Channel channel;
+ int i;
+ DWORD dwBytesRead;
+ LPICONDIRENTRY lpIDE;
+
+ /* Open the file */
+ channel = Tcl_FSOpenFileChannel(interp, fileName, "r", 0);
+ if (channel == NULL) {
+ Tcl_AppendResult(interp,"Error opening file \"",
+ Tcl_GetString(fileName),
+ "\" for reading",(char*)NULL);
+ return NULL;
+ }
+ if (Tcl_SetChannelOption(interp, channel, "-translation", "binary")
+ != TCL_OK) {
+ Tcl_Close(NULL, channel);
+ return NULL;
+ }
+ if (Tcl_SetChannelOption(interp, channel, "-encoding", "binary")
+ != TCL_OK) {
+ Tcl_Close(NULL, channel);
+ return NULL;
+ }
+ /* Allocate memory for the resource structure */
+ lpIR = (BlockOfIconImagesPtr) ckalloc(sizeof(BlockOfIconImages));
+ if (lpIR == NULL) {
+ Tcl_AppendResult(interp,"Error allocating memory",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ return NULL;
+ }
+ /* Read in the header */
+ if ((lpIR->nNumImages = ReadICOHeader( channel )) == -1) {
+ Tcl_AppendResult(interp,"Invalid file header",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree((char*) lpIR );
+ return NULL;
+ }
+ /* Adjust the size of the struct to account for the images */
+ lpNew = (BlockOfIconImagesPtr) ckrealloc((char*)lpIR,
+ sizeof(BlockOfIconImages) + ((lpIR->nNumImages-1) * sizeof(ICONIMAGE)));
+ if (lpNew == NULL) {
+ Tcl_AppendResult(interp,"Error allocating memory",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree( (char*)lpIR );
+ return NULL;
+ }
+ lpIR = lpNew;
+ /* Allocate enough memory for the icon directory entries */
+ lpIDE = (LPICONDIRENTRY) ckalloc(lpIR->nNumImages * sizeof(ICONDIRENTRY));
+ if (lpIDE == NULL) {
+ Tcl_AppendResult(interp,"Error allocating memory",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree( (char*)lpIR );
+ return NULL;
+ }
+ /* Read in the icon directory entries */
+ dwBytesRead = Tcl_Read(channel, (char*)lpIDE,
+ lpIR->nNumImages * sizeof( ICONDIRENTRY ));
+ if (dwBytesRead != lpIR->nNumImages * sizeof( ICONDIRENTRY )) {
+ Tcl_AppendResult(interp,"Error reading file",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree( (char*)lpIR );
+ return NULL;
+ }
+ /* Loop through and read in each image */
+ for( i = 0; i < lpIR->nNumImages; i++ ) {
+ /* Allocate memory for the resource */
+ lpIR->IconImages[i].lpBits = (LPBYTE) ckalloc(lpIDE[i].dwBytesInRes);
+ if (lpIR->IconImages[i].lpBits == NULL) {
+ Tcl_AppendResult(interp,"Error allocating memory",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree( (char*)lpIR );
+ ckfree( (char*)lpIDE );
+ return NULL;
+ }
+ lpIR->IconImages[i].dwNumBytes = lpIDE[i].dwBytesInRes;
+ /* Seek to beginning of this image */
+ if (Tcl_Seek(channel, lpIDE[i].dwImageOffset, FILE_BEGIN) == -1) {
+ Tcl_AppendResult(interp,"Error seeking in file",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree( (char*)lpIR );
+ ckfree( (char*)lpIDE );
+ return NULL;
+ }
+ /* Read it in */
+ dwBytesRead = Tcl_Read( channel, lpIR->IconImages[i].lpBits,
+ lpIDE[i].dwBytesInRes);
+ if (dwBytesRead != lpIDE[i].dwBytesInRes) {
+ Tcl_AppendResult(interp,"Error reading file",(char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree( (char*)lpIDE );
+ ckfree( (char*)lpIR );
+ return NULL;
+ }
+ /* Set the internal pointers appropriately */
+ if (!AdjustIconImagePointers( &(lpIR->IconImages[i]))) {
+ Tcl_AppendResult(interp,"Error converting to internal format",
+ (char*)NULL);
+ Tcl_Close(NULL, channel);
+ ckfree( (char*)lpIDE );
+ ckfree( (char*)lpIR );
+ return NULL;
+ }
+ lpIR->IconImages[i].hIcon =
+ MakeIconOrCursorFromResource(&(lpIR->IconImages[i]), isIcon);
+ }
+ /* Clean up */
+ ckfree((char*)lpIDE);
+ Tcl_Close(NULL, channel);
+ if (lpIR == NULL){
+ Tcl_AppendResult(interp,"Reading of ", Tcl_GetString(fileName),
+ " failed!",(char*)NULL);
+ return NULL;
+ }
+ return lpIR;
}
/*
@@ -392,12 +1535,11 @@ InitWm(void)
*
*----------------------------------------------------------------------
*/
-
static TkWindow *
GetTopLevel(hwnd)
HWND hwnd;
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -409,7 +1551,11 @@ GetTopLevel(hwnd)
if (tsdPtr->createWindow) {
return tsdPtr->createWindow;
}
+#ifdef _WIN64
+ return (TkWindow *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
+#else
return (TkWindow *) GetWindowLong(hwnd, GWL_USERDATA);
+#endif
}
/*
@@ -445,7 +1591,7 @@ SetLimits(hwnd, info)
}
wmPtr = winPtr->wmInfoPtr;
-
+
/*
* Copy latest constraint info.
*/
@@ -454,7 +1600,7 @@ SetLimits(hwnd, info)
wmPtr->defMinHeight = info->ptMinTrackSize.y;
wmPtr->defMaxWidth = info->ptMaxTrackSize.x;
wmPtr->defMaxHeight = info->ptMaxTrackSize.y;
-
+
GetMaxSize(wmPtr, &maxWidth, &maxHeight);
GetMinSize(wmPtr, &minWidth, &minHeight);
@@ -493,7 +1639,7 @@ SetLimits(hwnd, info)
info->ptMaxTrackSize.x = info->ptMinTrackSize.x;
}
if (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) {
- info->ptMinTrackSize.y = winPtr->changes.height
+ info->ptMinTrackSize.y = winPtr->changes.height
+ wmPtr->borderHeight;
info->ptMaxTrackSize.y = info->ptMinTrackSize.y;
}
@@ -534,14 +1680,14 @@ TkWinWmCleanup(hInstance)
}
#endif
- tsdPtr = (ThreadSpecificData *)
+ tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
return;
}
tsdPtr->initialized = 0;
-
+
UnregisterClass(TK_WIN_TOPLEVEL_CLASS_NAME, hInstance);
}
@@ -570,12 +1716,13 @@ TkWmNewWindow(winPtr)
register WmInfo *wmPtr;
wmPtr = (WmInfo *) ckalloc(sizeof(WmInfo));
+
+ /*
+ * Initialize full structure, then set what isn't NULL
+ */
+ ZeroMemory(wmPtr, sizeof(WmInfo));
winPtr->wmInfoPtr = wmPtr;
wmPtr->winPtr = winPtr;
- wmPtr->wrapper = NULL;
- wmPtr->titleUid = NULL;
- wmPtr->iconName = NULL;
- wmPtr->masterPtr = NULL;
wmPtr->hints.flags = InputHint | StateHint;
wmPtr->hints.input = True;
wmPtr->hints.initial_state = NormalState;
@@ -584,23 +1731,16 @@ TkWmNewWindow(winPtr)
wmPtr->hints.icon_x = wmPtr->hints.icon_y = 0;
wmPtr->hints.icon_mask = None;
wmPtr->hints.window_group = None;
- wmPtr->leaderName = NULL;
- wmPtr->icon = NULL;
- wmPtr->iconFor = NULL;
- wmPtr->sizeHintsFlags = 0;
/*
* Default the maximum dimensions to the size of the display.
*/
wmPtr->defMinWidth = wmPtr->defMinHeight = 0;
- wmPtr->defMaxWidth = DisplayWidth(winPtr->display,
- winPtr->screenNum);
- wmPtr->defMaxHeight = DisplayHeight(winPtr->display,
- winPtr->screenNum);
+ wmPtr->defMaxWidth = DisplayWidth(winPtr->display, winPtr->screenNum);
+ wmPtr->defMaxHeight = DisplayHeight(winPtr->display, winPtr->screenNum);
wmPtr->minWidth = wmPtr->minHeight = 1;
wmPtr->maxWidth = wmPtr->maxHeight = 0;
- wmPtr->gridWin = NULL;
wmPtr->widthInc = wmPtr->heightInc = 1;
wmPtr->minAspect.x = wmPtr->minAspect.y = 1;
wmPtr->maxAspect.x = wmPtr->maxAspect.y = 1;
@@ -608,21 +1748,11 @@ TkWmNewWindow(winPtr)
wmPtr->gravity = NorthWestGravity;
wmPtr->width = -1;
wmPtr->height = -1;
- wmPtr->hMenu = NULL;
wmPtr->x = winPtr->changes.x;
wmPtr->y = winPtr->changes.y;
- wmPtr->borderWidth = 0;
- wmPtr->borderHeight = 0;
-
- wmPtr->cmapList = NULL;
- wmPtr->cmapCount = 0;
- wmPtr->numTransients = 0;
wmPtr->configWidth = -1;
wmPtr->configHeight = -1;
- wmPtr->protPtr = NULL;
- wmPtr->cmdArgv = NULL;
- wmPtr->clientMachine = NULL;
wmPtr->flags = WM_NEVER_MAPPED;
wmPtr->nextPtr = winPtr->dispPtr->firstWmPtr;
winPtr->dispPtr->firstWmPtr = wmPtr;
@@ -668,25 +1798,34 @@ UpdateWrapper(winPtr)
TkWindow *winPtr; /* Top-level window to redecorate. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- HWND parentHWND = NULL, oldWrapper;
- HWND child = TkWinGetHWND(winPtr->window);
+ HWND parentHWND, oldWrapper;
+ HWND child;
int x, y, width, height, state;
WINDOWPLACEMENT place;
- Tcl_DString titleString;
+ HICON hSmallIcon = NULL;
+ HICON hBigIcon = NULL;
+ Tcl_DString titleString, classString;
int *childStateInfo = NULL;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- parentHWND = NULL;
+ if (winPtr->window == None) {
+ /*
+ * Ensure existence of the window to update the wrapper for.
+ */
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ }
+
child = TkWinGetHWND(winPtr->window);
+ parentHWND = NULL;
if (winPtr->flags & TK_EMBEDDED) {
wmPtr->wrapper = (HWND) winPtr->privatePtr;
if (wmPtr->wrapper == NULL) {
- panic("TkWmMapWindow: Cannot find container window");
+ panic("UpdateWrapper: Cannot find container window");
}
if (!IsWindow(wmPtr->wrapper)) {
- panic("TkWmMapWindow: Container was destroyed");
+ panic("UpdateWrapper: Container was destroyed");
}
} else {
@@ -706,7 +1845,7 @@ UpdateWrapper(winPtr)
wmPtr->style = WM_TRANSIENT_STYLE;
wmPtr->exStyle = EX_TRANSIENT_STYLE;
parentHWND = Tk_GetHWND(Tk_WindowId(wmPtr->masterPtr));
- if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
+ if (! ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) &&
(wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE))) {
wmPtr->style |= WS_THICKFRAME;
}
@@ -715,6 +1854,9 @@ UpdateWrapper(winPtr)
wmPtr->exStyle = EX_TOPLEVEL_STYLE;
}
+ wmPtr->style |= wmPtr->styleConfig;
+ wmPtr->exStyle |= wmPtr->exStyleConfig;
+
if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE)
&& (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) {
wmPtr->style &= ~ (WS_MAXIMIZEBOX | WS_SIZEBOX);
@@ -752,13 +1894,21 @@ UpdateWrapper(winPtr)
*/
tsdPtr->createWindow = winPtr;
- Tcl_UtfToExternalDString(NULL, wmPtr->titleUid, -1, &titleString);
- wmPtr->wrapper = CreateWindowEx(wmPtr->exStyle,
- TK_WIN_TOPLEVEL_CLASS_NAME,
- Tcl_DStringValue(&titleString), wmPtr->style, x, y, width,
- height, parentHWND, NULL, Tk_GetHINSTANCE(), NULL);
+ Tcl_WinUtfToTChar(((wmPtr->title != NULL) ?
+ wmPtr->title : winPtr->nameUid), -1, &titleString);
+ Tcl_WinUtfToTChar(TK_WIN_TOPLEVEL_CLASS_NAME, -1, &classString);
+ wmPtr->wrapper = (*tkWinProcs->createWindowEx)(wmPtr->exStyle,
+ (LPCTSTR) Tcl_DStringValue(&classString),
+ (LPCTSTR) Tcl_DStringValue(&titleString),
+ wmPtr->style, x, y, width, height,
+ parentHWND, NULL, Tk_GetHINSTANCE(), NULL);
+ Tcl_DStringFree(&classString);
Tcl_DStringFree(&titleString);
+#ifdef _WIN64
+ SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (LONG_PTR) winPtr);
+#else
SetWindowLong(wmPtr->wrapper, GWL_USERDATA, (LONG) winPtr);
+#endif
tsdPtr->createWindow = NULL;
place.length = sizeof(WINDOWPLACEMENT);
@@ -775,15 +1925,35 @@ UpdateWrapper(winPtr)
* Windows doesn't try to set the focus to the child window.
*/
+#ifdef _WIN64
+ SetWindowLongPtr(child, GWL_STYLE,
+ WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
+#else
SetWindowLong(child, GWL_STYLE,
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
+#endif
if (winPtr->flags & TK_EMBEDDED) {
+#ifdef _WIN64
+ SetWindowLongPtr(child, GWLP_WNDPROC, (LONG_PTR) TopLevelProc);
+#else
SetWindowLong(child, GWL_WNDPROC, (LONG) TopLevelProc);
+#endif
}
oldWrapper = SetParent(child, wmPtr->wrapper);
- if (oldWrapper && (oldWrapper != wmPtr->wrapper)
+ if (oldWrapper) {
+ hSmallIcon = (HICON) SendMessage(oldWrapper, WM_GETICON, ICON_SMALL,
+ (LPARAM) NULL);
+ hBigIcon = (HICON) SendMessage(oldWrapper, WM_GETICON, ICON_BIG,
+ (LPARAM) NULL);
+ }
+
+ if (oldWrapper && (oldWrapper != wmPtr->wrapper)
&& (oldWrapper != GetDesktopWindow())) {
+#ifdef _WIN64
+ SetWindowLongPtr(oldWrapper, GWLP_USERDATA, (LONG) NULL);
+#else
SetWindowLong(oldWrapper, GWL_USERDATA, (LONG) NULL);
+#endif
if (wmPtr->numTransients > 0) {
/*
@@ -819,13 +1989,20 @@ UpdateWrapper(winPtr)
/*
* Force an initial transition from withdrawn to the real
- * initial state.
+ * initial state.
*/
state = wmPtr->hints.initial_state;
wmPtr->hints.initial_state = WithdrawnState;
TkpWmSetState(winPtr, state);
+ if (hSmallIcon != NULL) {
+ SendMessage(wmPtr->wrapper,WM_SETICON,ICON_SMALL,(LPARAM)hSmallIcon);
+ }
+ if (hBigIcon != NULL) {
+ SendMessage(wmPtr->wrapper,WM_SETICON,ICON_BIG,(LPARAM)hBigIcon);
+ }
+
/*
* If we are embedded then force a mapping of the window now,
* because we do not necessarily own the wrapper and may not
@@ -842,7 +2019,7 @@ UpdateWrapper(winPtr)
/*
* Set up menus on the wrapper if required.
*/
-
+
if (wmPtr->hMenu != NULL) {
wmPtr->flags = WM_SYNC_PENDING;
SetMenu(wmPtr->wrapper, wmPtr->hMenu);
@@ -911,14 +2088,24 @@ TkWmMapWindow(winPtr)
* be mapped. */
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (!tsdPtr->initialized) {
InitWm();
}
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ /*
+ * Don't map a transient if the master is not mapped.
+ */
+
+ if (wmPtr->masterPtr != NULL &&
+ !Tk_IsMapped(wmPtr->masterPtr)) {
+ wmPtr->hints.initial_state = WithdrawnState;
+ return;
+ }
+ } else {
if (wmPtr->hints.initial_state == WithdrawnState) {
return;
}
@@ -937,9 +2124,6 @@ TkWmMapWindow(winPtr)
* window.
*/
- if (wmPtr->titleUid == NULL) {
- wmPtr->titleUid = winPtr->nameUid;
- }
UpdateWrapper(winPtr);
}
@@ -995,8 +2179,7 @@ TkpWmSetState(winPtr, state)
WmInfo *wmPtr = winPtr->wmInfoPtr;
int cmd;
- if ((wmPtr->flags & WM_NEVER_MAPPED) ||
- (wmPtr->masterPtr && !Tk_IsMapped(wmPtr->masterPtr))) {
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
wmPtr->hints.initial_state = state;
return;
}
@@ -1072,6 +2255,10 @@ TkWmDeadWindow(winPtr)
for (wmPtr2 = winPtr->dispPtr->firstWmPtr; wmPtr2 != NULL;
wmPtr2 = wmPtr2->nextPtr) {
if (wmPtr2->masterPtr == winPtr) {
+ wmPtr->numTransients--;
+ Tk_DeleteEventHandler((Tk_Window) wmPtr2->masterPtr,
+ VisibilityChangeMask|StructureNotifyMask,
+ WmWaitVisibilityOrMapProc, (ClientData) wmPtr2->winPtr);
wmPtr2->masterPtr = NULL;
if ((wmPtr2->wrapper != None)
&& !(wmPtr2->flags & (WM_NEVER_MAPPED))) {
@@ -1079,7 +2266,15 @@ TkWmDeadWindow(winPtr)
}
}
}
-
+ if (wmPtr->numTransients != 0)
+ panic("numTransients should be 0");
+
+ if (wmPtr->title != NULL) {
+ ckfree(wmPtr->title);
+ }
+ if (wmPtr->iconName != NULL) {
+ ckfree(wmPtr->iconName);
+ }
if (wmPtr->hints.flags & IconPixmapHint) {
Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
}
@@ -1124,8 +2319,8 @@ TkWmDeadWindow(winPtr)
wmPtr2->numTransients--;
}
Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
- VisibilityChangeMask,
- WmWaitVisibilityProc, (ClientData) winPtr);
+ VisibilityChangeMask|StructureNotifyMask,
+ WmWaitVisibilityOrMapProc, (ClientData) winPtr);
wmPtr->masterPtr = NULL;
}
@@ -1140,6 +2335,15 @@ TkWmDeadWindow(winPtr)
DestroyWindow(Tk_GetHWND(winPtr->window));
}
}
+ if (wmPtr->iconPtr != NULL) {
+ /*
+ * This may delete the icon resource data. I believe we
+ * should do this after destroying the decorative frame,
+ * because the decorative frame is using this icon.
+ */
+ DecrIconRefCount(wmPtr->iconPtr);
+ }
+
ckfree((char *) wmPtr);
winPtr->wmInfoPtr = NULL;
}
@@ -1174,7 +2378,7 @@ TkWmSetClass(winPtr)
/*
*----------------------------------------------------------------------
*
- * Tk_WmCmd --
+ * Tk_WmObjCmd --
*
* This procedure is invoked to process the "wm" Tcl command.
* See the user documentation for details on what it does.
@@ -1190,1154 +2394,2343 @@ TkWmSetClass(winPtr)
/* ARGSUSED */
int
-Tk_WmCmd(clientData, interp, argc, argv)
+Tk_WmObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window tkwin = (Tk_Window) clientData;
- TkWindow *winPtr = NULL;
- register WmInfo *wmPtr;
- int c;
- size_t length;
+ static CONST char *optionStrings[] = {
+ "aspect", "attributes", "client", "colormapwindows",
+ "command", "deiconify", "focusmodel", "frame",
+ "geometry", "grid", "group", "iconbitmap",
+ "iconify", "iconmask", "iconname", "iconposition",
+ "iconwindow", "maxsize", "minsize", "overrideredirect",
+ "positionfrom", "protocol", "resizable", "sizefrom",
+ "stackorder", "state", "title", "transient",
+ "withdraw", (char *) NULL };
+ enum options {
+ WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS,
+ WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FRAME,
+ WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBITMAP,
+ WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME, WMOPT_ICONPOSITION,
+ WMOPT_ICONWINDOW, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT,
+ WMOPT_POSITIONFROM, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM,
+ WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT,
+ WMOPT_WITHDRAW };
+ int index, length;
+ char *argv1;
+ TkWindow *winPtr;
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
- if (argc < 2) {
+ if (objc < 2) {
wrongNumArgs:
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " option window ?arg ...?\"", (char *) NULL);
+ Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg ...?");
return TCL_ERROR;
}
- c = argv[1][0];
- length = strlen(argv[1]);
- if ((c == 't') && (strncmp(argv[1], "tracing", length) == 0)
+
+ argv1 = Tcl_GetStringFromObj(objv[1], &length);
+ if ((argv1[0] == 't') && (strncmp(argv1, "tracing", length) == 0)
&& (length >= 3)) {
- if ((argc != 2) && (argc != 3)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " tracing ?boolean?\"", (char *) NULL);
+ int wmTracing;
+ if ((objc != 2) && (objc != 3)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
return TCL_ERROR;
}
- if (argc == 2) {
- Tcl_SetResult(interp, ((dispPtr->wmTracing) ? "on" : "off"),
+ if (objc == 2) {
+ Tcl_SetResult(interp,
+ ((dispPtr->flags & TK_DISPLAY_WM_TRACING) ? "on" : "off"),
TCL_STATIC);
return TCL_OK;
}
- return Tcl_GetBoolean(interp, argv[2], &dispPtr->wmTracing);
+ if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (wmTracing) {
+ dispPtr->flags |= TK_DISPLAY_WM_TRACING;
+ } else {
+ dispPtr->flags &= ~TK_DISPLAY_WM_TRACING;
+ }
+ return TCL_OK;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
}
- if (argc < 3) {
+ if (objc < 3) {
goto wrongNumArgs;
}
- winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[2], tkwin);
- if (winPtr == NULL) {
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[2], (Tk_Window *) &winPtr)
+ != TCL_OK) {
return TCL_ERROR;
}
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!Tk_IsTopLevel(winPtr)) {
Tcl_AppendResult(interp, "window \"", winPtr->pathName,
"\" isn't a top-level window", (char *) NULL);
return TCL_ERROR;
}
- wmPtr = winPtr->wmInfoPtr;
- if ((c == 'a') && (strncmp(argv[1], "aspect", length) == 0)) {
- int numer1, denom1, numer2, denom2;
- if ((argc != 3) && (argc != 7)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " aspect window ?minNumer minDenom ",
- "maxNumer maxDenom?\"", (char *) NULL);
+ switch ((enum options) index) {
+ case WMOPT_ASPECT:
+ return WmAspectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ATTRIBUTES:
+ return WmAttributesCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_CLIENT:
+ return WmClientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COLORMAPWINDOWS:
+ return WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_COMMAND:
+ return WmCommandCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_DEICONIFY:
+ return WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FOCUSMODEL:
+ return WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_FRAME:
+ return WmFrameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GEOMETRY:
+ return WmGeometryCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GRID:
+ return WmGridCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_GROUP:
+ return WmGroupCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONBITMAP:
+ return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONIFY:
+ return WmIconifyCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONMASK:
+ return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONNAME:
+ return WmIconnameCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONPOSITION:
+ return WmIconpositionCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_ICONWINDOW:
+ return WmIconwindowCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MAXSIZE:
+ return WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_MINSIZE:
+ return WmMinsizeCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_OVERRIDEREDIRECT:
+ return WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_POSITIONFROM:
+ return WmPositionfromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_PROTOCOL:
+ return WmProtocolCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_RESIZABLE:
+ return WmResizableCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_SIZEFROM:
+ return WmSizefromCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STACKORDER:
+ return WmStackorderCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_STATE:
+ return WmStateCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TITLE:
+ return WmTitleCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_TRANSIENT:
+ return WmTransientCmd(tkwin, winPtr, interp, objc, objv);
+ case WMOPT_WITHDRAW:
+ return WmWithdrawCmd(tkwin, winPtr, interp, objc, objv);
+ }
+
+ /* This should not happen */
+ return TCL_ERROR;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAspectCmd --
+ *
+ * This procedure is invoked to process the "wm aspect" 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
+WmAspectCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int numer1, denom1, numer2, denom2;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?minNumer minDenom maxNumer maxDenom?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PAspect) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
+ wmPtr->minAspect.y, wmPtr->maxAspect.x,
+ wmPtr->maxAspect.y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~PAspect;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &numer1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &denom1) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &numer2) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &denom2) != TCL_OK)) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & PAspect) {
- char buf[TCL_INTEGER_SPACE * 4];
-
- sprintf(buf, "%d %d %d %d", wmPtr->minAspect.x,
- wmPtr->minAspect.y, wmPtr->maxAspect.x,
- wmPtr->maxAspect.y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
+ if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
+ (denom2 <= 0)) {
+ Tcl_SetResult(interp, "aspect number can't be <= 0",
+ TCL_STATIC);
+ return TCL_ERROR;
}
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~PAspect;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &numer1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &denom1) != TCL_OK)
- || (Tcl_GetInt(interp, argv[5], &numer2) != TCL_OK)
- || (Tcl_GetInt(interp, argv[6], &denom2) != TCL_OK)) {
- return TCL_ERROR;
- }
- if ((numer1 <= 0) || (denom1 <= 0) || (numer2 <= 0) ||
- (denom2 <= 0)) {
- Tcl_SetResult(interp, "aspect number can't be <= 0",
- TCL_STATIC);
- return TCL_ERROR;
- }
- wmPtr->minAspect.x = numer1;
- wmPtr->minAspect.y = denom1;
- wmPtr->maxAspect.x = numer2;
- wmPtr->maxAspect.y = denom2;
- wmPtr->sizeHintsFlags |= PAspect;
- }
- goto updateGeom;
- } else if ((c == 'c') && (strncmp(argv[1], "client", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " client window ?name?\"",
- (char *) NULL);
+ wmPtr->minAspect.x = numer1;
+ wmPtr->minAspect.y = denom1;
+ wmPtr->maxAspect.x = numer2;
+ wmPtr->maxAspect.y = denom2;
+ wmPtr->sizeHintsFlags |= PAspect;
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmAttributesCmd --
+ *
+ * This procedure is invoked to process the "wm attributes" 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
+WmAttributesCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ LONG style, exStyle, styleBit, *stylePtr;
+ char buf[TCL_INTEGER_SPACE], *string;
+ int i, boolean, length;
+
+ if (objc < 3) {
+ configArgs:
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window"
+ " ?-disabled ?bool??"
+ " ?-toolwindow ?bool??"
+ " ?-topmost ?bool??");
+ return TCL_ERROR;
+ }
+ exStyle = wmPtr->exStyleConfig;
+ style = wmPtr->styleConfig;
+ if (objc == 3) {
+ sprintf(buf, "%d", ((style & WS_DISABLED) != 0));
+ Tcl_AppendResult(interp, "-disabled ", buf, (char *) NULL);
+ sprintf(buf, "%d", ((exStyle & WS_EX_TOOLWINDOW) != 0));
+ Tcl_AppendResult(interp, " -toolwindow ", buf, (char *) NULL);
+ sprintf(buf, "%d", ((exStyle & WS_EX_TOPMOST) != 0));
+ Tcl_AppendResult(interp, " -topmost ", buf, (char *) NULL);
+ return TCL_OK;
+ }
+ for (i = 3; i < objc; i += 2) {
+ string = Tcl_GetStringFromObj(objv[i], &length);
+ if ((length < 2) || (string[0] != '-')) {
+ goto configArgs;
+ }
+ if ((i < objc-1) &&
+ (Tcl_GetBooleanFromObj(interp, objv[i+1], &boolean) != TCL_OK)) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->clientMachine != NULL) {
- Tcl_SetResult(interp, wmPtr->clientMachine, TCL_STATIC);
+ if (strncmp(string, "-disabled", length) == 0) {
+ stylePtr = &style;
+ styleBit = WS_DISABLED;
+ } else if ((strncmp(string, "-toolwindow", length) == 0)
+ && (length >= 3)) {
+ stylePtr = &exStyle;
+ styleBit = WS_EX_TOOLWINDOW;
+ } else if ((strncmp(string, "-topmost", length) == 0)
+ && (length >= 3)) {
+ stylePtr = &exStyle;
+ styleBit = WS_EX_TOPMOST;
+ if ((i < objc-1) && (winPtr->flags & TK_EMBEDDED)) {
+ Tcl_AppendResult(interp, "can't set topmost flag on ",
+ winPtr->pathName, ": it is an embedded window",
+ (char *) NULL);
+ return TCL_ERROR;
}
- return TCL_OK;
+ } else {
+ goto configArgs;
}
- if (argv[3][0] == 0) {
- if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
- wmPtr->clientMachine = NULL;
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XDeleteProperty(winPtr->display, winPtr->window,
- Tk_InternAtom((Tk_Window) winPtr,
- "WM_CLIENT_MACHINE"));
- }
- }
- return TCL_OK;
+ if (i == objc-1) {
+ Tcl_SetIntObj(Tcl_GetObjResult(interp),
+ ((*stylePtr & styleBit) != 0));
+ } else if (boolean) {
+ *stylePtr |= styleBit;
+ } else {
+ *stylePtr &= ~styleBit;
}
+ }
+ if ((wmPtr->styleConfig != style) ||
+ (wmPtr->exStyleConfig != exStyle)) {
+ wmPtr->styleConfig = style;
+ wmPtr->exStyleConfig = exStyle;
+ UpdateWrapper(winPtr);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmClientCmd --
+ *
+ * This procedure is invoked to process the "wm client" 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
+WmClientCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
if (wmPtr->clientMachine != NULL) {
- ckfree((char *) wmPtr->clientMachine);
+ Tcl_SetResult(interp, wmPtr->clientMachine, TCL_STATIC);
}
- wmPtr->clientMachine = (char *)
- ckalloc((unsigned) (strlen(argv[3]) + 1));
- strcpy(wmPtr->clientMachine, argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XTextProperty textProp;
- if (XStringListToTextProperty(&wmPtr->clientMachine, 1, &textProp)
- != 0) {
- XSetWMClientMachine(winPtr->display, winPtr->window,
- &textProp);
- XFree((char *) textProp.value);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (argv3[0] == 0) {
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ wmPtr->clientMachine = NULL;
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XDeleteProperty(winPtr->display, winPtr->window,
+ Tk_InternAtom((Tk_Window) winPtr,
+ "WM_CLIENT_MACHINE"));
}
}
- } else if ((c == 'c') && (strncmp(argv[1], "colormapwindows", length) == 0)
- && (length >= 3)) {
- TkWindow **cmapList;
- TkWindow *winPtr2;
- int i, windowArgc, gotToplevel;
- char **windowArgv;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " colormapwindows window ?windowList?\"",
- (char *) NULL);
- return TCL_ERROR;
+ return TCL_OK;
+ }
+ if (wmPtr->clientMachine != NULL) {
+ ckfree((char *) wmPtr->clientMachine);
+ }
+ wmPtr->clientMachine = (char *)
+ ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->clientMachine, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XTextProperty textProp;
+ if (XStringListToTextProperty(&wmPtr->clientMachine, 1, &textProp)
+ != 0) {
+ XSetWMClientMachine(winPtr->display, winPtr->window,
+ &textProp);
+ XFree((char *) textProp.value);
}
- if (argc == 3) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
- for (i = 0; i < wmPtr->cmapCount; i++) {
- if ((i == (wmPtr->cmapCount-1))
- && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
- break;
- }
- Tcl_AppendElement(interp, wmPtr->cmapList[i]->pathName);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmColormapwindowsCmd --
+ *
+ * This procedure is invoked to process the "wm colormapwindows"
+ * 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
+WmColormapwindowsCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ TkWindow **cmapList;
+ TkWindow *winPtr2;
+ int i, windowObjc, gotToplevel;
+ Tcl_Obj **windowObjv;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?windowList?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ for (i = 0; i < wmPtr->cmapCount; i++) {
+ if ((i == (wmPtr->cmapCount-1))
+ && (wmPtr->flags & WM_ADDED_TOPLEVEL_COLORMAP)) {
+ break;
}
- return TCL_OK;
+ Tcl_AppendElement(interp, wmPtr->cmapList[i]->pathName);
}
- if (Tcl_SplitList(interp, argv[3], &windowArgc, &windowArgv)
- != TCL_OK) {
+ return TCL_OK;
+ }
+ if (Tcl_ListObjGetElements(interp, objv[3], &windowObjc, &windowObjv)
+ != TCL_OK) {
+ return TCL_ERROR;
+ }
+ cmapList = (TkWindow **) ckalloc((unsigned)
+ ((windowObjc+1)*sizeof(TkWindow*)));
+ gotToplevel = 0;
+ for (i = 0; i < windowObjc; i++) {
+ if (TkGetWindowFromObj(interp, tkwin, windowObjv[i],
+ (Tk_Window *) &winPtr2) != TCL_OK)
+ {
+ ckfree((char *) cmapList);
return TCL_ERROR;
}
- cmapList = (TkWindow **) ckalloc((unsigned)
- ((windowArgc+1)*sizeof(TkWindow*)));
- for (i = 0; i < windowArgc; i++) {
- winPtr2 = (TkWindow *) Tk_NameToWindow(interp, windowArgv[i],
- tkwin);
- if (winPtr2 == NULL) {
- ckfree((char *) cmapList);
- ckfree((char *) windowArgv);
- return TCL_ERROR;
- }
- if (winPtr2 == winPtr) {
- gotToplevel = 1;
- }
- if (winPtr2->window == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr2);
- }
- cmapList[i] = winPtr2;
+ if (winPtr2 == winPtr) {
+ gotToplevel = 1;
}
- if (!gotToplevel) {
- wmPtr->flags |= WM_ADDED_TOPLEVEL_COLORMAP;
- cmapList[windowArgc] = winPtr;
- windowArgc++;
- } else {
- wmPtr->flags &= ~WM_ADDED_TOPLEVEL_COLORMAP;
+ if (winPtr2->window == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr2);
+ }
+ cmapList[i] = winPtr2;
+ }
+ if (!gotToplevel) {
+ wmPtr->flags |= WM_ADDED_TOPLEVEL_COLORMAP;
+ cmapList[windowObjc] = winPtr;
+ windowObjc++;
+ } else {
+ wmPtr->flags &= ~WM_ADDED_TOPLEVEL_COLORMAP;
+ }
+ wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
+ if (wmPtr->cmapList != NULL) {
+ ckfree((char *)wmPtr->cmapList);
+ }
+ wmPtr->cmapList = cmapList;
+ wmPtr->cmapCount = windowObjc;
+
+ /*
+ * Now we need to force the updated colormaps to be installed.
+ */
+
+ if (wmPtr == winPtr->dispPtr->foregroundWmPtr) {
+ InstallColormaps(wmPtr->wrapper, WM_QUERYNEWPALETTE, 1);
+ } else {
+ InstallColormaps(wmPtr->wrapper, WM_PALETTECHANGED, 0);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmCommandCmd --
+ *
+ * This procedure is invoked to process the "wm command" 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
+WmCommandCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int cmdArgc;
+ CONST char **cmdArgv;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?value?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->cmdArgv != NULL) {
+ Tcl_SetResult(interp,
+ Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
+ TCL_DYNAMIC);
}
- wmPtr->flags |= WM_COLORMAPS_EXPLICIT;
- if (wmPtr->cmapList != NULL) {
- ckfree((char *)wmPtr->cmapList);
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (argv3[0] == 0) {
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ wmPtr->cmdArgv = NULL;
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XDeleteProperty(winPtr->display, winPtr->window,
+ Tk_InternAtom((Tk_Window) winPtr, "WM_COMMAND"));
+ }
}
- wmPtr->cmapList = cmapList;
- wmPtr->cmapCount = windowArgc;
- ckfree((char *) windowArgv);
+ return TCL_OK;
+ }
+ if (Tcl_SplitList(interp, argv3, &cmdArgc, &cmdArgv) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (wmPtr->cmdArgv != NULL) {
+ ckfree((char *) wmPtr->cmdArgv);
+ }
+ wmPtr->cmdArgc = cmdArgc;
+ wmPtr->cmdArgv = cmdArgv;
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XSetCommand(winPtr->display, winPtr->window, cmdArgv, cmdArgc);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmDeiconifyCmd --
+ *
+ * This procedure is invoked to process the "wm deiconify" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * Now we need to force the updated colormaps to be installed.
- */
+static int
+WmDeiconifyCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't deiconify ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) {
+ wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN;
+ }
+
+ /*
+ * If WM_UPDATE_PENDING is true, a pending UpdateGeometryInfo may
+ * need to be called first to update a withdrawn toplevel's geometry
+ * before it is deiconified by TkpWmSetState.
+ * Don't bother if we've never been mapped.
+ */
+ if ((wmPtr->flags & WM_UPDATE_PENDING) &&
+ !(wmPtr->flags & WM_NEVER_MAPPED)) {
+ Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
+ UpdateGeometryInfo((ClientData) winPtr);
+ }
+
+ /*
+ * If we were in the ZoomState (maximized), 'wm deiconify'
+ * should not cause the window to shrink
+ */
+ if (wmPtr->hints.initial_state == ZoomState) {
+ TkpWmSetState(winPtr, ZoomState);
+ } else {
+ TkpWmSetState(winPtr, NormalState);
+ }
+
+ /*
+ * An unmapped window will be mapped at idle time
+ * by a call to MapFrame. That calls CreateWrapper
+ * which sets the focus and raises the window.
+ */
+ if (wmPtr->flags & WM_NEVER_MAPPED) {
+ return TCL_OK;
+ }
+
+ /*
+ * Follow Windows-like style here, raising the window to the top.
+ */
+ TkWmRestackToplevel(winPtr, Above, NULL);
+ if (!(Tk_Attributes((Tk_Window) winPtr)->override_redirect)) {
+ TkSetFocusWin(winPtr, 1);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFocusmodelCmd --
+ *
+ * This procedure is invoked to process the "wm focusmodel" 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
+WmFocusmodelCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "active", "passive", (char *) NULL };
+ enum options {
+ OPT_ACTIVE, OPT_PASSIVE };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?active|passive?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp, (wmPtr->hints.input ? "passive" : "active"),
+ TCL_STATIC);
+ return TCL_OK;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (index == OPT_ACTIVE) {
+ wmPtr->hints.input = False;
+ } else { /* OPT_PASSIVE */
+ wmPtr->hints.input = True;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmFrameCmd --
+ *
+ * This procedure is invoked to process the "wm frame" 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
+WmFrameCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ HWND hwnd;
+ char buf[TCL_INTEGER_SPACE];
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (Tk_WindowId((Tk_Window) winPtr) == None) {
+ Tk_MakeWindowExist((Tk_Window) winPtr);
+ }
+ hwnd = wmPtr->wrapper;
+ if (hwnd == NULL) {
+ hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) winPtr));
+ }
+ sprintf(buf, "0x%x", (unsigned int) hwnd);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGeometryCmd --
+ *
+ * This procedure is invoked to process the "wm geometry" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if (wmPtr == winPtr->dispPtr->foregroundWmPtr) {
- InstallColormaps(wmPtr->wrapper, WM_QUERYNEWPALETTE, 1);
+static int
+WmGeometryCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char xSign, ySign;
+ int width, height;
+ char *argv3;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newGeometry?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[16 + TCL_INTEGER_SPACE * 4];
+
+ xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
+ ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
+ if (wmPtr->gridWin != NULL) {
+ width = wmPtr->reqGridWidth + (winPtr->changes.width
+ - winPtr->reqWidth)/wmPtr->widthInc;
+ height = wmPtr->reqGridHeight + (winPtr->changes.height
+ - winPtr->reqHeight)/wmPtr->heightInc;
} else {
- InstallColormaps(wmPtr->wrapper, WM_PALETTECHANGED, 0);
+ width = winPtr->changes.width;
+ height = winPtr->changes.height;
}
+ sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
+ ySign, wmPtr->y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_OK;
- } else if ((c == 'c') && (strncmp(argv[1], "command", length) == 0)
- && (length >= 3)) {
- int cmdArgc;
- char **cmdArgv;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ wmPtr->width = -1;
+ wmPtr->height = -1;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+ }
+ return ParseGeometry(interp, argv3, winPtr);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGridCmd --
+ *
+ * This procedure is invoked to process the "wm grid" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " command window ?value?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- if (wmPtr->cmdArgv != NULL) {
- Tcl_SetResult(interp,
- Tcl_Merge(wmPtr->cmdArgc, wmPtr->cmdArgv),
- TCL_DYNAMIC);
- }
- return TCL_OK;
+static int
+WmGridCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int reqWidth, reqHeight, widthInc, heightInc;
+
+ if ((objc != 3) && (objc != 7)) {
+ Tcl_WrongNumArgs(interp, 2, objv,
+ "window ?baseWidth baseHeight widthInc heightInc?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & PBaseSize) {
+ char buf[TCL_INTEGER_SPACE * 4];
+
+ sprintf(buf, "%d %d %d %d", wmPtr->reqGridWidth,
+ wmPtr->reqGridHeight, wmPtr->widthInc,
+ wmPtr->heightInc);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- if (argv[3][0] == 0) {
- if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
- wmPtr->cmdArgv = NULL;
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XDeleteProperty(winPtr->display, winPtr->window,
- Tk_InternAtom((Tk_Window) winPtr, "WM_COMMAND"));
- }
- }
- return TCL_OK;
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ /*
+ * Turn off gridding and reset the width and height
+ * to make sense as ungridded numbers.
+ */
+
+ wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
+ if (wmPtr->width != -1) {
+ wmPtr->width = winPtr->reqWidth + (wmPtr->width
+ - wmPtr->reqGridWidth)*wmPtr->widthInc;
+ wmPtr->height = winPtr->reqHeight + (wmPtr->height
+ - wmPtr->reqGridHeight)*wmPtr->heightInc;
}
- if (Tcl_SplitList(interp, argv[3], &cmdArgc, &cmdArgv) != TCL_OK) {
+ wmPtr->widthInc = 1;
+ wmPtr->heightInc = 1;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &reqWidth) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &reqHeight) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[5], &widthInc) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[6], &heightInc) != TCL_OK)) {
return TCL_ERROR;
}
- if (wmPtr->cmdArgv != NULL) {
- ckfree((char *) wmPtr->cmdArgv);
- }
- wmPtr->cmdArgc = cmdArgc;
- wmPtr->cmdArgv = cmdArgv;
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XSetCommand(winPtr->display, winPtr->window, cmdArgv, cmdArgc);
+ if (reqWidth < 0) {
+ Tcl_SetResult(interp, "baseWidth can't be < 0", TCL_STATIC);
+ return TCL_ERROR;
}
- } else if ((c == 'd') && (strncmp(argv[1], "deiconify", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " deiconify window\"", (char *) NULL);
+ if (reqHeight < 0) {
+ Tcl_SetResult(interp, "baseHeight can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't deiconify ", argv[2],
- ": it is an icon for ", winPtr->pathName, (char *) NULL);
+ if (widthInc < 0) {
+ Tcl_SetResult(interp, "widthInc can't be < 0", TCL_STATIC);
return TCL_ERROR;
}
- if (winPtr->flags & TK_EMBEDDED) {
- Tcl_AppendResult(interp, "can't deiconify ", winPtr->pathName,
- ": it is an embedded window", (char *) NULL);
- return TCL_ERROR;
- }
- /*
- * If WM_UPDATE_PENDING is true, a pending UpdateGeometryInfo may
- * need to be called first to update a withdrew toplevel's geometry
- * before it is deiconified by TkpWmSetState.
- * Don't bother if we've never been mapped.
- */
- if (wmPtr->flags & WM_UPDATE_PENDING) {
- Tcl_CancelIdleCall(UpdateGeometryInfo, (ClientData) winPtr);
- UpdateGeometryInfo((ClientData) winPtr);
+ if (heightInc < 0) {
+ Tcl_SetResult(interp, "heightInc can't be < 0", TCL_STATIC);
+ return TCL_ERROR;
}
+ Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
+ heightInc);
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmGroupCmd --
+ *
+ * This procedure is invoked to process the "wm group" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * If we were in the ZoomState (maximized), 'wm deiconify'
- * should not cause the window to shrink
- */
- if (wmPtr->hints.initial_state == ZoomState) {
- TkpWmSetState(winPtr, ZoomState);
- } else {
- TkpWmSetState(winPtr, NormalState);
- }
+static int
+WmGroupCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ char *argv3;
+ int length;
- /*
- * Follow Windows-like style here, raising the window to the top.
- */
- TkWmRestackToplevel(winPtr, Above, NULL);
- if (!(Tk_Attributes((Tk_Window) winPtr)->override_redirect)) {
- TkSetFocusWin(winPtr, 1);
- }
- } else if ((c == 'f') && (strncmp(argv[1], "focusmodel", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " focusmodel window ?active|passive?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- Tcl_SetResult(interp, (wmPtr->hints.input ? "passive" : "active"),
- TCL_STATIC);
- return TCL_OK;
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & WindowGroupHint) {
+ Tcl_SetResult(interp, wmPtr->leaderName, TCL_STATIC);
}
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'a') && (strncmp(argv[3], "active", length) == 0)) {
- wmPtr->hints.input = False;
- } else if ((c == 'p') && (strncmp(argv[3], "passive", length) == 0)) {
- wmPtr->hints.input = True;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be active or passive", (char *) NULL);
- return TCL_ERROR;
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ if (*argv3 == '\0') {
+ wmPtr->hints.flags &= ~WindowGroupHint;
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
}
- } else if ((c == 'f') && (strncmp(argv[1], "frame", length) == 0)
- && (length >= 2)) {
- HWND hwnd;
- char buf[TCL_INTEGER_SPACE];
-
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " frame window\"", (char *) NULL);
+ wmPtr->leaderName = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
- if (Tk_WindowId((Tk_Window) winPtr) == None) {
- Tk_MakeWindowExist((Tk_Window) winPtr);
- }
- hwnd = wmPtr->wrapper;
- if (hwnd == NULL) {
- hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) winPtr));
+ Tk_MakeWindowExist(tkwin2);
+ if (wmPtr->leaderName != NULL) {
+ ckfree(wmPtr->leaderName);
}
- sprintf(buf, "0x%x", (unsigned int) hwnd);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- } else if ((c == 'g') && (strncmp(argv[1], "geometry", length) == 0)
- && (length >= 2)) {
- char xSign, ySign;
- int width, height;
+ wmPtr->hints.window_group = Tk_WindowId(tkwin2);
+ wmPtr->hints.flags |= WindowGroupHint;
+ wmPtr->leaderName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->leaderName, argv3);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconbitmapCmd --
+ *
+ * This procedure is invoked to process the "wm iconbitmap" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " geometry window ?newGeometry?\"",
+static int
+WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ /* If true, then set for all windows. */
+ int isDefault = 0;
+ char *string;
+
+ if ((objc < 3) || (objc > 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?-default? ?image?");
+ return TCL_ERROR;
+ } else if (objc == 5) {
+ /* If we have 5 arguments, we must have a '-default' flag */
+ char *argv3 = Tcl_GetString(objv[3]);
+ if (strcmp(argv3, "-default")) {
+ Tcl_AppendResult(interp, "illegal option \"",
+ argv3, "\" must be \"-default\"",
(char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- char buf[16 + TCL_INTEGER_SPACE * 4];
-
- xSign = (wmPtr->flags & WM_NEGATIVE_X) ? '-' : '+';
- ySign = (wmPtr->flags & WM_NEGATIVE_Y) ? '-' : '+';
- if (wmPtr->gridWin != NULL) {
- width = wmPtr->reqGridWidth + (winPtr->changes.width
- - winPtr->reqWidth)/wmPtr->widthInc;
- height = wmPtr->reqGridHeight + (winPtr->changes.height
- - winPtr->reqHeight)/wmPtr->heightInc;
- } else {
- width = winPtr->changes.width;
- height = winPtr->changes.height;
- }
- sprintf(buf, "%dx%d%c%d%c%d", width, height, xSign, wmPtr->x,
- ySign, wmPtr->y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->width = -1;
- wmPtr->height = -1;
- goto updateGeom;
+ isDefault = 1;
+ } else if (objc == 3) {
+ /* No arguments were given */
+ if (wmPtr->hints.flags & IconPixmapHint) {
+ Tcl_SetResult(interp, (char *)
+ Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_pixmap),
+ TCL_STATIC);
}
- return ParseGeometry(interp, argv[3], winPtr);
- } else if ((c == 'g') && (strncmp(argv[1], "grid", length) == 0)
- && (length >= 3)) {
- int reqWidth, reqHeight, widthInc, heightInc;
+ return TCL_OK;
+ }
- if ((argc != 3) && (argc != 7)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " grid window ?baseWidth baseHeight ",
- "widthInc heightInc?\"", (char *) NULL);
+ string = Tcl_GetString(objv[objc-1]);
+ if (*string == '\0') {
+ if (wmPtr->hints.icon_pixmap != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
+ wmPtr->hints.icon_pixmap = None;
+ }
+ wmPtr->hints.flags &= ~IconPixmapHint;
+ if (WinSetIcon(interp, NULL,
+ (isDefault ? NULL : (Tk_Window) winPtr)) != TCL_OK) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & PBaseSize) {
- char buf[TCL_INTEGER_SPACE * 4];
-
- sprintf(buf, "%d %d %d %d", wmPtr->reqGridWidth,
- wmPtr->reqGridHeight, wmPtr->widthInc,
- wmPtr->heightInc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ } else {
+ /*
+ * In the future this block of code will use Tk's 'image'
+ * functionality to allow all supported image formats.
+ * However, this will require a change to the way icons are
+ * handled. We will need to add icon<->image conversions
+ * routines.
+ *
+ * Until that happens we simply try to find an icon in the
+ * given argument, and if that fails, we use the older
+ * bitmap code. We do things this way round (icon then
+ * bitmap), because the bitmap code actually seems to have
+ * no visible effect, so we want to give the icon code the
+ * first try at doing something.
+ */
+
+ /*
+ * Either return NULL, or return a valid titlebaricon with its
+ * ref count already incremented.
+ */
+ WinIconPtr titlebaricon = ReadIconFromFile(interp, objv[objc-1]);
+ if (titlebaricon != NULL) {
+ /*
+ * Try to set the icon for the window. If it is a '-default'
+ * icon, we must pass in NULL
+ */
+ if (WinSetIcon(interp, titlebaricon,
+ (isDefault ? NULL : (Tk_Window) winPtr)) != TCL_OK) {
+ /* We didn't use the titlebaricon after all */
+ DecrIconRefCount(titlebaricon);
+ titlebaricon = NULL;
}
- return TCL_OK;
}
- if (*argv[3] == '\0') {
+ if (titlebaricon == NULL) {
/*
- * Turn off gridding and reset the width and height
- * to make sense as ungridded numbers.
+ * We didn't manage to handle the argument as a valid
+ * icon. Try as a bitmap. First we must clear the
+ * error message which was placed in the interpreter
*/
-
- wmPtr->sizeHintsFlags &= ~(PBaseSize|PResizeInc);
- if (wmPtr->width != -1) {
- wmPtr->width = winPtr->reqWidth + (wmPtr->width
- - wmPtr->reqGridWidth)*wmPtr->widthInc;
- wmPtr->height = winPtr->reqHeight + (wmPtr->height
- - wmPtr->reqGridHeight)*wmPtr->heightInc;
- }
- wmPtr->widthInc = 1;
- wmPtr->heightInc = 1;
- } else {
- if ((Tcl_GetInt(interp, argv[3], &reqWidth) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &reqHeight) != TCL_OK)
- || (Tcl_GetInt(interp, argv[5], &widthInc) != TCL_OK)
- || (Tcl_GetInt(interp, argv[6], &heightInc) != TCL_OK)) {
- return TCL_ERROR;
- }
- if (reqWidth < 0) {
- Tcl_SetResult(interp, "baseWidth can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (reqHeight < 0) {
- Tcl_SetResult(interp, "baseHeight can't be < 0", TCL_STATIC);
- return TCL_ERROR;
- }
- if (widthInc < 0) {
- Tcl_SetResult(interp, "widthInc can't be < 0", TCL_STATIC);
+ Pixmap pixmap;
+ Tcl_ResetResult(interp);
+ pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr, string);
+ if (pixmap == None) {
return TCL_ERROR;
}
- if (heightInc < 0) {
- Tcl_SetResult(interp, "heightInc can't be < 0", TCL_STATIC);
- return TCL_ERROR;
+ wmPtr->hints.icon_pixmap = pixmap;
+ wmPtr->hints.flags |= IconPixmapHint;
+ titlebaricon = GetIconFromPixmap(Tk_Display(winPtr), pixmap);
+ if (titlebaricon != NULL) {
+ if (WinSetIcon(interp, titlebaricon,
+ (isDefault ? NULL : (Tk_Window) winPtr)) != TCL_OK) {
+ /* We didn't use the titlebaricon after all */
+ DecrIconRefCount(titlebaricon);
+ titlebaricon = NULL;
+ }
}
- Tk_SetGrid((Tk_Window) winPtr, reqWidth, reqHeight, widthInc,
- heightInc);
}
- goto updateGeom;
- } else if ((c == 'g') && (strncmp(argv[1], "group", length) == 0)
- && (length >= 3)) {
- Tk_Window tkwin2;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconifyCmd --
+ *
+ * This procedure is invoked to process the "wm iconify" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " group window ?pathName?\"",
- (char *) NULL);
- return TCL_ERROR;
+static int
+WmIconifyCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": override-redirect flag is set", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->masterPtr != NULL) {
+ Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
+ ": it is an embedded window", (char *) NULL);
+ return TCL_ERROR;
+ }
+ TkpWmSetState(winPtr, IconicState);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconmaskCmd --
+ *
+ * This procedure is invoked to process the "wm iconmask" 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
+WmIconmaskCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Pixmap pixmap;
+ char *argv3;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?bitmap?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconMaskHint) {
+ Tcl_SetResult(interp, (char *)
+ Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
+ TCL_STATIC);
}
- if (argc == 3) {
- if (wmPtr->hints.flags & WindowGroupHint) {
- Tcl_SetResult(interp, wmPtr->leaderName, TCL_STATIC);
- }
- return TCL_OK;
+ return TCL_OK;
+ }
+ argv3 = Tcl_GetString(objv[3]);
+ if (*argv3 == '\0') {
+ if (wmPtr->hints.icon_mask != None) {
+ Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~WindowGroupHint;
- if (wmPtr->leaderName != NULL) {
- ckfree(wmPtr->leaderName);
- }
- wmPtr->leaderName = NULL;
- } else {
- tkwin2 = Tk_NameToWindow(interp, argv[3], tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- Tk_MakeWindowExist(tkwin2);
- wmPtr->hints.window_group = Tk_WindowId(tkwin2);
- wmPtr->hints.flags |= WindowGroupHint;
- wmPtr->leaderName = ckalloc((unsigned) (strlen(argv[3])+1));
- strcpy(wmPtr->leaderName, argv[3]);
- }
- } else if ((c == 'i') && (strncmp(argv[1], "iconbitmap", length) == 0)
- && (length >= 5)) {
- Pixmap pixmap;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconbitmap window ?bitmap?\"",
- (char *) NULL);
+ wmPtr->hints.flags &= ~IconMaskHint;
+ } else {
+ pixmap = Tk_GetBitmap(interp, tkwin, argv3);
+ if (pixmap == None) {
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->hints.flags & IconPixmapHint) {
- Tcl_SetResult(interp,
- Tk_NameOfBitmap(winPtr->display,
- wmPtr->hints.icon_pixmap), TCL_STATIC);
- }
- return TCL_OK;
+ wmPtr->hints.icon_mask = pixmap;
+ wmPtr->hints.flags |= IconMaskHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconnameCmd --
+ *
+ * This procedure is invoked to process the "wm iconname" 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
+WmIconnameCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp,
+ ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ if (wmPtr->iconName != NULL) {
+ ckfree((char *) wmPtr->iconName);
}
- if (*argv[3] == '\0') {
- if (wmPtr->hints.icon_pixmap != None) {
- Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_pixmap);
- }
- wmPtr->hints.flags &= ~IconPixmapHint;
- } else {
- pixmap = Tk_GetBitmap(interp, (Tk_Window) winPtr,
- Tk_GetUid(argv[3]));
- if (pixmap == None) {
- return TCL_ERROR;
- }
- wmPtr->hints.icon_pixmap = pixmap;
- wmPtr->hints.flags |= IconPixmapHint;
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->iconName = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->iconName, argv3);
+ if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
+ XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconify", length) == 0)
- && (length >= 5)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconify window\"", (char *) NULL);
- return TCL_ERROR;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconpositionCmd --
+ *
+ * This procedure is invoked to process the "wm iconposition"
+ * 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
+WmIconpositionCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int x, y;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?x y?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->hints.flags & IconPositionHint) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ sprintf(buf, "%d %d", wmPtr->hints.icon_x,
+ wmPtr->hints.icon_y);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
}
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
- Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
- "\": override-redirect flag is set", (char *) NULL);
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconPositionHint;
+ } else {
+ if ((Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK)){
return TCL_ERROR;
}
- if (wmPtr->masterPtr != NULL) {
- Tcl_AppendResult(interp, "can't iconify \"", winPtr->pathName,
- "\": it is a transient", (char *) NULL);
+ wmPtr->hints.icon_x = x;
+ wmPtr->hints.icon_y = y;
+ wmPtr->hints.flags |= IconPositionHint;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmIconwindowCmd --
+ *
+ * This procedure is invoked to process the "wm iconwindow" 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
+WmIconwindowCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ Tk_Window tkwin2;
+ WmInfo *wmPtr2;
+ XSetWindowAttributes atts;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?pathName?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->icon != NULL) {
+ Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->hints.flags &= ~IconWindowHint;
+ if (wmPtr->icon != NULL) {
+ /*
+ * Let the window use button events again, then remove
+ * it as icon window.
+ */
+
+ atts.event_mask = Tk_Attributes(wmPtr->icon)->event_mask
+ | ButtonPressMask;
+ Tk_ChangeWindowAttributes(wmPtr->icon, CWEventMask, &atts);
+ wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr2->iconFor = NULL;
+ wmPtr2->hints.initial_state = WithdrawnState;
+ }
+ wmPtr->icon = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3], &tkwin2) != TCL_OK) {
return TCL_ERROR;
}
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't iconify ", argv[2],
- ": it is an icon for ", winPtr->pathName, (char *) NULL);
+ if (!Tk_IsTopLevel(tkwin2)) {
+ Tcl_AppendResult(interp, "can't use ", Tcl_GetString(objv[3]),
+ " as icon window: not at top level", (char *) NULL);
return TCL_ERROR;
}
- if (winPtr->flags & TK_EMBEDDED) {
- Tcl_AppendResult(interp, "can't iconify ", winPtr->pathName,
- ": it is an embedded window", (char *) NULL);
- return TCL_ERROR;
- }
- TkpWmSetState(winPtr, IconicState);
- } else if ((c == 'i') && (strncmp(argv[1], "iconmask", length) == 0)
- && (length >= 5)) {
- Pixmap pixmap;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconmask window ?bitmap?\"",
- (char *) NULL);
+ wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
+ if (wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, Tcl_GetString(objv[3]),
+ " is already an icon for ",
+ Tk_PathName(wmPtr2->iconFor), (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->hints.flags & IconMaskHint) {
+ if (wmPtr->icon != NULL) {
+ WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
+ wmPtr3->iconFor = NULL;
+
+ /*
+ * Let the window use button events again.
+ */
+
+ atts.event_mask = Tk_Attributes(wmPtr->icon)->event_mask
+ | ButtonPressMask;
+ Tk_ChangeWindowAttributes(wmPtr->icon, CWEventMask, &atts);
+ }
+
+ /*
+ * Disable button events in the icon window: some window
+ * managers (like olvwm) want to get the events themselves,
+ * but X only allows one application at a time to receive
+ * button events for a window.
+ */
+
+ atts.event_mask = Tk_Attributes(tkwin2)->event_mask
+ & ~ButtonPressMask;
+ Tk_ChangeWindowAttributes(tkwin2, CWEventMask, &atts);
+ Tk_MakeWindowExist(tkwin2);
+ wmPtr->hints.icon_window = Tk_WindowId(tkwin2);
+ wmPtr->hints.flags |= IconWindowHint;
+ wmPtr->icon = tkwin2;
+ wmPtr2->iconFor = (Tk_Window) winPtr;
+ if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
+ if (XWithdrawWindow(Tk_Display(tkwin2), Tk_WindowId(tkwin2),
+ Tk_ScreenNumber(tkwin2)) == 0) {
Tcl_SetResult(interp,
- Tk_NameOfBitmap(winPtr->display, wmPtr->hints.icon_mask),
+ "couldn't send withdraw message to window manager",
TCL_STATIC);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- if (wmPtr->hints.icon_mask != None) {
- Tk_FreeBitmap(winPtr->display, wmPtr->hints.icon_mask);
- }
- wmPtr->hints.flags &= ~IconMaskHint;
- } else {
- pixmap = Tk_GetBitmap(interp, tkwin, Tk_GetUid(argv[3]));
- if (pixmap == None) {
return TCL_ERROR;
}
- wmPtr->hints.icon_mask = pixmap;
- wmPtr->hints.flags |= IconMaskHint;
- }
- } else if ((c == 'i') && (strncmp(argv[1], "iconname", length) == 0)
- && (length >= 5)) {
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconname window ?newName?\"", (char *) NULL);
- return TCL_ERROR;
}
- if (argc == 3) {
- Tcl_SetResult(interp,
- ((wmPtr->iconName != NULL) ? wmPtr->iconName : ""),
- TCL_STATIC);
- return TCL_OK;
- } else {
- wmPtr->iconName = Tk_GetUid(argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
- XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
- }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMaxsizeCmd --
+ *
+ * This procedure is invoked to process the "wm maxsize" 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
+WmMaxsizeCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ GetMaxSize(wmPtr, &width, &height);
+ sprintf(buf, "%d %d", width, height);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->maxWidth = width;
+ wmPtr->maxHeight = height;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmMinsizeCmd --
+ *
+ * This procedure is invoked to process the "wm minsize" 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
+WmMinsizeCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
+
+ GetMinSize(wmPtr, &width, &height);
+ sprintf(buf, "%d %d", width, height);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ wmPtr->minWidth = width;
+ wmPtr->minHeight = height;
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmOverrideredirectCmd --
+ *
+ * This procedure is invoked to process the "wm overrideredirect"
+ * 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
+WmOverrideredirectCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int boolean, curValue;
+ XSetWindowAttributes atts;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?boolean?");
+ return TCL_ERROR;
+ }
+ curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
+ if (objc == 3) {
+ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), curValue);
+ return TCL_OK;
+ }
+ if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (curValue != boolean) {
+ /*
+ * Only do this if we are really changing value, because it
+ * causes some funky stuff to occur
+ */
+ atts.override_redirect = (boolean) ? True : False;
+ Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
+ &atts);
+ if (!(wmPtr->flags & (WM_NEVER_MAPPED)
+ && !(winPtr->flags & TK_EMBEDDED))) {
+ UpdateWrapper(winPtr);
}
- } else if ((c == 'i') && (strncmp(argv[1], "iconposition", length) == 0)
- && (length >= 5)) {
- int x, y;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmPositionfromCmd --
+ *
+ * This procedure is invoked to process the "wm positionfrom"
+ * Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconposition window ?x y?\"",
- (char *) NULL);
- return TCL_ERROR;
+static int
+WmPositionfromCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user/program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USPosition) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PPosition) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
}
- if (argc == 3) {
- if (wmPtr->hints.flags & IconPositionHint) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- sprintf(buf, "%d %d", wmPtr->hints.icon_x,
- wmPtr->hints.icon_y);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- }
- return TCL_OK;
+ return TCL_OK;
+ }
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
+ return TCL_ERROR;
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~IconPositionHint;
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PPosition;
+ wmPtr->sizeHintsFlags |= USPosition;
} else {
- if ((Tcl_GetInt(interp, argv[3], &x) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &y) != TCL_OK)){
- return TCL_ERROR;
- }
- wmPtr->hints.icon_x = x;
- wmPtr->hints.icon_y = y;
- wmPtr->hints.flags |= IconPositionHint;
- }
- } else if ((c == 'i') && (strncmp(argv[1], "iconwindow", length) == 0)
- && (length >= 5)) {
- Tk_Window tkwin2;
- WmInfo *wmPtr2;
- XSetWindowAttributes atts;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " iconwindow window ?pathName?\"",
- (char *) NULL);
- return TCL_ERROR;
+ wmPtr->sizeHintsFlags &= ~USPosition;
+ wmPtr->sizeHintsFlags |= PPosition;
+ }
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmProtocolCmd --
+ *
+ * This procedure is invoked to process the "wm protocol" 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
+WmProtocolCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ register ProtocolHandler *protPtr, *prevPtr;
+ Atom protocol;
+ char *cmd;
+ int cmdLength;
+
+ if ((objc < 3) || (objc > 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?name? ?command?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ /*
+ * Return a list of all defined protocols for the window.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ Tcl_AppendElement(interp,
+ Tk_GetAtomName((Tk_Window) winPtr, protPtr->protocol));
}
- if (argc == 3) {
- if (wmPtr->icon != NULL) {
- Tcl_SetResult(interp, Tk_PathName(wmPtr->icon), TCL_STATIC);
+ return TCL_OK;
+ }
+ protocol = Tk_InternAtom((Tk_Window) winPtr, Tcl_GetString(objv[3]));
+ if (objc == 4) {
+ /*
+ * Return the command to handle a given protocol.
+ */
+ for (protPtr = wmPtr->protPtr; protPtr != NULL;
+ protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ Tcl_SetResult(interp, protPtr->command, TCL_STATIC);
+ return TCL_OK;
}
- return TCL_OK;
}
- if (*argv[3] == '\0') {
- wmPtr->hints.flags &= ~IconWindowHint;
- if (wmPtr->icon != NULL) {
- /*
- * Let the window use button events again, then remove
- * it as icon window.
- */
+ return TCL_OK;
+ }
- atts.event_mask = Tk_Attributes(wmPtr->icon)->event_mask
- | ButtonPressMask;
- Tk_ChangeWindowAttributes(wmPtr->icon, CWEventMask, &atts);
- wmPtr2 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
- wmPtr2->iconFor = NULL;
- wmPtr2->hints.initial_state = WithdrawnState;
- }
- wmPtr->icon = NULL;
- } else {
- tkwin2 = Tk_NameToWindow(interp, argv[3], tkwin);
- if (tkwin2 == NULL) {
- return TCL_ERROR;
- }
- if (!Tk_IsTopLevel(tkwin2)) {
- Tcl_AppendResult(interp, "can't use ", argv[3],
- " as icon window: not at top level", (char *) NULL);
- return TCL_ERROR;
- }
- wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr;
- if (wmPtr2->iconFor != NULL) {
- Tcl_AppendResult(interp, argv[3], " is already an icon for ",
- Tk_PathName(wmPtr2->iconFor), (char *) NULL);
- return TCL_ERROR;
+ /*
+ * Delete any current protocol handler, then create a new
+ * one with the specified command, unless the command is
+ * empty.
+ */
+
+ for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
+ prevPtr = protPtr, protPtr = protPtr->nextPtr) {
+ if (protPtr->protocol == protocol) {
+ if (prevPtr == NULL) {
+ wmPtr->protPtr = protPtr->nextPtr;
+ } else {
+ prevPtr->nextPtr = protPtr->nextPtr;
}
- if (wmPtr->icon != NULL) {
- WmInfo *wmPtr3 = ((TkWindow *) wmPtr->icon)->wmInfoPtr;
- wmPtr3->iconFor = NULL;
+ Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
+ break;
+ }
+ }
+ cmd = Tcl_GetStringFromObj(objv[4], &cmdLength);
+ if (cmdLength > 0) {
+ protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
+ protPtr->protocol = protocol;
+ protPtr->nextPtr = wmPtr->protPtr;
+ wmPtr->protPtr = protPtr;
+ protPtr->interp = interp;
+ strcpy(protPtr->command, cmd);
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmResizableCmd --
+ *
+ * This procedure is invoked to process the "wm resizable" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- /*
- * Let the window use button events again.
- */
+static int
+WmResizableCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ int width, height;
- atts.event_mask = Tk_Attributes(wmPtr->icon)->event_mask
- | ButtonPressMask;
- Tk_ChangeWindowAttributes(wmPtr->icon, CWEventMask, &atts);
- }
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?width height?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ char buf[TCL_INTEGER_SPACE * 2];
- /*
- * Disable button events in the icon window: some window
- * managers (like olvwm) want to get the events themselves,
- * but X only allows one application at a time to receive
- * button events for a window.
- */
+ sprintf(buf, "%d %d",
+ (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
+ (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ return TCL_OK;
+ }
+ if ((Tcl_GetBooleanFromObj(interp, objv[3], &width) != TCL_OK)
+ || (Tcl_GetBooleanFromObj(interp, objv[4], &height) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ if (width) {
+ wmPtr->flags &= ~WM_WIDTH_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
+ }
+ if (height) {
+ wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
+ } else {
+ wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
+ }
+ if (!((wmPtr->flags & WM_NEVER_MAPPED)
+ && !(winPtr->flags & TK_EMBEDDED))) {
+ UpdateWrapper(winPtr);
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmSizefromCmd --
+ *
+ * This procedure is invoked to process the "wm sizefrom" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- atts.event_mask = Tk_Attributes(tkwin2)->event_mask
- & ~ButtonPressMask;
- Tk_ChangeWindowAttributes(tkwin2, CWEventMask, &atts);
- Tk_MakeWindowExist(tkwin2);
- wmPtr->hints.icon_window = Tk_WindowId(tkwin2);
- wmPtr->hints.flags |= IconWindowHint;
- wmPtr->icon = tkwin2;
- wmPtr2->iconFor = (Tk_Window) winPtr;
- if (!(wmPtr2->flags & WM_NEVER_MAPPED)) {
- if (XWithdrawWindow(Tk_Display(tkwin2), Tk_WindowId(tkwin2),
- Tk_ScreenNumber(tkwin2)) == 0) {
- Tcl_SetResult(interp,
- "couldn't send withdraw message to window manager",
- TCL_STATIC);
- return TCL_ERROR;
- }
- }
- }
- } else if ((c == 'm') && (strncmp(argv[1], "maxsize", length) == 0)
- && (length >= 2)) {
- int width, height;
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " maxsize window ?width height?\"",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- GetMaxSize(wmPtr, &width, &height);
- sprintf(buf, "%d %d", width, height);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
+static int
+WmSizefromCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "program", "user", (char *) NULL };
+ enum options {
+ OPT_PROGRAM, OPT_USER };
+ int index;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?user|program?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (wmPtr->sizeHintsFlags & USSize) {
+ Tcl_SetResult(interp, "user", TCL_STATIC);
+ } else if (wmPtr->sizeHintsFlags & PSize) {
+ Tcl_SetResult(interp, "program", TCL_STATIC);
}
- if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &height) != TCL_OK)) {
+ return TCL_OK;
+ }
+
+ if (*Tcl_GetString(objv[3]) == '\0') {
+ wmPtr->sizeHintsFlags &= ~(USSize|PSize);
+ } else {
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- wmPtr->maxWidth = width;
- wmPtr->maxHeight = height;
- goto updateGeom;
- } else if ((c == 'm') && (strncmp(argv[1], "minsize", length) == 0)
- && (length >= 2)) {
- int width, height;
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " minsize window ?width height?\"",
- (char *) NULL);
- return TCL_ERROR;
+ if (index == OPT_USER) {
+ wmPtr->sizeHintsFlags &= ~PSize;
+ wmPtr->sizeHintsFlags |= USSize;
+ } else { /* OPT_PROGRAM */
+ wmPtr->sizeHintsFlags &= ~USSize;
+ wmPtr->sizeHintsFlags |= PSize;
}
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- GetMinSize(wmPtr, &width, &height);
- sprintf(buf, "%d %d", width, height);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ }
+ WmUpdateGeom(wmPtr, winPtr);
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStackorderCmd --
+ *
+ * This procedure is invoked to process the "wm stackorder" 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
+WmStackorderCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ TkWindow **windows, **window_ptr;
+ static CONST char *optionStrings[] = {
+ "isabove", "isbelow", (char *) NULL };
+ enum options {
+ OPT_ISABOVE, OPT_ISBELOW };
+ int index;
+
+ if ((objc != 3) && (objc != 5)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?isabove|isbelow window?");
+ return TCL_ERROR;
+ }
+
+ if (objc == 3) {
+ windows = TkWmStackorderToplevel(winPtr);
+ if (windows == NULL) {
+ panic("TkWmStackorderToplevel failed");
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ Tcl_AppendElement(interp, (*window_ptr)->pathName);
+ }
+ ckfree((char *) windows);
return TCL_OK;
}
- if ((Tcl_GetInt(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetInt(interp, argv[4], &height) != TCL_OK)) {
- return TCL_ERROR;
- }
- wmPtr->minWidth = width;
- wmPtr->minHeight = height;
- goto updateGeom;
- } else if ((c == 'o')
- && (strncmp(argv[1], "overrideredirect", length) == 0)) {
- int boolean, curValue;
- XSetWindowAttributes atts;
-
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " overrideredirect window ?boolean?\"",
- (char *) NULL);
+ } else {
+ TkWindow *winPtr2;
+ int index1=-1, index2=-1, result;
+
+ if (TkGetWindowFromObj(interp, tkwin, objv[4], (Tk_Window *) &winPtr2)
+ != TCL_OK) {
return TCL_ERROR;
}
- curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
- if (argc == 3) {
- Tcl_SetBooleanObj(Tcl_GetObjResult(interp), curValue);
- return TCL_OK;
- }
- if (Tcl_GetBoolean(interp, argv[3], &boolean) != TCL_OK) {
+
+ if (!Tk_IsTopLevel(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't a top-level window", (char *) NULL);
return TCL_ERROR;
}
- if (curValue != boolean) {
- /*
- * Only do this if we are really changing value, because it
- * causes some funky stuff to occur
- */
- atts.override_redirect = (boolean) ? True : False;
- Tk_ChangeWindowAttributes((Tk_Window) winPtr, CWOverrideRedirect,
- &atts);
- if (!(wmPtr->flags & (WM_NEVER_MAPPED)
- && !(winPtr->flags & TK_EMBEDDED))) {
- UpdateWrapper(winPtr);
- }
- }
- } else if ((c == 'p') && (strncmp(argv[1], "positionfrom", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " positionfrom window ?user/program?\"",
- (char *) NULL);
+
+ if (!Tk_IsMapped(winPtr)) {
+ Tcl_AppendResult(interp, "window \"", winPtr->pathName,
+ "\" isn't mapped", (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & USPosition) {
- Tcl_SetResult(interp, "user", TCL_STATIC);
- } else if (wmPtr->sizeHintsFlags & PPosition) {
- Tcl_SetResult(interp, "program", TCL_STATIC);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~(USPosition|PPosition);
- } else {
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'u') && (strncmp(argv[3], "user", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~PPosition;
- wmPtr->sizeHintsFlags |= USPosition;
- } else if ((c == 'p')
- && (strncmp(argv[3], "program", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~USPosition;
- wmPtr->sizeHintsFlags |= PPosition;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be program or user", (char *) NULL);
- return TCL_ERROR;
- }
- }
- goto updateGeom;
- } else if ((c == 'p') && (strncmp(argv[1], "protocol", length) == 0)
- && (length >= 2)) {
- register ProtocolHandler *protPtr, *prevPtr;
- Atom protocol;
- int cmdLength;
- if ((argc < 3) || (argc > 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " protocol window ?name? ?command?\"",
- (char *) NULL);
+ if (!Tk_IsMapped(winPtr2)) {
+ Tcl_AppendResult(interp, "window \"", winPtr2->pathName,
+ "\" isn't mapped", (char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- /*
- * Return a list of all defined protocols for the window.
- */
- for (protPtr = wmPtr->protPtr; protPtr != NULL;
- protPtr = protPtr->nextPtr) {
- Tcl_AppendElement(interp,
- Tk_GetAtomName((Tk_Window) winPtr, protPtr->protocol));
- }
- return TCL_OK;
- }
- protocol = Tk_InternAtom((Tk_Window) winPtr, argv[3]);
- if (argc == 4) {
- /*
- * Return the command to handle a given protocol.
- */
- for (protPtr = wmPtr->protPtr; protPtr != NULL;
- protPtr = protPtr->nextPtr) {
- if (protPtr->protocol == protocol) {
- Tcl_SetResult(interp, protPtr->command, TCL_STATIC);
- return TCL_OK;
- }
- }
- return TCL_OK;
- }
/*
- * Delete any current protocol handler, then create a new
- * one with the specified command, unless the command is
- * empty.
+ * Lookup stacking order of all toplevels that are children
+ * of "." and find the position of winPtr and winPtr2
+ * in the stacking order.
*/
- for (protPtr = wmPtr->protPtr, prevPtr = NULL; protPtr != NULL;
- prevPtr = protPtr, protPtr = protPtr->nextPtr) {
- if (protPtr->protocol == protocol) {
- if (prevPtr == NULL) {
- wmPtr->protPtr = protPtr->nextPtr;
- } else {
- prevPtr->nextPtr = protPtr->nextPtr;
- }
- Tcl_EventuallyFree((ClientData) protPtr, TCL_DYNAMIC);
- break;
+ windows = TkWmStackorderToplevel(winPtr->mainPtr->winPtr);
+
+ if (windows == NULL) {
+ Tcl_AppendResult(interp, "TkWmStackorderToplevel failed",
+ (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ for (window_ptr = windows; *window_ptr ; window_ptr++) {
+ if (*window_ptr == winPtr)
+ index1 = (window_ptr - windows);
+ if (*window_ptr == winPtr2)
+ index2 = (window_ptr - windows);
}
+ if (index1 == -1)
+ panic("winPtr window not found");
+ if (index2 == -1)
+ panic("winPtr2 window not found");
+
+ ckfree((char *) windows);
}
- cmdLength = strlen(argv[4]);
- if (cmdLength > 0) {
- protPtr = (ProtocolHandler *) ckalloc(HANDLER_SIZE(cmdLength));
- protPtr->protocol = protocol;
- protPtr->nextPtr = wmPtr->protPtr;
- wmPtr->protPtr = protPtr;
- protPtr->interp = interp;
- strcpy(protPtr->command, argv[4]);
- }
- } else if ((c == 'r') && (strncmp(argv[1], "resizable", length) == 0)) {
- int width, height;
- if ((argc != 3) && (argc != 5)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " resizable window ?width height?\"",
- (char *) NULL);
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- if (argc == 3) {
- char buf[TCL_INTEGER_SPACE * 2];
-
- sprintf(buf, "%d %d",
- (wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) ? 0 : 1,
- (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) ? 0 : 1);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
- return TCL_OK;
+ if (index == OPT_ISABOVE) {
+ result = index1 > index2;
+ } else { /* OPT_ISBELOW */
+ result = index1 < index2;
}
- if ((Tcl_GetBoolean(interp, argv[3], &width) != TCL_OK)
- || (Tcl_GetBoolean(interp, argv[4], &height) != TCL_OK)) {
+ Tcl_SetIntObj(Tcl_GetObjResult(interp), result);
+ return TCL_OK;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmStateCmd --
+ *
+ * This procedure is invoked to process the "wm state" 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
+WmStateCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ static CONST char *optionStrings[] = {
+ "normal", "iconic", "withdrawn", "zoomed", (char *) NULL };
+ enum options {
+ OPT_NORMAL, OPT_ICONIC, OPT_WITHDRAWN, OPT_ZOOMED };
+ int index;
+
+ if ((objc < 3) || (objc > 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?state?");
+ return TCL_ERROR;
+ }
+ if (objc == 4) {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
return TCL_ERROR;
}
- if (width) {
- wmPtr->flags &= ~WM_WIDTH_NOT_RESIZABLE;
- } else {
- wmPtr->flags |= WM_WIDTH_NOT_RESIZABLE;
- }
- if (height) {
- wmPtr->flags &= ~WM_HEIGHT_NOT_RESIZABLE;
- } else {
- wmPtr->flags |= WM_HEIGHT_NOT_RESIZABLE;
- }
- if (!((wmPtr->flags & WM_NEVER_MAPPED)
- && !(winPtr->flags & TK_EMBEDDED))) {
- UpdateWrapper(winPtr);
- }
- goto updateGeom;
- } else if ((c == 's') && (strncmp(argv[1], "sizefrom", length) == 0)
- && (length >= 2)) {
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " sizefrom window ?user|program?\"",
+ if (winPtr->flags & TK_EMBEDDED) {
+ Tcl_AppendResult(interp, "can't change state of ",
+ winPtr->pathName, ": it is an embedded window",
(char *) NULL);
return TCL_ERROR;
}
- if (argc == 3) {
- if (wmPtr->sizeHintsFlags & USSize) {
- Tcl_SetResult(interp, "user", TCL_STATIC);
- } else if (wmPtr->sizeHintsFlags & PSize) {
- Tcl_SetResult(interp, "program", TCL_STATIC);
- }
- return TCL_OK;
- }
- if (*argv[3] == '\0') {
- wmPtr->sizeHintsFlags &= ~(USSize|PSize);
- } else {
- c = argv[3][0];
- length = strlen(argv[3]);
- if ((c == 'u') && (strncmp(argv[3], "user", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~PSize;
- wmPtr->sizeHintsFlags |= USSize;
- } else if ((c == 'p')
- && (strncmp(argv[3], "program", length) == 0)) {
- wmPtr->sizeHintsFlags &= ~USSize;
- wmPtr->sizeHintsFlags |= PSize;
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be program or user", (char *) NULL);
- return TCL_ERROR;
- }
- }
- goto updateGeom;
- } else if ((c == 's') && (strncmp(argv[1], "state", length) == 0)
- && (length >= 2)) {
- if ((argc < 3) || (argc > 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " state window ?state?\"", (char *) NULL);
+
+ if (Tcl_GetIndexFromObj(interp, objv[3], optionStrings, "argument", 0,
+ &index) != TCL_OK) {
return TCL_ERROR;
}
- if (argc == 4) {
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't change state of ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
- (char *) NULL);
- return TCL_ERROR;
+
+ if (index == OPT_NORMAL) {
+ if (wmPtr->flags & WM_TRANSIENT_WITHDRAWN) {
+ wmPtr->flags &= ~WM_TRANSIENT_WITHDRAWN;
}
- if (winPtr->flags & TK_EMBEDDED) {
- Tcl_AppendResult(interp, "can't change state of ",
- winPtr->pathName, ": it is an embedded window",
+ TkpWmSetState(winPtr, NormalState);
+ /*
+ * This varies from 'wm deiconify' because it does not
+ * force the window to be raised and receive focus
+ */
+ } else if (index == OPT_ICONIC) {
+ if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": override-redirect flag is set",
(char *) NULL);
return TCL_ERROR;
}
-
- c = argv[3][0];
- length = strlen(argv[3]);
-
- if ((c == 'n') && (strncmp(argv[3], "normal", length) == 0)) {
- TkpWmSetState(winPtr, NormalState);
- /*
- * This varies from 'wm deiconify' because it does not
- * force the window to be raised and receive focus
- */
- } else if ((c == 'i')
- && (strncmp(argv[3], "iconic", length) == 0)) {
- if (Tk_Attributes((Tk_Window) winPtr)->override_redirect) {
- Tcl_AppendResult(interp, "can't iconify \"",
- winPtr->pathName,
- "\": override-redirect flag is set",
- (char *) NULL);
- return TCL_ERROR;
- }
- if (wmPtr->masterPtr != NULL) {
- Tcl_AppendResult(interp, "can't iconify \"",
- winPtr->pathName,
- "\": it is a transient", (char *) NULL);
- return TCL_ERROR;
- }
- TkpWmSetState(winPtr, IconicState);
- } else if ((c == 'w')
- && (strncmp(argv[3], "withdrawn", length) == 0)) {
- TkpWmSetState(winPtr, WithdrawnState);
- } else if ((c == 'z')
- && (strncmp(argv[3], "zoomed", length) == 0)) {
- TkpWmSetState(winPtr, ZoomState);
- } else {
- Tcl_AppendResult(interp, "bad argument \"", argv[3],
- "\": must be normal, iconic, withdrawn or zoomed",
- (char *) NULL);
+ if (wmPtr->masterPtr != NULL) {
+ Tcl_AppendResult(interp, "can't iconify \"",
+ winPtr->pathName,
+ "\": it is a transient", (char *) NULL);
return TCL_ERROR;
}
- } else {
- if (wmPtr->iconFor != NULL) {
- Tcl_SetResult(interp, "icon", TCL_STATIC);
- } else {
- switch (wmPtr->hints.initial_state) {
- case NormalState:
- Tcl_SetResult(interp, "normal", TCL_STATIC);
- break;
- case IconicState:
- Tcl_SetResult(interp, "iconic", TCL_STATIC);
- break;
- case WithdrawnState:
- Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
- break;
- case ZoomState:
- Tcl_SetResult(interp, "zoomed", TCL_STATIC);
- break;
- }
+ TkpWmSetState(winPtr, IconicState);
+ } else if (index == OPT_WITHDRAWN) {
+ if (wmPtr->masterPtr != NULL) {
+ wmPtr->flags |= WM_TRANSIENT_WITHDRAWN;
}
+ TkpWmSetState(winPtr, WithdrawnState);
+ } else { /* OPT_ZOOMED */
+ TkpWmSetState(winPtr, ZoomState);
}
- } else if ((c == 't') && (strncmp(argv[1], "title", length) == 0)
- && (length >= 2)) {
- if (argc > 4) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " title window ?newTitle?\"", (char *) NULL);
- return TCL_ERROR;
- }
- if (argc == 3) {
- Tcl_SetResult(interp, ((wmPtr->titleUid != NULL) ?
- wmPtr->titleUid : winPtr->nameUid), TCL_STATIC);
- return TCL_OK;
+ } else {
+ if (wmPtr->iconFor != NULL) {
+ Tcl_SetResult(interp, "icon", TCL_STATIC);
} else {
- wmPtr->titleUid = Tk_GetUid(argv[3]);
- if (!(wmPtr->flags & WM_NEVER_MAPPED) && wmPtr->wrapper != NULL) {
- Tcl_DString titleString;
- Tcl_UtfToExternalDString(NULL, wmPtr->titleUid, -1,
- &titleString);
- SetWindowText(wmPtr->wrapper, Tcl_DStringValue(&titleString));
- Tcl_DStringFree(&titleString);
+ switch (wmPtr->hints.initial_state) {
+ case NormalState:
+ Tcl_SetResult(interp, "normal", TCL_STATIC);
+ break;
+ case IconicState:
+ Tcl_SetResult(interp, "iconic", TCL_STATIC);
+ break;
+ case WithdrawnState:
+ Tcl_SetResult(interp, "withdrawn", TCL_STATIC);
+ break;
+ case ZoomState:
+ Tcl_SetResult(interp, "zoomed", TCL_STATIC);
+ break;
}
}
- } else if ((c == 't') && (strncmp(argv[1], "transient", length) == 0)
- && (length >= 3)) {
- TkWindow *masterPtr = wmPtr->masterPtr;
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTitleCmd --
+ *
+ * This procedure is invoked to process the "wm title" Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
- if ((argc != 3) && (argc != 4)) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " transient window ?master?\"", (char *) NULL);
- return TCL_ERROR;
+static int
+WmTitleCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ char *argv3;
+ int length;
+
+ if (objc > 4) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?newTitle?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ Tcl_SetResult(interp, (char *)
+ ((wmPtr->title != NULL) ? wmPtr->title : winPtr->nameUid),
+ TCL_STATIC);
+ return TCL_OK;
+ } else {
+ if (wmPtr->title != NULL) {
+ ckfree((char *) wmPtr->title);
}
- if (argc == 3) {
- if (masterPtr != NULL) {
- Tcl_SetResult(interp, Tk_PathName(masterPtr), TCL_STATIC);
- }
- return TCL_OK;
+ argv3 = Tcl_GetStringFromObj(objv[3], &length);
+ wmPtr->title = ckalloc((unsigned) (length + 1));
+ strcpy(wmPtr->title, argv3);
+
+ if (!(wmPtr->flags & WM_NEVER_MAPPED) && wmPtr->wrapper != NULL) {
+ Tcl_DString titleString;
+ Tcl_WinUtfToTChar(wmPtr->title, -1, &titleString);
+ (*tkWinProcs->setWindowText)(wmPtr->wrapper,
+ (LPCTSTR) Tcl_DStringValue(&titleString));
+ Tcl_DStringFree(&titleString);
}
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmTransientCmd --
+ *
+ * This procedure is invoked to process the "wm transient" 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
+WmTransientCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+ TkWindow *masterPtr = wmPtr->masterPtr;
+ WmInfo *wmPtr2;
+
+ if ((objc != 3) && (objc != 4)) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window ?master?");
+ return TCL_ERROR;
+ }
+ if (objc == 3) {
+ if (masterPtr != NULL) {
+ Tcl_SetResult(interp, Tk_PathName(masterPtr), TCL_STATIC);
+ }
+ return TCL_OK;
+ }
+ if (Tcl_GetString(objv[3])[0] == '\0') {
if (masterPtr != NULL) {
/*
* If we had a master, tell them that we aren't tied
* to them anymore
*/
+
masterPtr->wmInfoPtr->numTransients--;
Tk_DeleteEventHandler((Tk_Window) masterPtr,
- VisibilityChangeMask,
- WmWaitVisibilityProc, (ClientData) winPtr);
+ VisibilityChangeMask|StructureNotifyMask,
+ WmWaitVisibilityOrMapProc, (ClientData) winPtr);
}
- if (argv[3][0] == '\0') {
- wmPtr->masterPtr = NULL;
- } else {
- masterPtr = (TkWindow*) Tk_NameToWindow(interp, argv[3], tkwin);
- if (masterPtr == NULL) {
- return TCL_ERROR;
- }
- if (masterPtr == winPtr) {
- wmPtr->masterPtr = NULL;
- } else if (masterPtr != wmPtr->masterPtr) {
- Tk_MakeWindowExist((Tk_Window)masterPtr);
- /*
- * Ensure that the master window is actually a Tk toplevel.
- */
-
- while (!(masterPtr->flags & TK_TOP_LEVEL)) {
- masterPtr = masterPtr->parentPtr;
- }
- wmPtr->masterPtr = masterPtr;
- masterPtr->wmInfoPtr->numTransients++;
-
- /*
- * Bind a visibility event handler to the master window,
- * to ensure that when it is mapped, the children will
- * have their state set properly.
- */
+ wmPtr->masterPtr = NULL;
+ } else {
+ if (TkGetWindowFromObj(interp, tkwin, objv[3],
+ (Tk_Window *) &masterPtr) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ while (!Tk_TopWinHierarchy(masterPtr)) {
+ /*
+ * Ensure that the master window is actually a Tk toplevel.
+ */
- Tk_CreateEventHandler((Tk_Window) masterPtr,
- VisibilityChangeMask,
- WmWaitVisibilityProc, (ClientData) winPtr);
- }
+ masterPtr = masterPtr->parentPtr;
}
- if (!((wmPtr->flags & WM_NEVER_MAPPED)
- && !(winPtr->flags & TK_EMBEDDED))) {
- UpdateWrapper(winPtr);
+ Tk_MakeWindowExist((Tk_Window) masterPtr);
+
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[2]),
+ "\" a transient: it is an icon for ",
+ Tk_PathName(wmPtr->iconFor),
+ (char *) NULL);
+ return TCL_ERROR;
}
- } else if ((c == 'w') && (strncmp(argv[1], "withdraw", length) == 0)) {
- if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # arguments: must be \"",
- argv[0], " withdraw window\"", (char *) NULL);
+
+ wmPtr2 = masterPtr->wmInfoPtr;
+
+ if (wmPtr2->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't make \"",
+ Tcl_GetString(objv[3]),
+ "\" a master: it is an icon for ",
+ Tk_PathName(wmPtr2->iconFor),
+ (char *) NULL);
return TCL_ERROR;
}
- if (wmPtr->iconFor != NULL) {
- Tcl_AppendResult(interp, "can't withdraw ", argv[2],
- ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
+
+ if (masterPtr == winPtr) {
+ Tcl_AppendResult(interp, "can't make \"", Tk_PathName(winPtr),
+ "\" its own master",
(char *) NULL);
return TCL_ERROR;
+ } else if (masterPtr != wmPtr->masterPtr) {
+ /*
+ * Remove old master map/unmap binding before setting
+ * the new master. The event handler will ensure that
+ * transient states reflect the state of the master.
+ */
+
+ if (wmPtr->masterPtr != NULL) {
+ wmPtr->masterPtr->wmInfoPtr->numTransients--;
+ Tk_DeleteEventHandler((Tk_Window) wmPtr->masterPtr,
+ VisibilityChangeMask|StructureNotifyMask,
+ WmWaitVisibilityOrMapProc, (ClientData) winPtr);
+ }
+
+ masterPtr->wmInfoPtr->numTransients++;
+ Tk_CreateEventHandler((Tk_Window) masterPtr,
+ VisibilityChangeMask|StructureNotifyMask,
+ WmWaitVisibilityOrMapProc, (ClientData) winPtr);
+
+ wmPtr->masterPtr = masterPtr;
}
- TkpWmSetState(winPtr, WithdrawnState);
- } else {
- Tcl_AppendResult(interp, "unknown or ambiguous option \"", argv[1],
- "\": must be aspect, client, command, deiconify, ",
- "focusmodel, frame, geometry, grid, group, iconbitmap, ",
- "iconify, iconmask, iconname, iconposition, ",
- "iconwindow, maxsize, minsize, overrideredirect, ",
- "positionfrom, protocol, resizable, sizefrom, state, title, ",
- "transient, or withdraw",
+ }
+ if (!((wmPtr->flags & WM_NEVER_MAPPED)
+ && !(winPtr->flags & TK_EMBEDDED))) {
+ if (wmPtr->masterPtr != NULL &&
+ !Tk_IsMapped(wmPtr->masterPtr)) {
+ TkpWmSetState(winPtr, WithdrawnState);
+ } else {
+ UpdateWrapper(winPtr);
+ }
+ }
+ return TCL_OK;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * WmWithdrawCmd --
+ *
+ * This procedure is invoked to process the "wm withdraw" 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
+WmWithdrawCmd(tkwin, winPtr, interp, objc, objv)
+ Tk_Window tkwin; /* Main window of the application. */
+ TkWindow *winPtr; /* Toplevel to work with */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
+{
+ register WmInfo *wmPtr = winPtr->wmInfoPtr;
+
+ if (objc != 3) {
+ Tcl_WrongNumArgs(interp, 2, objv, "window");
+ return TCL_ERROR;
+ }
+ if (wmPtr->iconFor != NULL) {
+ Tcl_AppendResult(interp, "can't withdraw ", Tcl_GetString(objv[2]),
+ ": it is an icon for ", Tk_PathName(wmPtr->iconFor),
(char *) NULL);
return TCL_ERROR;
}
+ if (wmPtr->masterPtr != NULL) {
+ wmPtr->flags |= WM_TRANSIENT_WITHDRAWN;
+ }
+ TkpWmSetState(winPtr, WithdrawnState);
return TCL_OK;
+}
- updateGeom:
+/*
+ * Invoked by those wm subcommands that affect geometry.
+ * Schedules a geometry update.
+ */
+static void
+WmUpdateGeom(wmPtr, winPtr)
+ WmInfo *wmPtr;
+ TkWindow *winPtr;
+{
if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) {
Tcl_DoWhenIdle(UpdateGeometryInfo, (ClientData) winPtr);
wmPtr->flags |= WM_UPDATE_PENDING;
}
- return TCL_OK;
}
+
/*ARGSUSED*/
static void
-WmWaitVisibilityProc(clientData, eventPtr)
+WmWaitVisibilityOrMapProc(clientData, eventPtr)
ClientData clientData; /* Pointer to window. */
XEvent *eventPtr; /* Information about event. */
{
TkWindow *winPtr = (TkWindow *) clientData;
TkWindow *masterPtr = winPtr->wmInfoPtr->masterPtr;
- if ((eventPtr->type == VisibilityNotify) && (masterPtr != NULL)) {
+ if (masterPtr == NULL)
+ return;
+
+ if (eventPtr->type == MapNotify) {
+ if (!(winPtr->wmInfoPtr->flags & WM_TRANSIENT_WITHDRAWN))
+ TkpWmSetState(winPtr, NormalState);
+ } else if (eventPtr->type == UnmapNotify) {
+ TkpWmSetState(winPtr, WithdrawnState);
+ }
+
+ if (eventPtr->type == VisibilityNotify) {
int state = masterPtr->wmInfoPtr->hints.initial_state;
if ((state == NormalState) || (state == ZoomState)) {
@@ -2391,10 +4784,13 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
if ((wmPtr->gridWin != NULL) && (wmPtr->gridWin != tkwin)) {
return;
@@ -2426,7 +4822,7 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
wmPtr->height = -1;
}
- /*
+ /*
* Set the new gridding information, and start the process of passing
* all of this information to the window manager.
*/
@@ -2475,10 +4871,14 @@ Tk_UnsetGrid(tkwin)
* information.
*/
- while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ while (!(winPtr->flags & TK_TOP_HIERARCHY)) {
winPtr = winPtr->parentPtr;
}
wmPtr = winPtr->wmInfoPtr;
+ if (wmPtr == NULL) {
+ return;
+ }
+
if (tkwin != wmPtr->gridWin) {
return;
}
@@ -2536,7 +4936,7 @@ TopLevelEventProc(clientData, eventPtr)
* Tk_DestroyWindow will try to destroy the window, but of course
* it's already gone.
*/
-
+
handler = Tk_CreateErrorHandler(winPtr->display, -1, -1, -1,
(Tk_ErrorProc *) NULL, (ClientData) NULL);
Tk_DestroyWindow((Tk_Window) winPtr);
@@ -2583,7 +4983,7 @@ TopLevelReqProc(dummy, tkwin)
WmInfo *wmPtr;
wmPtr = winPtr->wmInfoPtr;
- if (winPtr->flags & TK_EMBEDDED) {
+ if ((winPtr->flags & TK_EMBEDDED) && (wmPtr->wrapper != NULL)) {
SendMessage(wmPtr->wrapper, TK_GEOMETRYREQ, Tk_ReqWidth(tkwin),
Tk_ReqHeight(tkwin));
}
@@ -2741,7 +5141,7 @@ UpdateGeometryInfo(clientData)
wmPtr->configWidth = width;
wmPtr->configHeight = height;
-
+
/*
* Don't bother moving the window if we are in the process of
* creating it. Just update the geometry info based on what
@@ -2808,7 +5208,7 @@ UpdateGeometryInfo(clientData)
GetClientRect(wmPtr->wrapper, &windowRect);
newHeight = windowRect.bottom - windowRect.top;
-
+
if (newHeight == height) {
/*
* We're done.
@@ -3209,7 +5609,7 @@ TkWmProtocolEventProc(winPtr, eventPtr)
* Cache atom name, as we might destroy the window as a
* result of the eval.
*/
- char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol);
+ CONST char *name = Tk_GetAtomName((Tk_Window) winPtr, protocol);
Tcl_Preserve((ClientData) protPtr);
interp = protPtr->interp;
@@ -3240,6 +5640,173 @@ TkWmProtocolEventProc(winPtr, eventPtr)
/*
*----------------------------------------------------------------------
*
+ * TkWmStackorderToplevelEnumProc --
+ *
+ * This procedure is invoked once for each HWND Window on the
+ * display as a result of calling EnumWindows from
+ * TkWmStackorderToplevel.
+ *
+ * Results:
+ * TRUE to request further iteration.
+ *
+ * Side effects:
+ * Adds entries to the passed array of TkWindows.
+ *
+ *----------------------------------------------------------------------
+ */
+
+BOOL CALLBACK TkWmStackorderToplevelEnumProc(hwnd, lParam)
+ HWND hwnd; /* handle to parent window */
+ LPARAM lParam; /* application-defined value */
+{
+ Tcl_HashEntry *hPtr;
+ TkWindow *childWinPtr;
+
+ TkWmStackorderToplevelPair *pair =
+ (TkWmStackorderToplevelPair *) lParam;
+
+ /*fprintf(stderr, "Looking up HWND %d\n", hwnd);*/
+
+ hPtr = Tcl_FindHashEntry(pair->table, (char *) hwnd);
+ if (hPtr != NULL) {
+ childWinPtr = (TkWindow *) Tcl_GetHashValue(hPtr);
+ /* Double check that same HWND does not get passed twice */
+ if (childWinPtr == NULL) {
+ panic("duplicate HWND in TkWmStackorderToplevelEnumProc");
+ } else {
+ Tcl_SetHashValue(hPtr, NULL);
+ }
+ /*fprintf(stderr, "Found mapped HWND %d -> %x (%s)\n", hwnd,
+ childWinPtr, childWinPtr->pathName);*/
+ *(pair->window_ptr)-- = childWinPtr;
+ }
+ return TRUE;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmStackorderToplevelWrapperMap --
+ *
+ * This procedure will create a table that maps the wrapper
+ * HWND id for a toplevel to the TkWindow structure that is wraps.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Adds entries to the passed hashtable.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+TkWmStackorderToplevelWrapperMap(winPtr, table)
+ TkWindow *winPtr; /* TkWindow to recurse on */
+ Tcl_HashTable *table; /* Table to maps HWND to TkWindow */
+{
+ TkWindow *childPtr;
+ Tcl_HashEntry *hPtr;
+ HWND wrapper;
+ int newEntry;
+
+ if (Tk_IsMapped(winPtr) && Tk_IsTopLevel(winPtr) &&
+ !Tk_IsEmbedded(winPtr)) {
+ wrapper = TkWinGetWrapperWindow((Tk_Window) winPtr);
+
+ /*fprintf(stderr, "Mapped HWND %d to %x (%s)\n", wrapper,
+ winPtr, winPtr->pathName);*/
+
+ hPtr = Tcl_CreateHashEntry(table,
+ (char *) wrapper, &newEntry);
+ Tcl_SetHashValue(hPtr, winPtr);
+ }
+
+ for (childPtr = winPtr->childList; childPtr != NULL;
+ childPtr = childPtr->nextPtr) {
+ TkWmStackorderToplevelWrapperMap(childPtr, table);
+ }
+}
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWmStackorderToplevel --
+ *
+ * This procedure returns the stack order of toplevel windows.
+ *
+ * Results:
+ * An array of pointers to tk window objects in stacking order
+ * or else NULL if there was an error.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+TkWindow **
+TkWmStackorderToplevel(parentPtr)
+ TkWindow *parentPtr; /* Parent toplevel window. */
+{
+ TkWmStackorderToplevelPair pair;
+ TkWindow **windows;
+ Tcl_HashTable table;
+ Tcl_HashEntry *hPtr;
+ Tcl_HashSearch search;
+
+ /*
+ * Map HWND ids to a TkWindow of the wrapped toplevel.
+ */
+
+ Tcl_InitHashTable(&table, TCL_ONE_WORD_KEYS);
+ TkWmStackorderToplevelWrapperMap(parentPtr, &table);
+
+ windows = (TkWindow **) ckalloc((table.numEntries+1)
+ * sizeof(TkWindow *));
+
+ /*
+ * Special cases: If zero or one toplevels were mapped
+ * there is no need to call EnumWindows.
+ */
+
+ switch (table.numEntries) {
+ case 0:
+ windows[0] = NULL;
+ goto done;
+ case 1:
+ hPtr = Tcl_FirstHashEntry(&table, &search);
+ windows[0] = (TkWindow *) Tcl_GetHashValue(hPtr);
+ windows[1] = NULL;
+ goto done;
+ }
+
+ /*
+ * We will be inserting into the array starting at the end
+ * and working our way to the beginning since EnumWindows
+ * returns windows in highest to lowest order.
+ */
+
+ pair.table = &table;
+ pair.window_ptr = windows + table.numEntries;
+ *pair.window_ptr-- = NULL;
+
+ if (EnumWindows((WNDENUMPROC) TkWmStackorderToplevelEnumProc,
+ (LPARAM) &pair) == 0) {
+ ckfree((char *) windows);
+ windows = NULL;
+ } else {
+ if (pair.window_ptr != (windows-1))
+ panic("num matched toplevel windows does not equal num children");
+ }
+
+ done:
+ Tcl_DeleteHashTable(&table);
+ return windows;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkWmRestackToplevel --
*
* This procedure restacks a top-level window.
@@ -3340,10 +5907,14 @@ TkWmAddToColormapWindows(winPtr)
return;
}
- if (topPtr->flags & TK_TOP_LEVEL) {
+ if (topPtr->flags & TK_TOP_HIERARCHY) {
break;
}
}
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
if (topPtr->wmInfoPtr->flags & WM_COLORMAPS_EXPLICIT) {
return;
}
@@ -3447,6 +6018,10 @@ TkWmRemoveFromColormapWindows(winPtr)
return;
}
+ if (topPtr->wmInfoPtr == NULL) {
+ return;
+ }
+
/*
* Find the window and slide the following ones down to cover
* it up.
@@ -3535,7 +6110,7 @@ ConfigureTopLevel(pos)
int state; /* Current window state. */
RECT rect;
WINDOWPLACEMENT windowPos;
-
+
if (winPtr == NULL) {
return;
}
@@ -3626,7 +6201,7 @@ ConfigureTopLevel(pos)
if (state == NormalState) {
- /*
+ /*
* Update size information from the event. There are a couple of
* tricky points here:
*
@@ -3689,9 +6264,9 @@ ConfigureTopLevel(pos)
wmPtr->flags &= ~(WM_NEGATIVE_X | WM_NEGATIVE_Y);
}
}
-
+
/*
- * Update the wrapper window location information.
+ * Update the wrapper window location information.
*/
if (wmPtr->flags & WM_NEGATIVE_X) {
@@ -3784,9 +6359,9 @@ InstallColormaps(hwnd, message, isForemost)
HPALETTE oldPalette;
TkWindow *winPtr = GetTopLevel(hwnd);
WmInfo *wmPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
-
+
if (winPtr == NULL) {
return 0;
}
@@ -3946,10 +6521,10 @@ InvalidateSubTree(winPtr, colormap)
childPtr = childPtr->nextPtr) {
/*
* We can stop the descent when we hit an unmapped or
- * toplevel window.
+ * toplevel window.
*/
- if (!Tk_IsTopLevel(childPtr) && Tk_IsMapped(childPtr)) {
+ if (!Tk_TopWinHierarchy(childPtr) && Tk_IsMapped(childPtr)) {
InvalidateSubTree(childPtr, colormap);
}
}
@@ -3975,7 +6550,7 @@ InvalidateSubTree(winPtr, colormap)
HPALETTE
TkWinGetSystemPalette()
{
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
return tsdPtr->systemPalette;
@@ -4150,7 +6725,7 @@ TopLevelProc(hwnd, message, wParam, lParam)
if (message == WM_WINDOWPOSCHANGED) {
WINDOWPOS *pos = (WINDOWPOS *) lParam;
TkWindow *winPtr = (TkWindow *) Tk_HWNDToWindow(pos->hwnd);
-
+
if (winPtr == NULL) {
return 0;
}
@@ -4201,7 +6776,7 @@ WmProc(hwnd, message, wParam, lParam)
LPARAM lParam;
{
static int inMoveSize = 0;
- static oldMode; /* This static is set upon entering move/size mode
+ static int oldMode; /* This static is set upon entering move/size mode
* and is used to reset the service mode after
* leaving move/size mode. Note that this mechanism
* assumes move/size is only one level deep. */
@@ -4240,7 +6815,7 @@ WmProc(hwnd, message, wParam, lParam)
}
break;
- case WM_GETMINMAXINFO:
+ case WM_GETMINMAXINFO:
SetLimits(hwnd, (MINMAXINFO *) lParam);
result = 0;
goto done;
@@ -4253,7 +6828,7 @@ WmProc(hwnd, message, wParam, lParam)
case WM_QUERYNEWPALETTE:
result = InstallColormaps(hwnd, WM_QUERYNEWPALETTE, TRUE);
goto done;
-
+
case WM_WINDOWPOSCHANGED:
ConfigureTopLevel((WINDOWPOS *) lParam);
result = 0;
@@ -4285,7 +6860,8 @@ WmProc(hwnd, message, wParam, lParam)
* This allows us to pass the message onto the
* native menus [Bug: 2272]
*/
- result = DefWindowProc(hwnd, message, wParam, lParam);
+ result = (*tkWinProcs->defWindowProc)(hwnd, message,
+ wParam, lParam);
goto done;
}
@@ -4296,7 +6872,7 @@ WmProc(hwnd, message, wParam, lParam)
* handle the mouse event.
*/
- if (winPtr) {
+ if (winPtr) {
eventPtr = (ActivateEvent *)ckalloc(sizeof(ActivateEvent));
eventPtr->ev.proc = ActivateWindow;
eventPtr->winPtr = winPtr;
@@ -4318,10 +6894,11 @@ WmProc(hwnd, message, wParam, lParam)
result = 0;
} else if (!Tk_TranslateWinEvent(child, message, wParam, lParam,
&result)) {
- result = DefWindowProc(hwnd, message, wParam, lParam);
+ result = (*tkWinProcs->defWindowProc)(hwnd, message,
+ wParam, lParam);
}
} else {
- result = DefWindowProc(hwnd, message, wParam, lParam);
+ result = (*tkWinProcs->defWindowProc)(hwnd, message, wParam, lParam);
}
done:
@@ -4364,13 +6941,13 @@ TkpMakeMenuWindow(tkwin, transient)
atts.override_redirect = False;
atts.save_under = False;
}
-
+
if ((atts.override_redirect != Tk_Attributes(tkwin)->override_redirect)
|| (atts.save_under != Tk_Attributes(tkwin)->save_under)) {
Tk_ChangeWindowAttributes(tkwin,
CWOverrideRedirect|CWSaveUnder, &atts);
}
-
+
}
/*
@@ -4425,7 +7002,7 @@ TkWmFocusToplevel(winPtr)
TkWindow *winPtr; /* Window that received a focus-related
* event. */
{
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!(winPtr->flags & TK_TOP_HIERARCHY)) {
return NULL;
}
return winPtr;
@@ -4455,7 +7032,7 @@ TkpGetWrapperWindow(
TkWindow *winPtr) /* Window that received a focus-related
* event. */
{
- if (!(winPtr->flags & TK_TOP_LEVEL)) {
+ if (!(winPtr->flags & TK_TOP_HIERARCHY)) {
return NULL;
}
return winPtr;
@@ -4497,7 +7074,7 @@ ActivateWindow(
if (winPtr && (TkGrabState(winPtr) != TK_GRAB_EXCLUDED)) {
SetFocus(Tk_GetHWND(winPtr->window));
}
-
+
return 1;
}
@@ -4525,7 +7102,7 @@ TkWinSetForegroundWindow(winPtr)
TkWindow *winPtr;
{
register WmInfo *wmPtr = winPtr->wmInfoPtr;
-
+
if (wmPtr->wrapper != NULL) {
SetForegroundWindow(wmPtr->wrapper);
} else {
diff --git a/tk/win/tkWinX.c b/tk/win/tkWinX.c
index aed6113e888..93c305dc78e 100644
--- a/tk/win/tkWinX.c
+++ b/tk/win/tkWinX.c
@@ -16,12 +16,62 @@
#include "tkWinInt.h"
/*
+ * The w32api 1.1 package (included in Mingw 1.1) does not define _WIN32_IE
+ * by default. Define it here to gain access to the InitCommonControlsEx API
+ * in commctrl.h.
+ */
+
+#ifndef _WIN32_IE
+#define _WIN32_IE 0x0300
+#endif
+
+#include <commctrl.h>
+
+/*
* The zmouse.h file includes the definition for WM_MOUSEWHEEL.
*/
#include <zmouse.h>
/*
+ * imm.h is needed by HandleIMEComposition
+ */
+
+#include <imm.h>
+
+static TkWinProcs asciiProcs = {
+ 0,
+
+ (LRESULT (WINAPI *)(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg,
+ WPARAM wParam, LPARAM lParam)) CallWindowProcA,
+ (LRESULT (WINAPI *)(HWND hWnd, UINT Msg, WPARAM wParam,
+ LPARAM lParam)) DefWindowProcA,
+ (ATOM (WINAPI *)(CONST WNDCLASS *lpWndClass)) RegisterClassA,
+ (BOOL (WINAPI *)(HWND hWnd, LPCTSTR lpString)) SetWindowTextA,
+ (HWND (WINAPI *)(DWORD dwExStyle, LPCTSTR lpClassName,
+ LPCTSTR lpWindowName, DWORD dwStyle, int x, int y,
+ int nWidth, int nHeight, HWND hWndParent, HMENU hMenu,
+ HINSTANCE hInstance, LPVOID lpParam)) CreateWindowExA,
+};
+
+static TkWinProcs unicodeProcs = {
+ 1,
+
+ (LRESULT (WINAPI *)(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg,
+ WPARAM wParam, LPARAM lParam)) CallWindowProcW,
+ (LRESULT (WINAPI *)(HWND hWnd, UINT Msg, WPARAM wParam,
+ LPARAM lParam)) DefWindowProcW,
+ (ATOM (WINAPI *)(CONST WNDCLASS *lpWndClass)) RegisterClassW,
+ (BOOL (WINAPI *)(HWND hWnd, LPCTSTR lpString)) SetWindowTextW,
+ (HWND (WINAPI *)(DWORD dwExStyle, LPCTSTR lpClassName,
+ LPCTSTR lpWindowName, DWORD dwStyle, int x, int y,
+ int nWidth, int nHeight, HWND hWndParent, HMENU hMenu,
+ HINSTANCE hInstance, LPVOID lpParam)) CreateWindowExW,
+};
+
+TkWinProcs *tkWinProcs;
+
+/*
* Declarations of static variables used in this file.
*/
@@ -29,9 +79,12 @@ static char winScreenName[] = ":0"; /* Default name of windows display. */
static HINSTANCE tkInstance; /* Application instance handle. */
static int childClassInitialized; /* Registered child class? */
static WNDCLASS childClass; /* Window class for child windows. */
-static int tkPlatformId; /* version of Windows platform */
-
-TCL_DECLARE_MUTEX(winXMutex)
+static int tkPlatformId = 0; /* version of Windows platform */
+static Tcl_Encoding keyInputEncoding = NULL;/* The current character
+ * encoding for keyboard input */
+static int keyInputCharset = -1; /* The Win32 CHARSET for the keyboard
+ * encoding */
+static Tcl_Encoding unicodeEncoding = NULL; /* unicode encoding */
/*
* Thread local storage. Notice that now each thread must have its
@@ -54,6 +107,9 @@ static void GenerateXEvent _ANSI_ARGS_((HWND hwnd, UINT message,
static unsigned int GetState _ANSI_ARGS_((UINT message, WPARAM wParam,
LPARAM lParam));
static void GetTranslatedKey _ANSI_ARGS_((XKeyEvent *xkey));
+static void UpdateInputLanguage _ANSI_ARGS_((int charset));
+static int HandleIMEComposition _ANSI_ARGS_((HWND hwnd,
+ LPARAM lParam));
/*
*----------------------------------------------------------------------
@@ -85,8 +141,14 @@ TkGetServerInfo(interp, tkwin)
os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&os);
- sprintf(buffer, "Windows %d.%d %d Win32", os.dwMajorVersion,
- os.dwMinorVersion, os.dwBuildNumber);
+ sprintf(buffer, "Windows %d.%d %d %s", os.dwMajorVersion,
+ os.dwMinorVersion, os.dwBuildNumber,
+#ifdef _WIN64
+ "Win64"
+#else
+ "Win32"
+#endif
+ );
Tcl_SetResult(interp, buffer, TCL_VOLATILE);
}
@@ -132,18 +194,27 @@ void
TkWinXInit(hInstance)
HINSTANCE hInstance;
{
- OSVERSIONINFO os;
-
if (childClassInitialized != 0) {
return;
}
childClassInitialized = 1;
- tkInstance = hInstance;
+ if (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT) {
+ /*
+ * This is necessary to enable the use of themeable elements on XP,
+ * so we don't even try and call it for Win9*.
+ */
- os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- GetVersionEx(&os);
- tkPlatformId = os.dwPlatformId;
+ INITCOMMONCONTROLSEX comctl;
+ ZeroMemory(&comctl, sizeof(comctl));
+ (void) InitCommonControlsEx(&comctl);
+
+ tkWinProcs = &unicodeProcs;
+ } else {
+ tkWinProcs = &asciiProcs;
+ }
+
+ tkInstance = hInstance;
/*
* When threads are enabled, we cannot use CLASSDC because
@@ -209,6 +280,11 @@ TkWinXCleanup(hInstance)
UnregisterClass(TK_WIN_CHILD_CLASS_NAME, hInstance);
}
+ if (unicodeEncoding != NULL) {
+ Tcl_FreeEncoding(unicodeEncoding);
+ unicodeEncoding = NULL;
+ }
+
/*
* And let the window manager clean up its own class(es).
*/
@@ -222,7 +298,7 @@ TkWinXCleanup(hInstance)
* TkWinGetPlatformId --
*
* Determines whether running under NT, 95, or Win32s, to allow
- * runtime conditional code.
+ * runtime conditional code. Win32s is no longer supported.
*
* Results:
* The return value is one of:
@@ -239,6 +315,13 @@ TkWinXCleanup(hInstance)
int
TkWinGetPlatformId()
{
+ if (tkPlatformId == 0) {
+ OSVERSIONINFO os;
+
+ os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&os);
+ tkPlatformId = os.dwPlatformId;
+ }
return tkPlatformId;
}
@@ -259,10 +342,10 @@ TkWinGetPlatformId()
*----------------------------------------------------------------------
*/
-char *
+CONST char *
TkGetDefaultScreenName(interp, screenName)
Tcl_Interp *interp; /* Not used. */
- char *screenName; /* If NULL, use default string. */
+ CONST char *screenName; /* If NULL, use default string. */
{
if ((screenName == NULL) || (screenName[0] == '\0')) {
screenName = winScreenName;
@@ -289,7 +372,7 @@ TkGetDefaultScreenName(interp, screenName)
TkDisplay *
TkpOpenDisplay(display_name)
- char *display_name;
+ CONST char *display_name;
{
Screen *screen;
HDC dc;
@@ -308,6 +391,8 @@ TkpOpenDisplay(display_name)
}
display = (Display *) ckalloc(sizeof(Display));
+ ZeroMemory(display, sizeof(Display));
+
display->display_name = (char *) ckalloc(strlen(display_name)+1);
strcpy(display->display_name, display_name);
@@ -339,7 +424,7 @@ TkpOpenDisplay(display_name)
twdPtr->window.winPtr = NULL;
twdPtr->window.handle = NULL;
screen->root = (Window)twdPtr;
-
+
/*
* On windows, when creating a color bitmap, need two pieces of
* information: the number of color planes and the number of
@@ -404,6 +489,7 @@ TkpOpenDisplay(display_name)
screen->cmap = XCreateColormap(display, None, screen->root_visual,
AllocNone);
tsdPtr->winDisplay = (TkDisplay *) ckalloc(sizeof(TkDisplay));
+ ZeroMemory(tsdPtr->winDisplay, sizeof(TkDisplay));
tsdPtr->winDisplay->display = display;
tsdPtr->updatingClipboard = FALSE;
return tsdPtr->winDisplay;
@@ -472,7 +558,6 @@ TkpCloseDisplay(dispPtr)
ckfree((char *) display->screens);
}
ckfree((char *) display);
- ckfree((char *) dispPtr);
}
/*
@@ -526,6 +611,18 @@ TkWinChildProc(hwnd, message, wParam, lParam)
LRESULT result;
switch (message) {
+ case WM_INPUTLANGCHANGE:
+ UpdateInputLanguage(wParam);
+ result = 1;
+ break;
+
+ case WM_IME_COMPOSITION:
+ result = 0;
+ if (HandleIMEComposition(hwnd, lParam) == 0) {
+ result = DefWindowProc(hwnd, message, wParam, lParam);
+ }
+ break;
+
case WM_SETCURSOR:
/*
* Short circuit the WM_SETCURSOR message since we set
@@ -738,6 +835,15 @@ GenerateXEvent(hwnd, message, wParam, lParam)
while (otherWinPtr && !(otherWinPtr->flags & TK_TOP_LEVEL)) {
otherWinPtr = otherWinPtr->parentPtr;
}
+
+ /*
+ * Do a catch-all Tk_SetCaretPos here to make sure that the
+ * window receiving focus sets the caret at least once.
+ */
+ if (message == WM_SETFOCUS) {
+ Tk_SetCaretPos((Tk_Window) winPtr, 0, 0, 0);
+ }
+
if (otherWinPtr == winPtr) {
return;
}
@@ -746,6 +852,14 @@ GenerateXEvent(hwnd, message, wParam, lParam)
event.type = (message == WM_SETFOCUS) ? FocusIn : FocusOut;
event.xfocus.mode = NotifyNormal;
event.xfocus.detail = NotifyNonlinear;
+
+ /*
+ * Destroy the caret if we own it. If we are moving to another Tk
+ * window, it will reclaim and reposition it with Tk_SetCaretPos.
+ */
+ if (message == WM_KILLFOCUS) {
+ DestroyCaret();
+ }
break;
}
@@ -828,13 +942,11 @@ GenerateXEvent(hwnd, message, wParam, lParam)
/*
* Check for translated characters in the event queue.
* Setting xany.send_event to -1 indicates to the
- * Windows implementation of XLookupString that this
+ * Windows implementation of TkpGetString() that this
* event was generated by windows and that the Windows
* extension xkey.trans_chars is filled with the
- * characters that came from the TranslateMessage
- * call. If it is not -1, xkey.keycode is the
- * virtual key being sent programmatically by generic
- * code.
+ * MBCS characters that came from the TranslateMessage
+ * call.
*/
event.type = KeyPress;
@@ -1019,7 +1131,6 @@ GetTranslatedKey(xkey)
XKeyEvent *xkey;
{
MSG msg;
- char buf[XMaxTransChars];
xkey->nbytes = 0;
@@ -1039,9 +1150,21 @@ GetTranslatedKey(xkey)
if ((msg.message == WM_CHAR) && (msg.lParam & 0x20000000)) {
xkey->state = 0;
}
- buf[xkey->nbytes] = (char) msg.wParam;
xkey->trans_chars[xkey->nbytes] = (char) msg.wParam;
xkey->nbytes++;
+
+ if (((unsigned short) msg.wParam) > ((unsigned short) 0xff)) {
+ /*
+ * Some "addon" input devices, such as the popular
+ * PenPower Chinese writing pad, generate 16 bit
+ * values in WM_CHAR messages (instead of passing them
+ * in two separate WM_CHAR messages containing two
+ * 8-bit values.
+ */
+
+ xkey->trans_chars[xkey->nbytes] = (char) (msg.wParam >> 8);
+ xkey->nbytes ++;
+ }
} else {
break;
}
@@ -1051,9 +1174,252 @@ GetTranslatedKey(xkey)
/*
*----------------------------------------------------------------------
*
+ * UpdateInputLanguage --
+ *
+ * Gets called when a WM_INPUTLANGCHANGE message is received
+ * by the TK child window procedure. This message is sent
+ * by the Input Method Editor system when the user chooses
+ * a different input method. All subsequent WM_CHAR
+ * messages will contain characters in the new encoding. We record
+ * the new encoding so that TkpGetString() knows how to
+ * correctly translate the WM_CHAR into unicode.
+ *
+ * Results:
+ * Records the new encoding in keyInputEncoding.
+ *
+ * Side effects:
+ * Old value of keyInputEncoding is freed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+UpdateInputLanguage(charset)
+ int charset;
+{
+ CHARSETINFO charsetInfo;
+ Tcl_Encoding encoding;
+ char codepage[4 + TCL_INTEGER_SPACE];
+
+ if (keyInputCharset == charset) {
+ return;
+ }
+ if (TranslateCharsetInfo((DWORD*)charset, &charsetInfo, TCI_SRCCHARSET)
+ == 0) {
+ /*
+ * Some mysterious failure.
+ */
+
+ return;
+ }
+
+ wsprintfA(codepage, "cp%d", charsetInfo.ciACP);
+
+ if ((encoding = Tcl_GetEncoding(NULL, codepage)) == NULL) {
+ /*
+ * The encoding is not supported by Tcl.
+ */
+
+ return;
+ }
+
+ if (keyInputEncoding != NULL) {
+ Tcl_FreeEncoding(keyInputEncoding);
+ }
+
+ keyInputEncoding = encoding;
+ keyInputCharset = charset;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWinGetKeyInputEncoding --
+ *
+ * Returns the current keyboard input encoding selected by the
+ * user (with WM_INPUTLANGCHANGE events).
+ *
+ * Results:
+ * The current keyboard input encoding.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Encoding
+TkWinGetKeyInputEncoding()
+{
+ return keyInputEncoding;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkWinGetUnicodeEncoding --
+ *
+ * Returns the cached unicode encoding.
+ *
+ * Results:
+ * The unicode encoding.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Tcl_Encoding
+TkWinGetUnicodeEncoding()
+{
+ if (unicodeEncoding == NULL) {
+ unicodeEncoding = Tcl_GetEncoding(NULL, "unicode");
+ }
+ return unicodeEncoding;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HandleIMEComposition --
+ *
+ * This function works around a definciency in some versions
+ * of Windows 2000 to make it possible to entry multi-lingual
+ * characters under all versions of Windows 2000.
+ *
+ * When an Input Method Editor (IME) is ready to send input
+ * characters to an application, it sends a WM_IME_COMPOSITION
+ * message with the GCS_RESULTSTR. However, The DefWindowProc()
+ * on English Windows 2000 arbitrarily converts all non-Latin-1
+ * characters in the composition to "?".
+ *
+ * This function correctly processes the composition data and
+ * sends the UNICODE values of the composed characters to
+ * TK's event queue.
+ *
+ * Results:
+ * If this function has processed the composition data, returns 1.
+ * Otherwise returns 0.
+ *
+ * Side effects:
+ * Key events are put into the TK event queue.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+HandleIMEComposition(hwnd, lParam)
+ HWND hwnd; /* Window receiving the message. */
+ LPARAM lParam; /* Flags for the WM_IME_COMPOSITION
+ * message */
+{
+ HIMC hIMC;
+ int i, n;
+ XEvent event;
+ char * buff;
+ TkWindow *winPtr;
+ Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
+ BOOL isWinNT = (TkWinGetPlatformId() == VER_PLATFORM_WIN32_NT);
+
+ if ((lParam & GCS_RESULTSTR) == 0) {
+ /*
+ * Composition is not finished yet.
+ */
+
+ return 0;
+ }
+
+ hIMC = ImmGetContext(hwnd);
+ if (hIMC) {
+ if (isWinNT) {
+ n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0);
+ } else {
+ n = ImmGetCompositionStringA(hIMC, GCS_RESULTSTR, NULL, 0);
+ }
+
+ if ((n > 0) && ((buff = (char *) ckalloc(n)) != NULL)) {
+ if (isWinNT) {
+ n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, n);
+ } else {
+ Tcl_DString utfString, unicodeString;
+
+ n = ImmGetCompositionStringA(hIMC, GCS_RESULTSTR, buff, n);
+ Tcl_DStringInit(&utfString);
+ Tcl_ExternalToUtfDString(keyInputEncoding, buff, n,
+ &utfString);
+ Tcl_UtfToExternalDString(unicodeEncoding,
+ Tcl_DStringValue(&utfString), -1, &unicodeString);
+ i = Tcl_DStringLength(&unicodeString);
+ if (n < i) {
+ /*
+ * Only alloc more space if we need, otherwise just
+ * use what we've created. Don't realloc as that may
+ * copy data we no longer need.
+ */
+ ckfree((char *) buff);
+ buff = (char *) ckalloc(i);
+ }
+ n = i;
+ memcpy(buff, Tcl_DStringValue(&unicodeString), n);
+ Tcl_DStringFree(&utfString);
+ Tcl_DStringFree(&unicodeString);
+ }
+
+ /*
+ * Set up the fields pertinent to key event.
+ *
+ * We set send_event to the special value of -2, so that
+ * TkpGetString() in tkWinKey.c knows that trans_chars[]
+ * already contains a UNICODE char and there's no need to
+ * do encoding conversion.
+ */
+
+ winPtr = (TkWindow *)Tk_HWNDToWindow(hwnd);
+
+ event.xkey.serial = winPtr->display->request++;
+ event.xkey.send_event = -2;
+ event.xkey.display = winPtr->display;
+ event.xkey.window = winPtr->window;
+ event.xkey.root = RootWindow(winPtr->display, winPtr->screenNum);
+ event.xkey.subwindow = None;
+ event.xkey.state = TkWinGetModifierState();
+ event.xkey.time = TkpGetMS();
+ event.xkey.same_screen = True;
+ event.xkey.keycode = 0;
+ event.xkey.nbytes = 2;
+
+ for (i=0; i<n;) {
+ /*
+ * Simulate a pair of KeyPress and KeyRelease events
+ * for each UNICODE character in the composition.
+ */
+
+ event.xkey.trans_chars[0] = (char) buff[i++];
+ event.xkey.trans_chars[1] = (char) buff[i++];
+
+ event.type = KeyPress;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+
+ event.type = KeyRelease;
+ Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ }
+
+ ckfree(buff);
+ }
+ ImmReleaseContext(hwnd, hIMC);
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* Tk_FreeXId --
*
- * This inteface is not needed under Windows.
+ * This interface is not needed under Windows.
*
* Results:
* None.
@@ -1184,3 +1550,100 @@ TkWinUpdatingClipboard(int mode)
tsdPtr->updatingClipboard = mode;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tk_SetCaretPos --
+ *
+ * This enables correct movement of focus in the MS Magnifier, as well
+ * as allowing us to correctly position the IME Window. The following
+ * Win32 APIs are used to work with MS caret:
+ *
+ * CreateCaret DestroyCaret SetCaretPos GetCaretPos
+ *
+ * Only one instance of caret can be active at any time
+ * (e.g. DestroyCaret API does not take any argument such as handle).
+ * Since do-it-right approach requires to track the create/destroy
+ * caret status all the time in a global scope among windows (or
+ * widgets), we just implement this minimal setup to get the job done.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * Sets the global Windows caret position.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tk_SetCaretPos(Tk_Window tkwin, int x, int y, int height)
+{
+ static HWND caretHWND = NULL;
+ TkCaret *caretPtr = &(((TkWindow *) tkwin)->dispPtr->caret);
+ Window win;
+
+ /*
+ * Prevent processing anything if the values haven't changed.
+ * Windows only has one display, so we can do this with statics.
+ */
+ if ((caretPtr->winPtr == ((TkWindow *) tkwin))
+ && (caretPtr->x == x) && (caretPtr->y == y)) {
+ return;
+ }
+
+ caretPtr->winPtr = ((TkWindow *) tkwin);
+ caretPtr->x = x;
+ caretPtr->y = y;
+ caretPtr->height = height;
+
+ /*
+ * We adjust to the toplevel to get the coords right, as setting
+ * the IME composition window is based on the toplevel hwnd, so
+ * ignore height.
+ */
+
+ while (!Tk_IsTopLevel(tkwin)) {
+ x += Tk_X(tkwin);
+ y += Tk_Y(tkwin);
+ tkwin = Tk_Parent(tkwin);
+ if (tkwin == NULL) {
+ return;
+ }
+ }
+
+ win = Tk_WindowId(tkwin);
+ if (win) {
+ HIMC hIMC;
+ HWND hwnd = Tk_GetHWND(win);
+
+ if (hwnd != caretHWND) {
+ DestroyCaret();
+ if (CreateCaret(hwnd, NULL, 0, 0)) {
+ caretHWND = hwnd;
+ }
+ }
+
+ if (!SetCaretPos(x, y) && CreateCaret(hwnd, NULL, 0, 0)) {
+ caretHWND = hwnd;
+ SetCaretPos(x, y);
+ }
+
+ /*
+ * The IME composition window should be updated whenever the caret
+ * position is changed because a clause of the composition string may
+ * be converted to the final characters and the other clauses still
+ * stay on the composition window. -- yamamoto
+ */
+ hIMC = ImmGetContext(hwnd);
+ if (hIMC) {
+ COMPOSITIONFORM cform;
+ cform.dwStyle = CFS_POINT;
+ cform.ptCurrentPos.x = x;
+ cform.ptCurrentPos.y = y;
+ ImmSetCompositionWindow(hIMC, &cform);
+ ImmReleaseContext(hwnd, hIMC);
+ }
+ }
+}
diff --git a/tk/win/winMain.c b/tk/win/winMain.c
index 8cc6b7773e2..864f28a1286 100644
--- a/tk/win/winMain.c
+++ b/tk/win/winMain.c
@@ -32,17 +32,12 @@
*/
static void setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr));
-static void WishPanic _ANSI_ARGS_(TCL_VARARGS(char *,format));
+static void WishPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format));
#ifdef TK_TEST
extern int Tktest_Init(Tcl_Interp *interp);
#endif /* TK_TEST */
-#ifdef TCL_TEST
-extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp));
-extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
-#endif /* TCL_TEST */
-
static BOOL consoleRequired = TRUE;
/*
@@ -189,17 +184,6 @@ Tcl_AppInit(interp)
}
}
-#ifdef TCL_TEST
- if (Tcltest_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
- Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
- (Tcl_PackageInitProc *) NULL);
- if (TclObjTest_Init(interp) == TCL_ERROR) {
- return TCL_ERROR;
- }
-#endif /* TCL_TEST */
-
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
goto error;
@@ -237,13 +221,13 @@ error:
*/
void
-WishPanic TCL_VARARGS_DEF(char *,arg1)
+WishPanic TCL_VARARGS_DEF(CONST char *,arg1)
{
va_list argList;
char buf[1024];
- char *format;
+ CONST char *format;
- format = TCL_VARARGS_START(char *,arg1,argList);
+ format = TCL_VARARGS_START(CONST char *,arg1,argList);
vsprintf(buf, format, argList);
MessageBeep(MB_ICONEXCLAMATION);
@@ -421,5 +405,3 @@ int main(int argc, char **argv)
return 0;
}
-
-
diff --git a/tk/xlib/X11/X.h b/tk/xlib/X11/X.h
index a7f6566e237..7755cacc4d8 100644
--- a/tk/xlib/X11/X.h
+++ b/tk/xlib/X11/X.h
@@ -33,14 +33,18 @@ SOFTWARE.
#define X_PROTOCOL 11 /* current protocol version */
#define X_PROTOCOL_REVISION 0 /* current minor version */
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
# define Cursor XCursor
# define Region XRegion
#endif
/* Resources */
+#ifdef _WIN64
+typedef __int64 XID;
+#else
typedef unsigned long XID;
+#endif
typedef XID Window;
typedef XID Drawable;
@@ -665,7 +669,7 @@ are reserved in the protocol for errors and replies. */
#define LSBFirst 0
#define MSBFirst 1
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
# undef Cursor
# undef Region
#endif
diff --git a/tk/xlib/X11/Xlib.h b/tk/xlib/X11/Xlib.h
index e8723ddb8f0..252b11d203a 100644
--- a/tk/xlib/X11/Xlib.h
+++ b/tk/xlib/X11/Xlib.h
@@ -27,12 +27,18 @@
#define XlibSpecificationRelease 5
+#if !defined(MAC_TCL) && !defined(MAC_OSX_TK)
+# include <X11/X.h>
+#endif
#ifdef MAC_TCL
# include <X.h>
# define Cursor XCursor
# define Region XRegion
-#else
+#endif
+#ifdef MAC_OSX_TK
# include <X11/X.h>
+# define Cursor XCursor
+# define Region XRegion
#endif
/* applications should not depend on these two headers being included! */
@@ -58,7 +64,8 @@ typedef unsigned long wchar_t;
typedef char *XPointer;
#define Bool int
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
+/* Use define rather than typedef, since may need to undefine this later */
#define Status int
#else
typedef int Status;
@@ -1199,7 +1206,7 @@ _XFUNCPROTOBEGIN
_XFUNCPROTOEND
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
# undef Cursor
# undef Region
#endif
diff --git a/tk/xlib/X11/Xutil.h b/tk/xlib/X11/Xutil.h
index f6c0a36788f..8812c80905c 100644
--- a/tk/xlib/X11/Xutil.h
+++ b/tk/xlib/X11/Xutil.h
@@ -29,7 +29,7 @@ SOFTWARE.
/* You must include <X11/Xlib.h> before including this file */
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
# define Region XRegion
#endif
@@ -848,7 +848,7 @@ extern void XXorRegion(
_XFUNCPROTOEND
-#ifdef MAC_TCL
+#if defined(MAC_TCL) || defined(MAC_OSX_TK)
# undef Region
#endif
diff --git a/tk/xlib/xbytes.h b/tk/xlib/xbytes.h
index bc22e892be1..fb2ee851c43 100644
--- a/tk/xlib/xbytes.h
+++ b/tk/xlib/xbytes.h
@@ -56,4 +56,3 @@ static unsigned char xBitReverseTable[256] = {
};
#endif /* _XBYTES */
-
diff --git a/tk/xlib/xcolors.c b/tk/xlib/xcolors.c
index 85341dfa676..4b06097c410 100644
--- a/tk/xlib/xcolors.c
+++ b/tk/xlib/xcolors.c
@@ -28,759 +28,759 @@ typedef struct {
} XColorEntry;
static XColorEntry xColors[] = {
- "alice blue", 240, 248, 255,
- "AliceBlue", 240, 248, 255,
- "antique white", 250, 235, 215,
- "AntiqueWhite", 250, 235, 215,
- "AntiqueWhite1", 255, 239, 219,
- "AntiqueWhite2", 238, 223, 204,
- "AntiqueWhite3", 205, 192, 176,
- "AntiqueWhite4", 139, 131, 120,
- "aquamarine", 127, 255, 212,
- "aquamarine1", 127, 255, 212,
- "aquamarine2", 118, 238, 198,
- "aquamarine3", 102, 205, 170,
- "aquamarine4", 69, 139, 116,
- "azure", 240, 255, 255,
- "azure1", 240, 255, 255,
- "azure2", 224, 238, 238,
- "azure3", 193, 205, 205,
- "azure4", 131, 139, 139,
- "beige", 245, 245, 220,
- "bisque", 255, 228, 196,
- "bisque1", 255, 228, 196,
- "bisque2", 238, 213, 183,
- "bisque3", 205, 183, 158,
- "bisque4", 139, 125, 107,
- "black", 0, 0, 0,
- "blanched almond", 255, 235, 205,
- "BlanchedAlmond", 255, 235, 205,
- "blue", 0, 0, 255,
- "blue violet", 138, 43, 226,
- "blue1", 0, 0, 255,
- "blue2", 0, 0, 238,
- "blue3", 0, 0, 205,
- "blue4", 0, 0, 139,
- "BlueViolet", 138, 43, 226,
- "brown", 165, 42, 42,
- "brown1", 255, 64, 64,
- "brown2", 238, 59, 59,
- "brown3", 205, 51, 51,
- "brown4", 139, 35, 35,
- "burlywood", 222, 184, 135,
- "burlywood1", 255, 211, 155,
- "burlywood2", 238, 197, 145,
- "burlywood3", 205, 170, 125,
- "burlywood4", 139, 115, 85,
- "cadet blue", 95, 158, 160,
- "CadetBlue", 95, 158, 160,
- "CadetBlue1", 152, 245, 255,
- "CadetBlue2", 142, 229, 238,
- "CadetBlue3", 122, 197, 205,
- "CadetBlue4", 83, 134, 139,
- "chartreuse", 127, 255, 0,
- "chartreuse1", 127, 255, 0,
- "chartreuse2", 118, 238, 0,
- "chartreuse3", 102, 205, 0,
- "chartreuse4", 69, 139, 0,
- "chocolate", 210, 105, 30,
- "chocolate1", 255, 127, 36,
- "chocolate2", 238, 118, 33,
- "chocolate3", 205, 102, 29,
- "chocolate4", 139, 69, 19,
- "coral", 255, 127, 80,
- "coral1", 255, 114, 86,
- "coral2", 238, 106, 80,
- "coral3", 205, 91, 69,
- "coral4", 139, 62, 47,
- "cornflower blue", 100, 149, 237,
- "CornflowerBlue", 100, 149, 237,
- "cornsilk", 255, 248, 220,
- "cornsilk1", 255, 248, 220,
- "cornsilk2", 238, 232, 205,
- "cornsilk3", 205, 200, 177,
- "cornsilk4", 139, 136, 120,
- "cyan", 0, 255, 255,
- "cyan1", 0, 255, 255,
- "cyan2", 0, 238, 238,
- "cyan3", 0, 205, 205,
- "cyan4", 0, 139, 139,
- "dark blue", 0, 0, 139,
- "dark cyan", 0, 139, 139,
- "dark goldenrod", 184, 134, 11,
- "dark gray", 169, 169, 169,
- "dark green", 0, 100, 0,
- "dark grey", 169, 169, 169,
- "dark khaki", 189, 183, 107,
- "dark magenta", 139, 0, 139,
- "dark olive green", 85, 107, 47,
- "dark orange", 255, 140, 0,
- "dark orchid", 153, 50, 204,
- "dark red", 139, 0, 0,
- "dark salmon", 233, 150, 122,
- "dark sea green", 143, 188, 143,
- "dark slate blue", 72, 61, 139,
- "dark slate gray", 47, 79, 79,
- "dark slate grey", 47, 79, 79,
- "dark turquoise", 0, 206, 209,
- "dark violet", 148, 0, 211,
- "DarkBlue", 0, 0, 139,
- "DarkCyan", 0, 139, 139,
- "DarkGoldenrod", 184, 134, 11,
- "DarkGoldenrod1", 255, 185, 15,
- "DarkGoldenrod2", 238, 173, 14,
- "DarkGoldenrod3", 205, 149, 12,
- "DarkGoldenrod4", 139, 101, 8,
- "DarkGray", 169, 169, 169,
- "DarkGreen", 0, 100, 0,
- "DarkGrey", 169, 169, 169,
- "DarkKhaki", 189, 183, 107,
- "DarkMagenta", 139, 0, 139,
- "DarkOliveGreen", 85, 107, 47,
- "DarkOliveGreen1", 202, 255, 112,
- "DarkOliveGreen2", 188, 238, 104,
- "DarkOliveGreen3", 162, 205, 90,
- "DarkOliveGreen4", 110, 139, 61,
- "DarkOrange", 255, 140, 0,
- "DarkOrange1", 255, 127, 0,
- "DarkOrange2", 238, 118, 0,
- "DarkOrange3", 205, 102, 0,
- "DarkOrange4", 139, 69, 0,
- "DarkOrchid", 153, 50, 204,
- "DarkOrchid1", 191, 62, 255,
- "DarkOrchid2", 178, 58, 238,
- "DarkOrchid3", 154, 50, 205,
- "DarkOrchid4", 104, 34, 139,
- "DarkRed", 139, 0, 0,
- "DarkSalmon", 233, 150, 122,
- "DarkSeaGreen", 143, 188, 143,
- "DarkSeaGreen1", 193, 255, 193,
- "DarkSeaGreen2", 180, 238, 180,
- "DarkSeaGreen3", 155, 205, 155,
- "DarkSeaGreen4", 105, 139, 105,
- "DarkSlateBlue", 72, 61, 139,
- "DarkSlateGray", 47, 79, 79,
- "DarkSlateGray1", 151, 255, 255,
- "DarkSlateGray2", 141, 238, 238,
- "DarkSlateGray3", 121, 205, 205,
- "DarkSlateGray4", 82, 139, 139,
- "DarkSlateGrey", 47, 79, 79,
- "DarkTurquoise", 0, 206, 209,
- "DarkViolet", 148, 0, 211,
- "deep pink", 255, 20, 147,
- "deep sky blue", 0, 191, 255,
- "DeepPink", 255, 20, 147,
- "DeepPink1", 255, 20, 147,
- "DeepPink2", 238, 18, 137,
- "DeepPink3", 205, 16, 118,
- "DeepPink4", 139, 10, 80,
- "DeepSkyBlue", 0, 191, 255,
- "DeepSkyBlue1", 0, 191, 255,
- "DeepSkyBlue2", 0, 178, 238,
- "DeepSkyBlue3", 0, 154, 205,
- "DeepSkyBlue4", 0, 104, 139,
- "dim gray", 105, 105, 105,
- "dim grey", 105, 105, 105,
- "DimGray", 105, 105, 105,
- "DimGrey", 105, 105, 105,
- "dodger blue", 30, 144, 255,
- "DodgerBlue", 30, 144, 255,
- "DodgerBlue1", 30, 144, 255,
- "DodgerBlue2", 28, 134, 238,
- "DodgerBlue3", 24, 116, 205,
- "DodgerBlue4", 16, 78, 139,
- "firebrick", 178, 34, 34,
- "firebrick1", 255, 48, 48,
- "firebrick2", 238, 44, 44,
- "firebrick3", 205, 38, 38,
- "firebrick4", 139, 26, 26,
- "floral white", 255, 250, 240,
- "FloralWhite", 255, 250, 240,
- "forest green", 34, 139, 34,
- "ForestGreen", 34, 139, 34,
- "gainsboro", 220, 220, 220,
- "ghost white", 248, 248, 255,
- "GhostWhite", 248, 248, 255,
- "gold", 255, 215, 0,
- "gold1", 255, 215, 0,
- "gold2", 238, 201, 0,
- "gold3", 205, 173, 0,
- "gold4", 139, 117, 0,
- "goldenrod", 218, 165, 32,
- "goldenrod1", 255, 193, 37,
- "goldenrod2", 238, 180, 34,
- "goldenrod3", 205, 155, 29,
- "goldenrod4", 139, 105, 20,
- "gray", 190, 190, 190,
- "gray0", 0, 0, 0,
- "gray1", 3, 3, 3,
- "gray10", 26, 26, 26,
- "gray100", 255, 255, 255,
- "gray11", 28, 28, 28,
- "gray12", 31, 31, 31,
- "gray13", 33, 33, 33,
- "gray14", 36, 36, 36,
- "gray15", 38, 38, 38,
- "gray16", 41, 41, 41,
- "gray17", 43, 43, 43,
- "gray18", 46, 46, 46,
- "gray19", 48, 48, 48,
- "gray2", 5, 5, 5,
- "gray20", 51, 51, 51,
- "gray21", 54, 54, 54,
- "gray22", 56, 56, 56,
- "gray23", 59, 59, 59,
- "gray24", 61, 61, 61,
- "gray25", 64, 64, 64,
- "gray26", 66, 66, 66,
- "gray27", 69, 69, 69,
- "gray28", 71, 71, 71,
- "gray29", 74, 74, 74,
- "gray3", 8, 8, 8,
- "gray30", 77, 77, 77,
- "gray31", 79, 79, 79,
- "gray32", 82, 82, 82,
- "gray33", 84, 84, 84,
- "gray34", 87, 87, 87,
- "gray35", 89, 89, 89,
- "gray36", 92, 92, 92,
- "gray37", 94, 94, 94,
- "gray38", 97, 97, 97,
- "gray39", 99, 99, 99,
- "gray4", 10, 10, 10,
- "gray40", 102, 102, 102,
- "gray41", 105, 105, 105,
- "gray42", 107, 107, 107,
- "gray43", 110, 110, 110,
- "gray44", 112, 112, 112,
- "gray45", 115, 115, 115,
- "gray46", 117, 117, 117,
- "gray47", 120, 120, 120,
- "gray48", 122, 122, 122,
- "gray49", 125, 125, 125,
- "gray5", 13, 13, 13,
- "gray50", 127, 127, 127,
- "gray51", 130, 130, 130,
- "gray52", 133, 133, 133,
- "gray53", 135, 135, 135,
- "gray54", 138, 138, 138,
- "gray55", 140, 140, 140,
- "gray56", 143, 143, 143,
- "gray57", 145, 145, 145,
- "gray58", 148, 148, 148,
- "gray59", 150, 150, 150,
- "gray6", 15, 15, 15,
- "gray60", 153, 153, 153,
- "gray61", 156, 156, 156,
- "gray62", 158, 158, 158,
- "gray63", 161, 161, 161,
- "gray64", 163, 163, 163,
- "gray65", 166, 166, 166,
- "gray66", 168, 168, 168,
- "gray67", 171, 171, 171,
- "gray68", 173, 173, 173,
- "gray69", 176, 176, 176,
- "gray7", 18, 18, 18,
- "gray70", 179, 179, 179,
- "gray71", 181, 181, 181,
- "gray72", 184, 184, 184,
- "gray73", 186, 186, 186,
- "gray74", 189, 189, 189,
- "gray75", 191, 191, 191,
- "gray76", 194, 194, 194,
- "gray77", 196, 196, 196,
- "gray78", 199, 199, 199,
- "gray79", 201, 201, 201,
- "gray8", 20, 20, 20,
- "gray80", 204, 204, 204,
- "gray81", 207, 207, 207,
- "gray82", 209, 209, 209,
- "gray83", 212, 212, 212,
- "gray84", 214, 214, 214,
- "gray85", 217, 217, 217,
- "gray86", 219, 219, 219,
- "gray87", 222, 222, 222,
- "gray88", 224, 224, 224,
- "gray89", 227, 227, 227,
- "gray9", 23, 23, 23,
- "gray90", 229, 229, 229,
- "gray91", 232, 232, 232,
- "gray92", 235, 235, 235,
- "gray93", 237, 237, 237,
- "gray94", 240, 240, 240,
- "gray95", 242, 242, 242,
- "gray96", 245, 245, 245,
- "gray97", 247, 247, 247,
- "gray98", 250, 250, 250,
- "gray99", 252, 252, 252,
- "green", 0, 255, 0,
- "green yellow", 173, 255, 47,
- "green1", 0, 255, 0,
- "green2", 0, 238, 0,
- "green3", 0, 205, 0,
- "green4", 0, 139, 0,
- "GreenYellow", 173, 255, 47,
- "grey", 190, 190, 190,
- "grey0", 0, 0, 0,
- "grey1", 3, 3, 3,
- "grey10", 26, 26, 26,
- "grey100", 255, 255, 255,
- "grey11", 28, 28, 28,
- "grey12", 31, 31, 31,
- "grey13", 33, 33, 33,
- "grey14", 36, 36, 36,
- "grey15", 38, 38, 38,
- "grey16", 41, 41, 41,
- "grey17", 43, 43, 43,
- "grey18", 46, 46, 46,
- "grey19", 48, 48, 48,
- "grey2", 5, 5, 5,
- "grey20", 51, 51, 51,
- "grey21", 54, 54, 54,
- "grey22", 56, 56, 56,
- "grey23", 59, 59, 59,
- "grey24", 61, 61, 61,
- "grey25", 64, 64, 64,
- "grey26", 66, 66, 66,
- "grey27", 69, 69, 69,
- "grey28", 71, 71, 71,
- "grey29", 74, 74, 74,
- "grey3", 8, 8, 8,
- "grey30", 77, 77, 77,
- "grey31", 79, 79, 79,
- "grey32", 82, 82, 82,
- "grey33", 84, 84, 84,
- "grey34", 87, 87, 87,
- "grey35", 89, 89, 89,
- "grey36", 92, 92, 92,
- "grey37", 94, 94, 94,
- "grey38", 97, 97, 97,
- "grey39", 99, 99, 99,
- "grey4", 10, 10, 10,
- "grey40", 102, 102, 102,
- "grey41", 105, 105, 105,
- "grey42", 107, 107, 107,
- "grey43", 110, 110, 110,
- "grey44", 112, 112, 112,
- "grey45", 115, 115, 115,
- "grey46", 117, 117, 117,
- "grey47", 120, 120, 120,
- "grey48", 122, 122, 122,
- "grey49", 125, 125, 125,
- "grey5", 13, 13, 13,
- "grey50", 127, 127, 127,
- "grey51", 130, 130, 130,
- "grey52", 133, 133, 133,
- "grey53", 135, 135, 135,
- "grey54", 138, 138, 138,
- "grey55", 140, 140, 140,
- "grey56", 143, 143, 143,
- "grey57", 145, 145, 145,
- "grey58", 148, 148, 148,
- "grey59", 150, 150, 150,
- "grey6", 15, 15, 15,
- "grey60", 153, 153, 153,
- "grey61", 156, 156, 156,
- "grey62", 158, 158, 158,
- "grey63", 161, 161, 161,
- "grey64", 163, 163, 163,
- "grey65", 166, 166, 166,
- "grey66", 168, 168, 168,
- "grey67", 171, 171, 171,
- "grey68", 173, 173, 173,
- "grey69", 176, 176, 176,
- "grey7", 18, 18, 18,
- "grey70", 179, 179, 179,
- "grey71", 181, 181, 181,
- "grey72", 184, 184, 184,
- "grey73", 186, 186, 186,
- "grey74", 189, 189, 189,
- "grey75", 191, 191, 191,
- "grey76", 194, 194, 194,
- "grey77", 196, 196, 196,
- "grey78", 199, 199, 199,
- "grey79", 201, 201, 201,
- "grey8", 20, 20, 20,
- "grey80", 204, 204, 204,
- "grey81", 207, 207, 207,
- "grey82", 209, 209, 209,
- "grey83", 212, 212, 212,
- "grey84", 214, 214, 214,
- "grey85", 217, 217, 217,
- "grey86", 219, 219, 219,
- "grey87", 222, 222, 222,
- "grey88", 224, 224, 224,
- "grey89", 227, 227, 227,
- "grey9", 23, 23, 23,
- "grey90", 229, 229, 229,
- "grey91", 232, 232, 232,
- "grey92", 235, 235, 235,
- "grey93", 237, 237, 237,
- "grey94", 240, 240, 240,
- "grey95", 242, 242, 242,
- "grey96", 245, 245, 245,
- "grey97", 247, 247, 247,
- "grey98", 250, 250, 250,
- "grey99", 252, 252, 252,
- "honeydew", 240, 255, 240,
- "honeydew1", 240, 255, 240,
- "honeydew2", 224, 238, 224,
- "honeydew3", 193, 205, 193,
- "honeydew4", 131, 139, 131,
- "hot pink", 255, 105, 180,
- "HotPink", 255, 105, 180,
- "HotPink1", 255, 110, 180,
- "HotPink2", 238, 106, 167,
- "HotPink3", 205, 96, 144,
- "HotPink4", 139, 58, 98,
- "indian red", 205, 92, 92,
- "IndianRed", 205, 92, 92,
- "IndianRed1", 255, 106, 106,
- "IndianRed2", 238, 99, 99,
- "IndianRed3", 205, 85, 85,
- "IndianRed4", 139, 58, 58,
- "ivory", 255, 255, 240,
- "ivory1", 255, 255, 240,
- "ivory2", 238, 238, 224,
- "ivory3", 205, 205, 193,
- "ivory4", 139, 139, 131,
- "khaki", 240, 230, 140,
- "khaki1", 255, 246, 143,
- "khaki2", 238, 230, 133,
- "khaki3", 205, 198, 115,
- "khaki4", 139, 134, 78,
- "lavender", 230, 230, 250,
- "lavender blush", 255, 240, 245,
- "LavenderBlush", 255, 240, 245,
- "LavenderBlush1", 255, 240, 245,
- "LavenderBlush2", 238, 224, 229,
- "LavenderBlush3", 205, 193, 197,
- "LavenderBlush4", 139, 131, 134,
- "lawn green", 124, 252, 0,
- "LawnGreen", 124, 252, 0,
- "lemon chiffon", 255, 250, 205,
- "LemonChiffon", 255, 250, 205,
- "LemonChiffon1", 255, 250, 205,
- "LemonChiffon2", 238, 233, 191,
- "LemonChiffon3", 205, 201, 165,
- "LemonChiffon4", 139, 137, 112,
- "light blue", 173, 216, 230,
- "light coral", 240, 128, 128,
- "light cyan", 224, 255, 255,
- "light goldenrod", 238, 221, 130,
- "light goldenrod yellow", 250, 250, 210,
- "light gray", 211, 211, 211,
- "light green", 144, 238, 144,
- "light grey", 211, 211, 211,
- "light pink", 255, 182, 193,
- "light salmon", 255, 160, 122,
- "light sea green", 32, 178, 170,
- "light sky blue", 135, 206, 250,
- "light slate blue", 132, 112, 255,
- "light slate gray", 119, 136, 153,
- "light slate grey", 119, 136, 153,
- "light steel blue", 176, 196, 222,
- "light yellow", 255, 255, 224,
- "LightBlue", 173, 216, 230,
- "LightBlue1", 191, 239, 255,
- "LightBlue2", 178, 223, 238,
- "LightBlue3", 154, 192, 205,
- "LightBlue4", 104, 131, 139,
- "LightCoral", 240, 128, 128,
- "LightCyan", 224, 255, 255,
- "LightCyan1", 224, 255, 255,
- "LightCyan2", 209, 238, 238,
- "LightCyan3", 180, 205, 205,
- "LightCyan4", 122, 139, 139,
- "LightGoldenrod", 238, 221, 130,
- "LightGoldenrod1", 255, 236, 139,
- "LightGoldenrod2", 238, 220, 130,
- "LightGoldenrod3", 205, 190, 112,
- "LightGoldenrod4", 139, 129, 76,
- "LightGoldenrodYellow", 250, 250, 210,
- "LightGray", 211, 211, 211,
- "LightGreen", 144, 238, 144,
- "LightGrey", 211, 211, 211,
- "LightPink", 255, 182, 193,
- "LightPink1", 255, 174, 185,
- "LightPink2", 238, 162, 173,
- "LightPink3", 205, 140, 149,
- "LightPink4", 139, 95, 101,
- "LightSalmon", 255, 160, 122,
- "LightSalmon1", 255, 160, 122,
- "LightSalmon2", 238, 149, 114,
- "LightSalmon3", 205, 129, 98,
- "LightSalmon4", 139, 87, 66,
- "LightSeaGreen", 32, 178, 170,
- "LightSkyBlue", 135, 206, 250,
- "LightSkyBlue1", 176, 226, 255,
- "LightSkyBlue2", 164, 211, 238,
- "LightSkyBlue3", 141, 182, 205,
- "LightSkyBlue4", 96, 123, 139,
- "LightSlateBlue", 132, 112, 255,
- "LightSlateGray", 119, 136, 153,
- "LightSlateGrey", 119, 136, 153,
- "LightSteelBlue", 176, 196, 222,
- "LightSteelBlue1", 202, 225, 255,
- "LightSteelBlue2", 188, 210, 238,
- "LightSteelBlue3", 162, 181, 205,
- "LightSteelBlue4", 110, 123, 139,
- "LightYellow", 255, 255, 224,
- "LightYellow1", 255, 255, 224,
- "LightYellow2", 238, 238, 209,
- "LightYellow3", 205, 205, 180,
- "LightYellow4", 139, 139, 122,
- "lime green", 50, 205, 50,
- "LimeGreen", 50, 205, 50,
- "linen", 250, 240, 230,
- "magenta", 255, 0, 255,
- "magenta1", 255, 0, 255,
- "magenta2", 238, 0, 238,
- "magenta3", 205, 0, 205,
- "magenta4", 139, 0, 139,
- "maroon", 176, 48, 96,
- "maroon1", 255, 52, 179,
- "maroon2", 238, 48, 167,
- "maroon3", 205, 41, 144,
- "maroon4", 139, 28, 98,
- "medium aquamarine", 102, 205, 170,
- "medium blue", 0, 0, 205,
- "medium orchid", 186, 85, 211,
- "medium purple", 147, 112, 219,
- "medium sea green", 60, 179, 113,
- "medium slate blue", 123, 104, 238,
- "medium spring green", 0, 250, 154,
- "medium turquoise", 72, 209, 204,
- "medium violet red", 199, 21, 133,
- "MediumAquamarine", 102, 205, 170,
- "MediumBlue", 0, 0, 205,
- "MediumOrchid", 186, 85, 211,
- "MediumOrchid1", 224, 102, 255,
- "MediumOrchid2", 209, 95, 238,
- "MediumOrchid3", 180, 82, 205,
- "MediumOrchid4", 122, 55, 139,
- "MediumPurple", 147, 112, 219,
- "MediumPurple1", 171, 130, 255,
- "MediumPurple2", 159, 121, 238,
- "MediumPurple3", 137, 104, 205,
- "MediumPurple4", 93, 71, 139,
- "MediumSeaGreen", 60, 179, 113,
- "MediumSlateBlue", 123, 104, 238,
- "MediumSpringGreen", 0, 250, 154,
- "MediumTurquoise", 72, 209, 204,
- "MediumVioletRed", 199, 21, 133,
- "midnight blue", 25, 25, 112,
- "MidnightBlue", 25, 25, 112,
- "mint cream", 245, 255, 250,
- "MintCream", 245, 255, 250,
- "misty rose", 255, 228, 225,
- "MistyRose", 255, 228, 225,
- "MistyRose1", 255, 228, 225,
- "MistyRose2", 238, 213, 210,
- "MistyRose3", 205, 183, 181,
- "MistyRose4", 139, 125, 123,
- "moccasin", 255, 228, 181,
- "navajo white", 255, 222, 173,
- "NavajoWhite", 255, 222, 173,
- "NavajoWhite1", 255, 222, 173,
- "NavajoWhite2", 238, 207, 161,
- "NavajoWhite3", 205, 179, 139,
- "NavajoWhite4", 139, 121, 94,
- "navy", 0, 0, 128,
- "navy blue", 0, 0, 128,
- "NavyBlue", 0, 0, 128,
- "old lace", 253, 245, 230,
- "OldLace", 253, 245, 230,
- "olive drab", 107, 142, 35,
- "OliveDrab", 107, 142, 35,
- "OliveDrab1", 192, 255, 62,
- "OliveDrab2", 179, 238, 58,
- "OliveDrab3", 154, 205, 50,
- "OliveDrab4", 105, 139, 34,
- "orange", 255, 165, 0,
- "orange red", 255, 69, 0,
- "orange1", 255, 165, 0,
- "orange2", 238, 154, 0,
- "orange3", 205, 133, 0,
- "orange4", 139, 90, 0,
- "OrangeRed", 255, 69, 0,
- "OrangeRed1", 255, 69, 0,
- "OrangeRed2", 238, 64, 0,
- "OrangeRed3", 205, 55, 0,
- "OrangeRed4", 139, 37, 0,
- "orchid", 218, 112, 214,
- "orchid1", 255, 131, 250,
- "orchid2", 238, 122, 233,
- "orchid3", 205, 105, 201,
- "orchid4", 139, 71, 137,
- "pale goldenrod", 238, 232, 170,
- "pale green", 152, 251, 152,
- "pale turquoise", 175, 238, 238,
- "pale violet red", 219, 112, 147,
- "PaleGoldenrod", 238, 232, 170,
- "PaleGreen", 152, 251, 152,
- "PaleGreen1", 154, 255, 154,
- "PaleGreen2", 144, 238, 144,
- "PaleGreen3", 124, 205, 124,
- "PaleGreen4", 84, 139, 84,
- "PaleTurquoise", 175, 238, 238,
- "PaleTurquoise1", 187, 255, 255,
- "PaleTurquoise2", 174, 238, 238,
- "PaleTurquoise3", 150, 205, 205,
- "PaleTurquoise4", 102, 139, 139,
- "PaleVioletRed", 219, 112, 147,
- "PaleVioletRed1", 255, 130, 171,
- "PaleVioletRed2", 238, 121, 159,
- "PaleVioletRed3", 205, 104, 137,
- "PaleVioletRed4", 139, 71, 93,
- "papaya whip", 255, 239, 213,
- "PapayaWhip", 255, 239, 213,
- "peach puff", 255, 218, 185,
- "PeachPuff", 255, 218, 185,
- "PeachPuff1", 255, 218, 185,
- "PeachPuff2", 238, 203, 173,
- "PeachPuff3", 205, 175, 149,
- "PeachPuff4", 139, 119, 101,
- "peru", 205, 133, 63,
- "pink", 255, 192, 203,
- "pink1", 255, 181, 197,
- "pink2", 238, 169, 184,
- "pink3", 205, 145, 158,
- "pink4", 139, 99, 108,
- "plum", 221, 160, 221,
- "plum1", 255, 187, 255,
- "plum2", 238, 174, 238,
- "plum3", 205, 150, 205,
- "plum4", 139, 102, 139,
- "powder blue", 176, 224, 230,
- "PowderBlue", 176, 224, 230,
- "purple", 160, 32, 240,
- "purple1", 155, 48, 255,
- "purple2", 145, 44, 238,
- "purple3", 125, 38, 205,
- "purple4", 85, 26, 139,
- "red", 255, 0, 0,
- "red1", 255, 0, 0,
- "red2", 238, 0, 0,
- "red3", 205, 0, 0,
- "red4", 139, 0, 0,
- "rosy brown", 188, 143, 143,
- "RosyBrown", 188, 143, 143,
- "RosyBrown1", 255, 193, 193,
- "RosyBrown2", 238, 180, 180,
- "RosyBrown3", 205, 155, 155,
- "RosyBrown4", 139, 105, 105,
- "royal blue", 65, 105, 225,
- "RoyalBlue", 65, 105, 225,
- "RoyalBlue1", 72, 118, 255,
- "RoyalBlue2", 67, 110, 238,
- "RoyalBlue3", 58, 95, 205,
- "RoyalBlue4", 39, 64, 139,
- "saddle brown", 139, 69, 19,
- "SaddleBrown", 139, 69, 19,
- "salmon", 250, 128, 114,
- "salmon1", 255, 140, 105,
- "salmon2", 238, 130, 98,
- "salmon3", 205, 112, 84,
- "salmon4", 139, 76, 57,
- "sandy brown", 244, 164, 96,
- "SandyBrown", 244, 164, 96,
- "sea green", 46, 139, 87,
- "SeaGreen", 46, 139, 87,
- "SeaGreen1", 84, 255, 159,
- "SeaGreen2", 78, 238, 148,
- "SeaGreen3", 67, 205, 128,
- "SeaGreen4", 46, 139, 87,
- "seashell", 255, 245, 238,
- "seashell1", 255, 245, 238,
- "seashell2", 238, 229, 222,
- "seashell3", 205, 197, 191,
- "seashell4", 139, 134, 130,
- "sienna", 160, 82, 45,
- "sienna1", 255, 130, 71,
- "sienna2", 238, 121, 66,
- "sienna3", 205, 104, 57,
- "sienna4", 139, 71, 38,
- "sky blue", 135, 206, 235,
- "SkyBlue", 135, 206, 235,
- "SkyBlue1", 135, 206, 255,
- "SkyBlue2", 126, 192, 238,
- "SkyBlue3", 108, 166, 205,
- "SkyBlue4", 74, 112, 139,
- "slate blue", 106, 90, 205,
- "slate gray", 112, 128, 144,
- "slate grey", 112, 128, 144,
- "SlateBlue", 106, 90, 205,
- "SlateBlue1", 131, 111, 255,
- "SlateBlue2", 122, 103, 238,
- "SlateBlue3", 105, 89, 205,
- "SlateBlue4", 71, 60, 139,
- "SlateGray", 112, 128, 144,
- "SlateGray1", 198, 226, 255,
- "SlateGray2", 185, 211, 238,
- "SlateGray3", 159, 182, 205,
- "SlateGray4", 108, 123, 139,
- "SlateGrey", 112, 128, 144,
- "snow", 255, 250, 250,
- "snow1", 255, 250, 250,
- "snow2", 238, 233, 233,
- "snow3", 205, 201, 201,
- "snow4", 139, 137, 137,
- "spring green", 0, 255, 127,
- "SpringGreen", 0, 255, 127,
- "SpringGreen1", 0, 255, 127,
- "SpringGreen2", 0, 238, 118,
- "SpringGreen3", 0, 205, 102,
- "SpringGreen4", 0, 139, 69,
- "steel blue", 70, 130, 180,
- "SteelBlue", 70, 130, 180,
- "SteelBlue1", 99, 184, 255,
- "SteelBlue2", 92, 172, 238,
- "SteelBlue3", 79, 148, 205,
- "SteelBlue4", 54, 100, 139,
- "tan", 210, 180, 140,
- "tan1", 255, 165, 79,
- "tan2", 238, 154, 73,
- "tan3", 205, 133, 63,
- "tan4", 139, 90, 43,
- "thistle", 216, 191, 216,
- "thistle1", 255, 225, 255,
- "thistle2", 238, 210, 238,
- "thistle3", 205, 181, 205,
- "thistle4", 139, 123, 139,
- "tomato", 255, 99, 71,
- "tomato1", 255, 99, 71,
- "tomato2", 238, 92, 66,
- "tomato3", 205, 79, 57,
- "tomato4", 139, 54, 38,
- "turquoise", 64, 224, 208,
- "turquoise1", 0, 245, 255,
- "turquoise2", 0, 229, 238,
- "turquoise3", 0, 197, 205,
- "turquoise4", 0, 134, 139,
- "violet", 238, 130, 238,
- "violet red", 208, 32, 144,
- "VioletRed", 208, 32, 144,
- "VioletRed1", 255, 62, 150,
- "VioletRed2", 238, 58, 140,
- "VioletRed3", 205, 50, 120,
- "VioletRed4", 139, 34, 82,
- "wheat", 245, 222, 179,
- "wheat1", 255, 231, 186,
- "wheat2", 238, 216, 174,
- "wheat3", 205, 186, 150,
- "wheat4", 139, 126, 102,
- "white", 255, 255, 255,
- "white smoke", 245, 245, 245,
- "WhiteSmoke", 245, 245, 245,
- "yellow", 255, 255, 0,
- "yellow green", 154, 205, 50,
- "yellow1", 255, 255, 0,
- "yellow2", 238, 238, 0,
- "yellow3", 205, 205, 0,
- "yellow4", 139, 139, 0,
- "YellowGreen", 154, 205, 50,
- NULL, 0, 0, 0
+ { "alice blue", 240, 248, 255 },
+ { "AliceBlue", 240, 248, 255 },
+ { "antique white", 250, 235, 215 },
+ { "AntiqueWhite", 250, 235, 215 },
+ { "AntiqueWhite1", 255, 239, 219 },
+ { "AntiqueWhite2", 238, 223, 204 },
+ { "AntiqueWhite3", 205, 192, 176 },
+ { "AntiqueWhite4", 139, 131, 120 },
+ { "aquamarine", 127, 255, 212 },
+ { "aquamarine1", 127, 255, 212 },
+ { "aquamarine2", 118, 238, 198 },
+ { "aquamarine3", 102, 205, 170 },
+ { "aquamarine4", 69, 139, 116 },
+ { "azure", 240, 255, 255 },
+ { "azure1", 240, 255, 255 },
+ { "azure2", 224, 238, 238 },
+ { "azure3", 193, 205, 205 },
+ { "azure4", 131, 139, 139 },
+ { "beige", 245, 245, 220 },
+ { "bisque", 255, 228, 196 },
+ { "bisque1", 255, 228, 196 },
+ { "bisque2", 238, 213, 183 },
+ { "bisque3", 205, 183, 158 },
+ { "bisque4", 139, 125, 107 },
+ { "black", 0, 0, 0 },
+ { "blanched almond", 255, 235, 205 },
+ { "BlanchedAlmond", 255, 235, 205 },
+ { "blue", 0, 0, 255 },
+ { "blue violet", 138, 43, 226 },
+ { "blue1", 0, 0, 255 },
+ { "blue2", 0, 0, 238 },
+ { "blue3", 0, 0, 205 },
+ { "blue4", 0, 0, 139 },
+ { "BlueViolet", 138, 43, 226 },
+ { "brown", 165, 42, 42 },
+ { "brown1", 255, 64, 64 },
+ { "brown2", 238, 59, 59 },
+ { "brown3", 205, 51, 51 },
+ { "brown4", 139, 35, 35 },
+ { "burlywood", 222, 184, 135 },
+ { "burlywood1", 255, 211, 155 },
+ { "burlywood2", 238, 197, 145 },
+ { "burlywood3", 205, 170, 125 },
+ { "burlywood4", 139, 115, 85 },
+ { "cadet blue", 95, 158, 160 },
+ { "CadetBlue", 95, 158, 160 },
+ { "CadetBlue1", 152, 245, 255 },
+ { "CadetBlue2", 142, 229, 238 },
+ { "CadetBlue3", 122, 197, 205 },
+ { "CadetBlue4", 83, 134, 139 },
+ { "chartreuse", 127, 255, 0 },
+ { "chartreuse1", 127, 255, 0 },
+ { "chartreuse2", 118, 238, 0 },
+ { "chartreuse3", 102, 205, 0 },
+ { "chartreuse4", 69, 139, 0 },
+ { "chocolate", 210, 105, 30 },
+ { "chocolate1", 255, 127, 36 },
+ { "chocolate2", 238, 118, 33 },
+ { "chocolate3", 205, 102, 29 },
+ { "chocolate4", 139, 69, 19 },
+ { "coral", 255, 127, 80 },
+ { "coral1", 255, 114, 86 },
+ { "coral2", 238, 106, 80 },
+ { "coral3", 205, 91, 69 },
+ { "coral4", 139, 62, 47 },
+ { "cornflower blue", 100, 149, 237 },
+ { "CornflowerBlue", 100, 149, 237 },
+ { "cornsilk", 255, 248, 220 },
+ { "cornsilk1", 255, 248, 220 },
+ { "cornsilk2", 238, 232, 205 },
+ { "cornsilk3", 205, 200, 177 },
+ { "cornsilk4", 139, 136, 120 },
+ { "cyan", 0, 255, 255 },
+ { "cyan1", 0, 255, 255 },
+ { "cyan2", 0, 238, 238 },
+ { "cyan3", 0, 205, 205 },
+ { "cyan4", 0, 139, 139 },
+ { "dark blue", 0, 0, 139 },
+ { "dark cyan", 0, 139, 139 },
+ { "dark goldenrod", 184, 134, 11 },
+ { "dark gray", 169, 169, 169 },
+ { "dark green", 0, 100, 0 },
+ { "dark grey", 169, 169, 169 },
+ { "dark khaki", 189, 183, 107 },
+ { "dark magenta", 139, 0, 139 },
+ { "dark olive green", 85, 107, 47 },
+ { "dark orange", 255, 140, 0 },
+ { "dark orchid", 153, 50, 204 },
+ { "dark red", 139, 0, 0 },
+ { "dark salmon", 233, 150, 122 },
+ { "dark sea green", 143, 188, 143 },
+ { "dark slate blue", 72, 61, 139 },
+ { "dark slate gray", 47, 79, 79 },
+ { "dark slate grey", 47, 79, 79 },
+ { "dark turquoise", 0, 206, 209 },
+ { "dark violet", 148, 0, 211 },
+ { "DarkBlue", 0, 0, 139 },
+ { "DarkCyan", 0, 139, 139 },
+ { "DarkGoldenrod", 184, 134, 11 },
+ { "DarkGoldenrod1", 255, 185, 15 },
+ { "DarkGoldenrod2", 238, 173, 14 },
+ { "DarkGoldenrod3", 205, 149, 12 },
+ { "DarkGoldenrod4", 139, 101, 8 },
+ { "DarkGray", 169, 169, 169 },
+ { "DarkGreen", 0, 100, 0 },
+ { "DarkGrey", 169, 169, 169 },
+ { "DarkKhaki", 189, 183, 107 },
+ { "DarkMagenta", 139, 0, 139 },
+ { "DarkOliveGreen", 85, 107, 47 },
+ { "DarkOliveGreen1", 202, 255, 112 },
+ { "DarkOliveGreen2", 188, 238, 104 },
+ { "DarkOliveGreen3", 162, 205, 90 },
+ { "DarkOliveGreen4", 110, 139, 61 },
+ { "DarkOrange", 255, 140, 0 },
+ { "DarkOrange1", 255, 127, 0 },
+ { "DarkOrange2", 238, 118, 0 },
+ { "DarkOrange3", 205, 102, 0 },
+ { "DarkOrange4", 139, 69, 0 },
+ { "DarkOrchid", 153, 50, 204 },
+ { "DarkOrchid1", 191, 62, 255 },
+ { "DarkOrchid2", 178, 58, 238 },
+ { "DarkOrchid3", 154, 50, 205 },
+ { "DarkOrchid4", 104, 34, 139 },
+ { "DarkRed", 139, 0, 0 },
+ { "DarkSalmon", 233, 150, 122 },
+ { "DarkSeaGreen", 143, 188, 143 },
+ { "DarkSeaGreen1", 193, 255, 193 },
+ { "DarkSeaGreen2", 180, 238, 180 },
+ { "DarkSeaGreen3", 155, 205, 155 },
+ { "DarkSeaGreen4", 105, 139, 105 },
+ { "DarkSlateBlue", 72, 61, 139 },
+ { "DarkSlateGray", 47, 79, 79 },
+ { "DarkSlateGray1", 151, 255, 255 },
+ { "DarkSlateGray2", 141, 238, 238 },
+ { "DarkSlateGray3", 121, 205, 205 },
+ { "DarkSlateGray4", 82, 139, 139 },
+ { "DarkSlateGrey", 47, 79, 79 },
+ { "DarkTurquoise", 0, 206, 209 },
+ { "DarkViolet", 148, 0, 211 },
+ { "deep pink", 255, 20, 147 },
+ { "deep sky blue", 0, 191, 255 },
+ { "DeepPink", 255, 20, 147 },
+ { "DeepPink1", 255, 20, 147 },
+ { "DeepPink2", 238, 18, 137 },
+ { "DeepPink3", 205, 16, 118 },
+ { "DeepPink4", 139, 10, 80 },
+ { "DeepSkyBlue", 0, 191, 255 },
+ { "DeepSkyBlue1", 0, 191, 255 },
+ { "DeepSkyBlue2", 0, 178, 238 },
+ { "DeepSkyBlue3", 0, 154, 205 },
+ { "DeepSkyBlue4", 0, 104, 139 },
+ { "dim gray", 105, 105, 105 },
+ { "dim grey", 105, 105, 105 },
+ { "DimGray", 105, 105, 105 },
+ { "DimGrey", 105, 105, 105 },
+ { "dodger blue", 30, 144, 255 },
+ { "DodgerBlue", 30, 144, 255 },
+ { "DodgerBlue1", 30, 144, 255 },
+ { "DodgerBlue2", 28, 134, 238 },
+ { "DodgerBlue3", 24, 116, 205 },
+ { "DodgerBlue4", 16, 78, 139 },
+ { "firebrick", 178, 34, 34 },
+ { "firebrick1", 255, 48, 48 },
+ { "firebrick2", 238, 44, 44 },
+ { "firebrick3", 205, 38, 38 },
+ { "firebrick4", 139, 26, 26 },
+ { "floral white", 255, 250, 240 },
+ { "FloralWhite", 255, 250, 240 },
+ { "forest green", 34, 139, 34 },
+ { "ForestGreen", 34, 139, 34 },
+ { "gainsboro", 220, 220, 220 },
+ { "ghost white", 248, 248, 255 },
+ { "GhostWhite", 248, 248, 255 },
+ { "gold", 255, 215, 0 },
+ { "gold1", 255, 215, 0 },
+ { "gold2", 238, 201, 0 },
+ { "gold3", 205, 173, 0 },
+ { "gold4", 139, 117, 0 },
+ { "goldenrod", 218, 165, 32 },
+ { "goldenrod1", 255, 193, 37 },
+ { "goldenrod2", 238, 180, 34 },
+ { "goldenrod3", 205, 155, 29 },
+ { "goldenrod4", 139, 105, 20 },
+ { "gray", 190, 190, 190 },
+ { "gray0", 0, 0, 0 },
+ { "gray1", 3, 3, 3 },
+ { "gray10", 26, 26, 26 },
+ { "gray100", 255, 255, 255 },
+ { "gray11", 28, 28, 28 },
+ { "gray12", 31, 31, 31 },
+ { "gray13", 33, 33, 33 },
+ { "gray14", 36, 36, 36 },
+ { "gray15", 38, 38, 38 },
+ { "gray16", 41, 41, 41 },
+ { "gray17", 43, 43, 43 },
+ { "gray18", 46, 46, 46 },
+ { "gray19", 48, 48, 48 },
+ { "gray2", 5, 5, 5 },
+ { "gray20", 51, 51, 51 },
+ { "gray21", 54, 54, 54 },
+ { "gray22", 56, 56, 56 },
+ { "gray23", 59, 59, 59 },
+ { "gray24", 61, 61, 61 },
+ { "gray25", 64, 64, 64 },
+ { "gray26", 66, 66, 66 },
+ { "gray27", 69, 69, 69 },
+ { "gray28", 71, 71, 71 },
+ { "gray29", 74, 74, 74 },
+ { "gray3", 8, 8, 8 },
+ { "gray30", 77, 77, 77 },
+ { "gray31", 79, 79, 79 },
+ { "gray32", 82, 82, 82 },
+ { "gray33", 84, 84, 84 },
+ { "gray34", 87, 87, 87 },
+ { "gray35", 89, 89, 89 },
+ { "gray36", 92, 92, 92 },
+ { "gray37", 94, 94, 94 },
+ { "gray38", 97, 97, 97 },
+ { "gray39", 99, 99, 99 },
+ { "gray4", 10, 10, 10 },
+ { "gray40", 102, 102, 102 },
+ { "gray41", 105, 105, 105 },
+ { "gray42", 107, 107, 107 },
+ { "gray43", 110, 110, 110 },
+ { "gray44", 112, 112, 112 },
+ { "gray45", 115, 115, 115 },
+ { "gray46", 117, 117, 117 },
+ { "gray47", 120, 120, 120 },
+ { "gray48", 122, 122, 122 },
+ { "gray49", 125, 125, 125 },
+ { "gray5", 13, 13, 13 },
+ { "gray50", 127, 127, 127 },
+ { "gray51", 130, 130, 130 },
+ { "gray52", 133, 133, 133 },
+ { "gray53", 135, 135, 135 },
+ { "gray54", 138, 138, 138 },
+ { "gray55", 140, 140, 140 },
+ { "gray56", 143, 143, 143 },
+ { "gray57", 145, 145, 145 },
+ { "gray58", 148, 148, 148 },
+ { "gray59", 150, 150, 150 },
+ { "gray6", 15, 15, 15 },
+ { "gray60", 153, 153, 153 },
+ { "gray61", 156, 156, 156 },
+ { "gray62", 158, 158, 158 },
+ { "gray63", 161, 161, 161 },
+ { "gray64", 163, 163, 163 },
+ { "gray65", 166, 166, 166 },
+ { "gray66", 168, 168, 168 },
+ { "gray67", 171, 171, 171 },
+ { "gray68", 173, 173, 173 },
+ { "gray69", 176, 176, 176 },
+ { "gray7", 18, 18, 18 },
+ { "gray70", 179, 179, 179 },
+ { "gray71", 181, 181, 181 },
+ { "gray72", 184, 184, 184 },
+ { "gray73", 186, 186, 186 },
+ { "gray74", 189, 189, 189 },
+ { "gray75", 191, 191, 191 },
+ { "gray76", 194, 194, 194 },
+ { "gray77", 196, 196, 196 },
+ { "gray78", 199, 199, 199 },
+ { "gray79", 201, 201, 201 },
+ { "gray8", 20, 20, 20 },
+ { "gray80", 204, 204, 204 },
+ { "gray81", 207, 207, 207 },
+ { "gray82", 209, 209, 209 },
+ { "gray83", 212, 212, 212 },
+ { "gray84", 214, 214, 214 },
+ { "gray85", 217, 217, 217 },
+ { "gray86", 219, 219, 219 },
+ { "gray87", 222, 222, 222 },
+ { "gray88", 224, 224, 224 },
+ { "gray89", 227, 227, 227 },
+ { "gray9", 23, 23, 23 },
+ { "gray90", 229, 229, 229 },
+ { "gray91", 232, 232, 232 },
+ { "gray92", 235, 235, 235 },
+ { "gray93", 237, 237, 237 },
+ { "gray94", 240, 240, 240 },
+ { "gray95", 242, 242, 242 },
+ { "gray96", 245, 245, 245 },
+ { "gray97", 247, 247, 247 },
+ { "gray98", 250, 250, 250 },
+ { "gray99", 252, 252, 252 },
+ { "green", 0, 255, 0 },
+ { "green yellow", 173, 255, 47 },
+ { "green1", 0, 255, 0 },
+ { "green2", 0, 238, 0 },
+ { "green3", 0, 205, 0 },
+ { "green4", 0, 139, 0 },
+ { "GreenYellow", 173, 255, 47 },
+ { "grey", 190, 190, 190 },
+ { "grey0", 0, 0, 0 },
+ { "grey1", 3, 3, 3 },
+ { "grey10", 26, 26, 26 },
+ { "grey100", 255, 255, 255 },
+ { "grey11", 28, 28, 28 },
+ { "grey12", 31, 31, 31 },
+ { "grey13", 33, 33, 33 },
+ { "grey14", 36, 36, 36 },
+ { "grey15", 38, 38, 38 },
+ { "grey16", 41, 41, 41 },
+ { "grey17", 43, 43, 43 },
+ { "grey18", 46, 46, 46 },
+ { "grey19", 48, 48, 48 },
+ { "grey2", 5, 5, 5 },
+ { "grey20", 51, 51, 51 },
+ { "grey21", 54, 54, 54 },
+ { "grey22", 56, 56, 56 },
+ { "grey23", 59, 59, 59 },
+ { "grey24", 61, 61, 61 },
+ { "grey25", 64, 64, 64 },
+ { "grey26", 66, 66, 66 },
+ { "grey27", 69, 69, 69 },
+ { "grey28", 71, 71, 71 },
+ { "grey29", 74, 74, 74 },
+ { "grey3", 8, 8, 8 },
+ { "grey30", 77, 77, 77 },
+ { "grey31", 79, 79, 79 },
+ { "grey32", 82, 82, 82 },
+ { "grey33", 84, 84, 84 },
+ { "grey34", 87, 87, 87 },
+ { "grey35", 89, 89, 89 },
+ { "grey36", 92, 92, 92 },
+ { "grey37", 94, 94, 94 },
+ { "grey38", 97, 97, 97 },
+ { "grey39", 99, 99, 99 },
+ { "grey4", 10, 10, 10 },
+ { "grey40", 102, 102, 102 },
+ { "grey41", 105, 105, 105 },
+ { "grey42", 107, 107, 107 },
+ { "grey43", 110, 110, 110 },
+ { "grey44", 112, 112, 112 },
+ { "grey45", 115, 115, 115 },
+ { "grey46", 117, 117, 117 },
+ { "grey47", 120, 120, 120 },
+ { "grey48", 122, 122, 122 },
+ { "grey49", 125, 125, 125 },
+ { "grey5", 13, 13, 13 },
+ { "grey50", 127, 127, 127 },
+ { "grey51", 130, 130, 130 },
+ { "grey52", 133, 133, 133 },
+ { "grey53", 135, 135, 135 },
+ { "grey54", 138, 138, 138 },
+ { "grey55", 140, 140, 140 },
+ { "grey56", 143, 143, 143 },
+ { "grey57", 145, 145, 145 },
+ { "grey58", 148, 148, 148 },
+ { "grey59", 150, 150, 150 },
+ { "grey6", 15, 15, 15 },
+ { "grey60", 153, 153, 153 },
+ { "grey61", 156, 156, 156 },
+ { "grey62", 158, 158, 158 },
+ { "grey63", 161, 161, 161 },
+ { "grey64", 163, 163, 163 },
+ { "grey65", 166, 166, 166 },
+ { "grey66", 168, 168, 168 },
+ { "grey67", 171, 171, 171 },
+ { "grey68", 173, 173, 173 },
+ { "grey69", 176, 176, 176 },
+ { "grey7", 18, 18, 18 },
+ { "grey70", 179, 179, 179 },
+ { "grey71", 181, 181, 181 },
+ { "grey72", 184, 184, 184 },
+ { "grey73", 186, 186, 186 },
+ { "grey74", 189, 189, 189 },
+ { "grey75", 191, 191, 191 },
+ { "grey76", 194, 194, 194 },
+ { "grey77", 196, 196, 196 },
+ { "grey78", 199, 199, 199 },
+ { "grey79", 201, 201, 201 },
+ { "grey8", 20, 20, 20 },
+ { "grey80", 204, 204, 204 },
+ { "grey81", 207, 207, 207 },
+ { "grey82", 209, 209, 209 },
+ { "grey83", 212, 212, 212 },
+ { "grey84", 214, 214, 214 },
+ { "grey85", 217, 217, 217 },
+ { "grey86", 219, 219, 219 },
+ { "grey87", 222, 222, 222 },
+ { "grey88", 224, 224, 224 },
+ { "grey89", 227, 227, 227 },
+ { "grey9", 23, 23, 23 },
+ { "grey90", 229, 229, 229 },
+ { "grey91", 232, 232, 232 },
+ { "grey92", 235, 235, 235 },
+ { "grey93", 237, 237, 237 },
+ { "grey94", 240, 240, 240 },
+ { "grey95", 242, 242, 242 },
+ { "grey96", 245, 245, 245 },
+ { "grey97", 247, 247, 247 },
+ { "grey98", 250, 250, 250 },
+ { "grey99", 252, 252, 252 },
+ { "honeydew", 240, 255, 240 },
+ { "honeydew1", 240, 255, 240 },
+ { "honeydew2", 224, 238, 224 },
+ { "honeydew3", 193, 205, 193 },
+ { "honeydew4", 131, 139, 131 },
+ { "hot pink", 255, 105, 180 },
+ { "HotPink", 255, 105, 180 },
+ { "HotPink1", 255, 110, 180 },
+ { "HotPink2", 238, 106, 167 },
+ { "HotPink3", 205, 96, 144 },
+ { "HotPink4", 139, 58, 98 },
+ { "indian red", 205, 92, 92 },
+ { "IndianRed", 205, 92, 92 },
+ { "IndianRed1", 255, 106, 106 },
+ { "IndianRed2", 238, 99, 99 },
+ { "IndianRed3", 205, 85, 85 },
+ { "IndianRed4", 139, 58, 58 },
+ { "ivory", 255, 255, 240 },
+ { "ivory1", 255, 255, 240 },
+ { "ivory2", 238, 238, 224 },
+ { "ivory3", 205, 205, 193 },
+ { "ivory4", 139, 139, 131 },
+ { "khaki", 240, 230, 140 },
+ { "khaki1", 255, 246, 143 },
+ { "khaki2", 238, 230, 133 },
+ { "khaki3", 205, 198, 115 },
+ { "khaki4", 139, 134, 78 },
+ { "lavender", 230, 230, 250 },
+ { "lavender blush", 255, 240, 245 },
+ { "LavenderBlush", 255, 240, 245 },
+ { "LavenderBlush1", 255, 240, 245 },
+ { "LavenderBlush2", 238, 224, 229 },
+ { "LavenderBlush3", 205, 193, 197 },
+ { "LavenderBlush4", 139, 131, 134 },
+ { "lawn green", 124, 252, 0 },
+ { "LawnGreen", 124, 252, 0 },
+ { "lemon chiffon", 255, 250, 205 },
+ { "LemonChiffon", 255, 250, 205 },
+ { "LemonChiffon1", 255, 250, 205 },
+ { "LemonChiffon2", 238, 233, 191 },
+ { "LemonChiffon3", 205, 201, 165 },
+ { "LemonChiffon4", 139, 137, 112 },
+ { "light blue", 173, 216, 230 },
+ { "light coral", 240, 128, 128 },
+ { "light cyan", 224, 255, 255 },
+ { "light goldenrod", 238, 221, 130 },
+ { "light goldenrod yellow", 250, 250, 210 },
+ { "light gray", 211, 211, 211 },
+ { "light green", 144, 238, 144 },
+ { "light grey", 211, 211, 211 },
+ { "light pink", 255, 182, 193 },
+ { "light salmon", 255, 160, 122 },
+ { "light sea green", 32, 178, 170 },
+ { "light sky blue", 135, 206, 250 },
+ { "light slate blue", 132, 112, 255 },
+ { "light slate gray", 119, 136, 153 },
+ { "light slate grey", 119, 136, 153 },
+ { "light steel blue", 176, 196, 222 },
+ { "light yellow", 255, 255, 224 },
+ { "LightBlue", 173, 216, 230 },
+ { "LightBlue1", 191, 239, 255 },
+ { "LightBlue2", 178, 223, 238 },
+ { "LightBlue3", 154, 192, 205 },
+ { "LightBlue4", 104, 131, 139 },
+ { "LightCoral", 240, 128, 128 },
+ { "LightCyan", 224, 255, 255 },
+ { "LightCyan1", 224, 255, 255 },
+ { "LightCyan2", 209, 238, 238 },
+ { "LightCyan3", 180, 205, 205 },
+ { "LightCyan4", 122, 139, 139 },
+ { "LightGoldenrod", 238, 221, 130 },
+ { "LightGoldenrod1", 255, 236, 139 },
+ { "LightGoldenrod2", 238, 220, 130 },
+ { "LightGoldenrod3", 205, 190, 112 },
+ { "LightGoldenrod4", 139, 129, 76 },
+ { "LightGoldenrodYellow", 250, 250, 210 },
+ { "LightGray", 211, 211, 211 },
+ { "LightGreen", 144, 238, 144 },
+ { "LightGrey", 211, 211, 211 },
+ { "LightPink", 255, 182, 193 },
+ { "LightPink1", 255, 174, 185 },
+ { "LightPink2", 238, 162, 173 },
+ { "LightPink3", 205, 140, 149 },
+ { "LightPink4", 139, 95, 101 },
+ { "LightSalmon", 255, 160, 122 },
+ { "LightSalmon1", 255, 160, 122 },
+ { "LightSalmon2", 238, 149, 114 },
+ { "LightSalmon3", 205, 129, 98 },
+ { "LightSalmon4", 139, 87, 66 },
+ { "LightSeaGreen", 32, 178, 170 },
+ { "LightSkyBlue", 135, 206, 250 },
+ { "LightSkyBlue1", 176, 226, 255 },
+ { "LightSkyBlue2", 164, 211, 238 },
+ { "LightSkyBlue3", 141, 182, 205 },
+ { "LightSkyBlue4", 96, 123, 139 },
+ { "LightSlateBlue", 132, 112, 255 },
+ { "LightSlateGray", 119, 136, 153 },
+ { "LightSlateGrey", 119, 136, 153 },
+ { "LightSteelBlue", 176, 196, 222 },
+ { "LightSteelBlue1", 202, 225, 255 },
+ { "LightSteelBlue2", 188, 210, 238 },
+ { "LightSteelBlue3", 162, 181, 205 },
+ { "LightSteelBlue4", 110, 123, 139 },
+ { "LightYellow", 255, 255, 224 },
+ { "LightYellow1", 255, 255, 224 },
+ { "LightYellow2", 238, 238, 209 },
+ { "LightYellow3", 205, 205, 180 },
+ { "LightYellow4", 139, 139, 122 },
+ { "lime green", 50, 205, 50 },
+ { "LimeGreen", 50, 205, 50 },
+ { "linen", 250, 240, 230 },
+ { "magenta", 255, 0, 255 },
+ { "magenta1", 255, 0, 255 },
+ { "magenta2", 238, 0, 238 },
+ { "magenta3", 205, 0, 205 },
+ { "magenta4", 139, 0, 139 },
+ { "maroon", 176, 48, 96 },
+ { "maroon1", 255, 52, 179 },
+ { "maroon2", 238, 48, 167 },
+ { "maroon3", 205, 41, 144 },
+ { "maroon4", 139, 28, 98 },
+ { "medium aquamarine", 102, 205, 170 },
+ { "medium blue", 0, 0, 205 },
+ { "medium orchid", 186, 85, 211 },
+ { "medium purple", 147, 112, 219 },
+ { "medium sea green", 60, 179, 113 },
+ { "medium slate blue", 123, 104, 238 },
+ { "medium spring green", 0, 250, 154 },
+ { "medium turquoise", 72, 209, 204 },
+ { "medium violet red", 199, 21, 133 },
+ { "MediumAquamarine", 102, 205, 170 },
+ { "MediumBlue", 0, 0, 205 },
+ { "MediumOrchid", 186, 85, 211 },
+ { "MediumOrchid1", 224, 102, 255 },
+ { "MediumOrchid2", 209, 95, 238 },
+ { "MediumOrchid3", 180, 82, 205 },
+ { "MediumOrchid4", 122, 55, 139 },
+ { "MediumPurple", 147, 112, 219 },
+ { "MediumPurple1", 171, 130, 255 },
+ { "MediumPurple2", 159, 121, 238 },
+ { "MediumPurple3", 137, 104, 205 },
+ { "MediumPurple4", 93, 71, 139 },
+ { "MediumSeaGreen", 60, 179, 113 },
+ { "MediumSlateBlue", 123, 104, 238 },
+ { "MediumSpringGreen", 0, 250, 154 },
+ { "MediumTurquoise", 72, 209, 204 },
+ { "MediumVioletRed", 199, 21, 133 },
+ { "midnight blue", 25, 25, 112 },
+ { "MidnightBlue", 25, 25, 112 },
+ { "mint cream", 245, 255, 250 },
+ { "MintCream", 245, 255, 250 },
+ { "misty rose", 255, 228, 225 },
+ { "MistyRose", 255, 228, 225 },
+ { "MistyRose1", 255, 228, 225 },
+ { "MistyRose2", 238, 213, 210 },
+ { "MistyRose3", 205, 183, 181 },
+ { "MistyRose4", 139, 125, 123 },
+ { "moccasin", 255, 228, 181 },
+ { "navajo white", 255, 222, 173 },
+ { "NavajoWhite", 255, 222, 173 },
+ { "NavajoWhite1", 255, 222, 173 },
+ { "NavajoWhite2", 238, 207, 161 },
+ { "NavajoWhite3", 205, 179, 139 },
+ { "NavajoWhite4", 139, 121, 94 },
+ { "navy", 0, 0, 128 },
+ { "navy blue", 0, 0, 128 },
+ { "NavyBlue", 0, 0, 128 },
+ { "old lace", 253, 245, 230 },
+ { "OldLace", 253, 245, 230 },
+ { "olive drab", 107, 142, 35 },
+ { "OliveDrab", 107, 142, 35 },
+ { "OliveDrab1", 192, 255, 62 },
+ { "OliveDrab2", 179, 238, 58 },
+ { "OliveDrab3", 154, 205, 50 },
+ { "OliveDrab4", 105, 139, 34 },
+ { "orange", 255, 165, 0 },
+ { "orange red", 255, 69, 0 },
+ { "orange1", 255, 165, 0 },
+ { "orange2", 238, 154, 0 },
+ { "orange3", 205, 133, 0 },
+ { "orange4", 139, 90, 0 },
+ { "OrangeRed", 255, 69, 0 },
+ { "OrangeRed1", 255, 69, 0 },
+ { "OrangeRed2", 238, 64, 0 },
+ { "OrangeRed3", 205, 55, 0 },
+ { "OrangeRed4", 139, 37, 0 },
+ { "orchid", 218, 112, 214 },
+ { "orchid1", 255, 131, 250 },
+ { "orchid2", 238, 122, 233 },
+ { "orchid3", 205, 105, 201 },
+ { "orchid4", 139, 71, 137 },
+ { "pale goldenrod", 238, 232, 170 },
+ { "pale green", 152, 251, 152 },
+ { "pale turquoise", 175, 238, 238 },
+ { "pale violet red", 219, 112, 147 },
+ { "PaleGoldenrod", 238, 232, 170 },
+ { "PaleGreen", 152, 251, 152 },
+ { "PaleGreen1", 154, 255, 154 },
+ { "PaleGreen2", 144, 238, 144 },
+ { "PaleGreen3", 124, 205, 124 },
+ { "PaleGreen4", 84, 139, 84 },
+ { "PaleTurquoise", 175, 238, 238 },
+ { "PaleTurquoise1", 187, 255, 255 },
+ { "PaleTurquoise2", 174, 238, 238 },
+ { "PaleTurquoise3", 150, 205, 205 },
+ { "PaleTurquoise4", 102, 139, 139 },
+ { "PaleVioletRed", 219, 112, 147 },
+ { "PaleVioletRed1", 255, 130, 171 },
+ { "PaleVioletRed2", 238, 121, 159 },
+ { "PaleVioletRed3", 205, 104, 137 },
+ { "PaleVioletRed4", 139, 71, 93 },
+ { "papaya whip", 255, 239, 213 },
+ { "PapayaWhip", 255, 239, 213 },
+ { "peach puff", 255, 218, 185 },
+ { "PeachPuff", 255, 218, 185 },
+ { "PeachPuff1", 255, 218, 185 },
+ { "PeachPuff2", 238, 203, 173 },
+ { "PeachPuff3", 205, 175, 149 },
+ { "PeachPuff4", 139, 119, 101 },
+ { "peru", 205, 133, 63 },
+ { "pink", 255, 192, 203 },
+ { "pink1", 255, 181, 197 },
+ { "pink2", 238, 169, 184 },
+ { "pink3", 205, 145, 158 },
+ { "pink4", 139, 99, 108 },
+ { "plum", 221, 160, 221 },
+ { "plum1", 255, 187, 255 },
+ { "plum2", 238, 174, 238 },
+ { "plum3", 205, 150, 205 },
+ { "plum4", 139, 102, 139 },
+ { "powder blue", 176, 224, 230 },
+ { "PowderBlue", 176, 224, 230 },
+ { "purple", 160, 32, 240 },
+ { "purple1", 155, 48, 255 },
+ { "purple2", 145, 44, 238 },
+ { "purple3", 125, 38, 205 },
+ { "purple4", 85, 26, 139 },
+ { "red", 255, 0, 0 },
+ { "red1", 255, 0, 0 },
+ { "red2", 238, 0, 0 },
+ { "red3", 205, 0, 0 },
+ { "red4", 139, 0, 0 },
+ { "rosy brown", 188, 143, 143 },
+ { "RosyBrown", 188, 143, 143 },
+ { "RosyBrown1", 255, 193, 193 },
+ { "RosyBrown2", 238, 180, 180 },
+ { "RosyBrown3", 205, 155, 155 },
+ { "RosyBrown4", 139, 105, 105 },
+ { "royal blue", 65, 105, 225 },
+ { "RoyalBlue", 65, 105, 225 },
+ { "RoyalBlue1", 72, 118, 255 },
+ { "RoyalBlue2", 67, 110, 238 },
+ { "RoyalBlue3", 58, 95, 205 },
+ { "RoyalBlue4", 39, 64, 139 },
+ { "saddle brown", 139, 69, 19 },
+ { "SaddleBrown", 139, 69, 19 },
+ { "salmon", 250, 128, 114 },
+ { "salmon1", 255, 140, 105 },
+ { "salmon2", 238, 130, 98 },
+ { "salmon3", 205, 112, 84 },
+ { "salmon4", 139, 76, 57 },
+ { "sandy brown", 244, 164, 96 },
+ { "SandyBrown", 244, 164, 96 },
+ { "sea green", 46, 139, 87 },
+ { "SeaGreen", 46, 139, 87 },
+ { "SeaGreen1", 84, 255, 159 },
+ { "SeaGreen2", 78, 238, 148 },
+ { "SeaGreen3", 67, 205, 128 },
+ { "SeaGreen4", 46, 139, 87 },
+ { "seashell", 255, 245, 238 },
+ { "seashell1", 255, 245, 238 },
+ { "seashell2", 238, 229, 222 },
+ { "seashell3", 205, 197, 191 },
+ { "seashell4", 139, 134, 130 },
+ { "sienna", 160, 82, 45 },
+ { "sienna1", 255, 130, 71 },
+ { "sienna2", 238, 121, 66 },
+ { "sienna3", 205, 104, 57 },
+ { "sienna4", 139, 71, 38 },
+ { "sky blue", 135, 206, 235 },
+ { "SkyBlue", 135, 206, 235 },
+ { "SkyBlue1", 135, 206, 255 },
+ { "SkyBlue2", 126, 192, 238 },
+ { "SkyBlue3", 108, 166, 205 },
+ { "SkyBlue4", 74, 112, 139 },
+ { "slate blue", 106, 90, 205 },
+ { "slate gray", 112, 128, 144 },
+ { "slate grey", 112, 128, 144 },
+ { "SlateBlue", 106, 90, 205 },
+ { "SlateBlue1", 131, 111, 255 },
+ { "SlateBlue2", 122, 103, 238 },
+ { "SlateBlue3", 105, 89, 205 },
+ { "SlateBlue4", 71, 60, 139 },
+ { "SlateGray", 112, 128, 144 },
+ { "SlateGray1", 198, 226, 255 },
+ { "SlateGray2", 185, 211, 238 },
+ { "SlateGray3", 159, 182, 205 },
+ { "SlateGray4", 108, 123, 139 },
+ { "SlateGrey", 112, 128, 144 },
+ { "snow", 255, 250, 250 },
+ { "snow1", 255, 250, 250 },
+ { "snow2", 238, 233, 233 },
+ { "snow3", 205, 201, 201 },
+ { "snow4", 139, 137, 137 },
+ { "spring green", 0, 255, 127 },
+ { "SpringGreen", 0, 255, 127 },
+ { "SpringGreen1", 0, 255, 127 },
+ { "SpringGreen2", 0, 238, 118 },
+ { "SpringGreen3", 0, 205, 102 },
+ { "SpringGreen4", 0, 139, 69 },
+ { "steel blue", 70, 130, 180 },
+ { "SteelBlue", 70, 130, 180 },
+ { "SteelBlue1", 99, 184, 255 },
+ { "SteelBlue2", 92, 172, 238 },
+ { "SteelBlue3", 79, 148, 205 },
+ { "SteelBlue4", 54, 100, 139 },
+ { "tan", 210, 180, 140 },
+ { "tan1", 255, 165, 79 },
+ { "tan2", 238, 154, 73 },
+ { "tan3", 205, 133, 63 },
+ { "tan4", 139, 90, 43 },
+ { "thistle", 216, 191, 216 },
+ { "thistle1", 255, 225, 255 },
+ { "thistle2", 238, 210, 238 },
+ { "thistle3", 205, 181, 205 },
+ { "thistle4", 139, 123, 139 },
+ { "tomato", 255, 99, 71 },
+ { "tomato1", 255, 99, 71 },
+ { "tomato2", 238, 92, 66 },
+ { "tomato3", 205, 79, 57 },
+ { "tomato4", 139, 54, 38 },
+ { "turquoise", 64, 224, 208 },
+ { "turquoise1", 0, 245, 255 },
+ { "turquoise2", 0, 229, 238 },
+ { "turquoise3", 0, 197, 205 },
+ { "turquoise4", 0, 134, 139 },
+ { "violet", 238, 130, 238 },
+ { "violet red", 208, 32, 144 },
+ { "VioletRed", 208, 32, 144 },
+ { "VioletRed1", 255, 62, 150 },
+ { "VioletRed2", 238, 58, 140 },
+ { "VioletRed3", 205, 50, 120 },
+ { "VioletRed4", 139, 34, 82 },
+ { "wheat", 245, 222, 179 },
+ { "wheat1", 255, 231, 186 },
+ { "wheat2", 238, 216, 174 },
+ { "wheat3", 205, 186, 150 },
+ { "wheat4", 139, 126, 102 },
+ { "white", 255, 255, 255 },
+ { "white smoke", 245, 245, 245 },
+ { "WhiteSmoke", 245, 245, 245 },
+ { "yellow", 255, 255, 0 },
+ { "yellow green", 154, 205, 50 },
+ { "yellow1", 255, 255, 0 },
+ { "yellow2", 238, 238, 0 },
+ { "yellow3", 205, 205, 0 },
+ { "yellow4", 139, 139, 0 },
+ { "YellowGreen", 154, 205, 50 },
+ { NULL, 0, 0, 0 }
};
@@ -887,7 +887,7 @@ XParseColor(display, map, spec, colorPtr)
char fmt[16];
int i, red, green, blue;
- if ((i = strlen(spec+1))%3) {
+ if ((i = (int) strlen(spec+1))%3) {
return 0;
}
i /= 3;
@@ -912,5 +912,3 @@ XParseColor(display, map, spec, colorPtr)
colorPtr->pad = 0;
return 1;
}
-
-
diff --git a/tk/xlib/xdraw.c b/tk/xlib/xdraw.c
index 05738d068b4..2655915b3c2 100644
--- a/tk/xlib/xdraw.c
+++ b/tk/xlib/xdraw.c
@@ -80,4 +80,3 @@ XFillRectangle(display, d, gc, x, y, width, height)
rectangle.height = height;
XFillRectangles(display, d, gc, &rectangle, 1);
}
-
diff --git a/tk/xlib/xgc.c b/tk/xlib/xgc.c
index f40ebc4197b..447c05ffb40 100644
--- a/tk/xlib/xgc.c
+++ b/tk/xlib/xgc.c
@@ -14,13 +14,20 @@
#include <tkInt.h>
+#if !defined(MAC_TCL) && !defined(MAC_OSX_TK)
+# include <X11/Xlib.h>
+#endif
#ifdef MAC_TCL
# include <Xlib.h>
# include <X.h>
# define Cursor XCursor
# define Region XRegion
-#else
+#endif
+#ifdef MAC_OSX_TK
# include <X11/Xlib.h>
+# include <X11/X.h>
+# define Cursor XCursor
+# define Region XRegion
#endif
@@ -438,7 +445,7 @@ XDrawPoints(display, d, gc, points, npoints, mode)
}
}
-#ifndef MAC_TCL
+#if !defined(MAC_TCL) && !defined(MAC_OSX_TK)
void
XDrawSegments(display, d, gc, segments, nsegments)
Display* display;
@@ -542,4 +549,3 @@ XUndefineCursor(display, w)
Window w;
{
}
-
diff --git a/tk/xlib/ximage.c b/tk/xlib/ximage.c
index 512302e4ed0..e11ce67ce64 100644
--- a/tk/xlib/ximage.c
+++ b/tk/xlib/ximage.c
@@ -47,7 +47,7 @@ XCreateBitmapFromData(display, d, data, width, height)
GC gc;
Pixmap pix;
- pix = Tk_GetPixmap(display, d, width, height, 1);
+ pix = Tk_GetPixmap(display, d, (int) width, (int) height, 1);
gc = XCreateGC(display, pix, 0, NULL);
if (gc == NULL) {
return None;
@@ -69,4 +69,3 @@ XCreateBitmapFromData(display, d, data, width, height)
XFreeGC(display, gc);
return pix;
}
-
diff --git a/tk/xlib/xutil.c b/tk/xlib/xutil.c
index 2ddbad6dba8..b98a6fdd48c 100644
--- a/tk/xlib/xutil.c
+++ b/tk/xlib/xutil.c
@@ -114,4 +114,3 @@ XGetVisualInfo(display, vinfo_mask, vinfo_template, nitems_return)
*nitems_return = 1;
return info;
}
-